mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
- Fixed mouse boundary to game window for multi-monitor setup in full screen mode (vanilla bug) (by Buggler)
- Freed 'Ctrl+y' hotkey in tactical & laptop screen for other uses (by Buggler) git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6407 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -193,6 +193,9 @@ extern INT16 ITEMDESC_START_Y;
|
||||
BOOLEAN gfMouseLockedOnBorder = FALSE;
|
||||
extern int iWindowedMode;
|
||||
|
||||
extern BOOLEAN gfInItemStackPopup;
|
||||
extern BOOLEAN gfInKeyRingPopup;
|
||||
|
||||
|
||||
//Little functions called by keyboard input
|
||||
void SwapGoggles(SOLDIERTYPE *pTeamSoldier);
|
||||
@@ -1605,25 +1608,26 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
|
||||
|
||||
// BEGIN: by Lejardo for mouse-locking in game screen
|
||||
// WANNE: If the game runs in windowed mode, the user can "lock" / "unlock" the mouse cursor
|
||||
if (iWindowedMode)
|
||||
if ( iWindowedMode && !gfInKeyRingPopup && !gfInItemStackPopup)
|
||||
{
|
||||
SGPRect LJDRect;
|
||||
if ((InputEvent.usEvent == KEY_DOWN ) && ( InputEvent.usParam == 'z' || InputEvent.usParam == 'y'))
|
||||
if ((InputEvent.usEvent == KEY_DOWN ) && InputEvent.usParam == 'z' )
|
||||
{
|
||||
if( (InputEvent.usKeyState & CTRL_DOWN) && !(InputEvent.usKeyState & ALT_DOWN))
|
||||
{
|
||||
// Unlock the mouse cursor
|
||||
if (gfMouseLockedOnBorder)
|
||||
{
|
||||
FreeMouseCursor();
|
||||
FreeMouseCursor( FALSE );
|
||||
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[MSG_WINDOWED_MODE_RELEASE_MOUSE] );
|
||||
}
|
||||
// Lock the mouse cursor
|
||||
else
|
||||
{
|
||||
{
|
||||
SGPRect LJDRect;
|
||||
|
||||
LJDRect.iLeft = 0;
|
||||
LJDRect.iTop = 0;
|
||||
LJDRect.iTop = 0;
|
||||
LJDRect.iRight = SCREEN_WIDTH;
|
||||
LJDRect.iBottom = SCREEN_HEIGHT;
|
||||
RestrictMouseCursor( &LJDRect );
|
||||
@@ -1631,8 +1635,8 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[MSG_WINDOWED_MODE_LOCK_MOUSE] );
|
||||
}
|
||||
|
||||
gfMouseLockedOnBorder = !gfMouseLockedOnBorder;
|
||||
}
|
||||
gfMouseLockedOnBorder = !gfMouseLockedOnBorder;
|
||||
}
|
||||
}
|
||||
}
|
||||
// END: by Lejardo for mouse-locking in game screen
|
||||
|
||||
Reference in New Issue
Block a user