Skip to content
Merged
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
3 changes: 3 additions & 0 deletions Core/GameEngine/Include/Common/OptionPreferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,7 @@ class OptionPreferences : public UserPreferences

Int getObserverStatsFontSize(void);
Int getObserverNotificationFontSize(void);
Bool getObserverNotificationSpecialPowerUsage(void);
Bool getObserverNotificationSpecialPowerPurchase(void);
Bool getObserverNotificationMilestone(void);
};
64 changes: 55 additions & 9 deletions Core/GameEngine/Source/Common/OptionPreferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,27 +116,73 @@ Int OptionPreferences::getCampaignDifficulty()
return factor;
}

Int OptionPreferences::getObserverNotificationFontSize(void) {
OptionPreferences::const_iterator it = find("ObserverNotificationFontSize");
if (it == end())
return 10;
Int fontSize = atoi(it->second.str());
if (fontSize < 0)
fontSize = 0;
return fontSize;
Int OptionPreferences::getObserverNotificationFontSize(void)
{
OptionPreferences::const_iterator it = find("ObserverNotificationFontSize");
if (it == end())
return 10;
Int fontSize = atoi(it->second.str());
if (fontSize < 0)
{
fontSize = 0;
}
if (fontSize > 15)
{
fontSize = 15;
}
return fontSize;
}

Bool OptionPreferences::getObserverNotificationSpecialPowerUsage(void)
{
OptionPreferences::const_iterator it = find("ObserverNotificationSpecialPowerUsage");
if (it == end())
return TheGlobalData->m_observerNotificationSpecialPowerUsage;
if (stricmp(it->second.str(), "yes") == 0)
{
return TRUE;
}
return FALSE;
}

Bool OptionPreferences::getObserverNotificationSpecialPowerPurchase(void)
{
OptionPreferences::const_iterator it = find("ObserverNotificationSpecialPowerPurchase");
if (it == end())
return TheGlobalData->m_observerNotificationSpecialPowerPurchase;
if (stricmp(it->second.str(), "yes") == 0)
{
return TRUE;
}
return FALSE;
}

Bool OptionPreferences::getObserverNotificationMilestone(void)
{
OptionPreferences::const_iterator it = find("ObserverNotificationMilestone");
if (it == end())
return TheGlobalData->m_observerNotificationMilestone;
if (stricmp(it->second.str(), "yes") == 0)
{
return TRUE;
}
return FALSE;
}

Int OptionPreferences::getObserverStatsFontSize(void)
{
OptionPreferences::const_iterator it = find("ObserverStatsFontSize");
if (it == end())
return 7;

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

Expand Down
3 changes: 3 additions & 0 deletions GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,9 @@ class GlobalData : public SubsystemInterface

// Generals Online @feature 16/1/2025 allow the observer notification font size to be set, a size of zero disables it
Int m_observerNotificationFontSize;
Bool m_observerNotificationSpecialPowerUsage;
Bool m_observerNotificationSpecialPowerPurchase;
Bool m_observerNotificationMilestone;

Real m_shakeSubtleIntensity; ///< Intensity for shaking a camera with SHAKE_SUBTLE
Real m_shakeNormalIntensity; ///< Intensity for shaking a camera with SHAKE_NORMAL
Expand Down
2 changes: 2 additions & 0 deletions GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@ class GameMessage : public MemoryPoolObject

MSG_META_INCREASE_OBSERVER_STATS_FONT, ///< Generals Online @feature Increase observer overlay size
MSG_META_DECREASE_OBSERVER_STATS_FONT, ///< Generals Online @feature Decrease observer overlay size
MSG_META_INCREASE_OBSERVER_NOTIFICATION_FONT, ///< Generals Online @feature Increase observer notification size
MSG_META_DECREASE_OBSERVER_NOTIFICATION_FONT, ///< Generals Online @feature Decrease observer notification size

MSG_META_BEGIN_PATH_BUILD, ///< enter path-building mode
MSG_META_END_PATH_BUILD, ///< exit path-building mode
Expand Down
9 changes: 3 additions & 6 deletions GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,6 @@ class InGameUI : public SubsystemInterface, public Snapshot
void triggerDoubleClickAttackMoveGuardHint();

void drawObserverNotifications(Int& x, Int& y);
void updateObserverNotifications(UnsignedInt currentFrame);
void checkObserverMilestones(UnsignedInt currentFrame);
void addObserverNotification(const UnicodeString& playerName, const wchar_t* message, Color playerColor);
void addObserverNotificationRaw(const UnicodeString& message, Color color);
Expand Down Expand Up @@ -685,10 +684,8 @@ class InGameUI : public SubsystemInterface, public Snapshot
Bool reachedLevel3;
Bool reachedLevel5;
Bool reached10kCPM;
Bool reached20kCPM;
Bool reached50kCPM;
Bool reached100kCPM;
Bool warnedFloating100k;
Bool stolenPower;
Bool gotHunted;
};

struct PlayerData {
Expand Down Expand Up @@ -1051,7 +1048,7 @@ class InGameUI : public SubsystemInterface, public Snapshot
// Obs overlay
static const Int numCols = 8;
const wchar_t* headers[numCols] = {
L"(T) Name", L"Army", L"Cash", L"Cash/m", L"(R) XP", L"SP", L"K/D", L"Power"
L"(T) Player", L"Army", L"Cash", L"Cash/m", L"(R) XP", L"SP", L"K/D", L"Power"
};

struct ObsOverlayPlayerData
Expand Down
6 changes: 6 additions & 0 deletions GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -963,6 +963,9 @@ GlobalData::GlobalData()

m_observerStatsFontSize = 7;
m_observerNotificationFontSize = 10;
m_observerNotificationSpecialPowerUsage = TRUE;
m_observerNotificationSpecialPowerPurchase = TRUE;
m_observerNotificationMilestone = TRUE;

m_showMoneyPerMinute = FALSE;
m_allowMoneyPerMinuteForPlayer = FALSE;
Expand Down Expand Up @@ -1258,6 +1261,9 @@ void GlobalData::parseGameDataDefinition( INI* ini )
TheWritableGlobalData->m_showMoneyPerMinute = optionPref.getShowMoneyPerMinute();
TheWritableGlobalData->m_observerStatsFontSize = optionPref.getObserverStatsFontSize();
TheWritableGlobalData->m_observerNotificationFontSize = optionPref.getObserverNotificationFontSize();
TheWritableGlobalData->m_observerNotificationSpecialPowerUsage = optionPref.getObserverNotificationSpecialPowerUsage();
TheWritableGlobalData->m_observerNotificationSpecialPowerPurchase = optionPref.getObserverNotificationSpecialPowerPurchase();
TheWritableGlobalData->m_observerNotificationMilestone = optionPref.getObserverNotificationMilestone();

TheWritableGlobalData->m_antiAliasLevel = optionPref.getAntiAliasing();
TheWritableGlobalData->m_textureFilteringMode = optionPref.getTextureFilterMode();
Expand Down
2 changes: 2 additions & 0 deletions GeneralsMD/Code/GameEngine/Source/Common/MessageStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,8 @@ const char *GameMessage::getCommandTypeAsString(GameMessage::Type t)

CASE_LABEL(MSG_META_INCREASE_OBSERVER_STATS_FONT)
CASE_LABEL(MSG_META_DECREASE_OBSERVER_STATS_FONT)
CASE_LABEL(MSG_META_INCREASE_OBSERVER_NOTIFICATION_FONT)
CASE_LABEL(MSG_META_DECREASE_OBSERVER_NOTIFICATION_FONT)
CASE_LABEL(MSG_META_INCREASE_MAX_RENDER_FPS)
CASE_LABEL(MSG_META_DECREASE_MAX_RENDER_FPS)
CASE_LABEL(MSG_META_INCREASE_LOGIC_TIME_SCALE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,17 @@ static void saveOptions()
TheWritableGlobalData->m_showMoneyPerMinute = show;
}

//-------------------------------------------------------------------------------------------------
// Set Observer Stats Font Size
val = pref->getObserverStatsFontSize();
if (val >= 0)
{
AsciiString prefString;
prefString.format("%d", val);
(*pref)["ObserverStatsFontSize"] = prefString;
TheInGameUI->initObserverOverlay();
}

//-------------------------------------------------------------------------------------------------
// Resolution
//
Expand Down
Loading
Loading