mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
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:
@@ -162,6 +162,7 @@ UINT32 guiMapBottomTimeButtonsImage[ 2 ];
|
||||
|
||||
// mouse regions
|
||||
MOUSE_REGION gMapMessageScrollBarRegion;
|
||||
MOUSE_REGION gMapMessageRegion;
|
||||
MOUSE_REGION gMapPauseRegion;
|
||||
|
||||
MOUSE_REGION gTimeCompressionMask[ 3 ];
|
||||
@@ -1045,12 +1046,16 @@ void CreateMapScreenBottomMessageScrollBarRegion( void )
|
||||
MSYS_DefineRegion( &gMapMessageScrollBarRegion, MESSAGE_SCROLL_AREA_START_X, MESSAGE_SCROLL_AREA_START_Y,
|
||||
MESSAGE_SCROLL_AREA_END_X, MESSAGE_SCROLL_AREA_END_Y,
|
||||
MSYS_PRIORITY_NORMAL, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, MapScreenMessageScrollBarCallBack );
|
||||
|
||||
MSYS_DefineRegion(&gMapMessageRegion, (INT16)(xResOffset + 4), MESSAGE_SCROLL_AREA_START_Y, MESSAGE_SCROLL_AREA_END_X, MESSAGE_SCROLL_AREA_END_Y,
|
||||
MSYS_PRIORITY_NORMAL, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, MSYS_NO_CALLBACK);
|
||||
}
|
||||
|
||||
|
||||
void DeleteMapScreenBottomMessageScrollRegion( void )
|
||||
{
|
||||
MSYS_RemoveRegion( &gMapMessageScrollBarRegion );
|
||||
MSYS_RemoveRegion(&gMapMessageRegion);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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 )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user