DungeonCrawl
Loading...
Searching...
No Matches
combat_mode_local.h File Reference

Exposes functions for working with the localization of the combat mode. More...

Go to the source code of this file.

Enumerations

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
}

Functions

void update_combat_local (void)
 Updates the combat mode strings with localized versions.

Variables

char ** combat_mode_strings

Detailed Description

Exposes functions for working with the localization of the combat mode.

Definition in file combat_mode_local.h.

Enumeration Type Documentation

◆ combat_mode_index

enum 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};

Function Documentation

◆ 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");
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}
char * get_local_string(const char *key)
Get the localized string for the given key.

Variable Documentation

◆ combat_mode_strings

char** combat_mode_strings
extern

Definition at line 11 of file combat_mode_local.c.