From 914d869445048466ef00954109a15286938521c6 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Tue, 17 Sep 2019 11:20:41 +0200 Subject: [PATCH] added options for player selection button positions in setup menu --- build-scripts/create_element_defs.pl | 1 + src/conf_gfx.c | 5 +++++ src/main.h | 12 ++++++++++++ src/screens.c | 8 ++++---- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/build-scripts/create_element_defs.pl b/build-scripts/create_element_defs.pl index 90749c42..10280faa 100755 --- a/build-scripts/create_element_defs.pl +++ b/build-scripts/create_element_defs.pl @@ -2360,6 +2360,7 @@ sub print_image_config_vars # --- some prefix replacements --- $var =~ s/^main\./menu.main./; + $var =~ s/^setup\./menu.setup./; $var =~ s/^\[player\]\./game.player_/; $var =~ s/^\[title_initial\]/title_initial_default/; $var =~ s/^\[title\]/title_default/; diff --git a/src/conf_gfx.c b/src/conf_gfx.c index 5075ee37..6c1a6ba2 100644 --- a/src/conf_gfx.c +++ b/src/conf_gfx.c @@ -8087,6 +8087,11 @@ struct ConfigInfo image_config[] = { "main.preview_players.xoffset", "-1" }, { "main.preview_players.yoffset", "-1" }, + { "setup.button.prev_player.x", "320" }, + { "setup.button.prev_player.y", "64" }, + { "setup.button.next_player.x", "384" }, + { "setup.button.next_player.y", "64" }, + { "preview.x", "272" }, { "preview.y", "380" }, { "preview.align", "center" }, diff --git a/src/main.h b/src/main.h index 869e5ba5..88577ac2 100644 --- a/src/main.h +++ b/src/main.h @@ -2719,6 +2719,17 @@ struct MenuMainInfo struct TextPosInfo network_players; }; +struct MenuSetupButtonInfo +{ + struct MenuPosInfo prev_player; + struct MenuPosInfo next_player; +}; + +struct MenuSetupInfo +{ + struct MenuSetupButtonInfo button; +}; + struct TitleFadingInfo { int fade_mode; @@ -2807,6 +2818,7 @@ struct MenuInfo int music[NUM_SPECIAL_GFX_ARGS]; struct MenuMainInfo main; + struct MenuSetupInfo setup; }; struct DoorInfo diff --git a/src/screens.c b/src/screens.c index fc760274..9e55d796 100644 --- a/src/screens.c +++ b/src/screens.c @@ -8330,13 +8330,13 @@ static void getScreenMenuButtonPos(int *x, int *y, int gadget_id) break; case SCREEN_CTRL_ID_PREV_PLAYER: - *x = mSX + TILEX * 10; - *y = mSY + TILEY * MENU_SCREEN_START_YPOS; + *x = mSX + GDI_ACTIVE_POS(menu.setup.button.prev_player.x); + *y = mSY + GDI_ACTIVE_POS(menu.setup.button.prev_player.y); break; case SCREEN_CTRL_ID_NEXT_PLAYER: - *x = mSX + TILEX * 12; - *y = mSY + TILEY * MENU_SCREEN_START_YPOS; + *x = mSX + GDI_ACTIVE_POS(menu.setup.button.next_player.x); + *y = mSY + GDI_ACTIVE_POS(menu.setup.button.next_player.y); break; case SCREEN_CTRL_ID_INSERT_SOLUTION: -- 2.34.1