DungeonCrawl
Loading...
Searching...
No Matches
main_menu_local.c File Reference

Loads and updates localized strings for the main menu UI. More...

#include "main_menu_local.h"
#include "../../local/local_handler.h"
#include <stdlib.h>

Go to the source code of this file.

Functions

void update_main_menu_local (void)
 Updates the localized strings for the main menu.

Variables

char ** main_menu_strings = NULL

Detailed Description

Loads and updates localized strings for the main menu UI.

Definition in file main_menu_local.c.

Function Documentation

◆ update_main_menu_local()

void update_main_menu_local ( void )

Updates the localized strings for the main menu.

This function retrieves the localized strings for the main menu and updates the corresponding entries in the main menu strings array.

Definition at line 13 of file main_menu_local.c.

13 {
14 for (int i = 0; i < MAX_MAIN_MENU_STRINGS; i++) {
15 if (main_menu_strings[i] != NULL) {
16 free(main_menu_strings[i]);
17 }
18 }
19
20 main_menu_strings[NEW_GAME_STR] = get_local_string("MAIN_MENU.NEW_GAME");
21 main_menu_strings[CONTINUE_STR] = get_local_string("MAIN_MENU.CONTINUE");
22 main_menu_strings[SAVE_GAME_STR] = get_local_string("MAIN_MENU.SAVE_GAME");
23 main_menu_strings[LOAD_GAME_STR] = get_local_string("MAIN_MENU.LOAD_GAME");
24 main_menu_strings[CHANGE_LANGUAGE_STR] = get_local_string("MAIN_MENU.CHANGE_LANGUAGE");
25 main_menu_strings[EXIT_STR] = get_local_string("MAIN_MENU.EXIT");
26 main_menu_strings[QUESTION_CONTINUE] = get_local_string("MAIN_MENU.QUESTION.CONTINUE");
27 main_menu_strings[QUESTION_EXIT] = get_local_string("MAIN_MENU.QUESTION.EXIT");
28}
char * get_local_string(const char *key)
Get the localized string for the given key.

Variable Documentation

◆ main_menu_strings

char** main_menu_strings = NULL

Definition at line 11 of file main_menu_local.c.