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): keys press in, rank key blinks in the side's steel
Olcay Seygana3ce77caee64
diff --git a/GeneralsMD/Code/Data/Window/Html/ControlBar.html b/GeneralsMD/Code/Data/Window/Html/ControlBar.htmlindex e97aaea0b..71e1449c5 100644--- a/GeneralsMD/Code/Data/Window/Html/ControlBar.html+++ b/GeneralsMD/Code/Data/Window/Html/ControlBar.html@@ -226,6 +226,12 @@.gla .key:hover { background: linear-gradient(to bottom, #cabe86, #766a3a); }.key .icon { position: absolute; left: 9px; top: 2px; width: 14px; height: 14px;background-size: 100% 100%; background-repeat: no-repeat; }+ /* pressed, the key under the pointer while the left button is {{held}}: sunk deeper than at rest,+ dark on top and lit below, the gold rim kept and the picture a pixel down */+ .held .key:hover { background: linear-gradient(to bottom, #151a1f, #3a414a); border-color: #e8d27a; }+ .china .held .key:hover { background: linear-gradient(to bottom, #1c0906, #5a2217); }+ .gla .held .key:hover { background: linear-gradient(to bottom, #19160a, #4f4623); }+ .held .key:hover .icon { top: 3px; }.key .veil { display: none; }.disabled .key .veil { display: block; position: absolute; left: 0; top: 0; width: 32px; height: 18px;background-color: rgba(4, 8, 10, 0.65); }@@ -258,12 +264,21 @@/* the rank: the promotion button, a key like the idle worker's in a tab on the right panel'sbezel, a star on it for every rank there is, gold up to the one reached and dark past it. Thetab is 66 by 22 and the key 60 by 17 with its rim, three pixels in. Under the pointer it comes- up as lit steel with a gold rim, and while a promotion waits to be spent it blinks gold */+ up as lit steel with a gold rim, and while a promotion waits to be spent it blinks in the side's own+ steel at its brightest, a white rim round it. The stars carry a dark outline so the gold reads+ on the lit key as well, and an unreached one is a dark star rimmed in light steel */.rank .key { left: 3px; top: 3px; width: 58px; height: 15px; }.rank.hilite .key { background: linear-gradient(to bottom, #b3bbc4, #5a626c); border-color: #e8d27a; }.china .rank.hilite .key { background: linear-gradient(to bottom, #d58a70, #7a3120); }.gla .rank.hilite .key { background: linear-gradient(to bottom, #cabe86, #766a3a); }- .rank.ready.lit .key { background: linear-gradient(to bottom, #f6e08a, #a4832a); border-color: #fff4b8; }+ .rank.ready.lit .key { background: linear-gradient(to bottom, #eef3f7, #6f7883); border-color: #ffffff; }+ .china .rank.ready.lit .key { background: linear-gradient(to bottom, #ffc4ae, #a4432e); border-color: #ffe4d8; }+ .gla .rank.ready.lit .key { background: linear-gradient(to bottom, #f4ecc0, #8f8249); border-color: #fff8dc; }+ /* pressed through its own window, which the bar marks pushed, or held under the pointer */+ .rank.pushed .key, .held .rank .key:hover { background: linear-gradient(to bottom, #151a1f, #3a414a); border-color: #e8d27a; }+ .china .rank.pushed .key, .china .held .rank .key:hover { background: linear-gradient(to bottom, #1c0906, #5a2217); }+ .gla .rank.pushed .key, .gla .held .rank .key:hover { background: linear-gradient(to bottom, #19160a, #4f4623); }+ .rank.pushed .star, .held .rank .key:hover .star { margin-top: 1px; }.rank .star { position: absolute; top: 2px; width: 10px; height: 10px; background-size: 100% 100%;background-repeat: no-repeat; background-image: url(Icons/RankStarDark.svg); }.rank .star.lit { background-image: url(Icons/RankStar.svg); }@@ -307,7 +322,7 @@</style></head><body>-<div class="{{side}} {{watching}}">+<div class="{{side}} {{watching}} {{held}}"><div class="piece frame bezel solid {{left.shown}}" style="left: {{left.x}}px; top: {{left.y}}px; width: {{left.w}}px; height: {{left.h}}px; border-width: {{left.bt}}px {{left.br}}px {{left.bb}}px {{left.bl}}px"><div class="steel" style="left: -{{left.bl}}px; right: -{{left.br}}px; top: -{{left.bt}}px; bottom: -{{left.bb}}px"></div>diff --git a/GeneralsMD/Code/Data/Window/Html/Icons/RankStar.svg b/GeneralsMD/Code/Data/Window/Html/Icons/RankStar.svgindex 4b0a3b508..00b3cfb5c 100644--- a/GeneralsMD/Code/Data/Window/Html/Icons/RankStar.svg+++ b/GeneralsMD/Code/Data/Window/Html/Icons/RankStar.svg@@ -1,3 +1,3 @@<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">- <path d="M12.0 1.8 14.6 9.2 22.5 9.4 16.2 14.2 18.5 21.7 12.0 17.2 5.5 21.7 7.8 14.2 1.5 9.4 9.4 9.2Z" fill="#f2cf4a"/>+ <path d="M12.0 1.8 14.6 9.2 22.5 9.4 16.2 14.2 18.5 21.7 12.0 17.2 5.5 21.7 7.8 14.2 1.5 9.4 9.4 9.2Z" fill="#ffd84a" stroke="#8a5c0a" stroke-width="1.2" stroke-linejoin="round"/></svg>diff --git a/GeneralsMD/Code/Data/Window/Html/Icons/RankStarDark.svg b/GeneralsMD/Code/Data/Window/Html/Icons/RankStarDark.svgindex 8a9998cf4..09a1ecfd3 100644--- a/GeneralsMD/Code/Data/Window/Html/Icons/RankStarDark.svg+++ b/GeneralsMD/Code/Data/Window/Html/Icons/RankStarDark.svg@@ -1,3 +1,3 @@<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">- <path d="M12.0 1.8 14.6 9.2 22.5 9.4 16.2 14.2 18.5 21.7 12.0 17.2 5.5 21.7 7.8 14.2 1.5 9.4 9.4 9.2Z" fill="#3a4048"/>+ <path d="M12.0 1.8 14.6 9.2 22.5 9.4 16.2 14.2 18.5 21.7 12.0 17.2 5.5 21.7 7.8 14.2 1.5 9.4 9.4 9.2Z" fill="#1a1f24" stroke="#9aa4ae" stroke-width="2" stroke-linejoin="round"/></svg>diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cppindex 9717487cb..afcb40b92 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp@@ -10728,6 +10728,9 @@ Bool InGameUI::drawControlBarPage( const IRegion2D *panels, const Bool *shown, Iconst Bool watching = localPlayerWatching();values[ "promotion" ] = !watching && TheControlBar->isGeneralStarFlashing() ? "ready" : "";values[ "watching" ] = watching ? "watching" : "";+ // the page's clicks are whole, down and up at once, so a key pressed in under the pointer goes by+ // the mouse's own left button+ values[ "held" ] = TheMouse->getMouseStatus()->leftState != MBS_Up ? "held" : "";values.insert( m_hudValues.begin(), m_hudValues.end() );values[ "blink" ] = TheGameLogic->getFrame() % LOGICFRAMES_PER_SECOND > LOGICFRAMES_PER_SECOND / 2 ? "lit" : "";for( Int panel = 0; panel < panelCount; panel++ )