From af44b5e172aa96841397fd0f84c4fefef82b449b Mon Sep 17 00:00:00 2001 From: Caball009 <82909616+Caball009@users.noreply.github.com> Date: Thu, 30 Apr 2026 21:23:36 +0200 Subject: [PATCH 1/8] tweak(msg): Remove unused MSG_AREA_SELECTION message from game logic. --- GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h | 3 +++ .../GameEngine/Source/GameClient/MessageStream/HintSpy.cpp | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h b/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h index e1ecb01f738..55dc09e7f65 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h @@ -563,7 +563,10 @@ class GameMessage : public MemoryPoolObject MSG_EXECUTE_RAILED_TRANSPORT, ///< Execute railed transport sequence MSG_COMBATDROP_AT_LOCATION, ///< dump out all rappellers MSG_COMBATDROP_AT_OBJECT, ///< dump out all rappellers + + // TheSuperHackers @todo MSG_AREA_SELECTION can be moved out of the network messages because it's currently unused by the game logic. MSG_AREA_SELECTION, ///< (pixelRegion) rectangular selection area + MSG_DO_ATTACK_OBJECT, ///< (objectID, victim objectID) MSG_DO_FORCE_ATTACK_OBJECT, ///< force attack the given object if picked MSG_DO_FORCE_ATTACK_GROUND, ///< (locationID) bombard the given location if picked diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/HintSpy.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/HintSpy.cpp index 14e4269627e..a883f4d1abf 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/HintSpy.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/HintSpy.cpp @@ -106,6 +106,10 @@ GameMessageDisposition HintSpyTranslator::translateGameMessage(const GameMessage // watch for it to stop hinting. case GameMessage::MSG_AREA_SELECTION: TheInGameUI->endAreaSelectHint( msg ); + + // TheSuperHackers @tweak Originally this message was passed on to the game logic, but it wasn't used for anything. + disp = DESTROY_MESSAGE; + break; //----------------------------------------------------------------------------- From bc50caa92a9820af37fc4f54f547081148d1e0fc Mon Sep 17 00:00:00 2001 From: Caball009 <82909616+Caball009@users.noreply.github.com> Date: Thu, 30 Apr 2026 22:56:42 +0200 Subject: [PATCH 2/8] Addressed feedback. --- GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h | 5 +++-- GeneralsMD/Code/GameEngine/Source/Common/MessageStream.cpp | 3 ++- .../GameEngine/Source/GameClient/MessageStream/HintSpy.cpp | 6 +----- .../Source/GameClient/MessageStream/SelectionXlat.cpp | 4 ++-- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h b/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h index 55dc09e7f65..6d9b9c93f6f 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h @@ -224,6 +224,7 @@ class GameMessage : public MemoryPoolObject MSG_META_SELECT_HERO, ///< selects player's hero character, if exists... MSG_META_SELECT_ALL, ///< selects all units across screen MSG_META_SELECT_ALL_AIRCRAFT, ///< selects all air units just like select all + MSG_META_AREA_SELECTION, ///< rectangular selection area (pixelRegion) MSG_META_SCATTER, ///< selected units scatter MSG_META_STOP, ///< selected units stop MSG_META_DEPLOY, ///< selected units 'deploy' @@ -564,8 +565,8 @@ class GameMessage : public MemoryPoolObject MSG_COMBATDROP_AT_LOCATION, ///< dump out all rappellers MSG_COMBATDROP_AT_OBJECT, ///< dump out all rappellers - // TheSuperHackers @todo MSG_AREA_SELECTION can be moved out of the network messages because it's currently unused by the game logic. - MSG_AREA_SELECTION, ///< (pixelRegion) rectangular selection area + // TheSuperHackers @todo Remove MSG_AREA_SELECTION_DEPRECATED when possible. + MSG_AREA_SELECTION_DEPRECATED, MSG_DO_ATTACK_OBJECT, ///< (objectID, victim objectID) MSG_DO_FORCE_ATTACK_OBJECT, ///< force attack the given object if picked diff --git a/GeneralsMD/Code/GameEngine/Source/Common/MessageStream.cpp b/GeneralsMD/Code/GameEngine/Source/Common/MessageStream.cpp index 3a4b6958895..f116799616f 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/MessageStream.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/MessageStream.cpp @@ -331,6 +331,7 @@ const char *GameMessage::getCommandTypeAsString(GameMessage::Type t) CASE_LABEL(MSG_META_SELECT_HERO) CASE_LABEL(MSG_META_SELECT_ALL) CASE_LABEL(MSG_META_SELECT_ALL_AIRCRAFT) + CASE_LABEL(MSG_META_AREA_SELECTION) CASE_LABEL(MSG_META_SCATTER) CASE_LABEL(MSG_META_STOP) CASE_LABEL(MSG_META_DEPLOY) @@ -631,7 +632,7 @@ const char *GameMessage::getCommandTypeAsString(GameMessage::Type t) CASE_LABEL(MSG_EXECUTE_RAILED_TRANSPORT) CASE_LABEL(MSG_COMBATDROP_AT_LOCATION) CASE_LABEL(MSG_COMBATDROP_AT_OBJECT) - CASE_LABEL(MSG_AREA_SELECTION) + CASE_LABEL(MSG_AREA_SELECTION_DEPRECATED) CASE_LABEL(MSG_DO_ATTACK_OBJECT) CASE_LABEL(MSG_DO_FORCE_ATTACK_OBJECT) CASE_LABEL(MSG_DO_FORCE_ATTACK_GROUND) diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/HintSpy.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/HintSpy.cpp index a883f4d1abf..0e1edc5b05d 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/HintSpy.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/HintSpy.cpp @@ -104,12 +104,8 @@ GameMessageDisposition HintSpyTranslator::translateGameMessage(const GameMessage //----------------------------------------------------------------------------- // An AREA_SELECTION_HINT is always followed by an AREA_SELECTION, so // watch for it to stop hinting. - case GameMessage::MSG_AREA_SELECTION: + case GameMessage::MSG_META_AREA_SELECTION: TheInGameUI->endAreaSelectHint( msg ); - - // TheSuperHackers @tweak Originally this message was passed on to the game logic, but it wasn't used for anything. - disp = DESTROY_MESSAGE; - break; //----------------------------------------------------------------------------- diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp index 3bd19e0762e..e162378de53 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp @@ -517,7 +517,7 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa TheInGameUI->selectMatchingAcrossScreen(); // emit "picked" message - GameMessage *pickMsg = TheMessageStream->appendMessage( GameMessage::MSG_AREA_SELECTION ); + GameMessage *pickMsg = TheMessageStream->appendMessage( GameMessage::MSG_META_AREA_SELECTION ); pickMsg->appendDrawableIDArgument( picked->getID() ); /// note we are putting in a drawable id if (TheInGameUI->isInPreferSelectionMode() && !listOfSelectedDrawables.empty()) { @@ -932,7 +932,7 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa TheInGameUI->endAreaSelectHint(nullptr); // insert area selection message into stream - GameMessage *dragMsg = TheMessageStream->appendMessage( GameMessage::MSG_AREA_SELECTION ); + GameMessage *dragMsg = TheMessageStream->appendMessage( GameMessage::MSG_META_AREA_SELECTION ); IRegion2D selectionRegion; buildRegion( &m_selectFeedbackAnchor, &msg->getArgument(0)->pixel, &selectionRegion ); From d3e99d9aca22f10bd01f71efc83ad756aa74f509 Mon Sep 17 00:00:00 2001 From: Caball009 <82909616+Caball009@users.noreply.github.com> Date: Fri, 1 May 2026 02:02:59 +0200 Subject: [PATCH 3/8] Changed area selection enum names. --- GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h | 4 ++-- GeneralsMD/Code/GameEngine/Source/Common/MessageStream.cpp | 4 ++-- .../GameEngine/Source/GameClient/MessageStream/HintSpy.cpp | 6 +++--- .../Source/GameClient/MessageStream/SelectionXlat.cpp | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h b/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h index 6d9b9c93f6f..15b6fb0e9ee 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h @@ -224,7 +224,6 @@ class GameMessage : public MemoryPoolObject MSG_META_SELECT_HERO, ///< selects player's hero character, if exists... MSG_META_SELECT_ALL, ///< selects all units across screen MSG_META_SELECT_ALL_AIRCRAFT, ///< selects all air units just like select all - MSG_META_AREA_SELECTION, ///< rectangular selection area (pixelRegion) MSG_META_SCATTER, ///< selected units scatter MSG_META_STOP, ///< selected units stop MSG_META_DEPLOY, ///< selected units 'deploy' @@ -446,7 +445,8 @@ class GameMessage : public MemoryPoolObject MSG_MOUSEOVER_LOCATION_HINT, ///< (location) The cursor is not over a drawable, but is here. MSG_VALID_GUICOMMAND_HINT, ///< posted when the gui command is valid if the user clicked to execute it. MSG_INVALID_GUICOMMAND_HINT, ///< posted when the gui command is not valid if the user were to click to attempt to execute it. - MSG_AREA_SELECTION_HINT, ///< (pixelRegion) rectangular selection area under construction, not confirmed + MSG_BEGIN_AREA_SELECTION_HINT, ///< rectangular selection area (pixelRegion) under construction, not confirmed + MSG_END_AREA_SELECTION_HINT, ///< rectangular selection area (pixelRegion) finish construction //Command hints MSG_DO_ATTACK_OBJECT_HINT, ///< (victim objectID) If clicked, an attack would be ordered, "Current Selection" is assumed diff --git a/GeneralsMD/Code/GameEngine/Source/Common/MessageStream.cpp b/GeneralsMD/Code/GameEngine/Source/Common/MessageStream.cpp index f116799616f..0addbe79dac 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/MessageStream.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/MessageStream.cpp @@ -331,7 +331,6 @@ const char *GameMessage::getCommandTypeAsString(GameMessage::Type t) CASE_LABEL(MSG_META_SELECT_HERO) CASE_LABEL(MSG_META_SELECT_ALL) CASE_LABEL(MSG_META_SELECT_ALL_AIRCRAFT) - CASE_LABEL(MSG_META_AREA_SELECTION) CASE_LABEL(MSG_META_SCATTER) CASE_LABEL(MSG_META_STOP) CASE_LABEL(MSG_META_DEPLOY) @@ -544,7 +543,8 @@ const char *GameMessage::getCommandTypeAsString(GameMessage::Type t) CASE_LABEL(MSG_MOUSEOVER_LOCATION_HINT) CASE_LABEL(MSG_VALID_GUICOMMAND_HINT) CASE_LABEL(MSG_INVALID_GUICOMMAND_HINT) - CASE_LABEL(MSG_AREA_SELECTION_HINT) + CASE_LABEL(MSG_BEGIN_AREA_SELECTION_HINT) + CASE_LABEL(MSG_END_AREA_SELECTION_HINT) CASE_LABEL(MSG_DO_ATTACK_OBJECT_HINT) CASE_LABEL(MSG_DO_ATTACK_OBJECT_AFTER_MOVING_HINT) CASE_LABEL(MSG_DO_FORCE_ATTACK_OBJECT_HINT) diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/HintSpy.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/HintSpy.cpp index 0e1edc5b05d..14cbfb7303d 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/HintSpy.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/HintSpy.cpp @@ -97,14 +97,14 @@ GameMessageDisposition HintSpyTranslator::translateGameMessage(const GameMessage break; //----------------------------------------------------------------------------- - case GameMessage::MSG_AREA_SELECTION_HINT: + case GameMessage::MSG_BEGIN_AREA_SELECTION_HINT: TheInGameUI->beginAreaSelectHint( msg ); break; //----------------------------------------------------------------------------- - // An AREA_SELECTION_HINT is always followed by an AREA_SELECTION, so + // A BEGIN_AREA_SELECTION_HINT is always followed by an END_AREA_SELECTION_HINT, so // watch for it to stop hinting. - case GameMessage::MSG_META_AREA_SELECTION: + case GameMessage::MSG_END_AREA_SELECTION_HINT: TheInGameUI->endAreaSelectHint( msg ); break; diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp index e162378de53..203874859b1 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp @@ -427,7 +427,7 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa if (m_dragSelecting) { // insert area selection "hint" message into stream - GameMessage *hintMsg = TheMessageStream->appendMessage( GameMessage::MSG_AREA_SELECTION_HINT ); + GameMessage *hintMsg = TheMessageStream->appendMessage( GameMessage::MSG_BEGIN_AREA_SELECTION_HINT ); // build rectangular region defined by the drag selection IRegion2D pixelRegion; @@ -517,7 +517,7 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa TheInGameUI->selectMatchingAcrossScreen(); // emit "picked" message - GameMessage *pickMsg = TheMessageStream->appendMessage( GameMessage::MSG_META_AREA_SELECTION ); + GameMessage *pickMsg = TheMessageStream->appendMessage( GameMessage::MSG_END_AREA_SELECTION_HINT ); pickMsg->appendDrawableIDArgument( picked->getID() ); /// note we are putting in a drawable id if (TheInGameUI->isInPreferSelectionMode() && !listOfSelectedDrawables.empty()) { @@ -932,7 +932,7 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa TheInGameUI->endAreaSelectHint(nullptr); // insert area selection message into stream - GameMessage *dragMsg = TheMessageStream->appendMessage( GameMessage::MSG_META_AREA_SELECTION ); + GameMessage *dragMsg = TheMessageStream->appendMessage( GameMessage::MSG_END_AREA_SELECTION_HINT ); IRegion2D selectionRegion; buildRegion( &m_selectFeedbackAnchor, &msg->getArgument(0)->pixel, &selectionRegion ); From beaef41560a6bc98858b738999f15da06f3bd45f Mon Sep 17 00:00:00 2001 From: Caball009 <82909616+Caball009@users.noreply.github.com> Date: Fri, 1 May 2026 18:28:46 +0200 Subject: [PATCH 4/8] Changed TSH comment. --- GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h b/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h index 15b6fb0e9ee..ecb7e619c10 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h @@ -564,10 +564,7 @@ class GameMessage : public MemoryPoolObject MSG_EXECUTE_RAILED_TRANSPORT, ///< Execute railed transport sequence MSG_COMBATDROP_AT_LOCATION, ///< dump out all rappellers MSG_COMBATDROP_AT_OBJECT, ///< dump out all rappellers - - // TheSuperHackers @todo Remove MSG_AREA_SELECTION_DEPRECATED when possible. - MSG_AREA_SELECTION_DEPRECATED, - + MSG_AREA_SELECTION_DEPRECATED, ///< TheSuperHackers @tweak former MSG_AREA_SELECTION is deprecated as network message. MSG_DO_ATTACK_OBJECT, ///< (objectID, victim objectID) MSG_DO_FORCE_ATTACK_OBJECT, ///< force attack the given object if picked MSG_DO_FORCE_ATTACK_GROUND, ///< (locationID) bombard the given location if picked From 1a8e5aebae2085ca677887347fbe9073bb6909d0 Mon Sep 17 00:00:00 2001 From: Caball009 <82909616+Caball009@users.noreply.github.com> Date: Fri, 1 May 2026 18:30:01 +0200 Subject: [PATCH 5/8] Added destroy message back in For consistency with other discarded hint messages. --- .../Code/GameEngine/Source/GameClient/MessageStream/HintSpy.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/HintSpy.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/HintSpy.cpp index 14cbfb7303d..85183c8e2f1 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/HintSpy.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/HintSpy.cpp @@ -106,6 +106,7 @@ GameMessageDisposition HintSpyTranslator::translateGameMessage(const GameMessage // watch for it to stop hinting. case GameMessage::MSG_END_AREA_SELECTION_HINT: TheInGameUI->endAreaSelectHint( msg ); + disp = DESTROY_MESSAGE; break; //----------------------------------------------------------------------------- From 7d84cebd34f54dd585495aaf1570eace6e6bd2c8 Mon Sep 17 00:00:00 2001 From: Caball009 <82909616+Caball009@users.noreply.github.com> Date: Fri, 1 May 2026 18:36:10 +0200 Subject: [PATCH 6/8] Restored original format of comments for area selection hints. --- GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h b/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h index ecb7e619c10..0a08d98486d 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h @@ -445,8 +445,8 @@ class GameMessage : public MemoryPoolObject MSG_MOUSEOVER_LOCATION_HINT, ///< (location) The cursor is not over a drawable, but is here. MSG_VALID_GUICOMMAND_HINT, ///< posted when the gui command is valid if the user clicked to execute it. MSG_INVALID_GUICOMMAND_HINT, ///< posted when the gui command is not valid if the user were to click to attempt to execute it. - MSG_BEGIN_AREA_SELECTION_HINT, ///< rectangular selection area (pixelRegion) under construction, not confirmed - MSG_END_AREA_SELECTION_HINT, ///< rectangular selection area (pixelRegion) finish construction + MSG_BEGIN_AREA_SELECTION_HINT, ///< (pixelRegion) rectangular selection area under construction, not confirmed + MSG_END_AREA_SELECTION_HINT, ///< (pixelRegion) rectangular selection area finish construction //Command hints MSG_DO_ATTACK_OBJECT_HINT, ///< (victim objectID) If clicked, an attack would be ordered, "Current Selection" is assumed From 37ff1711b3e559250514faeab2ab4da386f8ee50 Mon Sep 17 00:00:00 2001 From: Caball009 <82909616+Caball009@users.noreply.github.com> Date: Sat, 2 May 2026 00:37:55 +0200 Subject: [PATCH 7/8] Added destroy message to MSG_BEGIN_AREA_SELECTION_HINT. --- .../Code/GameEngine/Source/GameClient/MessageStream/HintSpy.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/HintSpy.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/HintSpy.cpp index 85183c8e2f1..615a1aa94c4 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/HintSpy.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/HintSpy.cpp @@ -99,6 +99,7 @@ GameMessageDisposition HintSpyTranslator::translateGameMessage(const GameMessage //----------------------------------------------------------------------------- case GameMessage::MSG_BEGIN_AREA_SELECTION_HINT: TheInGameUI->beginAreaSelectHint( msg ); + disp = DESTROY_MESSAGE; break; //----------------------------------------------------------------------------- From cea27312cf2a3fc42657625dbe3da5d3ae597076 Mon Sep 17 00:00:00 2001 From: Caball009 <82909616+Caball009@users.noreply.github.com> Date: Sun, 3 May 2026 17:20:31 +0200 Subject: [PATCH 8/8] Replicated in Generals. --- Generals/Code/GameEngine/Include/Common/MessageStream.h | 5 +++-- Generals/Code/GameEngine/Source/Common/MessageStream.cpp | 5 +++-- .../Source/GameClient/MessageStream/HintSpy.cpp | 8 +++++--- .../Source/GameClient/MessageStream/SelectionXlat.cpp | 6 +++--- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/Generals/Code/GameEngine/Include/Common/MessageStream.h b/Generals/Code/GameEngine/Include/Common/MessageStream.h index 151f7fa1aec..2b04f40be2e 100644 --- a/Generals/Code/GameEngine/Include/Common/MessageStream.h +++ b/Generals/Code/GameEngine/Include/Common/MessageStream.h @@ -415,7 +415,8 @@ class GameMessage : public MemoryPoolObject MSG_MOUSEOVER_LOCATION_HINT, ///< (location) The cursor is not over a drawable, but is here. MSG_VALID_GUICOMMAND_HINT, ///< posted when the gui command is valid if the user clicked to execute it. MSG_INVALID_GUICOMMAND_HINT, ///< posted when the gui command is not valid if the user were to click to attempt to execute it. - MSG_AREA_SELECTION_HINT, ///< (pixelRegion) rectangular selection area under construction, not confirmed + MSG_BEGIN_AREA_SELECTION_HINT, ///< (pixelRegion) rectangular selection area under construction, not confirmed + MSG_END_AREA_SELECTION_HINT, ///< (pixelRegion) rectangular selection area finish construction //Command hints MSG_DO_ATTACK_OBJECT_HINT, ///< (victim objectID) If clicked, an attack would be ordered, "Current Selection" is assumed @@ -532,7 +533,7 @@ class GameMessage : public MemoryPoolObject MSG_EXECUTE_RAILED_TRANSPORT, ///< Execute railed transport sequence MSG_COMBATDROP_AT_LOCATION, ///< dump out all rappellers MSG_COMBATDROP_AT_OBJECT, ///< dump out all rappellers - MSG_AREA_SELECTION, ///< (pixelRegion) rectangular selection area + MSG_AREA_SELECTION_DEPRECATED, ///< TheSuperHackers @tweak former MSG_AREA_SELECTION is deprecated as network message. MSG_DO_ATTACK_OBJECT, ///< (objectID, victim objectID) MSG_DO_FORCE_ATTACK_OBJECT, ///< force attack the given object if picked MSG_DO_FORCE_ATTACK_GROUND, ///< (locationID) bombard the given location if picked diff --git a/Generals/Code/GameEngine/Source/Common/MessageStream.cpp b/Generals/Code/GameEngine/Source/Common/MessageStream.cpp index d9e2e27b415..b970e457bf0 100644 --- a/Generals/Code/GameEngine/Source/Common/MessageStream.cpp +++ b/Generals/Code/GameEngine/Source/Common/MessageStream.cpp @@ -513,7 +513,8 @@ const char *GameMessage::getCommandTypeAsString(GameMessage::Type t) CASE_LABEL(MSG_MOUSEOVER_LOCATION_HINT) CASE_LABEL(MSG_VALID_GUICOMMAND_HINT) CASE_LABEL(MSG_INVALID_GUICOMMAND_HINT) - CASE_LABEL(MSG_AREA_SELECTION_HINT) + CASE_LABEL(MSG_BEGIN_AREA_SELECTION_HINT) + CASE_LABEL(MSG_END_AREA_SELECTION_HINT) CASE_LABEL(MSG_DO_ATTACK_OBJECT_HINT) CASE_LABEL(MSG_DO_ATTACK_OBJECT_AFTER_MOVING_HINT) CASE_LABEL(MSG_DO_FORCE_ATTACK_OBJECT_HINT) @@ -600,7 +601,7 @@ const char *GameMessage::getCommandTypeAsString(GameMessage::Type t) CASE_LABEL(MSG_EXECUTE_RAILED_TRANSPORT) CASE_LABEL(MSG_COMBATDROP_AT_LOCATION) CASE_LABEL(MSG_COMBATDROP_AT_OBJECT) - CASE_LABEL(MSG_AREA_SELECTION) + CASE_LABEL(MSG_AREA_SELECTION_DEPRECATED) CASE_LABEL(MSG_DO_ATTACK_OBJECT) CASE_LABEL(MSG_DO_FORCE_ATTACK_OBJECT) CASE_LABEL(MSG_DO_FORCE_ATTACK_GROUND) diff --git a/Generals/Code/GameEngine/Source/GameClient/MessageStream/HintSpy.cpp b/Generals/Code/GameEngine/Source/GameClient/MessageStream/HintSpy.cpp index 756be270dd1..37174941ebb 100644 --- a/Generals/Code/GameEngine/Source/GameClient/MessageStream/HintSpy.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/MessageStream/HintSpy.cpp @@ -96,15 +96,17 @@ GameMessageDisposition HintSpyTranslator::translateGameMessage(const GameMessage break; //----------------------------------------------------------------------------- - case GameMessage::MSG_AREA_SELECTION_HINT: + case GameMessage::MSG_BEGIN_AREA_SELECTION_HINT: TheInGameUI->beginAreaSelectHint( msg ); + disp = DESTROY_MESSAGE; break; //----------------------------------------------------------------------------- - // An AREA_SELECTION_HINT is always followed by an AREA_SELECTION, so + // A BEGIN_AREA_SELECTION_HINT is always followed by an END_AREA_SELECTION_HINT, so // watch for it to stop hinting. - case GameMessage::MSG_AREA_SELECTION: + case GameMessage::MSG_END_AREA_SELECTION_HINT: TheInGameUI->endAreaSelectHint( msg ); + disp = DESTROY_MESSAGE; break; //----------------------------------------------------------------------------- diff --git a/Generals/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp b/Generals/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp index 4b77577f934..964368235d4 100644 --- a/Generals/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp @@ -418,7 +418,7 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa if (m_dragSelecting) { // insert area selection "hint" message into stream - GameMessage *hintMsg = TheMessageStream->appendMessage( GameMessage::MSG_AREA_SELECTION_HINT ); + GameMessage *hintMsg = TheMessageStream->appendMessage( GameMessage::MSG_BEGIN_AREA_SELECTION_HINT ); // build rectangular region defined by the drag selection IRegion2D pixelRegion; @@ -508,7 +508,7 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa TheInGameUI->selectMatchingAcrossScreen(); // emit "picked" message - GameMessage *pickMsg = TheMessageStream->appendMessage( GameMessage::MSG_AREA_SELECTION ); + GameMessage *pickMsg = TheMessageStream->appendMessage( GameMessage::MSG_END_AREA_SELECTION_HINT ); pickMsg->appendDrawableIDArgument( picked->getID() ); /// note we are putting in a drawable id if (TheInGameUI->isInPreferSelectionMode() && !listOfSelectedDrawables.empty()) { @@ -857,7 +857,7 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa TheInGameUI->endAreaSelectHint(nullptr); // insert area selection message into stream - GameMessage *dragMsg = TheMessageStream->appendMessage( GameMessage::MSG_AREA_SELECTION ); + GameMessage *dragMsg = TheMessageStream->appendMessage( GameMessage::MSG_END_AREA_SELECTION_HINT ); IRegion2D selectionRegion; buildRegion( &m_selectFeedbackAnchor, &msg->getArgument(0)->pixel, &selectionRegion );