ScummVM API documentation
Macs2::View1 Class Reference
Inheritance diagram for Macs2::View1:
Macs2::UIElement

Classes

struct  BorderStyle
 
struct  OverlayTextEntry
 

Public Types

enum  UiPanelState : uint16 {
  kUiPanelNone = 0 , kUiPanelActionBar = 1 , kUiPanelInventory = 2 , kUiPanelContainerInventory = 3 ,
  kUiPanelSaveLoad = 4
}
 
enum  PendingPanelRequest : uint16 {
  kPanelRequestNone = 0 , kPanelRequestInventory = 1 , kPanelRequestContainerInventory = 2 , kPanelRequestSaveLoad = 3 ,
  kPanelRequestSaveLoadActive = 4
}
 
enum class  InventoryButtonIndex {
  Look = 0 , Hand = 1 , Up = 2 , Down = 3 ,
  Drop = 4 , Close = 5
}
 
enum class  MainMenuButtonIndex {
  Talk = 0 , Look = 1 , Use = 2 , Walk = 3 ,
  Inventory = 4 , InventoryUse = 5 , Map = 6 , SaveLoad = 7 ,
  Close = 8
}
 

Public Member Functions

bool hasPersistentActionBar () const
 
bool shouldShowActionBar () const
 
void ensureActionBar ()
 
int actionBarTopY () const
 
bool isHelpButtonDisabled () const
 
void restoreUiPaletteEntries ()
 
void clearClickedButtonIndex ()
 
AnimFrame * getInventoryIcon (GameObject *gameObject)
 
void flushPendingCharacterDeletes ()
 
void transferPickupTarget (GameObject *targetObject)
 
void finishPanelCloseAfterRelease (UiPanelState closedFromState)
 
void drawPathfindingPoints (Graphics::ManagedSurface &s)
 
void drawDebugOutput (Graphics::ManagedSurface &s)
 
void drawPath (Graphics::ManagedSurface &s)
 
void setInventorySource (GameObject *newInventorySource)
 
void refreshProtagonistInventoryAfterLoad (uint16 actorIndex)
 
void openInventory (GameObject *newInventorySource)
 
void closeInventory ()
 
bool isInventorySourceProtagonist () const
 
void transferInventoryItem (GameObject *item, GameObject *targetContainer)
 
Character * getCharacterByIndex (uint16 index) const
 
void rebuildCharacterLookupTable () const
 
int getCharacterArrayIndex (const Character *c) const
 
void updateCursor (const Graphics::Palette *palette=nullptr)
 
bool msgFocus (const FocusMessage &msg) override
 
bool msgKeypress (const KeypressMessage &msg) override
 
bool msgAction (const ActionMessage &msg) override
 
bool msgMouseDown (const MouseDownMessage &msg) override
 
bool msgMouseUp (const MouseUpMessage &msg) override
 
bool msgMouseMove (const MouseMoveMessage &msg) override
 
void draw () override
 
bool tick () override
 
void drawInventory (Graphics::ManagedSurface &s)
 
GameObject * getClickedInventoryItem (const Common::Point &p)
 
void openMainMenu (Common::Point clickedPosition)
 
void openScriptActionBar (const Common::Point &position, Script::MouseMode restoreCursorMode)
 
void closeScriptActionBar (Script::MouseMode &outSavedCursorMode)
 
void enterMapMode ()
 
void layoutActionBarButtons ()
 
void drawMainMenu (Graphics::ManagedSurface &s)
 
void drawSceneUpdate ()
 
void drawSceneFrame (bool fullUpdate)
 
void handleTextBoxInput ()
 
void dismissDialoguePanel ()
 
bool handleDialogueChoiceClick (int clickY, int clickX)
 
void startFading (uint16 speed=4)
 
void fadePaletteToBlack (uint16 speed, const Graphics::Palette &sourcePalette)
 
void startFadeToBlack (uint16 speed=4)
 
void startFadingWithSpeed (uint16 speed)
 
void instantSceneCut ()
 
void presentFrame ()
 
void showSpeechAct (uint16 characterIndex, const Common::Array< Common::String > &strings, const Common::Point &position, bool onRightSide=false)
 
void drawNinePatchBorder (const Common::Point &pos, const Common::Point &size, const BorderStyle &style, bool fillCenter, bool fillSides, Graphics::ManagedSurface &s)
 
void drawBorder (const Common::Point &pos, const Common::Point &size, Graphics::ManagedSurface &s)
 
void drawBorderSide (const Common::Point &pos, const Common::Point &size, Graphics::ManagedSurface &s)
 
Macs2::AnimFrame * getUISprite (uint32 offset)
 
void drawHorizontalBorderHighlight (const Common::Point &pos, int16 width, uint32 spriteAddress, Graphics::ManagedSurface &s)
 
void drawVerticalBorderHighlight (const Common::Point &pos, int16 height, uint32 spriteAddress, Graphics::ManagedSurface &s)
 
void drawImageResources (Graphics::ManagedSurface &s)
 
void showDialogueChoice (uint16 speakerObjectID, const Common::Array< Common::StringArray > &choices, const Common::Point &position, bool onRightSide=false)
 
void triggerDialogueChoice (uint8 index)
 
void addOverlayTextEntry (const OverlayTextEntry &entry)
 
void clearOverlayTextEntries ()
 
void drawOverlayTextEntries ()
 
uint16 getHitObjectID (const Common::Point &pos) const
 
- Public Member Functions inherited from Macs2::UIElement
 UIElement (const Common::String &name, UIElement *uiParent)
 
 UIElement (const Common::String &name)
 
void redraw ()
 
Graphics::ManagedSurface getSurface () const
 
virtual void draw ()
 
virtual bool tick ()
 
virtual UIElement * findView (const Common::String &name)
 

Public Attributes

ScalingValues _scalingValues
 
ViewMode _currentMode = ViewMode::VM_GAME
 
bool _paletteDirty = true
 
bool _isShowingTextBox = false
 
bool _isShowingDialoguePanel = false
 
bool _continueScriptAfterUI = false
 
Common::StringArray _drawnStringBox
 
uint16 _dialogueChoiceCount = 0
 
Common::Array< uint16 > _dialogueChoiceLineCounts
 
SpeechActData _currentSpeechActData
 
Graphics::ManagedSurface _backgroundSurface
 
bool _started = false
 
bool _autoclickActive = false
 
Common::Array< Character * > _characters
 
Common::Array< Character * > _pendingCharacterDeletes
 
GameObject * _inventorySource = nullptr
 
Common::Array< GameObject * > _inventoryItems
 
GameObject * _activeInventoryItem = nullptr
 
Common::Point _stringBoxPosition
 
UiPanelState _uiPanelState = kUiPanelNone
 
PendingPanelRequest _pendingPanelRequest = kPanelRequestNone
 
bool _uiBackgroundRestorePending = false
 
bool _isDialogueChoiceInputActive = false
 
Script::MouseMode _savedCursorMode = Script::MouseMode::Walk
 
uint16 _hoverAreaId = 0
 
uint16 _hoverHotspotId = 0
 
Common::Array< OverlayTextEntry > _overlayTextEntries
 

Static Public Attributes

static const BorderStyle kBorderRaised
 
static const BorderStyle kBorderPressed
 

Additional Inherited Members

- Protected Member Functions inherited from Macs2::UIElement
virtual bool msgFocus (const FocusMessage &e)
 
virtual bool msgUnfocus (const UnfocusMessage &e)
 
virtual bool msgKeypress (const KeypressMessage &e)
 
virtual bool msgMouseDown (const MouseDownMessage &e)
 
virtual bool msgMouseUp (const MouseUpMessage &e)
 
virtual bool msgAction (const ActionMessage &e)
 
virtual bool msgMouseMove (const MouseMoveMessage &e)
 
- Protected Attributes inherited from Macs2::UIElement
Common::Array< UIElement * > _children
 
Common::Rect _innerBounds
 
Bounds _bounds
 
bool _needsRedraw = true
 
Common::String _name
 

Member Function Documentation

◆ actionBarTopY()

int Macs2::View1::actionBarTopY ( ) const

Top Y of the persistent action bar (game area ends here when shown).

◆ msgFocus()

bool Macs2::View1::msgFocus ( const FocusMessage &  msg)
overridevirtual

Reimplemented from Macs2::UIElement.

◆ msgKeypress()

bool Macs2::View1::msgKeypress ( const KeypressMessage &  msg)
overridevirtual

Reimplemented from Macs2::UIElement.

◆ msgAction()

bool Macs2::View1::msgAction ( const ActionMessage &  msg)
overridevirtual

Reimplemented from Macs2::UIElement.

◆ msgMouseDown()

bool Macs2::View1::msgMouseDown ( const MouseDownMessage &  msg)
overridevirtual

Reimplemented from Macs2::UIElement.

◆ msgMouseUp()

bool Macs2::View1::msgMouseUp ( const MouseUpMessage &  msg)
overridevirtual

Reimplemented from Macs2::UIElement.

◆ msgMouseMove()

bool Macs2::View1::msgMouseMove ( const MouseMoveMessage &  msg)
overridevirtual

Reimplemented from Macs2::UIElement.

◆ draw()

void Macs2::View1::draw ( )
overridevirtual

Draws the element

Reimplemented from Macs2::UIElement.

◆ tick()

bool Macs2::View1::tick ( )
overridevirtual

Called for game frame ticks

Reimplemented from Macs2::UIElement.

◆ openScriptActionBar()

void Macs2::View1::openScriptActionBar ( const Common::Point &  position,
Script::MouseMode  restoreCursorMode 
)

Script-driven action bar open; restores the given cursor after opening.

◆ closeScriptActionBar()

void Macs2::View1::closeScriptActionBar ( Script::MouseMode &  outSavedCursorMode)

Script-driven action bar close; writes the cursor mode that was active.


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