diff --git a/Laptop/BobbyRAmmo.cpp b/Laptop/BobbyRAmmo.cpp index 050b3912..338ad4b1 100644 --- a/Laptop/BobbyRAmmo.cpp +++ b/Laptop/BobbyRAmmo.cpp @@ -73,6 +73,7 @@ void ExitBobbyRAmmo() void HandleBobbyRAmmo() { + HandleBobbyRGuns(); } void RenderBobbyRAmmo() diff --git a/Laptop/BobbyRArmour.cpp b/Laptop/BobbyRArmour.cpp index 2a44a7bc..61034b74 100644 --- a/Laptop/BobbyRArmour.cpp +++ b/Laptop/BobbyRArmour.cpp @@ -71,6 +71,7 @@ void ExitBobbyRArmour() void HandleBobbyRArmour() { + HandleBobbyRGuns(); } void RenderBobbyRArmour() diff --git a/Laptop/BobbyRGuns.cpp b/Laptop/BobbyRGuns.cpp index 482bedd7..bb5db0d8 100644 --- a/Laptop/BobbyRGuns.cpp +++ b/Laptop/BobbyRGuns.cpp @@ -16,11 +16,11 @@ #include "Finances.h" #include "AimMembers.h" #include "Overhead.h" - #include "Text.h" #include "Weapons.h" #include "GameSettings.h" #include "Points.h" #include "Multi Language Graphic Utils.h" + #include "english.h" // HEADROCK HAM 4 #include "input.h" #endif @@ -245,6 +245,8 @@ UINT16 gusLastItemIndex=0; UINT16 gusFirstItemIndex=0; UINT8 gubNumItemsOnScreen; UINT8 gubNumPages; +UINT8 gubNumPagesMod; + BOOLEAN gfBigImageMouseRegionCreated; UINT16 gusItemNumberForItemsOnScreen[ BOBBYR_NUM_WEAPONS_ON_PAGE ]; @@ -326,6 +328,8 @@ void BobbyrRGunsHelpTextDoneCallBack( void ); void ReportBobbyROrderError( UINT16 usItemNumber, UINT8 ubPurchaseNum, UINT8 ubQtyOnHand, UINT8 ubNumPurchasing ); #endif +//Hotkey Assignment +void HandleBobbyRGunsKeyBoardInput(); void GameInitBobbyRGuns() { @@ -406,6 +410,8 @@ void ExitBobbyRGuns() void HandleBobbyRGuns() { + //Hotkey Assignment + HandleBobbyRGunsKeyBoardInput(); } void RenderBobbyRGuns() @@ -1306,11 +1312,11 @@ void BtnBobbyRNextPreviousPageCallback(GUI_BUTTON *btn,INT32 reason) //else next screen else { - if( gubCurPage < gubNumPages-1 ) + if( gubCurPage < gubNumPages - 1 ) { if (_KeyDown( 16 ) ) // SHIFT { - gubCurPage = __min(gubNumPages, gubCurPage+5); + gubCurPage = __min(gubNumPages - 1, gubCurPage + 5); } else { @@ -2283,7 +2289,8 @@ void SetFirstLastPagesForNew( UINT32 uiClassMask, INT32 iFilter ) gusFirstItemIndex = (UINT16)sFirst; gusLastItemIndex = (UINT16)sLast; gubNumPages = (UINT8)( ubNumItems / (FLOAT)BOBBYR_NUM_WEAPONS_ON_PAGE ); - if( (ubNumItems % BOBBYR_NUM_WEAPONS_ON_PAGE ) != 0 ) + gubNumPagesMod = ubNumItems % BOBBYR_NUM_WEAPONS_ON_PAGE; + if( gubNumPagesMod != 0 ) gubNumPages += 1; } @@ -2383,7 +2390,8 @@ void SetFirstLastPagesForUsed(INT32 iFilter) gusFirstItemIndex = (UINT16)sFirst; gusLastItemIndex = (UINT16)sLast; gubNumPages = (UINT8)( ubNumItems / (FLOAT)BOBBYR_NUM_WEAPONS_ON_PAGE ); - if( (ubNumItems % BOBBYR_NUM_WEAPONS_ON_PAGE ) != 0 ) + gubNumPagesMod = ubNumItems % BOBBYR_NUM_WEAPONS_ON_PAGE; + if( gubNumPagesMod != 0 ) gubNumPages += 1; } @@ -3719,14 +3727,195 @@ void ReportBobbyROrderError( UINT16 usItemNumber, UINT8 ubPurchaseNum, UINT8 ubQ } #endif +void HandleBobbyRGunsKeyBoardInput() +{ + InputAtom InputEvent; + BOOLEAN fCtrl, fAlt; + fCtrl = _KeyDown( CTRL ); + fAlt = _KeyDown( ALT ); + while (DequeueEvent(&InputEvent) == TRUE) + { + if( InputEvent.usEvent == KEY_DOWN ) + { + 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 ENTER: + // order form + guiCurrentLaptopMode = LAPTOP_MODE_BOBBY_R_MAILORDER; + break; + case '1': + // 1st item on screen + if( ( ( gubNumPages > 0 ) && ( gubCurPage != gubNumPages - 1 ) ) || + ( ( gubCurPage == gubNumPages - 1 ) ) ) + { + if( fCtrl ) + UnPurchaseBobbyRayItem(gusItemNumberForItemsOnScreen[ 0 ], FALSE); + else + PurchaseBobbyRayItem(gusItemNumberForItemsOnScreen[ 0 ], FALSE); + } + break; + case '2': + // 2nd item on screen + if( ( ( gubNumPages > 0 ) && ( gubCurPage != gubNumPages - 1 ) ) || + ( ( gubCurPage == gubNumPages - 1 ) && ( ( gubNumPagesMod == 0 ) || ( gubNumPagesMod >= 2 ) ) ) ) + { + if( fCtrl ) + UnPurchaseBobbyRayItem(gusItemNumberForItemsOnScreen[ 1 ], FALSE); + else + PurchaseBobbyRayItem(gusItemNumberForItemsOnScreen[ 1 ], FALSE); + } + break; + case '3': + // 3rd item on screen + if( ( ( gubNumPages > 0 ) && ( gubCurPage != gubNumPages - 1 ) ) || + ( ( gubCurPage == gubNumPages - 1 ) && ( ( gubNumPagesMod == 0 ) || ( gubNumPagesMod >= 3 ) ) ) ) { + if( fCtrl ) + UnPurchaseBobbyRayItem(gusItemNumberForItemsOnScreen[ 2 ], FALSE); + else + PurchaseBobbyRayItem(gusItemNumberForItemsOnScreen[ 2 ], FALSE); + } + break; + case '4': + // 4th item on screen + if( ( ( gubNumPages > 0 ) && ( gubCurPage != gubNumPages - 1 ) ) || + ( ( gubCurPage == gubNumPages -1 ) && ( gubNumPagesMod == 0 ) ) ) + { + if( fCtrl ) + UnPurchaseBobbyRayItem(gusItemNumberForItemsOnScreen[ 3 ], FALSE); + else + PurchaseBobbyRayItem(gusItemNumberForItemsOnScreen[ 3 ], FALSE); + } + break; + case '!': + // 1st item on screen all at once + if( ( ( gubNumPages > 0 ) && ( gubCurPage != gubNumPages - 1 ) ) || + ( ( gubCurPage == gubNumPages - 1 ) ) ) + { + if( fCtrl ) + UnPurchaseBobbyRayItem(gusItemNumberForItemsOnScreen[ 0 ], TRUE); + else + PurchaseBobbyRayItem(gusItemNumberForItemsOnScreen[ 0 ], TRUE); + } + break; + case '@': + // 2nd item on screen all at once + if( ( ( gubNumPages > 0 ) && ( gubCurPage != gubNumPages - 1 ) ) || + ( ( gubCurPage == gubNumPages - 1 ) && ( ( gubNumPagesMod == 0 ) || ( gubNumPagesMod >= 2 ) ) ) ) + { + if( fCtrl ) + UnPurchaseBobbyRayItem(gusItemNumberForItemsOnScreen[ 1 ], TRUE); + else + PurchaseBobbyRayItem(gusItemNumberForItemsOnScreen[ 1 ], TRUE); + } + break; + case '#': + // 3rd item on screen all at once + if( ( ( gubNumPages > 0 ) && ( gubCurPage != gubNumPages - 1 ) ) || + ( ( gubCurPage == gubNumPages - 1 ) && ( ( gubNumPagesMod == 0 ) || ( gubNumPagesMod >= 3 ) ) ) ) { + if( fCtrl ) + UnPurchaseBobbyRayItem(gusItemNumberForItemsOnScreen[ 2 ], TRUE); + else + PurchaseBobbyRayItem(gusItemNumberForItemsOnScreen[ 2 ], TRUE); + } + break; + case '$': + // 4th item on screen all at once + if( ( ( gubNumPages > 0 ) && ( gubCurPage != gubNumPages - 1 ) ) || + ( ( gubCurPage == gubNumPages -1 ) && ( gubNumPagesMod == 0 ) ) ) + { + if( fCtrl ) + UnPurchaseBobbyRayItem(gusItemNumberForItemsOnScreen[ 3 ], TRUE); + else + PurchaseBobbyRayItem(gusItemNumberForItemsOnScreen[ 3 ], TRUE); + } + break; + default: + HandleKeyBoardShortCutsForLapTop( InputEvent.usEvent, InputEvent.usParam, InputEvent.usKeyState ); + break; + } + } + else if( InputEvent.usEvent == KEY_REPEAT ) + { + switch( InputEvent.usParam ) + { + case '1': + // 1st item on screen + if( ( ( gubNumPages > 0 ) && ( gubCurPage != gubNumPages - 1 ) ) || + ( ( gubCurPage == gubNumPages - 1 ) ) ) + { + if( fCtrl ) + UnPurchaseBobbyRayItem(gusItemNumberForItemsOnScreen[ 0 ], FALSE); + else + PurchaseBobbyRayItem(gusItemNumberForItemsOnScreen[ 0 ], FALSE); + } + break; + case '2': + // 2nd item on screen + if( ( ( gubNumPages > 0 ) && ( gubCurPage != gubNumPages - 1 ) ) || + ( ( gubCurPage == gubNumPages - 1 ) && ( ( gubNumPagesMod == 0 ) || ( gubNumPagesMod >= 2 ) ) ) ) + { + if( fCtrl ) + UnPurchaseBobbyRayItem(gusItemNumberForItemsOnScreen[ 1 ], FALSE); + else + PurchaseBobbyRayItem(gusItemNumberForItemsOnScreen[ 1 ], FALSE); + } + break; + case '3': + // 3rd item on screen + if( ( ( gubNumPages > 0 ) && ( gubCurPage != gubNumPages - 1 ) ) || + ( ( gubCurPage == gubNumPages - 1 ) && ( ( gubNumPagesMod == 0 ) || ( gubNumPagesMod >= 3 ) ) ) ) { + if( fCtrl ) + UnPurchaseBobbyRayItem(gusItemNumberForItemsOnScreen[ 2 ], FALSE); + else + PurchaseBobbyRayItem(gusItemNumberForItemsOnScreen[ 2 ], FALSE); + } + break; + case '4': + // 4th item on screen + if( ( ( gubNumPages > 0 ) && ( gubCurPage != gubNumPages - 1 ) ) || + ( ( gubCurPage == gubNumPages -1 ) && ( gubNumPagesMod == 0 ) ) ) + { + if( fCtrl ) + UnPurchaseBobbyRayItem(gusItemNumberForItemsOnScreen[ 3 ], FALSE); + else + PurchaseBobbyRayItem(gusItemNumberForItemsOnScreen[ 3 ], FALSE); + } + break; + } + } + } +} \ No newline at end of file diff --git a/Laptop/BobbyRMisc.cpp b/Laptop/BobbyRMisc.cpp index b79e4db4..aecee5cb 100644 --- a/Laptop/BobbyRMisc.cpp +++ b/Laptop/BobbyRMisc.cpp @@ -73,6 +73,7 @@ void ExitBobbyRMisc() void HandleBobbyRMisc() { + HandleBobbyRGuns(); } void RenderBobbyRMisc() diff --git a/Laptop/BobbyRUsed.cpp b/Laptop/BobbyRUsed.cpp index cbea1785..e495b9d1 100644 --- a/Laptop/BobbyRUsed.cpp +++ b/Laptop/BobbyRUsed.cpp @@ -71,6 +71,7 @@ void ExitBobbyRUsed() void HandleBobbyRUsed() { + HandleBobbyRGuns(); } void RenderBobbyRUsed() diff --git a/Laptop/mercs Files.cpp b/Laptop/mercs Files.cpp index 3f7e096b..5f4d0326 100644 Binary files a/Laptop/mercs Files.cpp and b/Laptop/mercs Files.cpp differ diff --git a/Utils/_EnglishText.cpp b/Utils/_EnglishText.cpp index 0568aed9..a0287e73 100644 --- a/Utils/_EnglishText.cpp +++ b/Utils/_EnglishText.cpp @@ -4230,7 +4230,7 @@ STR16 BobbyRText[] = //Popup that tells the player that they can only order 10 items at a time - L"Darn! This here on-line order form will only accept 10 items per order. If you're looking to order more stuff (and we hope you are), kindly make a separate order and accept our apologies.", + L"Darn! This on-line order form will only accept 10 items per order. If you're looking to order more stuff (and we hope you are), kindly make a separate order and accept our apologies.", // A popup that tells the user that they are trying to order more items then the store has in stock diff --git a/Utils/_TaiwaneseText.cpp b/Utils/_TaiwaneseText.cpp index aab0b52c..eee887a3 100644 --- a/Utils/_TaiwaneseText.cpp +++ b/Utils/_TaiwaneseText.cpp @@ -4231,7 +4231,7 @@ STR16 BobbyRText[] = //Popup that tells the player that they can only order 10 items at a time - L"Darn! This here on-line order form will only accept 10 items per order. If you're looking to order more stuff (and we hope you are), kindly make a separate order and accept our apologies.", + L"Darn! This on-line order form will only accept 10 items per order. If you're looking to order more stuff (and we hope you are), kindly make a separate order and accept our apologies.", // A popup that tells the user that they are trying to order more items then the store has in stock