Exposes functions for working with the localization of the combat mode.
More...
Go to the source code of this file.
|
enum | combat_mode_index {
MAIN_MENU_TITLE
, ABILITY_MENU_TITLE
, POTION_MENU_TITLE
, MAIN_MENU_OPTION1
,
MAIN_MENU_OPTION2
, ABILITY_FORMAT
, POTION_FORMAT
, PRESS_C_RETURN
,
NO_MORE_POTIONS
, ATTACK_SUCCESS
, ATTACK_MISS
, ATTACK_FAIL
,
POTION_USE
, MAX_COMBAT_MODE_STRINGS
} |
Exposes functions for working with the localization of the combat mode.
Definition in file combat_mode_local.h.
◆ combat_mode_index
Definition at line 8 of file combat_mode_local.h.
8 {
9 MAIN_MENU_TITLE,
10 ABILITY_MENU_TITLE,
11 POTION_MENU_TITLE,
12 MAIN_MENU_OPTION1,
13 MAIN_MENU_OPTION2,
14 ABILITY_FORMAT,
15 POTION_FORMAT,
16 PRESS_C_RETURN,
17 NO_MORE_POTIONS,
18 ATTACK_SUCCESS,
19 ATTACK_MISS,
20 ATTACK_FAIL,
21 POTION_USE,
22
23 MAX_COMBAT_MODE_STRINGS
24};
◆ update_combat_local()
void update_combat_local |
( |
void | | ) |
|
Updates the combat mode strings with localized versions.
- Note
- This function should be called after initializing the combat mode.
Definition at line 13 of file combat_mode_local.c.
13 {
14 for (int i = 0; i < MAX_COMBAT_MODE_STRINGS; i++) {
15 if (combat_mode_strings[i] != NULL) {
16 free(combat_mode_strings[i]);
17 }
18 }
19
20 combat_mode_strings[MAIN_MENU_TITLE] =
get_local_string(
"COMBAT.MAIN.MENU.TITLE");
21 combat_mode_strings[ABILITY_MENU_TITLE] =
get_local_string(
"COMBAT.ABILITY.MENU.TITLE");
22 combat_mode_strings[POTION_MENU_TITLE] =
get_local_string(
"COMBAT.POTION.MENU.TITLE");
23 combat_mode_strings[MAIN_MENU_OPTION1] =
get_local_string(
"COMBAT.USE.ABILITY");
24 combat_mode_strings[MAIN_MENU_OPTION2] =
get_local_string(
"COMBAT.USE.POTION");
25
26 combat_mode_strings[ABILITY_FORMAT] =
get_local_string(
"COMBAT.ABILITY.FORMAT");
30
31 combat_mode_strings[ATTACK_SUCCESS] =
get_local_string(
"COMBAT.ATTACK.SUCCESS");
35}
char * get_local_string(const char *key)
Get the localized string for the given key.
◆ combat_mode_strings
char** combat_mode_strings |
|
extern |