Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Core/GameEngine/Include/Common/UserPreferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ class OptionPreferences : public UserPreferences
Int getRenderFpsFontSize(void);
Int getSystemTimeFontSize(void);
Int getGameTimeFontSize(void);
Int getObserverListFontSize(void);

Real getResolutionFontAdjustment(void);

Expand Down
2 changes: 2 additions & 0 deletions GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,8 @@ class GlobalData : public SubsystemInterface
// TheSuperHackers @feature Mauller 21/06/2025 allow the system time and game time font size to be set, a size of zero disables them
Int m_systemTimeFontSize;
Int m_gameTimeFontSize;
// TheSuperHackers @feature L3-M 05/11/2025 allow the observer list font size to be set, a size of zero disables it
Int m_observerListFontSize;

// TheSuperHackers @feature L3-M 21/08/2025 toggle the money per minute display, false shows only the original current money
Bool m_showMoneyPerMinute;
Expand Down
50 changes: 50 additions & 0 deletions GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,7 @@ friend class Drawable; // for selection/deselection transactions
virtual void refreshRenderFpsResources(void);
virtual void refreshSystemTimeResources( void );
virtual void refreshGameTimeResources( void );
virtual void refreshObserverListResources( void );

virtual void disableTooltipsUntil(UnsignedInt frameNum);
virtual void clearTooltipsDisabled();
Expand All @@ -596,6 +597,7 @@ friend class Drawable; // for selection/deselection transactions
void drawRenderFps(Int &x, Int &y);
void drawSystemTime(Int &x, Int &y);
void drawGameTime();
void drawObserverList();

public:
void registerWindowLayout(WindowLayout *layout); // register a layout for updates
Expand Down Expand Up @@ -799,6 +801,54 @@ friend class Drawable; // for selection/deselection transactions
Color m_gameTimeColor;
Color m_gameTimeDropColor;

// Observer Player List
struct ObserverList
{
enum LabelType
{
LabelType_Team,
LabelType_Money,
LabelType_Rank,
LabelType_Xp,

LabelType_Count
};

enum ValueType
{
ValueType_Team,
ValueType_Money,
ValueType_Rank,
ValueType_Xp,
ValueType_Name,

ValueType_Count
};

struct LastValues
{
Int team[MAX_PLAYER_COUNT];
UnsignedInt money[MAX_PLAYER_COUNT];
Int rank[MAX_PLAYER_COUNT];
Int xp[MAX_PLAYER_COUNT];
UnicodeString name[MAX_PLAYER_COUNT];
};

DisplayString *labels[LabelType_Count];
DisplayString *values[ValueType_Count][MAX_PLAYER_COUNT];
LastValues lastValues;
};

ObserverList m_observerList;
AsciiString m_observerListFont;
Int m_observerListPointSize;
Bool m_observerListBold;
Coord2D m_observerListPosition;
Color m_observerListLabelColor;
Color m_observerListValueColor;
Color m_observerListDropColor;
UnsignedInt m_observerListBackgroundAlpha;

// message data
UIMessage m_uiMessages[ MAX_UI_MESSAGES ];/**< messages to display to the user, the
array is organized with newer messages at
Expand Down
2 changes: 2 additions & 0 deletions GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -949,6 +949,7 @@ GlobalData::GlobalData()
m_renderFpsFontSize = 8;
m_systemTimeFontSize = 8;
m_gameTimeFontSize = 8;
m_observerListFontSize = 8;

m_showMoneyPerMinute = FALSE;
m_allowMoneyPerMinuteForPlayer = FALSE;
Expand Down Expand Up @@ -1225,6 +1226,7 @@ void GlobalData::parseGameDataDefinition( INI* ini )
TheWritableGlobalData->m_renderFpsFontSize = optionPref.getRenderFpsFontSize();
TheWritableGlobalData->m_systemTimeFontSize = optionPref.getSystemTimeFontSize();
TheWritableGlobalData->m_gameTimeFontSize = optionPref.getGameTimeFontSize();
TheWritableGlobalData->m_observerListFontSize = optionPref.getObserverListFontSize();
TheWritableGlobalData->m_showMoneyPerMinute = optionPref.getShowMoneyPerMinute();

Int val=optionPref.getGammaValue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -968,6 +968,20 @@ Int OptionPreferences::getGameTimeFontSize(void)
return fontSize;
}

Int OptionPreferences::getObserverListFontSize(void)
{
OptionPreferences::const_iterator it = find("ObserverListFontSize");
if (it == end())
return 8;

Int fontSize = atoi(it->second.str());
if (fontSize < 0)
{
fontSize = 0;
}
return fontSize;
}

Real OptionPreferences::getResolutionFontAdjustment(void)
{
OptionPreferences::const_iterator it = find("ResolutionFontAdjustment");
Expand Down Expand Up @@ -1553,6 +1567,17 @@ static void saveOptions( void )
TheInGameUI->refreshGameTimeResources();
}

//-------------------------------------------------------------------------------------------------
// Set Observer List Font Size
val = pref->getObserverListFontSize();
if (val >= 0)
{
AsciiString prefString;
prefString.format("%d", val);
(*pref)["ObserverListFontSize"] = prefString;
TheInGameUI->refreshObserverListResources();
}

//-------------------------------------------------------------------------------------------------
// Set User Font Scaling Percentage
val = pref->getResolutionFontAdjustment() * 100.0f; // TheSuperHackers @todo replace with options input when applicable
Expand Down
Loading
Loading