2012-08-12 16:11:09 +00:00
# ifndef MWGUI_WINDOWMANAGERIMP_H
# define MWGUI_WINDOWMANAGERIMP_H
/**
This class owns and controls all the MW specific windows in the
GUI . It can enable / disable Gui mode , and is responsible for sending
and retrieving information from the Gui .
* */
2015-01-31 22:27:34 +00:00
# include <stack>
2017-02-14 02:55:29 +00:00
# include <osg/ref_ptr>
2012-08-12 16:11:09 +00:00
# include "../mwbase/windowmanager.hpp"
2020-04-16 13:31:20 +00:00
# include <components/sdlutil/events.hpp>
2015-01-31 22:27:34 +00:00
# include <components/settings/settings.hpp>
2015-02-09 15:23:41 +00:00
# include <components/to_utf8/to_utf8.hpp>
2015-01-31 22:27:34 +00:00
2014-08-17 03:45:35 +00:00
# include "mapwindow.hpp"
2020-06-05 14:22:53 +00:00
# include "statswatcher.hpp"
2017-07-24 11:25:01 +00:00
# include "textcolours.hpp"
2014-08-17 03:45:35 +00:00
2014-06-09 23:57:54 +00:00
# include <MyGUI_KeyCode.h>
# include <MyGUI_Types.h>
2012-08-12 16:11:09 +00:00
namespace MyGUI
{
class Gui ;
class Widget ;
2013-12-03 17:42:35 +00:00
class Window ;
2012-08-12 16:11:09 +00:00
class UString ;
2014-03-27 18:10:15 +00:00
class ImageBox ;
2012-08-12 16:11:09 +00:00
}
2015-12-09 00:06:53 +00:00
namespace MWWorld
{
class ESMStore ;
}
2012-08-12 16:11:09 +00:00
namespace Compiler
{
class Extensions ;
}
2012-12-26 16:06:33 +00:00
namespace Translation
{
class Storage ;
}
2015-04-24 19:55:30 +00:00
namespace osg
{
class Group ;
}
namespace osgViewer
{
class Viewer ;
}
namespace Resource
{
2015-04-30 23:15:25 +00:00
class ResourceSystem ;
2015-04-24 19:55:30 +00:00
}
2017-02-14 02:55:29 +00:00
namespace SceneUtil
{
class WorkQueue ;
}
2015-05-13 16:56:14 +00:00
namespace SDLUtil
2013-01-11 12:27:59 +00:00
{
2015-05-13 16:56:14 +00:00
class SDLCursorManager ;
2020-04-16 13:31:20 +00:00
class VideoWrapper ;
2013-01-11 12:27:59 +00:00
}
2015-04-30 23:15:25 +00:00
namespace osgMyGUI
{
class Platform ;
}
2015-04-30 23:41:33 +00:00
namespace Gui
{
class FontLoader ;
2020-11-14 18:13:16 +00:00
class VirtualKeyboardManager ;
2015-04-30 23:41:33 +00:00
}
2015-05-26 14:40:44 +00:00
namespace MWRender
{
class LocalMap ;
}
2020-10-27 19:45:41 +00:00
namespace MWVR
{
class VrMetaMenu ;
}
2012-08-12 16:11:09 +00:00
namespace MWGui
{
class WindowBase ;
class HUD ;
class MapWindow ;
class MainMenu ;
class StatsWindow ;
class InventoryWindow ;
2015-03-06 08:36:42 +00:00
struct JournalWindow ;
2012-08-12 16:11:09 +00:00
class CharacterCreation ;
class DragAndDrop ;
class ToolTips ;
class TextInputDialog ;
class InfoBoxDialog ;
class MessageBoxManager ;
class SettingsWindow ;
class AlchemyWindow ;
2012-08-26 08:52:06 +00:00
class QuickKeysMenu ;
2012-09-11 14:37:54 +00:00
class LoadingScreen ;
2012-09-14 17:44:00 +00:00
class LevelupDialog ;
2012-09-18 16:29:03 +00:00
class WaitDialog ;
2012-09-22 22:36:20 +00:00
class SpellCreationDialog ;
2012-09-27 06:47:47 +00:00
class EnchantingDialog ;
2012-10-17 16:03:02 +00:00
class TrainingWindow ;
2013-03-03 11:01:19 +00:00
class SpellIcons ;
2013-03-22 13:13:10 +00:00
class MerchantRepair ;
2013-03-30 14:51:07 +00:00
class SoulgemDialog ;
2013-11-19 05:48:47 +00:00
class Recharge ;
2013-03-31 11:13:46 +00:00
class CompanionWindow ;
2014-03-27 18:10:15 +00:00
class VideoWidget ;
2014-05-27 07:00:31 +00:00
class WindowModal ;
2014-08-01 14:25:41 +00:00
class ScreenFader ;
2014-09-28 15:57:14 +00:00
class DebugWindow ;
2015-02-07 03:05:28 +00:00
class JailScreen ;
2017-09-22 14:52:39 +00:00
class KeyboardNavigation ;
2012-08-12 16:11:09 +00:00
2020-04-16 13:31:20 +00:00
class WindowManager :
public MWBase : : WindowManager
2012-08-12 16:11:09 +00:00
{
public :
typedef std : : pair < std : : string , int > Faction ;
typedef std : : vector < Faction > FactionList ;
2020-04-16 13:31:20 +00:00
WindowManager ( SDL_Window * window , osgViewer : : Viewer * viewer , osg : : Group * guiRoot , Resource : : ResourceSystem * resourceSystem , SceneUtil : : WorkQueue * workQueue ,
2018-09-04 05:15:07 +00:00
const std : : string & logpath , const std : : string & cacheDir , bool consoleOnlyScripts , Translation : : Storage & translationDataStorage ,
2019-01-22 06:08:48 +00:00
ToUTF8 : : FromType encoding , bool exportFonts , const std : : string & versionDescription , const std : : string & localPath ) ;
2012-08-12 16:11:09 +00:00
virtual ~ WindowManager ( ) ;
2015-12-09 00:06:53 +00:00
/// Set the ESMStore to use for retrieving of GUI-related strings.
void setStore ( const MWWorld : : ESMStore & store ) ;
2013-08-27 13:48:13 +00:00
void initUI ( ) ;
2020-10-16 18:18:54 +00:00
void loadUserFonts ( ) override ;
2013-08-27 13:48:13 +00:00
2020-10-16 18:18:54 +00:00
Loading : : Listener * getLoadingScreen ( ) override ;
2013-08-27 13:48:13 +00:00
2014-03-27 18:10:15 +00:00
/// @note This method will block until the video finishes playing
/// (and will continually update the window while doing so)
2020-10-16 18:18:54 +00:00
void playVideo ( const std : : string & name , bool allowSkipping ) override ;
2020-11-14 18:13:16 +00:00
bool isPlayingVideo ( void ) const override ;
2014-03-27 18:10:15 +00:00
2019-06-08 23:08:09 +00:00
/// Warning: do not use MyGUI::InputManager::setKeyFocusWidget directly. Instead use this.
2020-10-16 18:18:54 +00:00
void setKeyFocusWidget ( MyGUI : : Widget * widget ) override ;
2019-06-08 23:08:09 +00:00
2020-10-16 18:18:54 +00:00
void setNewGame ( bool newgame ) override ;
2013-05-15 15:54:18 +00:00
2020-10-16 18:18:54 +00:00
void pushGuiMode ( GuiMode mode , const MWWorld : : Ptr & arg ) override ;
void pushGuiMode ( GuiMode mode ) override ;
void popGuiMode ( bool noSound = false ) override ;
void removeGuiMode ( GuiMode mode , bool noSound = false ) override ; ///< can be anywhere in the stack
2012-08-12 16:11:09 +00:00
2020-10-16 18:18:54 +00:00
void goToJail ( int days ) override ;
2015-02-07 03:05:28 +00:00
2020-10-16 18:18:54 +00:00
GuiMode getMode ( ) const override ;
bool containsMode ( GuiMode mode ) const override ;
2012-08-12 16:11:09 +00:00
2020-10-16 18:18:54 +00:00
bool isGuiMode ( ) const override ;
2012-08-12 16:11:09 +00:00
2020-10-16 18:18:54 +00:00
bool isConsoleMode ( ) const override ;
2013-03-18 20:33:12 +00:00
2020-10-16 18:18:54 +00:00
void toggleVisible ( GuiWindow wnd ) override ;
2012-08-12 16:11:09 +00:00
2020-10-16 18:18:54 +00:00
void forceHide ( MWGui : : GuiWindow wnd ) override ;
void unsetForceHide ( MWGui : : GuiWindow wnd ) override ;
2020-10-22 18:39:53 +00:00
DragAndDrop & getDragAndDrop ( void ) override ;
2014-05-27 03:13:37 +00:00
/// Disallow all inventory mode windows
2020-10-16 18:18:54 +00:00
void disallowAll ( ) override ;
2012-08-12 16:11:09 +00:00
2014-05-27 03:13:37 +00:00
/// Allow one or more windows
2020-10-16 18:18:54 +00:00
void allow ( GuiWindow wnd ) override ;
2012-08-12 16:11:09 +00:00
2020-10-16 18:18:54 +00:00
bool isAllowed ( GuiWindow wnd ) const override ;
2012-08-12 16:11:09 +00:00
/// \todo investigate, if we really need to expose every single lousy UI element to the outside world
2020-10-16 18:18:54 +00:00
MWGui : : InventoryWindow * getInventoryWindow ( ) override ;
MWGui : : CountDialog * getCountDialog ( ) override ;
MWGui : : ConfirmationDialog * getConfirmationDialog ( ) override ;
MWGui : : TradeWindow * getTradeWindow ( ) override ;
2015-03-11 19:04:25 +00:00
2018-03-24 07:00:15 +00:00
/*
Start of tes3mp addition
Make it possible to get the ContainerWindow from elsewhere
in the code
*/
virtual MWGui : : ContainerWindow * getContainerWindow ( ) ;
/*
End of tes3mp addition
*/
2020-10-26 17:48:40 +00:00
/*
Start of tes3mp addition
Make it possible to get the DialogueWindow from elsewhere
*/
virtual MWGui : : DialogueWindow * getDialogueWindow ( ) ;
/*
End of tes3mp addition
*/
2015-09-07 19:32:28 +00:00
/// Make the player use an item, while updating GUI state accordingly
2020-10-16 18:18:54 +00:00
void useItem ( const MWWorld : : Ptr & item , bool bypassBeastRestrictions = false ) override ;
2015-09-07 19:32:28 +00:00
2020-10-16 18:18:54 +00:00
void updateSpellWindow ( ) override ;
2015-03-11 19:04:25 +00:00
2020-10-16 18:18:54 +00:00
void setConsoleSelectedObject ( const MWWorld : : Ptr & object ) override ;
2012-08-12 16:11:09 +00:00
2017-12-26 13:04:28 +00:00
/*
Start of tes3mp addition
Allow the direct setting of a console ' s Ptr , without the assumption that an object
was clicked and that key focus should be restored to the console window , for console
commands executed via server scripts
*/
virtual void setConsolePtr ( const MWWorld : : Ptr & object ) ;
/*
End of tes3mp addition
*/
/*
Start of tes3mp addition
Allow the clearing of the console ' s Ptr from elsewhere in the code , so that
Ptrs used in console commands run from server scripts do not stay selected
*/
virtual void clearConsolePtr ( ) ;
/*
End of tes3mp addition
*/
2013-08-07 13:34:11 +00:00
/// Set time left for the player to start drowning (update the drowning bar)
2014-04-27 02:27:26 +00:00
/// @param time time left to start drowning
/// @param maxTime how long we can be underwater (in total) until drowning starts
2020-10-16 18:18:54 +00:00
void setDrowningTimeLeft ( float time , float maxTime ) override ;
2013-08-07 13:34:11 +00:00
2020-10-16 18:18:54 +00:00
void changeCell ( const MWWorld : : CellStore * cell ) override ; ///< change the active cell
2012-08-12 16:11:09 +00:00
2017-07-03 06:28:27 +00:00
/*
Start of tes3mp addition
2018-05-08 02:57:04 +00:00
Allow the setting of the image data for a global map tile from elsewhere
in the code
2017-07-03 06:28:27 +00:00
*/
2018-05-08 02:57:04 +00:00
virtual void setGlobalMapImage ( int cellX , int cellY , const std : : vector < char > & imageData ) ;
2017-07-03 06:28:27 +00:00
/*
End of tes3mp addition
*/
2020-10-16 18:18:54 +00:00
void setFocusObject ( const MWWorld : : Ptr & focus ) override ;
void setFocusObjectScreenCoords ( float min_x , float min_y , float max_x , float max_y ) override ;
2012-08-12 16:11:09 +00:00
2020-11-01 21:17:59 +00:00
void getMousePosition ( int & x , int & y ) override ;
void getMousePosition ( float & x , float & y ) override ;
2020-10-16 18:18:54 +00:00
void setDragDrop ( bool dragDrop ) override ;
2017-12-16 05:21:02 +00:00
/*
Start of tes3mp addition
Allow the completion of a drag and drop from elsewhere in the code
*/
virtual void finishDragDrop ( ) ;
/*
End of tes3mp addition
*/
2020-10-16 18:18:54 +00:00
bool getWorldMouseOver ( ) override ;
2012-08-12 16:11:09 +00:00
2021-04-15 11:14:41 +00:00
float getScalingFactor ( ) override ;
2020-10-16 18:18:54 +00:00
bool toggleFogOfWar ( ) override ;
bool toggleFullHelp ( ) override ; ///< show extra info in item tooltips (owner, script)
bool getFullHelp ( ) const override ;
2012-08-12 16:11:09 +00:00
2020-10-16 18:18:54 +00:00
void setActiveMap ( int x , int y , bool interior ) override ;
2014-05-11 00:27:43 +00:00
///< set the indices of the map texture that should be used
2012-08-12 16:11:09 +00:00
2013-08-07 13:34:11 +00:00
/// sets the visibility of the drowning bar
2020-10-16 18:18:54 +00:00
void setDrowningBarVisibility ( bool visible ) override ;
2013-08-07 13:34:11 +00:00
2012-08-12 16:11:09 +00:00
// sets the visibility of the hud health/magicka/stamina bars
2020-10-16 18:18:54 +00:00
void setHMSVisibility ( bool visible ) override ;
2012-08-12 16:11:09 +00:00
// sets the visibility of the hud minimap
2020-10-16 18:18:54 +00:00
void setMinimapVisibility ( bool visible ) override ;
void setWeaponVisibility ( bool visible ) override ;
void setSpellVisibility ( bool visible ) override ;
void setSneakVisibility ( bool visible ) override ;
2012-08-12 16:11:09 +00:00
2017-08-18 15:24:34 +00:00
/// activate selected quick key
2020-10-16 18:18:54 +00:00
void activateQuickKey ( int index ) override ;
2017-08-18 15:24:34 +00:00
/// update activated quick key state (if action executing was delayed for some reason)
2020-10-16 18:18:54 +00:00
void updateActivatedQuickKey ( ) override ;
2012-08-27 13:51:01 +00:00
2017-10-25 04:21:00 +00:00
/*
Start of tes3mp addition
Make it possible to add quickKeys from elsewhere in the code
*/
virtual void setQuickKey ( int slot , int quickKeyType , MWWorld : : Ptr item , const std : : string & spellId = " " ) ;
/*
End of tes3mp addition
*/
2020-10-16 18:18:54 +00:00
std : : string getSelectedSpell ( ) override { return mSelectedSpell ; }
void setSelectedSpell ( const std : : string & spellId , int successChancePercent ) override ;
void setSelectedEnchantItem ( const MWWorld : : Ptr & item ) override ;
const MWWorld : : Ptr & getSelectedEnchantItem ( ) const override ;
void setSelectedWeapon ( const MWWorld : : Ptr & item ) override ;
const MWWorld : : Ptr & getSelectedWeapon ( ) const override ;
int getFontHeight ( ) const override ;
void unsetSelectedSpell ( ) override ;
void unsetSelectedWeapon ( ) override ;
2012-08-12 16:11:09 +00:00
2020-10-16 18:18:54 +00:00
void updateConsoleObjectPtr ( const MWWorld : : Ptr & currentPtr , const MWWorld : : Ptr & newPtr ) override ;
2020-07-11 13:24:20 +00:00
2020-10-16 18:18:54 +00:00
void showCrosshair ( bool show ) override ;
bool getSubtitlesEnabled ( ) override ;
2012-08-27 17:18:55 +00:00
2017-09-23 10:58:28 +00:00
/// Turn visibility of HUD on or off
2020-10-16 18:18:54 +00:00
bool toggleHud ( ) override ;
2014-06-20 16:49:19 +00:00
2020-10-16 18:18:54 +00:00
void disallowMouse ( ) override ;
void allowMouse ( ) override ;
void notifyInputActionBound ( ) override ;
2012-08-12 23:26:15 +00:00
2020-10-16 18:18:54 +00:00
void addVisitedLocation ( const std : : string & name , int x , int y ) override ;
2012-09-20 16:02:37 +00:00
2014-05-27 03:13:37 +00:00
///Hides dialog and schedules dialog to be deleted.
2020-10-16 18:18:54 +00:00
void removeDialog ( Layout * dialog ) override ;
2014-05-27 03:13:37 +00:00
///Gracefully attempts to exit the topmost GUI mode
2020-10-16 18:18:54 +00:00
void exitCurrentGuiMode ( ) override ;
2012-08-12 16:11:09 +00:00
2020-11-01 21:17:59 +00:00
void messageBox ( const std : : string & message , enum MWGui : : ShowInDialogueMode showInDialogueMode = MWGui : : ShowInDialogueMode_IfPossible ) override ;
2020-10-16 18:18:54 +00:00
void staticMessageBox ( const std : : string & message ) override ;
void removeStaticMessageBox ( ) override ;
2017-07-13 15:58:48 +00:00
/*
2020-07-17 23:36:13 +00:00
Start of tes3mp change ( major )
2017-07-13 15:58:48 +00:00
2020-07-17 23:36:13 +00:00
Add a hasServerOrigin boolean to the list of arguments so those messageboxes
can be differentiated from client - only ones
2017-07-13 15:58:48 +00:00
*/
2020-11-01 21:17:59 +00:00
void interactiveMessageBox ( const std : : string & message ,
const std : : vector < std : : string > & buttons = std : : vector < std : : string > ( ) , bool block = false , bool hasServerOrigin = false ) override ;
2017-07-13 15:58:48 +00:00
/*
2020-07-17 23:36:13 +00:00
End of tes3mp change ( major )
2017-07-13 15:58:48 +00:00
*/
2020-10-16 18:18:54 +00:00
int readPressedButton ( ) override ; ///< returns the index of the pressed button or -1 if no button was pressed (->MessageBoxmanager->InteractiveMessageBox)
2020-07-17 23:36:13 +00:00
2020-10-16 18:18:54 +00:00
void update ( float duration ) override ;
2012-08-12 16:11:09 +00:00
/**
* 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 .
*
* @ param id Identifier for the GMST setting , e . g . " aName "
* @ param default Default value if the GMST setting cannot be used .
*/
2020-10-16 18:18:54 +00:00
std : : string getGameSettingString ( const std : : string & id , const std : : string & default_ ) override ;
2012-08-12 16:11:09 +00:00
2020-10-16 18:18:54 +00:00
void processChangedSettings ( const Settings : : CategorySettingVector & changed ) override ;
2012-08-12 16:11:09 +00:00
2020-10-16 18:18:54 +00:00
void windowVisibilityChange ( bool visible ) override ;
void windowResized ( int x , int y ) override ;
void windowClosed ( ) override ;
bool isWindowVisible ( ) override ;
2013-07-29 00:32:08 +00:00
2020-10-16 18:18:54 +00:00
void watchActor ( const MWWorld : : Ptr & ptr ) override ;
MWWorld : : Ptr getWatchedActor ( ) const override ;
2020-06-05 14:22:53 +00:00
2020-10-16 18:18:54 +00:00
void executeInConsole ( const std : : string & path ) override ;
2012-08-12 16:11:09 +00:00
2017-11-22 22:21:47 +00:00
/*
Start of tes3mp addition
Allow the execution of console commands from elsewhere in the code
*/
virtual void executeCommandInConsole ( const std : : string & command ) ;
/*
End of tes3mp addition
*/
2020-10-16 18:18:54 +00:00
void enableRest ( ) override { mRestAllowed = true ; }
bool getRestEnabled ( ) override ;
2012-09-15 18:18:41 +00:00
2020-10-16 18:18:54 +00:00
bool getJournalAllowed ( ) override { return ( mAllowed & GW_Magic ) ! = 0 ; }
2012-09-15 18:18:41 +00:00
2020-10-16 18:18:54 +00:00
bool getPlayerSleeping ( ) override ;
void wakeUpPlayer ( ) override ;
2012-09-19 01:11:23 +00:00
2020-10-16 18:18:54 +00:00
void updatePlayer ( ) override ;
2013-05-15 15:54:18 +00:00
2020-10-16 18:18:54 +00:00
void showSoulgemDialog ( MWWorld : : Ptr item ) override ;
2013-03-30 14:51:07 +00:00
2020-10-16 18:18:54 +00:00
void changePointer ( const std : : string & name ) override ;
2012-09-22 22:36:20 +00:00
2020-10-16 18:18:54 +00:00
void setEnemy ( const MWWorld : : Ptr & enemy ) override ;
2013-07-30 04:00:20 +00:00
2020-10-16 18:18:54 +00:00
int getMessagesCount ( ) const override ;
2018-10-28 07:44:14 +00:00
2020-10-16 18:18:54 +00:00
const Translation : : Storage & getTranslationDataStorage ( ) const override ;
2012-12-31 00:15:47 +00:00
2013-03-30 14:51:07 +00:00
void onSoulgemDialogButtonPressed ( int button ) ;
2020-10-16 18:18:54 +00:00
bool getCursorVisible ( ) override ;
2013-11-20 15:05:24 +00:00
2017-09-26 15:44:35 +00:00
/// Call when mouse cursor or buttons are used.
2020-10-16 18:18:54 +00:00
void setCursorActive ( bool active ) override ;
2017-09-26 15:44:35 +00:00
2014-01-25 12:34:56 +00:00
/// Clear all savegame-specific data
2020-10-16 18:18:54 +00:00
void clear ( ) override ;
2014-01-25 12:34:56 +00:00
2020-10-16 18:18:54 +00:00
void write ( ESM : : ESMWriter & writer , Loading : : Listener & progress ) override ;
void readRecord ( ESM : : ESMReader & reader , uint32_t type ) override ;
int countSavedGameRecords ( ) const override ;
2014-01-25 17:20:17 +00:00
2014-05-02 09:20:43 +00:00
/// Does the current stack of GUI-windows permit saving?
2020-10-16 18:18:54 +00:00
bool isSavingAllowed ( ) const override ;
2014-05-02 09:20:43 +00:00
2015-03-11 19:04:25 +00:00
/// Send exit command to active Modal window **/
2020-10-16 18:18:54 +00:00
void exitCurrentModal ( ) override ;
2014-05-27 07:00:31 +00:00
/// Sets the current Modal
/** Used to send exit command to active Modal when Esc is pressed **/
2020-10-16 18:18:54 +00:00
void addCurrentModal ( WindowModal * input ) override ;
2014-05-27 08:38:13 +00:00
/// Removes the top Modal
/** Used when one Modal adds another Modal
\ param input Pointer to the current modal , to ensure proper modal is removed * */
2020-10-16 18:18:54 +00:00
void removeCurrentModal ( WindowModal * input ) override ;
2014-05-27 07:00:31 +00:00
2020-10-16 18:18:54 +00:00
void pinWindow ( MWGui : : GuiWindow window ) override ;
void toggleMaximized ( Layout * layout ) override ;
2014-06-10 15:47:59 +00:00
2014-08-01 14:25:41 +00:00
/// Fade the screen in, over \a time seconds
2020-10-16 18:18:54 +00:00
void fadeScreenIn ( const float time , bool clearQueue , float delay ) override ;
2014-08-01 14:25:41 +00:00
/// Fade the screen out to black, over \a time seconds
2020-10-16 18:18:54 +00:00
void fadeScreenOut ( const float time , bool clearQueue , float delay ) override ;
2014-08-01 14:25:41 +00:00
/// Fade the screen to a specified percentage of black, over \a time seconds
2020-10-16 18:18:54 +00:00
void fadeScreenTo ( const int percent , const float time , bool clearQueue , float delay ) override ;
2014-10-12 17:06:40 +00:00
/// Darken the screen to a specified percentage
2020-10-16 18:18:54 +00:00
void setBlindness ( const int percent ) override ;
2014-08-01 14:25:41 +00:00
2020-10-16 18:18:54 +00:00
void activateHitOverlay ( bool interrupt ) override ;
void setWerewolfOverlay ( bool set ) override ;
2014-10-05 15:53:50 +00:00
2020-10-16 18:18:54 +00:00
void toggleConsole ( ) override ;
void toggleDebugWindow ( ) override ;
2014-09-28 15:57:14 +00:00
2014-12-15 14:23:03 +00:00
/// Cycle to next or previous spell
2020-10-16 18:18:54 +00:00
void cycleSpell ( bool next ) override ;
2014-12-15 14:23:03 +00:00
/// Cycle to next or previous weapon
2020-10-16 18:18:54 +00:00
void cycleWeapon ( bool next ) override ;
2014-12-15 14:23:03 +00:00
2020-10-16 18:18:54 +00:00
void playSound ( const std : : string & soundId , float volume = 1.f , float pitch = 1.f ) override ;
2017-07-10 11:48:00 +00:00
2015-05-01 16:37:24 +00:00
// In WindowManager for now since there isn't a VFS singleton
2020-10-16 18:18:54 +00:00
std : : string correctIconPath ( const std : : string & path ) override ;
std : : string correctBookartPath ( const std : : string & path , int width , int height , bool * exists = nullptr ) override ;
std : : string correctTexturePath ( const std : : string & path ) override ;
bool textureExists ( const std : : string & path ) override ;
2015-05-01 16:37:24 +00:00
2020-10-16 18:18:54 +00:00
void addCell ( MWWorld : : CellStore * cell ) override ;
void removeCell ( MWWorld : : CellStore * cell ) override ;
void writeFog ( MWWorld : : CellStore * cell ) override ;
2015-05-26 14:40:44 +00:00
2020-10-16 18:18:54 +00:00
const MWGui : : TextColours & getTextColours ( ) override ;
2017-07-24 11:25:01 +00:00
2020-10-16 18:18:54 +00:00
bool injectKeyPress ( MyGUI : : KeyCode key , unsigned int text , bool repeat = false ) override ;
bool injectKeyRelease ( MyGUI : : KeyCode key ) override ;
2017-09-22 14:52:39 +00:00
2021-01-17 11:12:14 +00:00
void viewerTraversals ( bool updateWindowManager ) override ;
2012-08-12 16:11:09 +00:00
private :
2019-06-21 13:37:00 +00:00
unsigned int mOldUpdateMask ; unsigned int mOldCullMask ;
2015-12-09 00:06:53 +00:00
const MWWorld : : ESMStore * mStore ;
2020-03-29 23:25:23 +00:00
bool mVRMode ;
2015-05-01 16:37:24 +00:00
Resource : : ResourceSystem * mResourceSystem ;
2017-02-14 02:55:29 +00:00
osg : : ref_ptr < SceneUtil : : WorkQueue > mWorkQueue ;
2015-05-01 16:37:24 +00:00
2015-04-30 23:15:25 +00:00
osgMyGUI : : Platform * mGuiPlatform ;
2015-05-01 01:03:44 +00:00
osgViewer : : Viewer * mViewer ;
2015-04-24 21:30:30 +00:00
2017-04-28 15:30:26 +00:00
std : : unique_ptr < Gui : : FontLoader > mFontLoader ;
2020-06-05 14:22:53 +00:00
std : : unique_ptr < StatsWatcher > mStatsWatcher ;
2015-04-30 23:41:33 +00:00
2013-08-27 13:48:13 +00:00
bool mConsoleOnlyScripts ;
2013-12-03 17:42:35 +00:00
std : : map < MyGUI : : Window * , std : : string > mTrackedWindows ;
2015-05-01 00:09:57 +00:00
void trackWindow ( Layout * layout , const std : : string & name ) ;
2013-12-03 17:42:35 +00:00
void onWindowChangeCoord ( MyGUI : : Window * _sender ) ;
2013-12-26 21:32:39 +00:00
std : : string mSelectedSpell ;
2017-02-14 23:55:35 +00:00
MWWorld : : Ptr mSelectedEnchantItem ;
MWWorld : : Ptr mSelectedWeapon ;
2013-12-26 21:32:39 +00:00
2017-10-04 15:03:23 +00:00
std : : vector < WindowModal * > mCurrentModals ;
2014-05-27 07:00:31 +00:00
2014-08-17 03:45:35 +00:00
// Markers placed manually by the player. Must be shared between both map views (the HUD map and the map window).
CustomMarkerCollection mCustomMarkers ;
2012-08-12 16:11:09 +00:00
HUD * mHud ;
MapWindow * mMap ;
2015-05-26 14:40:44 +00:00
MWRender : : LocalMap * mLocalMapRender ;
2012-08-12 16:11:09 +00:00
ToolTips * mToolTips ;
StatsWindow * mStatsWindow ;
MessageBoxManager * mMessageBoxManager ;
Console * mConsole ;
DialogueWindow * mDialogueWindow ;
DragAndDrop * mDragAndDrop ;
InventoryWindow * mInventoryWindow ;
ScrollWindow * mScrollWindow ;
BookWindow * mBookWindow ;
CountDialog * mCountDialog ;
TradeWindow * mTradeWindow ;
SettingsWindow * mSettingsWindow ;
ConfirmationDialog * mConfirmationDialog ;
2012-09-09 18:10:07 +00:00
SpellWindow * mSpellWindow ;
2012-08-26 08:52:06 +00:00
QuickKeysMenu * mQuickKeysMenu ;
2012-09-11 14:37:54 +00:00
LoadingScreen * mLoadingScreen ;
2012-09-18 16:29:03 +00:00
WaitDialog * mWaitDialog ;
2013-03-30 14:51:07 +00:00
SoulgemDialog * mSoulgemDialog ;
2014-03-27 18:10:15 +00:00
MyGUI : : ImageBox * mVideoBackground ;
VideoWidget * mVideoWidget ;
2014-10-05 15:53:50 +00:00
ScreenFader * mWerewolfFader ;
2014-10-12 17:06:40 +00:00
ScreenFader * mBlindnessFader ;
2014-10-05 15:53:50 +00:00
ScreenFader * mHitFader ;
2014-08-01 14:25:41 +00:00
ScreenFader * mScreenFader ;
2014-09-28 15:57:14 +00:00
DebugWindow * mDebugWindow ;
2015-02-07 03:05:28 +00:00
JailScreen * mJailScreen ;
2020-10-27 19:45:41 +00:00
MWVR : : VrMetaMenu * mVrMetaMenu ;
2013-03-22 13:13:10 +00:00
2020-11-14 18:13:16 +00:00
Gui : : VirtualKeyboardManager * mVirtualKeyboardManager ;
2013-03-22 13:13:10 +00:00
2018-03-24 07:00:15 +00:00
/*
Start of tes3mp addition
Keep a pointer to the container window because of its usefulness
in multiplayer for container sync
*/
ContainerWindow * mContainerWindow ;
/*
End of tes3mp addition
*/
2017-09-23 19:45:52 +00:00
std : : vector < WindowBase * > mWindows ;
2012-12-26 16:06:33 +00:00
Translation : : Storage & mTranslationDataStorage ;
2012-08-12 16:11:09 +00:00
CharacterCreation * mCharGen ;
2012-08-12 23:26:15 +00:00
MyGUI : : Widget * mInputBlocker ;
2012-08-29 09:15:17 +00:00
bool mCrosshairEnabled ;
bool mSubtitlesEnabled ;
2014-10-05 15:53:50 +00:00
bool mHitFaderEnabled ;
bool mWerewolfOverlayEnabled ;
2012-08-30 18:47:39 +00:00
bool mHudEnabled ;
2013-01-11 13:32:29 +00:00
bool mCursorVisible ;
2017-09-26 15:44:35 +00:00
bool mCursorActive ;
2020-03-10 21:39:11 +00:00
bool mVideoEnabled ;
2012-08-29 09:15:17 +00:00
2019-09-05 16:16:03 +00:00
int mPlayerBounty ;
2020-10-16 18:18:54 +00:00
void setCursorVisible ( bool visible ) override ;
2012-08-29 09:15:17 +00:00
2012-08-12 16:11:09 +00:00
MyGUI : : Gui * mGui ; // Gui
2017-09-22 18:46:08 +00:00
struct GuiModeState
{
GuiModeState ( WindowBase * window )
{
mWindows . push_back ( window ) ;
}
GuiModeState ( const std : : vector < WindowBase * > & windows )
: mWindows ( windows ) { }
GuiModeState ( ) { }
void update ( bool visible ) ;
std : : vector < WindowBase * > mWindows ;
2017-09-22 22:00:40 +00:00
std : : string mCloseSound ;
std : : string mOpenSound ;
2017-09-22 18:46:08 +00:00
} ;
// Defines the windows that should be shown in a particular GUI mode.
std : : map < GuiMode , GuiModeState > mGuiModeStates ;
// The currently active stack of GUI modes (top mode is the one we are in).
2012-08-12 16:11:09 +00:00
std : : vector < GuiMode > mGuiModes ;
2015-05-13 16:56:14 +00:00
SDLUtil : : SDLCursorManager * mCursorManager ;
2013-01-11 12:27:59 +00:00
2015-05-01 00:09:57 +00:00
std : : vector < Layout * > mGarbageDialogs ;
2012-08-12 16:11:09 +00:00
void cleanupGarbage ( ) ;
GuiWindow mShown ; // Currently shown windows in inventory mode
2013-08-05 21:15:26 +00:00
GuiWindow mForceHidden ; // Hidden windows (overrides mShown)
2012-08-12 16:11:09 +00:00
/* Currently ALLOWED windows in inventory mode. This is used at
the start of the game , when windows are enabled one by one
through script commands . You can manipulate this through using
allow ( ) and disableAll ( ) .
*/
GuiWindow mAllowed ;
2012-09-15 18:18:41 +00:00
// is the rest window allowed?
bool mRestAllowed ;
2012-08-12 16:11:09 +00:00
void updateVisible ( ) ; // Update visibility of all windows based on mode, shown and allowed settings
2015-05-26 14:40:44 +00:00
void updateMap ( ) ;
2015-07-18 15:13:20 +00:00
int mShowOwned ;
2014-09-19 09:53:20 +00:00
2017-11-21 05:32:35 +00:00
ToUTF8 : : FromType mEncoding ;
2015-07-18 01:01:06 +00:00
std : : string mVersionDescription ;
2020-04-16 13:31:20 +00:00
bool mWindowVisible ;
2017-07-24 11:25:01 +00:00
MWGui : : TextColours mTextColours ;
2017-09-22 14:52:39 +00:00
std : : unique_ptr < KeyboardNavigation > mKeyboardNavigation ;
2020-04-16 13:31:20 +00:00
SDLUtil : : VideoWrapper * mVideoWrapper ;
2021-04-15 11:14:41 +00:00
float mScalingFactor ;
2012-08-12 16:11:09 +00:00
/**
2014-09-19 09:53:20 +00:00
* Called when MyGUI tries to retrieve a tag ' s value . Tags must be denoted in # { tag } notation and will be replaced upon setting a user visible text / property .
* Supported syntax :
* # { GMSTName } : retrieves String value of the GMST called GMSTName
2015-07-19 17:52:50 +00:00
* # { setting = CATEGORY_NAME , SETTING_NAME } : retrieves String value of SETTING_NAME under category CATEGORY_NAME from settings . cfg
2014-09-19 09:53:20 +00:00
* # { sCell = CellID } : retrieves translated name of the given CellID ( used only by some Morrowind localisations , in others cell ID is = = cell name )
* # { fontcolour = FontColourName } : retrieves the value of the fallback setting " FontColor_color_<FontColourName> " from openmw . cfg ,
2014-09-20 07:07:47 +00:00
* in the format " r g b a " , float values in range 0 - 1. Useful for " Colour " and " TextColour " properties in skins .
* # { fontcolourhtml = FontColourName } : retrieves the value of the fallback setting " FontColor_color_<FontColourName> " from openmw . cfg ,
* in the format " #xxxxxx " where x are hexadecimal numbers . Useful in an EditBox ' s caption to change the color of following text .
2012-08-12 16:11:09 +00:00
*/
void onRetrieveTag ( const MyGUI : : UString & _tag , MyGUI : : UString & _result ) ;
2013-01-11 12:27:59 +00:00
void onCursorChange ( const std : : string & name ) ;
2013-06-16 16:06:55 +00:00
void onKeyFocusChanged ( MyGUI : : Widget * widget ) ;
2014-03-27 18:10:15 +00:00
2014-06-09 23:57:54 +00:00
// Key pressed while playing a video
void onVideoKeyPressed ( MyGUI : : Widget * _sender , MyGUI : : KeyCode _key , MyGUI : : Char _char ) ;
2014-03-27 18:10:15 +00:00
void sizeVideo ( int screenWidth , int screenHeight ) ;
2014-08-25 16:00:53 +00:00
void onClipboardChanged ( const std : : string & _type , const std : : string & _data ) ;
void onClipboardRequested ( const std : : string & _type , std : : string & _data ) ;
2015-05-02 16:06:54 +00:00
void createTextures ( ) ;
2015-07-13 21:36:25 +00:00
void createCursors ( ) ;
2015-05-02 16:06:54 +00:00
void setMenuTransparency ( float value ) ;
2017-04-21 15:37:09 +00:00
void updatePinnedWindows ( ) ;
2019-06-21 13:37:00 +00:00
void enableScene ( bool enable ) ;
2012-08-12 16:11:09 +00:00
} ;
}
# endif