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

#include <ControlBar.h>

Inherits SubsystemInterface.

Classes

struct  ContainEntry
 
struct  QueueEntry
 

Public Member Functions

 ControlBar (void)
 
virtual ~ControlBar (void)
 
virtual void init (void)
 from subsystem interface
 
virtual void reset (void)
 from subsystem interface
 
virtual void update (void)
 from subsystem interface
 
void markUIDirty (void)
 mark the UI as dirty so the context of everything is re-evaluated
 
void onDrawableSelected (Drawable *draw)
 a drawable has just become selected
 
void onDrawableDeselected (Drawable *draw)
 a drawable has just become de-selected
 
void onPlayerRankChanged (const Player *p)
 
void onPlayerSciencePurchasePointsChanged (const Player *p)
 
CBCommandStatus processContextSensitiveButtonClick (GameWindow *button, GadgetGameMessage gadgetMessage)
 
CBCommandStatus processContextSensitiveButtonTransition (GameWindow *button, GadgetGameMessage gadgetMessage)
 
Bool isDrivingContextUI (Drawable *draw) const
 is the drawable the currently selected drawable for the context sensitive UI?
 
const CommandButtonfindCommandButton (const AsciiString &name)
 find existing command button if present
 
const CommandSetfindCommandSet (const AsciiString &name)
 find existing command set
 
void showPurchaseScience (void)
 
void hidePurchaseScience (void)
 
void togglePurchaseScience (void)
 
void showSpecialPowerShortcut (void)
 
void hideSpecialPowerShortcut (void)
 
void animateSpecialPowerShortcut (Bool isOn)
 
ControlBarSchemeManagergetControlBarSchemeManager (void)
 set the control bar to the proper scheme based off a player template that's passed in
 
void setControlBarSchemeByPlayer (Player *p)
 
void setControlBarSchemeByName (const AsciiString &name)
 
void setControlBarSchemeByPlayerTemplate (const PlayerTemplate *pt)
 
void updateBuildQueueDisabledImages (const Image *image)
 We need to sometime change what the images look like depending on what scheme we're using.
 
void updateRightHUDImage (const Image *image)
 We need to sometime change what the images look like depending on what scheme we're using.
 
void updateCommandMarkerImage (const Image *image)
 We need to be able to update the command marker image based on which scheme we're using.
 
void updateSlotExitImage (const Image *image)
 
void updateUpDownImages (const Image *toggleButtonUpIn, const Image *toggleButtonUpOn, const Image *toggleButtonUpPushed, const Image *toggleButtonDownIn, const Image *toggleButtonDownOn, const Image *toggleButtonDownPushed, const Image *generalButtonEnable, const Image *generalButtonHighlight)
 
void preloadAssets (TimeOfDay timeOfDay)
 preload the assets
 
void updateBuildUpClockColor (Color color)
 We want to be able to have the control bar scheme set the color of the build up clock.
 
void updatePurchaseScience (void)
 
void initObserverControls (void)
 
void setObserverLookAtPlayer (Player *p)
 
PlayergetObserverLookAtPlayer (void)
 
void populateObserverInfoWindow (void)
 
void populateObserverList (void)
 
Bool isObserverControlBarOn (void)
 
void switchControlBarStage (ControlBarStages stage)
 
void toggleControlBarStage (void)
 
const ImagegetStarImage (void)
 
Color getBorderColor (void)
 
void updateBorderColor (Color color)
 
void setControlCommand (GameWindow *button, const CommandButton *commandButton)
 set the command data into the button
 
void getForegroundMarkerPos (Int *x, Int *y)
 
void getBackgroundMarkerPos (Int *x, Int *y)
 
void drawTransitionHandler (void)
 
const ImagegetArrowImage (void)
 
void setArrowImage (const Image *arrowImage)
 
void initSpecialPowershortcutBar (Player *player)
 
void triggerRadarAttackGlow (void)
 
void drawSpecialPowerShortcutMultiplierText ()
 
Bool hasAnyShortcutSelection () const
 
void setFlash (Bool b)
 
const CommandButtongetCommandButtons (void)
 
void hideCommunicator (Bool b)
 
void showBuildTooltipLayout (GameWindow *cmdButton)
 
void hideBuildTooltipLayout (void)
 
void deleteBuildTooltipLayout (void)
 
Bool getShowBuildTooltipLayout (void)
 
void populateBuildTooltipLayout (const CommandButton *commandButton, GameWindow *tooltipWin=NULL)
 
void repopulateBuildTooltipLayout (void)
 
void updateCommanBarBorderColors (Color build, Color action, Color upgrade, Color system)
 
- Public Member Functions inherited from SubsystemInterface
 SubsystemInterface ()
 
virtual ~SubsystemInterface ()
 
virtual void postProcessLoad ()
 
virtual void draw (void)
 
void UPDATE (void)
 
void DRAW (void)
 
AsciiString getName (void)
 
void setName (AsciiString name)
 

Static Public Member Functions

static void parseCommandSetDefinition (INI *ini)
 
static void parseCommandButtonDefinition (INI *ini)
 

Public Attributes

WindowVideoManagerm_videoManager
 Video manager to take care of all animations on screen.
 
AnimateWindowManagerm_animateWindowManager
 The animate window manager.
 
AnimateWindowManagerm_animateWindowManagerForGenShortcuts
 The animate window manager.
 
AnimateWindowManagerm_generalsScreenAnimate
 The animate window manager.
 

Protected Member Functions

void updateRadarAttackGlow (void)
 
void setDefaultControlBarConfig (void)
 
void setSquishedControlBarConfig (void)
 
void setLowControlBarConfig (void)
 
void setHiddenControlBar (void)
 
CommandButtonfindNonConstCommandButton (const AsciiString &name)
 find existing command button if present
 
CommandButtonnewCommandButton (const AsciiString &name)
 allocate a new command button, link to list, initialize to default, and return
 
CommandButtonnewCommandButtonOverride (CommandButton *buttonToOverride)
 
CommandSetnewCommandSet (const AsciiString &name)
 allocate a new command set, link to list, initialize to default, and return it
 
CommandSetnewCommandSetOverride (CommandSet *setToOverride)
 
void evaluateContextUI (void)
 evaluate what the user should see based on what selected drawables we have in our UI
 
void addCommonCommands (Drawable *draw, Bool firstDrawable)
 add the common commands of this drawable to the common command set
 
void switchToContext (ControlBarContext context, Drawable *draw)
 switch the interface context to the new mode and populate as needed
 
void setControlCommand (const AsciiString &buttonWindowName, GameWindow *parent, const CommandButton *commandButton)
 set the command data into the button
 
void setPortraitByImage (const Image *image)
 show/hide the portrait window image using the image pointer to set
 
void setPortraitByObject (Object *obj)
 show/hide the portrait window image using the image from the object
 
void showRallyPoint (const Coord3D *loc)
 show rally point at world location, a NULL location will hide any visible rally point marker
 
void postProcessCommands (void)
 post process step, after all commands and command sets are loaded
 
void resetCommonCommandData (void)
 
void resetContainData (void)
 reset shared command data
 
void resetBuildQueueData (void)
 reset container data we use to tie controls to objects IDs for containment
 
void populatePurchaseScience (Player *player)
 
void populateCommand (Object *obj)
 
void populateMultiSelect (void)
 
void populateBuildQueue (Object *producer)
 
void populateStructureInventory (Object *building)
 
void populateBeacon (Object *beacon)
 
void populateUnderConstruction (Object *objectUnderConstruction)
 
void populateOCLTimer (Object *creatorObject)
 
void doTransportInventoryUI (Object *transport, const CommandSet *commandSet)
 
CommandAvailability getCommandAvailability (const CommandButton *command, Object *obj, GameWindow *win, GameWindow *applyToWin=NULL, Bool forceDisabledEvaluation=FALSE) const
 
void updateContextMultiSelect (void)
 
void updateContextPurchaseScience (void)
 
void updateContextCommand (void)
 
void updateContextStructureInventory (void)
 
void updateContextBeacon (void)
 
void updateContextUnderConstruction (void)
 
void updateContextOCLTimer (void)
 
void populateSpecialPowerShortcut (Player *player)
 
void updateSpecialPowerShortcut (void)
 
CBCommandStatus processCommandUI (GameWindow *control, GadgetGameMessage gadgetMessage)
 
CBCommandStatus processCommandTransitionUI (GameWindow *control, GadgetGameMessage gadgetMessage)
 
void updateConstructionTextDisplay (Object *obj)
 
void updateOCLTimerTextDisplay (UnsignedInt totalSeconds, Real percent)
 
void setUpDownImages (void)
 

Static Protected Member Functions

static void populateButtonProc (Object *obj, void *userData)
 reset the build queue data we use to die queue entires to control
 
static void populateInvDataCallback (Object *obj, void *userData)
 
static const ImagecalculateVeterancyOverlayForThing (const ThingTemplate *thingTemplate)
 
static const ImagecalculateVeterancyOverlayForObject (const Object *obj)
 

Protected Attributes

ICoord2D m_defaultControlBarPosition
 Stored the original position of the control bar on the screen.
 
ControlBarStages m_currentControlBarStage
 
Bool m_UIDirty
 the context UI must be re-evaluated
 
CommandButtonm_commandButtons
 list of possible commands to have
 
CommandSetm_commandSets
 list of all command sets defined
 
ControlBarSchemeManagerm_controlBarSchemeManager
 The Scheme singleton.
 
GameWindowm_contextParent [NUM_CONTEXT_PARENTS]
 "parent" window for buttons that are part of the context sensitive interface
 
Drawablem_currentSelectedDrawable
 currently selected drawable for the context sensitive interface
 
ControlBarContext m_currContext
 our current displayed context
 
DrawableID m_rallyPointDrawableID
 rally point drawable for visual rally point
 
Real m_displayedConstructPercent
 construct percent last displayed to user
 
UnsignedInt m_displayedOCLTimerSeconds
 OCL Timer seconds remaining last displayed to user.
 
UnsignedInt m_displayedQueueCount
 queue count last displayed to user
 
UnsignedInt m_lastRecordedInventoryCount
 last known UI state of an inventory count
 
GameWindowm_rightHUDWindow
 window of the right HUD display
 
GameWindowm_rightHUDCameoWindow
 window of the right HUD display
 
GameWindowm_rightHUDUpgradeCameos [MAX_RIGHT_HUD_UPGRADE_CAMEOS]
 
GameWindowm_rightHUDUnitSelectParent
 
GameWindowm_communicatorButton
 button for the communicator
 
WindowLayoutm_scienceLayout
 the Science window layout
 
GameWindowm_sciencePurchaseWindowsRank1 [MAX_PURCHASE_SCIENCE_RANK_1]
 command window controls for easy access
 
GameWindowm_sciencePurchaseWindowsRank3 [MAX_PURCHASE_SCIENCE_RANK_3]
 command window controls for easy access
 
GameWindowm_sciencePurchaseWindowsRank8 [MAX_PURCHASE_SCIENCE_RANK_8]
 command window controls for easy access
 
GameWindowm_specialPowerShortcutButtons [MAX_SPECIAL_POWER_SHORTCUTS]
 
GameWindowm_specialPowerShortcutButtonParents [MAX_SPECIAL_POWER_SHORTCUTS]
 
DisplayStringm_shortcutDisplayStrings [MAX_SPECIAL_POWER_SHORTCUTS]
 
Int m_currentlyUsedSpecialPowersButtons
 Value will be <= MAX_SPECIAL_POWER_SHORTCUTS;.
 
WindowLayoutm_specialPowerLayout
 
GameWindowm_specialPowerShortcutParent
 
GameWindowm_commandWindows [MAX_COMMANDS_PER_SET]
 command window controls for easy access
 
const CommandButtonm_commonCommands [MAX_COMMANDS_PER_SET]
 shared commands we will use for multi-selection
 
QueueEntry m_queueData [MAX_BUILD_QUEUE_BUTTONS]
 what the build queue represents
 
Bool m_flash
 tells update whether or not to check for flash
 
Bool m_sideSelectAnimateDown
 
ICoord2D m_animateDownWin1Size
 
ICoord2D m_animateDownWin2Size
 
ICoord2D m_animateDownWin1Pos
 
ICoord2D m_animateDownWin2Pos
 
GameWindowm_animateDownWindow
 
UnsignedInt m_animTime
 
Color m_buildUpClockColor
 
Bool m_isObserverCommandBar
 If this is true, the command bar behaves greatly differnt.
 
Playerm_observerLookAtPlayer
 The current player we're looking at, Null if we're not looking at anyone.
 
WindowLayoutm_buildToolTipLayout
 The window that will slide on/display tooltips.
 
Bool m_showBuildToolTipLayout
 every frame we test to see if we aregoing to continue showing this or not.
 
- Protected Attributes inherited from SubsystemInterface
AsciiString m_name
 

Static Protected Attributes

static ContainEntry m_containData [MAX_COMMANDS_PER_SET]
 inventory buttons integrated into the regular command set for buildings/transports
 

Detailed Description

Definition at line 651 of file ControlBar.h.

Constructor & Destructor Documentation

◆ ControlBar()

ControlBar::ControlBar ( void )

Definition at line 865 of file ControlBar.cpp.

◆ ~ControlBar()

ControlBar::~ControlBar ( void )
virtual

Definition at line 973 of file ControlBar.cpp.

Member Function Documentation

◆ addCommonCommands()

void ControlBar::addCommonCommands ( Drawable * draw,
Bool firstDrawable )
protected

add the common commands of this drawable to the common command set

add the common commands of this drawable to the common command set

Definition at line 70 of file ControlBarMultiSelect.cpp.

◆ animateSpecialPowerShortcut()

void ControlBar::animateSpecialPowerShortcut ( Bool isOn)

Definition at line 3716 of file ControlBar.cpp.

◆ calculateVeterancyOverlayForObject()

const Image * ControlBar::calculateVeterancyOverlayForObject ( const Object * obj)
staticprotected

Definition at line 974 of file ControlBarCommand.cpp.

◆ calculateVeterancyOverlayForThing()

const Image * ControlBar::calculateVeterancyOverlayForThing ( const ThingTemplate * thingTemplate)
staticprotected

Definition at line 917 of file ControlBarCommand.cpp.

◆ deleteBuildTooltipLayout()

void ControlBar::deleteBuildTooltipLayout ( void )

Definition at line 701 of file ControlBarPopupDescription.cpp.

◆ doTransportInventoryUI()

void ControlBar::doTransportInventoryUI ( Object * transport,
const CommandSet * commandSet )
protected

Transports have an extra special manipulation of the user interface. They get to look at the available command set, and any of the commands that are TransportExit commands AND there is actually an object to represent that slot contained in the transport, the inventory picture of the contained object will be displayed in the window control for that TransportExit command. Also, transports will HIDE any TransportExit controls found in the command set that represent slots that DO NOT EXIST for the transport (that is, the transport can only hold 4 things, but the GUI has buttons for 8 things). For slots that are empty but present in the transport the UI will show a disabled button to show the user that there is an open "slot"

Todo
srj – remove hard-coding here, please

Definition at line 148 of file ControlBarCommand.cpp.

◆ drawSpecialPowerShortcutMultiplierText()

void ControlBar::drawSpecialPowerShortcutMultiplierText ( )

Definition at line 3663 of file ControlBar.cpp.

◆ drawTransitionHandler()

void ControlBar::drawTransitionHandler ( void )

Definition at line 3183 of file ControlBar.cpp.

◆ evaluateContextUI()

void ControlBar::evaluateContextUI ( void )
protected

evaluate what the user should see based on what selected drawables we have in our UI

Given the drawables that we have selected into our context sensitive UI, evaluate and perform all UI manipulations to make the GUI show to the user what we want them to see

Definition at line 1713 of file ControlBar.cpp.

◆ findCommandButton()

const CommandButton * ControlBar::findCommandButton ( const AsciiString & name)

find existing command button if present

find existing command button if present

Definition at line 2034 of file ControlBar.cpp.

◆ findCommandSet()

const CommandSet * ControlBar::findCommandSet ( const AsciiString & name)

find existing command set

Find existing command set by name

Definition at line 2047 of file ControlBar.cpp.

◆ findNonConstCommandButton()

CommandButton * ControlBar::findNonConstCommandButton ( const AsciiString & name)
protected

find existing command button if present

Find a command button of the given name if present

Definition at line 1917 of file ControlBar.cpp.

◆ getArrowImage()

const Image * ControlBar::getArrowImage ( void )
inline

Definition at line 768 of file ControlBar.h.

◆ getBackgroundMarkerPos()

void ControlBar::getBackgroundMarkerPos ( Int * x,
Int * y )

Definition at line 3177 of file ControlBar.cpp.

◆ getBorderColor()

Color ControlBar::getBorderColor ( void )
inline

Definition at line 754 of file ControlBar.h.

◆ getCommandAvailability()

CommandAvailability ControlBar::getCommandAvailability ( const CommandButton * command,
Object * obj,
GameWindow * win,
GameWindow * applyToWin = NULL,
Bool forceDisabledEvaluation = FALSE ) const
protected

What's the status between 'obj' and the 'command' at present. Can we do it? Are we already doing it? Can ya dig it?

@Kris – We need to show the button as always available for anything with a 0 clip reload time.

Todo
srj – not sure why this next check is necessary, but the Comanche missile buttons will flicker without it. figure out someday.
Todo
Todo
ml – and note: that the "now-1" below causes zero-clip-reload weapons to never be ready, so I added this If you make changes to this code, make sure that the DragonTank's firewall weapon can be retargeted while active, that is, while the tank is squirting out flames all over the floor, you can click the firewall button (or "F"), and re-target the firewall without having to stop or move in-betwen.. Thanks for reading

Definition at line 1017 of file ControlBarCommand.cpp.

◆ getCommandButtons()

const CommandButton * ControlBar::getCommandButtons ( void )
inline

Definition at line 874 of file ControlBar.h.

◆ getControlBarSchemeManager()

ControlBarSchemeManager * ControlBar::getControlBarSchemeManager ( void )
inline

set the control bar to the proper scheme based off a player template that's passed in

Definition at line 710 of file ControlBar.h.

◆ getForegroundMarkerPos()

void ControlBar::getForegroundMarkerPos ( Int * x,
Int * y )

Definition at line 3172 of file ControlBar.cpp.

◆ getObserverLookAtPlayer()

Player * ControlBar::getObserverLookAtPlayer ( void )
inline

Definition at line 741 of file ControlBar.h.

◆ getShowBuildTooltipLayout()

Bool ControlBar::getShowBuildTooltipLayout ( void )
inline

Definition at line 976 of file ControlBar.h.

◆ getStarImage()

const Image * ControlBar::getStarImage ( void )

Definition at line 1645 of file ControlBar.cpp.

◆ hasAnyShortcutSelection()

Bool ControlBar::hasAnyShortcutSelection ( ) const

Definition at line 3509 of file ControlBar.cpp.

◆ hideBuildTooltipLayout()

void ControlBar::hideBuildTooltipLayout ( void )

Definition at line 690 of file ControlBarPopupDescription.cpp.

◆ hideCommunicator()

void ControlBar::hideCommunicator ( Bool b)

Definition at line 2921 of file ControlBar.cpp.

◆ hidePurchaseScience()

void ControlBar::hidePurchaseScience ( void )

Definition at line 2959 of file ControlBar.cpp.

◆ hideSpecialPowerShortcut()

void ControlBar::hideSpecialPowerShortcut ( void )

Definition at line 3764 of file ControlBar.cpp.

◆ init()

void ControlBar::init ( void )
virtual

from subsystem interface

Initialzie the control bar, this is our interface to the context sinsitive GUI

Implements SubsystemInterface.

Definition at line 1050 of file ControlBar.cpp.

◆ initObserverControls()

void ControlBar::initObserverControls ( void )

Definition at line 103 of file ControlBarObserver.cpp.

◆ initSpecialPowershortcutBar()

void ControlBar::initSpecialPowershortcutBar ( Player * player)

Definition at line 3222 of file ControlBar.cpp.

◆ isDrivingContextUI()

Bool ControlBar::isDrivingContextUI ( Drawable * draw) const
inline

is the drawable the currently selected drawable for the context sensitive UI?

Definition at line 687 of file ControlBar.h.

◆ isObserverControlBarOn()

Bool ControlBar::isObserverControlBarOn ( void )
inline

Definition at line 744 of file ControlBar.h.

◆ markUIDirty()

void ControlBar::markUIDirty ( void )

mark the UI as dirty so the context of everything is re-evaluated

Definition at line 138 of file ControlBar.cpp.

◆ newCommandButton()

CommandButton * ControlBar::newCommandButton ( const AsciiString & name)
protected

allocate a new command button, link to list, initialize to default, and return

Allocate a new command button, assign name, and tie to list

Definition at line 1931 of file ControlBar.cpp.

◆ newCommandButtonOverride()

CommandButton * ControlBar::newCommandButtonOverride ( CommandButton * buttonToOverride)
protected

Definition at line 1951 of file ControlBar.cpp.

◆ newCommandSet()

CommandSet * ControlBar::newCommandSet ( const AsciiString & name)
protected

allocate a new command set, link to list, initialize to default, and return it

Allocate a new command set, link to list, initialize to default, and return it

Definition at line 2058 of file ControlBar.cpp.

◆ newCommandSetOverride()

CommandSet * ControlBar::newCommandSetOverride ( CommandSet * setToOverride)
protected

Create an overridden command set.

Definition at line 2072 of file ControlBar.cpp.

◆ onDrawableDeselected()

void ControlBar::onDrawableDeselected ( Drawable * draw)

a drawable has just become de-selected

Definition at line 1622 of file ControlBar.cpp.

◆ onDrawableSelected()

void ControlBar::onDrawableSelected ( Drawable * draw)

a drawable has just become selected

Definition at line 1608 of file ControlBar.cpp.

◆ onPlayerRankChanged()

void ControlBar::onPlayerRankChanged ( const Player * p)
Todo
implement me

Definition at line 1675 of file ControlBar.cpp.

◆ onPlayerSciencePurchasePointsChanged()

void ControlBar::onPlayerSciencePurchasePointsChanged ( const Player * p)
Todo
implement me

Definition at line 1693 of file ControlBar.cpp.

◆ parseCommandButtonDefinition()

void ControlBar::parseCommandButtonDefinition ( INI * ini)
static

Parse a command button

Definition at line 49 of file INICommandButton.cpp.

◆ parseCommandSetDefinition()

void ControlBar::parseCommandSetDefinition ( INI * ini)
static

Parse a command set

Definition at line 1973 of file ControlBar.cpp.

◆ populateBeacon()

void ControlBar::populateBeacon ( Object * beacon)
protected

Definition at line 44 of file ControlBarBeacon.cpp.

◆ populateBuildQueue()

void ControlBar::populateBuildQueue ( Object * producer)
protected
Todo
srj – remove hard-coding here, please
Todo
srj – remove hard-coding here, please

Definition at line 555 of file ControlBarCommand.cpp.

◆ populateBuildTooltipLayout()

void ControlBar::populateBuildTooltipLayout ( const CommandButton * commandButton,
GameWindow * tooltipWin = NULL )

Definition at line 249 of file ControlBarPopupDescription.cpp.

◆ populateButtonProc()

void ControlBar::populateButtonProc ( Object * obj,
void * userData )
staticprotected

reset the build queue data we use to die queue entires to control

Definition at line 68 of file ControlBarStructureInventory.cpp.

◆ populateCommand()

void ControlBar::populateCommand ( Object * obj)
protected

Definition at line 270 of file ControlBarCommand.cpp.

◆ populateInvDataCallback()

void ControlBar::populateInvDataCallback ( Object * obj,
void * userData )
staticprotected

Used for the callback iterator on transport contents to do the actual GUI fill

Definition at line 91 of file ControlBarCommand.cpp.

◆ populateMultiSelect()

void ControlBar::populateMultiSelect ( void )
protected

Populate the visible command bar with commands that are common to all the objects that are selected in the UI

Definition at line 211 of file ControlBarMultiSelect.cpp.

◆ populateObserverInfoWindow()

void ControlBar::populateObserverInfoWindow ( void )

Definition at line 295 of file ControlBarObserver.cpp.

◆ populateObserverList()

void ControlBar::populateObserverList ( void )

Definition at line 210 of file ControlBarObserver.cpp.

◆ populateOCLTimer()

void ControlBar::populateOCLTimer ( Object * creatorObject)
protected

Populate the interface for an OCL Timer context.

Todo
srj – remove hard-coding here, please

Definition at line 79 of file ControlBarOCLTimer.cpp.

◆ populatePurchaseScience()

void ControlBar::populatePurchaseScience ( Player * player)
protected

Definition at line 167 of file ControlBar.cpp.

◆ populateSpecialPowerShortcut()

void ControlBar::populateSpecialPowerShortcut ( Player * player)
protected

Definition at line 3280 of file ControlBar.cpp.

◆ populateStructureInventory()

void ControlBar::populateStructureInventory ( Object * building)
protected
Todo
srj – remove hard-coding here, please
Todo
srj – remove hard-coding here, please
Todo
srj – remove hard-coding here, please

Definition at line 100 of file ControlBarStructureInventory.cpp.

◆ populateUnderConstruction()

void ControlBar::populateUnderConstruction ( Object * objectUnderConstruction)
protected

Populate the interface for an under construction context.

Todo
srj – remove hard-coding here, please

Definition at line 70 of file ControlBarUnderConstruction.cpp.

◆ postProcessCommands()

void ControlBar::postProcessCommands ( void )
protected

post process step, after all commands and command sets are loaded

post process step, after all commands and command sets are loaded

Definition at line 2523 of file ControlBar.cpp.

◆ preloadAssets()

void ControlBar::preloadAssets ( TimeOfDay timeOfDay)

preload the assets

Definition at line 2850 of file ControlBar.cpp.

◆ processCommandTransitionUI()

CBCommandStatus ControlBar::processCommandTransitionUI ( GameWindow * control,
GadgetGameMessage gadgetMessage )
protected

Process a button transition message from the window system that should be for one of our GUI commands

Definition at line 105 of file ControlBarCommandProcessing.cpp.

◆ processCommandUI()

CBCommandStatus ControlBar::processCommandUI ( GameWindow * control,
GadgetGameMessage gadgetMessage )
protected

Process a button selected message from the window system that should be for one of our GUI commands

Todo
Added obj check because Single Use and Multi Select crash when used together, but with this check they just won't work. When the "rethinking" occurs, this can get fixed. Right now it is unused. Convoy Truck needs Multi Select so Single Use is turned off, and noone else has it.

Definition at line 129 of file ControlBarCommandProcessing.cpp.

◆ processContextSensitiveButtonClick()

CBCommandStatus ControlBar::processContextSensitiveButtonClick ( GameWindow * button,
GadgetGameMessage gadgetMessage )

if this button is part of the context sensitive command system, process a button click the gadgetMessage is either a GBM_SELECTED or GBM_SELECTED_RIGHT

Process a button click for the context sensitive GUI

Definition at line 2095 of file ControlBar.cpp.

◆ processContextSensitiveButtonTransition()

CBCommandStatus ControlBar::processContextSensitiveButtonTransition ( GameWindow * button,
GadgetGameMessage gadgetMessage )

if this button is part of the context sensitive command system, process the Transition gadgetMessage is either a GBM_MOUSE_LEAVING or GBM_MOUSE_ENTERING

Process a button click for the context sensitive GUI

Definition at line 2107 of file ControlBar.cpp.

◆ repopulateBuildTooltipLayout()

void ControlBar::repopulateBuildTooltipLayout ( void )

Definition at line 239 of file ControlBarPopupDescription.cpp.

◆ reset()

void ControlBar::reset ( void )
virtual

from subsystem interface

Reset the context sensitive control bar GUI

Implements SubsystemInterface.

Definition at line 1294 of file ControlBar.cpp.

◆ resetBuildQueueData()

void ControlBar::resetBuildQueueData ( void )
protected

reset container data we use to tie controls to objects IDs for containment

reset the build queue data we use to die queue entires to control

Definition at line 537 of file ControlBarCommand.cpp.

◆ resetCommonCommandData()

void ControlBar::resetCommonCommandData ( void )
protected

Reset the common command data

Definition at line 54 of file ControlBarMultiSelect.cpp.

◆ resetContainData()

void ControlBar::resetContainData ( void )
protected

reset shared command data

reset transport data

Definition at line 520 of file ControlBarCommand.cpp.

◆ setArrowImage()

void ControlBar::setArrowImage ( const Image * arrowImage)
inline

Definition at line 769 of file ControlBar.h.

◆ setControlBarSchemeByName()

void ControlBar::setControlBarSchemeByName ( const AsciiString & name)

Definition at line 2842 of file ControlBar.cpp.

◆ setControlBarSchemeByPlayer()

void ControlBar::setControlBarSchemeByPlayer ( Player * p)

Show a rally point marker at the world location specified. If no location is specified any marker that we might have visible is hidden

Definition at line 2750 of file ControlBar.cpp.

◆ setControlBarSchemeByPlayerTemplate()

void ControlBar::setControlBarSchemeByPlayerTemplate ( const PlayerTemplate * pt)

Definition at line 2795 of file ControlBar.cpp.

◆ setControlCommand() [1/2]

void ControlBar::setControlCommand ( const AsciiString & buttonWindowName,
GameWindow * parent,
const CommandButton * commandButton )
protected

set the command data into the button

set the command for the button identified by the window name NOTE that parent may be NULL, it only helps to speed up the search for a particular window ID

Definition at line 2536 of file ControlBar.cpp.

◆ setControlCommand() [2/2]

void ControlBar::setControlCommand ( GameWindow * button,
const CommandButton * commandButton )

set the command data into the button

Set the command data into the control

Definition at line 2427 of file ControlBar.cpp.

◆ setDefaultControlBarConfig()

void ControlBar::setDefaultControlBarConfig ( void )
protected

Definition at line 3025 of file ControlBar.cpp.

◆ setFlash()

void ControlBar::setFlash ( Bool b)
inline

Definition at line 871 of file ControlBar.h.

◆ setHiddenControlBar()

void ControlBar::setHiddenControlBar ( void )
protected

Definition at line 3073 of file ControlBar.cpp.

◆ setLowControlBarConfig()

void ControlBar::setLowControlBarConfig ( void )
protected

Definition at line 3054 of file ControlBar.cpp.

◆ setObserverLookAtPlayer()

void ControlBar::setObserverLookAtPlayer ( Player * p)
inline

Definition at line 740 of file ControlBar.h.

◆ setPortraitByImage()

void ControlBar::setPortraitByImage ( const Image * image)
protected

show/hide the portrait window image using the image pointer to set

show/hide the portrait window image

Definition at line 2558 of file ControlBar.cpp.

◆ setPortraitByObject()

void ControlBar::setPortraitByObject ( Object * obj)
protected

show/hide the portrait window image using the image from the object

show/hide the portrait image by object. We like to use this method as opposed to the plain image one above so that we can build more intelligence into what portrait to show for an object given its current state or object type

Definition at line 2591 of file ControlBar.cpp.

◆ setSquishedControlBarConfig()

void ControlBar::setSquishedControlBarConfig ( void )
protected

Definition at line 3041 of file ControlBar.cpp.

◆ setUpDownImages()

void ControlBar::setUpDownImages ( void )
protected

Definition at line 3152 of file ControlBar.cpp.

◆ showBuildTooltipLayout()

void ControlBar::showBuildTooltipLayout ( GameWindow * cmdButton)

Definition at line 133 of file ControlBarPopupDescription.cpp.

◆ showPurchaseScience()

void ControlBar::showPurchaseScience ( void )

Definition at line 2942 of file ControlBar.cpp.

◆ showRallyPoint()

void ControlBar::showRallyPoint ( const Coord3D * loc)
protected

show rally point at world location, a NULL location will hide any visible rally point marker

Show a rally point marker at the world location specified. If no location is specified any marker that we might have visible is hidden

Definition at line 2693 of file ControlBar.cpp.

◆ showSpecialPowerShortcut()

void ControlBar::showSpecialPowerShortcut ( void )

Definition at line 3743 of file ControlBar.cpp.

◆ switchControlBarStage()

void ControlBar::switchControlBarStage ( ControlBarStages stage)

Definition at line 3001 of file ControlBar.cpp.

◆ switchToContext()

void ControlBar::switchToContext ( ControlBarContext context,
Drawable * draw )
protected

switch the interface context to the new mode and populate as needed

Switch the user interface to the new context specified and fill out any of the art and/or buttons that we need to for the new context using data from the object passed in

Definition at line 2122 of file ControlBar.cpp.

◆ toggleControlBarStage()

void ControlBar::toggleControlBarStage ( void )

Definition at line 2992 of file ControlBar.cpp.

◆ togglePurchaseScience()

void ControlBar::togglePurchaseScience ( void )

Definition at line 2984 of file ControlBar.cpp.

◆ triggerRadarAttackGlow()

void ControlBar::triggerRadarAttackGlow ( void )

Definition at line 3193 of file ControlBar.cpp.

◆ update()

void ControlBar::update ( void )
virtual

from subsystem interface

Update phase, we can track if our selected object is destroyed, update button percentages, status, enabled status etc

Implements SubsystemInterface.

Definition at line 1383 of file ControlBar.cpp.

◆ updateBorderColor()

void ControlBar::updateBorderColor ( Color color)
inline

Definition at line 755 of file ControlBar.h.

◆ updateBuildQueueDisabledImages()

void ControlBar::updateBuildQueueDisabledImages ( const Image * image)

We need to sometime change what the images look like depending on what scheme we're using.

Definition at line 2856 of file ControlBar.cpp.

◆ updateBuildUpClockColor()

void ControlBar::updateBuildUpClockColor ( Color color)

We want to be able to have the control bar scheme set the color of the build up clock.

Definition at line 2904 of file ControlBar.cpp.

◆ updateCommanBarBorderColors()

void ControlBar::updateCommanBarBorderColors ( Color build,
Color action,
Color upgrade,
Color system )

Definition at line 2911 of file ControlBar.cpp.

◆ updateCommandMarkerImage()

void ControlBar::updateCommandMarkerImage ( const Image * image)

We need to be able to update the command marker image based on which scheme we're using.

Definition at line 3090 of file ControlBar.cpp.

◆ updateConstructionTextDisplay()

void ControlBar::updateConstructionTextDisplay ( Object * obj)
protected

Definition at line 48 of file ControlBarUnderConstruction.cpp.

◆ updateContextBeacon()

void ControlBar::updateContextBeacon ( void )
protected

Definition at line 88 of file ControlBarBeacon.cpp.

◆ updateContextCommand()

void ControlBar::updateContextCommand ( void )
protected

Definition at line 702 of file ControlBarCommand.cpp.

◆ updateContextMultiSelect()

void ControlBar::updateContextMultiSelect ( void )
protected

Update logic for the multi select context sensitive GUI

Definition at line 300 of file ControlBarMultiSelect.cpp.

◆ updateContextOCLTimer()

void ControlBar::updateContextOCLTimer ( void )
protected

Definition at line 140 of file ControlBarOCLTimer.cpp.

◆ updateContextPurchaseScience()

void ControlBar::updateContextPurchaseScience ( void )
protected

Definition at line 458 of file ControlBar.cpp.

◆ updateContextStructureInventory()

void ControlBar::updateContextStructureInventory ( void )
protected

Definition at line 205 of file ControlBarStructureInventory.cpp.

◆ updateContextUnderConstruction()

void ControlBar::updateContextUnderConstruction ( void )
protected

Definition at line 106 of file ControlBarUnderConstruction.cpp.

◆ updateOCLTimerTextDisplay()

void ControlBar::updateOCLTimerTextDisplay ( UnsignedInt totalSeconds,
Real percent )
protected

Definition at line 47 of file ControlBarOCLTimer.cpp.

◆ updatePurchaseScience()

void ControlBar::updatePurchaseScience ( void )

Definition at line 2931 of file ControlBar.cpp.

◆ updateRadarAttackGlow()

void ControlBar::updateRadarAttackGlow ( void )
protected

Definition at line 3203 of file ControlBar.cpp.

◆ updateRightHUDImage()

void ControlBar::updateRightHUDImage ( const Image * image)

We need to sometime change what the images look like depending on what scheme we're using.

Definition at line 2896 of file ControlBar.cpp.

◆ updateSlotExitImage()

void ControlBar::updateSlotExitImage ( const Image * image)

Definition at line 3101 of file ControlBar.cpp.

◆ updateSpecialPowerShortcut()

void ControlBar::updateSpecialPowerShortcut ( void )
protected

Definition at line 3535 of file ControlBar.cpp.

◆ updateUpDownImages()

void ControlBar::updateUpDownImages ( const Image * toggleButtonUpIn,
const Image * toggleButtonUpOn,
const Image * toggleButtonUpPushed,
const Image * toggleButtonDownIn,
const Image * toggleButtonDownOn,
const Image * toggleButtonDownPushed,
const Image * generalButtonEnable,
const Image * generalButtonHighlight )

Definition at line 3134 of file ControlBar.cpp.

Member Data Documentation

◆ m_animateDownWin1Pos

ICoord2D ControlBar::m_animateDownWin1Pos
protected

Definition at line 960 of file ControlBar.h.

◆ m_animateDownWin1Size

ICoord2D ControlBar::m_animateDownWin1Size
protected

Definition at line 958 of file ControlBar.h.

◆ m_animateDownWin2Pos

ICoord2D ControlBar::m_animateDownWin2Pos
protected

Definition at line 961 of file ControlBar.h.

◆ m_animateDownWin2Size

ICoord2D ControlBar::m_animateDownWin2Size
protected

Definition at line 959 of file ControlBar.h.

◆ m_animateDownWindow

GameWindow* ControlBar::m_animateDownWindow
protected

Definition at line 962 of file ControlBar.h.

◆ m_animateWindowManager

AnimateWindowManager* ControlBar::m_animateWindowManager

The animate window manager.

Definition at line 733 of file ControlBar.h.

◆ m_animateWindowManagerForGenShortcuts

AnimateWindowManager* ControlBar::m_animateWindowManagerForGenShortcuts

The animate window manager.

Definition at line 734 of file ControlBar.h.

◆ m_animTime

UnsignedInt ControlBar::m_animTime
protected

Definition at line 963 of file ControlBar.h.

◆ m_buildToolTipLayout

WindowLayout* ControlBar::m_buildToolTipLayout
protected

The window that will slide on/display tooltips.

Definition at line 970 of file ControlBar.h.

◆ m_buildUpClockColor

Color ControlBar::m_buildUpClockColor
protected

Definition at line 965 of file ControlBar.h.

◆ m_commandButtons

CommandButton* ControlBar::m_commandButtons
protected

list of possible commands to have

Definition at line 883 of file ControlBar.h.

◆ m_commandSets

CommandSet* ControlBar::m_commandSets
protected

list of all command sets defined

Definition at line 884 of file ControlBar.h.

◆ m_commandWindows

GameWindow* ControlBar::m_commandWindows[MAX_COMMANDS_PER_SET]
protected

command window controls for easy access

Definition at line 919 of file ControlBar.h.

◆ m_commonCommands

const CommandButton* ControlBar::m_commonCommands[MAX_COMMANDS_PER_SET]
protected

shared commands we will use for multi-selection

Definition at line 920 of file ControlBar.h.

◆ m_communicatorButton

GameWindow* ControlBar::m_communicatorButton
protected

button for the communicator

Definition at line 904 of file ControlBar.h.

◆ m_containData

ControlBar::ContainEntry ControlBar::m_containData
staticprotected

inventory buttons integrated into the regular command set for buildings/transports

Definition at line 939 of file ControlBar.h.

◆ m_contextParent

GameWindow* ControlBar::m_contextParent[NUM_CONTEXT_PARENTS]
protected

"parent" window for buttons that are part of the context sensitive interface

Definition at line 887 of file ControlBar.h.

◆ m_controlBarSchemeManager

ControlBarSchemeManager* ControlBar::m_controlBarSchemeManager
protected

The Scheme singleton.

Definition at line 885 of file ControlBar.h.

◆ m_currContext

ControlBarContext ControlBar::m_currContext
protected

our current displayed context

Definition at line 890 of file ControlBar.h.

◆ m_currentControlBarStage

ControlBarStages ControlBar::m_currentControlBarStage
protected

Definition at line 879 of file ControlBar.h.

◆ m_currentlyUsedSpecialPowersButtons

Int ControlBar::m_currentlyUsedSpecialPowersButtons
protected

Value will be <= MAX_SPECIAL_POWER_SHORTCUTS;.

Definition at line 913 of file ControlBar.h.

◆ m_currentSelectedDrawable

Drawable* ControlBar::m_currentSelectedDrawable
protected

currently selected drawable for the context sensitive interface

Definition at line 889 of file ControlBar.h.

◆ m_defaultControlBarPosition

ICoord2D ControlBar::m_defaultControlBarPosition
protected

Stored the original position of the control bar on the screen.

Definition at line 878 of file ControlBar.h.

◆ m_displayedConstructPercent

Real ControlBar::m_displayedConstructPercent
protected

construct percent last displayed to user

Definition at line 894 of file ControlBar.h.

◆ m_displayedOCLTimerSeconds

UnsignedInt ControlBar::m_displayedOCLTimerSeconds
protected

OCL Timer seconds remaining last displayed to user.

Definition at line 895 of file ControlBar.h.

◆ m_displayedQueueCount

UnsignedInt ControlBar::m_displayedQueueCount
protected

queue count last displayed to user

Definition at line 896 of file ControlBar.h.

◆ m_flash

Bool ControlBar::m_flash
protected

tells update whether or not to check for flash

Definition at line 955 of file ControlBar.h.

◆ m_generalsScreenAnimate

AnimateWindowManager* ControlBar::m_generalsScreenAnimate

The animate window manager.

Definition at line 736 of file ControlBar.h.

◆ m_isObserverCommandBar

Bool ControlBar::m_isObserverCommandBar
protected

If this is true, the command bar behaves greatly differnt.

Definition at line 967 of file ControlBar.h.

◆ m_lastRecordedInventoryCount

UnsignedInt ControlBar::m_lastRecordedInventoryCount
protected

last known UI state of an inventory count

Definition at line 897 of file ControlBar.h.

◆ m_observerLookAtPlayer

Player* ControlBar::m_observerLookAtPlayer
protected

The current player we're looking at, Null if we're not looking at anyone.

Definition at line 968 of file ControlBar.h.

◆ m_queueData

QueueEntry ControlBar::m_queueData[MAX_BUILD_QUEUE_BUTTONS]
protected

what the build queue represents

Definition at line 952 of file ControlBar.h.

◆ m_rallyPointDrawableID

DrawableID ControlBar::m_rallyPointDrawableID
protected

rally point drawable for visual rally point

Definition at line 892 of file ControlBar.h.

◆ m_rightHUDCameoWindow

GameWindow* ControlBar::m_rightHUDCameoWindow
protected

window of the right HUD display

Definition at line 900 of file ControlBar.h.

◆ m_rightHUDUnitSelectParent

GameWindow* ControlBar::m_rightHUDUnitSelectParent
protected

Definition at line 902 of file ControlBar.h.

◆ m_rightHUDUpgradeCameos

GameWindow* ControlBar::m_rightHUDUpgradeCameos[MAX_RIGHT_HUD_UPGRADE_CAMEOS]
protected

Definition at line 901 of file ControlBar.h.

◆ m_rightHUDWindow

GameWindow* ControlBar::m_rightHUDWindow
protected

window of the right HUD display

Definition at line 899 of file ControlBar.h.

◆ m_scienceLayout

WindowLayout* ControlBar::m_scienceLayout
protected

the Science window layout

Definition at line 906 of file ControlBar.h.

◆ m_sciencePurchaseWindowsRank1

GameWindow* ControlBar::m_sciencePurchaseWindowsRank1[MAX_PURCHASE_SCIENCE_RANK_1]
protected

command window controls for easy access

Definition at line 907 of file ControlBar.h.

◆ m_sciencePurchaseWindowsRank3

GameWindow* ControlBar::m_sciencePurchaseWindowsRank3[MAX_PURCHASE_SCIENCE_RANK_3]
protected

command window controls for easy access

Definition at line 908 of file ControlBar.h.

◆ m_sciencePurchaseWindowsRank8

GameWindow* ControlBar::m_sciencePurchaseWindowsRank8[MAX_PURCHASE_SCIENCE_RANK_8]
protected

command window controls for easy access

Definition at line 909 of file ControlBar.h.

◆ m_shortcutDisplayStrings

DisplayString* ControlBar::m_shortcutDisplayStrings[MAX_SPECIAL_POWER_SHORTCUTS]
protected

Definition at line 912 of file ControlBar.h.

◆ m_showBuildToolTipLayout

Bool ControlBar::m_showBuildToolTipLayout
protected

every frame we test to see if we aregoing to continue showing this or not.

Definition at line 971 of file ControlBar.h.

◆ m_sideSelectAnimateDown

Bool ControlBar::m_sideSelectAnimateDown
protected

Definition at line 957 of file ControlBar.h.

◆ m_specialPowerLayout

WindowLayout* ControlBar::m_specialPowerLayout
protected

Definition at line 916 of file ControlBar.h.

◆ m_specialPowerShortcutButtonParents

GameWindow* ControlBar::m_specialPowerShortcutButtonParents[MAX_SPECIAL_POWER_SHORTCUTS]
protected

Definition at line 911 of file ControlBar.h.

◆ m_specialPowerShortcutButtons

GameWindow* ControlBar::m_specialPowerShortcutButtons[MAX_SPECIAL_POWER_SHORTCUTS]
protected

Definition at line 910 of file ControlBar.h.

◆ m_specialPowerShortcutParent

GameWindow* ControlBar::m_specialPowerShortcutParent
protected

Definition at line 917 of file ControlBar.h.

◆ m_UIDirty

Bool ControlBar::m_UIDirty
protected

the context UI must be re-evaluated

Definition at line 881 of file ControlBar.h.

◆ m_videoManager

WindowVideoManager* ControlBar::m_videoManager

Video manager to take care of all animations on screen.

Definition at line 732 of file ControlBar.h.


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