From 12abe8c5bcd54242d6c33dca0a97b444ceddad1b Mon Sep 17 00:00:00 2001 From: Wanne Date: Tue, 17 Mar 2020 09:48:16 +0000 Subject: [PATCH] Bugfix: Fixed INTEL-Button wrong placement x button position, if DISEASE-Button is not displayed git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8772 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Strategic/Map Screen Interface Border.cpp | 27 +++++++++++++++++------ ja2_VS2010.vcxproj | 2 +- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/Strategic/Map Screen Interface Border.cpp b/Strategic/Map Screen Interface Border.cpp index d9f4ae63..24e303df 100644 --- a/Strategic/Map Screen Interface Border.cpp +++ b/Strategic/Map Screen Interface Border.cpp @@ -54,9 +54,10 @@ UINT16 MAP_BORDER_MILITIA_BTN_X; UINT16 MAP_BORDER_MILITIA_BTN_Y; UINT16 MAP_BORDER_DISEASE_BTN_X; // Flugente: disease UINT16 MAP_BORDER_DISEASE_BTN_Y; -UINT16 MAP_BORDER_WEATHER_BTN_X; // Flugente: weather + +//UINT16 MAP_BORDER_WEATHER_BTN_X; // Flugente: weather // WANNE: Dynamic X position UINT16 MAP_BORDER_WEATHER_BTN_Y; -UINT16 MAP_BORDER_INTEL_BTN_X; // Flugente: intel +//UINT16 MAP_BORDER_INTEL_BTN_X; // Flugente: intel // WANNE: Dynamic X position UINT16 MAP_BORDER_INTEL_BTN_Y; UINT16 MAP_LEVEL_MARKER_X; @@ -300,17 +301,21 @@ BOOLEAN CreateButtonsForMapBorder( void ) SetButtonCursor(giMapBorderButtons[ MAP_BORDER_AIRSPACE_BTN ], MSYS_NO_CURSOR ); SetButtonCursor(giMapBorderButtons[ MAP_BORDER_ITEM_BTN ], MSYS_NO_CURSOR ); SetButtonCursor(giMapBorderButtons[ MAP_BORDER_MILITIA_BTN ], MSYS_NO_CURSOR ); + + UINT16 nextButtonX = MAP_BORDER_DISEASE_BTN_X - 43; // Flugente: disease if ( gGameExternalOptions.fDisease && gGameExternalOptions.fDiseaseStrategic ) { + nextButtonX += 43; + giMapBorderButtonsImage[MAP_BORDER_DISEASE_BTN] = LoadButtonImage( "INTERFACE\\map_border_buttons.sti", -1, 31, -1, 32, -1 ); // if the button image cannot be created, this is likely to a custom sti replacement that isn't up to date to this feature - just use some other images then if ( giMapBorderButtonsImage[MAP_BORDER_DISEASE_BTN] < 0 ) giMapBorderButtonsImage[MAP_BORDER_DISEASE_BTN] = LoadButtonImage( "INTERFACE\\map_border_buttons.sti", -1, 2, -1, 11, -1 ); - giMapBorderButtons[MAP_BORDER_DISEASE_BTN] = QuickCreateButton( giMapBorderButtonsImage[MAP_BORDER_DISEASE_BTN], MAP_BORDER_DISEASE_BTN_X, MAP_BORDER_DISEASE_BTN_Y, + giMapBorderButtons[MAP_BORDER_DISEASE_BTN] = QuickCreateButton( giMapBorderButtonsImage[MAP_BORDER_DISEASE_BTN], nextButtonX, MAP_BORDER_DISEASE_BTN_Y, BUTTON_NO_TOGGLE, MSYS_PRIORITY_HIGH, (GUI_CALLBACK)MSYS_NO_CALLBACK, (GUI_CALLBACK)BtnDiseaseCallback ); @@ -322,17 +327,21 @@ BOOLEAN CreateButtonsForMapBorder( void ) // Flugente: weather if ( gGameExternalOptions.gfAllowRain || gGameExternalOptions.gfAllowSandStorms || gGameExternalOptions.gfAllowSnow ) { + nextButtonX += 43; + giMapBorderButtonsImage[MAP_BORDER_WEATHER_BTN] = LoadButtonImage( "INTERFACE\\map_border_buttons.sti", -1, 37, -1, 38, -1 ); // if the button image cannot be created, this is likely to a custom sti replacement that isn't up to date to this feature - just use some other images then if ( giMapBorderButtonsImage[MAP_BORDER_WEATHER_BTN] < 0 ) giMapBorderButtonsImage[MAP_BORDER_WEATHER_BTN] = LoadButtonImage( "INTERFACE\\map_border_buttons.sti", -1, 2, -1, 11, -1 ); + /* INT16 x = MAP_BORDER_WEATHER_BTN_X; if ( giMapBorderButtonsImage[MAP_BORDER_DISEASE_BTN] < 0 ) x = MAP_BORDER_DISEASE_BTN_X; + */ - giMapBorderButtons[MAP_BORDER_WEATHER_BTN] = QuickCreateButton( giMapBorderButtonsImage[MAP_BORDER_WEATHER_BTN], x, MAP_BORDER_WEATHER_BTN_Y, + giMapBorderButtons[MAP_BORDER_WEATHER_BTN] = QuickCreateButton( giMapBorderButtonsImage[MAP_BORDER_WEATHER_BTN], nextButtonX, MAP_BORDER_WEATHER_BTN_Y, BUTTON_NO_TOGGLE, MSYS_PRIORITY_HIGH, (GUI_CALLBACK)MSYS_NO_CALLBACK, (GUI_CALLBACK)BtnWeatherCallback ); @@ -344,17 +353,21 @@ BOOLEAN CreateButtonsForMapBorder( void ) // Flugente: intel if ( TRUE ) { + nextButtonX += 43; + giMapBorderButtonsImage[MAP_BORDER_INTEL_BTN] = LoadButtonImage( "INTERFACE\\map_border_buttons.sti", -1, 39, -1, 40, -1 ); // if the button image cannot be created, this is likely to a custom sti replacement that isn't up to date to this feature - just use some other images then if ( giMapBorderButtonsImage[MAP_BORDER_INTEL_BTN] < 0 ) giMapBorderButtonsImage[MAP_BORDER_INTEL_BTN] = LoadButtonImage( "INTERFACE\\map_border_buttons.sti", -1, 2, -1, 11, -1 ); + /* INT16 x = MAP_BORDER_INTEL_BTN_X; if ( giMapBorderButtonsImage[MAP_BORDER_WEATHER_BTN] < 0 ) x = MAP_BORDER_WEATHER_BTN_X; + */ - giMapBorderButtons[MAP_BORDER_INTEL_BTN] = QuickCreateButton( giMapBorderButtonsImage[MAP_BORDER_INTEL_BTN], x, MAP_BORDER_INTEL_BTN_Y, + giMapBorderButtons[MAP_BORDER_INTEL_BTN] = QuickCreateButton( giMapBorderButtonsImage[MAP_BORDER_INTEL_BTN], nextButtonX, MAP_BORDER_INTEL_BTN_Y, BUTTON_NO_TOGGLE, MSYS_PRIORITY_HIGH, (GUI_CALLBACK)MSYS_NO_CALLBACK, (GUI_CALLBACK)BtnIntelCallback ); @@ -1445,9 +1458,9 @@ void InitMapBorderButtonCoordinates() MAP_BORDER_MILITIA_BTN_Y = (SCREEN_HEIGHT - yResOffset - buttonOffset); MAP_BORDER_DISEASE_BTN_X = xResOffset + MAP_BORDER_X + ((SCREEN_WIDTH - MAP_BORDER_X - 2 * xResOffset) / 2) + 190; MAP_BORDER_DISEASE_BTN_Y = (SCREEN_HEIGHT - yResOffset - buttonOffset); - MAP_BORDER_WEATHER_BTN_X = xResOffset + MAP_BORDER_X + ((SCREEN_WIDTH - MAP_BORDER_X - 2 * xResOffset) / 2) + 233; + //MAP_BORDER_WEATHER_BTN_X = xResOffset + MAP_BORDER_X + ((SCREEN_WIDTH - MAP_BORDER_X - 2 * xResOffset) / 2) + 233; // WANNE: Dynamic X position MAP_BORDER_WEATHER_BTN_Y = (SCREEN_HEIGHT - yResOffset - buttonOffset); - MAP_BORDER_INTEL_BTN_X = xResOffset + MAP_BORDER_X + ( ( SCREEN_WIDTH - MAP_BORDER_X - 2 * xResOffset ) / 2 ) + 276; + //MAP_BORDER_INTEL_BTN_X = xResOffset + MAP_BORDER_X + ( ( SCREEN_WIDTH - MAP_BORDER_X - 2 * xResOffset ) / 2 ) + 276; // WANNE: Dynamic X position MAP_BORDER_INTEL_BTN_Y = ( SCREEN_HEIGHT - yResOffset - buttonOffset ); MAP_LEVEL_MARKER_X = xResOffset + MAP_BORDER_X + ((SCREEN_WIDTH - MAP_BORDER_X - 2 * xResOffset) / 2) + 114; diff --git a/ja2_VS2010.vcxproj b/ja2_VS2010.vcxproj index a1ca0056..17cb3b0e 100644 --- a/ja2_VS2010.vcxproj +++ b/ja2_VS2010.vcxproj @@ -141,7 +141,7 @@ Multiplayer\raknet;%(AdditionalLibraryDirectories) Winmm.lib;RakNetLibStatic.lib;ws2_32.lib;DbgHelp.lib;%(AdditionalDependencies) false - $(OutDir)\JA2_EN_Debug + $(OutDir)\JA2_EN_Debug.exe