From ebef9b6df35542c9696dc728f4e9ca00756d8b41 Mon Sep 17 00:00:00 2001 From: Wanne Date: Fri, 27 Sep 2013 06:41:49 +0000 Subject: [PATCH] Bugfix: Repair assignment sub-menu goes out of rendering range (by Moa) git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6446 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Strategic/Assignments.cpp | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/Strategic/Assignments.cpp b/Strategic/Assignments.cpp index d13af4fa..933e6703 100644 --- a/Strategic/Assignments.cpp +++ b/Strategic/Assignments.cpp @@ -7269,12 +7269,12 @@ void CreateDestroyMouseRegionForRepairMenu( void ) if( ( fShowRepairMenu == TRUE ) && ( fCreated == FALSE ) ) { - CheckAndUpdateTacticalAssignmentPopUpPositions( ); - - if( ( fShowRepairMenu ) && ( guiCurrentScreen == MAP_SCREEN ) ) - { - //SetBoxPosition( ghRepairBox ,RepairPosition); - } + // Moa: removed below: repositioning now the same way as for training in AssignmentMenuBtnCB as it caused missplaced box for higher resolutions then 3. + //CheckAndUpdateTacticalAssignmentPopUpPositions( ); + //if( ( fShowRepairMenu ) && ( guiCurrentScreen == MAP_SCREEN ) ) + //{ + // //SetBoxPosition( ghRepairBox ,RepairPosition); + //} // grab height of font iFontHeight = GetLineSpace( ghRepairBox ) + GetFontHeight( GetBoxFont( ghRepairBox ) ); @@ -10232,8 +10232,8 @@ void AssignmentMenuBtnCallback( MOUSE_REGION * pRegion, INT32 iReason ) if( DisplayRepairMenu( pSoldier ) ) { fShowRepairMenu = TRUE; + DetermineBoxPositions( ); } - } } @@ -10285,6 +10285,7 @@ void AssignmentMenuBtnCallback( MOUSE_REGION * pRegion, INT32 iReason ) if( DisplayMoveItemsMenu( pSoldier ) ) { fShowMoveItemMenu = TRUE; + DetermineBoxPositions( ); } } } @@ -11237,18 +11238,20 @@ void DetermineBoxPositions( void ) if( ( fShowRepairMenu == TRUE ) && ( ghRepairBox != -1 ) ) { - CreateDestroyMouseRegionForRepairMenu( ); + //CreateDestroyMouseRegionForRepairMenu( ); pNewPoint.iY += ( ( GetFontHeight( MAP_SCREEN_FONT ) + 2 ) * ASSIGN_MENU_REPAIR ); SetBoxPosition( ghRepairBox, pNewPoint ); + CreateDestroyMouseRegionForRepairMenu( ); } if( ( fShowMoveItemMenu == TRUE ) && ( ghMoveItemBox != -1 ) ) { - CreateDestroyMouseRegionForMoveItemMenu( ); + //CreateDestroyMouseRegionForMoveItemMenu( ); pNewPoint.iY += ( ( GetFontHeight( MAP_SCREEN_FONT ) + 2 ) * ASSIGN_MENU_MOVE_ITEMS ); SetBoxPosition( ghMoveItemBox, pNewPoint ); + CreateDestroyMouseRegionForMoveItemMenu( ); } if( ( fShowTrainingMenu == TRUE ) && ( ghTrainingBox != -1 ) ) @@ -17838,12 +17841,12 @@ void CreateDestroyMouseRegionForMoveItemMenu( void ) if( ( fShowMoveItemMenu == TRUE ) && ( fCreated == FALSE ) ) { - CheckAndUpdateTacticalAssignmentPopUpPositions( ); - - if( ( fShowMoveItemMenu ) && ( guiCurrentScreen == MAP_SCREEN ) ) - { - //SetBoxPosition( ghMoveItemBox ,RepairPosition); - } + // Moa: removed below: repositioning now the same way as for training in AssignmentMenuBtnCB as it caused missplaced box for higher resolutions then 3. + //CheckAndUpdateTacticalAssignmentPopUpPositions( ); + //if( ( fShowMoveItemMenu ) && ( guiCurrentScreen == MAP_SCREEN ) ) + //{ + // //SetBoxPosition( ghMoveItemBox ,RepairPosition); + //} // grab height of font iFontHeight = GetLineSpace( ghMoveItemBox ) + GetFontHeight( GetBoxFont( ghMoveItemBox ) );