ScummVM API documentation
Stark::UserInterface Class Reference

#include <userinterface.h>

Public Member Functions

 UserInterface (StarkEngine *vm, Gfx::Driver *gfx)
 
void init ()
 
void onGameLoop ()
 
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::Path &name)
 
void onFMVStopped ()
 
bool skipFMV ()
 
void changeScreen (Screen::Name screenName)
 
void backPrevScreen ()
 
void doQueuedScreenChange ()
 
void requestQuitToMainMenu ()
 
void restoreScreenHistory ()
 
bool isInGameScreen () const
 
bool isInSaveLoadMenuScreen () const
 
bool isInDiaryIndexScreen () const
 
bool isInventoryOpen () const
 
bool isInteractive () const
 
void setInteractive (bool interactive)
 
void notifyInventoryItemEnabled (uint16 itemIndex)
 
void notifyDiaryEntryEnabled ()
 
int16 getSelectedInventoryItem () const
 
void selectInventoryItem (int16 itemIndex)
 
void clearLocationDependentState ()
 
void optionsOpen ()
 
void markInteractionDenied ()
 
bool wasInteractionDenied () const
 
void onScreenChanged ()
 
void saveGameScreenThumbnail ()
 
void freeGameScreenThumbnail ()
 
const Graphics::SurfacegetGameWindowThumbnail () const
 
template<class T >
void confirm (const Common::String &message, T *instance, void(T::*confirmCallBack)())
 
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)
 
bool hasToggleSubtitleRequest ()
 
void performToggleSubtitle ()
 
void handleActions (Common::CustomEventType customType)
 
void handleKeyPress (const Common::KeyState &keyState)
 

Detailed Description

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

Member Function Documentation

◆ onGameLoop()

void Stark::UserInterface::onGameLoop ( )

Called once per game loop.

◆ requestFMVPlayback()

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

Start playing a FMV

◆ onFMVStopped()

void Stark::UserInterface::onFMVStopped ( )

FMV playback has just ended

◆ skipFMV()

bool Stark::UserInterface::skipFMV ( )

Abort the currently playing FMV, if any

Returns
true if a FMV was skipped

◆ changeScreen()

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

Set the currently displayed screen

◆ backPrevScreen()

void Stark::UserInterface::backPrevScreen ( )

Back to the previous displayed screen

◆ doQueuedScreenChange()

void Stark::UserInterface::doQueuedScreenChange ( )

Apply the scheduled screen change if any

◆ requestQuitToMainMenu()

void Stark::UserInterface::requestQuitToMainMenu ( )
inline

Back to the main menu screen and rest resources

◆ restoreScreenHistory()

void Stark::UserInterface::restoreScreenHistory ( )

Restore the screen travelling history to the initial state

◆ isInGameScreen()

bool Stark::UserInterface::isInGameScreen ( ) const

Is the game screen currently displayed?

◆ isInSaveLoadMenuScreen()

bool Stark::UserInterface::isInSaveLoadMenuScreen ( ) const

Is the save & load menu screen currently displayed?

◆ isInDiaryIndexScreen()

bool Stark::UserInterface::isInDiaryIndexScreen ( ) const

Is the diary index screen currently displayed?

◆ isInventoryOpen()

bool Stark::UserInterface::isInventoryOpen ( ) const

Is the inventory panel being displayed?

◆ isInteractive()

bool Stark::UserInterface::isInteractive ( ) const

Can the player interact with the game world?

◆ setInteractive()

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

Allow or forbid interaction with the game world

◆ notifyInventoryItemEnabled()

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

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

◆ notifyDiaryEntryEnabled()

void Stark::UserInterface::notifyDiaryEntryEnabled ( )

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

◆ getSelectedInventoryItem()

int16 Stark::UserInterface::getSelectedInventoryItem ( ) const

Access the selected inventory item

◆ clearLocationDependentState()

void Stark::UserInterface::clearLocationDependentState ( )

Clears all the pointers to data that may be location dependent

◆ optionsOpen()

void Stark::UserInterface::optionsOpen ( )

Open the in game options menu

◆ markInteractionDenied()

void Stark::UserInterface::markInteractionDenied ( )

Signal a denied interaction that occurred during a non interactive period

◆ wasInteractionDenied()

bool Stark::UserInterface::wasInteractionDenied ( ) const

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

◆ onScreenChanged()

void Stark::UserInterface::onScreenChanged ( )

The screen resolution just changed, rebuild resolution dependent data

◆ saveGameScreenThumbnail()

void Stark::UserInterface::saveGameScreenThumbnail ( )

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

◆ freeGameScreenThumbnail()

void Stark::UserInterface::freeGameScreenThumbnail ( )

Clear the currently stored game screen thumbnail, if any

◆ getGameWindowThumbnail()

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

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

◆ confirm()

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.

◆ toggleScreen()

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

Directly open or close a screen

◆ hasToggleSubtitleRequest()

bool Stark::UserInterface::hasToggleSubtitleRequest ( )
inline

Toggle subtitles on and off

◆ handleActions()

void Stark::UserInterface::handleActions ( Common::CustomEventType  customType)

Perform an action after a keypress


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