Пример #1
0
int menu_cbs_init_bind_deferred_push(menu_file_list_cbs_t *cbs,
                                     const char *path, const char *label, unsigned type, size_t idx,
                                     const char *elem0, const char *elem1,
                                     uint32_t label_hash, uint32_t menu_label_hash)
{
    settings_t *settings   = config_get_ptr();
    rarch_setting_t *setting = menu_setting_find(elem0);

    if (!cbs)
        return -1;

    cbs->action_deferred_push = deferred_push_default;

    if (setting)
    {
        uint32_t parent_group_hash = menu_hash_calculate(setting->parent_group);

        if ((parent_group_hash == MENU_VALUE_MAIN_MENU) && setting->type == ST_GROUP)
        {
            if (!settings->menu.collapse_subgroups_enable)
            {
                cbs->action_deferred_push = deferred_push_settings_subgroup;
                return 0;
            }
        }
    }

    if (menu_cbs_init_bind_deferred_push_compare_label(cbs, label, label_hash) == 0)
        return 0;

    if (menu_cbs_init_bind_deferred_push_compare_type(cbs, type, label_hash) == 0)
        return 0;

    return -1;
}
int menu_cbs_init_bind_deferred_push(menu_file_list_cbs_t *cbs,
      const char *path, const char *label, unsigned type, size_t idx,
      const char *elem0, const char *elem1,
      uint32_t label_hash, uint32_t menu_label_hash)
{
   settings_t *settings   = config_get_ptr();

   if (!cbs)
      return -1;

   BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_default);

   if (cbs->setting)
   {
      const char *parent_group   = menu_setting_get_parent_group(cbs->setting);
      uint32_t parent_group_hash = menu_hash_calculate(parent_group);

      if ((parent_group_hash == MENU_VALUE_MAIN_MENU) && menu_setting_get_type(cbs->setting) == ST_GROUP)
      {
         if (!settings->menu.collapse_subgroups_enable)
         {
            BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_settings_subgroup);
            return 0;
         }
      }
   }

   if (menu_cbs_init_bind_deferred_push_compare_label(cbs, label, label_hash) == 0)
      return 0;

   if (menu_cbs_init_bind_deferred_push_compare_type(cbs, type, label_hash) == 0)
      return 0;

   return -1;
}
Пример #3
0
int menu_cbs_init_bind_deferred_push(menu_file_list_cbs_t *cbs,
      const char *path, const char *label, unsigned type, size_t idx,
      const char *elem0, const char *elem1,
      uint32_t label_hash, uint32_t menu_label_hash)
{
   if (!cbs)
      return -1;

   BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_default);

   if (menu_cbs_init_bind_deferred_push_compare_label(cbs, label, label_hash) == 0)
      return 0;

   if (menu_cbs_init_bind_deferred_push_compare_type(cbs, type, label_hash) == 0)
      return 0;

   return -1;
}