mirror of
https://github.com/libretro/RetroArch
synced 2025-04-18 05:43:34 +00:00
Dehardcode more strings, can get rid of some TODOS/FIXMEs
This commit is contained in:
parent
dcbd68b11b
commit
0eb467e04d
46
command.c
46
command.c
@ -1451,7 +1451,8 @@ static bool command_event_save_core_config(void)
|
|||||||
&& path_file_exists(settings->path.libretro))
|
&& path_file_exists(settings->path.libretro))
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
RARCH_LOG("Using core name for new config\n");
|
RARCH_LOG("%s\n", msg_hash_to_str(MSG_USING_CORE_NAME_FOR_NEW_CONFIG));
|
||||||
|
|
||||||
/* In case of collision, find an alternative name. */
|
/* In case of collision, find an alternative name. */
|
||||||
for (i = 0; i < 16; i++)
|
for (i = 0; i < 16; i++)
|
||||||
{
|
{
|
||||||
@ -1483,10 +1484,11 @@ static bool command_event_save_core_config(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Fallback to system time... */
|
|
||||||
if (!found_path)
|
if (!found_path)
|
||||||
{
|
{
|
||||||
RARCH_WARN("Cannot infer new config path. Use current time.\n");
|
/* Fallback to system time... */
|
||||||
|
RARCH_WARN("%s\n",
|
||||||
|
msg_hash_to_str(MSG_CANNOT_INFER_NEW_CONFIG_PATH));
|
||||||
fill_dated_filename(config_name,
|
fill_dated_filename(config_name,
|
||||||
file_path_str(FILE_PATH_CONFIG_EXTENSION),
|
file_path_str(FILE_PATH_CONFIG_EXTENSION),
|
||||||
sizeof(config_name));
|
sizeof(config_name));
|
||||||
@ -1494,10 +1496,11 @@ static bool command_event_save_core_config(void)
|
|||||||
sizeof(config_path));
|
sizeof(config_path));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Overrides block config file saving, make it appear as overrides
|
|
||||||
* weren't enabled for a manual save */
|
|
||||||
if (runloop_ctl(RUNLOOP_CTL_IS_OVERRIDES_ACTIVE, NULL))
|
if (runloop_ctl(RUNLOOP_CTL_IS_OVERRIDES_ACTIVE, NULL))
|
||||||
{
|
{
|
||||||
|
/* Overrides block config file saving,
|
||||||
|
* make it appear as overrides weren't enabled
|
||||||
|
* for a manual save. */
|
||||||
runloop_ctl(RUNLOOP_CTL_UNSET_OVERRIDES_ACTIVE, NULL);
|
runloop_ctl(RUNLOOP_CTL_UNSET_OVERRIDES_ACTIVE, NULL);
|
||||||
overrides_active = true;
|
overrides_active = true;
|
||||||
}
|
}
|
||||||
@ -1506,13 +1509,16 @@ static bool command_event_save_core_config(void)
|
|||||||
{
|
{
|
||||||
strlcpy(global->path.config, config_path,
|
strlcpy(global->path.config, config_path,
|
||||||
sizeof(global->path.config));
|
sizeof(global->path.config));
|
||||||
snprintf(msg, sizeof(msg), "Saved new config to \"%s\".",
|
snprintf(msg, sizeof(msg), "%s \"%s\".",
|
||||||
|
msg_hash_to_str(MSG_SAVED_NEW_CONFIG_TO),
|
||||||
config_path);
|
config_path);
|
||||||
RARCH_LOG("%s\n", msg);
|
RARCH_LOG("%s\n", msg);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
snprintf(msg, sizeof(msg), "Failed saving config to \"%s\".",
|
snprintf(msg, sizeof(msg),
|
||||||
|
"%s \"%s\".",
|
||||||
|
msg_hash_to_str(MSG_FAILED_SAVING_CONFIG_TO),
|
||||||
config_path);
|
config_path);
|
||||||
RARCH_ERR("%s\n", msg);
|
RARCH_ERR("%s\n", msg);
|
||||||
}
|
}
|
||||||
@ -1555,13 +1561,15 @@ void command_event_save_current_config(void)
|
|||||||
|
|
||||||
if (ret)
|
if (ret)
|
||||||
{
|
{
|
||||||
snprintf(msg, sizeof(msg), "Saved new config to \"%s\".",
|
snprintf(msg, sizeof(msg), "%s \"%s\".",
|
||||||
|
msg_hash_to_str(MSG_SAVED_NEW_CONFIG_TO),
|
||||||
global->path.config);
|
global->path.config);
|
||||||
RARCH_LOG("%s\n", msg);
|
RARCH_LOG("%s\n", msg);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
snprintf(msg, sizeof(msg), "Failed saving config to \"%s\".",
|
snprintf(msg, sizeof(msg), "%s \"%s\".",
|
||||||
|
msg_hash_to_str(MSG_FAILED_SAVING_CONFIG_TO),
|
||||||
global->path.config);
|
global->path.config);
|
||||||
RARCH_ERR("%s\n", msg);
|
RARCH_ERR("%s\n", msg);
|
||||||
}
|
}
|
||||||
@ -1603,9 +1611,8 @@ static void command_event_undo_save_state(char *s, size_t len)
|
|||||||
{
|
{
|
||||||
if (content_undo_save_buf_is_empty())
|
if (content_undo_save_buf_is_empty())
|
||||||
{
|
{
|
||||||
/* TODO/FIXME - use msg_hash_to_str here */
|
strlcpy(s,
|
||||||
snprintf(s, len, "%s",
|
msg_hash_to_str(MSG_NO_SAVE_STATE_HAS_BEEN_OVERWRITTEN_YET), len);
|
||||||
"No save state has been overwritten yet.");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1617,9 +1624,7 @@ static void command_event_undo_save_state(char *s, size_t len)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO/FIXME - use msg_hash_to_str here */
|
strlcpy(s, msg_hash_to_str(MSG_RESTORED_OLD_SAVE_STATE), len);
|
||||||
snprintf(s, len, "%s",
|
|
||||||
"Restored old save state.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1655,9 +1660,9 @@ static void command_event_undo_load_state(char *s, size_t len)
|
|||||||
|
|
||||||
if (content_undo_load_buf_is_empty())
|
if (content_undo_load_buf_is_empty())
|
||||||
{
|
{
|
||||||
/* TODO/FIXME - use msg_hash_to_str here */
|
strlcpy(s,
|
||||||
snprintf(s, len, "%s",
|
msg_hash_to_str(MSG_NO_STATE_HAS_BEEN_LOADED_YET),
|
||||||
"No state has been loaded yet.");
|
len);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1669,9 +1674,8 @@ static void command_event_undo_load_state(char *s, size_t len)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO/FIXME - use msg_hash_to_str here */
|
strlcpy(s,
|
||||||
snprintf(s, len, "%s",
|
msg_hash_to_str(MSG_UNDID_LOAD_STATE), len);
|
||||||
"Undid load state.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void command_event_main_state(unsigned cmd)
|
static void command_event_main_state(unsigned cmd)
|
||||||
|
@ -2052,6 +2052,20 @@ const char *msg_hash_to_str_us(enum msg_hash_enums msg)
|
|||||||
return "Failed to send nickname to client.";
|
return "Failed to send nickname to client.";
|
||||||
case MSG_FAILED_TO_GENERATE_BSV_HEADER:
|
case MSG_FAILED_TO_GENERATE_BSV_HEADER:
|
||||||
return "Failed to generate BSV header.";
|
return "Failed to generate BSV header.";
|
||||||
|
case MSG_USING_CORE_NAME_FOR_NEW_CONFIG:
|
||||||
|
return "Using core name for new config.";
|
||||||
|
case MSG_CANNOT_INFER_NEW_CONFIG_PATH:
|
||||||
|
return "Cannot infer new config path. Use current time.";
|
||||||
|
case MSG_NO_STATE_HAS_BEEN_LOADED_YET:
|
||||||
|
return "No state has been loaded yet.";
|
||||||
|
case MSG_NO_SAVE_STATE_HAS_BEEN_OVERWRITTEN_YET:
|
||||||
|
return "No save state has been overwritten yet.";
|
||||||
|
case MSG_RESTORED_OLD_SAVE_STATE:
|
||||||
|
return "Restored old save state.";
|
||||||
|
case MSG_SAVED_NEW_CONFIG_TO:
|
||||||
|
return "Saved new config to";
|
||||||
|
case MSG_FAILED_SAVING_CONFIG_TO:
|
||||||
|
return "Failed saving config to";
|
||||||
case MSG_FAILED_TO_SEND_HEADER_TO_CLIENT:
|
case MSG_FAILED_TO_SEND_HEADER_TO_CLIENT:
|
||||||
return "Failed to send header to client.";
|
return "Failed to send header to client.";
|
||||||
case MSG_FAILED_TO_RECEIVE_NICKNAME_SIZE_FROM_HOST:
|
case MSG_FAILED_TO_RECEIVE_NICKNAME_SIZE_FROM_HOST:
|
||||||
|
@ -118,6 +118,14 @@ enum msg_hash_enums
|
|||||||
MSG_LOADING,
|
MSG_LOADING,
|
||||||
MSG_CONNECTED_TO,
|
MSG_CONNECTED_TO,
|
||||||
MSG_FAILED_TO_LOAD,
|
MSG_FAILED_TO_LOAD,
|
||||||
|
MSG_USING_CORE_NAME_FOR_NEW_CONFIG,
|
||||||
|
MSG_SAVED_NEW_CONFIG_TO,
|
||||||
|
MSG_FAILED_SAVING_CONFIG_TO,
|
||||||
|
MSG_RESTORED_OLD_SAVE_STATE,
|
||||||
|
MSG_NO_STATE_HAS_BEEN_LOADED_YET,
|
||||||
|
MSG_NO_SAVE_STATE_HAS_BEEN_OVERWRITTEN_YET,
|
||||||
|
MSG_CANNOT_INFER_NEW_CONFIG_PATH,
|
||||||
|
MSG_UNDID_LOAD_STATE,
|
||||||
MSG_FAILED_TO_ACCEPT_INCOMING_SPECTATOR,
|
MSG_FAILED_TO_ACCEPT_INCOMING_SPECTATOR,
|
||||||
MSG_FAILED_TO_GET_NICKNAME_FROM_CLIENT,
|
MSG_FAILED_TO_GET_NICKNAME_FROM_CLIENT,
|
||||||
MSG_FAILED_TO_SEND_NICKNAME_TO_CLIENT,
|
MSG_FAILED_TO_SEND_NICKNAME_TO_CLIENT,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user