Merged from revision: 6764

Fixes (by Buggler)
- fixed hotkey switch weapons AP cost and empty hand swap
- adjusted colors for militia equipment item shading
- fixed IMP background button states and previous button array list

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6765 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2014-01-15 13:20:31 +00:00
parent 8d5ed89e14
commit 5f92048f5a
3 changed files with 29 additions and 22 deletions
+13 -9
View File
@@ -72,8 +72,8 @@ INT32 giIMPBackgroundAnswerButton[ IMP_BACKGROUND_DISPLAYED_CHOICES ];
INT32 giIMPBackgroundAnswerButtonImage[ IMP_BACKGROUND_DISPLAYED_CHOICES ];
// this is the Done buttons
INT32 giIMPBackgroundFinsihButton;
INT32 giIMPBackgroundFinsihButtonImage;
INT32 giIMPBackgroundFinishButton;
INT32 giIMPBackgroundFinishButtonImage;
INT8 gbLastSelectedBackground[ 10 ];
@@ -135,15 +135,15 @@ void EnterIMPBackground( void )
return;
}
giIMPBackgroundFinsihButtonImage = LoadButtonImage( "LAPTOP\\button_5.sti" ,-1,0,-1,1,-1 );
giIMPBackgroundFinsihButton = CreateIconAndTextButton( giIMPBackgroundFinsihButtonImage, pImpButtonText[ 24 ], FONT12ARIAL,
giIMPBackgroundFinishButtonImage = LoadButtonImage( "LAPTOP\\button_5.sti" ,-1,0,-1,1,-1 );
giIMPBackgroundFinishButton = CreateIconAndTextButton( giIMPBackgroundFinishButtonImage, pImpButtonText[ 24 ], FONT12ARIAL,
FONT_WHITE, DEFAULT_SHADOW,
FONT_WHITE, DEFAULT_SHADOW,
TEXT_CJUSTIFIED,
LAPTOP_SCREEN_UL_X + ( 350 ), LAPTOP_SCREEN_WEB_UL_Y + ( 340 ), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnIMPBackgroundFinishCallback );
SetButtonCursor( giIMPBackgroundFinsihButton, CURSOR_WWW);
SetButtonCursor( giIMPBackgroundFinishButton, CURSOR_WWW);
//if we are not DONE and are just reviewing
if( iCurrentProfileMode != IMP__FINISH )
@@ -205,8 +205,8 @@ void ExitIMPBackground( void )
MSYS_RemoveRegion( &gMR_BackgroundHelpTextRegions[iCnt] );
}
RemoveButton( giIMPBackgroundFinsihButton );
UnloadButtonImage( giIMPBackgroundFinsihButtonImage );
RemoveButton( giIMPBackgroundFinishButton );
UnloadButtonImage( giIMPBackgroundFinishButtonImage );
}
@@ -542,8 +542,8 @@ void UpdateDisplaySkills( BOOLEAN fIncrease )
// select previous items
else
{
// the last item of our new selection
firstitem = max(0, gBackgroundFirstItem - IMP_BACKGROUND_DISPLAYED_CHOICES);
// the first item of our new selection
firstitem = max(0, gBackgroundFirstItem - IMP_BACKGROUND_DISPLAYED_CHOICES + 1);
lastitem = min(found , firstitem + IMP_BACKGROUND_DISPLAYED_CHOICES - 1);
}
@@ -746,9 +746,11 @@ void BtnIMPBackgroundNextCallback(GUI_BUTTON *btn,INT32 reason)
for( UINT16 uiCnt=0; uiCnt<IMP_BACKGROUND_DISPLAYED_CHOICES; ++uiCnt )
{
gfBackgroundQuestions[ uiCnt ] = FALSE;
ButtonList[ giIMPBackgroundAnswerButton[ uiCnt ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
}
//Have the NONE trait initially selected
gfBackgroundQuestions[ IMP_BACKGROUND_NONE ] = TRUE;
ButtonList[ giIMPBackgroundAnswerButton[ IMP_BACKGROUND_NONE ] ]->uiFlags |= BUTTON_CLICKED_ON;
//reset choice
usBackground = 0;
@@ -781,9 +783,11 @@ void BtnIMPBackgroundPreviousCallback(GUI_BUTTON *btn,INT32 reason)
for( UINT16 uiCnt=0; uiCnt<IMP_BACKGROUND_DISPLAYED_CHOICES; ++uiCnt )
{
gfBackgroundQuestions[ uiCnt ] = FALSE;
ButtonList[ giIMPBackgroundAnswerButton[ uiCnt ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
}
//Have the NONE trait initially selected
gfBackgroundQuestions[ IMP_BACKGROUND_NONE ] = TRUE;
ButtonList[ giIMPBackgroundAnswerButton[ IMP_BACKGROUND_NONE ] ]->uiFlags |= BUTTON_CLICKED_ON;
//reset choice
usBackground = 0;
@@ -652,9 +652,9 @@ BOOLEAN RenderItemInPoolSlot( INT32 iCurrentSlot, INT32 iFirstSlotOnPage )
if ( pInventoryPoolList[ iCurrentSlot + iFirstSlotOnPage ].object.exists() == true)
{
// colour depends on flag
UINT16 usMilitia_EQColor = Get16BPPColor( FROMRGB( 31, 123, 129 ) );
UINT16 usMilitia_EQColor = Get16BPPColor( FROMRGB( 0, 150, 215 ) );
if ( pInventoryPoolList[ iCurrentSlot + iFirstSlotOnPage ].usFlags & WORLD_ITEM_TABOO_FOR_MILITIA_EQ_BLUE )
usMilitia_EQColor = Get16BPPColor( FROMRGB( 57, 4, 155 ) );
usMilitia_EQColor = Get16BPPColor( FROMRGB( 0, 110, 245 ) );
if ( pInventoryPoolList[ iCurrentSlot + iFirstSlotOnPage ].usFlags & WORLD_ITEM_TABOO_FOR_MILITIA_EQ_ELITE )
usMilitia_EQColor = Get16BPPColor( FROMRGB( 156, 37, 3 ) );
+14 -11
View File
@@ -16385,6 +16385,7 @@ void SOLDIERTYPE::SwitchWeapons( BOOLEAN fKnife, BOOLEAN fSideArm )
if (gGameOptions.fInventoryCostsAP)
{
UINT8 APCost = 0;
UINT8 APTotalCost = 0;
if (gGameExternalOptions.uWeightDivisor != 0)
{
// we need to determine moving costs according to slots
@@ -16427,28 +16428,30 @@ void SOLDIERTYPE::SwitchWeapons( BOOLEAN fKnife, BOOLEAN fSideArm )
if (this->inv[retrieveslot].exists())
{
APCost += ( uiAPCostFromSlot[ fromretrieve ] + uiAPCostToSlot [ tohand ] );
APCost = ( uiAPCostFromSlot[ fromretrieve ] + uiAPCostToSlot [ tohand ] );
INT16 weight = (int)((Item[this->inv[retrieveslot].usItem].ubWeight) / gGameExternalOptions.uWeightDivisor);
APCost += DynamicAdjustAPConstants(weight, weight);
APTotalCost += __min(APCost, APBPConstants[AP_INV_MAX_COST]);
}
if (this->inv[HANDPOS].exists())
{
APCost += ( uiAPCostFromSlot [ fromhand ] + uiAPCostToSlot [ tostorage ] );
APCost = ( uiAPCostFromSlot [ fromhand ] + uiAPCostToSlot [ tostorage ] );
INT16 weight = (int)((Item[this->inv[HANDPOS].usItem].ubWeight) / gGameExternalOptions.uWeightDivisor);
APCost += DynamicAdjustAPConstants(weight, weight);
APTotalCost += __min(APCost, APBPConstants[AP_INV_MAX_COST]);
}
}
APCost = __min(APCost, APBPConstants[AP_INV_MAX_COST]);
if (this->bActionPoints >= APCost)
if (this->bActionPoints >= APTotalCost)
{
// SANDRO - I dared to change this to use the apropriate function, as that function is actually important for IIS
//pSoldier->bActionPoints -= APCost;
DeductPoints( this, APCost, 0 );
//pSoldier->bActionPoints -= APTotalCost;
DeductPoints( this, APTotalCost, 0 );
SwapObjs(&this->inv[HANDPOS], &this->inv[retrieveslot]);
// if we store our han item in a different position than the item we retrieve originally was, swap again
if ( handobjstorageslot != retrieveslot )
// if we store our hand item in a different position than the item we retrieve originally was, swap again
if ( handobjstorageslot != retrieveslot && handobjstorageslot != HANDPOS )
SwapObjs(&this->inv[retrieveslot], &this->inv[handobjstorageslot]);
HandleTacticalEffectsOfEquipmentChange(this, HANDPOS, this->inv[retrieveslot].usItem, this->inv[HANDPOS].usItem);
@@ -16456,7 +16459,7 @@ void SOLDIERTYPE::SwitchWeapons( BOOLEAN fKnife, BOOLEAN fSideArm )
else
{
CHAR16 zOutputString[512];
swprintf( zOutputString, New113Message[MSG113_INVENTORY_APS_INSUFFICIENT], APCost, this->bActionPoints);
swprintf( zOutputString, New113Message[MSG113_INVENTORY_APS_INSUFFICIENT], APTotalCost, this->bActionPoints);
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, zOutputString );
}
}
@@ -16464,8 +16467,8 @@ void SOLDIERTYPE::SwitchWeapons( BOOLEAN fKnife, BOOLEAN fSideArm )
{
SwapObjs(&this->inv[HANDPOS], &this->inv[retrieveslot]);
// if we store our han item in a different position than the item we retrieve originally was, swap again
if ( handobjstorageslot != retrieveslot )
// if we store our hand item in a different position than the item we retrieve originally was, swap again
if ( handobjstorageslot != retrieveslot && handobjstorageslot != HANDPOS )
SwapObjs(&this->inv[retrieveslot], &this->inv[handobjstorageslot]);
HandleTacticalEffectsOfEquipmentChange(this, HANDPOS, this->inv[retrieveslot].usItem, this->inv[HANDPOS].usItem);