From 9ac63ed68417dba413c129c1c14c179f2437fd44 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Wed, 30 Sep 2020 23:45:42 +0200 Subject: [PATCH] added definitions for upcoming new name selection screen --- src/anim.c | 11 ++++++++--- src/conf_gfx.c | 17 +++++++++++++++++ src/conf_mus.c | 1 + src/conf_snd.c | 1 + src/events.c | 1 + src/init.c | 3 +++ src/main.c | 3 +++ src/main.h | 6 ++++++ src/screens.c | 4 +++- src/tools.c | 8 +++++++- 10 files changed, 50 insertions(+), 5 deletions(-) diff --git a/src/anim.c b/src/anim.c index 01434554..f109b874 100644 --- a/src/anim.c +++ b/src/anim.c @@ -178,10 +178,13 @@ struct GameModeAnimClass { GAME_MODE_TITLE_3, ANIM_CLASS_TITLE }, { GAME_MODE_TITLE_4, ANIM_CLASS_TITLE }, { GAME_MODE_TITLE_5, ANIM_CLASS_TITLE }, + { GAME_MODE_NAMES, ANIM_CLASS_TOONS_MENU_SUBMENU }, { GAME_MODE_LEVELS, ANIM_CLASS_TOONS_MENU_SUBMENU }, { GAME_MODE_LEVELNR, ANIM_CLASS_TOONS_MENU_SUBMENU }, { GAME_MODE_INFO, ANIM_CLASS_TOONS_MENU_SUBMENU }, { GAME_MODE_SETUP, ANIM_CLASS_TOONS_MENU_SUBMENU }, + { GAME_MODE_PSEUDO_NAMESONLY, ANIM_CLASS_TOONS_MENU_SUBMENU }, + { GAME_MODE_PSEUDO_TYPENAMES, ANIM_CLASS_TOONS_MENU_SUBMENU }, { GAME_MODE_PSEUDO_MAINONLY, ANIM_CLASS_TOONS_MENU_MAIN }, { GAME_MODE_PSEUDO_TYPENAME, ANIM_CLASS_TOONS_MENU_MAIN }, { GAME_MODE_PSEUDO_SCORESOLD, ANIM_CLASS_TOONS_SCORES }, @@ -642,9 +645,11 @@ static void DrawGlobalAnimationsExt(int drawing_target, int drawing_stage) if (drawing_target == DRAW_TO_FADE_TARGET) after_fading = TRUE; - // special case: changing from/to this screen is done without fading - if (global.anim_status == GAME_MODE_PSEUDO_TYPENAME || - anim_status_last == GAME_MODE_PSEUDO_TYPENAME) + // special case: changing from/to these screens is done without fading + if (global.anim_status == GAME_MODE_PSEUDO_TYPENAME || + global.anim_status == GAME_MODE_PSEUDO_TYPENAMES || + anim_status_last == GAME_MODE_PSEUDO_TYPENAME || + anim_status_last == GAME_MODE_PSEUDO_TYPENAMES) after_fading = TRUE; // ---------- part 1 ------------------------------------------------------ diff --git a/src/conf_gfx.c b/src/conf_gfx.c index 20f3f1cb..b46c8c5a 100644 --- a/src/conf_gfx.c +++ b/src/conf_gfx.c @@ -6457,6 +6457,8 @@ struct ConfigInfo image_config[] = { "font.text_1.LEVELNR.clone_from", "font.text_1.LEVELS" }, { "font.text_1.SETUP", UNDEFINED_FILENAME }, { "font.text_1.SETUP.clone_from", "font.text_1.LEVELS" }, + { "font.text_1.NAMES", UNDEFINED_FILENAME }, + { "font.text_1.NAMES.clone_from", "font.input_1.MAIN" }, { "font.text_1.PREVIEW", "RocksFontEM.png" }, { "font.text_1.PREVIEW.x", "0" }, { "font.text_1.PREVIEW.y", "160" }, @@ -6492,6 +6494,8 @@ struct ConfigInfo image_config[] = { "font.text_2.LEVELNR.clone_from", "font.text_2.LEVELS" }, { "font.text_2.SETUP", UNDEFINED_FILENAME }, { "font.text_2.SETUP.clone_from", "font.text_2.LEVELS" }, + { "font.text_2.NAMES", UNDEFINED_FILENAME }, + { "font.text_2.NAMES.clone_from", "font.option_off" }, { "font.text_2.PREVIEW", "RocksFontEM.png" }, { "font.text_2.PREVIEW.x", "0" }, { "font.text_2.PREVIEW.y", "160" }, @@ -6521,6 +6525,8 @@ struct ConfigInfo image_config[] = { "font.text_3.LEVELNR.clone_from", "font.text_3.LEVELS" }, { "font.text_3.SETUP", UNDEFINED_FILENAME }, { "font.text_3.SETUP.clone_from", "font.text_3.LEVELS" }, + { "font.text_3.NAMES", UNDEFINED_FILENAME }, + { "font.text_3.NAMES.clone_from", "font.menu_1" }, { "font.text_3.PREVIEW", "RocksFontEM.png" }, { "font.text_3.PREVIEW.x", "0" }, { "font.text_3.PREVIEW.y", "160" }, @@ -6552,6 +6558,8 @@ struct ConfigInfo image_config[] = { "font.text_4.LEVELNR.clone_from", "font.text_4.LEVELS" }, { "font.text_4.SETUP", UNDEFINED_FILENAME }, { "font.text_4.SETUP.clone_from", "font.text_4.LEVELS" }, + { "font.text_4.NAMES", UNDEFINED_FILENAME }, + { "font.text_4.NAMES.clone_from", "font.menu_1.active" }, { "font.text_4.SCORES", "RocksFontMedium.png" }, { "font.text_4.SCORES.x", "0" }, { "font.text_4.SCORES.y", "480" }, @@ -6600,6 +6608,8 @@ struct ConfigInfo image_config[] = { "font.input_1.MAIN.y", "0" }, { "font.input_1.MAIN.width", "32" }, { "font.input_1.MAIN.height", "32" }, + { "font.input_1.NAMES", UNDEFINED_FILENAME }, + { "font.input_1.NAMES.clone_from", "font.input_1.MAIN" }, { "font.input_1.active", "RocksFontSmall.png" }, { "font.input_1.active.x", "0" }, { "font.input_1.active.y", "210" }, @@ -6610,6 +6620,8 @@ struct ConfigInfo image_config[] = { "font.input_1.active.MAIN.y", "480" }, { "font.input_1.active.MAIN.width", "32" }, { "font.input_1.active.MAIN.height", "32" }, + { "font.input_1.active.NAMES", UNDEFINED_FILENAME }, + { "font.input_1.active.NAMES.clone_from", "font.input_1.MAIN" }, { "font.input_1.active.SETUP", "RocksFontBig.png" }, { "font.input_1.active.SETUP.x", "0" }, { "font.input_1.active.SETUP.y", "0" }, @@ -7178,6 +7190,7 @@ struct ConfigInfo image_config[] = { "background.TITLE_INITIAL", UNDEFINED_FILENAME }, { "background.TITLE", UNDEFINED_FILENAME }, { "background.MAIN", UNDEFINED_FILENAME }, + { "background.NAMES", UNDEFINED_FILENAME }, { "background.LEVELS", UNDEFINED_FILENAME }, { "background.LEVELNR", UNDEFINED_FILENAME }, { "background.SCORES", UNDEFINED_FILENAME }, @@ -7701,6 +7714,7 @@ struct ConfigInfo image_config[] = { "border.draw_masked.TITLE", "false" }, { "border.draw_masked.MAIN", "false" }, + { "border.draw_masked.NAMES", "false" }, { "border.draw_masked.LEVELS", "false" }, { "border.draw_masked.LEVELNR", "false" }, { "border.draw_masked.SCORES", "false" }, @@ -7779,6 +7793,8 @@ struct ConfigInfo image_config[] = { "menu.draw_yoffset", "0" }, { "menu.draw_xoffset.MAIN", "0" }, { "menu.draw_yoffset.MAIN", "0" }, + { "menu.draw_xoffset.NAMES", "0" }, + { "menu.draw_yoffset.NAMES", "0" }, { "menu.draw_xoffset.LEVELS", "0" }, { "menu.draw_yoffset.LEVELS", "0" }, { "menu.draw_xoffset.LEVELNR", "0" }, @@ -7844,6 +7860,7 @@ struct ConfigInfo image_config[] = { "menu.list.SETUP[CHOOSE_OTHER].valign", "top" }, { "menu.list_size", "-1" }, + { "menu.list_size.NAMES", "-1" }, { "menu.list_size.LEVELS", "-1" }, { "menu.list_size.LEVELNR", "-1" }, { "menu.list_size.SCORES", "-1" }, diff --git a/src/conf_mus.c b/src/conf_mus.c index 08ccd659..d11a5bff 100644 --- a/src/conf_mus.c +++ b/src/conf_mus.c @@ -30,6 +30,7 @@ struct ConfigInfo music_config[] = { "background.TITLE_INITIAL", UNDEFINED_FILENAME }, { "background.TITLE", UNDEFINED_FILENAME }, { "background.MAIN", UNDEFINED_FILENAME }, + { "background.NAMES", UNDEFINED_FILENAME }, { "background.LEVELS", UNDEFINED_FILENAME }, { "background.LEVELNR", UNDEFINED_FILENAME }, { "background.SCORES", UNDEFINED_FILENAME }, diff --git a/src/conf_snd.c b/src/conf_snd.c index 83867110..eacaf778 100644 --- a/src/conf_snd.c +++ b/src/conf_snd.c @@ -315,6 +315,7 @@ struct ConfigInfo sound_config[] = { "background.TITLE_INITIAL", UNDEFINED_FILENAME }, { "background.TITLE", UNDEFINED_FILENAME }, { "background.MAIN", UNDEFINED_FILENAME }, + { "background.NAMES", UNDEFINED_FILENAME }, { "background.LEVELS", UNDEFINED_FILENAME }, { "background.LEVELNR", UNDEFINED_FILENAME }, { "background.SCORES", "halloffame.wav" }, diff --git a/src/events.c b/src/events.c index f2f64593..b4f75948 100644 --- a/src/events.c +++ b/src/events.c @@ -2547,6 +2547,7 @@ void HandleJoystick(void) } if (newbutton && (game_status == GAME_MODE_PSEUDO_TYPENAME || + game_status == GAME_MODE_PSEUDO_TYPENAMES || anyTextGadgetActive())) { // leave name input in main menu or text input gadget diff --git a/src/init.c b/src/init.c index 44b0a5cb..008db40c 100644 --- a/src/init.c +++ b/src/init.c @@ -333,6 +333,8 @@ static int getFontBitmapID(int font_nr) special = game_status; else if (game_status == GAME_MODE_PSEUDO_TYPENAME) special = GFX_SPECIAL_ARG_MAIN; + else if (game_status == GAME_MODE_PSEUDO_TYPENAMES) + special = GFX_SPECIAL_ARG_NAMES; if (special != -1) return font_info[font_nr].special_bitmap_id[special]; @@ -1695,6 +1697,7 @@ static void InitGraphicInfo(void) IMG_BACKGROUND_TITLE_INITIAL, IMG_BACKGROUND_TITLE, IMG_BACKGROUND_MAIN, + IMG_BACKGROUND_NAMES, IMG_BACKGROUND_LEVELS, IMG_BACKGROUND_LEVELNR, IMG_BACKGROUND_SCORES, diff --git a/src/main.c b/src/main.c index 1a4243f9..650d626d 100644 --- a/src/main.c +++ b/src/main.c @@ -7416,6 +7416,7 @@ struct SpecialSuffixInfo special_suffix_info[NUM_SPECIAL_GFX_ARGS + 1 + 1] = { ".TITLE_4", GFX_SPECIAL_ARG_TITLE_4, }, { ".TITLE_5", GFX_SPECIAL_ARG_TITLE_5, }, { ".MAIN", GFX_SPECIAL_ARG_MAIN, }, + { ".NAMES", GFX_SPECIAL_ARG_NAMES, }, { ".LEVELS", GFX_SPECIAL_ARG_LEVELS }, { ".LEVELNR", GFX_SPECIAL_ARG_LEVELNR }, { ".SCORES", GFX_SPECIAL_ARG_SCORES, }, @@ -7429,7 +7430,9 @@ struct SpecialSuffixInfo special_suffix_info[NUM_SPECIAL_GFX_ARGS + 1 + 1] = { ".PREVIEW", GFX_SPECIAL_ARG_PREVIEW, }, { ".CRUMBLED", GFX_SPECIAL_ARG_CRUMBLED, }, { ".MAINONLY", GFX_SPECIAL_ARG_MAINONLY, }, + { ".NAMESONLY", GFX_SPECIAL_ARG_NAMESONLY, }, { ".TYPENAME", GFX_SPECIAL_ARG_TYPENAME, }, + { ".TYPENAMES", GFX_SPECIAL_ARG_TYPENAMES, }, { ".SUBMENU", GFX_SPECIAL_ARG_SUBMENU, }, { ".MENU", GFX_SPECIAL_ARG_MENU, }, { ".TOONS", GFX_SPECIAL_ARG_TOONS, }, diff --git a/src/main.h b/src/main.h index 4452a9bd..f0e559a5 100644 --- a/src/main.h +++ b/src/main.h @@ -2279,6 +2279,7 @@ enum GFX_SPECIAL_ARG_TITLE_4, GFX_SPECIAL_ARG_TITLE_5, GFX_SPECIAL_ARG_MAIN, + GFX_SPECIAL_ARG_NAMES, GFX_SPECIAL_ARG_LEVELS, GFX_SPECIAL_ARG_LEVELNR, GFX_SPECIAL_ARG_SCORES, @@ -2292,7 +2293,9 @@ enum GFX_SPECIAL_ARG_PREVIEW, GFX_SPECIAL_ARG_CRUMBLED, GFX_SPECIAL_ARG_MAINONLY, + GFX_SPECIAL_ARG_NAMESONLY, GFX_SPECIAL_ARG_TYPENAME, + GFX_SPECIAL_ARG_TYPENAMES, GFX_SPECIAL_ARG_SUBMENU, GFX_SPECIAL_ARG_MENU, GFX_SPECIAL_ARG_TOONS, @@ -2527,6 +2530,7 @@ enum #define GAME_MODE_TITLE_4 GFX_SPECIAL_ARG_TITLE_4 #define GAME_MODE_TITLE_5 GFX_SPECIAL_ARG_TITLE_5 #define GAME_MODE_MAIN GFX_SPECIAL_ARG_MAIN +#define GAME_MODE_NAMES GFX_SPECIAL_ARG_NAMES #define GAME_MODE_LEVELS GFX_SPECIAL_ARG_LEVELS #define GAME_MODE_LEVELNR GFX_SPECIAL_ARG_LEVELNR #define GAME_MODE_SCORES GFX_SPECIAL_ARG_SCORES @@ -2540,7 +2544,9 @@ enum #define GAME_MODE_PSEUDO_PREVIEW GFX_SPECIAL_ARG_PREVIEW #define GAME_MODE_PSEUDO_CRUMBLED GFX_SPECIAL_ARG_CRUMBLED #define GAME_MODE_PSEUDO_MAINONLY GFX_SPECIAL_ARG_MAINONLY +#define GAME_MODE_PSEUDO_NAMESONLY GFX_SPECIAL_ARG_NAMESONLY #define GAME_MODE_PSEUDO_TYPENAME GFX_SPECIAL_ARG_TYPENAME +#define GAME_MODE_PSEUDO_TYPENAMES GFX_SPECIAL_ARG_TYPENAMES #define GAME_MODE_PSEUDO_SUBMENU GFX_SPECIAL_ARG_SUBMENU #define GAME_MODE_PSEUDO_MENU GFX_SPECIAL_ARG_MENU #define GAME_MODE_PSEUDO_TOONS GFX_SPECIAL_ARG_TOONS diff --git a/src/screens.c b/src/screens.c index 16a3fc1b..f0fca35b 100644 --- a/src/screens.c +++ b/src/screens.c @@ -541,7 +541,9 @@ static int align_yoffset = 0; #define DRAW_MODE(s) ((s) >= GAME_MODE_MAIN && \ (s) <= GAME_MODE_SETUP ? (s) : \ (s) == GAME_MODE_PSEUDO_TYPENAME ? \ - GAME_MODE_MAIN : GAME_MODE_DEFAULT) + GAME_MODE_MAIN : \ + (s) == GAME_MODE_PSEUDO_TYPENAMES ? \ + GAME_MODE_NAMES : GAME_MODE_DEFAULT) // (there are no draw offset definitions needed for INFO_MODE_TITLE) #define DRAW_MODE_INFO(i) ((i) >= INFO_MODE_TITLE && \ diff --git a/src/tools.c b/src/tools.c index 27469503..de19e464 100644 --- a/src/tools.c +++ b/src/tools.c @@ -9351,6 +9351,8 @@ void SetAnimStatus(int anim_status_new) { if (anim_status_new == GAME_MODE_MAIN) anim_status_new = GAME_MODE_PSEUDO_MAINONLY; + else if (anim_status_new == GAME_MODE_NAMES) + anim_status_new = GAME_MODE_PSEUDO_NAMESONLY; else if (anim_status_new == GAME_MODE_SCORES) anim_status_new = GAME_MODE_PSEUDO_SCORESOLD; @@ -9360,7 +9362,11 @@ void SetAnimStatus(int anim_status_new) if ((global.anim_status == GAME_MODE_PSEUDO_MAINONLY && global.anim_status_next == GAME_MODE_PSEUDO_TYPENAME) || (global.anim_status == GAME_MODE_PSEUDO_TYPENAME && - global.anim_status_next == GAME_MODE_PSEUDO_MAINONLY)) + global.anim_status_next == GAME_MODE_PSEUDO_MAINONLY) || + (global.anim_status == GAME_MODE_PSEUDO_NAMESONLY && + global.anim_status_next == GAME_MODE_PSEUDO_TYPENAMES) || + (global.anim_status == GAME_MODE_PSEUDO_TYPENAMES && + global.anim_status_next == GAME_MODE_PSEUDO_NAMESONLY)) global.anim_status = global.anim_status_next; } -- 2.34.1