Skip to content

Commit cea2731

Browse files
committed
Replicated in Generals.
1 parent 37ff171 commit cea2731

4 files changed

Lines changed: 14 additions & 10 deletions

File tree

Generals/Code/GameEngine/Include/Common/MessageStream.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,8 @@ class GameMessage : public MemoryPoolObject
415415
MSG_MOUSEOVER_LOCATION_HINT, ///< (location) The cursor is not over a drawable, but is here.
416416
MSG_VALID_GUICOMMAND_HINT, ///< posted when the gui command is valid if the user clicked to execute it.
417417
MSG_INVALID_GUICOMMAND_HINT, ///< posted when the gui command is not valid if the user were to click to attempt to execute it.
418-
MSG_AREA_SELECTION_HINT, ///< (pixelRegion) rectangular selection area under construction, not confirmed
418+
MSG_BEGIN_AREA_SELECTION_HINT, ///< (pixelRegion) rectangular selection area under construction, not confirmed
419+
MSG_END_AREA_SELECTION_HINT, ///< (pixelRegion) rectangular selection area finish construction
419420

420421
//Command hints
421422
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
532533
MSG_EXECUTE_RAILED_TRANSPORT, ///< Execute railed transport sequence
533534
MSG_COMBATDROP_AT_LOCATION, ///< dump out all rappellers
534535
MSG_COMBATDROP_AT_OBJECT, ///< dump out all rappellers
535-
MSG_AREA_SELECTION, ///< (pixelRegion) rectangular selection area
536+
MSG_AREA_SELECTION_DEPRECATED, ///< TheSuperHackers @tweak former MSG_AREA_SELECTION is deprecated as network message.
536537
MSG_DO_ATTACK_OBJECT, ///< (objectID, victim objectID)
537538
MSG_DO_FORCE_ATTACK_OBJECT, ///< force attack the given object if picked
538539
MSG_DO_FORCE_ATTACK_GROUND, ///< (locationID) bombard the given location if picked

Generals/Code/GameEngine/Source/Common/MessageStream.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,8 @@ const char *GameMessage::getCommandTypeAsString(GameMessage::Type t)
513513
CASE_LABEL(MSG_MOUSEOVER_LOCATION_HINT)
514514
CASE_LABEL(MSG_VALID_GUICOMMAND_HINT)
515515
CASE_LABEL(MSG_INVALID_GUICOMMAND_HINT)
516-
CASE_LABEL(MSG_AREA_SELECTION_HINT)
516+
CASE_LABEL(MSG_BEGIN_AREA_SELECTION_HINT)
517+
CASE_LABEL(MSG_END_AREA_SELECTION_HINT)
517518
CASE_LABEL(MSG_DO_ATTACK_OBJECT_HINT)
518519
CASE_LABEL(MSG_DO_ATTACK_OBJECT_AFTER_MOVING_HINT)
519520
CASE_LABEL(MSG_DO_FORCE_ATTACK_OBJECT_HINT)
@@ -600,7 +601,7 @@ const char *GameMessage::getCommandTypeAsString(GameMessage::Type t)
600601
CASE_LABEL(MSG_EXECUTE_RAILED_TRANSPORT)
601602
CASE_LABEL(MSG_COMBATDROP_AT_LOCATION)
602603
CASE_LABEL(MSG_COMBATDROP_AT_OBJECT)
603-
CASE_LABEL(MSG_AREA_SELECTION)
604+
CASE_LABEL(MSG_AREA_SELECTION_DEPRECATED)
604605
CASE_LABEL(MSG_DO_ATTACK_OBJECT)
605606
CASE_LABEL(MSG_DO_FORCE_ATTACK_OBJECT)
606607
CASE_LABEL(MSG_DO_FORCE_ATTACK_GROUND)

Generals/Code/GameEngine/Source/GameClient/MessageStream/HintSpy.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,17 @@ GameMessageDisposition HintSpyTranslator::translateGameMessage(const GameMessage
9696
break;
9797

9898
//-----------------------------------------------------------------------------
99-
case GameMessage::MSG_AREA_SELECTION_HINT:
99+
case GameMessage::MSG_BEGIN_AREA_SELECTION_HINT:
100100
TheInGameUI->beginAreaSelectHint( msg );
101+
disp = DESTROY_MESSAGE;
101102
break;
102103

103104
//-----------------------------------------------------------------------------
104-
// An AREA_SELECTION_HINT is always followed by an AREA_SELECTION, so
105+
// A BEGIN_AREA_SELECTION_HINT is always followed by an END_AREA_SELECTION_HINT, so
105106
// watch for it to stop hinting.
106-
case GameMessage::MSG_AREA_SELECTION:
107+
case GameMessage::MSG_END_AREA_SELECTION_HINT:
107108
TheInGameUI->endAreaSelectHint( msg );
109+
disp = DESTROY_MESSAGE;
108110
break;
109111

110112
//-----------------------------------------------------------------------------

Generals/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa
418418
if (m_dragSelecting)
419419
{
420420
// insert area selection "hint" message into stream
421-
GameMessage *hintMsg = TheMessageStream->appendMessage( GameMessage::MSG_AREA_SELECTION_HINT );
421+
GameMessage *hintMsg = TheMessageStream->appendMessage( GameMessage::MSG_BEGIN_AREA_SELECTION_HINT );
422422

423423
// build rectangular region defined by the drag selection
424424
IRegion2D pixelRegion;
@@ -508,7 +508,7 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa
508508
TheInGameUI->selectMatchingAcrossScreen();
509509

510510
// emit "picked" message
511-
GameMessage *pickMsg = TheMessageStream->appendMessage( GameMessage::MSG_AREA_SELECTION );
511+
GameMessage *pickMsg = TheMessageStream->appendMessage( GameMessage::MSG_END_AREA_SELECTION_HINT );
512512
pickMsg->appendDrawableIDArgument( picked->getID() ); /// note we are putting in a drawable id
513513

514514
if (TheInGameUI->isInPreferSelectionMode() && !listOfSelectedDrawables.empty()) {
@@ -857,7 +857,7 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa
857857
TheInGameUI->endAreaSelectHint(nullptr);
858858

859859
// insert area selection message into stream
860-
GameMessage *dragMsg = TheMessageStream->appendMessage( GameMessage::MSG_AREA_SELECTION );
860+
GameMessage *dragMsg = TheMessageStream->appendMessage( GameMessage::MSG_END_AREA_SELECTION_HINT );
861861

862862
IRegion2D selectionRegion;
863863
buildRegion( &m_selectFeedbackAnchor, &msg->getArgument(0)->pixel, &selectionRegion );

0 commit comments

Comments
 (0)