Skip to content

Zero Hour rebuilt from EA's source: x64, Direct3D 11, VS2022/CMake, ~60 original bugs fixed, an AI that builds a base. Bring your own game.

feat(gameclient): scoreboard shows five superweapons and counts the rest

Olcay Seygan476abe0b8ec2
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e733bfbda..8523a8c94 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -726,11 +726,11 @@ found and fixed — EA's own, not port damage.**
## A scoreboard on Tab
- Hold Tab and a scoreboard opens in the top left corner of the screen, beside the menu key; let go and it is gone. All eight seats of a full game fit in the top half of a 720 line screen. It is built from your command bar's steel, grey, red or sand for your side, with the match clock in its corner. Each side sits under a band edged green for yours and red for the enemy, and the band says how many of that side are still in the game, 4/4 down to 0/4. Watching, there is a band for every team. With a group selected, Tab still steps through the units in it as before, so the scoreboard wants one unit or none selected.
-- Every row on your side opens on a stripe of that player's colour, then the general in his metal tray, the player's name and the general under it. Then rank, money in the bank, income per minute, kills and losses, every promotion bought, once, at the level it has reached, and the unit that player has built the most of. Numbers line up on their last digit, and your own row is lit.
+- Every row on your side opens on a stripe of that player's colour, then the general's flag, the player's name and the general under it. Then rank, money in the bank, income per minute, kills and losses, every promotion bought, once, at the level it has reached, and the unit that player has built the most of. Numbers line up on their last digit, and your own row is lit.
- Names are written in white and the player's colour goes on the stripe. Dark red on a black panel measured about 2 to 1 and could barely be read. A player who is out goes grey.
- An enemy row is a colour, a name and a team and nothing more. What they are playing and what they have in the bank is theirs to know.
- Watching a match, everybody gets the full row, with a team column to say who is with whom.
-- Every player's superweapons are on their row, each as its picture and the seconds it still needs, soonest first, rimmed in gold once it can fire: on a line under the name for your side, and beside the name for an enemy, whose row has room for nothing else. Enemies' countdowns are there as the old column in the corner showed them.
+- Every player's superweapons are on their row, each as its picture and the seconds it still needs, soonest first, rimmed in gold once it can fire: on a line under the name for your side, and beside the name for an enemy, whose row has room for nothing else. The five soonest are shown and the rest are counted after them, "(+2, 1 ready)". The general's flag on each row stands bare, a size larger, without the old metal tray round it. Enemies' countdowns are there as the old column in the corner showed them.
- The diplomacy screen, where you mute a player, is still on the command bar's button.
## Your Razer hardware plays along
diff --git a/GeneralsMD/Code/Data/Window/Html/Scoreboard.html b/GeneralsMD/Code/Data/Window/Html/Scoreboard.html
index 27346858e..72802e095 100644
--- a/GeneralsMD/Code/Data/Window/Html/Scoreboard.html
+++ b/GeneralsMD/Code/Data/Window/Html/Scoreboard.html
@@ -15,8 +15,9 @@
has {{portrait}} {{general}} {{rank}} {{cash}} {{income}} {{kills}} {{losses}}, its promotions
as {{skill0}} to {{skill6}}, and {{favourite}} with {{favouritename}}, the unit built most.
A hidden seat is an enemy: a name, a colour and a team, nothing else.
- Every seat has its superweapons, soonest first, as {{w0.image}} {{w0.time}} {{w0.state}} to
- {{w5...}}, the state "ready" once it can fire and "none" for an unused place, and {{armed}}
+ Every seat has its five soonest superweapons as {{w0.image}} {{w0.time}} {{w0.state}} to
+ {{w4...}}, the state "ready" once it can fire and "none" for an unused place; {{more}} counts
+ the rest and {{moreready}} those of them ready, each with a mark "off" at zero; {{armed}} is
"armed" when it has any.
An image whose name is empty is not drawn, so an unused {{skillN}} leaves no box.
@@ -41,7 +42,7 @@
.china .well { background-color: rgba(26, 10, 8, 0.9); }
.gla .well { background-color: rgba(22, 19, 8, 0.9); }
- #board { position: absolute; left: 26px; top: 4px; width: 494px; padding-bottom: 3px; }
+ #board { position: absolute; left: 26px; top: 4px; width: 530px; padding-bottom: 3px; }
/* every column's left edge, shared by the captions and the seats; the Turkish captions are the
long ones, so a number column is as wide as its caption rather than its digits */
@@ -69,8 +70,9 @@
.seatrow { position: relative; height: 22px; margin: 0 3px; border-bottom: 1px solid rgba(119, 131, 145, 0.2); }
.seatrow.own { background-color: rgba(232, 210, 122, 0.12); }
.seatrow .stripe { position: absolute; left: 0; top: 2px; width: 2px; height: 18px; }
- .seatrow .tray { position: absolute; left: 4px; top: 2px; width: 24px; height: 18px; }
- .seatrow .emblem { position: absolute; left: 3px; top: 3px; width: 18px; height: 12px; }
+ /* the general's flag bare, with no tray round it, as big as the row leaves room for */
+ .seatrow .tray { position: absolute; left: 4px; top: 3px; width: 24px; height: 16px; background-image: none; }
+ .seatrow .emblem { position: absolute; left: 0; top: 0; width: 24px; height: 16px; }
.seatrow .cell { position: absolute; top: 0; line-height: 22px; }
/* the name is white and the colour goes on the stripe: dark red on this panel was about 2 to 1 */
.seatrow .who { position: absolute; top: 2px; line-height: 10px; font-weight: bold; color: #f5f5f5; }
@@ -85,17 +87,21 @@
.defeated .who { color: #8a949f; }
.defeated .num, .defeated .cash { color: #8a949f; }
- /* a player's superweapons, each a cameo and its seconds, gold once it can fire: on a line of their
+ /* a player's five soonest superweapons, each a cameo and its seconds, gold once it can fire, then
+ "(+3, 1 ready)" for the rest: on a line of their
own under a full row, and beside the name on an enemy's row, which has nothing else there */
.arms { display: none; position: absolute; left: 30px; top: 22px; height: 20px; }
.armed .arms { display: block; }
.seatrow.full.armed { height: 44px; }
- .hidden .arms { left: 170px; top: 1px; }
- .arm { position: absolute; top: 0; width: 52px; height: 20px; }
+ .hidden .arms { left: 168px; top: 1px; }
+ .arm { position: absolute; top: 0; width: 56px; height: 20px; }
.arm.none { display: none; }
- .w0 { left: 0; } .w1 { left: 54px; } .w2 { left: 108px; } .w3 { left: 162px; } .w4 { left: 216px; } .w5 { left: 270px; }
+ .w0 { left: 0; } .w1 { left: 60px; } .w2 { left: 120px; } .w3 { left: 180px; } .w4 { left: 240px; }
.arm .cameo { position: absolute; left: 0; top: 0; width: 22px; height: 18px; border: 1px solid #0c1114; }
- .arm .time { position: absolute; left: 27px; top: 0; line-height: 20px; font-weight: bold; color: #c9d2d9; }
+ .more { position: absolute; left: 300px; top: 0; line-height: 20px; white-space: nowrap; color: #c9d2d9; }
+ .moreready { color: #f2cf4a; }
+ .more.off, .moreready.off { display: none; }
+ .arm .time { position: absolute; left: 26px; top: 0; line-height: 20px; font-weight: bold; color: #c9d2d9; }
.arm.ready .cameo { border-color: #e8c24a; }
.arm.ready .time { color: #f2cf4a; }
</style>
@@ -142,7 +148,7 @@
<div class="arm w2 {{w2.state}}"><img class="cameo" src="{{w2.image}}"><span class="time">{{w2.time}}</span></div>
<div class="arm w3 {{w3.state}}"><img class="cameo" src="{{w3.image}}"><span class="time">{{w3.time}}</span></div>
<div class="arm w4 {{w4.state}}"><img class="cameo" src="{{w4.image}}"><span class="time">{{w4.time}}</span></div>
- <div class="arm w5 {{w5.state}}"><img class="cameo" src="{{w5.image}}"><span class="time">{{w5.time}}</span></div>
+ <div class="more {{moremark}}">(+{{more}}<span class="moreready {{morereadymark}}">, {{moreready}} {{text:GUI:BarNetReady}}</span>)</div>
</div>
</div>
</div>
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
index 6800a0517..0e513dea6 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
@@ -10230,13 +10230,15 @@ static HtmlValues scoreboardSeat( Player *player, const GameSlot *slot, Bool ful
}
//-------------------------------------------------------------------------------------------------
-/** One scoreboard seat's superweapons, soonest first, as {{wN.image}} {{wN.time}} and {{wN.state}}
- * for N 0 to SEAT_SUPERWEAPONS - 1: "ready" once it can fire, "none" for an unused place. {{armed}}
- * is "armed" when the player has any. */
+/** One scoreboard seat's superweapons, the SEAT_SUPERWEAPONS soonest side by side as {{wN.image}}
+ * {{wN.time}} and {{wN.state}}: "ready" once it can fire, "none" for an unused place. The rest
+ * are counted, {{more}} of them with {{moremark}} "off" when there are none, and {{moreready}}
+ * of those ready with {{morereadymark}} "off" when none is. {{armed}} is "armed" when the
+ * player has any. */
//-------------------------------------------------------------------------------------------------
static void putSeatSuperweapons( HtmlValues &row, Int playerIndex, const std::vector< SpectatorSuperweapon > &weapons )
{
- enum { SEAT_SUPERWEAPONS = 6 };
+ enum { SEAT_SUPERWEAPONS = 5 };
std::vector< SpectatorSuperweapon > owned;
for( size_t weapon = 0; weapon < weapons.size(); weapon++ )
@@ -10261,6 +10263,19 @@ static void putSeatSuperweapons( HtmlValues &row, Int playerIndex, const std::ve
row[ name + ".time" ] = WideCharStringToMultiByte( time.str() );
row[ name + ".state" ] = owned[ place ].ready ? "ready" : "";
}
+
+ Int more = 0;
+ Int moreReady = 0;
+ for( size_t weapon = SEAT_SUPERWEAPONS; weapon < owned.size(); weapon++ )
+ {
+ more++;
+ if( owned[ weapon ].ready )
+ moreReady++;
+ }
+ row[ "more" ] = std::to_string( more );
+ row[ "moremark" ] = more > 0 ? "" : "off";
+ row[ "moreready" ] = std::to_string( moreReady );
+ row[ "morereadymark" ] = moreReady > 0 ? "" : "off";
}
//-------------------------------------------------------------------------------------------------