Skip to content

Commit 569de23

Browse files
author
Bart Roossien
committed
[GEN] Backport feature to select all aircraft with hotkey (#834)
1 parent 7d884ad commit 569de23

File tree

7 files changed

+269
-167
lines changed

7 files changed

+269
-167
lines changed

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

+1
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ class GameMessage : public MemoryPoolObject
225225
MSG_META_VIEW_LAST_RADAR_EVENT, ///< center view on last radar event
226226
MSG_META_SELECT_HERO, ///< selects player's hero character, if exists...
227227
MSG_META_SELECT_ALL, ///< selects all units across screen
228+
MSG_META_SELECT_ALL_AIRCRAFT, ///< selects all air units just like select all
228229
MSG_META_SCATTER, ///< selected units scatter
229230
MSG_META_STOP, ///< selected units stop
230231
MSG_META_DEPLOY, ///< selected units 'deploy'

Generals/Code/GameEngine/Include/GameClient/InGameUI.h

+13-6
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,16 @@
3636
#include "Common/GameCommon.h"
3737
#include "Common/GameType.h"
3838
#include "Common/MessageStream.h" // for GameMessageTranslator
39+
#include "Common/KindOf.h"
3940
#include "Common/SpecialPowerType.h"
41+
#include "Common/Snapshot.h"
4042
#include "Common/STLTypedefs.h"
4143
#include "Common/SubsystemInterface.h"
4244
#include "Common/UnicodeString.h"
4345
#include "GameClient/DisplayString.h"
4446
#include "GameClient/Mouse.h"
4547
#include "GameClient/RadiusDecal.h"
4648
#include "GameClient/View.h"
47-
#include "Common/Snapshot.h"
4849

4950
// FORWARD DECLARATIONS ///////////////////////////////////////////////////////////////////////////
5051
class Drawable;
@@ -482,10 +483,16 @@ friend class Drawable; // for selection/deselection transactions
482483
Bool canSelectedObjectsOverrideSpecialPowerDestination( const Coord3D *loc, SelectionRules rule, SpecialPowerType spType = SPECIAL_INVALID ) const;
483484

484485
// Selection Methods
485-
virtual Int selectMatchingUnits(); ///< selects matching units
486-
virtual Int selectAcrossScreen(); ///< selects matching units across screen
487-
virtual Int selectAcrossMap(); ///< selects matching units across map
488-
virtual Int selectAcrossRegion( IRegion2D *region ); // -1 = no locally-owned selection, 0+ = # of units selected
486+
virtual Int selectUnitsMatchingCurrentSelection(); ///< selects matching units
487+
virtual Int selectMatchingAcrossScreen(); ///< selects matching units across screen
488+
virtual Int selectMatchingAcrossMap(); ///< selects matching units across map
489+
virtual Int selectMatchingAcrossRegion( IRegion2D *region ); // -1 = no locally-owned selection, 0+ = # of units selected
490+
491+
virtual Int selectAllUnitsByType(KindOfMaskType mustBeSet, KindOfMaskType mustBeClear);
492+
virtual Int selectAllUnitsByTypeAcrossScreen(KindOfMaskType mustBeSet, KindOfMaskType mustBeClear);
493+
virtual Int selectAllUnitsByTypeAcrossMap(KindOfMaskType mustBeSet, KindOfMaskType mustBeClear);
494+
virtual Int selectAllUnitsByTypeAcrossRegion( IRegion2D *region, KindOfMaskType mustBeSet, KindOfMaskType mustBeClear );
495+
489496
virtual void buildRegion( const ICoord2D *anchor, const ICoord2D *dest, IRegion2D *region ); ///< builds a region around the specified coordinates
490497

491498
virtual Bool getDisplayedMaxWarning( void ) { return m_displayedMaxWarning; }
@@ -700,7 +707,7 @@ friend class Drawable; // for selection/deselection transactions
700707
Int m_maxSelectCount; ///< Max number of objects to select
701708
UnsignedInt m_frameSelectionChanged; ///< Frame when the selection last changed.
702709

703-
710+
704711
// Video playback data
705712
VideoBuffer* m_videoBuffer; ///< video playback buffer
706713
VideoStreamInterface* m_videoStream; ///< Video stream;

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

+1
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ AsciiString GameMessage::getCommandTypeAsAsciiString(GameMessage::Type t)
327327
CHECK_IF(MSG_META_VIEW_LAST_RADAR_EVENT)
328328
CHECK_IF(MSG_META_SELECT_HERO)
329329
CHECK_IF(MSG_META_SELECT_ALL)
330+
CHECK_IF(MSG_META_SELECT_ALL_AIRCRAFT)
330331
CHECK_IF(MSG_META_SCATTER)
331332
CHECK_IF(MSG_META_STOP)
332333
CHECK_IF(MSG_META_DEPLOY)

0 commit comments

Comments
 (0)