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): hover cards for the attack, hold and move keys

Olcay Seygan4efad9ec01be
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e0972e198..b3bdc52dc 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -27,6 +27,7 @@ found and fixed — EA's own, not port damage.**
- Peace time has its own plate under your money, so the truce clock never pushes the match clock aside. When the last ten seconds start, the countdown hangs straight off that plate.
- A superweapon built, charged or fired anywhere on the map flashes its name in big letters under the clock: "Nuclear Missile launched". Yours are white, an ally's blue, an enemy's red. Each line stays four seconds and fades out. When several land at once they queue and hurry through, two seconds each with one more waiting and one second with a pile behind it, so the last news never sits stale.
- Your production queue stands on the console over your selection, five to a row, each row only as long as what is in it. The event feed runs down from the menu key in the top left corner, and the chat sits under it.
+- Point at the attack, hold position or move key and a card says what it does, in English or Turkish. Those three are painted onto the grid rather than given to a unit, so the game had no card for them and showed nothing. The card stands on top of the command bar like every other button's.
- HUD Size grows the console from its middle, and on a narrow screen it stops at the size that still fits.
## Groups attack-move at their own speed
diff --git a/GeneralsMD/Code/Data/Patch.str b/GeneralsMD/Code/Data/Patch.str
index eac664115..a5f35e04c 100644
--- a/GeneralsMD/Code/Data/Patch.str
+++ b/GeneralsMD/Code/Data/Patch.str
@@ -193,6 +193,33 @@ GUI:StopDescription
"Stops what the selected units are doing."
END
+// The command grid's own attack, hold position and move keys, which stand in no command set:
+// the cards they show under the pointer.
+
+GUI:OrderForceAttack
+"Force Attack"
+END
+
+GUI:OrderForceAttackDescription
+"The next click attacks whatever is under the pointer, the ground and your own side included. Click the key again to call it off."
+END
+
+GUI:OrderHoldPosition
+"Hold Position"
+END
+
+GUI:OrderHoldPositionDescription
+"The selected units guard the spot they stand on and fight whatever comes near, without chasing it out of the area."
+END
+
+GUI:OrderMove
+"Move"
+END
+
+GUI:OrderMoveDescription
+"The next click on the ground sends the selected units there. Drag instead and they spread out along the line you draw."
+END
+
// Smoke signals. The three ...Placed lines are what an ally reads; %s is the sender's name. The
// ...Label words are written over the smoke, which is in the sender's colour.
GUI:SignalAttack
diff --git a/GeneralsMD/Code/Data/Turkish/Generals.str b/GeneralsMD/Code/Data/Turkish/Generals.str
index 75f496d2a..57437321e 100644
--- a/GeneralsMD/Code/Data/Turkish/Generals.str
+++ b/GeneralsMD/Code/Data/Turkish/Generals.str
@@ -14801,6 +14801,30 @@ GUI:StopDescription
"Seçili birliklerin yaptığı işi durdurur."
END
+GUI:OrderForceAttack
+"Zorla Saldır"
+END
+
+GUI:OrderForceAttackDescription
+"Bir sonraki tıklama imlecin altındaki her şeye saldırır, zemin ve kendi tarafınız da buna dahil. Vazgeçmek için tuşa yeniden tıklayın."
+END
+
+GUI:OrderHoldPosition
+"Mevzini Koru"
+END
+
+GUI:OrderHoldPositionDescription
+"Seçili birlikler durdukları yeri korur ve yaklaşan her şeyle savaşır, ama onu bölgenin dışına kadar kovalamaz."
+END
+
+GUI:OrderMove
+"Hareket Et"
+END
+
+GUI:OrderMoveDescription
+"Zemine bir sonraki tıklama seçili birlikleri oraya gönderir. Bunun yerine sürüklerseniz birlikler çizdiğiniz çizgi boyunca dizilir."
+END
+
GUI:SignalAttack
"Sinyal: Saldır"
END
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
index e3c146688..10a4e332c 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
@@ -14795,7 +14795,28 @@ Bool InGameUI::drawTooltipPage( const UnicodeString &cursorText, const RGBColor
if( !isTooltipPageReady() )
return FALSE;
+ const ICoord2D &mouse = TheMouse->getMouseStatus()->pos;
const BuildTooltipCard *card = TheControlBar->getBuildTooltipCard();
+
+ // the attack, hold position and move keys are the page's own, with no window behind them for the
+ // bar's tooltip to find, so their cards are made here and stand on the console as a button's does
+ static const char *const ORDER_KEY_LABELS[ ORDER_KEYS ] = { "GUI:OrderForceAttack", "GUI:OrderHoldPosition", "GUI:OrderMove" };
+ BuildTooltipCard orderCard = BuildTooltipCard();
+ if( m_controlBarPageShown && m_orderKeysShown && !areTooltipsDisabled() && !isQuitMenuVisible() )
+ {
+ for( Int key = 0; key < ORDER_KEYS; key++ )
+ {
+ const IRegion2D &cell = m_orderKeyCell[ key ];
+ if( mouse.x < cell.lo.x || mouse.x >= cell.hi.x || mouse.y < cell.lo.y || mouse.y >= cell.hi.y )
+ continue;
+ AsciiString label = ORDER_KEY_LABELS[ key ];
+ orderCard.name = TheGameText->fetch( label );
+ label.concat( "Description" );
+ orderCard.description = TheGameText->fetch( label );
+ orderCard.anchor = cell;
+ card = &orderCard;
+ }
+ }
if( card == NULL && cursorText.isEmpty() )
return TRUE;
@@ -14831,7 +14852,6 @@ Bool InGameUI::drawTooltipPage( const UnicodeString &cursorText, const RGBColor
const Int screenWidth = TheDisplay->getWidth();
const Int screenHeight = TheDisplay->getHeight();
- const ICoord2D &mouse = TheMouse->getMouseStatus()->pos;
const Int gap = REAL_TO_INT( TOOLTIP_ANCHOR_GAP * ControlBarHudPageScale() );
for( Int pass = 0; pass < TOOLTIP_LAYOUT_PASSES; pass++ )
{