OpenMW
Public Types | Public Member Functions | Private Member Functions | Private Attributes
MWGui::WindowManager Class Reference

#include <windowmanagerimp.hpp>

List of all members.

Public Types

typedef std::pair< std::string,
int > 
Faction
typedef std::vector< FactionFactionList

Public Member Functions

 WindowManager (const Compiler::Extensions &extensions, int fpsLevel, OEngine::Render::OgreRenderer *mOgre, const std::string &logpath, const std::string &cacheDir, bool consoleOnlyScripts, Translation::Storage &translationDataStorage, ToUTF8::FromType encoding)
virtual ~WindowManager ()
void initUI ()
void renderWorldMap ()
virtual Loading::ListenergetLoadingScreen ()
virtual void update ()
virtual void setKeyFocusWidget (MyGUI::Widget *widget)
virtual void setNewGame (bool newgame)
virtual void pushGuiMode (GuiMode mode)
virtual void popGuiMode ()
virtual void removeGuiMode (GuiMode mode)
 can be anywhere in the stack
virtual GuiMode getMode () const
virtual bool containsMode (GuiMode mode) const
virtual bool isGuiMode () const
virtual bool isConsoleMode () const
virtual void toggleVisible (GuiWindow wnd)
virtual void forceHide (MWGui::GuiWindow wnd)
virtual void unsetForceHide (MWGui::GuiWindow wnd)
virtual void disallowAll ()
 Disallow all inventory mode windows.
virtual void allow (GuiWindow wnd)
 Allow one or more windows.
virtual bool isAllowed (GuiWindow wnd) const
virtual MWGui::DialogueWindowgetDialogueWindow ()
virtual MWGui::ContainerWindowgetContainerWindow ()
virtual MWGui::InventoryWindowgetInventoryWindow ()
virtual MWGui::BookWindowgetBookWindow ()
virtual MWGui::ScrollWindowgetScrollWindow ()
virtual MWGui::CountDialoggetCountDialog ()
virtual MWGui::ConfirmationDialoggetConfirmationDialog ()
virtual MWGui::TradeWindowgetTradeWindow ()
virtual MWGui::SpellBuyingWindowgetSpellBuyingWindow ()
virtual MWGui::TravelWindowgetTravelWindow ()
virtual MWGui::SpellWindowgetSpellWindow ()
virtual MWGui::ConsolegetConsole ()
virtual MyGUI::Gui * getGui () const
virtual void wmUpdateFps (float fps, unsigned int triangleCount, unsigned int batchCount)
 Set value for the given ID.
virtual void setValue (const std::string &id, const MWMechanics::Stat< int > &value)
 Set value for the given ID.
virtual void setValue (int parSkill, const MWMechanics::Stat< float > &value)
virtual void setValue (const std::string &id, const MWMechanics::DynamicStat< float > &value)
virtual void setValue (const std::string &id, const std::string &value)
virtual void setValue (const std::string &id, int value)
virtual void setDrowningTimeLeft (float time)
virtual void setPlayerClass (const ESM::Class &class_)
 set current class of player
virtual void configureSkills (const SkillList &major, const SkillList &minor)
 configure skill groups, each set contains the skill ID for that group.
virtual void setReputation (int reputation)
 set the current reputation value
virtual void setBounty (int bounty)
 set the current bounty value
virtual void updateSkillArea ()
 update display of skills, factions, birth sign, reputation and bounty
virtual void changeCell (MWWorld::CellStore *cell)
 change the active cell
virtual void setPlayerPos (const float x, const float y)
 set player position in map space
virtual void setPlayerDir (const float x, const float y)
 set player view direction in map space
virtual void setFocusObject (const MWWorld::Ptr &focus)
virtual void setFocusObjectScreenCoords (float min_x, float min_y, float max_x, float max_y)
virtual void getMousePosition (int &x, int &y)
virtual void getMousePosition (float &x, float &y)
virtual void setDragDrop (bool dragDrop)
virtual bool getWorldMouseOver ()
virtual void toggleFogOfWar ()
virtual void toggleFullHelp ()
 show extra info in item tooltips (owner, script)
virtual bool getFullHelp () const
virtual void setInteriorMapTexture (const int x, const int y)
 set the index of the map texture that should be used (for interiors)
virtual void setDrowningBarVisibility (bool visible)
 sets the visibility of the drowning bar
virtual void setHMSVisibility (bool visible)
 sets the visibility of the hud health/magicka/stamina bars
virtual void setMinimapVisibility (bool visible)
 sets the visibility of the hud minimap
virtual void setWeaponVisibility (bool visible)
virtual void setSpellVisibility (bool visible)
virtual void setSneakVisibility (bool visible)
virtual void activateQuickKey (int index)
virtual std::string getSelectedSpell ()
virtual void setSelectedSpell (const std::string &spellId, int successChancePercent)
virtual void setSelectedEnchantItem (const MWWorld::Ptr &item)
virtual void setSelectedWeapon (const MWWorld::Ptr &item)
virtual void unsetSelectedSpell ()
virtual void unsetSelectedWeapon ()
virtual void showCrosshair (bool show)
virtual bool getSubtitlesEnabled ()
virtual void toggleHud ()
virtual void disallowMouse ()
virtual void allowMouse ()
virtual void notifyInputActionBound ()
virtual void addVisitedLocation (const std::string &name, int x, int y)
virtual void removeDialog (OEngine::GUI::Layout *dialog)
 Hides dialog and schedules dialog to be deleted.
virtual void messageBox (const std::string &message, const std::vector< std::string > &buttons=std::vector< std::string >(), bool showInDialogueModeOnly=false)
virtual void staticMessageBox (const std::string &message)
virtual void removeStaticMessageBox ()
virtual void enterPressed ()
virtual void activateKeyPressed ()
virtual int readPressedButton ()
 returns the index of the pressed button or -1 if no button was pressed (->MessageBoxmanager->InteractiveMessageBox)
virtual void onFrame (float frameDuration)
virtual std::map< int,
MWMechanics::Stat< float > > 
getPlayerSkillValues ()
virtual std::map< int,
MWMechanics::Stat< int > > 
getPlayerAttributeValues ()
virtual SkillList getPlayerMinorSkills ()
virtual SkillList getPlayerMajorSkills ()
virtual std::string getGameSettingString (const std::string &id, const std::string &default_)
virtual void processChangedSettings (const Settings::CategorySettingVector &changed)
virtual void windowResized (int x, int y)
virtual void executeInConsole (const std::string &path)
virtual void enableRest ()
virtual bool getRestEnabled ()
virtual bool getJournalAllowed ()
virtual bool getPlayerSleeping ()
virtual void wakeUpPlayer ()
virtual void updatePlayer ()
virtual void showCompanionWindow (MWWorld::Ptr actor)
virtual void startSpellMaking (MWWorld::Ptr actor)
virtual void startEnchanting (MWWorld::Ptr actor)
virtual void startSelfEnchanting (MWWorld::Ptr soulgem)
virtual void startTraining (MWWorld::Ptr actor)
virtual void startRepair (MWWorld::Ptr actor)
virtual void startRepairItem (MWWorld::Ptr item)
virtual void startRecharge (MWWorld::Ptr soulgem)
virtual void frameStarted (float dt)
virtual void showSoulgemDialog (MWWorld::Ptr item)
virtual void changePointer (const std::string &name)
virtual void setEnemy (const MWWorld::Ptr &enemy)
virtual const
Translation::Storage
getTranslationDataStorage () const
void onSoulgemDialogButtonPressed (int button)
virtual bool getCursorVisible ()
 Should the cursor be visible?

Private Member Functions

void trackWindow (OEngine::GUI::Layout *layout, const std::string &name)
void onWindowChangeCoord (MyGUI::Window *_sender)
void setCursorVisible (bool visible)
void cleanupGarbage ()
void updateVisible ()
void onRetrieveTag (const MyGUI::UString &_tag, MyGUI::UString &_result)
void onCursorChange (const std::string &name)
void onKeyFocusChanged (MyGUI::Widget *widget)

Private Attributes

bool mConsoleOnlyScripts
std::map< MyGUI::Window
*, std::string > 
mTrackedWindows
std::string mSelectedSpell
OEngine::GUI::MyGUIManagermGuiManager
OEngine::Render::OgreRenderermRendering
HUDmHud
MapWindowmMap
MainMenumMenu
ToolTipsmToolTips
StatsWindowmStatsWindow
MessageBoxManagermMessageBoxManager
ConsolemConsole
JournalWindowmJournal
DialogueWindowmDialogueWindow
ContainerWindowmContainerWindow
DragAndDropmDragAndDrop
InventoryWindowmInventoryWindow
ScrollWindowmScrollWindow
BookWindowmBookWindow
CountDialogmCountDialog
TradeWindowmTradeWindow
SpellBuyingWindowmSpellBuyingWindow
TravelWindowmTravelWindow
SettingsWindowmSettingsWindow
ConfirmationDialogmConfirmationDialog
AlchemyWindowmAlchemyWindow
SpellWindowmSpellWindow
QuickKeysMenumQuickKeysMenu
LoadingScreenmLoadingScreen
LevelupDialogmLevelupDialog
WaitDialogmWaitDialog
SpellCreationDialogmSpellCreationDialog
EnchantingDialogmEnchantingDialog
TrainingWindowmTrainingWindow
MerchantRepairmMerchantRepair
SoulgemDialogmSoulgemDialog
RepairmRepair
RechargemRecharge
CompanionWindowmCompanionWindow
Translation::StoragemTranslationDataStorage
Cursor * mSoftwareCursor
CharacterCreationmCharGen
MyGUI::Widget * mInputBlocker
bool mCrosshairEnabled
bool mSubtitlesEnabled
bool mHudEnabled
bool mCursorVisible
std::string mPlayerName
std::string mPlayerRaceId
std::map< int,
MWMechanics::Stat< int > > 
mPlayerAttributes
SkillList mPlayerMajorSkills
SkillList mPlayerMinorSkills
std::map< int,
MWMechanics::Stat< float > > 
mPlayerSkillValues
MyGUI::Gui * mGui
std::vector< GuiModemGuiModes
SFO::CursorManager * mCursorManager
std::vector
< OEngine::GUI::Layout * > 
mGarbageDialogs
GuiWindow mShown
GuiWindow mForceHidden
GuiWindow mAllowed
bool mRestAllowed
int mShowFPSLevel
float mFPS
unsigned int mTriangleCount
unsigned int mBatchCount

Member Typedef Documentation

typedef std::pair<std::string, int> MWGui::WindowManager::Faction

Constructor & Destructor Documentation

MWGui::WindowManager::WindowManager ( const Compiler::Extensions extensions,
int  fpsLevel,
OEngine::Render::OgreRenderer mOgre,
const std::string &  logpath,
const std::string &  cacheDir,
bool  consoleOnlyScripts,
Translation::Storage translationDataStorage,
ToUTF8::FromType  encoding 
)

Reimplemented from MWBase::WindowManager.


Member Function Documentation

Implements MWBase::WindowManager.

void MWGui::WindowManager::activateQuickKey ( int  index) [virtual]

Implements MWBase::WindowManager.

void MWGui::WindowManager::addVisitedLocation ( const std::string &  name,
int  x,
int  y 
) [virtual]

Implements MWBase::WindowManager.

void MWGui::WindowManager::allow ( GuiWindow  wnd) [virtual]

Allow one or more windows.

Implements MWBase::WindowManager.

Implements MWBase::WindowManager.

change the active cell

Implements MWBase::WindowManager.

void MWGui::WindowManager::changePointer ( const std::string &  name) [virtual]

Implements MWBase::WindowManager.

void MWGui::WindowManager::configureSkills ( const SkillList major,
const SkillList minor 
) [virtual]

configure skill groups, each set contains the skill ID for that group.

Implements MWBase::WindowManager.

bool MWGui::WindowManager::containsMode ( GuiMode  mode) const [virtual]

Implements MWBase::WindowManager.

Disallow all inventory mode windows.

Implements MWBase::WindowManager.

Implements MWBase::WindowManager.

virtual void MWGui::WindowManager::enableRest ( ) [inline, virtual]

Implements MWBase::WindowManager.

Implements MWBase::WindowManager.

void MWGui::WindowManager::executeInConsole ( const std::string &  path) [virtual]

Implements MWBase::WindowManager.

Implements MWBase::WindowManager.

void MWGui::WindowManager::frameStarted ( float  dt) [virtual]

Implements MWBase::WindowManager.

Implements MWBase::WindowManager.

Implements MWBase::WindowManager.

Implements MWBase::WindowManager.

Implements MWBase::WindowManager.

Implements MWBase::WindowManager.

Should the cursor be visible?

Implements MWBase::WindowManager.

Todo:
investigate, if we really need to expose every single lousy UI element to the outside world

Implements MWBase::WindowManager.

bool MWGui::WindowManager::getFullHelp ( ) const [virtual]

Implements MWBase::WindowManager.

std::string MWGui::WindowManager::getGameSettingString ( const std::string &  id,
const std::string &  default_ 
) [virtual]

Fetches a GMST string from the store, if there is no setting with the given ID or it is not a string the default string is returned.

Parameters:
idIdentifier for the GMST setting, e.g. "aName"
defaultDefault value if the GMST setting cannot be used.

Implements MWBase::WindowManager.

MyGUI::Gui * MWGui::WindowManager::getGui ( ) const [virtual]

Implements MWBase::WindowManager.

Implements MWBase::WindowManager.

virtual bool MWGui::WindowManager::getJournalAllowed ( ) [inline, virtual]

Implements MWBase::WindowManager.

Implements MWBase::WindowManager.

Implements MWBase::WindowManager.

void MWGui::WindowManager::getMousePosition ( int &  x,
int &  y 
) [virtual]

Implements MWBase::WindowManager.

void MWGui::WindowManager::getMousePosition ( float &  x,
float &  y 
) [virtual]

Implements MWBase::WindowManager.

Implements MWBase::WindowManager.

Implements MWBase::WindowManager.

Implements MWBase::WindowManager.

std::map< int, MWMechanics::Stat< float > > MWGui::WindowManager::getPlayerSkillValues ( ) [virtual]
Todo:
get rid of this stuff. Move it to the respective UI element classes, if needed.

Implements MWBase::WindowManager.

Implements MWBase::WindowManager.

Implements MWBase::WindowManager.

Implements MWBase::WindowManager.

virtual std::string MWGui::WindowManager::getSelectedSpell ( ) [inline, virtual]

Implements MWBase::WindowManager.

Implements MWBase::WindowManager.

Implements MWBase::WindowManager.

Implements MWBase::WindowManager.

Implements MWBase::WindowManager.

Implements MWBase::WindowManager.

Implements MWBase::WindowManager.

Implements MWBase::WindowManager.

bool MWGui::WindowManager::isAllowed ( GuiWindow  wnd) const [virtual]

Implements MWBase::WindowManager.

bool MWGui::WindowManager::isConsoleMode ( ) const [virtual]

Implements MWBase::WindowManager.

bool MWGui::WindowManager::isGuiMode ( ) const [virtual]

Implements MWBase::WindowManager.

void MWGui::WindowManager::messageBox ( const std::string &  message,
const std::vector< std::string > &  buttons = std::vector<std::string>(),
bool  showInDialogueModeOnly = false 
) [virtual]

Implements MWBase::WindowManager.

Implements MWBase::WindowManager.

void MWGui::WindowManager::onCursorChange ( const std::string &  name) [private]
void MWGui::WindowManager::onFrame ( float  frameDuration) [virtual]

Implements MWBase::WindowManager.

void MWGui::WindowManager::onKeyFocusChanged ( MyGUI::Widget *  widget) [private]
void MWGui::WindowManager::onRetrieveTag ( const MyGUI::UString &  _tag,
MyGUI::UString &  _result 
) [private]

Called when MyGUI tries to retrieve a tag. This usually corresponds to a GMST string, so this method will retrieve the GMST with the name _tag and place the result in _result

void MWGui::WindowManager::onWindowChangeCoord ( MyGUI::Window *  _sender) [private]

Implements MWBase::WindowManager.

Implements MWBase::WindowManager.

void MWGui::WindowManager::pushGuiMode ( GuiMode  mode) [virtual]

Implements MWBase::WindowManager.

returns the index of the pressed button or -1 if no button was pressed (->MessageBoxmanager->InteractiveMessageBox)

Implements MWBase::WindowManager.

Hides dialog and schedules dialog to be deleted.

Implements MWBase::WindowManager.

void MWGui::WindowManager::removeGuiMode ( GuiMode  mode) [virtual]

can be anywhere in the stack

Implements MWBase::WindowManager.

Implements MWBase::WindowManager.

void MWGui::WindowManager::setBounty ( int  bounty) [virtual]

set the current bounty value

Implements MWBase::WindowManager.

void MWGui::WindowManager::setCursorVisible ( bool  visible) [private, virtual]

Implements MWBase::WindowManager.

void MWGui::WindowManager::setDragDrop ( bool  dragDrop) [virtual]

Implements MWBase::WindowManager.

void MWGui::WindowManager::setDrowningBarVisibility ( bool  visible) [virtual]

sets the visibility of the drowning bar

Implements MWBase::WindowManager.

void MWGui::WindowManager::setDrowningTimeLeft ( float  time) [virtual]

Set time left for the player to start drowning (update the drowning bar)

Parameters:
timevalue from [0,20]

Implements MWBase::WindowManager.

void MWGui::WindowManager::setEnemy ( const MWWorld::Ptr enemy) [virtual]

Implements MWBase::WindowManager.

void MWGui::WindowManager::setFocusObject ( const MWWorld::Ptr focus) [virtual]

Implements MWBase::WindowManager.

void MWGui::WindowManager::setFocusObjectScreenCoords ( float  min_x,
float  min_y,
float  max_x,
float  max_y 
) [virtual]

Implements MWBase::WindowManager.

void MWGui::WindowManager::setHMSVisibility ( bool  visible) [virtual]

sets the visibility of the hud health/magicka/stamina bars

Implements MWBase::WindowManager.

void MWGui::WindowManager::setInteriorMapTexture ( const int  x,
const int  y 
) [virtual]

set the index of the map texture that should be used (for interiors)

Implements MWBase::WindowManager.

void MWGui::WindowManager::setKeyFocusWidget ( MyGUI::Widget *  widget) [virtual]

Implements MWBase::WindowManager.

void MWGui::WindowManager::setMinimapVisibility ( bool  visible) [virtual]

sets the visibility of the hud minimap

Implements MWBase::WindowManager.

void MWGui::WindowManager::setNewGame ( bool  newgame) [virtual]

Implements MWBase::WindowManager.

void MWGui::WindowManager::setPlayerClass ( const ESM::Class class_) [virtual]

set current class of player

Implements MWBase::WindowManager.

void MWGui::WindowManager::setPlayerDir ( const float  x,
const float  y 
) [virtual]

set player view direction in map space

Implements MWBase::WindowManager.

void MWGui::WindowManager::setPlayerPos ( const float  x,
const float  y 
) [virtual]

set player position in map space

Implements MWBase::WindowManager.

void MWGui::WindowManager::setReputation ( int  reputation) [virtual]

set the current reputation value

Implements MWBase::WindowManager.

Implements MWBase::WindowManager.

void MWGui::WindowManager::setSelectedSpell ( const std::string &  spellId,
int  successChancePercent 
) [virtual]

Implements MWBase::WindowManager.

void MWGui::WindowManager::setSelectedWeapon ( const MWWorld::Ptr item) [virtual]

Implements MWBase::WindowManager.

void MWGui::WindowManager::setSneakVisibility ( bool  visible) [virtual]

Implements MWBase::WindowManager.

void MWGui::WindowManager::setSpellVisibility ( bool  visible) [virtual]

Implements MWBase::WindowManager.

void MWGui::WindowManager::setValue ( const std::string &  id,
const MWMechanics::Stat< int > &  value 
) [virtual]

Set value for the given ID.

Implements MWBase::WindowManager.

void MWGui::WindowManager::setValue ( int  parSkill,
const MWMechanics::Stat< float > &  value 
) [virtual]
Todo:
Don't use the skill enum as a parameter type (we will have to drop it anyway, once we allow custom skills.

Implements MWBase::WindowManager.

void MWGui::WindowManager::setValue ( const std::string &  id,
const MWMechanics::DynamicStat< float > &  value 
) [virtual]

Implements MWBase::WindowManager.

void MWGui::WindowManager::setValue ( const std::string &  id,
const std::string &  value 
) [virtual]

Implements MWBase::WindowManager.

void MWGui::WindowManager::setValue ( const std::string &  id,
int  value 
) [virtual]

Implements MWBase::WindowManager.

void MWGui::WindowManager::setWeaponVisibility ( bool  visible) [virtual]

Implements MWBase::WindowManager.

Implements MWBase::WindowManager.

void MWGui::WindowManager::showCrosshair ( bool  show) [virtual]

Implements MWBase::WindowManager.

Implements MWBase::WindowManager.

Implements MWBase::WindowManager.

Implements MWBase::WindowManager.

Implements MWBase::WindowManager.

Implements MWBase::WindowManager.

Implements MWBase::WindowManager.

Implements MWBase::WindowManager.

Implements MWBase::WindowManager.

void MWGui::WindowManager::staticMessageBox ( const std::string &  message) [virtual]

Implements MWBase::WindowManager.

Implements MWBase::WindowManager.

show extra info in item tooltips (owner, script)

Implements MWBase::WindowManager.

void MWGui::WindowManager::toggleHud ( ) [virtual]

Implements MWBase::WindowManager.

Implements MWBase::WindowManager.

void MWGui::WindowManager::trackWindow ( OEngine::GUI::Layout layout,
const std::string &  name 
) [private]

Implements MWBase::WindowManager.

Implements MWBase::WindowManager.

Implements MWBase::WindowManager.

void MWGui::WindowManager::update ( ) [virtual]

Should be called each frame to update windows/gui elements. This could mean updating sizes of gui elements or opening new dialogs.

Implements MWBase::WindowManager.

Implements MWBase::WindowManager.

update display of skills, factions, birth sign, reputation and bounty

Implements MWBase::WindowManager.

Implements MWBase::WindowManager.

void MWGui::WindowManager::windowResized ( int  x,
int  y 
) [virtual]

Implements MWBase::WindowManager.

void MWGui::WindowManager::wmUpdateFps ( float  fps,
unsigned int  triangleCount,
unsigned int  batchCount 
) [virtual]

Set value for the given ID.

Implements MWBase::WindowManager.


Member Data Documentation

unsigned int MWGui::WindowManager::mBatchCount [private]
SFO::CursorManager* MWGui::WindowManager::mCursorManager [private]
float MWGui::WindowManager::mFPS [private]
MyGUI::Gui* MWGui::WindowManager::mGui [private]
std::vector<GuiMode> MWGui::WindowManager::mGuiModes [private]
MyGUI::Widget* MWGui::WindowManager::mInputBlocker [private]
std::string MWGui::WindowManager::mPlayerName [private]
Todo:
get rid of this stuff. Move it to the respective UI element classes, if needed.
std::string MWGui::WindowManager::mPlayerRaceId [private]
std::string MWGui::WindowManager::mSelectedSpell [private]
std::map<MyGUI::Window*, std::string> MWGui::WindowManager::mTrackedWindows [private]
unsigned int MWGui::WindowManager::mTriangleCount [private]

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