diff --git a/Laptop/finances.cpp b/Laptop/finances.cpp index 838f77f7..6bd9f5e1 100644 --- a/Laptop/finances.cpp +++ b/Laptop/finances.cpp @@ -1308,11 +1308,10 @@ void CreateFinanceButtons( void ) giFinanceButton[LAST_PAGE_BUTTON] = QuickCreateButton( giFinanceButtonImage[LAST_PAGE_BUTTON], LAST_PAGE_X, BTN_Y, BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1, BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnFinanceFirstLastPageCallBack); + MSYS_SetBtnUserData( giFinanceButton[LAST_PAGE_BUTTON], 0, 1 ); - - - + // set buttons SetButtonCursor(giFinanceButton[0], CURSOR_LAPTOP_SCREEN); SetButtonCursor(giFinanceButton[1], CURSOR_LAPTOP_SCREEN); SetButtonCursor(giFinanceButton[2], CURSOR_LAPTOP_SCREEN); @@ -2502,7 +2501,7 @@ void SetFinanceButtonStates( void ) if( LoadNextPage( ) ) { // decrement page - LoadPreviousPage( ); + LoadPreviousPage( ); // enable buttons @@ -2512,8 +2511,8 @@ void SetFinanceButtonStates( void ) } else { - DisableButton( giFinanceButton[ NEXT_PAGE_BUTTON ] ); - DisableButton( giFinanceButton[ LAST_PAGE_BUTTON ] ); + DisableButton( giFinanceButton[ NEXT_PAGE_BUTTON ] ); + DisableButton( giFinanceButton[ LAST_PAGE_BUTTON ] ); } } diff --git a/Laptop/history.cpp b/Laptop/history.cpp index cf580f1b..f002617f 100644 --- a/Laptop/history.cpp +++ b/Laptop/history.cpp @@ -51,8 +51,10 @@ #define SIZE_OF_HISTORY_FILE_RECORD ( sizeof( UINT8 ) + sizeof( UINT8 ) + sizeof( UINT32 ) + sizeof( UINT16 ) + sizeof( UINT16 ) + sizeof( UINT8 ) + sizeof( UINT8 ) ) // button positions -#define NEXT_BTN_X iScreenWidthOffset + 577 -#define PREV_BTN_X iScreenWidthOffset + 553 +#define FIRST_PAGE_X iScreenWidthOffset + 505 +#define NEXT_BTN_X iScreenWidthOffset + 553//577 +#define PREV_BTN_X iScreenWidthOffset + 529//553 +#define LAST_PAGE_X iScreenWidthOffset + 577 #define BTN_Y iScreenHeightOffset + 53 // graphics handles @@ -75,13 +77,15 @@ UINT32 guiSHADELINE; enum{ PREV_PAGE_BUTTON=0, NEXT_PAGE_BUTTON, + FIRST_PAGE_BUTTON, + LAST_PAGE_BUTTON, }; // the page flipping buttons -INT32 giHistoryButton[2]; -INT32 giHistoryButtonImage[2]; +INT32 giHistoryButton[4]; +INT32 giHistoryButtonImage[4]; BOOLEAN fInHistoryMode=FALSE; @@ -139,6 +143,7 @@ void PerformCheckOnHistoryRecord( UINT32 uiErrorCode, INT16 sSectorX, INT16 sSec // callbacks void BtnHistoryDisplayNextPageCallBack(GUI_BUTTON *btn,INT32 reason); void BtnHistoryDisplayPrevPageCallBack(GUI_BUTTON *btn,INT32 reason); +void BtnHistoryFirstLastPageCallBack(GUI_BUTTON *btn,INT32 reason); UINT32 SetHistoryFact( UINT8 ubCode, UINT8 ubSecondCode, UINT32 uiDate, INT16 sSectorX, INT16 sSectorY ) { @@ -428,10 +433,27 @@ void CreateHistoryButtons( void ) BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1, (GUI_CALLBACK)BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnHistoryDisplayNextPageCallBack); + //button to go to the first page + giHistoryButtonImage[FIRST_PAGE_BUTTON]= LoadButtonImage( "LAPTOP\\arrows.sti" ,-1,3,-1,4,-1 ); + giHistoryButton[FIRST_PAGE_BUTTON] = QuickCreateButton( giHistoryButtonImage[FIRST_PAGE_BUTTON], FIRST_PAGE_X, BTN_Y, + BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1, + (GUI_CALLBACK)BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnHistoryFirstLastPageCallBack); + + MSYS_SetBtnUserData( giHistoryButton[FIRST_PAGE_BUTTON], 0, 0 ); + + //button to go to the last page + giHistoryButtonImage[LAST_PAGE_BUTTON]= LoadButtonImage( "LAPTOP\\arrows.sti" ,-1,9,-1,10,-1 ); + giHistoryButton[LAST_PAGE_BUTTON] = QuickCreateButton( giHistoryButtonImage[LAST_PAGE_BUTTON], LAST_PAGE_X, BTN_Y, + BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1, + (GUI_CALLBACK)BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnHistoryFirstLastPageCallBack); + + MSYS_SetBtnUserData( giHistoryButton[LAST_PAGE_BUTTON], 0, 1 ); // set buttons SetButtonCursor(giHistoryButton[0], CURSOR_LAPTOP_SCREEN); SetButtonCursor(giHistoryButton[1], CURSOR_LAPTOP_SCREEN); + SetButtonCursor(giHistoryButton[2], CURSOR_LAPTOP_SCREEN); + SetButtonCursor(giHistoryButton[3], CURSOR_LAPTOP_SCREEN); return; } @@ -439,18 +461,14 @@ void CreateHistoryButtons( void ) void DestroyHistoryButtons( void ) { - // remove History buttons and images from memory + UINT32 uiCnt; - // next page button - RemoveButton(giHistoryButton[1] ); - UnloadButtonImage(giHistoryButtonImage[1] ); - - // prev page button - RemoveButton(giHistoryButton[0] ); - UnloadButtonImage(giHistoryButtonImage[0] ); - - return; + for( uiCnt=0; uiCnt<4; uiCnt++ ) + { + RemoveButton( giHistoryButton[ uiCnt ] ); + UnloadButtonImage( giHistoryButtonImage[ uiCnt ] ); + } } void BtnHistoryDisplayPrevPageCallBack(GUI_BUTTON *btn,INT32 reason) @@ -473,7 +491,7 @@ void BtnHistoryDisplayPrevPageCallBack(GUI_BUTTON *btn,INT32 reason) { LoadPreviousHistoryPage( ); //iCurrentHistoryPage--; - DrawAPageofHistoryRecords( ); + DrawAPageofHistoryRecords( ); } // set new state @@ -495,8 +513,8 @@ void BtnHistoryDisplayNextPageCallBack(GUI_BUTTON *btn,INT32 reason) // force redraw if(reason & MSYS_CALLBACK_REASON_LBUTTON_UP ) { - // increment currentPage - btn->uiFlags&=~(BUTTON_CLICKED_ON); + // increment currentPage + btn->uiFlags&=~(BUTTON_CLICKED_ON); LoadNextHistoryPage( ); // set new state SetHistoryButtonStates( ); @@ -507,6 +525,48 @@ void BtnHistoryDisplayNextPageCallBack(GUI_BUTTON *btn,INT32 reason) } +void BtnHistoryFirstLastPageCallBack(GUI_BUTTON *btn,INT32 reason) +{ + // force redraw + if(reason & MSYS_CALLBACK_REASON_LBUTTON_DWN ) + { + fReDrawScreenFlag=TRUE; + } + + if(reason & MSYS_CALLBACK_REASON_LBUTTON_UP ) + { + UINT32 uiButton = MSYS_GetBtnUserData( btn, 0 ); + + btn->uiFlags&=~(BUTTON_CLICKED_ON); + + // clear out old list of records, and load in previous page worth of records + ClearHistoryList( ); + + //if its the first page button + if( uiButton == 0 ) + { + iCurrentHistoryPage = 1; + LoadInHistoryRecords( iCurrentHistoryPage ); + DrawAPageofHistoryRecords( ); + } + + //else its the last page button + else + { + LoadInHistoryRecords( GetNumberOfHistoryPages() + 1 ); + + iCurrentHistoryPage = GetNumberOfHistoryPages() + 1; + } + + // set button state + SetHistoryButtonStates( ); + + pCurrentHistory=pHistoryListHead; + // redraw screen + fReDrawScreenFlag=TRUE; + } +} + BOOLEAN IncrementCurrentPageHistoryDisplay( void ) { // run through list, from pCurrentHistory, to NUM_RECORDS_PER_PAGE +1 HistoryUnits @@ -1001,7 +1061,7 @@ void DisplayPageNumberAndDateRange( void ) // get the last page - swprintf( sString, L"%s %d / %d",pHistoryHeaders[1], iCurrentHistoryPage , iLastPage +1 ); + swprintf( sString, L"%s %d / %d",pHistoryHeaders[1], iCurrentHistoryPage , iLastPage + 1 ); mprintf( PAGE_NUMBER_X, PAGE_NUMBER_Y, sString ); swprintf( sString, L"%s %d - %d",pHistoryHeaders[2], pCurrentHistory->uiDate / ( 24 * 60 ) , uiLastDate/( 24 * 60 ) ); @@ -1204,28 +1264,32 @@ void SetHistoryButtonStates( void ) { // first page, disable left buttons DisableButton( giHistoryButton[PREV_PAGE_BUTTON] ); + DisableButton( giHistoryButton[FIRST_PAGE_BUTTON] ); } else { // enable buttons EnableButton( giHistoryButton[PREV_PAGE_BUTTON] ); + EnableButton( giHistoryButton[FIRST_PAGE_BUTTON] ); } if( IncrementCurrentPageHistoryDisplay( ) ) { // decrement page - iCurrentHistoryPage--; + iCurrentHistoryPage--; DrawAPageofHistoryRecords( ); // enable buttons EnableButton( giHistoryButton[ NEXT_PAGE_BUTTON ] ); + EnableButton( giHistoryButton[ LAST_PAGE_BUTTON ] ); } else { - DisableButton( giHistoryButton[ NEXT_PAGE_BUTTON ] ); + DisableButton( giHistoryButton[ NEXT_PAGE_BUTTON ] ); + DisableButton( giHistoryButton[ LAST_PAGE_BUTTON ] ); } } @@ -1326,7 +1390,7 @@ BOOLEAN LoadInHistoryRecords( UINT32 uiPage ) return( FALSE ); } - // set up current finance + // set up current history pCurrentHistory = pHistoryListHead; return( TRUE ); @@ -1430,9 +1494,7 @@ BOOLEAN LoadNextHistoryPage( void ) // clear out old list of records, and load in previous page worth of records ClearHistoryList( ); - - - // now load in previous page's records, if we can + // now load in next page's records, if we can if ( LoadInHistoryRecords( iCurrentHistoryPage + 1 ) ) { iCurrentHistoryPage++; @@ -1467,7 +1529,7 @@ BOOLEAN LoadPreviousHistoryPage( void ) } else { - LoadInHistoryRecords( iCurrentHistoryPage ); + LoadInHistoryRecords( iCurrentHistoryPage ); return ( FALSE ); } } diff --git a/Tactical/Interface Panels.cpp b/Tactical/Interface Panels.cpp index 2cadb61a..48c90d8c 100644 --- a/Tactical/Interface Panels.cpp +++ b/Tactical/Interface Panels.cpp @@ -4315,7 +4315,8 @@ BOOLEAN ChangeDropPackStatus(SOLDIERTYPE *pSoldier, BOOLEAN newStatus) iRange = GetRangeInCellCoordsFromGridNoDiff( pSoldier->sGridNo, gWorldItems[wi].sGridNo ); if(gWorldItems[wi].sGridNo == pSoldier->sGridNo) // standing on pack - pickup regardless { - sAPCost = 0; + // Buggler: pickup should cost the same as manually picking it up + //sAPCost = 0; break; } else if(iRange < 26 && !(gTacticalStatus.uiFlags & INCOMBAT)) // should mean anything within 2 diagonal tiles while not in combat diff --git a/Tactical/Turn Based Input.cpp b/Tactical/Turn Based Input.cpp index 94d333f2..45921ae7 100644 --- a/Tactical/Turn Based Input.cpp +++ b/Tactical/Turn Based Input.cpp @@ -7833,6 +7833,7 @@ void HandleTBDropBackpacks( void ) } fCharacterInfoPanelDirty = TRUE; fInterfacePanelDirty = DIRTYLEVEL2; + ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, NewInvMessage[NIV_ALL_DROP] ); } } void HandleTBPickUpBackpacks( void ) @@ -7848,6 +7849,7 @@ void HandleTBPickUpBackpacks( void ) ChangeDropPackStatus(pTeamSoldier, FALSE); } } + ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, NewInvMessage[NIV_ALL_PICKUP] ); } } void HandleTBSoldierRun( void ) diff --git a/Utils/Text.h b/Utils/Text.h index e89daec8..e7ea30e8 100644 --- a/Utils/Text.h +++ b/Utils/Text.h @@ -2513,6 +2513,8 @@ enum NIV_SELL_ALL, NIV_DELETE_ALL, NIV_NO_CLIMB, + NIV_ALL_DROP, + NIV_ALL_PICKUP, TEXT_NUM_NIV, }; diff --git a/Utils/_ChineseText.cpp b/Utils/_ChineseText.cpp index e2ca5ea3..1419b367 100644 --- a/Utils/_ChineseText.cpp +++ b/Utils/_ChineseText.cpp @@ -6823,6 +6823,8 @@ STR16 NewInvMessage[] = L"你确定要变卖该地区所有物品吗?", L"你确定要销毁该地区所有物品吗?", L"装备大背包后无法爬上房顶", + L"All backpacks dropped", // TODO.Translate + L"All owned backpacks picked up", }; // WANNE - MP: Multiplayer messages diff --git a/Utils/_DutchText.cpp b/Utils/_DutchText.cpp index b29f6e5f..aba50435 100644 --- a/Utils/_DutchText.cpp +++ b/Utils/_DutchText.cpp @@ -6829,6 +6829,8 @@ STR16 NewInvMessage[] = L"Bent zeker u u wilt alle sectorpunten verkopen?", L"Bent zeker u u wilt alle sectorpunten schr?", L"Kan beklimmen niet terwijl het dragen van een rugzak", + L"All backpacks dropped", // TODO.Translate + L"All owned backpacks picked up", }; // WANNE - MP: Multiplayer messages diff --git a/Utils/_EnglishText.cpp b/Utils/_EnglishText.cpp index 13984f08..6c30eef2 100644 --- a/Utils/_EnglishText.cpp +++ b/Utils/_EnglishText.cpp @@ -6821,6 +6821,8 @@ STR16 NewInvMessage[] = L"Are you sure you want to sell all sector items?", L"Are you sure you want to delete all sector items?", L"Cannot climb while wearing a backpack", + L"All backpacks dropped", + L"All owned backpacks picked up", }; // WANNE - MP: Multiplayer messages diff --git a/Utils/_FrenchText.cpp b/Utils/_FrenchText.cpp index 07449292..d2b1c326 100644 --- a/Utils/_FrenchText.cpp +++ b/Utils/_FrenchText.cpp @@ -6826,6 +6826,8 @@ STR16 NewInvMessage[] = L"Êtes-vous sûr de vouloir vendre tous les articles du secteur ?", L"Êtes-vous sûr de vouloir supprimer tous les articles du secteur ?", L"Ne peut pas escalader avec un sac à dos", + L"All backpacks dropped", // TODO.Translate + L"All owned backpacks picked up", }; // WANNE - MP: Multiplayer messages diff --git a/Utils/_GermanText.cpp b/Utils/_GermanText.cpp index 93bc94e3..9e396bcb 100644 --- a/Utils/_GermanText.cpp +++ b/Utils/_GermanText.cpp @@ -6651,6 +6651,8 @@ STR16 NewInvMessage[] = L"Sind Sie sicher, dass Sie alle Gegenstände im Sektor verkaufen wollen?", L"Sind Sie sicher, dass Sie alle Gegenstände im Sektor löschen wollen?", L"Kann nicht beim Tragen eines Rucksacks klettern", + L"All backpacks dropped", // TODO.Translate + L"All owned backpacks picked up", }; // WANNE - MP: Multiplayer messages diff --git a/Utils/_ItalianText.cpp b/Utils/_ItalianText.cpp index 9aaa3c66..9bc65dff 100644 --- a/Utils/_ItalianText.cpp +++ b/Utils/_ItalianText.cpp @@ -6821,6 +6821,8 @@ STR16 NewInvMessage[] = L"Siete sicuri voi desiderate vendere tutti gli articoli del settore?", L"Siete sicuri voi desiderate cancellare tutti gli articoli del settore?", L"Non può arrampicarsi mentre portano uno zaino", + L"All backpacks dropped", // TODO.Translate + L"All owned backpacks picked up", }; // WANNE - MP: Multiplayer messages diff --git a/Utils/_PolishText.cpp b/Utils/_PolishText.cpp index 9b691c04..69155ff8 100644 --- a/Utils/_PolishText.cpp +++ b/Utils/_PolishText.cpp @@ -6834,6 +6834,8 @@ STR16 NewInvMessage[] = L"Na pewno chcesz sprzedać wszystkie przedmioty z tego sektora?", L"Na pewno chcesz skasować wszystkie przedmioty z tego sektora?", L"Nie można wspinać się z plecakiem", + L"All backpacks dropped", // TODO.Translate + L"All owned backpacks picked up", }; // WANNE - MP: Multiplayer messages diff --git a/Utils/_RussianText.cpp b/Utils/_RussianText.cpp index 04d2d6d4..55acba46 100644 --- a/Utils/_RussianText.cpp +++ b/Utils/_RussianText.cpp @@ -6824,6 +6824,8 @@ STR16 NewInvMessage[] = L"Вы уверены что хотите продать весь хлам этого сектора голодающему населению Арулько?", L"Вы уверены что хотите выбросить весь хлам, валяющийся в этом секторе?", L"Тяжеловато будет взбираться с полным рюкзаком на крышу. Может снимем?", + L"All backpacks dropped", // TODO.Translate + L"All owned backpacks picked up", }; // WANNE - MP: Multiplayer messages diff --git a/Utils/_TaiwaneseText.cpp b/Utils/_TaiwaneseText.cpp index 4f7f54b4..e2564302 100644 --- a/Utils/_TaiwaneseText.cpp +++ b/Utils/_TaiwaneseText.cpp @@ -6829,6 +6829,8 @@ STR16 NewInvMessage[] = L"Are you sure you want to sell all sector items?", L"Are you sure you want to delete all sector items?", L"Cannot climb while wearing a backpack", + L"All backpacks dropped", + L"All owned backpacks picked up", }; // WANNE - MP: Multiplayer messages