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 under-attack lamp from the command bar

Olcay Seygan0c055eacd257
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 658b2d1aa..cce5c814f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -20,7 +20,7 @@ found and fixed — EA's own, not port damage.**
## The command bar moves to the middle
-- The command bar is one console standing in the middle of the bottom edge: a taller radar, your selection and the build grid side by side, with the power bar over the grid. The idle worker, rank and under-attack keys sit in a row over your selection, and in multiplayer the smoke signals join them.
+- The command bar is one console standing in the middle of the bottom edge: a taller radar, your selection and the build grid side by side, with the power bar over the grid. The idle worker and rank keys sit in a row over your selection, and in multiplayer the smoke signals join them. The red under-attack lamp is gone: the ping on the radar, the voice and the line in the event feed already tell you where you are hit, and the lamp only blinked about it a second time.
- Your general's powers grow out of the console's right end, a column for each F key with its powers stacked up it, and only the powers you have take any room.
- A single unit's name and health stand beside its portrait, and a veteran gets his gold stars there too. A group shows every type it holds in the same box, five to a row.
- The match clock hangs from the middle of the top edge with your money in its own box under it. Superweapon countdowns in the top right corner are as big as your general's power buttons. Hold Tab and the scoreboard drops down from it.
diff --git a/GeneralsMD/Code/Data/Window/Html/ControlBar.html b/GeneralsMD/Code/Data/Window/Html/ControlBar.html
index 2b48b53c6..84bdb77d1 100644
--- a/GeneralsMD/Code/Data/Window/Html/ControlBar.html
+++ b/GeneralsMD/Code/Data/Window/Html/ControlBar.html
@@ -4,14 +4,14 @@
out the way the owner drew them on 2026-10-01: the console standing on the middle of the screen's
bottom edge, one plate of steel with a well for each section side by side - the radar with the
experience bar beside it, as tall as the console; the selection with, in the header strip over
- it, the idle worker's key, the skills key, the under-attack light and the smoke signals; the
+ it, the idle worker's key, the skills key and the smoke signals; the
command grid with the power bar in its header - with the general's powers growing out of its right
hand end, and the top page hanging from the middle of the top edge, the match clock's plate over
the money's. Laid out at
ControlBarHudScale(), 70 percent of the uniform scale the
tooltips and the boards use. The command buttons, the radar, the money and the
- portrait are still the bar's windows and paint over this page. The under-attack light, the power
- bar and the experience bar are the page's to draw: their windows take the clicks and draw
+ portrait are still the bar's windows and paint over this page. The power bar and the experience
+ bar are the page's to draw: their windows take the clicks and draw
nothing. The menu, idle worker and promotion buttons are the page's altogether, pressed through
data-click="press:Name"; the chat button is gone and Enter still opens the chat. Same materials
as Window/Html/Spectator.html, whose header says what the renderer draws and what not.
@@ -89,9 +89,9 @@
radar's, which reaches up to the console's top line
{{idletab.x}} ... in the selection's header from its left, on a grid of seven 30 pixel
{{skillstab.x}} ... slots: the idle worker's key, {{idleflash}} "flash" for half of every
- {{alerttab.x}} ... 0.7 seconds of the client's clock while one is idle; the skills key, two
- slots, the rank's stars, pressed through data-click="press:ButtonGeneral"
- for the promotion screen; and the under-attack light
+ 0.7 seconds of the client's clock while one is idle; and the skills key,
+ two slots, the rank's stars, pressed through
+ data-click="press:ButtonGeneral" for the promotion screen
{{powerframe.x}} ... the power bar's groove in the command grid's header strip;
{{powerframe.inner}} the height inside the frame and its lip
{{clock.x}} ... the match clock's well at the top of the top page, its figure
@@ -103,9 +103,8 @@
and {{Name.state}} any of "disabled", "hilite", "pushed", for LeftHUD (the
radar), RightHUD (the portrait's box), CameoWindow (the portrait),
CommandWindow, MoneyDisplay, PowerWindow, GeneralsExp, ButtonGeneral,
- ButtonLarge (the minimise button, stood down), ButtonOptions, ButtonIdleWorker,
- PopupCommunicator and WinUAttack (the under-attack light: "disabled" while
- it is lit, which is how the bar blinks it)
+ ButtonLarge (the minimise button, stood down), ButtonOptions, ButtonIdleWorker
+ and PopupCommunicator
All in the page's pixels, a pixel of an 800x600 screen. Without this page the plates draw.
Edit the copy under Run/Window/Html and the next match reads it.
@@ -311,16 +310,8 @@
/* the key in each one's top left corner is the game's, lettered the way the command buttons'
are (InGameUI::drawCellGridFront) */
- /* the under-attack light: a red lamp in a tab of a slot in the selection's header, dark until the
- bar blinks it. The lamp is a bar 22 by 10 with its rim */
- .alert .led { position: absolute; left: 3px; top: 5px; width: 20px; height: 8px; border: 1px solid #120302;
- background: linear-gradient(to bottom, #4a0d08, #2a0604); }
- .alert .glint { position: absolute; left: 2px; top: 1px; width: 16px; height: 2px; background-color: #6a2a24; }
- .alert.disabled .led { border-color: #ff9a80; background: linear-gradient(to bottom, #ff6a50, #d01a08); }
- .alert.disabled .glint { background-color: #ffe4dc; }
-
/* the skills key: the rank, and the promotion button, a key like the idle worker's in a tab of two
- slots between the idle worker's and the under-attack light, a star on it for every rank there
+ slots after the idle worker's, a star on it for every rank there
is, gold up to the one reached and dark past it. The key is 58 by 17 with its rim, a pixel in
from the tab's left and two down. Under the pointer it comes
up as lit steel with a gold rim, and while a promotion waits to be spent it blinks in the side's own
@@ -355,7 +346,7 @@
on the screen's edge */
.bezel .base { position: absolute; height: 1px; background-color: #0c1114; }
- /* the smoke signals: three slots after the under-attack light, a key in each: a crosshair to
+ /* the smoke signals: three slots after the skills key, a key in each: a crosshair to
attack, a shield to defend, an eye to look */
/* each key stands at its own left, pushed down by {{signalN.drop}} while it rises: a relatively
placed box inside an absolutely placed one is laid out from the screen's corner here, and the
@@ -383,7 +374,6 @@
<div class="rungs" style="width: {{expframe.innerw}}px"><div class="rung {{lit}}" data-each="expcells" style="top: {{y}}px; height: {{h}}px; width: {{expframe.innerw}}px"><div class="seg" style="width: {{expframe.innerw}}px; height: {{segh}}px"></div></div></div>
<div class="lip"></div>
</div>
- <div class="piece tab alert {{alerttab.shown}} {{WinUAttack.state}}" style="left: {{alerttab.x}}px; top: {{alerttab.y}}px; width: {{alerttab.w}}px; height: {{alerttab.h}}px"><div class="led"><div class="glint"></div></div></div>
<div class="piece tab rank {{skillstab.shown}} {{promotion}} {{blink}} {{ButtonGeneral.state}}" style="left: {{skillstab.x}}px; top: {{skillstab.y}}px; width: {{skillstab.w}}px; height: {{skillstab.h}}px">
<div class="key" data-click="press:ButtonGeneral"><div class="star {{lit}}" data-each="rankstars" style="left: {{x}}px"></div><div class="veil"></div></div>
</div>
diff --git a/GeneralsMD/Code/Data/Window/Html/Tooltip.html b/GeneralsMD/Code/Data/Window/Html/Tooltip.html
index c92d9fc30..4003b50a6 100644
--- a/GeneralsMD/Code/Data/Window/Html/Tooltip.html
+++ b/GeneralsMD/Code/Data/Window/Html/Tooltip.html
@@ -113,7 +113,7 @@
.entry.remark .from, .entry.remark .arrow, .entry .mark { display: none; }
.entry.upgrade.owned .mark { display: inline; }
- /* a note sunk into the card: dark on top, lit below, the warning in the under-attack lamp's red */
+ /* a note sunk into the card: dark on top, lit below, the warning in red */
.note { margin: 0 6px 6px 6px; padding: 3px 5px 3px 5px; line-height: 10px; background-color: #1b232b;
border: 1px solid #06090b; border-bottom-color: #4b535e; border-right-color: #4b535e; }
.china .note { background-color: #2a1512; border-bottom-color: #6a2a1e; border-right-color: #6a2a1e; }
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.h b/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.h
index f5a6b0356..0543023db 100644
--- a/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.h
+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.h
@@ -1058,8 +1058,6 @@ public:
///< put the general's powers bar on screen now, filled in, with no slide-in (control changed hands)
void showSpecialPowerShortcutInstantly( Player *player );
- void triggerRadarAttackGlow( void );
-
void drawSpecialPowerShortcutMultiplierText();
Bool hasAnyShortcutSelection() const;
@@ -1174,8 +1172,6 @@ protected:
Int oldParentX, Int oldParentY, Int newParentX, Int newParentY,
Int shiftX = 0 );
- void updateRadarAttackGlow ( void );
-
void setDefaultControlBarConfig( void );
void setSquishedControlBarConfig( void );
void setLowControlBarConfig( void );
@@ -1564,10 +1560,6 @@ private:
ICoord2D m_controlBarForegroundMarkerPos;
ICoord2D m_controlBarBackgroundMarkerPos;
-
- Bool m_radarAttackGlowOn;
- Int m_remainingRadarAttackGlowFrames;
- GameWindow *m_radarAttackGlowWindow;
#if defined( _INTERNAL ) || defined( _DEBUG )
UnsignedInt m_lastFrameMarkedDirty;
diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/Radar.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/Radar.cpp
index a8877575b..dd12287c6 100644
--- a/GeneralsMD/Code/GameEngine/Source/Common/System/Radar.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/Common/System/Radar.cpp
@@ -45,7 +45,6 @@
#include "GameClient/Eva.h"
#include "GameClient/GameWindowManager.h"
#include "GameClient/InGameUI.h"
-#include "GameClient/ControlBar.h"
#include "GameClient/PlayerColorScheme.h"
#include "GameLogic/GameLogic.h"
@@ -1239,8 +1238,6 @@ void Radar::tryUnderAttackEvent( const Object *obj )
// if event created, do some more feedback
if( eventCreated )
{
-
- TheControlBar->triggerRadarAttackGlow();
//
///@todo Should make an INI data driven table for radar event strings, and audio events
//
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp
index 68c194f19..a77246b47 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp
@@ -1560,9 +1560,6 @@ ControlBar::ControlBar( void )
m_sideSelectAnimateDown = FALSE;
updateCommanBarBorderColors(GAME_COLOR_UNDEFINED,GAME_COLOR_UNDEFINED,GAME_COLOR_UNDEFINED,GAME_COLOR_UNDEFINED);
- m_radarAttackGlowOn = FALSE;
- m_remainingRadarAttackGlowFrames = 0;
- m_radarAttackGlowWindow = NULL;
m_pageSolidsActive = FALSE;
#if defined( _INTERNAL ) || defined( _DEBUG )
@@ -2912,7 +2909,6 @@ void ControlBar::shutdownWindows( void )
m_rightHUDCameoWindow = NULL;
m_rightHUDUnitSelectParent = NULL;
m_communicatorButton = NULL;
- m_radarAttackGlowWindow = NULL;
m_animateDownWindow = NULL;
m_multiSelectTiles.clear();
m_sideSelectAnimateDown = FALSE;
@@ -3130,7 +3126,11 @@ void ControlBar::initWindows( void )
win->winSetTooltipFunc(commandButtonTooltip);
}
- m_radarAttackGlowWindow = TheWindowManager->winGetWindowFromId(NULL, TheNameKeyGenerator->nameToKey("ControlBar.wnd:WinUAttack"));
+ // the radar's under-attack light is gone from the bar: the radar ping, the EVA line and the
+ // message say it already
+ win = TheWindowManager->winGetWindowFromId(NULL, TheNameKeyGenerator->nameToKey("ControlBar.wnd:WinUAttack"));
+ if(win)
+ win->winHide(TRUE);
win = TheWindowManager->winGetWindowFromId(NULL,TheNameKeyGenerator->nameToKey( AsciiString( "ControlBar.wnd:BackgroundMarker" ) ));
@@ -3183,10 +3183,6 @@ void ControlBar::reset( void )
hideSpecialPowerShortcut();
// do not destroy the rally drawable, it will get destroyed with everythign else during a reset
m_rallyPointDrawableID = INVALID_DRAWABLE_ID;
- if(m_radarAttackGlowWindow)
- m_radarAttackGlowWindow->winEnable(TRUE);
- m_radarAttackGlowOn = FALSE;
- m_remainingRadarAttackGlowFrames = 0;
m_displayedConstructPercent = -1.0f;
m_displayedOCLTimerSeconds = 0;
@@ -3296,9 +3292,7 @@ void ControlBar::update( void )
// This is driven by the client, once per RENDER frame, but nearly everything it recomputes -
// button availability, build clocks, special power readiness, the general's star flash - is
// keyed to the LOGIC frame and cannot change twice inside one tick. With the renderer
- // uncapped that was several whole passes per tick for nothing, and updateRadarAttackGlow()
- // was actively wrong: it burns one frame off its own countdown per call, so the "under
- // attack" radar glow blinked (fps/30)x too fast and went dark early. Latch that work to the
+ // uncapped that was several whole passes per tick for nothing. Latch that work to the
// logic frame. The scheme/video/animation managers and the window runUpdate()s below really
// are per-render and stay outside the latch, and so does anything the UI marks dirty, which
// must still answer a selection change on the frame it happens. See FINDINGS.md 7.4.
@@ -3311,7 +3305,6 @@ void ControlBar::update( void )
if( logicTick )
{
getStarImage();
- updateRadarAttackGlow();
}
//
@@ -6250,40 +6243,6 @@ void ControlBar::drawTransitionHandler( void )
{
// if(m_transitionHandler)
// m_transitionHandler->draw();
-}
-enum{
- RADAR_ATTACK_GLOW_FRAMES = 150,
- RADAR_ATTACK_GLOW_NUM_TIMES = 15 ///< number of times we'll flash
-};
-
-void ControlBar::triggerRadarAttackGlow( void )
-{
- if(!m_radarAttackGlowWindow)
- return;
- m_radarAttackGlowOn = TRUE;
- m_remainingRadarAttackGlowFrames = RADAR_ATTACK_GLOW_FRAMES;
- if(BitTest(m_radarAttackGlowWindow->winGetStatus(),WIN_STATUS_ENABLED) == TRUE)
- m_radarAttackGlowWindow->winEnable(FALSE);
-}
-
-void ControlBar::updateRadarAttackGlow ( void )
-{
- if(!m_radarAttackGlowOn || !m_radarAttackGlowWindow)
- return;
- m_remainingRadarAttackGlowFrames--;
- if(m_remainingRadarAttackGlowFrames <= 0)
- {
- m_radarAttackGlowOn = FALSE;
- m_radarAttackGlowWindow->winEnable(TRUE);
- return;
- }
-
- if(m_remainingRadarAttackGlowFrames % RADAR_ATTACK_GLOW_NUM_TIMES == 0)
- {
- m_radarAttackGlowWindow->winEnable(!BitTest(m_radarAttackGlowWindow->winGetStatus(),WIN_STATUS_ENABLED));
- }
-
-
}
void ControlBar::initSpecialPowershortcutBar( Player *player)
{
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
index 176350987..c833dc088 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
@@ -11385,16 +11385,14 @@ static void standDownPromotionScreen( void );
static const char *const CONTROL_BAR_WINDOWS[] =
{
"LeftHUD", "RightHUD", "CameoWindow", "CommandWindow", "MoneyDisplay", "PowerWindow", "GeneralsExp",
- "ButtonGeneral", "ButtonLarge", "ButtonOptions", "ButtonIdleWorker", "PopupCommunicator",
- "WinUAttack"
+ "ButtonGeneral", "ButtonLarge", "ButtonOptions", "ButtonIdleWorker", "PopupCommunicator"
};
/** The bar's windows the page draws instead of letting them paint themselves: the promotion and
- * minimise buttons and the radar's under-attack light. They still take their clicks; only their
- * pictures are the page's. */
+ * minimise buttons among them. They still take their clicks; only their pictures are the page's. */
static const char *const CONTROL_BAR_CUSTOM[] =
{
- "ButtonGeneral", "ButtonLarge", "WinUAttack", "PowerWindow", "GeneralsExp", "ExpBarForeground", "RightHUD",
+ "ButtonGeneral", "ButtonLarge", "PowerWindow", "GeneralsExp", "ExpBarForeground", "RightHUD",
"WinUnitSelected"
};
@@ -11616,8 +11614,8 @@ static const Int UPGRADE_CAMEOS = 5; ///< UnitUpgrade1 to 5, a single unit's up
* the radar with the experience bar beside it, then the command grid, six by three, with the power
* bar lying along its top and the money on the power bar's left end, then the portrait bar on the
* screen's bottom edge. Since 2026-10-01 the radar's keys stand in the selection's header instead,
- * the idle worker's key, the skills key and the under-attack light from its left, the smoke signals
- * after them, and the radar has the height of its header too. */
+ * the idle worker's key and the skills key from its left, the smoke signals after them, and the
+ * radar has the height of its header too. */
enum
{
COMMAND_BUTTON_WIDTH = 50, ///< a command button as ControlBar.wnd authors it, the promotion screen's cell
@@ -11639,10 +11637,10 @@ enum
EXPERIENCE_GAP = 4, ///< between it and the radar
PANEL_FOOT = 4, ///< a grid's ring over the screen's bottom edge, the steel under it
HEADER_SLOTS = 7, ///< the selection's header, in slots of a seventh of it: the idle worker's key,
- ///< the skills key two, the under-attack light, and a smoke signal's key each
+ ///< the skills key two and a smoke signal's key each; the last slot is bare
+ ///< steel since the under-attack light went, so the keys kept their size
IDLE_SLOTS = 1,
SKILLS_SLOTS = 2,
- ALERT_SLOTS = 1,
SIGNAL_BUTTONS = 3, ///< attack, defend, look, a slot each
SIGNAL_STEP_HEIGHT = 24, ///< how far each smoke signal key rises into its place
MONEY_TEXT_MARGIN = 5, ///< the money's well each side of its figure, which sets the well's width
@@ -12338,11 +12336,10 @@ Bool InGameUI::drawControlBarPage( const IRegion2D *panels, const Bool *shown, I
putExperienceBar( values, lists[ "expcells" ], lists[ "rankstars" ] );
// in the selection's header, on its grid of HEADER_SLOTS from its left: the idle worker's key, the
- // skills key - the rank's stars, and the button that opens the promotion screen - the under-attack
- // light, and in a multiplayer game the three smoke signals. A key that is not there leaves no gap:
- // a watcher, or a player beaten, has no idle worker's key and no promotions to buy, and only the
- // light is left at the header's left end. Every edge is a whole slot from the header's left, each
- // rounded once, so two tabs share theirs
+ // skills key - the rank's stars, and the button that opens the promotion screen - and in a
+ // multiplayer game the three smoke signals. A key that is not there leaves no gap: a watcher, or a
+ // player beaten, has no idle worker's key and no promotions to buy. Every edge is a whole slot
+ // from the header's left, each rounded once, so two tabs share theirs
const Bool idleShown = leftFound && centreShown;
const Bool skillsShown = leftFound && ThePlayerList->getLocalPlayer()->isPlayerActive();
const IRegion2D header = wellHeader( selectionWell, scale );
@@ -12361,11 +12358,9 @@ Bool InGameUI::drawControlBarPage( const IRegion2D *panels, const Bool *shown, I
Int slot = 0;
const IRegion2D idleTab = Slots::take( header, slotWidth, slot, idleShown ? IDLE_SLOTS : 0 );
const IRegion2D skillsTab = Slots::take( header, slotWidth, slot, skillsShown ? SKILLS_SLOTS : 0 );
- const IRegion2D alertTab = Slots::take( header, slotWidth, slot, ALERT_SLOTS );
const IRegion2D signalTabs = Slots::take( header, slotWidth, slot, signalsShown ? SIGNAL_BUTTONS : 0 );
putPageRect( values, "idletab", idleTab, idleShown, scale );
putPageRect( values, "skillstab", skillsTab, skillsShown, scale );
- putPageRect( values, "alerttab", alertTab, leftFound, scale );
putPageRect( values, "signals", signalTabs, signalsShown, scale );
const UnsignedInt nowMs = Clock_Milliseconds();