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
This commit is contained in:
Wanne
2013-09-27 06:41:49 +00:00
parent 09ea0d8ec2
commit ebef9b6df3
+18 -15
View File
@@ -7269,12 +7269,12 @@ void CreateDestroyMouseRegionForRepairMenu( void )
if( ( fShowRepairMenu == TRUE ) && ( fCreated == FALSE ) ) if( ( fShowRepairMenu == TRUE ) && ( fCreated == FALSE ) )
{ {
CheckAndUpdateTacticalAssignmentPopUpPositions( ); // 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 ) ) //if( ( fShowRepairMenu ) && ( guiCurrentScreen == MAP_SCREEN ) )
{ //{
//SetBoxPosition( ghRepairBox ,RepairPosition); // //SetBoxPosition( ghRepairBox ,RepairPosition);
} //}
// grab height of font // grab height of font
iFontHeight = GetLineSpace( ghRepairBox ) + GetFontHeight( GetBoxFont( ghRepairBox ) ); iFontHeight = GetLineSpace( ghRepairBox ) + GetFontHeight( GetBoxFont( ghRepairBox ) );
@@ -10232,8 +10232,8 @@ void AssignmentMenuBtnCallback( MOUSE_REGION * pRegion, INT32 iReason )
if( DisplayRepairMenu( pSoldier ) ) if( DisplayRepairMenu( pSoldier ) )
{ {
fShowRepairMenu = TRUE; fShowRepairMenu = TRUE;
DetermineBoxPositions( );
} }
} }
} }
@@ -10285,6 +10285,7 @@ void AssignmentMenuBtnCallback( MOUSE_REGION * pRegion, INT32 iReason )
if( DisplayMoveItemsMenu( pSoldier ) ) if( DisplayMoveItemsMenu( pSoldier ) )
{ {
fShowMoveItemMenu = TRUE; fShowMoveItemMenu = TRUE;
DetermineBoxPositions( );
} }
} }
} }
@@ -11237,18 +11238,20 @@ void DetermineBoxPositions( void )
if( ( fShowRepairMenu == TRUE ) && ( ghRepairBox != -1 ) ) if( ( fShowRepairMenu == TRUE ) && ( ghRepairBox != -1 ) )
{ {
CreateDestroyMouseRegionForRepairMenu( ); //CreateDestroyMouseRegionForRepairMenu( );
pNewPoint.iY += ( ( GetFontHeight( MAP_SCREEN_FONT ) + 2 ) * ASSIGN_MENU_REPAIR ); pNewPoint.iY += ( ( GetFontHeight( MAP_SCREEN_FONT ) + 2 ) * ASSIGN_MENU_REPAIR );
SetBoxPosition( ghRepairBox, pNewPoint ); SetBoxPosition( ghRepairBox, pNewPoint );
CreateDestroyMouseRegionForRepairMenu( );
} }
if( ( fShowMoveItemMenu == TRUE ) && ( ghMoveItemBox != -1 ) ) if( ( fShowMoveItemMenu == TRUE ) && ( ghMoveItemBox != -1 ) )
{ {
CreateDestroyMouseRegionForMoveItemMenu( ); //CreateDestroyMouseRegionForMoveItemMenu( );
pNewPoint.iY += ( ( GetFontHeight( MAP_SCREEN_FONT ) + 2 ) * ASSIGN_MENU_MOVE_ITEMS ); pNewPoint.iY += ( ( GetFontHeight( MAP_SCREEN_FONT ) + 2 ) * ASSIGN_MENU_MOVE_ITEMS );
SetBoxPosition( ghMoveItemBox, pNewPoint ); SetBoxPosition( ghMoveItemBox, pNewPoint );
CreateDestroyMouseRegionForMoveItemMenu( );
} }
if( ( fShowTrainingMenu == TRUE ) && ( ghTrainingBox != -1 ) ) if( ( fShowTrainingMenu == TRUE ) && ( ghTrainingBox != -1 ) )
@@ -17838,12 +17841,12 @@ void CreateDestroyMouseRegionForMoveItemMenu( void )
if( ( fShowMoveItemMenu == TRUE ) && ( fCreated == FALSE ) ) if( ( fShowMoveItemMenu == TRUE ) && ( fCreated == FALSE ) )
{ {
CheckAndUpdateTacticalAssignmentPopUpPositions( ); // 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 ) ) //if( ( fShowMoveItemMenu ) && ( guiCurrentScreen == MAP_SCREEN ) )
{ //{
//SetBoxPosition( ghMoveItemBox ,RepairPosition); // //SetBoxPosition( ghMoveItemBox ,RepairPosition);
} //}
// grab height of font // grab height of font
iFontHeight = GetLineSpace( ghMoveItemBox ) + GetFontHeight( GetBoxFont( ghMoveItemBox ) ); iFontHeight = GetLineSpace( ghMoveItemBox ) + GetFontHeight( GetBoxFont( ghMoveItemBox ) );