1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-30 21:32:42 +00:00
OpenMW/apps/openmw/mwgui/windowmanagerimp.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

596 lines
21 KiB
C++
Raw Normal View History

#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.
**/
#include <memory>
2015-01-31 23:27:34 +01:00
#include <stack>
#include <vector>
2015-01-31 23:27:34 +01:00
#include <osg/ref_ptr>
#include "../mwbase/windowmanager.hpp"
#include "../mwrender/localmap.hpp"
#include <components/misc/guarded.hpp>
#include <components/myguiplatform/myguiplatform.hpp>
#include <components/sdlutil/events.hpp>
#include <components/sdlutil/sdlcursormanager.hpp>
#include <components/sdlutil/sdlvideowrapper.hpp>
2015-01-31 23:27:34 +01:00
#include <components/settings/settings.hpp>
#include <components/to_utf8/to_utf8.hpp>
2015-01-31 23:27:34 +01:00
#include "charactercreation.hpp"
#include "draganddrop.hpp"
#include "mapwindow.hpp"
#include "messagebox.hpp"
#include "settings.hpp"
#include "soulgemdialog.hpp"
2020-06-05 18:22:53 +04:00
#include "statswatcher.hpp"
2017-07-24 13:25:01 +02:00
#include "textcolours.hpp"
#include "tooltips.hpp"
#include "windowbase.hpp"
#include <MyGUI_Gui.h>
#include <MyGUI_KeyCode.h>
#include <MyGUI_Types.h>
#include <filesystem>
namespace MyGUI
{
class Widget;
2013-12-03 18:42:35 +01:00
class Window;
class UString;
class ImageBox;
}
namespace MWWorld
{
class ESMStore;
}
namespace Compiler
{
class Extensions;
}
namespace Translation
{
class Storage;
}
2015-04-24 21:55:30 +02:00
namespace osg
{
class Group;
}
namespace osgViewer
{
class Viewer;
}
namespace Resource
{
2015-05-01 01:15:25 +02:00
class ResourceSystem;
2015-04-24 21:55:30 +02:00
}
namespace SceneUtil
{
class WorkQueue;
}
namespace Gui
{
class FontLoader;
}
namespace MWGui
{
class HUD;
class MapWindow;
class MainMenu;
class StatsWindow;
class InventoryWindow;
struct JournalWindow;
class TextInputDialog;
2012-10-17 18:03:02 +02:00
class InfoBoxDialog;
class SettingsWindow;
class AlchemyWindow;
class QuickKeysMenu;
class LoadingScreen;
class LevelupDialog;
class WaitDialog;
class SpellCreationDialog;
class EnchantingDialog;
2022-08-28 17:20:49 +02:00
class TrainingWindow;
class SpellIcons;
class MerchantRepair;
class Recharge;
class CompanionWindow;
class VideoWidget;
class WindowModal;
class ScreenFader;
class DebugWindow;
class PostProcessorHud;
class JailScreen;
class KeyboardNavigation;
2022-09-22 21:26:05 +03:00
class WindowManager : public MWBase::WindowManager
2022-09-22 21:26:05 +03:00
{
2022-04-09 23:07:57 +02:00
public:
typedef std::pair<std::string, int> Faction;
typedef std::vector<Faction> FactionList;
WindowManager(SDL_Window* window, osgViewer::Viewer* viewer, osg::Group* guiRoot,
Resource::ResourceSystem* resourceSystem, SceneUtil::WorkQueue* workQueue,
const std::filesystem::path& logpath, bool consoleOnlyScripts, Translation::Storage& translationDataStorage,
ToUTF8::FromType encoding, const std::string& versionDescription, bool useShaders,
Files::ConfigurationManager& cfgMgr);
virtual ~WindowManager();
/// Set the ESMStore to use for retrieving of GUI-related strings.
void setStore(const MWWorld::ESMStore& store);
void initUI();
Loading::Listener* getLoadingScreen() override;
/// @note This method will block until the video finishes playing
/// (and will continually update the window while doing so)
void playVideo(std::string_view name, bool allowSkipping, bool overrideSounds = true) override;
/// Warning: do not use MyGUI::InputManager::setKeyFocusWidget directly. Instead use this.
void setKeyFocusWidget(MyGUI::Widget* widget) override;
void setNewGame(bool newgame) override;
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
void goToJail(int days) override;
2012-08-27 15:51:01 +02:00
2022-08-27 13:07:59 +02:00
GuiMode getMode() const override;
bool containsMode(GuiMode mode) const override;
bool isGuiMode() const override;
bool isConsoleMode() const override;
2012-08-27 19:18:55 +02:00
bool isPostProcessorHudVisible() const override;
2014-06-20 18:49:19 +02:00
void toggleVisible(GuiWindow wnd) override;
2012-08-13 01:26:15 +02:00
void forceHide(MWGui::GuiWindow wnd) override;
void unsetForceHide(MWGui::GuiWindow wnd) override;
/// Disallow all inventory mode windows
void disallowAll() override;
/// Allow one or more windows
void allow(GuiWindow wnd) override;
bool isAllowed(GuiWindow wnd) const override;
/// \todo investigate, if we really need to expose every single lousy UI element to the outside world
MWGui::InventoryWindow* getInventoryWindow() override;
MWGui::CountDialog* getCountDialog() override;
MWGui::ConfirmationDialog* getConfirmationDialog() override;
MWGui::TradeWindow* getTradeWindow() override;
MWGui::PostProcessorHud* getPostProcessorHud() override;
/// Make the player use an item, while updating GUI state accordingly
void useItem(const MWWorld::Ptr& item, bool bypassBeastRestrictions = false) override;
void updateSpellWindow() override;
void setConsoleSelectedObject(const MWWorld::Ptr& object) override;
2022-11-26 21:25:18 +01:00
MWWorld::Ptr getConsoleSelectedObject() const override;
void printToConsole(const std::string& msg, std::string_view color) override;
void setConsoleMode(const std::string& mode) override;
/// Set time left for the player to start drowning (update the drowning bar)
/// @param time time left to start drowning
/// @param maxTime how long we can be underwater (in total) until drowning starts
void setDrowningTimeLeft(float time, float maxTime) override;
2013-07-29 02:32:08 +02:00
void changeCell(const MWWorld::CellStore* cell) override; ///< change the active cell
2020-06-05 18:22:53 +04:00
void setFocusObject(const MWWorld::Ptr& focus) override;
void setFocusObjectScreenCoords(float min_x, float min_y, float max_x, float max_y) override;
void getMousePosition(int& x, int& y) override;
void getMousePosition(float& x, float& y) override;
void setDragDrop(bool dragDrop) override;
bool getWorldMouseOver() override;
2012-09-15 20:18:41 +02:00
float getScalingFactor() const override;
2012-09-15 20:18:41 +02:00
bool toggleFogOfWar() override;
bool toggleFullHelp() override; ///< show extra info in item tooltips (owner, script)
bool getFullHelp() const override;
2012-09-19 03:11:23 +02:00
void setActiveMap(int x, int y, bool interior) override;
///< set the indices of the map texture that should be used
2013-05-15 17:54:18 +02:00
/// sets the visibility of the drowning bar
void setDrowningBarVisibility(bool visible) override;
// sets the visibility of the hud health/magicka/stamina bars
void setHMSVisibility(bool visible) override;
// sets the visibility of the hud minimap
void setMinimapVisibility(bool visible) override;
void setWeaponVisibility(bool visible) override;
void setSpellVisibility(bool visible) override;
void setSneakVisibility(bool visible) override;
2012-09-23 00:36:20 +02:00
/// activate selected quick key
void activateQuickKey(int index) override;
/// update activated quick key state (if action executing was delayed for some reason)
void updateActivatedQuickKey() override;
2013-07-30 06:00:20 +02:00
Initial commit: In ESM structures, replace the string members that are RefIds to other records, to a new strong type The strong type is actually just a string underneath, but this will help in the future to have a distinction so it's easier to search and replace when we use an integer ID Slowly going through all the changes to make, still hundreds of errors a lot of functions/structures use std::string or stringview to designate an ID. So it takes time Continues slowly replacing ids. There are technically more and more compilation errors I have good hope that there is a point where the amount of errors will dramatically go down as all the main functions use the ESM::RefId type Continue moving forward, changes to the stores slowly moving along Starting to see the fruit of those changes. still many many error, but more and more Irun into a situation where a function is sandwiched between two functions that use the RefId type. More replacements. Things are starting to get easier I can see more and more often the issue is that the function is awaiting a RefId, but is given a string there is less need to go down functions and to fix a long list of them. Still moving forward, and for the first time error count is going down! Good pace, not sure about topics though, mId and mName are actually the same thing and are used interchangeably Cells are back to using string for the name, haven't fixed everything yet. Many other changes Under the bar of 400 compilation errors. more good progress <100 compile errors! More progress Game settings store can use string for find, it was a bit absurd how every use of it required to create refId from string some more progress on other fronts Mostly game settings clean one error opened a lot of other errors. Down to 18, but more will prbably appear only link errors left?? Fixed link errors OpenMW compiles, and launches, with some issues, but still!
2022-09-25 13:17:09 +02:00
const ESM::RefId& getSelectedSpell() override { return mSelectedSpell; }
void setSelectedSpell(const ESM::RefId& 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;
void updateConsoleObjectPtr(const MWWorld::Ptr& currentPtr, const MWWorld::Ptr& newPtr) override;
void showCrosshair(bool show) override;
bool getSubtitlesEnabled() override;
/// Turn visibility of HUD on or off
bool toggleHud() override;
2017-09-26 17:44:35 +02:00
void disallowMouse() override;
void allowMouse() override;
void notifyInputActionBound() override;
2017-09-26 17:44:35 +02:00
void addVisitedLocation(const std::string& name, int x, int y) override;
/// Hides dialog and schedules dialog to be deleted.
void removeDialog(std::unique_ptr<Layout>&& dialog) override;
2014-01-25 18:20:17 +01:00
/// Gracefully attempts to exit the topmost GUI mode
void exitCurrentGuiMode() override;
2015-03-11 20:04:25 +01:00
void messageBox(std::string_view message,
enum MWGui::ShowInDialogueMode showInDialogueMode = MWGui::ShowInDialogueMode_IfPossible) override;
void scheduleMessageBox(std::string message,
enum MWGui::ShowInDialogueMode showInDialogueMode = MWGui::ShowInDialogueMode_IfPossible) override;
void staticMessageBox(std::string_view message) override;
void removeStaticMessageBox() override;
void interactiveMessageBox(
std::string_view message, const std::vector<std::string>& buttons = {}, bool block = false) override;
int readPressedButton() override; ///< returns the index of the pressed button or -1 if no button was pressed
///< (->MessageBoxmanager->InteractiveMessageBox)
void update(float duration);
2022-09-22 21:26:05 +03: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.
2022-09-22 21:26:05 +03:00
*
* @param id Identifier for the GMST setting, e.g. "aName"
* @param default Default value if the GMST setting cannot be used.
2022-09-22 21:26:05 +03:00
*/
std::string_view getGameSettingString(std::string_view id, std::string_view default_) override;
void processChangedSettings(const Settings::CategorySettingVector& changed) override;
void windowVisibilityChange(bool visible) override;
void windowResized(int x, int y) override;
void windowClosed() override;
bool isWindowVisible() override;
void watchActor(const MWWorld::Ptr& ptr) override;
2022-05-13 18:58:00 -07:00
MWWorld::Ptr getWatchedActor() const override;
void executeInConsole(const std::string& path) override;
void enableRest() override { mRestAllowed = true; }
bool getRestEnabled() override;
bool getJournalAllowed() override { return (mAllowed & GW_Magic) != 0; }
2015-05-26 16:40:44 +02:00
bool getPlayerSleeping() override;
void wakeUpPlayer() override;
2017-07-24 13:25:01 +02:00
void updatePlayer() override;
2021-07-07 18:48:25 +02:00
void showSoulgemDialog(MWWorld::Ptr item) override;
void changePointer(const std::string& name) override;
void setEnemy(const MWWorld::Ptr& enemy) override;
int getMessagesCount() const override;
const Translation::Storage& getTranslationDataStorage() const override;
2015-05-01 03:03:44 +02:00
void onSoulgemDialogButtonPressed(int button);
2015-04-24 23:30:30 +02:00
2020-06-05 18:22:53 +04:00
bool getCursorVisible() override;
/// Call when mouse cursor or buttons are used.
void setCursorActive(bool active) override;
2015-05-01 02:09:57 +02:00
/// Clear all savegame-specific data
2013-12-03 18:42:35 +01:00
void clear() override;
void write(ESM::ESMWriter& writer, Loading::Listener& progress) override;
void readRecord(ESM::ESMReader& reader, uint32_t type) override;
int countSavedGameRecords() const override;
/// Does the current stack of GUI-windows permit saving?
bool isSavingAllowed() const override;
/// Send exit command to active Modal window **/
void exitCurrentModal() override;
2022-08-31 21:07:59 +02:00
/// Sets the current Modal
/** Used to send exit command to active Modal when Esc is pressed **/
void addCurrentModal(WindowModal* input) override;
/// Removes the top Modal
2012-08-13 01:26:15 +02:00
/** Used when one Modal adds another Modal
\param input Pointer to the current modal, to ensure proper modal is removed **/
2012-08-13 01:26:15 +02:00
void removeCurrentModal(WindowModal* input) override;
void pinWindow(MWGui::GuiWindow window) override;
void toggleMaximized(Layout* layout) override;
/// Fade the screen in, over \a time seconds
void fadeScreenIn(const float time, bool clearQueue, float delay) override;
/// Fade the screen out to black, over \a time seconds
void fadeScreenOut(const float time, bool clearQueue, float delay) override;
/// Fade the screen to a specified percentage of black, over \a time seconds
void fadeScreenTo(const int percent, const float time, bool clearQueue, float delay) override;
/// Darken the screen to a specified percentage
void setBlindness(const int percent) override;
void activateHitOverlay(bool interrupt) override;
void setWerewolfOverlay(bool set) override;
void toggleConsole() override;
void toggleDebugWindow() override;
2022-08-31 21:07:59 +02:00
void togglePostProcessorHud() override;
/// Cycle to next or previous spell
void cycleSpell(bool next) override;
/// Cycle to next or previous weapon
void cycleWeapon(bool next) override;
2022-09-22 21:26:05 +03:00
Initial commit: In ESM structures, replace the string members that are RefIds to other records, to a new strong type The strong type is actually just a string underneath, but this will help in the future to have a distinction so it's easier to search and replace when we use an integer ID Slowly going through all the changes to make, still hundreds of errors a lot of functions/structures use std::string or stringview to designate an ID. So it takes time Continues slowly replacing ids. There are technically more and more compilation errors I have good hope that there is a point where the amount of errors will dramatically go down as all the main functions use the ESM::RefId type Continue moving forward, changes to the stores slowly moving along Starting to see the fruit of those changes. still many many error, but more and more Irun into a situation where a function is sandwiched between two functions that use the RefId type. More replacements. Things are starting to get easier I can see more and more often the issue is that the function is awaiting a RefId, but is given a string there is less need to go down functions and to fix a long list of them. Still moving forward, and for the first time error count is going down! Good pace, not sure about topics though, mId and mName are actually the same thing and are used interchangeably Cells are back to using string for the name, haven't fixed everything yet. Many other changes Under the bar of 400 compilation errors. more good progress <100 compile errors! More progress Game settings store can use string for find, it was a bit absurd how every use of it required to create refId from string some more progress on other fronts Mostly game settings clean one error opened a lot of other errors. Down to 18, but more will prbably appear only link errors left?? Fixed link errors OpenMW compiles, and launches, with some issues, but still!
2022-09-25 13:17:09 +02:00
void playSound(const ESM::RefId& soundId, float volume = 1.f, float pitch = 1.f) override;
2022-09-22 21:26:05 +03:00
void addCell(MWWorld::CellStore* cell) override;
void removeCell(MWWorld::CellStore* cell) override;
void writeFog(MWWorld::CellStore* cell) override;
2022-09-22 21:26:05 +03:00
const MWGui::TextColours& getTextColours() override;
2022-09-22 21:26:05 +03:00
bool injectKeyPress(MyGUI::KeyCode key, unsigned int text, bool repeat = false) override;
bool injectKeyRelease(MyGUI::KeyCode key) override;
2022-09-22 21:26:05 +03:00
2021-07-07 18:48:25 +02:00
const std::string& getVersionDescription() const override;
2022-09-22 21:26:05 +03:00
void onDeleteCustomData(const MWWorld::Ptr& ptr) override;
void forceLootMode(const MWWorld::Ptr& ptr) override;
2022-09-22 21:26:05 +03:00
void asyncPrepareSaveMap() override;
2022-09-22 21:26:05 +03:00
private:
unsigned int mOldUpdateMask;
unsigned int mOldCullMask;
2022-09-22 21:26:05 +03:00
const MWWorld::ESMStore* mStore;
Resource::ResourceSystem* mResourceSystem;
osg::ref_ptr<SceneUtil::WorkQueue> mWorkQueue;
2022-09-22 21:26:05 +03:00
2022-08-31 21:07:59 +02:00
std::unique_ptr<osgMyGUI::Platform> mGuiPlatform;
2015-05-01 03:03:44 +02:00
osgViewer::Viewer* mViewer;
2022-09-22 21:26:05 +03:00
std::unique_ptr<Gui::FontLoader> mFontLoader;
2020-06-05 18:22:53 +04:00
std::unique_ptr<StatsWatcher> mStatsWatcher;
2022-09-22 21:26:05 +03:00
bool mConsoleOnlyScripts;
2022-09-22 21:26:05 +03:00
std::map<MyGUI::Window*, WindowSettingValues> mTrackedWindows;
void trackWindow(Layout* layout, const WindowSettingValues& settings);
2013-12-03 18:42:35 +01:00
void onWindowChangeCoord(MyGUI::Window* _sender);
2022-09-22 21:26:05 +03:00
Initial commit: In ESM structures, replace the string members that are RefIds to other records, to a new strong type The strong type is actually just a string underneath, but this will help in the future to have a distinction so it's easier to search and replace when we use an integer ID Slowly going through all the changes to make, still hundreds of errors a lot of functions/structures use std::string or stringview to designate an ID. So it takes time Continues slowly replacing ids. There are technically more and more compilation errors I have good hope that there is a point where the amount of errors will dramatically go down as all the main functions use the ESM::RefId type Continue moving forward, changes to the stores slowly moving along Starting to see the fruit of those changes. still many many error, but more and more Irun into a situation where a function is sandwiched between two functions that use the RefId type. More replacements. Things are starting to get easier I can see more and more often the issue is that the function is awaiting a RefId, but is given a string there is less need to go down functions and to fix a long list of them. Still moving forward, and for the first time error count is going down! Good pace, not sure about topics though, mId and mName are actually the same thing and are used interchangeably Cells are back to using string for the name, haven't fixed everything yet. Many other changes Under the bar of 400 compilation errors. more good progress <100 compile errors! More progress Game settings store can use string for find, it was a bit absurd how every use of it required to create refId from string some more progress on other fronts Mostly game settings clean one error opened a lot of other errors. Down to 18, but more will prbably appear only link errors left?? Fixed link errors OpenMW compiles, and launches, with some issues, but still!
2022-09-25 13:17:09 +02:00
ESM::RefId mSelectedSpell;
MWWorld::Ptr mSelectedEnchantItem;
MWWorld::Ptr mSelectedWeapon;
2022-09-22 21:26:05 +03:00
std::vector<WindowModal*> mCurrentModals;
2022-09-22 21:26:05 +03:00
// Markers placed manually by the player. Must be shared between both map views (the HUD map and the map
// window).
CustomMarkerCollection mCustomMarkers;
2022-09-22 21:26:05 +03:00
HUD* mHud;
MapWindow* mMap;
2022-08-31 21:07:59 +02:00
std::unique_ptr<MWRender::LocalMap> mLocalMapRender;
std::unique_ptr<ToolTips> mToolTips;
StatsWindow* mStatsWindow;
2022-08-31 21:07:59 +02:00
std::unique_ptr<MessageBoxManager> mMessageBoxManager;
Console* mConsole;
DialogueWindow* mDialogueWindow;
2022-08-31 21:07:59 +02:00
std::unique_ptr<DragAndDrop> mDragAndDrop;
InventoryWindow* mInventoryWindow;
ScrollWindow* mScrollWindow;
BookWindow* mBookWindow;
CountDialog* mCountDialog;
TradeWindow* mTradeWindow;
SettingsWindow* mSettingsWindow;
ConfirmationDialog* mConfirmationDialog;
SpellWindow* mSpellWindow;
QuickKeysMenu* mQuickKeysMenu;
2012-09-11 16:37:54 +02:00
LoadingScreen* mLoadingScreen;
2012-09-18 18:29:03 +02:00
WaitDialog* mWaitDialog;
2022-08-31 21:07:59 +02:00
std::unique_ptr<SoulgemDialog> mSoulgemDialog;
MyGUI::ImageBox* mVideoBackground;
VideoWidget* mVideoWidget;
ScreenFader* mWerewolfFader;
ScreenFader* mBlindnessFader;
ScreenFader* mHitFader;
ScreenFader* mScreenFader;
DebugWindow* mDebugWindow;
2022-05-13 18:58:00 -07:00
PostProcessorHud* mPostProcessorHud;
JailScreen* mJailScreen;
ContainerWindow* mContainerWindow;
2022-09-22 21:26:05 +03:00
2022-08-31 21:07:59 +02:00
std::vector<std::unique_ptr<WindowBase>> mWindows;
2022-09-22 21:26:05 +03:00
Translation::Storage& mTranslationDataStorage;
2022-09-22 21:26:05 +03:00
2022-08-31 21:07:59 +02:00
std::unique_ptr<CharacterCreation> mCharGen;
2022-09-22 21:26:05 +03:00
2012-08-13 01:26:15 +02:00
MyGUI::Widget* mInputBlocker;
2022-09-22 21:26:05 +03:00
bool mCrosshairEnabled;
bool mSubtitlesEnabled;
bool mHitFaderEnabled;
bool mWerewolfOverlayEnabled;
bool mHudEnabled;
bool mCursorVisible;
2017-09-26 17:44:35 +02:00
bool mCursorActive;
2022-09-22 21:26:05 +03:00
int mPlayerBounty;
2022-09-22 21:26:05 +03:00
void setCursorVisible(bool visible) override;
2022-09-22 21:26:05 +03:00
2022-08-31 21:07:59 +02:00
std::unique_ptr<MyGUI::Gui> mGui; // Gui
2022-09-22 21:26:05 +03: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;
Initial commit: In ESM structures, replace the string members that are RefIds to other records, to a new strong type The strong type is actually just a string underneath, but this will help in the future to have a distinction so it's easier to search and replace when we use an integer ID Slowly going through all the changes to make, still hundreds of errors a lot of functions/structures use std::string or stringview to designate an ID. So it takes time Continues slowly replacing ids. There are technically more and more compilation errors I have good hope that there is a point where the amount of errors will dramatically go down as all the main functions use the ESM::RefId type Continue moving forward, changes to the stores slowly moving along Starting to see the fruit of those changes. still many many error, but more and more Irun into a situation where a function is sandwiched between two functions that use the RefId type. More replacements. Things are starting to get easier I can see more and more often the issue is that the function is awaiting a RefId, but is given a string there is less need to go down functions and to fix a long list of them. Still moving forward, and for the first time error count is going down! Good pace, not sure about topics though, mId and mName are actually the same thing and are used interchangeably Cells are back to using string for the name, haven't fixed everything yet. Many other changes Under the bar of 400 compilation errors. more good progress <100 compile errors! More progress Game settings store can use string for find, it was a bit absurd how every use of it required to create refId from string some more progress on other fronts Mostly game settings clean one error opened a lot of other errors. Down to 18, but more will prbably appear only link errors left?? Fixed link errors OpenMW compiles, and launches, with some issues, but still!
2022-09-25 13:17:09 +02:00
ESM::RefId mCloseSound;
ESM::RefId mOpenSound;
};
// 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).
std::vector<GuiMode> mGuiModes;
2022-08-31 21:07:59 +02:00
std::unique_ptr<SDLUtil::SDLCursorManager> mCursorManager;
std::vector<std::unique_ptr<Layout>> mGarbageDialogs;
void cleanupGarbage();
GuiWindow mShown; // Currently shown windows in inventory mode
2013-08-05 23:15:26 +02:00
GuiWindow mForceHidden; // Hidden windows (overrides mShown)
/* 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 20:18:41 +02:00
// is the rest window allowed?
bool mRestAllowed;
void updateVisible(); // Update visibility of all windows based on mode, shown and allowed settings
2015-05-26 16:40:44 +02:00
void updateMap();
2015-07-18 17:13:20 +02:00
int mShowOwned;
ToUTF8::FromType mEncoding;
std::string mVersionDescription;
bool mWindowVisible;
2017-07-24 13:25:01 +02:00
MWGui::TextColours mTextColours;
std::unique_ptr<KeyboardNavigation> mKeyboardNavigation;
2022-08-31 21:07:59 +02:00
std::unique_ptr<SDLUtil::VideoWrapper> mVideoWrapper;
float mScalingFactor;
struct ScheduledMessageBox
{
std::string mMessage;
MWGui::ShowInDialogueMode mShowInDialogueMode;
ScheduledMessageBox(std::string&& message, MWGui::ShowInDialogueMode showInDialogueMode)
: mMessage(std::move(message))
, mShowInDialogueMode(showInDialogueMode)
{
}
};
Misc::ScopeGuarded<std::vector<ScheduledMessageBox>> mScheduledMessageBoxes;
/**
* 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
* #{setting=CATEGORY_NAME,SETTING_NAME}: retrieves String value of SETTING_NAME under category CATEGORY_NAME
* from settings.cfg
* #{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, 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.
*/
void onRetrieveTag(const MyGUI::UString& _tag, MyGUI::UString& _result);
void onCursorChange(const std::string& name);
void onKeyFocusChanged(MyGUI::Widget* widget);
// Key pressed while playing a video
void onVideoKeyPressed(MyGUI::Widget* _sender, MyGUI::KeyCode _key, MyGUI::Char _char);
void sizeVideo(int screenWidth, int screenHeight);
void onClipboardChanged(const std::string& _type, const std::string& _data);
void onClipboardRequested(const std::string& _type, std::string& _data);
2015-05-02 18:06:54 +02:00
void createTextures();
void createCursors();
2015-05-02 18:06:54 +02:00
void setMenuTransparency(float value);
void updatePinnedWindows();
void enableScene(bool enable);
void handleScheduledMessageBoxes();
void pushGuiMode(GuiMode mode, const MWWorld::Ptr& arg, bool force);
void setCullMask(uint32_t mask) override;
uint32_t getCullMask() override;
Files::ConfigurationManager& mCfgMgr;
};
}
#endif