예제 #1
0
int menu_entry_pathdir_set_value(uint32_t i, const char *s)
{
   const char *menu_label   = NULL;
   const char *menu_path    = NULL;
   rarch_setting_t *setting = NULL;
   menu_list_t *menu_list   = menu_list_get_ptr();

   menu_list_get_last_stack(menu_list,
         &menu_path, &menu_label, NULL, NULL);

   setting = menu_setting_find(menu_label);

   if (!setting)
      return -1;

   if (setting->type != ST_DIR)
      return -1;

   (void)s;
   setting_set_with_string_representation(setting, menu_path);

   menu_setting_generic(setting, false);

   menu_list_pop_stack_by_needle(menu_list, setting->name);

   return 0;
}
예제 #2
0
void menu_input_st_string_callback(void *userdata, const char *str)
{
   if (str && *str)
   {
      rarch_setting_t         *setting = NULL;
      const char                *label = NULL;
      global_t                 *global = global_get_ptr();

      menu_input_ctl(MENU_INPUT_CTL_KEYBOARD_LABEL_SETTING, &label);

      setting = menu_setting_find(label);

      if (setting)
      {
         menu_setting_set_with_string_representation(setting, str);
         menu_setting_generic(setting, false);
      }
      else
      {
         uint32_t hash_label = menu_hash_calculate(label);

         switch (hash_label)
         {
            case MENU_LABEL_VIDEO_SHADER_PRESET_SAVE_AS:
               menu_shader_manager_save_preset(str, false);
               break;
            case MENU_LABEL_CHEAT_FILE_SAVE_AS:
               cheat_manager_save(global->cheat, str);
               break;
         }
      }
   }

   menu_input_key_end_line();
}
예제 #3
0
void menu_input_st_string_callback(void *userdata, const char *str)
{
   menu_handle_t *menu = menu_driver_get_ptr();

   if (!menu)
      return;
 
   if (str && *str)
   {
      rarch_setting_t *current_setting = NULL;
      global_t *global = global_get_ptr();

      if ((current_setting = (rarch_setting_t*)
               setting_find_setting(
                  menu->list_settings, menu->keyboard.label_setting)))
      {
         strlcpy(current_setting->value.string, str, current_setting->size);
         menu_setting_generic(current_setting);
      }
      else
      {
         if (!strcmp(menu->keyboard.label_setting, "video_shader_preset_save_as"))
            menu_shader_manager_save_preset(str, false);
         else if (!strcmp(menu->keyboard.label_setting, "remap_file_save_as"))
            input_remapping_save_file(str);
         else if (!strcmp(menu->keyboard.label_setting, "cheat_file_save_as"))
            cheat_manager_save(global->cheat, str);
      }
   }

   menu_input_key_end_line();
}
예제 #4
0
static int action_ok_path_use_directory(const char *path,
      const char *label, unsigned type, size_t idx)
{
   const char *menu_label   = NULL;
   const char *menu_path    = NULL;
   rarch_setting_t *setting = NULL;
   menu_handle_t *menu = menu_driver_get_ptr();
   if (!menu)
      return -1;

   menu_list_get_last_stack(menu->menu_list,
         &menu_path, &menu_label, NULL);

   setting = menu_setting_find(menu_label);

   if (!setting)
      return -1;

   if (setting->type != ST_DIR)
      return -1;

   strlcpy(setting->value.string, menu_path, setting->size);
   menu_setting_generic(setting);
   menu_list_pop_stack_by_needle(menu->menu_list, setting->name);

   return 0;
}
예제 #5
0
int menu_entry_pathdir_set_value(uint32_t i, const char *s)
{
   const char *menu_path     = NULL;
   menu_file_list_cbs_t *cbs = menu_entries_get_last_stack_actiondata();

   menu_entries_get_last_stack(&menu_path, NULL, NULL, NULL);

   if (!cbs || !cbs->setting)
      return -1;

   if (menu_setting_get_type(cbs->setting) != ST_DIR)
      return -1;

   menu_setting_set_with_string_representation(cbs->setting, menu_path);
   menu_setting_generic(cbs->setting, false);

   menu_entries_flush_stack(NULL, 49);

   return 0;
}
예제 #6
0
void menu_input_st_string_callback(void *userdata, const char *str)
{
   menu_input_t *menu_input = menu_input_get_ptr();

   if (!menu_input)
      return;

   if (str && *str)
   {
      global_t *global = global_get_ptr();
      rarch_setting_t *current_setting = menu_setting_find(menu_input->keyboard.label_setting);

      if (current_setting)
      {
         setting_set_with_string_representation(current_setting, str);
         menu_setting_generic(current_setting, false);
      }
      else
      {
         uint32_t hash_label = menu_hash_calculate(menu_input->keyboard.label_setting);

         switch (hash_label)
         {
            case MENU_LABEL_VIDEO_SHADER_PRESET_SAVE_AS:
               menu_shader_manager_save_preset(str, false);
               break;
            case MENU_LABEL_REMAP_FILE_SAVE_AS:
               input_remapping_save_file(str);
               break;
            case MENU_LABEL_CHEAT_FILE_SAVE_AS:
               cheat_manager_save(global->cheat, str);
               break;
         }
      }
   }

   menu_input_key_end_line();
}
예제 #7
0
int menu_action_setting_set_current_string(
      rarch_setting_t *setting, const char *str)
{
   strlcpy(setting->value.string, str, setting->size);
   return menu_setting_generic(setting);
}
예제 #8
0
static int menu_action_setting_set_current_string_path(
      rarch_setting_t *setting, const char *dir, const char *path)
{
   fill_pathname_join(setting->value.string, dir, path, setting->size);
   return menu_setting_generic(setting);
}
예제 #9
0
int menu_setting_handler(rarch_setting_t *setting, unsigned action)
{
   if (setting_handler(setting, action) == 0)
      return menu_setting_generic(setting);
   return -1;
}