ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

Facade object for interacting with the user interface from the rest of the engine. More...

#include <userinterface.h>

Collaboration diagram for Stark::UserInterface:

List of all members.

Public Member Functions

 UserInterface (Gfx::Driver *gfx)
virtual ~UserInterface ()
void init ()
void onGameLoop ()
 Called once per game loop.
void render ()
void handleMouseMove (const Common::Point &pos)
void handleMouseUp ()
void handleClick ()
void handleRightClick ()
void handleDoubleClick ()
void handleEscape ()
void notifyShouldExit ()
void inventoryOpen (bool open)
bool shouldExit ()
void requestFMVPlayback (const Common::String &name)
 Start playing a FMV.
void onFMVStopped ()
 FMV playback has just ended.
bool skipFMV ()
 Abort the currently playing FMV, if any.
void changeScreen (Screen::Name screenName)
 Set the currently displayed screen.
void backPrevScreen ()
 Back to the previous displayed screen.
void doQueuedScreenChange ()
 Apply the scheduled screen change if any.
void requestQuitToMainMenu ()
 Back to the main menu screen and rest resources.
void restoreScreenHistory ()
 Restore the screen travelling history to the initial state.
bool isInGameScreen () const
 Is the game screen currently displayed?
bool isInSaveLoadMenuScreen () const
 Is the save & load menu screen currently displayed?
bool isInDiaryIndexScreen () const
 Is the diary index screen currently displayed?
bool isInventoryOpen () const
 Is the inventory panel being displayed?
bool isInteractive () const
 Can the player interact with the game world?
void setInteractive (bool interactive)
 Allow or forbid interaction with the game world.
void notifyInventoryItemEnabled (uint16 itemIndex)
 A new item has been added to the player's inventory.
void notifyDiaryEntryEnabled ()
 A new entry has been added to the player's diary.
int16 getSelectedInventoryItem () const
 Access the selected inventory item.
void selectInventoryItem (int16 itemIndex)
void clearLocationDependentState ()
 Clears all the pointers to data that may be location dependent.
void optionsOpen ()
 Open the in game options menu.
void markInteractionDenied ()
 Signal a denied interaction that occurred during a non interactive period.
bool wasInteractionDenied () const
 Was a player interaction with the world denied during this non interactive period?
void onScreenChanged ()
 The screen resolution just changed, rebuild resolution dependent data.
void saveGameScreenThumbnail ()
 Grab a screenshot of the game screen and store it in the class context as a thumbnail.
void freeGameScreenThumbnail ()
 Clear the currently stored game screen thumbnail, if any.
const Graphics::SurfacegetGameWindowThumbnail () const
 Get the currently stored game screen thumbnail, returns nullptr if there is not thumbnail stored.
template<class T >
void confirm (const Common::String &message, T *instance, void(T::*confirmCallBack)())
 Display a confirmation dialog.
template<class T >
void confirm (GameMessage::TextKey key, T *instance, void(T::*confirmCallBack)())
void confirm (const Common::String &message, Common::Functor0< void > *confirmCallBack)
void confirm (GameMessage::TextKey key, Common::Functor0< void > *confirmCallBack)
void toggleScreen (Screen::Name screenName)
 Directly open or close a screen.
bool hasToggleSubtitleRequest ()
 Toggle subtitles on and off.
void performToggleSubtitle ()
void handleKeyPress (const Common::KeyState &keyState)
 Perform an action after a keypress.

Static Public Attributes

static const uint kThumbnailWidth = 160
static const uint kThumbnailHeight = 92
static const uint kThumbnailSize = kThumbnailWidth * kThumbnailHeight * 4

Private Member Functions

ScreengetScreenByName (Screen::Name screenName) const
void cycleInventory (bool forward)

Private Attributes

GameScreen_gameScreen
FMVScreen_fmvScreen
DiaryIndexScreen_diaryIndexScreen
MainMenuScreen_mainMenuScreen
SettingsMenuScreen_settingsMenuScreen
SaveMenuScreen_saveMenuScreen
LoadMenuScreen_loadMenuScreen
FMVMenuScreen_fmvMenuScreen
DiaryPagesScreen_diaryPagesScreen
DialogScreen_dialogScreen
Screen_currentScreen
Common::Stack< Screen::Name_prevScreenNameStack
DialogBox_modalDialog
Cursor_cursor
Gfx::Driver_gfx
bool _exitGame
bool _quitToMainMenu
bool _interactive
bool _interactionAttemptDenied
bool _shouldToggleSubtitle
bool _shouldGoBackToPreviousScreen
Common::String _shouldPlayFmv
Graphics::Surface_gameWindowThumbnail

Detailed Description

Facade object for interacting with the user interface from the rest of the engine.

Definition at line 66 of file userinterface.h.


Constructor & Destructor Documentation

Stark::UserInterface::UserInterface ( Gfx::Driver gfx  )  [explicit]

Definition at line 63 of file userinterface.cpp.

Stark::UserInterface::~UserInterface (  )  [virtual]

Definition at line 87 of file userinterface.cpp.


Member Function Documentation

void Stark::UserInterface::backPrevScreen (  ) 

Back to the previous displayed screen.

Definition at line 235 of file userinterface.cpp.

void Stark::UserInterface::changeScreen ( Screen::Name  screenName  ) 

Set the currently displayed screen.

Definition at line 224 of file userinterface.cpp.

void Stark::UserInterface::clearLocationDependentState (  ) 

Clears all the pointers to data that may be location dependent.

Definition at line 339 of file userinterface.cpp.

template<class T >
void Stark::UserInterface::confirm ( const Common::String message,
T *  instance,
void(T::*)()  confirmCallBack 
)

Display a confirmation dialog.

Close the dialog when the cancel button is pressed, call a callback when the confirm button is pressed.

Definition at line 237 of file userinterface.h.

template<class T >
void Stark::UserInterface::confirm ( GameMessage::TextKey  key,
T *  instance,
void(T::*)()  confirmCallBack 
)

Definition at line 232 of file userinterface.h.

void Stark::UserInterface::confirm ( const Common::String message,
Common::Functor0< void > *  confirmCallBack 
)

Definition at line 567 of file userinterface.cpp.

void Stark::UserInterface::confirm ( GameMessage::TextKey  key,
Common::Functor0< void > *  confirmCallBack 
)

Definition at line 574 of file userinterface.cpp.

void Stark::UserInterface::cycleInventory ( bool  forward  )  [private]

Definition at line 430 of file userinterface.cpp.

void Stark::UserInterface::doQueuedScreenChange (  ) 

Apply the scheduled screen change if any.

Definition at line 436 of file userinterface.cpp.

void Stark::UserInterface::freeGameScreenThumbnail (  ) 

Clear the currently stored game screen thumbnail, if any.

Definition at line 378 of file userinterface.cpp.

const Graphics::Surface * Stark::UserInterface::getGameWindowThumbnail (  )  const

Get the currently stored game screen thumbnail, returns nullptr if there is not thumbnail stored.

Definition at line 386 of file userinterface.cpp.

Screen * Stark::UserInterface::getScreenByName ( Screen::Name  screenName  )  const [private]

Definition at line 250 of file userinterface.cpp.

int16 Stark::UserInterface::getSelectedInventoryItem (  )  const

Access the selected inventory item.

Definition at line 204 of file userinterface.cpp.

void Stark::UserInterface::handleClick (  ) 

Definition at line 154 of file userinterface.cpp.

void Stark::UserInterface::handleDoubleClick (  ) 

Definition at line 170 of file userinterface.cpp.

void Stark::UserInterface::handleEscape (  ) 

Definition at line 178 of file userinterface.cpp.

void Stark::UserInterface::handleKeyPress ( const Common::KeyState keyState  ) 

Perform an action after a keypress.

Definition at line 458 of file userinterface.cpp.

void Stark::UserInterface::handleMouseMove ( const Common::Point pos  ) 

Definition at line 144 of file userinterface.cpp.

void Stark::UserInterface::handleMouseUp (  ) 

Definition at line 148 of file userinterface.cpp.

void Stark::UserInterface::handleRightClick (  ) 

Definition at line 162 of file userinterface.cpp.

bool Stark::UserInterface::hasToggleSubtitleRequest (  )  [inline]

Toggle subtitles on and off.

Definition at line 184 of file userinterface.h.

void Stark::UserInterface::init (  ) 

Definition at line 104 of file userinterface.cpp.

void Stark::UserInterface::inventoryOpen ( bool  open  ) 

Definition at line 195 of file userinterface.cpp.

bool Stark::UserInterface::isInDiaryIndexScreen (  )  const

Is the diary index screen currently displayed?

Definition at line 286 of file userinterface.cpp.

bool Stark::UserInterface::isInGameScreen (  )  const

Is the game screen currently displayed?

Definition at line 277 of file userinterface.cpp.

bool Stark::UserInterface::isInSaveLoadMenuScreen (  )  const

Is the save & load menu screen currently displayed?

Definition at line 281 of file userinterface.cpp.

bool Stark::UserInterface::isInteractive (  )  const

Can the player interact with the game world?

Definition at line 315 of file userinterface.cpp.

bool Stark::UserInterface::isInventoryOpen (  )  const

Is the inventory panel being displayed?

Definition at line 290 of file userinterface.cpp.

void Stark::UserInterface::markInteractionDenied (  ) 

Signal a denied interaction that occurred during a non interactive period.

Definition at line 329 of file userinterface.cpp.

void Stark::UserInterface::notifyDiaryEntryEnabled (  ) 

A new entry has been added to the player's diary.

Definition at line 406 of file userinterface.cpp.

void Stark::UserInterface::notifyInventoryItemEnabled ( uint16  itemIndex  ) 

A new item has been added to the player's inventory.

Definition at line 402 of file userinterface.cpp.

void Stark::UserInterface::notifyShouldExit (  )  [inline]

Definition at line 83 of file userinterface.h.

void Stark::UserInterface::onFMVStopped (  ) 

FMV playback has just ended.

Definition at line 220 of file userinterface.cpp.

void Stark::UserInterface::onGameLoop (  ) 

Called once per game loop.

Definition at line 126 of file userinterface.cpp.

void Stark::UserInterface::onScreenChanged (  ) 

The screen resolution just changed, rebuild resolution dependent data.

Definition at line 390 of file userinterface.cpp.

void Stark::UserInterface::optionsOpen (  ) 

Open the in game options menu.

Definition at line 343 of file userinterface.cpp.

void Stark::UserInterface::performToggleSubtitle (  ) 

Definition at line 425 of file userinterface.cpp.

void Stark::UserInterface::render (  ) 

Definition at line 302 of file userinterface.cpp.

void Stark::UserInterface::requestFMVPlayback ( const Common::String name  ) 

Start playing a FMV.

Definition at line 216 of file userinterface.cpp.

void Stark::UserInterface::requestQuitToMainMenu (  )  [inline]

Back to the main menu screen and rest resources.

Definition at line 110 of file userinterface.h.

void Stark::UserInterface::restoreScreenHistory (  ) 

Restore the screen travelling history to the initial state.

Definition at line 244 of file userinterface.cpp.

void Stark::UserInterface::saveGameScreenThumbnail (  ) 

Grab a screenshot of the game screen and store it in the class context as a thumbnail.

Definition at line 347 of file userinterface.cpp.

void Stark::UserInterface::selectInventoryItem ( int16  itemIndex  ) 

Definition at line 212 of file userinterface.cpp.

void Stark::UserInterface::setInteractive ( bool  interactive  ) 

Allow or forbid interaction with the game world.

Definition at line 319 of file userinterface.cpp.

bool Stark::UserInterface::shouldExit (  )  [inline]

Definition at line 85 of file userinterface.h.

bool Stark::UserInterface::skipFMV (  ) 

Abort the currently playing FMV, if any.

Returns:
true if a FMV was skipped

Definition at line 294 of file userinterface.cpp.

void Stark::UserInterface::toggleScreen ( Screen::Name  screenName  ) 

Directly open or close a screen.

Definition at line 410 of file userinterface.cpp.

bool Stark::UserInterface::wasInteractionDenied (  )  const

Was a player interaction with the world denied during this non interactive period?

Definition at line 335 of file userinterface.cpp.


Member Data Documentation

Definition at line 209 of file userinterface.h.

Definition at line 213 of file userinterface.h.

Definition at line 208 of file userinterface.h.

Definition at line 216 of file userinterface.h.

Definition at line 200 of file userinterface.h.

Definition at line 199 of file userinterface.h.

Definition at line 215 of file userinterface.h.

Definition at line 220 of file userinterface.h.

Definition at line 219 of file userinterface.h.

Definition at line 212 of file userinterface.h.

Definition at line 217 of file userinterface.h.

Definition at line 225 of file userinterface.h.

Definition at line 222 of file userinterface.h.

Definition at line 191 of file userinterface.h.

Definition at line 190 of file userinterface.h.


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


Generated on Sat Mar 16 2019 05:06:55 for ResidualVM by doxygen 1.7.1
curved edge   curved edge