#include <events.h>
Public Member Functions | |
Events (bool enhancedMode) | |
void | runGame () |
void | replaceView (UIElement *ui, bool replaceAllViews=false) |
void | replaceView (const Common::String &name, bool replaceAllViews=false) |
void | addView (UIElement *ui) |
void | addView (const Common::String &name) |
void | clearViews () |
void | popView () |
void | redrawViews () |
UIElement * | focusedView () const |
UIElement * | priorView () const |
bool | isPresent (const Common::String &name) const |
bool | isInCombat () const |
Graphics::Screen * | getScreen () const |
void | drawElements () |
void | addKeypress (const Common::KeyCode kc) |
void | addAction (KeybindingAction action) |
bool | isKeypressPending () const |
void | draw () override |
bool | tick () override |
void | close () override |
Public Member Functions inherited from MM::MM1::UIElement | |
UIElement (const Common::String &name, UIElement *uiParent) | |
bool | needsRedraw () const |
void | redraw () |
void | focus () |
bool | isFocused () const |
void | replaceView (UIElement *ui, bool replaceAllViews=false) |
void | replaceView (const Common::String &name, bool replaceAllViews=false) |
void | addView (UIElement *ui) |
void | addView (const Common::String &name) |
void | addView () |
void | open () |
int | getRandomNumber (int minNumber, int maxNumber) |
int | getRandomNumber (int maxNumber) |
Common::String | getName () const |
virtual void | setBounds (const Common::Rect &r) |
Common::Rect | getBounds () const |
Graphics::ManagedSurface | getSurface () const |
virtual void | clearSurface () |
virtual UIElement * | findView (const Common::String &name) |
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 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 HeaderMessage &msg) |
bool | send (const HeaderMessage &msg) |
bool | send (const Common::String &viewName, const InfoMessage &msg) |
bool | send (const InfoMessage &msg) |
bool | send (const Common::String &viewName, const DrawGraphicMessage &msg) |
bool | send (const DrawGraphicMessage &msg) |
Public Member Functions inherited from MM::MM1::Mouse | |
void | loadCursors () |
void | setCursor (int cursorId) |
void | showCursor () |
void | hideCursor () |
bool | isCursorVisible () const |
Protected Member Functions | |
void | processEvent (Common::Event &ev) |
virtual bool | shouldQuit () const =0 |
bool | msgAction (const ActionMessage &e) override |
bool | msgFocus (const FocusMessage &e) override |
bool | msgUnfocus (const UnfocusMessage &e) override |
bool | msgKeypress (const KeypressMessage &e) override |
bool | msgMouseDown (const MouseDownMessage &e) override |
bool | msgMouseUp (const MouseUpMessage &e) override |
bool | msgDrawGraphic (const DrawGraphicMessage &e) override |
Protected Member Functions inherited from MM::MM1::UIElement | |
Common::Rect | getLineBounds (int line1, int line2) const |
void | delaySeconds (uint seconds) |
void | delayFrames (uint frames) |
bool | isDelayActive () const |
void | cancelDelay () |
bool | endDelay () |
virtual void | timeout () |
virtual bool | msgGame (const GameMessage &e) |
virtual bool | msgHeader (const HeaderMessage &e) |
virtual bool | msgInfo (const InfoMessage &e) |
Additional Inherited Members | |
Protected Attributes inherited from MM::MM1::UIElement | |
UIElement * | _parent |
Common::Array< UIElement * > | _children |
Common::Rect | _innerBounds |
Bounds | _bounds |
bool | _needsRedraw = true |
Common::String | _name |
Main events and view manager
|
protected |
Process an event
|
protectedpure virtual |
Returns true if the game should quit
Implemented in MM::MM1::MM1Engine.
void MM::MM1::Events::runGame | ( | ) |
Main game loop
void MM::MM1::Events::replaceView | ( | UIElement * | ui, |
bool | replaceAllViews = false |
||
) |
Sets the focus to a new view
void MM::MM1::Events::addView | ( | UIElement * | ui | ) |
Adds a focused view to the view stack without replacing current one
void MM::MM1::Events::clearViews | ( | ) |
Clears the view list
void MM::MM1::Events::popView | ( | ) |
Pops a view from the view stack
void MM::MM1::Events::redrawViews | ( | ) |
Redraws the views in order. This is used in rare cases where a view draws outside it's defined area, and needs to restore whether the background was before
|
inline |
Returns the currently focused view, if any
|
inline |
Returns the view prior to the current view, if any
bool MM::MM1::Events::isPresent | ( | const Common::String & | name | ) | const |
Returns true if a view of a given name is present at all in the visible view stack
|
inline |
Returns true if combat is active
void MM::MM1::Events::addKeypress | ( | const Common::KeyCode | kc | ) |
Add a keypress to the event queue
void MM::MM1::Events::addAction | ( | KeybindingAction | action | ) |
Add a action to the event queue
bool MM::MM1::Events::isKeypressPending | ( | ) | const |
Checks whether a keypress is pending
|
inlineoverridevirtual |
Draws the element
Reimplemented from MM::MM1::UIElement.
|
inlineoverridevirtual |
Called for game frame ticks
Reimplemented from MM::MM1::UIElement.
|
inlineoverridevirtual |
Calling the close method for g_events closes the active window
Reimplemented from MM::MM1::UIElement.