Report errors from save/load, disable loads under hard cheevos
This commit is contained in:
parent
6235f3138b
commit
fb94043d48
14
command.c
14
command.c
|
@ -812,25 +812,31 @@ bool command_play_replay_slot(command_t *cmd, const char *arg)
|
|||
bool command_save_savefiles(command_t *cmd, const char* arg)
|
||||
{
|
||||
char reply[4];
|
||||
bool ret;
|
||||
size_t _len = strlcpy(reply, "OK", sizeof(reply));
|
||||
reply[ _len] = '\n';
|
||||
reply[++_len] = '\0';
|
||||
/* In the future, this should probably send each saved file path
|
||||
to the replier. */
|
||||
command_event(CMD_EVENT_SAVE_FILES, NULL);
|
||||
ret = command_event(CMD_EVENT_SAVE_FILES, NULL);
|
||||
if (!ret)
|
||||
strlcpy(reply, "NO", sizeof(reply));
|
||||
cmd->replier(cmd, reply, _len);
|
||||
return true;
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool command_load_savefiles(command_t *cmd, const char* arg)
|
||||
{
|
||||
char reply[4];
|
||||
bool ret;
|
||||
size_t _len = strlcpy(reply, "OK", sizeof(reply));
|
||||
reply[ _len] = '\n';
|
||||
reply[++_len] = '\0';
|
||||
command_event(CMD_EVENT_LOAD_FILES, NULL);
|
||||
ret = command_event(CMD_EVENT_LOAD_FILES, NULL);
|
||||
if (!ret)
|
||||
strlcpy(reply, "NO", sizeof(reply));
|
||||
cmd->replier(cmd, reply, _len);
|
||||
return true;
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if defined(HAVE_CHEEVOS)
|
||||
|
|
17
retroarch.c
17
retroarch.c
|
@ -3021,10 +3021,18 @@ bool command_event(enum event_command cmd, void *data)
|
|||
switch (cmd)
|
||||
{
|
||||
case CMD_EVENT_LOAD_FILES:
|
||||
event_load_save_files(runloop_st->flags & RUNLOOP_FLAG_IS_SRAM_LOAD_DISABLED);
|
||||
break;
|
||||
#ifdef HAVE_CHEEVOS
|
||||
if (rcheevos_hardcore_active())
|
||||
{
|
||||
const char *_msg = msg_hash_to_str(MSG_CHEEVOS_LOAD_SAVEFILE_PREVENTED_BY_HARDCORE_MODE);
|
||||
runloop_msg_queue_push(_msg, strlen(_msg), 0, 180, true, NULL,
|
||||
MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_WARNING);
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
return event_load_save_files(runloop_st->flags & RUNLOOP_FLAG_IS_SRAM_LOAD_DISABLED);
|
||||
case CMD_EVENT_SAVE_FILES:
|
||||
event_save_files(
|
||||
return event_save_files(
|
||||
runloop_st->flags & RUNLOOP_FLAG_USE_SRAM,
|
||||
#if defined(HAVE_ZLIB)
|
||||
settings->bools.save_file_compression,
|
||||
|
@ -3036,8 +3044,7 @@ bool command_event(enum event_command cmd, void *data)
|
|||
#else
|
||||
NULL
|
||||
#endif
|
||||
);
|
||||
break;
|
||||
);
|
||||
case CMD_EVENT_OVERLAY_UNLOAD:
|
||||
#ifdef HAVE_OVERLAY
|
||||
input_overlay_unload();
|
||||
|
|
Loading…
Reference in New Issue