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(gameengine): no word over a smoke signal, the ground mark says it

Olcay Seyganc83a39321397
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 54af494ab..b68cfcd4a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -719,8 +719,8 @@ found and fixed — EA's own, not port damage.**
- Allies only, and only mutual ones. Your position is sent to the players you are actually allied with and to nobody else; an enemy is never sent it at all, and a machine that has been made to send it anyway is ignored by everyone who is not your ally.
- An ally who alt-tabs away fades out over a couple of seconds instead of freezing on the map, so a marker that is still there is a marker somebody is still behind.
- Off in one place. `ShowAllyCursors = no` in `Options.ini` stops both halves: nothing is sent from your machine and nothing is drawn on it.
-- Alt+Z, Alt+X and Alt+C put up a puff of smoke in your own colour where your mouse is, with ATTACK, DEFEND or LOOK written over it. The colour says who, the word says what. Point at the radar instead and the smoke goes up on that spot of the map.
-- Your allies see the smoke and their radar blinks at the spot, and the message area says who sent it. Three seconds later the smoke has cleared, so the call you made a minute ago is never still standing next to the one you are making now. Enemies see none of it.
+- Alt+Z, Alt+X and Alt+C put up a puff of smoke in your own colour where your mouse is, and lay a mark on the ground under it: crossed swords, a shield or an eye. The colour says who, the mark says what, with no word to read in anyone's language. Point at the radar instead and the smoke goes up on that spot of the map.
+- Your allies see the smoke and their radar blinks at the spot, and the feed says who sent it. The smoke clears in three seconds and the mark in ten, so the call you made a minute ago is never still standing next to the one you are making now. Enemies see none of it.
- One signal a second per player. Hammering the key gets you the first puff and nothing else, and a teammate who tries it cannot bury your screen in smoke either, because every machine in the game holds everyone to the same limit.
## A console, on the key above Tab
diff --git a/GeneralsMD/Code/Data/Patch.str b/GeneralsMD/Code/Data/Patch.str
index 0659eca0a..6c1cf2c39 100644
--- a/GeneralsMD/Code/Data/Patch.str
+++ b/GeneralsMD/Code/Data/Patch.str
@@ -192,7 +192,7 @@ GUI:SignalAttack
END
GUI:SignalAttackDescription
-"Smoke in your colour marked ATTACK for three seconds, where the cursor is or on the radar spot under it. Only your allies see it."
+"Smoke in your colour and crossed swords on the ground for ten seconds, where the cursor is or on the radar spot under it. Only your allies see it."
END
GUI:SignalDefend
@@ -200,7 +200,7 @@ GUI:SignalDefend
END
GUI:SignalDefendDescription
-"Smoke in your colour marked DEFEND for three seconds, where the cursor is or on the radar spot under it. Only your allies see it."
+"Smoke in your colour and a shield on the ground for ten seconds, where the cursor is or on the radar spot under it. Only your allies see it."
END
GUI:SignalAttention
@@ -208,19 +208,7 @@ GUI:SignalAttention
END
GUI:SignalAttentionDescription
-"Smoke in your colour marked LOOK for three seconds, where the cursor is or on the radar spot under it. Only your allies see it."
-END
-
-GUI:SignalAttackLabel
-"ATTACK"
-END
-
-GUI:SignalDefendLabel
-"DEFEND"
-END
-
-GUI:SignalAttentionLabel
-"LOOK"
+"Smoke in your colour and an eye on the ground for ten seconds, where the cursor is or on the radar spot under it. Only your allies see it."
END
GUI:SignalAttackPlaced
diff --git a/GeneralsMD/Code/Data/Turkish/Generals.str b/GeneralsMD/Code/Data/Turkish/Generals.str
index 425928b83..498d2b041 100644
--- a/GeneralsMD/Code/Data/Turkish/Generals.str
+++ b/GeneralsMD/Code/Data/Turkish/Generals.str
@@ -14790,7 +14790,7 @@ GUI:SignalAttack
END
GUI:SignalAttackDescription
-"İmlecin olduğu yere ya da altındaki radar noktasına üç saniyeliğine sizin renginizde, SALDIR yazılı bir duman bırakır. Yalnızca müttefikleriniz görür."
+"İmlecin olduğu yere ya da altındaki radar noktasına sizin renginizde bir duman ve on saniyeliğine yere çapraz kılıçlar bırakır. Yalnızca müttefikleriniz görür."
END
GUI:SignalDefend
@@ -14798,7 +14798,7 @@ GUI:SignalDefend
END
GUI:SignalDefendDescription
-"İmlecin olduğu yere ya da altındaki radar noktasına üç saniyeliğine sizin renginizde, SAVUN yazılı bir duman bırakır. Yalnızca müttefikleriniz görür."
+"İmlecin olduğu yere ya da altındaki radar noktasına sizin renginizde bir duman ve on saniyeliğine yere bir kalkan bırakır. Yalnızca müttefikleriniz görür."
END
GUI:SignalAttention
@@ -14806,19 +14806,7 @@ GUI:SignalAttention
END
GUI:SignalAttentionDescription
-"İmlecin olduğu yere ya da altındaki radar noktasına üç saniyeliğine sizin renginizde, BAK yazılı bir duman bırakır. Yalnızca müttefikleriniz görür."
-END
-
-GUI:SignalAttackLabel
-"SALDIR"
-END
-
-GUI:SignalDefendLabel
-"SAVUN"
-END
-
-GUI:SignalAttentionLabel
-"BAK"
+"İmlecin olduğu yere ya da altındaki radar noktasına sizin renginizde bir duman ve on saniyeliğine yere bir göz bırakır. Yalnızca müttefikleriniz görür."
END
GUI:SignalAttackPlaced
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h b/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h
index 1cec66c32..4667dbd79 100644
--- a/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h
+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h
@@ -297,7 +297,6 @@ public:
Coord3D m_pos3D; ///< the 3d position in game coords
Int m_frameTimeOut; ///< when we want this thing to disappear
Int m_frameCount; ///< how many frames have we been displaying text?
- Bool m_isSignalWord; ///< a smoke signal's word: stays on its spot, outlined, drawn over fogged ground too (fork)
};
typedef std::list<FloatingTextData *> FloatingTextList;
@@ -896,8 +895,6 @@ public: // ********************************************************************
// Floating Test Methods
/// the text it added, for a caller that wants to hold it longer; NULL while icons are not drawn
virtual FloatingTextData *addFloatingText(const UnicodeString& text,const Coord3D * pos, Color color);
- /// a smoke signal's word, written on the smoke for holdFrames and then faded like any floating text
- void addSignalWord( const UnicodeString& text, const Coord3D *pos, Color color, UnsignedInt holdFrames );
/// a smoke signal's mark laid on the ground in the sender's colour, faded in and out over holdFrames
void addSignalMark( SignalKind kind, const Coord3D &pos, Color color, UnsignedInt holdFrames );
/// a signal button pressed: the next left click on the ground or the radar drops that signal there
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
index 366abc8dd..7b2d9fbc0 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
@@ -8796,25 +8796,6 @@ FloatingTextData *InGameUI::addFloatingText(const UnicodeString& text,const Coor
}
}
-//-------------------------------------------------------------------------------------------------
-/** The floating text machinery, lettered for a word that has to be read over smoke at a glance.
- * The default floating text font is the money pop-up's, which is too thin for that. */
-//-------------------------------------------------------------------------------------------------
-void InGameUI::addSignalWord( const UnicodeString& text, const Coord3D *pos, Color color, UnsignedInt holdFrames )
-{
- const char *SIGNAL_WORD_FONT = "Arial";
- const Int SIGNAL_WORD_POINT_SIZE = 14;
-
- FloatingTextData *word = addFloatingText( text, pos, color );
- if( word == NULL )
- return;
-
- word->m_isSignalWord = TRUE;
- word->m_frameTimeOut = TheGameLogic->getFrame() + holdFrames;
- word->m_dString->setFont( TheWindowManager->winFindFont( AsciiString( SIGNAL_WORD_FONT ),
- TheGlobalLanguageData->adjustFontSize( SIGNAL_WORD_POINT_SIZE ), TRUE ) );
-}
-
/** Each signal's mark on the ground, by SignalKind: Art/Textures/<name>.tga, drawn by
* Tools/signal_marks.py, white where the sender's colour goes. */
static const char *const SIGNAL_MARK_TEXTURES[ SIGNAL_KIND_COUNT ] =
@@ -12460,27 +12441,6 @@ Bool InGameUI::handleProductionStripClick( const ICoord2D *mouse, Bool cancel )
return FALSE;
}
-//-------------------------------------------------------------------------------------------------
-/** Text with a stroke round it: the string in the outline colour one pixel out in each of the eight
- * directions, then the string itself on top. The position has to move between the passes, not
- * the drop offset - W3DDisplayString rebuilds its quads only when the position or a colour
- * changes, so eight drop offsets on one position would draw the first shadow eight times. */
-//-------------------------------------------------------------------------------------------------
-static void drawOutlinedText( DisplayString *string, Int x, Int y, Color color, Color outline )
-{
- const Int STROKE_PIXELS = 1;
-
- for( Int dy = -STROKE_PIXELS; dy <= STROKE_PIXELS; dy += STROKE_PIXELS )
- {
- for( Int dx = -STROKE_PIXELS; dx <= STROKE_PIXELS; dx += STROKE_PIXELS )
- {
- if( dx != 0 || dy != 0 )
- string->draw( x + dx, y + dy, outline, outline );
- }
- }
- string->draw( x, y, color, outline );
-}
-
void InGameUI::drawFloatingText( void )
{
FloatingTextData *ftd;
@@ -12499,7 +12459,7 @@ void InGameUI::drawFloatingText( void )
// translate it's 3d pos into a 2d screen pos
if( TheTacticalView->worldToScreen(&ftd->m_pos3D, &pos)
&& ftd->m_dString
- && ( ftd->m_isSignalWord || ThePartitionManager->getShroudStatusForPlayer(playerNdx, pCX, pCY) == CELLSHROUD_CLEAR ) )
+ && ThePartitionManager->getShroudStatusForPlayer(playerNdx, pCX, pCY) == CELLSHROUD_CLEAR )
{
Color dropColor;
UnsignedByte r, g, b, a;
@@ -12510,13 +12470,6 @@ void InGameUI::drawFloatingText( void )
dropColor = GameMakeColor( 0, 0, 0, a );
ftd->m_dString->getSize(&width, &height);
- // a signal's word is written on the smoke it names, centred on it, and does not drift off
- if( ftd->m_isSignalWord )
- {
- drawOutlinedText( ftd->m_dString, pos.x - width / 2, pos.y - height / 2, ftd->m_color, dropColor );
- continue;
- }
-
pos.y -= ftd->m_frameCount * m_floatingTextMoveUpSpeed;
// draw it!
ftd->m_dString->draw(pos.x - (width / 2), pos.y, ftd->m_color,dropColor);
@@ -12626,7 +12579,6 @@ FloatingTextData::FloatingTextData(void)
m_color = 0;
m_frameCount = 0;
m_frameTimeOut = 0;
- m_isSignalWord = FALSE;
m_pos3D.zero();
m_text.clear();
//
diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp
index 0bdb58bdc..9f71616f3 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp
@@ -403,22 +403,21 @@ void GameLogic::prepareNewGame( Int gameMode, GameDifficulty diff, Int rankPoint
//-------------------------------------------------------------------------------------------------
/** What each smoke signal says on an ally's screen, indexed by SignalKind. The smoke is the sender's
- * colour, so the kind is told apart by the word floated over it. No signal uses
+ * colour, so the kind is told apart by the mark it lays on the ground. No signal uses
* RADAR_EVENT_UNDER_ATTACK, because Radar::tryEvent refuses a real attack warning within ten
* seconds of one of those. */
//-------------------------------------------------------------------------------------------------
struct SignalLook
{
RadarEventType radarEvent;
- const char *wordLabel;
const char *announcementLabel;
};
static const SignalLook SIGNAL_LOOKS[ SIGNAL_KIND_COUNT ] =
{
- { RADAR_EVENT_BATTLE_PLAN, "GUI:SignalAttackLabel", "GUI:SignalAttackPlaced" },
- { RADAR_EVENT_CONSTRUCTION, "GUI:SignalDefendLabel", "GUI:SignalDefendPlaced" },
- { RADAR_EVENT_INFORMATION, "GUI:SignalAttentionLabel", "GUI:SignalAttentionPlaced" },
+ { RADAR_EVENT_BATTLE_PLAN, "GUI:SignalAttackPlaced" },
+ { RADAR_EVENT_CONSTRUCTION, "GUI:SignalDefendPlaced" },
+ { RADAR_EVENT_INFORMATION, "GUI:SignalAttentionPlaced" },
};
static const char *SIGNAL_SMOKE_TEMPLATE = "BeaconSmokeFFFFFF";
@@ -441,9 +440,6 @@ static const Real SIGNAL_SMOKE_RISE_SCALE = 3.0f;
static const Real SIGNAL_SMOKE_ALPHA_MIN = 0.6f;
static const Real SIGNAL_SMOKE_ALPHA_MAX = 0.8f;
-/// the word is written this far above the ground, which is about the middle of the plume
-static const Real SIGNAL_LABEL_HEIGHT = 20.0f;
-
//-------------------------------------------------------------------------------------------------
/** Is a signal on this frame too soon after the player's last one? A last frame ahead of now is
* left over from an earlier match, whose clock ran further, and holds nothing back. */
@@ -2154,12 +2150,6 @@ void GameLogic::logicMessageDispatcher( GameMessage *msg, void *userData )
TheInGameUI->addSignalMark( (SignalKind)kind, pos, clientPlayerColor( thisPlayer ),
(UnsignedInt)( SIGNAL_MARK_SECONDS * LOGICFRAMES_PER_SECOND ) );
- // floating text runs the colour through the viewer's scheme itself, so it takes the logic one
- Coord3D labelPos = pos;
- labelPos.z += SIGNAL_LABEL_HEIGHT;
- TheInGameUI->addSignalWord( TheGameText->fetch( look.wordLabel ), &labelPos,
- thisPlayer->getPlayerColor(), SIGNAL_HALF_FRAMES );
-
UnicodeString announcement;
announcement.format( TheGameText->fetch( look.announcementLabel ), thisPlayer->getPlayerDisplayName().str() );
TheInGameUI->playerMessage( thisPlayer, announcement );