Create EVENT_CMD_CHEATS_APPLY

This commit is contained in:
twinaphex 2015-09-02 01:10:44 +02:00
parent 1a54984fe9
commit bbf7e02139
3 changed files with 9 additions and 9 deletions

View File

@ -1187,6 +1187,12 @@ bool event_command(enum event_command cmd)
event_command(EVENT_CMD_CHEATS_DEINIT);
event_init_cheats();
break;
case EVENT_CMD_CHEATS_APPLY:
if (!global->cheat)
break;
cheat_manager_apply_cheats(global->cheat);
break;
case EVENT_CMD_REMAPPING_DEINIT:
break;
case EVENT_CMD_REMAPPING_INIT:

View File

@ -149,6 +149,8 @@ enum event_command
EVENT_CMD_CHEATS_INIT,
/* Deinitializes cheats. */
EVENT_CMD_CHEATS_DEINIT,
/* Apply cheats. */
EVENT_CMD_CHEATS_APPLY,
/* Deinitializes network system. */
EVENT_CMD_NETWORK_DEINIT,
/* Initializes network system. */

View File

@ -276,18 +276,10 @@ static int action_ok_playlist_entry(const char *path,
return -1;
}
static int action_ok_cheat_apply_changes(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
global_t *global = global_get_ptr();
cheat_manager_t *cheat = global->cheat;
if (!cheat)
return -1;
cheat_manager_apply_cheats(cheat);
event_command(EVENT_CMD_CHEATS_APPLY);
return 0;
}