DungeonCrawl
Loading...
Searching...
No Matches
combat_mode_local.c
Go to the documentation of this file.
1
5#include "combat_mode_local.h"
6
8
9#include <stdlib.h>
10
11char** combat_mode_strings = NULL;
12
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");
27 combat_mode_strings[POTION_FORMAT] = get_local_string("POTION.FORMAT");
28 combat_mode_strings[PRESS_C_RETURN] = get_local_string("PRESS.C.RETURN");
29 combat_mode_strings[NO_MORE_POTIONS] = get_local_string("POTION.EMPTY");
30
31 combat_mode_strings[ATTACK_SUCCESS] = get_local_string("COMBAT.ATTACK.SUCCESS");
32 combat_mode_strings[ATTACK_MISS] = get_local_string("COMBAT.ATTACK.MISS");
33 combat_mode_strings[ATTACK_FAIL] = get_local_string("COMBAT.ATTACK.FAIL");
34 combat_mode_strings[POTION_USE] = get_local_string("COMBAT.POTION.USE");
35}
void update_combat_local(void)
Updates the combat mode strings with localized versions.
Exposes functions for working with the localization of the combat mode.
char * get_local_string(const char *key)
Get the localized string for the given key.
Exposes public functions for the localization handler.