diff --git a/Laptop/BobbyRGuns.cpp b/Laptop/BobbyRGuns.cpp index a4fab9ca..3014f971 100644 --- a/Laptop/BobbyRGuns.cpp +++ b/Laptop/BobbyRGuns.cpp @@ -2000,7 +2000,10 @@ UINT16 DisplayLBEInfo(UINT16 usPosY, UINT16 usIndex, UINT16 usFontHeight) } else { - mbstowcs(pName,LBEPocketType[count].pName,80); + //mbstowcs(pName,LBEPocketType[count].pName,80); + for(UINT8 i = 0; i<14; i++) + pName[i] = LBEPocketType[count].pName[i]; + //pName = LBEPocketType[count].pName; pName[14] = '\0'; swprintf(sTemp, L"%s(x%d)", pName, pocketNum[count] ); DrawTextToScreen(sTemp, BOBBYR_ITEM_WEIGHT_TEXT_X, (UINT16)usPosY, BOBBYR_ITEM_WEIGHT_NUM_WIDTH, BOBBYR_ITEM_DESC_TEXT_FONT, BOBBYR_ITEM_DESC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED); @@ -3409,3 +3412,6 @@ void ReportBobbyROrderError( UINT16 usItemNumber, UINT8 ubPurchaseNum, UINT8 ubQ + + + diff --git a/Strategic/Map Screen Interface Map Inventory.cpp b/Strategic/Map Screen Interface Map Inventory.cpp index 4cebaaab..78323832 100644 --- a/Strategic/Map Screen Interface Map Inventory.cpp +++ b/Strategic/Map Screen Interface Map Inventory.cpp @@ -1387,10 +1387,10 @@ void BeginInventoryPoolPtr( OBJECTTYPE *pInventorySlot ) if ( _KeyDown ( 89 )) //Lalien: delete all items of this type on Ctrl+Y { DeleteItemsOfType( gItemPointer.usItem ); - ScreenMsg( FONT_MCOLOR_LTRED, MSG_INTERFACE, L"Deleted all items of this type" ); + ScreenMsg( FONT_MCOLOR_LTRED, MSG_INTERFACE, New113Message[MSG113_DELETE_ALL] ); } else { - ScreenMsg( FONT_MCOLOR_LTRED, MSG_INTERFACE, L"Deleted item" ); + ScreenMsg( FONT_MCOLOR_LTRED, MSG_INTERFACE, New113Message[MSG113_DELETED] ); } if ( fShowMapInventoryPool ) HandleButtonStatesWhileMapInventoryActive(); @@ -1420,10 +1420,10 @@ void BeginInventoryPoolPtr( OBJECTTYPE *pInventorySlot ) if ( _KeyDown ( 89 )) //Lalien: sell all items of this type on Alt+Y { - ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"Sold all items of this type" ); + ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, New113Message[MSG113_SOLD_ALL] ); } else { - ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"Sold item" ); + ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, New113Message[MSG113_SOLD] ); } AddTransactionToPlayersBook( SOLD_ITEMS, 0, GetWorldTotalMin(), iPrice ); diff --git a/Strategic/mapscreen.cpp b/Strategic/mapscreen.cpp index 1bf3ba2f..d5ba1993 100644 --- a/Strategic/mapscreen.cpp +++ b/Strategic/mapscreen.cpp @@ -619,6 +619,7 @@ extern UINT16 gusNewItemIndex; extern BOOLEAN gfDeductPoints; extern void CleanUpStack( OBJECTTYPE * pObj, OBJECTTYPE * pCursorObj ); +extern void SwapGoggles(SOLDIERTYPE *pTeamSoldier); UINT32 guiCHARLIST; UINT32 guiCHARINFO; @@ -6366,6 +6367,13 @@ void GetMapKeyboardInput( UINT32 *puiNewEvent ) } #endif break; + case 'N': + if ( bSelectedInfoChar != -1 && fShowInventoryFlag ) + { + SOLDIERTYPE *pSoldier = MercPtrs[ gCharactersList[ bSelectedInfoChar ].usSolID ]; + SwapGoggles(pSoldier); + } + break; case 'o': if( fAlt ) { // toggle if Orta & Tixa have been found diff --git a/Tactical/Interface Items.cpp b/Tactical/Interface Items.cpp index 4d293eb4..0d3d4fbf 100644 --- a/Tactical/Interface Items.cpp +++ b/Tactical/Interface Items.cpp @@ -2813,14 +2813,16 @@ void CycleItemDescriptionItem( INT16 sX, INT16 sY ) { usOldItem--; + if ( usOldItem < 1 ) + { + usOldItem = MAXITEMS-1; + } + while ( usOldItem > 0 && ( Item[usOldItem].usItemClass == IC_NONE || Item[usOldItem].usItemClass == 0 )) { usOldItem--; - } - - if ( usOldItem < 0 ) - { - usOldItem = MAXITEMS-1; + if(usOldItem < 1) + usOldItem = MAXITEMS-1; } } else @@ -2835,6 +2837,8 @@ void CycleItemDescriptionItem( INT16 sX, INT16 sY ) while (usOldItem < MAXITEMS && (Item[usOldItem].usItemClass == IC_NONE || Item[usOldItem].usItemClass == 0 )) { usOldItem++; + if(usOldItem >= MAXITEMS) + usOldItem = 1; } } diff --git a/Tactical/Interface Panels.cpp b/Tactical/Interface Panels.cpp index 46d2111f..017c1089 100644 --- a/Tactical/Interface Panels.cpp +++ b/Tactical/Interface Panels.cpp @@ -1191,6 +1191,7 @@ void RenderBackpackButtons(int bpAction) RemoveButton( giSMZipperButton ); if(giSMDropPackButton != -1) RemoveButton( giSMDropPackButton ); + RenderBackpackButtons(4); giSMDropPackImages = -1; giSMDropPackButton = -1; giSMZipperImages = -1; @@ -7010,3 +7011,5 @@ void GoToMapScreenFromTactical( void ) + + diff --git a/Tactical/Item Types.h b/Tactical/Item Types.h index 1bf8e9e2..5c78f06f 100644 --- a/Tactical/Item Types.h +++ b/Tactical/Item Types.h @@ -755,7 +755,7 @@ public: POCKETTYPE& operator=(const POCKETTYPE&); ~POCKETTYPE(); UINT16 pIndex; - CHAR8 pName[80]; + CHAR16 pName[80]; UINT8 pSilhouette; UINT16 pType; UINT32 pRestriction; diff --git a/Tactical/Turn Based Input.cpp b/Tactical/Turn Based Input.cpp index 5d118220..435f44f2 100644 --- a/Tactical/Turn Based Input.cpp +++ b/Tactical/Turn Based Input.cpp @@ -191,7 +191,7 @@ extern INT16 ITEMDESC_START_Y; //Little functions called by keyboard input -void SwapGoggles(); +void SwapGoggles(SOLDIERTYPE *pTeamSoldier); void SeperateItems(); void StackAndSort( BOOLEAN fRestrictToAmmo ); void CreateRandomItem(); @@ -3177,8 +3177,14 @@ void GetKeyboardInput( UINT32 *puiNewEvent ) // swap sungoggles and nightgoggles case 'N': + SOLDIERTYPE *pTeamSoldier; + INT8 bLoop; + for (bLoop=gTacticalStatus.Team[gbPlayerNum].bFirstID, pTeamSoldier=MercPtrs[bLoop]; bLoop <= gTacticalStatus.Team[gbPlayerNum].bLastID; bLoop++, pTeamSoldier++) { - SwapGoggles(); + if ( OK_CONTROLLABLE_MERC( pTeamSoldier ) && pTeamSoldier->bAssignment == CurrentSquad( ) && !AM_A_ROBOT( pTeamSoldier ) ) + { + SwapGoggles(pTeamSoldier); + } } break; @@ -5460,74 +5466,130 @@ void PopupMilitiaControlMenu( SOLDIERTYPE *pSoldier ) } -void SwapGoggles() +void SwapGoggles(SOLDIERTYPE *pTeamSoldier) { /* CHRISL - Adjusted this option to allow the game to search through Helmet attachments as well as inventory positions. */ - SOLDIERTYPE *pTeamSoldier; OBJECTTYPE * pObj; - INT8 bLoop, bSlot1; - for (bLoop=gTacticalStatus.Team[gbPlayerNum].bFirstID, pTeamSoldier=MercPtrs[bLoop]; bLoop <= gTacticalStatus.Team[gbPlayerNum].bLastID; bLoop++, pTeamSoldier++) + OBJECTTYPE * pGoggles = NULL; + INT8 bSlot1; + int bestBonus; + bool itemFound = false; + //2 head slots + for (bSlot1 = HEAD1POS; bSlot1 <= HEAD2POS; bSlot1++) { - if ( OK_CONTROLLABLE_MERC( pTeamSoldier ) && pTeamSoldier->bAssignment == CurrentSquad( ) && !AM_A_ROBOT( pTeamSoldier ) ) + // if wearing sungoggles + if ( Item[pTeamSoldier->inv[bSlot1].usItem].brightlightvisionrangebonus > 0 ) { - //2 head slots - for (bSlot1 = HEAD1POS; bSlot1 <= HEAD2POS; bSlot1++) + itemFound = true; + bestBonus = 0; + pGoggles = FindNightGogglesInInv( pTeamSoldier ); + //search for better goggles on the helmet + if (pGoggles) { - if ( Item[pTeamSoldier->inv[bSlot1].usItem].brightlightvisionrangebonus > 0 ) + bestBonus = Item[pGoggles->usItem].nightvisionrangebonus; + } + //search helmet and vest + for(UINT8 gear = HELMETPOS; gear <= VESTPOS; gear++) + { + pObj = &(pTeamSoldier->inv[gear]); + for (attachmentList::iterator iter = (*pObj)[0]->attachments.begin(); iter != (*pObj)[0]->attachments.end(); ++iter) { - int bestBonus = 0; - OBJECTTYPE* pGoggles = FindNightGogglesInInv( pTeamSoldier ); - //search for better goggles on the helmet - if (pGoggles) { - Item[pGoggles->usItem].nightvisionrangebonus; - } - pObj = &(pTeamSoldier->inv[HELMETPOS]); - for (attachmentList::iterator iter = (*pObj)[0]->attachments.begin(); iter != (*pObj)[0]->attachments.end(); ++iter) { - if ( Item[ iter->usItem ].nightvisionrangebonus > bestBonus - && Item[ iter->usItem ].usItemClass == IC_FACE ) - { - pGoggles = &(*iter); - bestBonus = Item[ iter->usItem ].nightvisionrangebonus; - } - } - if ( pGoggles ) + if ( Item[ iter->usItem ].nightvisionrangebonus > bestBonus && Item[ iter->usItem ].usItemClass == IC_FACE ) { - SwapObjs( pTeamSoldier, bSlot1, pGoggles, TRUE ); - break; - } - } - else if(Item[pTeamSoldier->inv[bSlot1].usItem].nightvisionrangebonus > 0) - { - int bestBonus = 0; - OBJECTTYPE* pGoggles = FindSunGogglesInInv( pTeamSoldier ); - //search for better goggles on the helmet - if (pGoggles) { - Item[pGoggles->usItem].brightlightvisionrangebonus; - } - pObj = &(pTeamSoldier->inv[HELMETPOS]); - for (attachmentList::iterator iter = (*pObj)[0]->attachments.begin(); iter != (*pObj)[0]->attachments.end(); ++iter) { - if ( Item[ iter->usItem ].brightlightvisionrangebonus > bestBonus - && Item[ iter->usItem ].usItemClass == IC_FACE ) - { - pGoggles = &(*iter); - bestBonus = Item[ iter->usItem ].brightlightvisionrangebonus; - } - } - if ( pGoggles ) - { - SwapObjs( pTeamSoldier, bSlot1, pGoggles, TRUE ); - break; + pGoggles = &(*iter); + bestBonus = Item[ iter->usItem ].nightvisionrangebonus; } } } - fCharacterInfoPanelDirty = TRUE; - fInterfacePanelDirty = DIRTYLEVEL2; - pTeamSoldier->DeleteSoldierLight( ); - pTeamSoldier->PositionSoldierLight( ); + if ( pGoggles ) + { + SwapObjs( pTeamSoldier, bSlot1, pGoggles, TRUE ); + break; + } + } + // else if wearing NVGs + else if(Item[pTeamSoldier->inv[bSlot1].usItem].nightvisionrangebonus > 0) + { + itemFound = true; + bestBonus = 0; + pGoggles = FindSunGogglesInInv( pTeamSoldier ); + //search for better goggles on the helmet + if (pGoggles) + { + bestBonus = Item[pGoggles->usItem].brightlightvisionrangebonus; + } + //search helmet and vest + for(UINT8 gear = HELMETPOS; gear <= VESTPOS; gear++) + { + pObj = &(pTeamSoldier->inv[gear]); + for (attachmentList::iterator iter = (*pObj)[0]->attachments.begin(); iter != (*pObj)[0]->attachments.end(); ++iter) + { + if ( Item[ iter->usItem ].brightlightvisionrangebonus > bestBonus && Item[ iter->usItem ].usItemClass == IC_FACE ) + { + pGoggles = &(*iter); + bestBonus = Item[ iter->usItem ].brightlightvisionrangebonus; + } + } + } + if ( pGoggles ) + { + SwapObjs( pTeamSoldier, bSlot1, pGoggles, TRUE ); + break; + } + } + // else if not wearing anything and no goggles found + else if(itemFound == false && pTeamSoldier->inv[bSlot1].exists() == false) + { + bestBonus = 0; + // search helmet and vest for goggles of some kind + for(UINT8 gear = HELMETPOS; gear <= VESTPOS; gear++) + { + pObj = &(pTeamSoldier->inv[gear]); + for(attachmentList::iterator iter = (*pObj)[0]->attachments.begin(); iter != (*pObj)[0]->attachments.end(); ++iter) + { + if(DayTime() == TRUE && Item[iter->usItem].brightlightvisionrangebonus > bestBonus && Item[iter->usItem].usItemClass == IC_FACE) + { + pGoggles = &(*iter); + bestBonus = Item[iter->usItem].brightlightvisionrangebonus; + } + else if(NightTime() == TRUE && Item[iter->usItem].nightvisionrangebonus > bestBonus && Item[iter->usItem].usItemClass == IC_FACE) + { + pGoggles = &(*iter); + bestBonus = Item[iter->usItem].nightvisionrangebonus; + } + } + if(pGoggles) + { + pGoggles->MoveThisObjectTo(pTeamSoldier->inv[bSlot1], 1, pTeamSoldier, bSlot1); + pObj->RemoveAttachment(pGoggles); + break; + } + } + if(pTeamSoldier->inv[bSlot1].exists() == false) + { + if(DayTime() == TRUE) + pGoggles = FindSunGogglesInInv( pTeamSoldier ); + else + pGoggles = FindNightGogglesInInv( pTeamSoldier ); + if(pGoggles) + { + SwapObjs( pTeamSoldier, bSlot1, pGoggles, TRUE ); + break; + } + } + else + { + break; + } } } + fCharacterInfoPanelDirty = TRUE; + fTeamPanelDirty = TRUE; + fInterfacePanelDirty = DIRTYLEVEL2; + pTeamSoldier->DeleteSoldierLight( ); + pTeamSoldier->PositionSoldierLight( ); } void SeperateItems() diff --git a/Tactical/XML_LBEPocket.cpp b/Tactical/XML_LBEPocket.cpp index 45e228fb..261728e6 100644 --- a/Tactical/XML_LBEPocket.cpp +++ b/Tactical/XML_LBEPocket.cpp @@ -133,7 +133,7 @@ lbepocketEndElementHandle(void *userData, const XML_Char *name) if ( !onlyLocalizedText ) LBEPocketType.push_back(pData->curLBEPocket); else - strcpy(LBEPocketType[pData->curLBEPocket.pIndex].pName, pData->curLBEPocket.pName); + wcscpy(LBEPocketType[pData->curLBEPocket.pIndex].pName,pData->curLBEPocket.pName); } else if(strcmp(name, "pIndex") == 0) { @@ -143,6 +143,7 @@ lbepocketEndElementHandle(void *userData, const XML_Char *name) else if(strcmp(name, "pName") == 0) { pData->curElement = ELEMENT; +#if 0 if(MAX_CHAR_DATA_LENGTH >= strlen(pData->szCharData)) strcpy(pData->curLBEPocket.pName,pData->szCharData); else @@ -150,6 +151,10 @@ lbepocketEndElementHandle(void *userData, const XML_Char *name) strncpy(pData->curLBEPocket.pName,pData->szCharData,MAX_CHAR_DATA_LENGTH); pData->curLBEPocket.pName[MAX_CHAR_DATA_LENGTH] = '\0'; } +#else + MultiByteToWideChar( CP_UTF8, 0, pData->szCharData, -1, pData->curLBEPocket.pName, sizeof(pData->curLBEPocket.pName)/sizeof(pData->curLBEPocket.pName[0]) ); + pData->curLBEPocket.pName[sizeof(pData->curLBEPocket.pName)/sizeof(pData->curLBEPocket.pName[0]) - 1] = '\0'; +#endif } else if(strcmp(name, "pSilhouette") == 0) { diff --git a/Utils/Text.h b/Utils/Text.h index 58b70015..655882f3 100644 --- a/Utils/Text.h +++ b/Utils/Text.h @@ -1554,6 +1554,10 @@ enum MSG113_SNIPER, MSG113_UNABLETOSPLITMONEY, MSG113_ARRIVINGREROUTED, + MSG113_DELETED, + MSG113_DELETE_ALL, + MSG113_SOLD, + MSG113_SOLD_ALL, }; //CHRISL: NewInv messages diff --git a/Utils/_DutchText.cpp b/Utils/_DutchText.cpp index 5f14862e..4f666444 100644 --- a/Utils/_DutchText.cpp +++ b/Utils/_DutchText.cpp @@ -4234,6 +4234,10 @@ STR16 New113Message[] = L"Sniper!", L"Unable to split money due to having an item on your cursor.", L"Arrival of new recruits is being rerouted to sector %s, as scheduled drop-off point of sector %s is enemy occupied.", + L"Geschrapt punt", + L"Schrapte alle punten van dit type", + L"Verkocht punt", + L"Verkocht alle punten van dit type", }; // WANNE: This are the email texts, when one of the 4 new 1.13 MERC mercs have levelled up, that Speck sends diff --git a/Utils/_EnglishText.cpp b/Utils/_EnglishText.cpp index 9237cc48..7626d995 100644 --- a/Utils/_EnglishText.cpp +++ b/Utils/_EnglishText.cpp @@ -4229,6 +4229,10 @@ STR16 New113Message[] = L"Sniper!", L"Unable to split money due to having an item on your cursor.", L"Arrival of new recruits is being rerouted to sector %s, as scheduled drop-off point of sector %s is enemy occupied.", + L"Deleted item", + L"Deleted all items of this type", + L"Sold item", + L"Sold all items of this type", }; // WANNE: This are the email texts, when one of the 4 new 1.13 MERC mercs have levelled up, that Speck sends diff --git a/Utils/_FrenchText.cpp b/Utils/_FrenchText.cpp index aad7c88a..f7c463ae 100644 --- a/Utils/_FrenchText.cpp +++ b/Utils/_FrenchText.cpp @@ -4216,6 +4216,10 @@ STR16 New113Message[] = L"Sniper!", L"Unable to split money due to having an item on your cursor.", L"Arrival of new recruits is being rerouted to sector %s, as scheduled drop-off point of sector %s is enemy occupied.", + L"Article supprimй", + L"A supprimй tous les articles de ce type", + L"Article vendu", + L"A vendu tous les articles de ce type", }; // WANNE: This are the email texts, when one of the 4 new 1.13 MERC mercs have levelled up, that Speck sends diff --git a/Utils/_GermanText.cpp b/Utils/_GermanText.cpp index cbccee0c..7c076f1b 100644 --- a/Utils/_GermanText.cpp +++ b/Utils/_GermanText.cpp @@ -4021,6 +4021,10 @@ STR16 New113Message[] = L"Sniper!", L"Unable to split money due to having an item on your cursor.", L"Arrival of new recruits is being rerouted to sector %s, as scheduled drop-off point of sector %s is enemy occupied.", + L"Gegenstand gelцscht", + L"Alle Gegenstдnde dieses Typs gelцscht", + L"Gegestand verkauft", + L"Alle Gegenstдnde dieses Typs verkauft", }; // WANNE: This are the email texts, when one of the 4 new 1.13 MERC mercs have levelled up, that Speck sends diff --git a/Utils/_ItalianText.cpp b/Utils/_ItalianText.cpp index f3407c64..c23dfaf1 100644 --- a/Utils/_ItalianText.cpp +++ b/Utils/_ItalianText.cpp @@ -4213,6 +4213,10 @@ STR16 New113Message[] = L"Sniper!", L"Unable to split money due to having an item on your cursor.", L"Arrival of new recruits is being rerouted to sector %s, as scheduled drop-off point of sector %s is enemy occupied.", + L"Articolo cancellato", + L"Ha cancellato tutti gli articoli di questo tipo", + L"Articolo venduto", + L"Ha venduto tutti gli articoli di questo tipo", }; // WANNE: This are the email texts, when one of the 4 new 1.13 MERC mercs have levelled up, that Speck sends diff --git a/Utils/_PolishText.cpp b/Utils/_PolishText.cpp index 9abfbeff..43acaf37 100644 --- a/Utils/_PolishText.cpp +++ b/Utils/_PolishText.cpp @@ -4209,6 +4209,10 @@ STR16 New113Message[] = L"Sniper!", L"Unable to split money due to having an item on your cursor.", L"Arrival of new recruits is being rerouted to sector %s, as scheduled drop-off point of sector %s is enemy occupied.", + L"Deleted item", + L"Deleted all items of this type", + L"Sold item", + L"Sold all items of this type", }; // WANNE: This are the email texts, when one of the 4 new 1.13 MERC mercs have levelled up, that Speck sends diff --git a/Utils/_RussianText.cpp b/Utils/_RussianText.cpp index c89feaa2..c5513d9a 100644 --- a/Utils/_RussianText.cpp +++ b/Utils/_RussianText.cpp @@ -4222,6 +4222,10 @@ STR16 New113Message[] = L"Снайпер!", L"Невозможно разделить деньги из-за предмета на курсоре.", L"Точка высадки новых наемников перенесена в %s, так как предыдущая точка высадки %s захвачена противником.", + L"Deleted item", + L"Deleted all items of this type", + L"Sold item", + L"Sold all items of this type", }; // WANNE: This are the email texts, when one of the 4 new 1.13 MERC mercs have levelled up, that Speck sends diff --git a/Utils/_TaiwaneseText.cpp b/Utils/_TaiwaneseText.cpp index a8a4de34..b6233795 100644 --- a/Utils/_TaiwaneseText.cpp +++ b/Utils/_TaiwaneseText.cpp @@ -4229,6 +4229,10 @@ STR16 New113Message[] = L"Sniper!", L"Unable to split money due to having an item on your cursor.", L"Arrival of new recruits is being rerouted to sector %s, as scheduled drop-off point of sector %s is enemy occupied.", + L"Deleted item", + L"Deleted all items of this type", + L"Sold item", + L"Sold all items of this type", }; // WANNE: This are the email texts, when one of the 4 new 1.13 MERC mercs have levelled up, that Speck sends