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): drop the top player strip, tab already lists everyone

Olcay Seyganb471805da534
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 06be47717..066294e77 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -482,9 +482,9 @@ found and fixed — EA's own, not port damage.**
- Pausing stops both clocks.
- Watching a match, hold Tab and every player's queue is on his row of the scoreboard, on the line under the name, ahead of his superweapons: the three that land soonest with their seconds and a count of the rest. Buildings going up on the ground are in there too, so a player answering an attack with three war factories is visible while the concrete is still wet. It used to be eight rows of pictures piled up the left edge of the screen for the whole match, over the battlefield. Knocked out and staying to watch, Tab gives you this same board, everybody in full; it used to keep your old side's view, with the enemy as names and nothing else.
- Every row and every countdown stands in real metal, cut from the same tray the general's powers sit in down in the corner - the side your command bar is showing. Watching a match there is no bar of your own, so the superweapon countdowns used to fall back to a flat black box for the whole match; now they wear the metal of the player you are watching, and follow it when you switch seats.
-- Watching, the command bar is down to the radar. The list of players it held is the row of seats across the top of the screen now: click a seat and you are looking at that player, his money and his side's steel, the way his button in the list did, and the seat is lit gold. Click it again for everybody. A seat click drops whatever you had selected, so the promotions on screen are that player's and not the owner of the tank you last clicked, and the seat stays yours when you click empty ground. The portrait panel in the right corner comes up when you select something and goes when you click empty ground, so an empty match leaves the bottom of the screen to the battle.
+- Watching, the command bar is down to the radar. The list of players it held is the board on the right and the Tab scoreboard now. Pick a player to follow in the camera panel and you are looking at him, his money and his side's steel, the way his button in the list did; pick nobody for everybody. Picking drops whatever you had selected, so the promotions on screen are that player's and not the owner of the tank you last clicked. The portrait panel in the right corner comes up when you select something and goes when you click empty ground, so an empty match leaves the bottom of the screen to the battle.
- Watching, the bars over the buildings are everyone's too - what each factory is turning out, and how long the superweapons have left. An observer used to see none of it.
-- Watching, the camera can drive itself. Two drop-downs in the camera panel on the right, above the board, say who has it and which player you follow, and you can follow nobody. The Director goes wherever the most things were hit in the last five seconds, stays with that fight at least six seconds, and cuts away only for one clearly bigger, so a 4v4 is watched like a broadcast rather than hunted for; with a player picked it keeps to the fights he is in. Player camera shows his screen: a human player's camera comes over the network five times a second, smoothed in between, and a computer player, who has no camera, gets the Director narrowed to his own fights. Scroll with the keys or a drag, turn the view or click the radar and the camera is yours again, still following the same player. The edge of the screen does not scroll while it drives: the flags along the top and the panel on the right stand on those edges, and reaching for them used to hand the camera back to you, so the Director stopped following the fighting the first time you went to change a setting. In a replay with the recorded camera switched on in the options, a seat click still follows that player the way it always did.
+- Watching, the camera can drive itself. Two drop-downs in the camera panel on the right, above the board, say who has it and which player you follow, and you can follow nobody. The Director goes wherever the most things were hit in the last five seconds, stays with that fight at least six seconds, and cuts away only for one clearly bigger, so a 4v4 is watched like a broadcast rather than hunted for; with a player picked it keeps to the fights he is in. Player camera shows his screen: a human player's camera comes over the network five times a second, smoothed in between, and a computer player, who has no camera, gets the Director narrowed to his own fights. Scroll with the keys or a drag, turn the view or click the radar and the camera is yours again, still following the same player. The edge of the screen does not scroll while it drives: the panel on the right stands on that edge, and reaching for it used to hand the camera back to you, so the Director stopped following the fighting the first time you went to change a setting. In a replay with the recorded camera switched on in the options, the player you follow still drives the camera the way his button in the old list did.
- Watching, tick Fog of war under the camera and you see what the player you follow sees and nothing more: black where he has never been, grey where he has been, none of the enemy he cannot see, and an enemy base as he last saw it. Stealth goes by his eyes too: a Jarmen Kell he has not found is gone from the screen and the radar, and his own stealthed units show the way they show him. It stays on whoever drives the camera, until you switch it off or follow nobody. Switch to another player and his fog comes in whole, shadows included: a building he has never seen casts nothing on his grey ground. An observer used to have no fog at all: the whole map, all match, with no way to see the game the way one of its players was seeing it.
- An ally, and anyone watching, now sees a stealthed unit's muzzle flash, its promotion and the cash it earns - if they can see the unit at all. Those three asked 'is it mine' instead of 'can I see it', so allies and observers got nothing.
- Watching, the match opens on the middle of the map. An observer has no start position, so the game looked for the camera waypoint of "player zero", did not find it, and fell back to the corner of the map: every match watched from the stands began pointed at empty ground in the south west.
@@ -493,11 +493,11 @@ found and fixed — EA's own, not port damage.**
- Watching, clicking one player's unit watches him, and clicking empty ground puts the whole match back. The screen wears his side's metal and the promotions on the right are his alone. The tilde key, or the general's stars on the right of the bar, then opens his promotion screen, on his side's artwork, with his skill points and his rank - greyed out, because they are not yours to spend. With nothing selected the key does nothing and the stars are dark; there is no one general to show.
- A general who has taken Artillery Barrage to level 3 shows one Artillery Barrage on the promotions strip, not three copies of the same picture in a row.
- The strips close up again: across a row the trays slide an eighth of a tray under each other, so a row reads as one run of metal. The cameos never overlap each other, because every tray goes down before any picture does.
-- Watching, the top left corner is clear. The promotions and superweapon shelves that stood there are gone: every general's promotions are on the Tab scoreboard, and the band under each flag at the top says whether his superweapon can fire.
+- Watching, the top left corner is clear. The promotions and superweapon shelves that stood there are gone: every general's promotions and superweapons are on the Tab scoreboard.
- Watching, an observer's board sits on the right of the screen, built from the command bar's own steel, and the steel is the watched side's: grey for America, red for China, sand for GLA, changing when you select a unit of another side: every player's general, his name in his colour, the number in gold, and under it a bar in the same colour as his name. In a two-sided match the bars used to go green for one side and red for the other, so a blue name could stand over a red bar. It opens on net worth, the cash in hand plus what everything the player has standing would cost to build again, counted twice a second, richest first.
- The number the board ranks by is yours to pick from the drop-down at its top: net worth, cash, income per minute, army value, kills and losses, the general's rank and power. The list re-sorts the moment you choose. The command bar's top row of keys picks them too while you watch, Q W E R T Y U, or Q E R T Y U I with the WASD camera, and the drop-down writes each stat's key beside it.
- A button under the list opens the armies: every player's six most expensive kinds of unit in cameo trays, with how many of each he has on the field. The generals' emblems on the board stand bare, with no tray round them.
-- Across the top, watching, the same flags a player has: every general's flag under a stripe of his colour, a team hung in a plate of steel with its name, and the band for his superweapon, green once it can fire. The flags are there to read, not to click; the player drop-down on the right is where you pick one. The drop-downs on the right open over the board instead of pushing it down the screen.
+- The drop-downs on the right open over the board instead of pushing it down the screen.
- The superweapon countdowns and the promotions each general has bought moved into a panel on the left, one row per player with his general at the head of it, where they used to be two strips down the right-hand edge.
- When a superweapon comes ready, the left side says so for eight seconds: whose it is, its picture and its name, "ready to fire". The newest is at the bottom, four at most.
- Both are an ordinary web page with a stylesheet, in the game's Window folder. Change the colours, the sizes or the order there and the next match you watch draws it that way, and the page opens in a browser too.
@@ -509,10 +509,10 @@ found and fixed — EA's own, not port damage.**
- Three buttons sit in a step of the radar's own steel, on its right: the smoke signals Alt+Z, X and C send, placed in the middle of your view for your allies to see. Each is a key sunk into the steel with a sharp white picture on it instead of a word: a crosshair to attack, a shield to defend, an eye to look. Point at one and it comes up out of its well as lit steel with a gold rim, and it sinks in darker while you hold the button down. They rise into place one after another from the bottom of the screen when the match starts. A game with nobody on your side to see the smoke, a skirmish against the computer or a replay, has no signal buttons at all.
- Tooltips wear the bar's steel. Point at a build button and a card opens right above it rather than in a fixed box at the side: the name on a steel header in your side's colour with the price in gold at its end, every "Power Supplied: 5" or "Strong: infantry" line of the description laid out as a label and a bold figure, then the unit's health, damage, attacks a second, damage a second, range and build time in gold, counted with the upgrades you own. Under them every upgrade that touches the unit and what it does to it: a Gattling Tank's card says Chain Guns takes its damage from 15 to 18 and its damage a second from 37 to 46, a Humvee's that TOW adds a 50 damage missile with a range of 317, and an upgrade you already bought turns gold. Point at the upgrade itself and the card lists the units it changes, Composite Armor putting a Crusader from 480 health to 680. At the bottom, "not enough money" or what you still need in a sunk red note at the bottom. Point at something on the battlefield and a small dark box beside the pointer names it, its owner's colour in a stripe down the left edge.
- The readout in the top right corner is a box of its own and always there: the time of day, the match time and the real time beside it, the logic rate and the frame rate, the renderer and the frame number. In a network game it adds how many frames are ready out of the input delay, the room's frame rate and the traffic in and out, and under a unit limit your count against it.
-- Every player in the match hangs from the top edge of the screen, your own team on the left. Each one is their general's flag in a hairline frame with the player's colour along its top, and a band of colour under it for their superweapons: green once one can fire, blue while it is still charging, grey when they have none. A team hangs in a plate of the command bar's steel, grey, red or sand for your side, with its name under the flags, Team 1 to Team 4 in a four-team game. The match clock is on Tab, so the strip is only flags. A free for all is all eight flags in one row, which fits with room to spare. The column of superweapon countdowns that used to sit in the top right is gone while you play; the full list with the seconds is on Tab.
+- The top of the screen is battlefield. The players, their teams, their superweapons with the seconds left and the match clock are all on Tab, which already had every one of them, so the column of superweapon countdowns that used to sit in the top right is gone while you play, and so is a strip of flags that repeated the scoreboard across the top edge.
- The steel between the build buttons, the portrait's grid and the promotion screen's cells is half as wide as it was, so the pictures take the room. The queue's tray has a thinner rim. The portrait and its upgrade icons sit under the portrait's grid, framed the same way as every other picture on the bar.
- The command bar slides up from the bottom of the screen again when a match starts. The new steel frame had been drawn at its final place from the first frame, so the buttons rose into a frame that was already standing.
-- The Escape menu is in the bar's steel too: a plate in your side's colour, no bigger than its keys, in the middle of the screen, the keys sunk in a well and lit gold under the pointer and pressed in when clicked. The Generals logo that took the top third of it is gone. The promotion screen opens across the middle of the screen, just under the players along the top edge, rather than over them. Restart reads Surrender or Restart Mission as the game you are in calls for.
+- The Escape menu is in the bar's steel too: a plate in your side's colour, no bigger than its keys, in the middle of the screen, the keys sunk in a well and lit gold under the pointer and pressed in when clicked. The Generals logo that took the top third of it is gone. The promotion screen opens across the middle of the screen. Restart reads Surrender or Restart Mission as the game you are in calls for.
## Placing buildings
diff --git a/GeneralsMD/Code/Data/Window/Html/ControlBar.html b/GeneralsMD/Code/Data/Window/Html/ControlBar.html
index faeadbb96..46dfd117a 100644
--- a/GeneralsMD/Code/Data/Window/Html/ControlBar.html
+++ b/GeneralsMD/Code/Data/Window/Html/ControlBar.html
@@ -51,11 +51,6 @@
net.in and net.out with {{net.online}} "online" in a network game;
net.units and net.cap with {{net.capped}} "capped" under a unit limit
{{blink}} "lit" for half of every second, for anything that blinks
- data-each="seats" while playing, one entry a team, your own first: {{kind}} "team" with
- {{label}}, "solo" for a player with no ally, or "ffa" for everybody in a
- free for all; its players in places s0 to s7, {{sN.image}} {{sN.color}}
- and {{sN.weapon}} "ready", "charging" or "none", {{sN.state}} "none" on an
- unused place. An entry of kind "gap" stands between two others
{{panelN.x}} .y .w .h N 0 to 2, left, centre and right: where the plates would have gone,
moving with the bar when it slides or minimises; .w and .h are 0 and
{{panelN.shown}} is "hidden" when a minimised bar has stood it down
@@ -341,31 +336,6 @@
#net.online .onlineonly { display: block; }
#net .cappedonly { display: none; }
#net .cappedonly.capped { display: block; }
-
- /* the players hanging from the top edge: each their general's flag filling a hairline frame with
- their colour along its top, and under it a band for their superweapons, green once one can
- fire, blue while none can yet, grey when they have none. A team hangs in a plate of the bar's
- steel, your side's colour, with its name under the flags; a free for all is everybody side by
- side. The match clock is on the Tab scoreboard */
- #seats { left: 180px; right: 180px; top: 0; text-align: center; }
- .steam, .sffa, .ssolo, .sgap { display: inline-block; position: relative; vertical-align: top; }
- .steam { padding: 0 2px 1px 2px; border: 1px solid #0c1114; border-top: 0; border-left-color: #b3bbc4;
- background: linear-gradient(to bottom, #9aa3ad, #5a626c 30%, #353c45); }
- .china .steam { border-left-color: #d58a70; background: linear-gradient(to bottom, #c06a52, #7a3120 30%, #3f160f); }
- .gla .steam { border-left-color: #cabe86; background: linear-gradient(to bottom, #b8ab6e, #766a3a 30%, #3c3519); }
- .teamname { display: none; }
- .steam .teamname { display: block; line-height: 9px; font-size: 7px; font-weight: bold; color: #f2cf4a; }
- .sgap .flags { display: none; }
- .flag { display: inline-block; position: relative; vertical-align: top; width: 32px; height: 26px; margin: 0 1px; }
- .flag.none { display: none; }
- .flag .plate { position: absolute; left: 0; top: 0; width: 30px; height: 21px; border: 1px solid #0c1114; border-top: 0; background-color: #0c1114; }
- .flag .stripe { position: absolute; left: 0; right: 0; top: 0; height: 3px; }
- .flag .emblem { position: absolute; left: 0; top: 3px; width: 30px; height: 18px; }
- .flag .lamp { position: absolute; left: 0; top: 21px; width: 30px; height: 4px; border: 1px solid #0c1114; border-top: 0; }
- .flag .lamp.ready { background-color: #4fd83a; }
- .flag .lamp.charging { background-color: #3a8ee8; }
- .flag .lamp.none { background-color: #6a737c; }
- .sgap { width: 8px; height: 26px; }
</style>
</head>
<body>
@@ -453,22 +423,6 @@
<div class="bar" style="top: 10px"></div>
</div>
- <div id="seats" class="piece">
- <div class="s{{kind}}" data-each="seats">
- <div class="flags">
- <div class="flag {{s0.state}}"><div class="plate"><div class="stripe" style="background-color: {{s0.color}}"></div><img class="emblem" src="{{s0.image}}"></div><div class="lamp {{s0.weapon}}"></div></div>
- <div class="flag {{s1.state}}"><div class="plate"><div class="stripe" style="background-color: {{s1.color}}"></div><img class="emblem" src="{{s1.image}}"></div><div class="lamp {{s1.weapon}}"></div></div>
- <div class="flag {{s2.state}}"><div class="plate"><div class="stripe" style="background-color: {{s2.color}}"></div><img class="emblem" src="{{s2.image}}"></div><div class="lamp {{s2.weapon}}"></div></div>
- <div class="flag {{s3.state}}"><div class="plate"><div class="stripe" style="background-color: {{s3.color}}"></div><img class="emblem" src="{{s3.image}}"></div><div class="lamp {{s3.weapon}}"></div></div>
- <div class="flag {{s4.state}}"><div class="plate"><div class="stripe" style="background-color: {{s4.color}}"></div><img class="emblem" src="{{s4.image}}"></div><div class="lamp {{s4.weapon}}"></div></div>
- <div class="flag {{s5.state}}"><div class="plate"><div class="stripe" style="background-color: {{s5.color}}"></div><img class="emblem" src="{{s5.image}}"></div><div class="lamp {{s5.weapon}}"></div></div>
- <div class="flag {{s6.state}}"><div class="plate"><div class="stripe" style="background-color: {{s6.color}}"></div><img class="emblem" src="{{s6.image}}"></div><div class="lamp {{s6.weapon}}"></div></div>
- <div class="flag {{s7.state}}"><div class="plate"><div class="stripe" style="background-color: {{s7.color}}"></div><img class="emblem" src="{{s7.image}}"></div><div class="lamp {{s7.weapon}}"></div></div>
- </div>
- <div class="teamname">{{label}}</div>
- </div>
- </div>
-
<div id="net" class="piece panel {{net.online}}">
<div class="line"><span class="big">{{net.clock}}</span> {{net.game}} <span class="dim">({{net.real}})</span></div>
<div class="line">{{net.hz}}hz {{net.fps}}fps <span class="dim">{{net.renderer}} frame {{net.frame}}</span></div>
diff --git a/GeneralsMD/Code/Data/Window/Html/Spectator.html b/GeneralsMD/Code/Data/Window/Html/Spectator.html
index 9acf95d65..272d83c78 100644
--- a/GeneralsMD/Code/Data/Window/Html/Spectator.html
+++ b/GeneralsMD/Code/Data/Window/Html/Spectator.html
@@ -3,9 +3,8 @@
What a spectator sees over the battlefield, dressed in the command bar's own materials: steel
plates with a lit top edge and a dark bottom one, the cameo tray the production strips stand in,
the power bar's fills. The steel follows the side whose bar is on screen, so selecting a Chinese
- unit turns it red. Three pieces:
+ unit turns it red. Two pieces, and the players themselves are on the Tab scoreboard:
- #seats every player across the top of the screen, grouped by team, the way a player sees them
#hud-top #feed, a superweapon coming ready, on the left for a few seconds, the way Dota's kill
feed runs
#right down the right: #watch, the camera, the followed player and the fog, and under it
@@ -29,10 +28,6 @@
data-each="players", one copy per player still in the match, ranked by the picked stat, with
{{name}} {{value}} {{share}} (percent of the highest) {{networth}} {{color}}
{{portrait}} (a mapped image name, for <img src>)
- data-each="seats", ControlBar.html's list: one entry a team, {{kind}} "team" with {{label}},
- "solo" or "ffa", its players in places s0 to s7 with {{sN.image}} {{sN.color}} {{sN.weapon}},
- {{sN.state}} "none" on an unused place; kind "gap" between two entries. Nothing on it is
- clicked: the camera's player drop-down is where a player is picked
data-each="army", every player's run: a {{kind}} "head" entry carrying {{image}} (his general),
{{color}} and {{name}}, then up to six "unit" entries, the most money first, with {{image}}
{{count}}
@@ -84,31 +79,6 @@
.gold { color: #e8d27a; }
.title { padding: 2px 5px; color: #e8d27a; }
- /* ---- the players across the top, ControlBar.html's #seats as a player has them ---- */
- /* each their general's flag filling a hairline frame with their colour along its top, and under
- it a band for their superweapons, green once one can fire, blue while none can yet, grey when
- they have none. A team hangs in a plate of the steel with its name under the flags; a free for
- all is everybody side by side */
- #seats { position: absolute; left: 180px; right: 180px; top: 0; text-align: center; }
- .steam, .sffa, .ssolo, .sgap { display: inline-block; position: relative; vertical-align: top; }
- .steam { padding: 0 2px 1px 2px; border: 1px solid #0c1114; border-top: 0; border-left-color: #b3bbc4;
- background: linear-gradient(to bottom, #9aa3ad, #5a626c 30%, #353c45); }
- .china .steam { border-left-color: #d58a70; background: linear-gradient(to bottom, #c06a52, #7a3120 30%, #3f160f); }
- .gla .steam { border-left-color: #cabe86; background: linear-gradient(to bottom, #b8ab6e, #766a3a 30%, #3c3519); }
- .teamname { display: none; }
- .steam .teamname { display: block; line-height: 9px; font-size: 7px; font-weight: bold; color: #f2cf4a; }
- .sgap .flags { display: none; }
- .flag { display: inline-block; position: relative; vertical-align: top; width: 32px; height: 26px; margin: 0 1px; }
- .flag.none { display: none; }
- .flag .frame { position: absolute; left: 0; top: 0; width: 30px; height: 21px; border: 1px solid #0c1114; border-top: 0; background-color: #0c1114; }
- .flag .stripe { position: absolute; left: 0; right: 0; top: 0; height: 3px; }
- .flag .emblem { position: absolute; left: 0; top: 3px; width: 30px; height: 18px; }
- .flag .lamp { position: absolute; left: 0; top: 21px; width: 30px; height: 4px; border: 1px solid #0c1114; border-top: 0; }
- .flag .lamp.ready { background-color: #4fd83a; }
- .flag .lamp.charging { background-color: #3a8ee8; }
- .flag .lamp.none { background-color: #6a737c; }
- .sgap { width: 8px; height: 26px; }
-
.row { padding: 2px 6px; color: #c9d2d9; }
.row:hover { color: #ffffff; background-color: rgba(119, 131, 145, 0.25); }
.box { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border: 1px solid #778391; background-color: #091417; vertical-align: middle; }
@@ -156,7 +126,7 @@
.players { margin: 2px 3px 0 3px; }
.player { position: relative; height: 18px; border-bottom: 1px solid rgba(119, 131, 145, 0.18); }
- /* the emblem as tall as its row, at the flag's 5:3 the top strip draws it at */
+ /* the emblem as tall as its row, at the flag's own 5:3 */
.player .tray { position: absolute; left: 1px; top: 0; width: 30px; }
.player .emblem { left: 0; top: 0; width: 30px; height: 18px; }
.name { position: absolute; left: 34px; top: 1px; line-height: 10px; }
@@ -185,22 +155,6 @@
<body>
<div class="{{side}}">
-<div id="seats">
- <div class="s{{kind}}" data-each="seats">
- <div class="flags">
- <div class="flag {{s0.state}}"><div class="frame"><div class="stripe" style="background-color: {{s0.color}}"></div><img class="emblem" src="{{s0.image}}"></div><div class="lamp {{s0.weapon}}"></div></div>
- <div class="flag {{s1.state}}"><div class="frame"><div class="stripe" style="background-color: {{s1.color}}"></div><img class="emblem" src="{{s1.image}}"></div><div class="lamp {{s1.weapon}}"></div></div>
- <div class="flag {{s2.state}}"><div class="frame"><div class="stripe" style="background-color: {{s2.color}}"></div><img class="emblem" src="{{s2.image}}"></div><div class="lamp {{s2.weapon}}"></div></div>
- <div class="flag {{s3.state}}"><div class="frame"><div class="stripe" style="background-color: {{s3.color}}"></div><img class="emblem" src="{{s3.image}}"></div><div class="lamp {{s3.weapon}}"></div></div>
- <div class="flag {{s4.state}}"><div class="frame"><div class="stripe" style="background-color: {{s4.color}}"></div><img class="emblem" src="{{s4.image}}"></div><div class="lamp {{s4.weapon}}"></div></div>
- <div class="flag {{s5.state}}"><div class="frame"><div class="stripe" style="background-color: {{s5.color}}"></div><img class="emblem" src="{{s5.image}}"></div><div class="lamp {{s5.weapon}}"></div></div>
- <div class="flag {{s6.state}}"><div class="frame"><div class="stripe" style="background-color: {{s6.color}}"></div><img class="emblem" src="{{s6.image}}"></div><div class="lamp {{s6.weapon}}"></div></div>
- <div class="flag {{s7.state}}"><div class="frame"><div class="stripe" style="background-color: {{s7.color}}"></div><img class="emblem" src="{{s7.image}}"></div><div class="lamp {{s7.weapon}}"></div></div>
- </div>
- <div class="teamname">{{label}}</div>
- </div>
-</div>
-
<div id="hud-top">
<div id="feed">
<div class="toast" data-each="toasts">
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/ObserverCamera.h b/GeneralsMD/Code/GameEngine/Include/GameClient/ObserverCamera.h
index 254323cb2..fdd7bb6fd 100644
--- a/GeneralsMD/Code/GameEngine/Include/GameClient/ObserverCamera.h
+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/ObserverCamera.h
@@ -27,10 +27,10 @@
// AI, which has no camera, gets the narrowed director, and with nobody picked it does nothing.
// Scrolling with the keys or a drag, turning the camera or clicking the radar hands it back to the
// watcher, who keeps the player he picked. The screen's edge does not scroll while this drives:
-// the page's flags stand on the top edge and its panel on the right one, and reaching for either
-// used to scroll the map and take the camera from the director with nobody asking.
+// the page's panel stands on the right one, and reaching for it used to scroll the map and take the
+// camera from the director with nobody asking.
//
-// The followed player is picked from his own list, not the seats: clicking a unit makes its owner
+// The followed player is picked from his own list, not the selection: clicking a unit makes its owner
// the watched player, and the camera jumping to an enemy's screen on a click would be no use. Fog
// on draws the followed player's fog, what he has seen and what he has not, and hides what he
// cannot see, stealthed units he has not detected included; following nobody it changes nothing.
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp
index 21bbc480f..aee0611c6 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp
@@ -446,13 +446,11 @@ void ControlBar::markUIDirty( void )
* Watching - an observer, or a player knocked out who stayed to watch - the screen used to be
* populated with the watcher's own player, who owns no command sets at all, so the whole screen
* came up blank. It follows the field instead: whatever is selected names its owner, and with
- * nothing selected it is the player the seats at the top are pointed at, or the first side still in
- * the match. */
+ * nothing selected it is the player being watched, or the first side still in the match. */
//-------------------------------------------------------------------------------------------------
/** The player a watcher has picked out by clicking one of his things, NULL when nothing is
* selected or the selection belongs to nobody who is still playing. It is what narrows the
- * whole screen to one player: his seat lit at the top, the skills on the right, the side the bar
- * wears and whose promotion screen the key opens. */
+ * whole screen to one player: the side the bar wears and whose promotion screen the key opens. */
Player *ControlBar::getSelectedPlayer( void )
{
if( ThePlayerList->getLocalPlayer()->isPlayerActive() )
@@ -471,9 +469,9 @@ Player *ControlBar::getSelectedPlayer( void )
}
//-------------------------------------------------------------------------------------------------
-/** Watching, the selection drives the whole bar: clicking a unit is clicking its owner's seat at
- * the top. His seat lights, the portrait's panel comes up, and the bar wears his side's metal -
- * and clicking empty ground puts everybody and the watcher's own plain bar back.
+/** Watching, the selection drives the whole bar: clicking a unit watches its owner. The
+ * portrait's panel comes up and the bar wears his side's metal, and clicking empty ground puts
+ * everybody and the watcher's own plain bar back.
*
* Before this, picking up somebody's tank told you nothing about him: the bar stayed on whatever
* side had last been chosen off the list, and the money plate with it. */
@@ -5873,7 +5871,7 @@ void ControlBar::setDefaultControlBarConfig( void )
m_contextParent[ CP_MASTER ]->winHide(FALSE);
// the three panels the minimised bar stands down. Watching, the middle is the player list, which
- // the seats across the top of the screen have taken over, and the right is the selection's portrait
+ // the spectator page and the Tab scoreboard have taken over, and the right is the selection's portrait
showPanel( CB_PANEL_LEFT, TRUE );
showPanel( CB_PANEL_CENTER, !m_isObserverCommandBar );
showPanel( CB_PANEL_RIGHT, !m_isObserverCommandBar || getSelectedPlayer() != NULL );
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
index 929970e34..4dce5c2e2 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
@@ -1816,7 +1816,6 @@ enum
SPECTATOR_TOAST_FRAMES = LOGICFRAMES_PER_SECOND * 8, ///< how long a "superweapon ready" message stays up
SPECTATOR_TOASTS_KEPT = 4, ///< the most of those on screen at once; the oldest goes first
COMMAND_SLOTS_PER_COLUMN = 2, ///< the command bar numbers its slots down each column, top then bottom
- TWO_TEAMS = 2,
PERCENT = 100
};
@@ -2125,7 +2124,7 @@ static std::string spectatorClock( UnsignedInt frame )
}
//-------------------------------------------------------------------------------------------------
-/** The players the camera can follow, grouped by team the way the seats are. Which one it is
+/** The players the camera can follow, grouped by team the way the scoreboard is. Which one it is
* following is marked every frame, not at the lists' rebuilds. */
//-------------------------------------------------------------------------------------------------
static void fillSpectatorFollows( std::vector< SpectatorStats > players, std::vector< HtmlValues > &entries )
@@ -2173,121 +2172,6 @@ static void fillSpectatorCameraValues( std::vector< HtmlValues > &follows, HtmlV
values[ "followcolor" ] = head.at( "color" );
}
-//-------------------------------------------------------------------------------------------------
-/** Every player still in the match for the pages a player sees: grouped by team, allies both ways
- * sharing one, the local player's own team first. Only the player and the team are filled in;
- * `teams` is how many there are. */
-//-------------------------------------------------------------------------------------------------
-static std::vector< SpectatorStats > gatherSeats( Int &teams )
-{
- std::vector< SpectatorStats > seats;
- const Player *local = ThePlayerList->getLocalPlayer();
- Int localTeam = -1;
- teams = 0;
- for( Int index = 0; index < ThePlayerList->getPlayerCount(); index++ )
- {
- Player *player = ThePlayerList->getNthPlayer( index );
- if( player == NULL || !player->isPlayerActive() || !player->isPlayableSide() )
- continue;
-
- SpectatorStats seat = SpectatorStats();
- seat.player = player;
- seat.team = -1;
- for( size_t earlier = 0; earlier < seats.size() && seat.team < 0; earlier++ )
- {
- const Player *other = seats[ earlier ].player;
- if( player->getRelationship( other->getDefaultTeam() ) == ALLIES && other->getRelationship( player->getDefaultTeam() ) == ALLIES )
- seat.team = seats[ earlier ].team;
- }
- if( seat.team < 0 )
- seat.team = teams++;
- if( player == local )
- localTeam = seat.team;
- seats.push_back( seat );
- }
-
- std::stable_sort( seats.begin(), seats.end(), [ localTeam ]( const SpectatorStats &a, const SpectatorStats &b )
- { return ( a.team == localTeam ? -1 : a.team ) < ( b.team == localTeam ? -1 : b.team ); } );
- return seats;
-}
-
-static UnicodeString scoreboardTeamLabel( const GameSlot *slot );
-
-/** The lobby slot `player` sits in, NULL outside a game that has slots. */
-static const GameSlot *playerSlot( const Player *player )
-{
- for( Int slotNum = 0; TheGameInfo && slotNum < MAX_SLOTS; slotNum++ )
- {
- AsciiString playerName;
- playerName.format( "player%d", slotNum );
- if( ThePlayerList->findPlayerWithNameKey( NAMEKEY( playerName ) ) == player )
- return TheGameInfo->getConstSlot( slotNum );
- }
- return NULL;
-}
-
-//-------------------------------------------------------------------------------------------------
-/** The command bar page's "seats" list, the strip across the top of the screen while playing, one
- * entry a team: kind "team" with its {{label}}, the lobby's team name, and its players in places
- * s0 to s7, each {{sN.image}} their general, {{sN.color}}, and {{sN.weapon}} where their
- * superweapons stand, "ready" once one can fire, "charging" while none can yet and "none" when they
- * have none; an unused place has {{sN.state}} "none". A player with no ally is an entry of kind
- * "solo", with no frame or name, and a free for all past two players is one entry of kind "ffa",
- * everybody side by side. Between two entries stands one of kind "gap"; the match clock is on
- * the Tab scoreboard. */
-//-------------------------------------------------------------------------------------------------
-static void fillPlayerSeats( const std::vector< SpectatorStats > &seats, Int teams,
- const std::vector< SpectatorSuperweapon > &weapons, std::vector< HtmlValues > &entries )
-{
- entries.clear();
- const Bool freeForAll = teams == (Int)seats.size() && teams > TWO_TEAMS;
-
- for( size_t first = 0; first < seats.size(); )
- {
- HtmlValues group;
- // the lobby's team name, or the team's place along the strip when the lobby set none
- const GameSlot *slot = playerSlot( seats[ first ].player );
- UnicodeString label;
- if( slot && slot->getTeamNumber() >= 0 )
- label.format( L"%s %s", TheGameText->fetch( "GUI:ScoreboardTeam" ).str(), scoreboardTeamLabel( slot ).str() );
- else
- label.format( L"%s %d", TheGameText->fetch( "GUI:ScoreboardTeam" ).str(), seats[ first ].team + 1 );
- group[ "label" ] = WideCharStringToMultiByte( label.str() );
-
- size_t end = first;
- for( ; end < seats.size() && ( freeForAll || seats[ end ].team == seats[ first ].team ); end++ )
- {
- Bool owned = FALSE;
- Bool ready = FALSE;
- for( size_t weapon = 0; weapon < weapons.size(); weapon++ )
- {
- if( weapons[ weapon ].playerIndex != seats[ end ].player->getPlayerIndex() )
- continue;
- owned = TRUE;
- ready = ready || weapons[ weapon ].ready;
- }
-
- const HtmlValues head = spectatorHead( seats[ end ].player );
- const std::string place = "s" + std::to_string( end - first );
- group[ place + ".image" ] = head.at( "image" );
- group[ place + ".color" ] = head.at( "color" );
- group[ place + ".weapon" ] = ready ? "ready" : owned ? "charging" : "none";
- }
- group[ "kind" ] = freeForAll ? "ffa" : end - first > 1 ? "team" : "solo";
- for( size_t place = end - first; place < MAX_SLOTS; place++ )
- group[ "s" + std::to_string( place ) + ".state" ] = "none";
-
- if( !entries.empty() )
- {
- HtmlValues between;
- between[ "kind" ] = "gap";
- entries.push_back( between );
- }
- entries.push_back( group );
- first = end;
- }
-}
-
//-------------------------------------------------------------------------------------------------
/** A superweapon of player `playerIndex` came ready: the page says so on its left edge for
* SPECTATOR_TOAST_FRAMES, newest at the bottom, the way Dota's kill feed runs. Only a watcher's
@@ -2352,10 +2236,9 @@ Bool InGameUI::pickSpectatorStat( Int commandSlot )
}
//-------------------------------------------------------------------------------------------------
-/** The spectator's page: the players across the top the way a player sees them, the camera, every
- * player ranked by the number picked in the stat drop-down and each army's most expensive units,
- * and a superweapon coming ready on the left. The promotions and the production are on the Tab
- * scoreboard. Only while watching: the other side's worth is not a player's to know. */
+/** The spectator's page: the camera, every player ranked by the number picked in the stat drop-down
+ * and each army's most expensive units, and a superweapon coming ready on the left. The players
+ * themselves, the promotions and the production are on the Tab scoreboard. Only while watching: the other side's worth is not a player's to know. */
//-------------------------------------------------------------------------------------------------
void InGameUI::drawSpectatorPage( void )
{
@@ -2389,11 +2272,6 @@ void InGameUI::drawSpectatorPage( void )
fillSpectatorArmies( players, m_spectatorLists[ "army" ] );
fillSpectatorFollows( players, m_spectatorLists[ "follows" ] );
- // the strip across the top is the one a player has, grouped by the lobby's teams
- Int seatTeams = 0;
- const std::vector< SpectatorStats > seats = gatherSeats( seatTeams );
- fillPlayerSeats( seats, seatTeams, m_spectatorSuperweapons, m_spectatorLists[ "seats" ] );
-
m_spectatorTotals.clear();
m_spectatorTotals[ "stat" ] = WideCharStringToMultiByte( TheGameText->fetch( stat.label ).str() );
m_spectatorTotals[ PICK_ACTION + STAT_GROUP + ":" + stat.key ] = "on";
@@ -2490,7 +2368,7 @@ void InGameUI::runSpectatorAction( const std::string &action )
}
else if( action.compare( 0, FOLLOW_ACTION.size(), FOLLOW_ACTION ) == 0 )
{
- // following a player is watching him too: his seat lit, his side on the bar
+ // following a player is watching him too: his side on the bar and the page's steel
const std::string choice = action.substr( FOLLOW_ACTION.size() );
Player *player = choice == FOLLOW_NOBODY ? NULL : ThePlayerList->getNthPlayer( atoi( choice.c_str() ) );
m_spectatorFlipped.erase( FOLLOW_GROUP );
@@ -9689,7 +9567,7 @@ void InGameUI::addSuperweaponIcon( const Image *image, Int seconds, Int percent,
void InGameUI::drawSuperweaponStrip( void )
{
// watching, the spectator page's left panel lists the countdowns instead
- // playing under the bar's page, the countdowns are on the Tab scoreboard and the strip of seats
+ // playing under the bar's page, the countdowns are on the Tab scoreboard
if( m_superweaponIconCount < 1 || stripSwitchedOff( &GlobalData::m_showSuperweaponStrip ) || m_spectatorPageShown ||
( m_controlBarPageShown && !localPlayerWatching() ) )
return;
@@ -11166,16 +11044,6 @@ Bool InGameUI::drawControlBarPage( const IRegion2D *panels, const Bool *shown, I
HtmlLists lists;
putPowerBar( values, lists[ "powercells" ] ); // after the stack, whose frame it divides into cells
- // every player across the top of the screen, and whether each has a superweapon ready; a watcher's
- // own page has its strip there
- // gathered first: an argument list may read `teams` before gatherSeats has counted them
- if( !watching )
- {
- Int teams = 0;
- const std::vector< SpectatorStats > seats = gatherSeats( teams );
- fillPlayerSeats( seats, teams, m_spectatorSuperweapons, lists[ "seats" ] );
- }
-
// a well behind each of the fourteen command buttons, shown or not, so the grid reads as a grid
// with the steel between its places, and an empty place is a hole in it rather than bare dark
std::vector< HtmlValues > &commandCells = lists[ "commandcells" ];
diff --git a/GeneralsMD/Code/Tests/test_gameengine.cpp b/GeneralsMD/Code/Tests/test_gameengine.cpp
index c437ffc71..72a6e9018 100644
--- a/GeneralsMD/Code/Tests/test_gameengine.cpp
+++ b/GeneralsMD/Code/Tests/test_gameengine.cpp
@@ -13743,7 +13743,8 @@ TEST(the_spectator_page_has_its_pieces_and_no_option_clicks)
// the message list starts under #hud-top
CHECK( page.find( "id=\"hud-top\"" ) != std::string::npos );
CHECK( page.find( "data-each=\"players\"" ) != std::string::npos );
- CHECK( page.find( "data-each=\"seats\"" ) != std::string::npos );
+ // the players are on the Tab scoreboard, not in a strip across the top
+ CHECK( page.find( "data-each=\"seats\"" ) == std::string::npos );
}
#include "test_camera_behavior.inc"