themes_rename
This commit is contained in:
parent
ddd18c32a9
commit
34fd3115d2
|
@ -452,6 +452,7 @@ int game_menu_act(const char *a)
|
|||
if (cur_lang >= langs_nr)
|
||||
cur_lang = 0;
|
||||
} while (menu_lang_select(langs[cur_lang].file));
|
||||
themes_rename();
|
||||
game_menu_box(1, game_menu_gen());
|
||||
} else if (!strcmp(a, "/lang--")) {
|
||||
do {
|
||||
|
@ -459,6 +460,7 @@ int game_menu_act(const char *a)
|
|||
if (cur_lang < 0)
|
||||
cur_lang = langs_nr - 1;
|
||||
} while (menu_lang_select(langs[cur_lang].file));
|
||||
themes_rename();
|
||||
game_menu_box(1, game_menu_gen());
|
||||
} else if (!strcmp(a,"/quit")) {
|
||||
return -1;
|
||||
|
|
|
@ -513,6 +513,20 @@ out:
|
|||
return 0;
|
||||
}
|
||||
|
||||
int themes_rename(void)
|
||||
{
|
||||
int i;
|
||||
char cwd[PATH_MAX];
|
||||
getcwd(cwd, sizeof(cwd));
|
||||
chdir(game_cwd);
|
||||
for (i = 0; i < themes_nr; i++) {
|
||||
FREE(themes[i].name);
|
||||
themes[i].name = theme_name(themes[i].path, themes[i].dir);
|
||||
}
|
||||
chdir(cwd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct theme *theme_lookup(const char *name)
|
||||
{
|
||||
int i;
|
||||
|
|
|
@ -105,6 +105,7 @@ extern int game_default_theme(void);
|
|||
extern int game_theme_select(const char *name);
|
||||
|
||||
extern int themes_lookup(const char *path);
|
||||
extern int themes_rename(void);
|
||||
extern int game_theme_load(const char *name);
|
||||
extern int game_theme_free(void);
|
||||
extern int game_theme_init(int w, int h);
|
||||
|
|
Reference in a new issue