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
2 changes: 2 additions & 0 deletions Generals/Code/GameEngine/Include/GameClient/InGameUI.h
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,7 @@ friend class Drawable; // for selection/deselection transactions
{
LabelType_Team,
LabelType_Money,
LabelType_MoneyPerMinute,
LabelType_Rank,
LabelType_Xp,

Expand All @@ -799,6 +800,7 @@ friend class Drawable; // for selection/deselection transactions
{
ValueType_Team,
ValueType_Money,
ValueType_MoneyPerMinute,
ValueType_Rank,
ValueType_Xp,
ValueType_Name,
Expand Down
14 changes: 12 additions & 2 deletions Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -978,6 +978,7 @@ void InGameUI::PlayerInfoList::init(const AsciiString &fontName, Int pointSize,

labels[LabelType_Team]->setText(TheGameText->FETCH_OR_SUBSTITUTE_FORMAT("GUI:PlayerInfoListLabelTeam", L"T"));
labels[LabelType_Money]->setText(TheGameText->FETCH_OR_SUBSTITUTE_FORMAT("GUI:PlayerInfoListLabelMoney", L"$"));
labels[LabelType_MoneyPerMinute]->setText(TheGameText->FETCH_OR_SUBSTITUTE_FORMAT("GUI:PlayerInfoListLabelMoneyPerMinute", L"$/min"));
labels[LabelType_Rank]->setText(TheGameText->FETCH_OR_SUBSTITUTE_FORMAT("GUI:PlayerInfoListLabelRank", L"*"));
labels[LabelType_Xp]->setText(TheGameText->FETCH_OR_SUBSTITUTE_FORMAT("GUI:PlayerInfoListLabelXp", L"XP"));
}
Expand Down Expand Up @@ -6125,6 +6126,7 @@ void InGameUI::drawPlayerInfoList()
Int maxValueWidths[PlayerInfoList::LabelType_Count] = {0};
Color rowColors[MAX_PLAYER_COUNT] = {0};
Int nameValueWidth[MAX_PLAYER_COUNT] = {0};
const Bool showMoneyPerMinute = TheGlobalData->m_showMoneyPerMinute;
Int column;

for (Int slotIndex = 0; slotIndex < MAX_SLOTS && rowCount < MAX_PLAYER_COUNT; ++slotIndex)
Expand All @@ -6139,12 +6141,14 @@ void InGameUI::drawPlayerInfoList()

const Int row = rowCount++;
const UnsignedInt teamValue = (slot && slot->getTeamNumber() >= 0) ? static_cast<UnsignedInt>(slot->getTeamNumber() + 1) : 0;
const UnsignedInt moneyValue = player->getMoney()->countMoney();
const Money *money = player->getMoney();
const UnsignedInt moneyValue = money->countMoney();
const UnsignedInt moneyPerMinuteValue = money->getCashPerMinute();
const UnsignedInt rankValue = static_cast<UnsignedInt>(player->getRankLevel());
const UnsignedInt xpValue = static_cast<UnsignedInt>(player->getSkillPoints());
const UnicodeString nameValue = player->getPlayerDisplayName();

const UnsignedInt currentValues[] = {teamValue, moneyValue, rankValue, xpValue};
const UnsignedInt currentValues[] = {teamValue, moneyValue, moneyPerMinuteValue, rankValue, xpValue};
for (column = 0; column < ARRAY_SIZE(currentValues); ++column)
{
UnsignedInt &lastValue = m_playerInfoList.lastValues.values[column][row];
Expand Down Expand Up @@ -6177,6 +6181,9 @@ void InGameUI::drawPlayerInfoList()
Int labelX = baseX;
for (column = 0; column < PlayerInfoList::LabelType_Count; ++column)
{
if (!showMoneyPerMinute && column == PlayerInfoList::LabelType_MoneyPerMinute)
continue;

labelWidths[column] = m_playerInfoList.labels[column]->getWidth();
columnLabelX[column] = labelX;
labelX += labelWidths[column] + maxValueWidths[column] + columnGap;
Expand All @@ -6189,6 +6196,9 @@ void InGameUI::drawPlayerInfoList()

for (column = 0; column < PlayerInfoList::LabelType_Count; ++column)
{
if (!showMoneyPerMinute && column == PlayerInfoList::LabelType_MoneyPerMinute)
continue;

m_playerInfoList.labels[column]->draw(columnLabelX[column], drawY, m_playerInfoListLabelColor, m_playerInfoListDropColor);
m_playerInfoList.values[column][row]->draw(columnLabelX[column] + labelWidths[column], drawY, m_playerInfoListValueColor, m_playerInfoListDropColor);
}
Expand Down
2 changes: 2 additions & 0 deletions GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,7 @@ friend class Drawable; // for selection/deselection transactions
{
LabelType_Team,
LabelType_Money,
LabelType_MoneyPerMinute,
LabelType_Rank,
LabelType_Xp,

Expand All @@ -821,6 +822,7 @@ friend class Drawable; // for selection/deselection transactions
{
ValueType_Team,
ValueType_Money,
ValueType_MoneyPerMinute,
ValueType_Rank,
ValueType_Xp,
ValueType_Name,
Expand Down
14 changes: 12 additions & 2 deletions GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1007,6 +1007,7 @@ void InGameUI::PlayerInfoList::init(const AsciiString &fontName, Int pointSize,

labels[LabelType_Team]->setText(TheGameText->FETCH_OR_SUBSTITUTE_FORMAT("GUI:PlayerInfoListLabelTeam", L"T"));
labels[LabelType_Money]->setText(TheGameText->FETCH_OR_SUBSTITUTE_FORMAT("GUI:PlayerInfoListLabelMoney", L"$"));
labels[LabelType_MoneyPerMinute]->setText(TheGameText->FETCH_OR_SUBSTITUTE_FORMAT("GUI:PlayerInfoListLabelMoneyPerMinute", L"$/min"));
labels[LabelType_Rank]->setText(TheGameText->FETCH_OR_SUBSTITUTE_FORMAT("GUI:PlayerInfoListLabelRank", L"*"));
labels[LabelType_Xp]->setText(TheGameText->FETCH_OR_SUBSTITUTE_FORMAT("GUI:PlayerInfoListLabelXp", L"XP"));
}
Expand Down Expand Up @@ -6298,6 +6299,7 @@ void InGameUI::drawPlayerInfoList()
Int maxValueWidths[PlayerInfoList::LabelType_Count] = {0};
Color rowColors[MAX_PLAYER_COUNT] = {0};
Int nameValueWidth[MAX_PLAYER_COUNT] = {0};
const Bool showMoneyPerMinute = TheGlobalData->m_showMoneyPerMinute;
Int column;

for (Int slotIndex = 0; slotIndex < MAX_SLOTS && rowCount < MAX_PLAYER_COUNT; ++slotIndex)
Expand All @@ -6312,12 +6314,14 @@ void InGameUI::drawPlayerInfoList()

const Int row = rowCount++;
const UnsignedInt teamValue = (slot && slot->getTeamNumber() >= 0) ? static_cast<UnsignedInt>(slot->getTeamNumber() + 1) : 0;
const UnsignedInt moneyValue = player->getMoney()->countMoney();
const Money *money = player->getMoney();
const UnsignedInt moneyValue = money->countMoney();
const UnsignedInt moneyPerMinuteValue = money->getCashPerMinute();
const UnsignedInt rankValue = static_cast<UnsignedInt>(player->getRankLevel());
const UnsignedInt xpValue = static_cast<UnsignedInt>(player->getSkillPoints());
const UnicodeString nameValue = player->getPlayerDisplayName();

const UnsignedInt currentValues[] = {teamValue, moneyValue, rankValue, xpValue};
const UnsignedInt currentValues[] = {teamValue, moneyValue, moneyPerMinuteValue, rankValue, xpValue};
for (column = 0; column < ARRAY_SIZE(currentValues); ++column)
{
UnsignedInt &lastValue = m_playerInfoList.lastValues.values[column][row];
Expand Down Expand Up @@ -6350,6 +6354,9 @@ void InGameUI::drawPlayerInfoList()
Int labelX = baseX;
for (column = 0; column < PlayerInfoList::LabelType_Count; ++column)
{
if (!showMoneyPerMinute && column == PlayerInfoList::LabelType_MoneyPerMinute)
continue;

labelWidths[column] = m_playerInfoList.labels[column]->getWidth();
columnLabelX[column] = labelX;
labelX += labelWidths[column] + maxValueWidths[column] + columnGap;
Expand All @@ -6362,6 +6369,9 @@ void InGameUI::drawPlayerInfoList()

for (column = 0; column < PlayerInfoList::LabelType_Count; ++column)
{
if (!showMoneyPerMinute && column == PlayerInfoList::LabelType_MoneyPerMinute)
continue;

m_playerInfoList.labels[column]->draw(columnLabelX[column], drawY, m_playerInfoListLabelColor, m_playerInfoListDropColor);
m_playerInfoList.values[column][row]->draw(columnLabelX[column] + labelWidths[column], drawY, m_playerInfoListValueColor, m_playerInfoListDropColor);
}
Expand Down
Loading