From be14552e3291ef5500df096c4f6c2efd44ee7780 Mon Sep 17 00:00:00 2001 From: Sevenfm Date: Tue, 25 Jan 2022 22:24:53 +0000 Subject: [PATCH] Prevented the game trying to delete an already deleted button when leaving mapscreen and fixed visual bug for popup boxes drawing in item description box in widescreen UI (by Asdow). git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9276 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Standard Gaming Platform/Button System.cpp | 3 ++- Strategic/mapscreen.cpp | 10 +++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Standard Gaming Platform/Button System.cpp b/Standard Gaming Platform/Button System.cpp index 2de66f9c..ea0796be 100644 --- a/Standard Gaming Platform/Button System.cpp +++ b/Standard Gaming Platform/Button System.cpp @@ -1309,7 +1309,8 @@ void RemoveButton(INT32 iButtonID) if( gfIgnoreShutdownAssertions ) #endif return; - AssertMsg( 0, "Attempting to remove a button that has already been deleted." ); + sprintf(str, "Attempting to remove a button that has already been deleted. ButtonID %d", iButtonID); + AssertMsg( 0, str ); } //If we happen to be in the middle of a callback, and attempt to delete a button, diff --git a/Strategic/mapscreen.cpp b/Strategic/mapscreen.cpp index 3c2c4cad..ae104237 100644 --- a/Strategic/mapscreen.cpp +++ b/Strategic/mapscreen.cpp @@ -9359,8 +9359,8 @@ void CreateMapCharInvIOregions() // Create trashcan and keyring buttons fShowInventoryFlag = TRUE; CreateDestroyTrashCanRegion(); - // Remove map inventory button, since widescreen res always has character inventory visible - RemoveButton(giMapInvDoneButton); + // Disable map inventory button, since widescreen res always has character inventory visible + DisableButton(giMapInvDoneButton); fShowInventoryFlag = FALSE; } @@ -12148,7 +12148,11 @@ void RenderCharacterInventoryWideScreen(void) if (!gfItemDescTransformPopupVisible) { BltCharInvPanel(); - RestoreExternBackgroundRect(UI_CHARINV.Region); + MarkAllBoxesAsAltered(); + if (!InItemDescriptionBox()) + { + RestoreExternBackgroundRect(UI_CHARINV.Region); + } } }