Skip to content

Commit 36a84ff

Browse files
committed
Remove pSecondColumnString
* Use the new columns added to Text instead * Changed most functions to allow choosing a column * Removed unneeded SecondColumn specific functions to lessen code duplication * Lots of formatting changes to Popupbox.cpp, indentation was messed up in majority of the functions
1 parent 865288e commit 36a84ff

File tree

4 files changed

+464
-811
lines changed

4 files changed

+464
-811
lines changed

Strategic/Map Screen Interface TownMine Info.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,12 @@ void CreateDestroyTownInfoBox( void )
180180
// set highlight color
181181
SetBoxHighLight(ghTownMineBox, FONT_WHITE);
182182

183-
SetBoxSecondColumnForeground( ghTownMineBox, FONT_WHITE );
184-
SetBoxSecondColumnBackground( ghTownMineBox, FONT_BLACK );
185-
SetBoxSecondColumnHighLight( ghTownMineBox, FONT_WHITE );
186-
SetBoxSecondColumnShade( ghTownMineBox, FONT_BLACK );
187-
SetBoxSecondColumnFont( ghTownMineBox, BLOCKFONT2 );
183+
const auto column = 1;
184+
SetBoxColumnForeground( ghTownMineBox, FONT_WHITE, column );
185+
SetBoxColumnBackground( ghTownMineBox, FONT_BLACK, column );
186+
SetBoxColumnHighLight( ghTownMineBox, FONT_WHITE, column );
187+
SetBoxColumnShade( ghTownMineBox, FONT_BLACK, column );
188+
SetBoxColumnFont( ghTownMineBox, BLOCKFONT2, column );
188189
SetBoxSecondColumnMinimumOffset( ghTownMineBox, 20 );
189190

190191
// unhighlighted color

Strategic/Map Screen Interface.cpp

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3796,27 +3796,27 @@ void AddStringsToMoveBox( void )
37963796
// add title
37973797
GetShortSectorString( sSelMapX, sSelMapY, sStringB );
37983798
swprintf( sString, L"%s %s", pMovementMenuStrings[ 0 ], sStringB );
3799-
AddStringToBoxColumn(&hStringHandle, sString, 0 );
3799+
AddMonoString(&hStringHandle, sString, 0 );
38003800
// Add empty lines to other columns
38013801
for ( size_t i = 1; i < MAX_POPUP_BOX_COLUMNS; i++ )
38023802
{
3803-
AddStringToBoxColumn( &hStringHandle, L"", i);
3803+
AddMonoString( &hStringHandle, L"", i);
38043804
}
38053805

38063806
// blank line
38073807
for ( size_t i = 0; i < MAX_POPUP_BOX_COLUMNS; i++ )
38083808
{
3809-
AddStringToBoxColumn( &hStringHandle, L"", i );
3809+
AddMonoString( &hStringHandle, L"", i );
38103810
}
38113811

38123812
// add Select all line
38133813
if (giNumberOfSquadsInSectorMoving > 1)
38143814
{
38153815
swprintf(sString, L"%s", pMovementMenuStrings[4]);
3816-
AddStringToBoxColumn( &hStringHandle, sString, 0 );
3816+
AddMonoString( &hStringHandle, sString, 0 );
38173817
for ( size_t i = 1; i < MAX_POPUP_BOX_COLUMNS; i++ )
38183818
{
3819-
AddStringToBoxColumn( &hStringHandle, L"", i );
3819+
AddMonoString( &hStringHandle, L"", i );
38203820
}
38213821
}
38223822

@@ -3842,21 +3842,21 @@ void AddStringsToMoveBox( void )
38423842
// Determine which column to add
38433843
if (!isFirstColumnFull)
38443844
{
3845-
AddStringToBoxColumn( &hStringHandle, sString, 0 );
3845+
AddMonoString( &hStringHandle, sString, 0 );
38463846
}
38473847
else if ( !secondColumnFull )
38483848
{
3849-
AddStringToBoxColumn( &hStringHandle, sString, 1 );
3849+
AddMonoString( &hStringHandle, sString, 1 );
38503850
gColumnEntries[1] += 1;
38513851
}
38523852
else if ( !thirdColumnFull )
38533853
{
3854-
AddStringToBoxColumn( &hStringHandle, sString, 2 );
3854+
AddMonoString( &hStringHandle, sString, 2 );
38553855
gColumnEntries[2] += 1;
38563856
}
38573857
else
38583858
{
3859-
AddStringToBoxColumn( &hStringHandle, sString, 3 );
3859+
AddMonoString( &hStringHandle, sString, 3 );
38603860
gColumnEntries[3] += 1;
38613861
}
38623862
entries += 1;
@@ -3878,21 +3878,21 @@ void AddStringsToMoveBox( void )
38783878

38793879
if ( !isFirstColumnFull )
38803880
{
3881-
AddStringToBoxColumn( &hStringHandle, sString, 0 );
3881+
AddMonoString( &hStringHandle, sString, 0 );
38823882
}
38833883
else if ( !secondColumnFull )
38843884
{
3885-
AddStringToBoxColumn( &hStringHandle, sString, 1 );
3885+
AddMonoString( &hStringHandle, sString, 1 );
38863886
gColumnEntries[1] += 1;
38873887
}
38883888
else if ( !thirdColumnFull )
38893889
{
3890-
AddStringToBoxColumn( &hStringHandle, sString, 2 );
3890+
AddMonoString( &hStringHandle, sString, 2 );
38913891
gColumnEntries[2] += 1;
38923892
}
38933893
else
38943894
{
3895-
AddStringToBoxColumn( &hStringHandle, sString, 3 );
3895+
AddMonoString( &hStringHandle, sString, 3 );
38963896
gColumnEntries[3] += 1;
38973897
}
38983898
entries += 1;
@@ -3930,21 +3930,21 @@ void AddStringsToMoveBox( void )
39303930

39313931
if ( !isFirstColumnFull )
39323932
{
3933-
AddStringToBoxColumn( &hStringHandle, sString, 0 );
3933+
AddMonoString( &hStringHandle, sString, 0 );
39343934
}
39353935
else if ( !secondColumnFull )
39363936
{
3937-
AddStringToBoxColumn( &hStringHandle, sString, 1 );
3937+
AddMonoString( &hStringHandle, sString, 1 );
39383938
gColumnEntries[1] += 1;
39393939
}
39403940
else if ( !thirdColumnFull )
39413941
{
3942-
AddStringToBoxColumn( &hStringHandle, sString, 2 );
3942+
AddMonoString( &hStringHandle, sString, 2 );
39433943
gColumnEntries[2] += 1;
39443944
}
39453945
else
39463946
{
3947-
AddStringToBoxColumn( &hStringHandle, sString, 3 );
3947+
AddMonoString( &hStringHandle, sString, 3 );
39483948
gColumnEntries[3] += 1;
39493949
}
39503950
entries += 1;
@@ -3966,21 +3966,21 @@ void AddStringsToMoveBox( void )
39663966

39673967
if ( !isFirstColumnFull )
39683968
{
3969-
AddStringToBoxColumn( &hStringHandle, sString, 0 );
3969+
AddMonoString( &hStringHandle, sString, 0 );
39703970
}
39713971
else if ( !secondColumnFull )
39723972
{
3973-
AddStringToBoxColumn( &hStringHandle, sString, 1 );
3973+
AddMonoString( &hStringHandle, sString, 1 );
39743974
gColumnEntries[1] += 1;
39753975
}
39763976
else if ( !thirdColumnFull )
39773977
{
3978-
AddStringToBoxColumn( &hStringHandle, sString, 2 );
3978+
AddMonoString( &hStringHandle, sString, 2 );
39793979
gColumnEntries[2] += 1;
39803980
}
39813981
else
39823982
{
3983-
AddStringToBoxColumn( &hStringHandle, sString, 3 );
3983+
AddMonoString( &hStringHandle, sString, 3 );
39843984
gColumnEntries[3] += 1;
39853985
}
39863986
entries += 1;

0 commit comments

Comments
 (0)