Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
CommandButton Class Reference

#include <ControlBar.h>

Inherits Overridable.

Public Member Functions

 CommandButton (void)
 
const FieldParsegetFieldParse () const
 INI parsing.
 
Bool isContextCommand () const
 determines if this is a context sensitive command.
 
Bool isValidRelationshipTarget (Relationship r) const
 
Bool isValidObjectTarget (const Player *sourcePlayer, const Object *targetObj) const
 
Bool isValidObjectTarget (const Object *sourceObj, const Object *targetObj) const
 
Bool isValidObjectTarget (const Drawable *source, const Drawable *target) const
 
Bool isValidToUseOn (const Object *sourceObj, const Object *targetObj, const Coord3D *targetLocation, CommandSourceType commandSource) const
 
Bool isReady (const Object *sourceObj) const
 
const AsciiStringgetName () const
 
const AsciiStringgetCursorName () const
 
const AsciiStringgetInvalidCursorName () const
 
const AsciiStringgetTextLabel () const
 
const AsciiStringgetDescriptionLabel () const
 
const AsciiStringgetPurchasedLabel () const
 
const AsciiStringgetConflictingLabel () const
 
const AudioEventRTSgetUnitSpecificSound () const
 
GUICommandType getCommandType () const
 
UnsignedInt getOptions () const
 
OVERRIDE< ThingTemplategetThingTemplate () const
 
const UpgradeTemplategetUpgradeTemplate () const
 
const SpecialPowerTemplategetSpecialPowerTemplate () const
 
RadiusCursorType getRadiusCursorType () const
 
WeaponSlotType getWeaponSlot () const
 
Int getMaxShotsToFire () const
 
const ScienceVecgetScienceVec () const
 
CommandButtonMappedBorderType getCommandButtonMappedBorderType () const
 
const ImagegetButtonImage () const
 
void cacheButtonImage ()
 
GameWindowgetWindow () const
 
Int getFlashCount () const
 
const CommandButtongetNext () const
 
void setName (const AsciiString &n)
 
void setButtonImage (const Image *image)
 
void copyImagesFrom (const CommandButton *button, Bool markUIDirtyIfChanged) const
 
void copyButtonTextFrom (const CommandButton *button, Bool shortcutButton, Bool markUIDirtyIfChanged) const
 
void setFlashCount (Int c) const
 
void friend_addToList (CommandButton **list)
 
CommandButtonfriend_getNext ()
 
- Public Member Functions inherited from Overridable
 Overridable ()
 
const OverridablegetNextOverride (void) const
 
const OverridablegetFinalOverride (void) const
 
void setNextOverride (Overridable *nextOverridable)
 
Overridablefriend_getNextOverride (void)
 
Overridablefriend_getFinalOverride (void)
 
const Overridablefriend_getFinalOverride (void) const
 
void markAsOverride (void)
 
OverridabledeleteOverrides (void)
 
- Public Member Functions inherited from MemoryPoolObject
void deleteInstance ()
 

Static Public Member Functions

static void parseCommand (INI *ini, void *instance, void *store, const void *userData)
 

Static Public Attributes

static const FieldParse s_commandButtonFieldParseTable []
 the parse table
 

Additional Inherited Members

- Protected Member Functions inherited from MemoryPoolObject
virtual ~MemoryPoolObject ()
 
void * operator new (size_t s)
 
void operator delete (void *p)
 
virtual MemoryPoolgetObjectMemoryPool ()=0
 

Detailed Description

Command buttons are used to load the buttons we place on throughout the command bar interface in different context sensitive windows depending on the situation and type of the object selected

Definition at line 299 of file ControlBar.h.

Constructor & Destructor Documentation

◆ CommandButton()

CommandButton::CommandButton ( void )

Definition at line 540 of file ControlBar.cpp.

Member Function Documentation

◆ cacheButtonImage()

void CommandButton::cacheButtonImage ( )

Definition at line 2507 of file ControlBar.cpp.

◆ copyButtonTextFrom()

void CommandButton::copyButtonTextFrom ( const CommandButton * button,
Bool shortcutButton,
Bool markUIDirtyIfChanged ) const

Definition at line 757 of file ControlBar.cpp.

◆ copyImagesFrom()

void CommandButton::copyImagesFrom ( const CommandButton * button,
Bool markUIDirtyIfChanged ) const

Definition at line 737 of file ControlBar.cpp.

◆ friend_addToList()

void CommandButton::friend_addToList ( CommandButton ** list)
inline

Definition at line 366 of file ControlBar.h.

◆ friend_getNext()

CommandButton * CommandButton::friend_getNext ( )
inline

Definition at line 367 of file ControlBar.h.

◆ getButtonImage()

const Image * CommandButton::getButtonImage ( ) const
inline

Definition at line 344 of file ControlBar.h.

◆ getCommandButtonMappedBorderType()

CommandButtonMappedBorderType CommandButton::getCommandButtonMappedBorderType ( ) const
inline

Definition at line 343 of file ControlBar.h.

◆ getCommandType()

GUICommandType CommandButton::getCommandType ( ) const
inline

Definition at line 334 of file ControlBar.h.

◆ getConflictingLabel()

const AsciiString & CommandButton::getConflictingLabel ( ) const
inline

Definition at line 331 of file ControlBar.h.

◆ getCursorName()

const AsciiString & CommandButton::getCursorName ( ) const
inline

Definition at line 326 of file ControlBar.h.

◆ getDescriptionLabel()

const AsciiString & CommandButton::getDescriptionLabel ( ) const
inline

Definition at line 329 of file ControlBar.h.

◆ getFieldParse()

const FieldParse * CommandButton::getFieldParse ( ) const
inline

INI parsing.

Definition at line 310 of file ControlBar.h.

◆ getFlashCount()

Int CommandButton::getFlashCount ( ) const
inline

Definition at line 348 of file ControlBar.h.

◆ getInvalidCursorName()

const AsciiString & CommandButton::getInvalidCursorName ( ) const
inline

Definition at line 327 of file ControlBar.h.

◆ getMaxShotsToFire()

Int CommandButton::getMaxShotsToFire ( ) const
inline

Definition at line 341 of file ControlBar.h.

◆ getName()

const AsciiString & CommandButton::getName ( ) const
inline

Definition at line 325 of file ControlBar.h.

◆ getNext()

const CommandButton * CommandButton::getNext ( ) const
inline

Definition at line 350 of file ControlBar.h.

◆ getOptions()

UnsignedInt CommandButton::getOptions ( ) const
inline

Definition at line 335 of file ControlBar.h.

◆ getPurchasedLabel()

const AsciiString & CommandButton::getPurchasedLabel ( ) const
inline

Definition at line 330 of file ControlBar.h.

◆ getRadiusCursorType()

RadiusCursorType CommandButton::getRadiusCursorType ( ) const
inline

Definition at line 339 of file ControlBar.h.

◆ getScienceVec()

const ScienceVec & CommandButton::getScienceVec ( ) const
inline

Definition at line 342 of file ControlBar.h.

◆ getSpecialPowerTemplate()

const SpecialPowerTemplate * CommandButton::getSpecialPowerTemplate ( ) const
inline

Definition at line 338 of file ControlBar.h.

◆ getTextLabel()

const AsciiString & CommandButton::getTextLabel ( ) const
inline

Definition at line 328 of file ControlBar.h.

◆ getThingTemplate()

OVERRIDE< ThingTemplate > CommandButton::getThingTemplate ( ) const
inline

Definition at line 336 of file ControlBar.h.

◆ getUnitSpecificSound()

const AudioEventRTS * CommandButton::getUnitSpecificSound ( ) const
inline

Definition at line 332 of file ControlBar.h.

◆ getUpgradeTemplate()

const UpgradeTemplate * CommandButton::getUpgradeTemplate ( ) const
inline

Definition at line 337 of file ControlBar.h.

◆ getWeaponSlot()

WeaponSlotType CommandButton::getWeaponSlot ( ) const
inline

Definition at line 340 of file ControlBar.h.

◆ getWindow()

GameWindow * CommandButton::getWindow ( ) const
inline

Definition at line 347 of file ControlBar.h.

◆ isContextCommand()

Bool CommandButton::isContextCommand ( ) const

determines if this is a context sensitive command.

Definition at line 730 of file ControlBar.cpp.

◆ isReady()

Bool CommandButton::isReady ( const Object * sourceObj) const

Definition at line 678 of file ControlBar.cpp.

◆ isValidObjectTarget() [1/3]

Bool CommandButton::isValidObjectTarget ( const Drawable * source,
const Drawable * target ) const

Definition at line 691 of file ControlBar.cpp.

◆ isValidObjectTarget() [2/3]

Bool CommandButton::isValidObjectTarget ( const Object * sourceObj,
const Object * targetObj ) const

Definition at line 611 of file ControlBar.cpp.

◆ isValidObjectTarget() [3/3]

Bool CommandButton::isValidObjectTarget ( const Player * sourcePlayer,
const Object * targetObj ) const

Definition at line 600 of file ControlBar.cpp.

◆ isValidRelationshipTarget()

Bool CommandButton::isValidRelationshipTarget ( Relationship r) const

Definition at line 589 of file ControlBar.cpp.

◆ isValidToUseOn()

Bool CommandButton::isValidToUseOn ( const Object * sourceObj,
const Object * targetObj,
const Coord3D * targetLocation,
CommandSourceType commandSource ) const

Definition at line 622 of file ControlBar.cpp.

◆ parseCommand()

void CommandButton::parseCommand ( INI * ini,
void * instance,
void * store,
const void * userData )
static

parse command definition

Definition at line 514 of file ControlBar.cpp.

◆ setButtonImage()

void CommandButton::setButtonImage ( const Image * image)
inline

Definition at line 354 of file ControlBar.h.

◆ setFlashCount()

void CommandButton::setFlashCount ( Int c) const
inline

Definition at line 363 of file ControlBar.h.

◆ setName()

void CommandButton::setName ( const AsciiString & n)
inline

Definition at line 352 of file ControlBar.h.

Member Data Documentation

◆ s_commandButtonFieldParseTable

const FieldParse CommandButton::s_commandButtonFieldParseTable
static
Initial value:
=
{
{ "Command", CommandButton::parseCommand, NULL, offsetof( CommandButton, m_command ) },
{ "Options", INI::parseBitString32, TheCommandOptionNames, offsetof( CommandButton, m_options ) },
{ "Object", INI::parseThingTemplate, NULL, offsetof( CommandButton, m_thingTemplate ) },
{ "Upgrade", INI::parseUpgradeTemplate, NULL, offsetof( CommandButton, m_upgradeTemplate ) },
{ "WeaponSlot", INI::parseLookupList, TheWeaponSlotTypeNamesLookupList, offsetof( CommandButton, m_weaponSlot ) },
{ "MaxShotsToFire", INI::parseInt, NULL, offsetof( CommandButton, m_maxShotsToFire ) },
{ "Science", INI::parseScienceVector, NULL, offsetof( CommandButton, m_science ) },
{ "SpecialPower", INI::parseSpecialPowerTemplate, NULL, offsetof( CommandButton, m_specialPower ) },
{ "TextLabel", INI::parseAsciiString, NULL, offsetof( CommandButton, m_textLabel ) },
{ "DescriptLabel", INI::parseAsciiString, NULL, offsetof( CommandButton, m_descriptionLabel ) },
{ "PurchasedLabel", INI::parseAsciiString, NULL, offsetof( CommandButton, m_purchasedLabel ) },
{ "ConflictingLabel", INI::parseAsciiString, NULL, offsetof( CommandButton, m_conflictingLabel ) },
{ "ButtonImage", INI::parseAsciiString, NULL, offsetof( CommandButton, m_buttonImageName ) },
{ "CursorName", INI::parseAsciiString, NULL, offsetof( CommandButton, m_cursorName ) },
{ "InvalidCursorName", INI::parseAsciiString, NULL, offsetof( CommandButton, m_invalidCursorName ) },
{ "ButtonBorderType", INI::parseLookupList, CommandButtonMappedBorderTypeNames, offsetof( CommandButton, m_commandButtonBorder ) },
{ "RadiusCursorType", INI::parseIndexList, TheRadiusCursorNames, offsetof( CommandButton, m_radiusCursor ) },
{ "UnitSpecificSound", INI::parseAudioEventRTS, NULL, offsetof( CommandButton, m_unitSpecificSound ) },
{ NULL, NULL, NULL, 0 }
}
#define NULL
Definition BaseType.h:92
static void parseCommand(INI *ini, void *instance, void *store, const void *userData)
static void parseIndexList(INI *ini, void *instance, void *store, const void *userData)
Definition INI.cpp:1399
static void parseScienceVector(INI *ini, void *instance, void *store, const void *userData)
Definition INI.cpp:698
static void parseAudioEventRTS(INI *ini, void *instance, void *store, const void *userData)
Definition INI.cpp:1170
static void parseInt(INI *ini, void *instance, void *store, const void *userData)
Definition INI.cpp:538
static void parseUpgradeTemplate(INI *ini, void *instance, void *store, const void *userData)
Definition INI.cpp:1333
static void parseSpecialPowerTemplate(INI *ini, void *instance, void *store, const void *userData)
Definition INI.cpp:1354
static void parseThingTemplate(INI *ini, void *instance, void *store, const void *userData)
Definition INI.cpp:1187
static void parseAsciiString(INI *ini, void *instance, void *store, const void *userData)
Definition INI.cpp:653
static void parseBitString32(INI *ini, void *instance, void *store, const void *userData)
Definition INI.cpp:903
static void parseLookupList(INI *ini, void *instance, void *store, const void *userData)
Definition INI.cpp:1431

the parse table

Definition at line 105 of file ControlBar.h.


The documentation for this class was generated from the following files: