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.
C++ cmakecnccommand-and-conquercppdirectx11game-enginegame-preservationgeneralsrtssage-enginex64zero-hour
feat(gameclient): spectator page takes the player's top strip, loses lead graph and strips
Olcay Seygan20f466e2e259
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 0dbe1f085..481d17caf 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -484,7 +484,7 @@ found and fixed — EA's own, not port damage.**- 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 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 at the top of the board on the right 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, turn the view or click the radar and the camera is yours again, still following the same player. 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, turn the view or click the radar and the camera is yours again, still following the same player. 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, 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 is clicking his seat at the top, 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 strips can be switched off. A small "Strips" drop-down in the top left corner opens into two boxes, the generals' promotions and the superweapon timers, and each box switches its strip the moment it is clicked and is remembered for the next match you watch. The message list moves down to start under it. Playing, there is no drop-down and every strip is up, whatever you chose in the stands.+- 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, 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 in the same metal tray the production strip uses, his name in his colour, the number in gold, and under it a bar filled the way the power bar is, green for one side and red for the other in a two-sided match and each player's own colour in a free for all. 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.-- Two buttons under the list. One opens the net worth lead since the first minute on a green radar screen, the first team's lead rising above the line and the second's falling below it in red, with how far ahead the leader is right now; it needs a match with two sides. The other 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.-- Across the top, every player in the match, grouped by team with the match clock between two teams: his general, his name, his cash, and the cash in red while his power is short.+- 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. Each general's emblem sits square in its tray; it used to show a dark slit down one side.+- 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. Click a flag to watch that player; the one you watch has his flag framed in gold. 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.diff --git a/GeneralsMD/Code/Data/Patch.str b/GeneralsMD/Code/Data/Patch.strindex 808cbf666..4e5aad48b 100644--- a/GeneralsMD/Code/Data/Patch.str+++ b/GeneralsMD/Code/Data/Patch.str@@ -1121,11 +1121,6 @@ GUI:CantBuildTooManyDerrickDefenses"You already have two defenses round these oil derricks."END-// the drop-down in the top left corner of a match that switches the strips on and off-GUI:HudToggles-"Strips"-END-GUI:HudSkillStrip"Generals' promotions"END@@ -1168,11 +1163,6 @@ GUI:HudStatPower"Power"END-// the graph of how far the first team's net worth is ahead of the second's-GUI:HudNetWorthLead-"Net worth lead"-END-// each player's most expensive units, with how many he hasGUI:HudArmies"Armies"diff --git a/GeneralsMD/Code/Data/Turkish/Generals.str b/GeneralsMD/Code/Data/Turkish/Generals.strindex 46fcda4e0..d74c7d0fe 100644--- a/GeneralsMD/Code/Data/Turkish/Generals.str+++ b/GeneralsMD/Code/Data/Turkish/Generals.str@@ -15649,10 +15649,6 @@ TOOLTIP:UpgradeOwned"alındı"END-GUI:HudToggles-"Şeritler"-END-GUI:HudSkillStrip"General yetenekleri"END@@ -15693,10 +15689,6 @@ GUI:HudStatPower"Elektrik"END-GUI:HudNetWorthLead-"Net değer farkı"-END-GUI:HudArmies"Ordular"ENDdiff --git a/GeneralsMD/Code/Data/Window/Html/Spectator.html b/GeneralsMD/Code/Data/Window/Html/Spectator.htmlindex 6a82ee2d4..5c9447f92 100644--- a/GeneralsMD/Code/Data/Window/Html/Spectator.html+++ b/GeneralsMD/Code/Data/Window/Html/Spectator.html@@ -3,13 +3,13 @@What a spectator sees over the battlefield, dressed in the command bar's own materials: steelplates 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. Four pieces:+ unit turns it red. Three pieces:- #top every player across the top of the screen, grouped by team, the match clock between two teams- #hud-top the left panel: the strips drop-down, the superweapon countdowns and the promotions bought- #feed a superweapon coming ready, on the left for a few seconds, the way Dota's kill feed runs- #board the right panel: the camera and the fog, every player ranked by a picked stat, the lead- graph, the armies+ #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+ #board, every player ranked by a picked stat and the armiesLaid out by litehtml and drawn by the game (GameClient/HtmlOverlay.h). A CSS pixel is a pixel ofan 800x600 screen and font-size is the game font's point size there; the page is scaled with the@@ -19,35 +19,26 @@gradients other than linear ones, and text-transform on anything but plain ASCII letters.The game fills in, before layout (GameClient/HtmlTemplate.h):- {{option:Key}} "on" while that Options.ini on/off option is on{{flip:name}} "flipped" while a data-click of flip:name has been clicked an odd number of times{{pick:group}} the choice last made with data-click="pick:group:choice"{{pick:group:choice}} "on" while that is the choice; pick:stat:networth is on until another is made{{text:Label}} a string table label, in the player's language{{side}} "america", "china" or "gla": the side whose command bar is on screen- {{clock}} the match time, m:ss{{stat}} the label of the picked stat{{statkey:stat}} the key that picks that stat: the command bar's top row, "Q" and so on{{teams}} how many teams are left- {{lead}} {{leader}} how much net worth the leading team is ahead by, and "team0" or "team1"- {{graph}} "shown" once two teams have a lead worth drawingdata-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}} {{team}} {{teams}}{{portrait}} (a mapped image name, for <img src>)- data-each="lead", the first team's net worth less the second's since the start, up to 48- columns, with {{up}} or {{down}} as a percent of the biggest lead either way- data-each="top", every player grouped by team: {{kind}} "player" with {{image}} {{color}} {{name}}- {{team}} {{cash}}, {{power}} "brownout" while his power is short, {{click}} "watch:N" and- {{watched}} "watched" while he is the one looked at; between two teams one entry of kind- "clock", between any others one of kind "gap". A data-click of watch:N looks at player N, what- his button in the old player list did, and watch:N on the one already looked at goes back to- everybody- Three flat lists open each player's run with a {{kind}} "head" entry carrying {{image}} (his- general), {{color}} and {{name}}:- data-each="army", then up to six "unit" entries, the most money first, with {{image}} {{count}}- data-each="superweapons", then his countdowns, soonest first, "weapon" with {{image}} {{time}}- and {{ready}} "ready" once it can fire- data-each="skills", then his promotions, "skill" with {{image}}+ 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, and here {{sN.click}} "watch:N" and {{sN.watched}}+ "watched" while he is the one looked at; kind "gap" between two entries. A data-click of+ watch:N looks at player N, what his button in the old player list did, and watch:N on the one+ already looked at goes back to everybody+ 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}}data-each="toasts", the superweapons that came ready in the last eight seconds, oldest first:{{portrait}} {{color}} {{name}} of the owner, {{image}} the weapon's cameo and {{what}} its name{{camera}} names who drives the camera (GameClient/ObserverCamera.h), and {{camerafree}}@@ -59,9 +50,8 @@{{followcolor}} are the followed player's name and colour, or the nobody label and no colour{{fog}} "on" while the fog is drawn for the followed player, flipped with data-click="fog"- The stats: networth, cash, income, army, kills, rank, power. A data-click of option:Key flips- that option and saves it; flip:name flips the name for the rest of the match; pick:group:choice- picks and folds up flip:group. #hud-top's bottom edge is where the message list starts.+ The stats: networth, cash, income, army, kills, rank, power. A data-click of flip:name flips the+ name for the rest of the match; pick:group:choice picks and folds up flip:group. #hud-top's bottom edge is where the message list starts.Edit the copy under Run/Window/Html and the next match reads it.-->@@ -89,74 +79,64 @@.tray, .cell { background-image: url(SATraySmall); }.china .tray, .china .cell { background-image: url(SNTraySmall); }.gla .tray, .gla .cell { background-image: url(SUTraySmall); }+ /* a general's emblem sits in its tray at these sizes or nowhere: the tray's window is off centre,+ and a 24x16 tray showed a dark slit down the emblem's left side and a wide bevel on its right */+ .tray { width: 28px; height: 18px; }+ .emblem { position: absolute; left: 4px; top: 3px; width: 20px; height: 12px; }.gold { color: #e8d27a; }.title { padding: 2px 5px; color: #e8d27a; }- /* ---- the strip across the top ---- */- #top { position: absolute; left: 180px; right: 180px; top: 2px; text-align: center; }- /* one entry per seat ("tplayer"), and between two teams the clock ("tclock") or a gap ("tgap") */- .tplayer, .tclock, .tgap { display: inline-block; position: relative; vertical-align: top; }- .tplayer { width: 56px; height: 36px; margin: 0 1px; background-color: rgba(9, 20, 23, 0.7); }- .tclock { width: 52px; height: 20px; margin: 6px 4px 0 4px; }- .tgap { width: 8px; height: 36px; }- .tclock .tray, .tclock .tint, .tclock .who, .tclock .cash, .tgap .tray, .tgap .tint, .tgap .who, .tgap .cash { display: none; }- .clocktext { display: none; }- .tclock .clocktext { display: block; line-height: 18px; font-size: 11px; font-weight: bold; color: #e8d27a; }- .tplayer .tray { position: absolute; left: 14px; top: 2px; width: 28px; height: 18px; }- .tplayer .emblem { position: absolute; left: 4px; top: 3px; width: 20px; height: 12px; }- .tplayer .tint { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; }- .tplayer .who { position: absolute; left: 0; right: 0; top: 20px; font-size: 8px; line-height: 8px; }- .tplayer .cash { position: absolute; left: 0; right: 0; top: 27px; font-size: 7px; line-height: 7px; color: #e8d27a; }- .tplayer.brownout .cash { color: #ff7a5c; }- /* the seat is the player list's button: the pointer lights it, and the one being watched is lit gold */- .tplayer:hover { background-color: rgba(60, 72, 80, 0.85); }- .tplayer.watched { background-color: rgba(232, 210, 122, 0.3); border-bottom: 2px solid #e8d27a; }- .team0 .tint { background-color: #b8f08a; }- .team1 .tint { background-color: #ff7a5c; }+ /* ---- 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. A flag is the old player list's button: the pointer lights its+ frame, and the player being watched has his in gold */+ #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; }+ .flag:hover .frame, .flag:hover .lamp { border-color: #dfe5ea; }+ .flag.watched .frame, .flag.watched .lamp { border-color: #e8d27a; }+ .sgap { width: 8px; height: 26px; }- /* ---- the left panel ---- */- /* it stands clear of the command bar's menu button in the screen's top left corner */- #hud-top { position: absolute; left: 26px; top: 4px; width: 172px; }-- .strips { margin-bottom: 3px; }- .strips .plate { padding: 2px 5px; }- .strips .items { display: none; padding: 1px 0; }- .strips.flipped .items { display: block; }.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; }.on .box { background-image: url(PowerBarGreen); border-color: #b8f08a; }- .section { display: none; margin-bottom: 3px; padding-bottom: 3px; }- .section.on { display: block; }- .section .title { margin-bottom: 1px; }- .shelf { overflow: hidden; padding: 0 3px; }- .shelf .cell { float: left; position: relative; width: 22px; height: 19px; margin: 1px 1px 0 0; }- .shelf .cell img { position: absolute; left: 1px; top: 1px; width: 20px; height: 17px; }- .shelf .cell.head { clear: left; width: 24px; height: 16px; margin: 2px 3px 0 0; }- .shelf .cell.head img { left: 3px; top: 2px; width: 18px; height: 12px; }- .time { position: absolute; left: 1px; bottom: 0; font-size: 7px; line-height: 7px; font-weight: bold; color: #ffffff; background-color: rgba(0, 0, 0, 0.6); }- .weapon.ready .time { color: #b8f08a; }- .weapon.ready { background-image: url(PowerBarGreen); }- .skills .cell { width: 19px; height: 17px; }- .skills .cell img { width: 17px; height: 15px; }-/* ---- the feed on the left ---- */- #feed { width: 260px; }+ /* it stands clear of the command bar's menu button in the screen's top left corner */+ #hud-top { position: absolute; left: 26px; top: 4px; width: 260px; }.toast { position: relative; height: 18px; margin-bottom: 2px;background: linear-gradient(to right, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0)); }- .toast .tray { position: absolute; left: 2px; top: 1px; width: 24px; height: 16px; }- .toast .emblem { position: absolute; left: 3px; top: 2px; width: 18px; height: 12px; }- .toast .who { position: absolute; left: 30px; top: 0; line-height: 18px; font-weight: bold; }- .toast .weapon { position: absolute; left: 100px; top: 1px; width: 20px; height: 16px; }- .toast .what { position: absolute; left: 124px; top: 0; line-height: 10px; color: #e8d27a; }- .toast .ready { position: absolute; left: 124px; top: 10px; line-height: 8px; font-size: 7px; color: #b8f08a; }+ .toast .tray { position: absolute; left: 2px; top: 0; }+ .toast .who { position: absolute; left: 34px; top: 0; line-height: 18px; font-weight: bold; }+ .toast .weapon { position: absolute; left: 104px; top: 1px; width: 20px; height: 16px; }+ .toast .what { position: absolute; left: 128px; top: 0; line-height: 10px; color: #e8d27a; }+ .toast .ready { position: absolute; left: 128px; top: 10px; line-height: 8px; font-size: 7px; color: #b8f08a; }- /* ---- the right panel ---- */+ /* ---- the right column: the camera, and under it the board ---- *//* under ControlBar.html's #net, 37px tall with the network line a player knocked out of anonline match still gets */- #board { position: absolute; right: 4px; top: 40px; width: 172px; padding: 0 0 3px 0; }+ #right { position: absolute; right: 4px; top: 40px; width: 172px; }+ #watch { padding: 0 0 1px 0; margin-bottom: 4px; }+ #board { padding: 0 0 3px 0; }.head { height: 16px; padding: 0 3px; position: relative; }.combo { position: absolute; left: 3px; right: 3px; top: 2px; height: 11px; line-height: 11px; padding-left: 5px; color: #b8f08a; }.combo:hover { color: #ffffff; }@@ -164,8 +144,15 @@.tab { position: absolute; right: 0; top: 0; width: 11px; height: 11px; text-align: center; font-size: 6px;background: linear-gradient(to bottom, #6f7782, #3f4650); color: #e8d27a; }- .choices { display: none; margin: 2px 3px; padding: 1px 0; }+ /* a drop-down opens over what is under it rather than pushing it down, in a well with no see-through.+ The z-index is on .drop: litehtml stacks every positioned element on its own, so one on .choices+ only counted inside .drop, and the player rows, positioned and later, were drawn over the list */+ .drop { position: relative; height: 0; z-index: 10; }+ .choices { display: none; position: absolute; left: 3px; right: 3px; top: 0; padding: 1px 0; }.flipped > .choices { display: block; }+ .choices.well { background-color: #091417; }+ .china .choices.well { background-color: #1a0a08; }+ .gla .choices.well { background-color: #161308; }.choice { padding: 2px 6px; color: #c9d2d9; }.choice:hover { color: #ffffff; background-color: rgba(119, 131, 145, 0.25); }.choice.on { color: #b8f08a; }@@ -175,85 +162,48 @@.players { margin: 2px 3px 0 3px; }.player { position: relative; height: 18px; border-bottom: 1px solid rgba(119, 131, 145, 0.18); }- .player .tray { position: absolute; left: 1px; top: 1px; width: 24px; height: 16px; }- .emblem { position: absolute; left: 3px; top: 2px; width: 18px; height: 12px; }- .name { position: absolute; left: 30px; top: 1px; line-height: 10px; }+ .player .tray { position: absolute; left: 1px; top: 0; }+ .name { position: absolute; left: 34px; top: 1px; line-height: 10px; }.value { position: absolute; right: 3px; top: 1px; line-height: 10px; font-weight: bold; color: #e8d27a; }- .meter { position: absolute; left: 30px; right: 3px; top: 12px; height: 3px; background-color: #030709; }+ .meter { position: absolute; left: 34px; right: 3px; top: 12px; height: 3px; background-color: #030709; }.fill { height: 3px; }.teams2.team0 .fill { background-image: url(PowerBarGreen); }.teams2.team1 .fill { background-image: url(PowerBarRed); }- .buttons { height: 13px; margin: 3px 3px 0 3px; }- .button { float: left; width: 78px; height: 11px; line-height: 11px; text-align: center; margin-right: 2px; font-size: 8px; color: #c9d2d9; }+ .button { height: 11px; line-height: 11px; margin: 3px 3px 0 3px; text-align: center; font-size: 8px; color: #c9d2d9; }.button.flipped { color: #b8f08a; }- .panel { display: none; clear: both; margin: 3px 3px 0 3px; }+ .panel { display: none; margin: 3px 3px 0 3px; }.panel.flipped { display: block; }- .graph.flipped { display: none; }- .graph.flipped.shown { display: block; }- .lead { float: right; font-weight: bold; }- .team0 .lead { color: #b8f08a; }- .team1 .lead { color: #ff7a5c; }- /* the radar's screen */- .radar { position: relative; height: 38px; margin: 0 4px 4px 4px; background-color: #06140b; border: 1px solid #000000; border-bottom-color: #3d4a3f; }- .grid { position: absolute; left: 0; right: 0; height: 1px; background-color: #0f2a17; }- .chart { position: absolute; left: 1px; top: 1px; }- .col { float: left; width: 3px; height: 36px; }- .half { position: relative; height: 18px; }- .over { border-bottom: 1px solid #2f7a44; height: 17px; }- .up { position: absolute; left: 0; right: 1px; bottom: 0; background-color: #7fe07a; }- .down { position: absolute; left: 0; right: 1px; top: 0; background-color: #e0503c; }-- .army { overflow: hidden; padding: 0 3px 3px 3px; }+ .army { overflow: hidden; padding: 0 1px 3px 1px; }.army .cell { float: left; position: relative; width: 19px; height: 17px; margin: 1px 1px 0 0; }.army .cell img { position: absolute; left: 1px; top: 1px; width: 17px; height: 15px; }- .army .cell.head { clear: left; width: 24px; margin-right: 3px; }- .army .cell.head img { left: 3px; top: 2px; width: 18px; height: 12px; }+ .army .cell.head { clear: left; width: 28px; height: 18px; margin-right: 2px; }+ .army .cell.head img { left: 4px; top: 3px; width: 20px; height: 12px; }.count { position: absolute; right: 2px; bottom: 0; font-size: 8px; font-weight: bold; color: #ffffff; }</style></head><body><div class="{{side}}">-<div id="top">- <div class="t{{kind}} team{{team}} {{power}} {{watched}}" data-each="top" data-click="{{click}}">- <div class="tray"><img class="emblem" src="{{image}}"></div>- <div class="tint"></div>- <div class="who" style="color: {{color}}">{{name}}</div>- <div class="cash">{{cash}}</div>- <div class="clocktext well">{{clock}}</div>+<div id="seats">+ <div class="s{{kind}}" data-each="seats">+ <div class="flags">+ <div class="flag {{s0.state}} {{s0.watched}}" data-click="{{s0.click}}"><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}} {{s1.watched}}" data-click="{{s1.click}}"><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}} {{s2.watched}}" data-click="{{s2.click}}"><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}} {{s3.watched}}" data-click="{{s3.click}}"><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}} {{s4.watched}}" data-click="{{s4.click}}"><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}} {{s5.watched}}" data-click="{{s5.click}}"><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}} {{s6.watched}}" data-click="{{s6.click}}"><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}} {{s7.watched}}" data-click="{{s7.click}}"><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 class="strips {{flip:strips}}">- <div class="plate" data-click="flip:strips"><span class="box"></span>{{text:GUI:HudToggles}}</div>- <div class="items well">- <div class="row {{option:ShowSkillStrip}}" data-click="option:ShowSkillStrip"><span class="box"></span>{{text:GUI:HudSkillStrip}}</div>- <div class="row {{option:ShowSuperweaponStrip}}" data-click="option:ShowSuperweaponStrip"><span class="box"></span>{{text:GUI:HudSuperweaponStrip}}</div>- </div>- </div>-- <div class="section well {{option:ShowSuperweaponStrip}}">- <div class="title">{{text:GUI:HudSuperweaponStrip}}</div>- <div class="shelf">- <div class="cell {{kind}} {{ready}}" data-each="superweapons">- <img src="{{image}}">- <span class="time">{{time}}</span>- </div>- </div>- </div>-- <div class="section well skills {{option:ShowSkillStrip}}">- <div class="title">{{text:GUI:HudSkillStrip}}</div>- <div class="shelf">- <div class="cell {{kind}}" data-each="skills"><img src="{{image}}"></div>- </div>- </div>-<div id="feed"><div class="toast" data-each="toasts"><div class="tray"><img class="emblem" src="{{portrait}}"></div>@@ -266,12 +216,13 @@</div>-<div id="board" class="well">+<div id="right">+<div id="watch" class="well"><div class="head plate"><div class="combo well" data-click="flip:camera">{{text:GUI:HudCamera}}: {{camera}}<span class="tab">▼</span></div></div>- <div class="{{flip:camera}}">+ <div class="drop {{flip:camera}}"><div class="choices well"><div class="choice {{camerafree}}" data-click="camera:free"><span class="box"></span>{{text:GUI:HudCameraFree}}</div><div class="choice {{cameradirector}}" data-click="camera:director"><span class="box"></span>{{text:GUI:HudCameraDirector}}</div>@@ -283,7 +234,7 @@<div class="combo well" data-click="flip:follow">{{text:GUI:HudFollow}}: <span style="color: {{followcolor}}">{{follow}}</span><span class="tab">▼</span></div></div>- <div class="{{flip:follow}}">+ <div class="drop {{flip:follow}}"><div class="choices well"><div class="choice {{follownobody}}" data-click="follow:none"><span class="box"></span>{{text:GUI:HudFollowNobody}}</div><div class="choice {{on}}" data-each="follows" data-click="{{click}}"><span class="box"></span><span style="color: {{color}}">{{name}}</span></div>@@ -291,12 +242,14 @@</div><div class="row {{fog}}" data-click="fog"><span class="box"></span>{{text:GUI:HudFog}}</div>+</div>+<div id="board" class="well"><div class="head plate"><div class="combo well" data-click="flip:stat">{{stat}}<span class="tab">▼</span></div></div>- <div class="{{flip:stat}}">+ <div class="drop {{flip:stat}}"><div class="choices well"><div class="caption">{{text:GUI:HudGameStats}}</div><div class="choice {{pick:stat:networth}}" data-click="pick:stat:networth"><span class="box"></span>{{text:GUI:HudNetWorth}}<span class="key">{{statkey:networth}}</span></div>@@ -318,24 +271,7 @@</div></div>- <div class="buttons">- <div class="button plate {{flip:graph}}" data-click="flip:graph">{{text:GUI:HudNetWorthLead}}</div>- <div class="button plate {{flip:army}}" data-click="flip:army">{{text:GUI:HudArmies}}</div>- </div>-- <div class="panel graph well {{graph}} {{flip:graph}}">- <div class="title {{leader}}">{{text:GUI:HudNetWorthLead}}<span class="lead">{{lead}}</span></div>- <div class="radar">- <div class="grid" style="top: 9px"></div>- <div class="grid" style="top: 27px"></div>- <div class="chart">- <div class="col" data-each="lead">- <div class="half over"><div class="up" style="height: {{up}}%"></div></div>- <div class="half"><div class="down" style="height: {{down}}%"></div></div>- </div>- </div>- </div>- </div>+ <div class="button plate {{flip:army}}" data-click="flip:army">{{text:GUI:HudArmies}}</div><div class="panel well {{flip:army}}"><div class="title">{{text:GUI:HudArmies}}</div>@@ -347,6 +283,7 @@</div></div></div>+</div></div></body>diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h b/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.hindex 0950cb703..8f4ab7620 100644--- a/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h@@ -1259,7 +1259,6 @@ protected://void drawSpectatorPage( void );Bool handleSpectatorPageClick( const ICoord2D *mouse, Bool act ); ///< TRUE when the click landed on it- void sampleSpectatorLead( Int lead, Bool twoTeams ); ///< the lead graph's next point, if one is dueHtmlOverlay * m_spectatorOverlay;Bool m_spectatorPageLoaded; ///< read once a match, so an edited page shows in the next oneBool m_spectatorPageShown; ///< drawn this frame, so clicks are its to take@@ -1270,8 +1269,6 @@ protected:HtmlValues m_spectatorTotals; ///< the page's values that are not per player, gathered with the listsUnsignedInt m_spectatorListsFrame; ///< the logic frame the lists were last gathered onconst Player *m_spectatorListsWatched; ///< the player being watched when they were, whose seat they mark- std::vector< Int > m_spectatorLead; ///< the first team's net worth less the second's, one per sample- UnsignedInt m_spectatorLeadFrame; ///< the logic frame the last of those was taken onInt m_hudTogglesBottom; ///< the bottom of the page's #hud-top, so the message list starts under itstd::vector< SpectatorSuperweapon > m_spectatorSuperweapons; ///< every countdown the superweapon pass found, rebuilt each passdiff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cppindex 7014012f2..6d3feedd0 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp@@ -62,7 +62,6 @@#include "GameClient/Eva.h"#include "GameClient/GameText.h"#include "Common/UserPreferences.h"-#include "Common/OptionsCatalog.h"#include "Common/FileSystem.h"#include "Common/file.h"#include "GameNetwork/GameSpy/ThreadUtils.h"@@ -1196,7 +1195,6 @@ InGameUI::InGameUI()m_spectatorPageShown = FALSE;m_spectatorListsFrame = 0;m_spectatorListsWatched = NULL;- m_spectatorLeadFrame = 0;m_hudTogglesBottom = 0;m_scoreboardOpen = FALSE;m_scoreboardOverlay = NULL;@@ -1788,7 +1786,6 @@ static Real elevatedReach( Real reach, Real range, const Coord3D ¢er, Real a// in the player's language.//-------------------------------------------------------------------------------------------------static const char *const SPECTATOR_PAGE = "Window\\Html\\Spectator.html";-static const std::string OPTION_ACTION = "option:";static const std::string FLIP_ACTION = "flip:";static const std::string PICK_ACTION = "pick:";static const std::string WATCH_ACTION = "watch:";@@ -1813,8 +1810,6 @@ enumMENU_BUTTON_CLEARANCE = 26, ///< where the messages start, right of the command bar page's menu button, 800x600NET_WORTH_REFRESH_FRAMES = LOGICFRAMES_PER_SECOND / 2, ///< how often every player's worth is counted againFRAMES_PER_MINUTE = LOGICFRAMES_PER_SECOND * 60,- LEAD_SAMPLE_FRAMES = LOGICFRAMES_PER_SECOND * 10, ///< one point of the lead graph every ten seconds- LEAD_GRAPH_COLUMNS = 48, ///< the most columns the graph draws; a longer match is averaged into themARMY_CHART_UNITS = 6, ///< kinds of unit shown per player, the most money firstPLAYER_NAME_CHARS = 11, ///< a name longer than this is cut, there is no clipping to hide itSECONDS_IN_MINUTE = 60,@@ -2076,57 +2071,6 @@ static void fillSpectatorArmies( const std::vector< SpectatorStats > &players, s}}-//--------------------------------------------------------------------------------------------------/** The page's "lead" list: the first team's net worth less the second's since the match began, as- * at most LEAD_GRAPH_COLUMNS columns, each with {{up}} or {{down}} the percentage of the biggest- * lead either way. A longer match averages neighbouring samples into one column. */-//--------------------------------------------------------------------------------------------------static void fillSpectatorLead( const std::vector< Int > &samples, std::vector< HtmlValues > &columns )-{- const Int count = (Int)samples.size();- const Int columnCount = min( count, (Int)LEAD_GRAPH_COLUMNS );- std::vector< Int > averages( columnCount );- Int biggest = 0;- for( Int column = 0; column < columnCount; column++ )- {- const Int first = column * count / columnCount;- const Int last = ( column + 1 ) * count / columnCount;- Int64 sum = 0;- for( Int sample = first; sample < last; sample++ )- sum += samples[ sample ];- averages[ column ] = (Int)( sum / ( last - first ) );- biggest = max( biggest, abs( averages[ column ] ) );- }-- columns.clear();- for( Int column = 0; column < columnCount; column++ )- {- const Int share = biggest > 0 ? abs( averages[ column ] ) * PERCENT / biggest : 0;- HtmlValues entry;- entry[ "up" ] = std::to_string( averages[ column ] > 0 ? share : 0 );- entry[ "down" ] = std::to_string( averages[ column ] < 0 ? share : 0 );- columns.push_back( entry );- }-}--//--------------------------------------------------------------------------------------------------/** The lead graph samples every LEAD_SAMPLE_FRAMES while two teams are left. A logic frame that- * went backwards is a new match or a load, and starts the graph again. */-//--------------------------------------------------------------------------------------------------void InGameUI::sampleSpectatorLead( Int lead, Bool twoTeams )-{- const UnsignedInt frame = TheGameLogic->getFrame();- if( frame < m_spectatorLeadFrame )- m_spectatorLead.clear();- if( !twoTeams )- return;- if( !m_spectatorLead.empty() && frame < m_spectatorLeadFrame + LEAD_SAMPLE_FRAMES )- return;-- m_spectatorLead.push_back( lead );- m_spectatorLeadFrame = frame;-}-static Int gatherPlayerSkills( const Player *player, const Image **icons, Int count, Int max );//-------------------------------------------------------------------------------------------------@@ -2185,38 +2129,6 @@ static std::string spectatorClock( UnsignedInt frame )return text;}-//--------------------------------------------------------------------------------------------------/** The page's "top" list, the strip across the top of the screen: every player grouped by team,- * each with kind "player", and between two teams an entry of kind "clock" - or kind "gap" between- * any others, so a free for all reads as separate seats. */-//--------------------------------------------------------------------------------------------------static void fillSpectatorTop( std::vector< SpectatorStats > players, std::vector< HtmlValues > &entries )-{- std::stable_sort( players.begin(), players.end(),- []( const SpectatorStats &a, const SpectatorStats &b ) { return a.team < b.team; } );-- entries.clear();- for( size_t index = 0; index < players.size(); index++ )- {- const SpectatorStats &stats = players[ index ];- if( index > 0 && players[ index - 1 ].team != stats.team )- {- HtmlValues between;- between[ "kind" ] = stats.team == 1 && players.back().team == 1 ? "clock" : "gap";- entries.push_back( between );- }-- HtmlValues entry = spectatorHead( stats.player );- entry[ "kind" ] = "player";- entry[ "team" ] = std::to_string( stats.team );- entry[ "cash" ] = std::to_string( stats.cash );- entry[ "power" ] = stats.power < 0 ? "brownout" : "";- entry[ "click" ] = WATCH_ACTION + std::to_string( stats.player->getPlayerIndex() );- entry[ "watched" ] = stats.player == TheControlBar->getObserverLookAtPlayer() ? "watched" : "";- entries.push_back( entry );- }-}-//-------------------------------------------------------------------------------------------------/** The players the camera can follow, grouped by team the way the seats are. Which one it is* following is marked every frame, not at the lists' rebuilds. */@@ -2365,6 +2277,8 @@ static void fillPlayerSeats( const std::vector< SpectatorStats > &seats, Int teagroup[ place + ".image" ] = head.at( "image" );group[ place + ".color" ] = head.at( "color" );group[ place + ".weapon" ] = ready ? "ready" : owned ? "charging" : "none";+ group[ place + ".click" ] = WATCH_ACTION + std::to_string( seats[ end ].player->getPlayerIndex() );+ group[ place + ".watched" ] = seats[ end ].player == TheControlBar->getObserverLookAtPlayer() ? "watched" : "";}group[ "kind" ] = freeForAll ? "ffa" : end - first > 1 ? "team" : "solo";for( size_t place = end - first; place < MAX_SLOTS; place++ )@@ -2381,70 +2295,6 @@ static void fillPlayerSeats( const std::vector< SpectatorStats > &seats, Int tea}}-//--------------------------------------------------------------------------------------------------/** The page's "superweapons" list: per player who has one, a head entry and then his countdowns,- * soonest first, each of kind "weapon" with its cameo, {{time}} and {{ready}} "ready" once it can- * fire. Players come in the order `players` has them. */-//--------------------------------------------------------------------------------------------------static void fillSpectatorSuperweapons( const std::vector< SpectatorStats > &players,- std::vector< SpectatorSuperweapon > weapons,- std::vector< HtmlValues > &cells )-{- std::stable_sort( weapons.begin(), weapons.end(),- []( const SpectatorSuperweapon &a, const SpectatorSuperweapon &b ) { return a.seconds < b.seconds; } );-- cells.clear();- for( size_t index = 0; index < players.size(); index++ )- {- const Int owner = players[ index ].player->getPlayerIndex();- Bool headed = FALSE;- for( size_t weapon = 0; weapon < weapons.size(); weapon++ )- {- if( weapons[ weapon ].playerIndex != owner )- continue;- if( !headed )- cells.push_back( spectatorHead( players[ index ].player ) );- headed = TRUE;-- UnicodeString time;- formatStripSeconds( &time, weapons[ weapon ].seconds );- HtmlValues cell;- cell[ "kind" ] = "weapon";- cell[ "image" ] = weapons[ weapon ].cameo ? weapons[ weapon ].cameo->getName().str() : "";- cell[ "time" ] = WideCharStringToMultiByte( time.str() );- cell[ "ready" ] = weapons[ weapon ].ready ? "ready" : "";- cells.push_back( cell );- }- }-}--//--------------------------------------------------------------------------------------------------/** The page's "skills" list: per player who has bought any, a head entry and then each promotion- * at the level it has reached, of kind "skill" with its cameo. */-//--------------------------------------------------------------------------------------------------static void fillSpectatorSkills( const std::vector< SpectatorStats > &players, std::vector< HtmlValues > &cells )-{- enum { SKILLS_SHOWN = 12 };-- cells.clear();- for( size_t index = 0; index < players.size(); index++ )- {- const Image *icons[ SKILLS_SHOWN ];- const Int count = gatherPlayerSkills( players[ index ].player, icons, 0, SKILLS_SHOWN );- if( count == 0 )- continue;-- cells.push_back( spectatorHead( players[ index ].player ) );- for( Int skill = 0; skill < count; skill++ )- {- HtmlValues cell;- cell[ "kind" ] = "skill";- cell[ "image" ] = icons[ skill ]->getName().str();- cells.push_back( cell );- }- }-}-//-------------------------------------------------------------------------------------------------/** 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@@ -2509,15 +2359,10 @@ Bool InGameUI::pickSpectatorStat( Int commandSlot )}//--------------------------------------------------------------------------------------------------/** The spectator's page: the drop-down that switches the strips on and off, every player ranked by- * the number picked in the stat drop-down, the net worth lead over the match and each army's most- * expensive units - the panels Dota's spectator keeps down the left of the screen.- *- * Watching a match two strips fight over the same picture - the promotions and the superweapon- * countdowns - and which of them a spectator wants depends on what he is watching for; the- * production is on the Tab scoreboard. Each box flips its option the moment it is clicked and- * saves the choice with the rest of the options. Only while watching: playing, the top left- * corner belongs to the messages, and the other side's worth is not a player's to know. */+/** 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. *///-------------------------------------------------------------------------------------------------void InGameUI::drawSpectatorPage( void ){@@ -2550,26 +2395,18 @@ void InGameUI::drawSpectatorPage( void )const std::vector< SpectatorStats > players = gatherSpectatorStats( stat, teams );fillSpectatorPlayers( players, stat, teams, m_spectatorLists[ "players" ] );fillSpectatorArmies( players, m_spectatorLists[ "army" ] );- fillSpectatorTop( players, m_spectatorLists[ "top" ] );fillSpectatorFollows( players, m_spectatorLists[ "follows" ] );- fillSpectatorSuperweapons( players, m_spectatorSuperweapons, m_spectatorLists[ "superweapons" ] );- fillSpectatorSkills( players, m_spectatorLists[ "skills" ] );- Int lead = 0;- for( size_t index = 0; index < players.size(); index++ )- lead += players[ index ].team == 0 ? players[ index ].networth : -players[ index ].networth;- sampleSpectatorLead( lead, teams == TWO_TEAMS );- fillSpectatorLead( m_spectatorLead, m_spectatorLists[ "lead" ] );+ // 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";m_spectatorTotals[ "teams" ] = std::to_string( teams );- m_spectatorTotals[ "lead" ] = std::to_string( abs( lead ) );- m_spectatorTotals[ "leader" ] = lead == 0 ? "" : ( lead > 0 ? "team0" : "team1" );- m_spectatorTotals[ "graph" ] = teams == TWO_TEAMS && m_spectatorLead.size() >= TWO_TEAMS ? "shown" : "";m_spectatorTotals[ "side" ] = spectatorSide();- m_spectatorTotals[ "clock" ] = spectatorClock( frame );for( Int each = 0; each < (Int)ARRAY_SIZE( SPECTATOR_STATS ); each++ )m_spectatorTotals[ std::string( "statkey:" ) + SPECTATOR_STATS[ each ].key ] = commandSlotKey( each * COMMAND_SLOTS_PER_COLUMN );m_spectatorListsFrame = frame;@@ -2598,9 +2435,6 @@ void InGameUI::drawSpectatorPage( void )values[ PICK_ACTION + pick->first ] = pick->second;values[ PICK_ACTION + pick->first + ":" + pick->second ] = "on";}- for( Int row = 0; row < TheOptionCatalogCount; row++ )- if( TheOptionCatalog[ row ].kind == OPTION_BOOL && TheOptionCatalog[ row ].get() )- values[ OPTION_ACTION + TheOptionCatalog[ row ].iniKey ] = "on";for( std::set< std::string >::const_iterator name = m_spectatorFlipped.begin(); name != m_spectatorFlipped.end(); ++name )values[ FLIP_ACTION + *name ] = "flipped";@@ -2693,22 +2527,6 @@ void InGameUI::runSpectatorAction( const std::string &action )}else if( action == FOG_ACTION )TheObserverCamera.setFog( !TheObserverCamera.isFogOn() );- else if( action.compare( 0, OPTION_ACTION.size(), OPTION_ACTION ) == 0 )- {- const OptionDef *option = findOptionDef( action.substr( OPTION_ACTION.size() ).c_str() );- if( option == NULL || option->kind != OPTION_BOOL )- {- DEBUG_LOG(( "Spectator page: data-click=\"%s\" names no on/off option\n", action.c_str() ));- return;- }-- const Bool now = !option->get();- option->set( now );-- OptionPreferences pref;- pref[ AsciiString( option->iniKey ) ] = AsciiString( now ? "yes" : "no" );- pref.write();- }}//-------------------------------------------------------------------------------------------------@@ -4155,8 +3973,6 @@ void InGameUI::reset( void )m_spectatorPicked.clear();m_spectatorLists.clear();m_spectatorTotals.clear();- m_spectatorLead.clear();- m_spectatorLeadFrame = 0;m_spectatorSuperweapons.clear();m_spectatorToasts.clear();m_inputEnabled = true;diff --git a/GeneralsMD/Code/Tests/test_gameengine.cpp b/GeneralsMD/Code/Tests/test_gameengine.cppindex 0471d2664..c437ffc71 100644--- a/GeneralsMD/Code/Tests/test_gameengine.cpp+++ b/GeneralsMD/Code/Tests/test_gameengine.cpp@@ -13722,9 +13722,10 @@ TEST(html_template_fills_values_and_repeats_each)CHECK_STR( HtmlTemplate_escape( "a\"b'c" ).c_str(), "a"b'c" );}-// The spectator's page is the shipped one. A data-click naming something that is not an on/off-// option draws a box that does nothing, and only a watched match would show it.-TEST(the_spectator_page_names_only_on_off_options)+// The spectator's page is the shipped one. It switches no options any more - the strips drop-down+// that did went with the shelves it switched - so an option: click is a box that does nothing, and+// only a watched match would show it.+TEST(the_spectator_page_has_its_pieces_and_no_option_clicks){FILE *fp = fopen( SPECTATOR_HTML, "rb" );CHECK( fp != NULL );@@ -13738,20 +13739,11 @@ TEST(the_spectator_page_names_only_on_off_options)page.append( chunk, got );fclose( fp );- const std::string click = "data-click=\"option:";- Int options = 0;- for( size_t at = page.find( click ); at != std::string::npos; at = page.find( click, at + 1 ) )- {- const size_t nameAt = at + click.size();- const std::string name = page.substr( nameAt, page.find( '"', nameAt ) - nameAt );- const OptionDef *option = findOptionDef( name.c_str() );- CHECK( option != NULL && option->kind == OPTION_BOOL );- options++;- }- // the promotions and the superweapon countdowns; the production queues are on the Tab scoreboard- CHECK_EQ( options, 2 );+ CHECK( page.find( "data-click=\"option:" ) == std::string::npos );+ // the message list starts under #hud-topCHECK( 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 );}#include "test_camera_behavior.inc"