ScummVM API documentation
Ultima::Ultima3::Views::MenuChoice Class Reference

#include <menu_input.h>

Public Member Functions

void setup (const char *keys, const char *const *words, int count, int col, int row)
 
void reset ()
 
bool hasChoice () const
 
const char * word () const
 
int index () const
 
char key () const
 
bool handleKey (const KeypressMessage &msg)
 
void draw (GfxSurface &s, bool active) const
 

Detailed Description

A menu prompt. Pressing one of the option keys only echoes the matching word; it then has to be confirmed with Enter, or taken back with Backspace or Left. Anything else is rejected with a beep.

Member Function Documentation

◆ setup()

void Ultima::Ultima3::Views::MenuChoice::setup ( const char *  keys,
const char *const *  words,
int  count,
int  col,
int  row 
)

Sets up the prompt. The word at each index is echoed for the key at the same index; the Escape key is represented in the keys by 0x1B

◆ hasChoice()

bool Ultima::Ultima3::Views::MenuChoice::hasChoice ( ) const
inline

Returns true if a choice has been echoed and is awaiting confirmation

◆ word()

const char * Ultima::Ultima3::Views::MenuChoice::word ( ) const
inline

Returns the word of the option currently echoed

◆ index()

int Ultima::Ultima3::Views::MenuChoice::index ( ) const
inline

Returns the number of the option currently echoed

◆ key()

char Ultima::Ultima3::Views::MenuChoice::key ( ) const
inline

Returns the key of the choice made

◆ handleKey()

bool Ultima::Ultima3::Views::MenuChoice::handleKey ( const KeypressMessage &  msg)

Handles a keypress, returning true once a choice has been confirmed

◆ draw()

void Ultima::Ultima3::Views::MenuChoice::draw ( GfxSurface &  s,
bool  active 
) const

Draws the echoed word, and the cursor if the prompt is still active


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