ScummVM API documentation
MM::Xeen::ButtonContainer Class Reference
Inheritance diagram for MM::Xeen::ButtonContainer:
MM::Xeen::Cutscenes MM::Xeen::Awards MM::Xeen::CantCast MM::Xeen::CastSpell MM::Xeen::CharacterInfo MM::Xeen::Choose123 MM::Xeen::Confirm MM::Xeen::ControlPanel MM::Xeen::CreateCharacterDialog MM::Xeen::CreditsScreen MM::Xeen::DetectMonsters MM::Xeen::DifficultyDialog MM::Xeen::Dismiss MM::Xeen::ExchangeDialog MM::Xeen::HowMuch MM::Xeen::IdentifyMonster MM::Xeen::InfoDialog MM::Xeen::Input MM::Xeen::Interface MM::Xeen::ItemsDialog MM::Xeen::ItemSelectionDialog MM::Xeen::LloydsBeacon MM::Xeen::Locations::BaseLocation MM::Xeen::MapDialog MM::Xeen::MessageDialog MM::Xeen::NotWhileEngaged MM::Xeen::PartyDialog MM::Xeen::Quests MM::Xeen::QuickFight MM::Xeen::QuickReferenceDialog MM::Xeen::SelectElement MM::Xeen::SettingsBaseDialog MM::Xeen::SpellOnWho MM::Xeen::SpellsDialog MM::Xeen::SwordsOfXeen::MainMenu MM::Xeen::Teleport MM::Xeen::TownPortal MM::Xeen::WhoWill MM::Xeen::WorldOfXeen::MenuContainerDialog MM::Xeen::YesNo

Public Member Functions

 ButtonContainer (XeenEngine *vm)
 
void saveButtons ()
 
void clearButtons ()
 
void restoreButtons ()
 
void addButton (const Common::Rect &bounds, int val, SpriteResource *sprites=nullptr, uint8 ttsIndex=UINT8_MAX)
 
void addButton (const Common::Rect &bounds, int val, int frameNum, SpriteResource *sprites=nullptr, uint8 ttsIndex=UINT8_MAX)
 
void addPartyButtons (XeenEngine *vm)
 
void drawButtons (XSurface *surface)
 
void clearEvents ()
 
void checkHoverOverButton ()
 

Protected Member Functions

bool checkEvents (XeenEngine *vm)
 
bool doScroll (bool rollUp, bool fadeIn) override
 
void loadStrings (const Common::Path &name)
 
void loadStrings (const Common::Path &name, int ccMode)
 
void setWaitBounds ()
 
Common::String getNextTextSection (const Common::String &text, uint &index, uint count, const char *separator) const
 
Common::String getNextTextSection (const Common::String &text, uint &index, uint count) const
 
Common::String getNextTextSection (const Common::String &text, uint &index) const
 
Common::String addNextTextToButtons (const Common::String &text, uint &index)
 
Common::String addNextTextToButtons (const Common::String &text, uint &index, uint count)
 
void setButtonTexts (const Common::String &text)
 
void disableButtonVoicing (uint startIndex, uint endIndex)
 
void enableButtonVoicing (uint startIndex, uint endIndex)
 
- Protected Member Functions inherited from MM::Xeen::Cutscenes
 Cutscenes (XeenEngine *vm)
 
uint getSpeakingFrame (uint minFrame, uint maxFrame)
 

Protected Attributes

Common::Array< UIButton_buttons
 
Common::StringArray _textStrings
 
Common::Rect _waitBounds
 
int _buttonValue
 
Common::StringArray _buttonTexts
 
int _previousButton
 
- Protected Attributes inherited from MM::Xeen::Cutscenes
XeenEngine_vm
 

Member Function Documentation

◆ doScroll()

bool MM::Xeen::ButtonContainer::doScroll ( bool  rollUp,
bool  fadeIn 
)
overrideprotectedvirtual

Draws the scroll in the background

Parameters
rollUpIf true, rolls up the scroll. If false, unrolls.
fadeInIf true, does an initial fade in
Returns
True if key or mouse pressed

Reimplemented from MM::Xeen::Cutscenes.

◆ loadStrings() [1/2]

void MM::Xeen::ButtonContainer::loadStrings ( const Common::Path name)
protected

Load a set of text strings from the given resource

Parameters
nameName of resource containing strings

◆ loadStrings() [2/2]

void MM::Xeen::ButtonContainer::loadStrings ( const Common::Path name,
int  ccMode 
)
protected

Load a set of text strings from the given resource

Parameters
nameName of resource containing strings
ccModeOptional cc file number to explicitly use

◆ setWaitBounds()

void MM::Xeen::ButtonContainer::setWaitBounds ( )
protected

Sets the wait bounds, the area where clicking with the mouse generates the equivalent of a space bar press, to the main interface area

◆ getNextTextSection() [1/3]

Common::String MM::Xeen::ButtonContainer::getNextTextSection ( const Common::String text,
uint &  index,
uint  count,
const char *  separator 
) const
protected

Reads one or more sections of text, then combines them

Parameters
textText to take the sections from. Each section should be separated by one or more newlines
indexStarting index, which is moved to the start of the following section, or npos if no sections remain
countHow many sections to read
separatorWhat to separate sections with
Returns
The text sections combined, each separated by the separator

◆ getNextTextSection() [2/3]

Common::String MM::Xeen::ButtonContainer::getNextTextSection ( const Common::String text,
uint &  index,
uint  count 
) const
protected

Reads one or more sections of text, then combines them. Newlines are kept intact

Parameters
textText to take the sections from. Each section should be separated by one or more newlines
indexStarting index, which is moved to the start of the following section, or npos if no sections remain
countHow many sections to read
Returns
The text sections combined

◆ getNextTextSection() [3/3]

Common::String MM::Xeen::ButtonContainer::getNextTextSection ( const Common::String text,
uint &  index 
) const
protected

Reads one section of text

Parameters
textText to take the section from. Each section should be separated by one or more newlines
indexStarting index, which is moved to the start of the following section, or npos if no sections remain
Returns
The text section

◆ addNextTextToButtons() [1/2]

Common::String MM::Xeen::ButtonContainer::addNextTextToButtons ( const Common::String text,
uint &  index 
)
protected

Reads one section of text and adds it to the button texts

Parameters
textText to take the section from. Each section should be separated by one or more newlines
indexStarting index, which is moved to the start of the following section, or npos if no sections remain
Returns
The text section

◆ addNextTextToButtons() [2/2]

Common::String MM::Xeen::ButtonContainer::addNextTextToButtons ( const Common::String text,
uint &  index,
uint  count 
)
protected

Reads one or more sections of text and adds them to the button texts

Parameters
textText to take the sections from. Each section should be separated by one or more newlines
indexStarting index, which is moved to the start of the following section, or npos if no sections remain
countHow many sections to read
Returns
The text sections combined

◆ setButtonTexts()

void MM::Xeen::ButtonContainer::setButtonTexts ( const Common::String text)
protected

Sets the text of each button for use by TTS

Parameters
textText for buttons. Each button's text should be separated by newlines

◆ disableButtonVoicing()

void MM::Xeen::ButtonContainer::disableButtonVoicing ( uint  startIndex,
uint  endIndex 
)
protected

Disables the voicing of buttons from the start index to the end index

Parameters
startIndexStarting index
endIndexEnding index

◆ enableButtonVoicing()

void MM::Xeen::ButtonContainer::enableButtonVoicing ( uint  startIndex,
uint  endIndex 
)
protected

Enables the voicing of buttons from the start index to the end index

Parameters
startIndexStarting index
endIndexEnding index

◆ saveButtons()

void MM::Xeen::ButtonContainer::saveButtons ( )

Saves the current list of buttons

◆ drawButtons()

void MM::Xeen::ButtonContainer::drawButtons ( XSurface surface)

Draws the buttons onto the passed surface

◆ clearEvents()

void MM::Xeen::ButtonContainer::clearEvents ( )
inline

Clears any currently set button value

◆ checkHoverOverButton()

void MM::Xeen::ButtonContainer::checkHoverOverButton ( )

Checks if a button is being hovered over and voices its text with TTS, if there is text


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