ScummVM API documentation
Ultima::Ultima2::Views::Map Class Referenceabstract

#include <map.h>

Inheritance diagram for Ultima::Ultima2::Views::Map:
Ultima::Shared::View Graphics::Views::View Graphics::Views::UIElement Ultima::Ultima2::Views::DungeonMap Ultima::Ultima2::Views::LocationMap Ultima::Ultima2::Views::OverworldMap

Public Member Functions

virtual void reloadTiles ()
 
 Map (const Common::String &name)
 
bool msgFocus (const FocusMessage &msg) override
 
bool msgAction (const ActionMessage &msg) override
 
bool msgKeypress (const KeypressMessage &msg) override
 
bool tick () 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 Graphics::Surface * tileGraphics ()=0
 
void checkIdle ()
 
void finishGraphics (Graphics::Views::GfxSurface &s)
 
void flashSprite (const Graphics::ManagedSurface &sprite, const Common::Point &pos)
 
- 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)
 

Additional Inherited Members

- 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 class for map views - forwards player input into the active Logic

Member Function Documentation

◆ tileGraphics()

virtual Graphics::Surface * Ultima::Ultima2::Views::Map::tileGraphics ( )
protectedpure virtual

Returns the view's TILE_COUNT tile graphics

Implemented in Ultima::Ultima2::Views::DungeonMap, Ultima::Ultima2::Views::LocationMap, and Ultima::Ultima2::Views::OverworldMap.

◆ checkIdle()

void Ultima::Ultima2::Views::Map::checkIdle ( )
protected

Passes the turn if no command has been given for a while

◆ finishGraphics()

void Ultima::Ultima2::Views::Map::finishGraphics ( Graphics::Views::GfxSurface &  s)
protected

Called at the end of draw() by views that draw CGA-indexed tiles: adds any sprite being flashed, then applies the composite renderer's decode if that's active

◆ flashSprite()

void Ultima::Ultima2::Views::Map::flashSprite ( const Graphics::ManagedSurface &  sprite,
const Common::Point &  pos 
)
protected

XOR-flashes a sprite on and then off again over the view, with a pause in between, as the original does for hit indicators. It's done by redrawing the view, rather than XORing onto the screen, since in the composite renderer the screen doesn't hold the CGA pixels

◆ reloadTiles()

virtual void Ultima::Ultima2::Views::Map::reloadTiles ( )
inlinevirtual

Re-reads whatever tile/sprite graphics this view uses for the current render mode. A no-op by default; overridden by subclasses that actually own tile surfaces (OverworldMap, LocationMap), since those are constructed once up front as part of Views::Views and so don't otherwise notice a render mode change made after the fact

◆ msgFocus()

bool Ultima::Ultima2::Views::Map::msgFocus ( const FocusMessage &  msg)
overridevirtual

Reimplemented from Graphics::Views::UIElement.

◆ msgAction()

bool Ultima::Ultima2::Views::Map::msgAction ( const ActionMessage &  msg)
overridevirtual

Reimplemented from Graphics::Views::UIElement.

◆ msgKeypress()

bool Ultima::Ultima2::Views::Map::msgKeypress ( const KeypressMessage &  msg)
overridevirtual

Reimplemented from Graphics::Views::UIElement.

◆ tick()

bool Ultima::Ultima2::Views::Map::tick ( )
overridevirtual

Called for game frame ticks

Reimplemented from Graphics::Views::UIElement.


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