ScummVM API documentation
Ultima::Ultima3::Views::Game Class Referenceabstract

#include <game.h>

Inheritance diagram for Ultima::Ultima3::Views::Game:
Ultima::Shared::View Graphics::Views::View Graphics::Views::UIElement Ultima::Ultima3::Views::CombatMap Ultima::Ultima3::Views::DungeonMap Ultima::Ultima3::Views::LocationMap

Public Member Functions

void cancelInteraction ()
 
 Game (const Common::String &name)
 
bool isEndgame () const
 
bool msgFocus (const FocusMessage &msg) override
 
bool msgKeypress (const KeypressMessage &msg) override
 
void draw () override
 
void timeout () override
 
- Public Member Functions inherited from Ultima::Shared::View
 View (const Common::String &name, Graphics::Views::UIElement *uiParent)
 
 View (const Common::String &name)
 
Graphics::Views::GfxSurface getSurface (bool innerBounds=false) const
 
- Public Member Functions inherited from Graphics::Views::View
 View (const Common::String &name, UIElement *uiParent)
 
 View (const Common::String &name)
 
bool msgFocus (const FocusMessage &msg) override
 
bool msgUnfocus (const UnfocusMessage &msg) override
 
bool msgMouseMove (const MouseMoveMessage &msg) override
 
bool msgMouseDown (const MouseDownMessage &msg) override
 
bool msgMouseUp (const MouseUpMessage &msg) override
 
- Public Member Functions inherited from Graphics::Views::UIElement
 UIElement (const Common::String &name, UIElement *uiParent)
 
 UIElement (const Common::String &name)
 
bool needsRedraw () const
 
void redraw ()
 
virtual void close ()
 
virtual void replaceView (UIElement *ui, bool replaceAllViews=false)
 
virtual void replaceView (const Common::String &name, bool replaceAllViews=false)
 
virtual void addView (UIElement *ui)
 
virtual void addView (const Common::String &name)
 
void addView ()
 
void open ()
 
int getRandomNumber (int minNumber, int maxNumber)
 
int getRandomNumber (int maxNumber)
 
virtual void setBounds (const Common::Rect &r)
 
Common::Rect getBounds () const
 
const Common::String & getName () const
 
GfxSurface getSurface (bool innerBounds=false) const
 
virtual void draw ()
 
virtual bool tick ()
 
virtual UIElement * findView (const Common::String &name)
 
bool send (const MouseMoveMessage &msg)
 
bool send (const Common::String &viewName, const FocusMessage &msg)
 
bool send (const FocusMessage &msg)
 
bool send (const Common::String &viewName, const UnfocusMessage &msg)
 
bool send (const UnfocusMessage &msg)
 
bool send (const Common::String &viewName, const MouseEnterMessage &msg)
 
bool send (const MouseEnterMessage &msg)
 
bool send (const Common::String &viewName, const MouseLeaveMessage &msg)
 
bool send (const MouseLeaveMessage &msg)
 
bool send (const Common::String &viewName, const KeypressMessage &msg)
 
bool send (const KeypressMessage &msg)
 
bool send (const Common::String &viewName, const MouseDownMessage &msg)
 
bool send (const MouseDownMessage &msg)
 
bool send (const Common::String &viewName, const MouseUpMessage &msg)
 
bool send (const MouseUpMessage &msg)
 
bool send (const Common::String &viewName, const ActionMessage &msg)
 
bool send (const ActionMessage &msg)
 
bool send (const Common::String &viewName, const GameMessage &msg)
 
bool send (const GameMessage &msg)
 
bool send (const Common::String &viewName, const ValueMessage &msg)
 
bool send (const ValueMessage &msg)
 
template<class T >
bool send (const T &msg)
 
template<class T >
bool send (const Common::String &viewName, const T &msg)
 

Protected Member Functions

virtual void drawViewport (GfxSurface &s)=0
 
virtual void drawLabels (GfxSurface &s)
 
void drawMoons (GfxSurface &s)
 
bool hasInteraction () const
 
virtual void idleTimeout ()=0
 
virtual void endTurn ()=0
 
virtual byte musicLocation () const
 
virtual void processFrame ()
 
virtual bool isWaiting () const
 
virtual bool handleCommand (const KeypressMessage &msg)
 
void startInteraction (Interactions::Interaction *interaction)
 
void commandFailed (const char *text, byte sound=0xFE)
 
void startGame ()
 
void startPrompt ()
 
bool checkPartyWipedOut ()
 
- Protected Member Functions inherited from Graphics::Views::UIElement
void delaySeconds (uint seconds)
 
void delayFrames (uint frames)
 
bool isDelayActive () const
 
void cancelDelay ()
 
virtual void timeout ()
 
virtual bool msgMouseMove (const MouseMoveMessage &msg)
 
void stopTextToSpeech ()
 
virtual bool msgFocus (const FocusMessage &e)
 
virtual bool msgUnfocus (const UnfocusMessage &e)
 
virtual bool msgMouseEnter (const MouseEnterMessage &e)
 
virtual bool msgMouseLeave (const MouseLeaveMessage &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 msgGame (const GameMessage &e)
 
virtual bool msgValue (const ValueMessage &e)
 
virtual bool msgCustom (const Message &msg)
 

Protected Attributes

bool _gameOver = false
 
- Protected Attributes inherited from Graphics::Views::UIElement
UIElement * _parent
 
Common::Array< UIElement * > _children
 
Common::Rect _innerBounds
 
Bounds _bounds
 
bool _needsRedraw = true
 
Common::String _name
 
Common::String _previousSaid
 

Detailed Description

Base for the in-game screens. It draws the frame around the 11x11 tile viewport on the left, the party's status panels and the scrolling message window on the right, and runs the animation that goes on while waiting for a command. Derived views supply the contents of the viewport.

Member Function Documentation

◆ drawViewport()

virtual void Ultima::Ultima3::Views::Game::drawViewport ( GfxSurface &  s)
protectedpure virtual

◆ drawLabels()

virtual void Ultima::Ultima3::Views::Game::drawLabels ( GfxSurface &  s)
protectedvirtual

Draws the labels set in the frame, which are the wind by default

Reimplemented in Ultima::Ultima3::Views::DungeonMap.

◆ drawMoons()

void Ultima::Ultima3::Views::Game::drawMoons ( GfxSurface &  s)
protected

Draws the label giving the phases of the moons

◆ hasInteraction()

bool Ultima::Ultima3::Views::Game::hasInteraction ( ) const
inlineprotected

Returns true if a command is part way through being given

◆ idleTimeout()

virtual void Ultima::Ultima3::Views::Game::idleTimeout ( )
protectedpure virtual

Called when no command has been given for several seconds

Implemented in Ultima::Ultima3::Views::CombatMap, Ultima::Ultima3::Views::DungeonMap, and Ultima::Ultima3::Views::LocationMap.

◆ endTurn()

virtual void Ultima::Ultima3::Views::Game::endTurn ( )
protectedpure virtual

Carries out what happens once a command has taken a turn

Implemented in Ultima::Ultima3::Views::CombatMap, Ultima::Ultima3::Views::DungeonMap, and Ultima::Ultima3::Views::LocationMap.

◆ musicLocation()

virtual byte Ultima::Ultima3::Views::Game::musicLocation ( ) const
protectedvirtual

Returns the kind of place the party is in as far as the music goes

Reimplemented in Ultima::Ultima3::Views::CombatMap.

◆ processFrame()

virtual void Ultima::Ultima3::Views::Game::processFrame ( )
inlineprotectedvirtual

Called every frame, for anything the view has going on

Reimplemented in Ultima::Ultima3::Views::CombatMap, Ultima::Ultima3::Views::DungeonMap, and Ultima::Ultima3::Views::LocationMap.

◆ isWaiting()

virtual bool Ultima::Ultima3::Views::Game::isWaiting ( ) const
inlineprotectedvirtual

Returns true if the view is waiting for a command, rather than busy

Reimplemented in Ultima::Ultima3::Views::CombatMap, and Ultima::Ultima3::Views::LocationMap.

◆ handleCommand()

virtual bool Ultima::Ultima3::Views::Game::handleCommand ( const KeypressMessage &  msg)
protectedvirtual

Carries out the command for a key press, if it's one that works the same wherever the party is

Returns
True if the key was a command

Reimplemented in Ultima::Ultima3::Views::CombatMap, Ultima::Ultima3::Views::DungeonMap, and Ultima::Ultima3::Views::LocationMap.

◆ startInteraction()

void Ultima::Ultima3::Views::Game::startInteraction ( Interactions::Interaction *  interaction)
protected

Takes over the keyboard to finish a command that needs further input

◆ commandFailed()

void Ultima::Ultima3::Views::Game::commandFailed ( const char *  text,
byte  sound = 0xFE 
)
protected

Prints the error shown for a command that can't be used right now, and ends the turn

◆ startGame()

void Ultima::Ultima3::Views::Game::startGame ( )
protected

Resets the state for a new game

◆ startPrompt()

void Ultima::Ultima3::Views::Game::startPrompt ( )
protected

Prints the command prompt and restarts the wait for a command

◆ checkPartyWipedOut()

bool Ultima::Ultima3::Views::Game::checkPartyWipedOut ( )
protected

Ends the game if every party member is dead, showing why

Returns
True if the game is over

◆ cancelInteraction()

void Ultima::Ultima3::Views::Game::cancelInteraction ( )
inline

Gives up any command that's part way through being given

◆ isEndgame()

bool Ultima::Ultima3::Views::Game::isEndgame ( ) const
inline

Returns true once the game has been won, and what's left is the ending

◆ msgFocus()

bool Ultima::Ultima3::Views::Game::msgFocus ( const FocusMessage &  msg)
overridevirtual

Reimplemented from Graphics::Views::UIElement.

◆ msgKeypress()

bool Ultima::Ultima3::Views::Game::msgKeypress ( const KeypressMessage &  msg)
overridevirtual

Reimplemented from Graphics::Views::UIElement.

◆ draw()

void Ultima::Ultima3::Views::Game::draw ( )
overridevirtual

Draws the element

Reimplemented from Graphics::Views::UIElement.

◆ timeout()

void Ultima::Ultima3::Views::Game::timeout ( )
overridevirtual

Called when an active timeout countdown expired

Reimplemented from Graphics::Views::UIElement.


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