(cheat_manager) No more dependency on configuration.h
This commit is contained in:
parent
d766a5b71e
commit
ef7b9830db
|
@ -43,7 +43,6 @@
|
|||
#include "cheat_manager.h"
|
||||
|
||||
#include "msg_hash.h"
|
||||
#include "configuration.h"
|
||||
#include "retroarch.h"
|
||||
#include "runloop.h"
|
||||
#include "dynamic.h"
|
||||
|
@ -632,6 +631,7 @@ void cheat_manager_update(cheat_manager_t *handle, unsigned handle_idx)
|
|||
}
|
||||
|
||||
void cheat_manager_toggle_index(bool apply_cheats_after_toggle,
|
||||
bool notification_show_cheats_applied,
|
||||
unsigned i)
|
||||
{
|
||||
cheat_manager_t *cheat_st = &cheat_manager_state;
|
||||
|
@ -642,17 +642,17 @@ void cheat_manager_toggle_index(bool apply_cheats_after_toggle,
|
|||
cheat_manager_update(cheat_st, i);
|
||||
|
||||
if (apply_cheats_after_toggle)
|
||||
cheat_manager_apply_cheats(config_get_ptr()->bools.notification_show_cheats_applied);
|
||||
cheat_manager_apply_cheats(notification_show_cheats_applied);
|
||||
}
|
||||
|
||||
void cheat_manager_toggle(void)
|
||||
void cheat_manager_toggle(bool notification_show_cheats_applied)
|
||||
{
|
||||
cheat_manager_t *cheat_st = &cheat_manager_state;
|
||||
if (!cheat_st->cheats || cheat_st->size == 0)
|
||||
return;
|
||||
|
||||
cheat_st->cheats[cheat_st->ptr].state ^= true;
|
||||
cheat_manager_apply_cheats(config_get_ptr()->bools.notification_show_cheats_applied);
|
||||
cheat_manager_apply_cheats(notification_show_cheats_applied);
|
||||
cheat_manager_update(cheat_st, cheat_st->ptr);
|
||||
}
|
||||
|
||||
|
|
|
@ -215,13 +215,14 @@ void cheat_manager_index_next(void);
|
|||
|
||||
void cheat_manager_index_prev(void);
|
||||
|
||||
void cheat_manager_toggle(void);
|
||||
void cheat_manager_toggle(bool notification_show_cheats_applied);
|
||||
|
||||
void cheat_manager_apply_cheats(bool notification_show_cheats_applied);
|
||||
|
||||
void cheat_manager_update(cheat_manager_t *handle, unsigned handle_idx);
|
||||
|
||||
void cheat_manager_toggle_index(bool apply_cheats_after_toggle,
|
||||
bool notification_show_cheats_applied,
|
||||
unsigned i);
|
||||
|
||||
unsigned cheat_manager_get_buf_size(void);
|
||||
|
|
|
@ -161,7 +161,9 @@ const char *cmd_cheat_get_code(unsigned index)
|
|||
|
||||
void cmd_cheat_toggle_index(bool apply_cheats_after_toggle, unsigned index)
|
||||
{
|
||||
cheat_manager_toggle_index(apply_cheats_after_toggle, index);
|
||||
cheat_manager_toggle_index(apply_cheats_after_toggle,
|
||||
config_get_ptr()->bools.notification_show_cheats_applied,
|
||||
index);
|
||||
}
|
||||
|
||||
bool cmd_cheat_get_code_state(unsigned index)
|
||||
|
|
|
@ -112,8 +112,8 @@ int generic_action_cheat_toggle(size_t idx, unsigned type, const char *label,
|
|||
settings_t *settings = config_get_ptr();
|
||||
bool apply_cheats_after_toggle = settings->bools.apply_cheats_after_toggle;
|
||||
|
||||
cheat_manager_toggle_index(
|
||||
apply_cheats_after_toggle,
|
||||
cheat_manager_toggle_index(apply_cheats_after_toggle,
|
||||
settings->bools.notification_show_cheats_applied,
|
||||
(unsigned)idx);
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -3019,7 +3019,7 @@ bool command_event(enum event_command cmd, void *data)
|
|||
break;
|
||||
case CMD_EVENT_CHEAT_TOGGLE:
|
||||
#ifdef HAVE_CHEATS
|
||||
cheat_manager_toggle();
|
||||
cheat_manager_toggle(settings->bools.notification_show_cheats_applied);
|
||||
#endif
|
||||
break;
|
||||
case CMD_EVENT_SHADER_NEXT:
|
||||
|
|
Loading…
Reference in New Issue