diff --git a/GameSettings.cpp b/GameSettings.cpp index 85af7cf31..71283fd2c 100644 --- a/GameSettings.cpp +++ b/GameSettings.cpp @@ -1569,6 +1569,7 @@ void LoadGameExternalOptions() #endif gGameExternalOptions.fDisableLaptopTransition = iniReader.ReadBoolean("Laptop Settings", "DISABLE_LAPTOP_TRANSITION", FALSE); gGameExternalOptions.fFastWWWSitesLoading = iniReader.ReadBoolean("Laptop Settings", "FAST_WWW_SITES_LOADING", FALSE); + gGameExternalOptions.fLaptopMouseCaptured = iniReader.ReadBoolean("Laptop Settings", "LAPTOP_MOUSE_CAPTURED", FALSE); //################# Bobby Ray Settings ################## diff --git a/GameSettings.h b/GameSettings.h index 14796223f..2e4e34850 100644 --- a/GameSettings.h +++ b/GameSettings.h @@ -730,6 +730,9 @@ typedef struct // CHRISL: Skyrider and enemy occupied sectors UINT8 ubSkyriderHotLZ; + // Laptop mouse capturing + BOOLEAN fLaptopMouseCaptured; + // WANNE: Fast loading settings BOOLEAN fDisableLaptopTransition; BOOLEAN fFastWWWSitesLoading; diff --git a/Laptop/AimMembers.cpp b/Laptop/AimMembers.cpp index 82e1e7bf3..d2d5bcad2 100644 --- a/Laptop/AimMembers.cpp +++ b/Laptop/AimMembers.cpp @@ -95,7 +95,7 @@ #define HIGH_STAT_COLOR FONT_MCOLOR_WHITE #define MED_STAT_COLOR FONT_MCOLOR_DKWHITE -#define LOW_STAT_COLOR FONT_MCOLOR_DKWHITE +#define LOW_STAT_COLOR FONT_MCOLOR_DKGRAY #define SIZE_MERC_BIO_INFO 400 * 2 #define SIZE_MERC_ADDITIONAL_INFO 160 * 2 @@ -181,6 +181,9 @@ #define NEXT_BR_X NEXT_X + BOTTOM_BUTTON_START_WIDTH #define NEXT_BR_Y NEXT_BOX_Y + BOTTOM_BUTTON_START_HEIGHT +#define PAGE_X iScreenWidthOffset + 582 +#define PAGE_Y PREVIOUS_Y + 4 + #define AIM_MERC_INFO_X iScreenWidthOffset + 124 #define AIM_MERC_INFO_Y iScreenHeightOffset + 223 + LAPTOP_SCREEN_WEB_DELTA_Y @@ -2152,6 +2155,7 @@ BOOLEAN DisplayMercsFace() void DisplayMercStats() { UINT8 ubColor; + CHAR16 sPage[60]; if(gGameExternalOptions.gfUseNewStartingGearInterface) { // @@ -2326,13 +2330,17 @@ void DisplayMercStats() ubColor = GetStatColor( gMercProfiles[gbCurrentSoldier].bMedical ); DrawNumeralsToScreen(gMercProfiles[gbCurrentSoldier].bMedical, 3, STATS_SECOND_NUM, MEDICAL_Y, AIM_M_NUMBER_FONT, ubColor ); } + + //Buggler: Display current AIM index & total AIM members at the bottom of the screen + swprintf( sPage, L"%d / %d", gbCurrentIndex + 1, MAX_NUMBER_MERCS ); + DrawTextToScreen(sPage, PAGE_X, PAGE_Y, 0, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED); } UINT8 GetStatColor( INT8 bStat ) { if( bStat >= 80 ) return( HIGH_STAT_COLOR ); - else if( bStat >= 50 ) + else if( bStat >= 20 ) return( MED_STAT_COLOR ); else return( LOW_STAT_COLOR ); @@ -5076,6 +5084,22 @@ void HandleAimMemberKeyBoardInput() InitCreateDeleteAimPopUpBox(AIM_POPUP_DELETE, NULL, NULL, 0, 0, 0); } break; + case BACKSPACE: + if( gubPopUpBoxAction != AIM_POPUP_DISPLAY ) + { + if( gubVideoConferencingMode != AIM_VIDEO_NOT_DISPLAYED_MODE ) + { + // close video conference + gubVideoConferencingMode = AIM_VIDEO_POPDOWN_MODE; + //gubVideoConferencingMode = AIM_VIDEO_NOT_DISPLAYED_MODE; + } + else + { + // back to AIM Facial Index Screen + guiCurrentLaptopMode = LAPTOP_MODE_AIM_MEMBERS_FACIAL_INDEX; + } + } + break; #ifdef JA2TESTVERSION case SPACE: QuickHireMerc(); @@ -5158,6 +5182,44 @@ void HandleAimMemberKeyBoardInput() break; } } + else if( InputEvent.usEvent == KEY_REPEAT ) + { + switch( InputEvent.usParam ) + { + case LEFTARROW: + // previous button + InitCreateDeleteAimPopUpBox(AIM_POPUP_DELETE, NULL, NULL, 0, 0, 0); + + if( gbCurrentIndex > 0) + gbCurrentIndex--; + else + gbCurrentIndex = MAX_NUMBER_MERCS - 1; + + //gbCurrentSoldier = AimMercArray[gbCurrentIndex]; + gbCurrentSoldier = gAimAvailability[AimMercArray[gbCurrentIndex]].ProfilId; + gbCurrentSoldierBio = gAimAvailability[AimMercArray[gbCurrentIndex]].AimBio; + gubVideoConferencingMode = AIM_VIDEO_NOT_DISPLAYED_MODE; + + gfRedrawScreen = TRUE; + break; + case RIGHTARROW: + // next button + InitCreateDeleteAimPopUpBox(AIM_POPUP_DELETE, NULL, NULL, 0, 0, 0); + + if( gbCurrentIndex < MAX_NUMBER_MERCS -1 ) + gbCurrentIndex++; + else + gbCurrentIndex = 0; + + //gbCurrentSoldier = AimMercArray[gbCurrentIndex]; + gbCurrentSoldier = gAimAvailability[AimMercArray[gbCurrentIndex]].ProfilId; + gbCurrentSoldierBio = gAimAvailability[AimMercArray[gbCurrentIndex]].AimBio; + gubVideoConferencingMode = AIM_VIDEO_NOT_DISPLAYED_MODE; + + gfRedrawScreen = TRUE; + break; + } + } } } diff --git a/Laptop/BobbyRGuns.cpp b/Laptop/BobbyRGuns.cpp index 440e5a63a..39ca37a65 100644 --- a/Laptop/BobbyRGuns.cpp +++ b/Laptop/BobbyRGuns.cpp @@ -134,6 +134,9 @@ #define BOBBYR_ORDER_SUBTOTAL_X iScreenWidthOffset + 470//490 #define BOBBYR_ORDER_SUBTOTAL_Y BOBBYR_ORDER_FORM_Y+2//BOBBYR_HOME_BUTTON_Y +#define BOBBYR_ORDER_PAGE_X iScreenWidthOffset + 285 +#define BOBBYR_ORDER_PAGE_Y BOBBYR_ORDER_FORM_Y+2//BOBBYR_HOME_BUTTON_Y + #define BOBBYR_PERCENT_FUNTCIONAL_X BOBBYR_ORDER_SUBTOTAL_X #define BOBBYR_PERCENT_FUNTCIONAL_Y BOBBYR_ORDER_SUBTOTAL_Y + 15 @@ -1393,6 +1396,7 @@ BOOLEAN DisplayItemInfo(UINT32 uiItemClass, INT32 iFilter, INT32 iSubFilter) UINT16 usItemIndex; CHAR16 sDollarTemp[60]; CHAR16 sTemp[60]; + CHAR16 sPage[60]; INT16 pItemNumbers[ BOBBYR_NUM_WEAPONS_ON_PAGE ]; BOOLEAN bAddItem = FALSE; @@ -1406,6 +1410,10 @@ BOOLEAN DisplayItemInfo(UINT32 uiItemClass, INT32 iFilter, INT32 iSubFilter) swprintf( sTemp, L"%s %s", BobbyRText[BOBBYR_GUNS_SUB_TOTAL], sDollarTemp ); DrawTextToScreen(sTemp, BOBBYR_ORDER_SUBTOTAL_X, BOBBYR_ORDER_SUBTOTAL_Y, 0, BOBBYR_ORDER_TITLE_FONT, BOBBYR_ORDER_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED | TEXT_SHADOWED); + //Buggler: Display the current page & total pages at the bottom of the screen + swprintf( sPage, L"%d / %d", gubCurPage + 1, gubNumPages ); + DrawTextToScreen(sPage, BOBBYR_ORDER_PAGE_X, BOBBYR_ORDER_PAGE_Y, 0, BOBBYR_ORDER_TITLE_FONT, BOBBYR_ORDER_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED | TEXT_SHADOWED); + //Display the Used item disclaimer if( gfOnUsedPage ) { @@ -3880,16 +3888,24 @@ void HandleBobbyRGunsKeyBoardInput() case LEFTARROW: // previous page if( gubCurPage > 0 ) - gubCurPage--; - + { + if( fCtrl ) + gubCurPage = 0; + else + gubCurPage--; + } fReDrawScreenFlag = TRUE; fPausedReDrawScreenFlag = TRUE; break; case RIGHTARROW: // next page if( gubCurPage < gubNumPages - 1 ) - gubCurPage++; - + { + if( fCtrl ) + gubCurPage = gubNumPages - 1; + else + gubCurPage++; + } fReDrawScreenFlag = TRUE; fPausedReDrawScreenFlag = TRUE; break; @@ -4008,6 +4024,38 @@ void HandleBobbyRGunsKeyBoardInput() { switch( InputEvent.usParam ) { + case LEFTARROW: + // previous page + if( gubCurPage > 0 ) + gubCurPage--; + + fReDrawScreenFlag = TRUE; + fPausedReDrawScreenFlag = TRUE; + break; + case RIGHTARROW: + // next page + if( gubCurPage < gubNumPages - 1 ) + gubCurPage++; + + fReDrawScreenFlag = TRUE; + fPausedReDrawScreenFlag = TRUE; + break; + case SHIFT_LEFTARROW: + // jump to 5 pages back + if( gubCurPage > 0 ) + gubCurPage = __max(gubCurPage - 5, 0); + + fReDrawScreenFlag = TRUE; + fPausedReDrawScreenFlag = TRUE; + break; + case SHIFT_RIGHTARROW: + // jump to 5 pages forward + if( gubCurPage < gubNumPages - 1 ) + gubCurPage = __min(gubNumPages - 1, gubCurPage + 5); + + fReDrawScreenFlag = TRUE; + fPausedReDrawScreenFlag = TRUE; + break; case '1': // 1st item on screen if( ( ( gubNumPages > 0 ) && ( gubCurPage != gubNumPages - 1 ) ) || diff --git a/Laptop/laptop.cpp b/Laptop/laptop.cpp index 836975671..e57adb564 100644 --- a/Laptop/laptop.cpp +++ b/Laptop/laptop.cpp @@ -82,6 +82,7 @@ #include "cheats.h" #include "Strategic Status.h" #include "Arms Dealer Init.h" + #include "GameSettings.h" #endif #include "connect.h" @@ -504,9 +505,6 @@ BOOLEAN gfWWWaitSubSitesVisitedFlags[LAPTOP_MODE_SIRTECH - LAPTOP_MODE_WWW ]; //INT32 iBookMarkList[MAX_BOOKMARKS]; -// flag to see if mouse is captured in the laptop's area or not -BOOLEAN fMouseCaptured; - // mouse regions MOUSE_REGION gEmailRegion; MOUSE_REGION gWWWRegion; @@ -802,8 +800,6 @@ UINT32 LaptopScreenInit() gfAtLeastOneMercWasHired = FALSE; - fMouseCaptured = TRUE; - //No longer inits the laptop screens, now InitLaptopAndLaptopScreens() does #ifdef JA2UB InitJa25SaveStruct(); @@ -1058,6 +1054,12 @@ INT32 EnterLaptop() fShowAtmPanelStartButton = TRUE; + // lock cursor to screen + if ( gGameExternalOptions.fLaptopMouseCaptured == TRUE ) + { + RestrictMouseCursor( &LaptopScreenRect ); + } + InvalidateRegion(0,0,SCREEN_WIDTH, SCREEN_HEIGHT); return( TRUE ); @@ -1065,9 +1067,6 @@ INT32 EnterLaptop() void ExitLaptop() { - - fMouseCaptured = TRUE; - // exit is called due to message box, leave if( fExitDueToMessageBox ) { @@ -1102,7 +1101,6 @@ void ExitLaptop() //} // release cursor - fMouseCaptured = false; FreeMouseCursor( ); // set the fact we are currently not in laptop, for rendering purposes @@ -2179,14 +2177,6 @@ UINT32 LaptopScreenHandle() RestoreBackgroundRects(); - // lock cursor to screen - if ( fMouseCaptured == TRUE ) - { - RestrictMouseCursor( &LaptopScreenRect ); - } - - - // handle animated cursors HandleAnimatedCursors( ); // Deque all game events @@ -6013,18 +6003,16 @@ void HandleKeyBoardShortCutsForLapTop( UINT16 usEvent, UINT32 usParam, UINT16 us MarkButtonsDirty( ); } } - else if( ( ( usEvent == KEY_DOWN ) || ( usEvent == KEY_REPEAT ) ) && ( ( usParam == 'z' ) || ( usParam == 'Z' ) || ( usParam == 'y' ) || ( usParam == 'Y' ) ) ) + else if( ( ( usEvent == KEY_DOWN ) || ( usEvent == KEY_REPEAT ) ) && ( ( usParam == 'z' ) || ( usParam == 'y' ) ) ) { if ( usKeyState & CTRL_DOWN ) { - if ( fMouseCaptured == TRUE ) + if( IsCursorRestricted( ) ) { - fMouseCaptured = FALSE; FreeMouseCursor( ); } else { - fMouseCaptured = TRUE; RestrictMouseCursor( &LaptopScreenRect ); } diff --git a/Laptop/mercs Files.cpp b/Laptop/mercs Files.cpp index d263d4653..184dcaac8 100644 Binary files a/Laptop/mercs Files.cpp and b/Laptop/mercs Files.cpp differ diff --git a/Strategic/mapscreen.cpp b/Strategic/mapscreen.cpp index 260376623..3dd26fbb5 100644 --- a/Strategic/mapscreen.cpp +++ b/Strategic/mapscreen.cpp @@ -8251,7 +8251,6 @@ void GetMapKeyboardInput( UINT32 *puiNewEvent ) // next character GoToNextCharacterInList( ); break; - case UPARROW: // up a line MapScreenMsgScrollUp( 1 ); @@ -8268,6 +8267,28 @@ void GetMapKeyboardInput( UINT32 *puiNewEvent ) // down a page MapScreenMsgScrollDown( MAX_MESSAGES_ON_MAP_BOTTOM ); break; + case ',': + if( fShowMapInventoryPool == TRUE ) + { + // if can go to previous page, go there + if( iCurrentInventoryPoolPage > 0 ) + { + iCurrentInventoryPoolPage--; + fMapPanelDirty = TRUE; + } + } + break; + case '.': + if( fShowMapInventoryPool == TRUE ) + { + // if can go to next page, go there + if( iCurrentInventoryPoolPage < ( iLastInventoryPoolPage ) ) + { + iCurrentInventoryPoolPage++; + fMapPanelDirty = TRUE; + } + } + break; } } else diff --git a/Tactical/Turn Based Input.cpp b/Tactical/Turn Based Input.cpp index 4ffe163d9..1948e92cb 100644 --- a/Tactical/Turn Based Input.cpp +++ b/Tactical/Turn Based Input.cpp @@ -4531,6 +4531,10 @@ void GetKeyboardInput( UINT32 *puiNewEvent ) } } } + else if ( fCtrl ) + { + // used for "lock" / "unlock" the mouse cursor in windowed mode + } else { // nothing in hand and either not in SM panel, or the matching button is enabled if we are in SM panel