Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Generals/Code/GameEngine/Include/Common/MessageStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions Generals/Code/GameEngine/Source/Common/MessageStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

//-----------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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()) {
Expand Down Expand Up @@ -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 );
Expand Down
5 changes: 3 additions & 2 deletions GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -445,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, ///< (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
Expand Down Expand Up @@ -563,7 +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
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
Expand Down
5 changes: 3 additions & 2 deletions GeneralsMD/Code/GameEngine/Source/Common/MessageStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -543,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)
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,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;
Comment thread
Caball009 marked this conversation as resolved.
break;
Comment thread
Caball009 marked this conversation as resolved.

//-----------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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_END_AREA_SELECTION_HINT );
pickMsg->appendDrawableIDArgument( picked->getID() ); /// note we are putting in a drawable id

if (TheInGameUI->isInPreferSelectionMode() && !listOfSelectedDrawables.empty()) {
Expand Down Expand Up @@ -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_END_AREA_SELECTION_HINT );

IRegion2D selectionRegion;
buildRegion( &m_selectFeedbackAnchor, &msg->getArgument(0)->pixel, &selectionRegion );
Expand Down
Loading