Dynamic dialogue boxes cause less issues when scrolling

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8486 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2017-10-01 11:08:38 +00:00
parent 8de2a8601e
commit a57d9455f3
2 changed files with 18 additions and 12 deletions
+14 -1
View File
@@ -319,6 +319,18 @@ void RefreshBoxes( )
// also halt dialogue if sector inventory is open
if ( guiCurrentScreen == GAME_SCREEN || guiCurrentScreen == MAP_SCREEN && !fShowMapInventoryPool )
{
// if we are scrolling, don't redraw the boxes as often
if (gfScrollPending || gfScrollInertia)
{
UINT32 timepassednotdisplaying = max(0, GetJA2Clock() - lasttimenhere);
if (timepassednotdisplaying < 100)
{
lasttimenhere = GetJA2Clock();
return;
}
}
// refresh all boxes, and while you're at it, check wether there are any
BOOLEAN fFound = FALSE;
for ( UINT8 i = 0; i < MYBOX_NUMBER; ++i )
@@ -344,7 +356,8 @@ void RefreshBoxes( )
else
{
// boxes are active, thus we have to refresh them
fMapPanelDirty = TRUE;
if (guiCurrentScreen == MAP_SCREEN)
fMapPanelDirty = TRUE;
}
}
else
+4 -11
View File
@@ -1239,14 +1239,7 @@ void AddOpinionEvent( UINT8 usProfileA, UINT8 usProfileB, UINT8 usEvent, BOOLEAN
// if this option is turned on, a small message will show us how opinions have changed
if ( gGameExternalOptions.fDynamicOpinionsShowChange )
{
if ( gDynamicOpinionEvent[usEvent].sOpinionModifier >= 0 )
{
ScreenMsg( FONT_MCOLOR_LTGREEN, MSG_INTERFACE, L"%s: %s +%d", gMercProfiles[usProfileA].zNickname, gMercProfiles[usProfileB].zNickname, gDynamicOpinionEvent[usEvent].sOpinionModifier );
}
else
{
ScreenMsg( FONT_MCOLOR_RED, MSG_INTERFACE, L"%s: %s %d", gMercProfiles[usProfileA].zNickname, gMercProfiles[usProfileB].zNickname, gDynamicOpinionEvent[usEvent].sOpinionModifier );
}
ScreenMsg( FONT_MCOLOR_LTGREEN, MSG_INTERFACE, gDynamicOpinionEvent[usEvent].sOpinionModifier >= 0 ? L"%s: %s +%d" : L"%s: %s %d", gMercProfiles[usProfileA].zNickname, gMercProfiles[usProfileB].zNickname, gDynamicOpinionEvent[usEvent].sOpinionModifier );
}
// if dialogue is allowed, set up dialogue
@@ -1743,7 +1736,7 @@ void HandleDynamicOpinionOnContractExtension( UINT8 ubCode, UINT8 usProfile )
if ( pSoldierWhoGotPaid->ubWhatKindOfMercAmI != MERC_TYPE__AIM_MERC )
return;
// determine the remaining length of his contract BEFORE it go renewed
// determine the remaining length of his contract BEFORE it got renewed
INT32 oldcontract = pSoldierWhoGotPaid->iEndofContractTime;
if ( ubCode == EXTENDED_CONTRACT_BY_1_DAY )
oldcontract -= 1440;
@@ -1752,7 +1745,7 @@ void HandleDynamicOpinionOnContractExtension( UINT8 ubCode, UINT8 usProfile )
else if ( ubCode == EXTENDED_CONTRACT_BY_2_WEEKS )
oldcontract -= 14 * 1440;
// someones contract got extended. Other mercs who have less time on their contract will be annoyed by this, as they feel they shoul be paid first
// someones contract got extended. Other mercs who have less time on their contract will be annoyed by this, as they feel they should have been paid first
SOLDIERTYPE* pSoldier = NULL;
UINT16 bMercID = gTacticalStatus.Team[gbPlayerNum].bFirstID;
UINT16 bLastTeamID = gTacticalStatus.Team[gbPlayerNum].bLastID;
@@ -2158,7 +2151,7 @@ void HandleDynamicOpinionChange( SOLDIERTYPE* pSoldier, UINT8 usEvent, BOOLEAN f
break;
}
UINT8 usEventUsed; // it is possible that the individaul event is switched
UINT8 usEventUsed; // it is possible that the individual event is switched
SOLDIERTYPE* pTeamSoldier = NULL;
UINT16 bMercID = gTacticalStatus.Team[gbPlayerNum].bFirstID;
UINT16 bLastTeamID = gTacticalStatus.Team[gbPlayerNum].bLastID;