- 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:
Wanne
2013-09-16 06:22:00 +00:00
parent 0f17320e8f
commit c3d88744b9
15 changed files with 48 additions and 30 deletions
+12 -8
View File
@@ -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