From 3fbcce497fdc630669d3fec9c2a21622b875a29d Mon Sep 17 00:00:00 2001 From: "Marco Antonio J. Costa" Date: Tue, 7 Oct 2025 22:31:37 -0300 Subject: [PATCH 1/3] remove comments --- Laptop/personnel.cpp | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/Laptop/personnel.cpp b/Laptop/personnel.cpp index bc202e2cd..d3081a5e7 100644 --- a/Laptop/personnel.cpp +++ b/Laptop/personnel.cpp @@ -5720,22 +5720,6 @@ void CreateDestroyStartATMButton( void ) if( ( fCreated == FALSE ) && showPersonnelButtons ) { - // not created, must create - - /* - // the ATM start button - giPersonnelATMStartButtonImage[ 0 ]= LoadButtonImage( "LAPTOP\\AtmButtons.sti" ,-1,2,-1,3,-1 ); - giPersonnelATMStartButton[ 0 ] = QuickCreateButton( giPersonnelATMStartButtonImage[ 0 ] , 519,87, - BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1, - BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)ATMStartButtonCallback ); - - // set text and what not - SpecifyButtonText( giPersonnelATMStartButton[ 0 ] ,gsAtmStartButtonText[ 0 ] ); - SpecifyButtonUpTextColors( giPersonnelATMStartButton[ 0 ], FONT_BLACK, FONT_BLACK ); - SpecifyButtonFont( giPersonnelATMStartButton[ 0 ], PERS_FONT ); - SetButtonCursor(giPersonnelATMStartButton[ 0 ], CURSOR_LAPTOP_SCREEN); -*/ - INT16 x = iScreenWidthOffset + 519; INT16 y = iScreenHeightOffset + 74; From 4286304ec9f11e612d054529c46d2960c19a0135 Mon Sep 17 00:00:00 2001 From: "Marco Antonio J. Costa" Date: Tue, 7 Oct 2025 22:31:59 -0300 Subject: [PATCH 2/3] refactor UpDateStateOfStartButton --- Laptop/personnel.cpp | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/Laptop/personnel.cpp b/Laptop/personnel.cpp index d3081a5e7..f18b18a4e 100644 --- a/Laptop/personnel.cpp +++ b/Laptop/personnel.cpp @@ -5998,20 +5998,15 @@ void UpDateStateOfStartButton( void ) ButtonList[giPersonnelATMStartButton[gubPersonnelInfoState]]->uiFlags |= BUTTON_CLICKED_ON; // if in current mercs and the currently selected guy is valid, enable button, else disable it - if (fCurrentTeamMode) + if (fCurrentTeamMode && currentTeamIndex != -1) { - // is the current guy valid - if (currentTeamIndex != -1) - { for ( int i = 0; i < PERSONNEL_NUM_BTN; ++i ) EnableButton( giPersonnelATMStartButton[ i ] ); SoldierID iId = currentTeamList[currentTeamIndex]; - if (iId != NOBODY) + if (iId != NOBODY && iId->bAssignment == ASSIGNMENT_POW ) { - if ( iId->bAssignment == ASSIGNMENT_POW ) - { DisableButton( giPersonnelATMStartButton[ PERSONNEL_INV_BTN ] ); if ( gubPersonnelInfoState == PERSONNEL_INV_BTN ) @@ -6019,15 +6014,7 @@ void UpDateStateOfStartButton( void ) gubPersonnelInfoState = PERSONNEL_STAT_BTN; fPausedReDrawScreenFlag = TRUE; } - } } - } - else - { - // not valid, disable - for ( int i = 0; i < PERSONNEL_NUM_BTN; ++i ) - DisableButton( giPersonnelATMStartButton[ i ] ); - } } else { From 5d11355250a39e9c8b485862802795d29b61ad7f Mon Sep 17 00:00:00 2001 From: "Marco Antonio J. Costa" Date: Tue, 7 Oct 2025 23:03:00 -0300 Subject: [PATCH 3/3] remove scope and fix whitespace in RenderAtmPanel --- Laptop/personnel.cpp | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/Laptop/personnel.cpp b/Laptop/personnel.cpp index f18b18a4e..14c854a7a 100644 --- a/Laptop/personnel.cpp +++ b/Laptop/personnel.cpp @@ -5688,29 +5688,27 @@ BOOLEAN RenderAtmPanel( void ) UINT32 uiBox = 0; HVOBJECT hHandle; + // just show basic panel + // bounding + VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE; + FilenameForBPP("LAPTOP\\AtmButtons.sti", VObjectDesc.ImageFile); + CHECKF(AddVideoObject(&VObjectDesc, &uiBox)); - { - // just show basic panel - // bounding - VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE; - FilenameForBPP("LAPTOP\\AtmButtons.sti", VObjectDesc.ImageFile); - CHECKF(AddVideoObject(&VObjectDesc, &uiBox)); + GetVideoObject(&hHandle, uiBox); + BltVideoObject(FRAME_BUFFER, hHandle, 0,( INT16 ) ( ATM_UL_X ), ( INT16 ) ( ATM_UL_Y ), VO_BLT_SRCTRANSPARENCY,NULL); - GetVideoObject(&hHandle, uiBox); - BltVideoObject(FRAME_BUFFER, hHandle, 0,( INT16 ) ( ATM_UL_X ), ( INT16 ) ( ATM_UL_Y ), VO_BLT_SRCTRANSPARENCY,NULL); + // blit it + GetVideoObject(&hHandle, uiBox); + BltVideoObject(FRAME_BUFFER, hHandle, 1,( INT16 ) ( ATM_UL_X + 1 ), ( INT16 ) ( ATM_UL_Y + 18), VO_BLT_SRCTRANSPARENCY,NULL); - // blit it - GetVideoObject(&hHandle, uiBox); - BltVideoObject(FRAME_BUFFER, hHandle, 1,( INT16 ) ( ATM_UL_X + 1 ), ( INT16 ) ( ATM_UL_Y + 18), VO_BLT_SRCTRANSPARENCY,NULL); + DeleteVideoObjectFromIndex( uiBox ); - DeleteVideoObjectFromIndex( uiBox ); + //DisplayAmountOnCurrentMerc( ); - //DisplayAmountOnCurrentMerc( ); + // create destroy + CreateDestroyStartATMButton( ); - // create destroy - CreateDestroyStartATMButton( ); - } return( TRUE ); }