From 3bc2ea294c36b576af114c126f22dcb9d0bafcea Mon Sep 17 00:00:00 2001 From: Flugente Date: Thu, 28 Aug 2014 01:16:59 +0000 Subject: [PATCH] Fix: the disease button was not always set back correctly git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7441 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Strategic/Map Screen Interface Border.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Strategic/Map Screen Interface Border.cpp b/Strategic/Map Screen Interface Border.cpp index 4545bb74..ac7a3253 100644 --- a/Strategic/Map Screen Interface Border.cpp +++ b/Strategic/Map Screen Interface Border.cpp @@ -335,6 +335,11 @@ BOOLEAN CreateButtonsForMapBorder( void ) if ( gGameExternalOptions.fDisease && gGameExternalOptions.fDiseaseStrategic ) { 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, BUTTON_NO_TOGGLE, MSYS_PRIORITY_HIGH, (GUI_CALLBACK)MSYS_NO_CALLBACK, (GUI_CALLBACK)BtnDiseaseCallback ); @@ -1023,7 +1028,7 @@ void TurnOnAirSpaceMode( void ) if ( fShowStrategicDiseaseFlag ) { - fShowStrategicDiseaseFlag = MAPMODE_DISEASE; + fShowStrategicDiseaseFlag = MAPMODE_OFF; MapBorderButtonOff( MAP_BORDER_DISEASE_BTN ); } @@ -1248,7 +1253,7 @@ void TurnOnMobileFilterMode( void ) if ( fShowStrategicDiseaseFlag ) { - fShowStrategicDiseaseFlag = MAPMODE_DISEASE; + fShowStrategicDiseaseFlag = MAPMODE_OFF; MapBorderButtonOff( MAP_BORDER_DISEASE_BTN ); }