allowed mouse wheel to work in map screen message log area

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9165 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Shadooow
2021-09-10 20:53:57 +00:00
parent ac3d9a9ec8
commit 79bd483fe4
2 changed files with 28 additions and 0 deletions
+23
View File
@@ -613,6 +613,7 @@ MOUSE_REGION gMapScreenMaskRegion;
MOUSE_REGION gTrashCanRegion;
MOUSE_REGION gMapMercWeightRegion;
MOUSE_REGION gMapMercCamoRegion;
extern MOUSE_REGION gMapMessageRegion;
// mouse regions for team info panel
MOUSE_REGION gTeamListNameRegion[ CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS ];
@@ -718,6 +719,7 @@ extern BOOLEAN gfMilitiaPopupCreated;
// PROTOTYPES
// basic input
void GetMapKeyboardInput( UINT32 *puiNewEvent );
void PollWheelInMapView(UINT32 *puiNewEvent);
void PollLeftButtonInMapView( UINT32 *puiNewEvent );
void PollRightButtonInMapView( UINT32 *puiNewEvent );
@@ -6467,6 +6469,7 @@ UINT32 HandleMapUI( )
// Get mouse
PollLeftButtonInMapView( &uiNewEvent );
PollRightButtonInMapView( &uiNewEvent );
PollWheelInMapView(&uiNewEvent);
// Switch on event
switch( uiNewEvent )
@@ -8886,6 +8889,26 @@ void RenderMapHighlight( INT16 sMapX, INT16 sMapY, UINT16 usLineColor, BOOLEAN f
UnLockVideoSurface( FRAME_BUFFER );
}
void PollWheelInMapView(UINT32 *puiNewEvent)
{
gMapMessageRegion.WheelState = gMapMessageRegion.WheelState * (gGameSettings.fOptions[TOPTION_INVERT_WHEEL] ? -1 : 1);
if (gMapMessageRegion.uiFlags & MSYS_MOUSE_IN_AREA)
{
if (gMapMessageRegion.WheelState != 0)
{
if (gMapMessageRegion.WheelState > 0)
{
MapScreenMsgScrollUp(1);
}
else
{
MapScreenMsgScrollDown(1);
}
ResetWheelState(&gMapMessageRegion);
}
}
}
void PollLeftButtonInMapView( UINT32 *puiNewEvent )
{