1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 20:53:50 +00:00

Issue #107: WindowManager is accessed only through the interface class from now on

This commit is contained in:
Marc Zinnschlag 2012-08-12 18:11:09 +02:00
parent 35a64edf2a
commit 6534c2a55a
93 changed files with 662 additions and 484 deletions

View file

@ -25,7 +25,7 @@ add_openmw_dir (mwinput
) )
add_openmw_dir (mwgui add_openmw_dir (mwgui
text_input widgets race class birth review window_manager console dialogue text_input widgets race class birth review windowmanagerimp console dialogue
dialogue_history window_base stats_window messagebox journalwindow charactercreation dialogue_history window_base stats_window messagebox journalwindow charactercreation
map_window window_pinnable_base cursorreplace tooltips scrollwindow bookwindow list map_window window_pinnable_base cursorreplace tooltips scrollwindow bookwindow list
formatting inventorywindow container hud countdialog tradewindow settingswindow formatting inventorywindow container hud countdialog tradewindow settingswindow
@ -66,7 +66,7 @@ add_openmw_dir (mwmechanics
add_openmw_dir (mwbase add_openmw_dir (mwbase
environment world scriptmanager dialoguemanager journal soundmanager mechanicsmanager environment world scriptmanager dialoguemanager journal soundmanager mechanicsmanager
inputmanager inputmanager windowmanager
) )
# Main executable # Main executable

View file

@ -15,7 +15,7 @@
#include "mwinput/inputmanagerimp.hpp" #include "mwinput/inputmanagerimp.hpp"
#include "mwgui/window_manager.hpp" #include "mwgui/windowmanagerimp.hpp"
#include "mwgui/cursorreplace.hpp" #include "mwgui/cursorreplace.hpp"
#include "mwscript/scriptmanagerimp.hpp" #include "mwscript/scriptmanagerimp.hpp"

View file

@ -10,6 +10,7 @@
#include "soundmanager.hpp" #include "soundmanager.hpp"
#include "mechanicsmanager.hpp" #include "mechanicsmanager.hpp"
#include "inputmanager.hpp" #include "inputmanager.hpp"
#include "windowmanager.hpp"
MWBase::Environment *MWBase::Environment::sThis = 0; MWBase::Environment *MWBase::Environment::sThis = 0;
@ -42,7 +43,7 @@ void MWBase::Environment::setScriptManager (ScriptManager *scriptManager)
mScriptManager = scriptManager; mScriptManager = scriptManager;
} }
void MWBase::Environment::setWindowManager (MWGui::WindowManager *windowManager) void MWBase::Environment::setWindowManager (WindowManager *windowManager)
{ {
mWindowManager = windowManager; mWindowManager = windowManager;
} }
@ -90,7 +91,7 @@ MWBase::ScriptManager *MWBase::Environment::getScriptManager() const
return mScriptManager; return mScriptManager;
} }
MWGui::WindowManager *MWBase::Environment::getWindowManager() const MWBase::WindowManager *MWBase::Environment::getWindowManager() const
{ {
assert (mWindowManager); assert (mWindowManager);
return mWindowManager; return mWindowManager;
@ -145,6 +146,10 @@ void MWBase::Environment::cleanup()
delete mScriptManager; delete mScriptManager;
mScriptManager = 0; mScriptManager = 0;
/// \todo Re-enable (currently throwing an exception)
// delete mWindowManager;
mWindowManager = 0;
delete mWorld; delete mWorld;
mWorld = 0; mWorld = 0;
} }

View file

@ -1,11 +1,6 @@
#ifndef GAME_BASE_INVIRONMENT_H #ifndef GAME_BASE_INVIRONMENT_H
#define GAME_BASE_INVIRONMENT_H #define GAME_BASE_INVIRONMENT_H
namespace MWGui
{
class WindowManager;
}
namespace MWBase namespace MWBase
{ {
class World; class World;
@ -15,6 +10,7 @@ namespace MWBase
class SoundManager; class SoundManager;
class MechanicsManager; class MechanicsManager;
class InputManager; class InputManager;
class WindowManager;
/// \brief Central hub for mw-subsystems /// \brief Central hub for mw-subsystems
/// ///
@ -29,7 +25,7 @@ namespace MWBase
World *mWorld; World *mWorld;
SoundManager *mSoundManager; SoundManager *mSoundManager;
ScriptManager *mScriptManager; ScriptManager *mScriptManager;
MWGui::WindowManager *mWindowManager; WindowManager *mWindowManager;
MechanicsManager *mMechanicsManager; MechanicsManager *mMechanicsManager;
DialogueManager *mDialogueManager; DialogueManager *mDialogueManager;
Journal *mJournal; Journal *mJournal;
@ -54,7 +50,7 @@ namespace MWBase
void setScriptManager (MWBase::ScriptManager *scriptManager); void setScriptManager (MWBase::ScriptManager *scriptManager);
void setWindowManager (MWGui::WindowManager *windowManager); void setWindowManager (WindowManager *windowManager);
void setMechanicsManager (MechanicsManager *mechanicsManager); void setMechanicsManager (MechanicsManager *mechanicsManager);
@ -73,7 +69,7 @@ namespace MWBase
ScriptManager *getScriptManager() const; ScriptManager *getScriptManager() const;
MWGui::WindowManager *getWindowManager() const; WindowManager *getWindowManager() const;
MechanicsManager *getMechanicsManager() const; MechanicsManager *getMechanicsManager() const;

View file

@ -0,0 +1,210 @@
#ifndef GAME_MWBASE_WINDOWMANAGER_H
#define GAME_MWBASE_WINDOWMANAGER_H
#include <string>
#include <vector>
#include <map>
#include <components/settings/settings.hpp>
#include "../mwmechanics/stat.hpp"
#include "../mwgui/mode.hpp"
namespace MyGUI
{
class Gui;
class Widget;
class UString;
}
namespace OEngine
{
namespace GUI
{
class Layout;
}
}
namespace ESM
{
struct Class;
}
namespace MWWorld
{
class CellStore;
class Ptr;
}
namespace MWGui
{
class Console;
class SpellWindow;
class TradeWindow;
class ConfirmationDialog;
class CountDialog;
class ScrollWindow;
class BookWindow;
class InventoryWindow;
class ContainerWindow;
class DialogueWindow;
}
namespace MWBase
{
/// \brief Interface for widnow manager (implemented in MWGui)
class WindowManager
{
WindowManager (const WindowManager&);
///< not implemented
WindowManager& operator= (const WindowManager&);
///< not implemented
public:
typedef std::vector<int> SkillList;
WindowManager() {}
virtual ~WindowManager() {}
/**
* Should be called each frame to update windows/gui elements.
* This could mean updating sizes of gui elements or opening
* new dialogs.
*/
virtual void update() = 0;
virtual void pushGuiMode (MWGui::GuiMode mode) = 0;
virtual void popGuiMode() = 0;
virtual void removeGuiMode (MWGui::GuiMode mode) = 0;
///< can be anywhere in the stack
virtual MWGui::GuiMode getMode() const = 0;
virtual bool isGuiMode() const = 0;
virtual void toggleVisible (MWGui::GuiWindow wnd) = 0;
/// Disallow all inventory mode windows
virtual void disallowAll() = 0;
/// Allow one or more windows
virtual void allow (MWGui::GuiWindow wnd) = 0;
virtual bool isAllowed (MWGui::GuiWindow wnd) const = 0;
/// \todo investigate, if we really need to expose every single lousy UI element to the outside world
virtual MWGui::DialogueWindow* getDialogueWindow() = 0;
virtual MWGui::ContainerWindow* getContainerWindow() = 0;
virtual MWGui::InventoryWindow* getInventoryWindow() = 0;
virtual MWGui::BookWindow* getBookWindow() = 0;
virtual MWGui::ScrollWindow* getScrollWindow() = 0;
virtual MWGui::CountDialog* getCountDialog() = 0;
virtual MWGui::ConfirmationDialog* getConfirmationDialog() = 0;
virtual MWGui::TradeWindow* getTradeWindow() = 0;
virtual MWGui::SpellWindow* getSpellWindow() = 0;
virtual MWGui::Console* getConsole() = 0;
virtual MyGUI::Gui* getGui() const = 0;
virtual void wmUpdateFps(float fps, unsigned int triangleCount, unsigned int batchCount) = 0;
/// Set value for the given ID.
virtual void setValue (const std::string& id, const MWMechanics::Stat<int>& value) = 0;
virtual void setValue (int parSkill, const MWMechanics::Stat<float>& value) = 0;
virtual void setValue (const std::string& id, const MWMechanics::DynamicStat<int>& value) = 0;
virtual void setValue (const std::string& id, const std::string& value) = 0;
virtual void setValue (const std::string& id, int value) = 0;
virtual void setPlayerClass (const ESM::Class &class_) = 0;
///< set current class of player
virtual void configureSkills (const SkillList& major, const SkillList& minor) = 0;
///< configure skill groups, each set contains the skill ID for that group.
virtual void setReputation (int reputation) = 0;
///< set the current reputation value
virtual void setBounty (int bounty) = 0;
///< set the current bounty value
virtual void updateSkillArea() = 0;
///< update display of skills, factions, birth sign, reputation and bounty
virtual void changeCell(MWWorld::CellStore* cell) = 0;
///< change the active cell
virtual void setPlayerPos(const float x, const float y) = 0;
///< set player position in map space
virtual void setPlayerDir(const float x, const float y) = 0;
///< set player view direction in map space
virtual void setFocusObject(const MWWorld::Ptr& focus) = 0;
virtual void setFocusObjectScreenCoords(float min_x, float min_y, float max_x, float max_y) = 0;
virtual void setMouseVisible(bool visible) = 0;
virtual void getMousePosition(int &x, int &y) = 0;
virtual void getMousePosition(float &x, float &y) = 0;
virtual void setDragDrop(bool dragDrop) = 0;
virtual bool getWorldMouseOver() = 0;
virtual void toggleFogOfWar() = 0;
virtual void toggleFullHelp() = 0;
///< show extra info in item tooltips (owner, script)
virtual bool getFullHelp() const = 0;
virtual void setInteriorMapTexture(const int x, const int y) = 0;
///< set the index of the map texture that should be used (for interiors)
/// sets the visibility of the hud health/magicka/stamina bars
virtual void setHMSVisibility(bool visible) = 0;
/// sets the visibility of the hud minimap
virtual void setMinimapVisibility(bool visible) = 0;
virtual void setWeaponVisibility(bool visible) = 0;
virtual void setSpellVisibility(bool visible) = 0;
virtual void setSelectedSpell(const std::string& spellId, int successChancePercent) = 0;
virtual void setSelectedEnchantItem(const MWWorld::Ptr& item, int chargePercent) = 0;
virtual void setSelectedWeapon(const MWWorld::Ptr& item, int durabilityPercent) = 0;
virtual void unsetSelectedSpell() = 0;
virtual void unsetSelectedWeapon() = 0;
virtual void removeDialog(OEngine::GUI::Layout* dialog) = 0;
///< Hides dialog and schedules dialog to be deleted.
virtual void messageBox (const std::string& message, const std::vector<std::string>& buttons) = 0;
virtual int readPressedButton() = 0;
///< returns the index of the pressed button or -1 if no button was pressed (->MessageBoxmanager->InteractiveMessageBox)
virtual void onFrame (float frameDuration) = 0;
/// \todo get rid of this stuff. Move it to the respective UI element classes, if needed.
virtual std::map<int, MWMechanics::Stat<float> > getPlayerSkillValues() = 0;
virtual std::map<int, MWMechanics::Stat<int> > getPlayerAttributeValues() = 0;
virtual SkillList getPlayerMinorSkills() = 0;
virtual SkillList getPlayerMajorSkills() = 0;
/**
* 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.
*/
virtual const std::string &getGameSettingString(const std::string &id, const std::string &default_) = 0;
virtual void processChangedSettings(const Settings::CategorySettingVector& changed) = 0;
virtual void executeInConsole (const std::string& path) = 0;
};
}
#endif

View file

@ -4,6 +4,7 @@
#include <components/esm/loadacti.hpp> #include <components/esm/loadacti.hpp>
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwworld//cellstore.hpp" #include "../mwworld//cellstore.hpp"
#include "../mwworld/ptr.hpp" #include "../mwworld/ptr.hpp"
@ -12,7 +13,6 @@
#include "../mwrender/objects.hpp" #include "../mwrender/objects.hpp"
#include "../mwrender/renderinginterface.hpp" #include "../mwrender/renderinginterface.hpp"
#include "../mwgui/window_manager.hpp"
#include "../mwgui/tooltips.hpp" #include "../mwgui/tooltips.hpp"
namespace MWClass namespace MWClass
@ -34,7 +34,7 @@ namespace MWClass
physics.insertObjectPhysics(ptr, model); physics.insertObjectPhysics(ptr, model);
} }
} }
std::string Activator::getModel(const MWWorld::Ptr &ptr) const std::string Activator::getModel(const MWWorld::Ptr &ptr) const
{ {
MWWorld::LiveCellRef<ESM::Activator> *ref = MWWorld::LiveCellRef<ESM::Activator> *ref =
@ -104,4 +104,3 @@ namespace MWClass
return MWWorld::Ptr(&cell.activators.insert(*ref), &cell); return MWWorld::Ptr(&cell.activators.insert(*ref), &cell);
} }
} }

View file

@ -6,6 +6,7 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp" #include "../mwbase/soundmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwworld/ptr.hpp" #include "../mwworld/ptr.hpp"
#include "../mwworld/actiontake.hpp" #include "../mwworld/actiontake.hpp"
@ -16,7 +17,6 @@
#include "../mwrender/objects.hpp" #include "../mwrender/objects.hpp"
#include "../mwrender/renderinginterface.hpp" #include "../mwrender/renderinginterface.hpp"
#include "../mwgui/window_manager.hpp"
#include "../mwgui/tooltips.hpp" #include "../mwgui/tooltips.hpp"
namespace MWClass namespace MWClass

View file

@ -8,6 +8,7 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp" #include "../mwbase/soundmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwworld/ptr.hpp" #include "../mwworld/ptr.hpp"
#include "../mwworld/actiontake.hpp" #include "../mwworld/actiontake.hpp"
@ -19,7 +20,6 @@
#include "../mwrender/objects.hpp" #include "../mwrender/objects.hpp"
#include "../mwrender/renderinginterface.hpp" #include "../mwrender/renderinginterface.hpp"
#include "../mwgui/window_manager.hpp"
#include "../mwgui/tooltips.hpp" #include "../mwgui/tooltips.hpp"
namespace MWClass namespace MWClass

View file

@ -6,6 +6,7 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp" #include "../mwbase/soundmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwworld/ptr.hpp" #include "../mwworld/ptr.hpp"
#include "../mwworld/actionread.hpp" #include "../mwworld/actionread.hpp"
@ -15,7 +16,6 @@
#include "../mwrender/objects.hpp" #include "../mwrender/objects.hpp"
#include "../mwrender/renderinginterface.hpp" #include "../mwrender/renderinginterface.hpp"
#include "../mwgui/window_manager.hpp"
#include "../mwgui/tooltips.hpp" #include "../mwgui/tooltips.hpp"
namespace MWClass namespace MWClass

View file

@ -6,6 +6,7 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp" #include "../mwbase/soundmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwworld/ptr.hpp" #include "../mwworld/ptr.hpp"
#include "../mwworld/actiontake.hpp" #include "../mwworld/actiontake.hpp"
@ -15,7 +16,6 @@
#include "../mwworld/physicssystem.hpp" #include "../mwworld/physicssystem.hpp"
#include "../mwgui/tooltips.hpp" #include "../mwgui/tooltips.hpp"
#include "../mwgui/window_manager.hpp"
#include "../mwrender/objects.hpp" #include "../mwrender/objects.hpp"
#include "../mwrender/renderinginterface.hpp" #include "../mwrender/renderinginterface.hpp"

View file

@ -6,6 +6,7 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp" #include "../mwbase/soundmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwworld/ptr.hpp" #include "../mwworld/ptr.hpp"
#include "../mwworld/nullaction.hpp" #include "../mwworld/nullaction.hpp"
@ -15,7 +16,6 @@
#include "../mwworld/actionopen.hpp" #include "../mwworld/actionopen.hpp"
#include "../mwworld/physicssystem.hpp" #include "../mwworld/physicssystem.hpp"
#include "../mwgui/window_manager.hpp"
#include "../mwgui/tooltips.hpp" #include "../mwgui/tooltips.hpp"
#include "../mwrender/objects.hpp" #include "../mwrender/objects.hpp"

View file

@ -8,6 +8,7 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/mechanicsmanager.hpp" #include "../mwbase/mechanicsmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwworld/ptr.hpp" #include "../mwworld/ptr.hpp"
#include "../mwworld/actiontalk.hpp" #include "../mwworld/actiontalk.hpp"
@ -17,7 +18,6 @@
#include "../mwrender/renderinginterface.hpp" #include "../mwrender/renderinginterface.hpp"
#include "../mwgui/window_manager.hpp"
#include "../mwgui/tooltips.hpp" #include "../mwgui/tooltips.hpp"
namespace namespace

View file

@ -6,6 +6,7 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp" #include "../mwbase/soundmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwworld/player.hpp" #include "../mwworld/player.hpp"
#include "../mwworld/ptr.hpp" #include "../mwworld/ptr.hpp"
@ -14,7 +15,6 @@
#include "../mwworld/cellstore.hpp" #include "../mwworld/cellstore.hpp"
#include "../mwworld/physicssystem.hpp" #include "../mwworld/physicssystem.hpp"
#include "../mwgui/window_manager.hpp"
#include "../mwgui/tooltips.hpp" #include "../mwgui/tooltips.hpp"
#include "../mwrender/objects.hpp" #include "../mwrender/objects.hpp"

View file

@ -6,13 +6,13 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp" #include "../mwbase/soundmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwworld/ptr.hpp" #include "../mwworld/ptr.hpp"
#include "../mwworld/actiontake.hpp" #include "../mwworld/actiontake.hpp"
#include "../mwworld/cellstore.hpp" #include "../mwworld/cellstore.hpp"
#include "../mwworld/physicssystem.hpp" #include "../mwworld/physicssystem.hpp"
#include "../mwgui/window_manager.hpp"
#include "../mwgui/tooltips.hpp" #include "../mwgui/tooltips.hpp"
#include "../mwrender/objects.hpp" #include "../mwrender/objects.hpp"

View file

@ -6,6 +6,7 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp" #include "../mwbase/soundmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwworld/ptr.hpp" #include "../mwworld/ptr.hpp"
#include "../mwworld/actiontake.hpp" #include "../mwworld/actiontake.hpp"
@ -15,7 +16,6 @@
#include "../mwworld/cellstore.hpp" #include "../mwworld/cellstore.hpp"
#include "../mwworld/physicssystem.hpp" #include "../mwworld/physicssystem.hpp"
#include "../mwgui/window_manager.hpp"
#include "../mwgui/tooltips.hpp" #include "../mwgui/tooltips.hpp"
#include "../mwrender/objects.hpp" #include "../mwrender/objects.hpp"

View file

@ -6,6 +6,7 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp" #include "../mwbase/soundmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwworld/ptr.hpp" #include "../mwworld/ptr.hpp"
#include "../mwworld/actiontake.hpp" #include "../mwworld/actiontake.hpp"
@ -14,7 +15,6 @@
#include "../mwworld/cellstore.hpp" #include "../mwworld/cellstore.hpp"
#include "../mwworld/physicssystem.hpp" #include "../mwworld/physicssystem.hpp"
#include "../mwgui/window_manager.hpp"
#include "../mwgui/tooltips.hpp" #include "../mwgui/tooltips.hpp"
#include "../mwrender/objects.hpp" #include "../mwrender/objects.hpp"

View file

@ -8,6 +8,7 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp" #include "../mwbase/soundmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwworld/ptr.hpp" #include "../mwworld/ptr.hpp"
#include "../mwworld/actiontake.hpp" #include "../mwworld/actiontake.hpp"
@ -15,7 +16,6 @@
#include "../mwworld/physicssystem.hpp" #include "../mwworld/physicssystem.hpp"
#include "../mwworld/manualref.hpp" #include "../mwworld/manualref.hpp"
#include "../mwgui/window_manager.hpp"
#include "../mwgui/tooltips.hpp" #include "../mwgui/tooltips.hpp"
#include "../mwrender/objects.hpp" #include "../mwrender/objects.hpp"

View file

@ -12,6 +12,7 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/mechanicsmanager.hpp" #include "../mwbase/mechanicsmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwmechanics/creaturestats.hpp" #include "../mwmechanics/creaturestats.hpp"
#include "../mwmechanics/npcstats.hpp" #include "../mwmechanics/npcstats.hpp"
@ -26,7 +27,6 @@
#include "../mwrender/actors.hpp" #include "../mwrender/actors.hpp"
#include "../mwrender/renderinginterface.hpp" #include "../mwrender/renderinginterface.hpp"
#include "../mwgui/window_manager.hpp"
#include "../mwgui/tooltips.hpp" #include "../mwgui/tooltips.hpp"
namespace namespace

View file

@ -6,6 +6,7 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp" #include "../mwbase/soundmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwworld/ptr.hpp" #include "../mwworld/ptr.hpp"
#include "../mwworld/actiontake.hpp" #include "../mwworld/actiontake.hpp"
@ -14,7 +15,6 @@
#include "../mwworld/physicssystem.hpp" #include "../mwworld/physicssystem.hpp"
#include "../mwworld/player.hpp" #include "../mwworld/player.hpp"
#include "../mwgui/window_manager.hpp"
#include "../mwgui/tooltips.hpp" #include "../mwgui/tooltips.hpp"
#include "../mwrender/objects.hpp" #include "../mwrender/objects.hpp"

View file

@ -6,6 +6,7 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp" #include "../mwbase/soundmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwworld/ptr.hpp" #include "../mwworld/ptr.hpp"
#include "../mwworld/actiontake.hpp" #include "../mwworld/actiontake.hpp"
@ -14,7 +15,6 @@
#include "../mwworld/cellstore.hpp" #include "../mwworld/cellstore.hpp"
#include "../mwworld/physicssystem.hpp" #include "../mwworld/physicssystem.hpp"
#include "../mwgui/window_manager.hpp"
#include "../mwgui/tooltips.hpp" #include "../mwgui/tooltips.hpp"
#include "../mwrender/objects.hpp" #include "../mwrender/objects.hpp"

View file

@ -6,13 +6,13 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp" #include "../mwbase/soundmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwworld/ptr.hpp" #include "../mwworld/ptr.hpp"
#include "../mwworld/actiontake.hpp" #include "../mwworld/actiontake.hpp"
#include "../mwworld/cellstore.hpp" #include "../mwworld/cellstore.hpp"
#include "../mwworld/physicssystem.hpp" #include "../mwworld/physicssystem.hpp"
#include "../mwgui/window_manager.hpp"
#include "../mwgui/tooltips.hpp" #include "../mwgui/tooltips.hpp"
#include "../mwrender/objects.hpp" #include "../mwrender/objects.hpp"

View file

@ -6,6 +6,7 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp" #include "../mwbase/soundmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwworld/ptr.hpp" #include "../mwworld/ptr.hpp"
#include "../mwworld/actiontake.hpp" #include "../mwworld/actiontake.hpp"
@ -14,7 +15,6 @@
#include "../mwworld/cellstore.hpp" #include "../mwworld/cellstore.hpp"
#include "../mwworld/physicssystem.hpp" #include "../mwworld/physicssystem.hpp"
#include "../mwgui/window_manager.hpp"
#include "../mwgui/tooltips.hpp" #include "../mwgui/tooltips.hpp"
#include "../mwrender/objects.hpp" #include "../mwrender/objects.hpp"

View file

@ -13,6 +13,7 @@
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/scriptmanager.hpp" #include "../mwbase/scriptmanager.hpp"
#include "../mwbase/journal.hpp" #include "../mwbase/journal.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwworld/class.hpp" #include "../mwworld/class.hpp"
#include "../mwworld/refdata.hpp" #include "../mwworld/refdata.hpp"
@ -20,22 +21,20 @@
#include "../mwworld/containerstore.hpp" #include "../mwworld/containerstore.hpp"
#include "../mwgui/dialogue.hpp" #include "../mwgui/dialogue.hpp"
#include "../mwgui/window_manager.hpp"
#include <iostream> #include <iostream>
#include "../mwscript/extensions.hpp"
#include <components/compiler/exception.hpp> #include <components/compiler/exception.hpp>
#include <components/compiler/errorhandler.hpp> #include <components/compiler/errorhandler.hpp>
#include <components/compiler/scanner.hpp> #include <components/compiler/scanner.hpp>
#include <components/compiler/locals.hpp> #include <components/compiler/locals.hpp>
#include <components/compiler/output.hpp> #include <components/compiler/output.hpp>
#include <components/compiler/scriptparser.hpp>
#include <components/interpreter/interpreter.hpp> #include <components/interpreter/interpreter.hpp>
#include "../mwscript/compilercontext.hpp" #include "../mwscript/compilercontext.hpp"
#include "../mwscript/interpretercontext.hpp" #include "../mwscript/interpretercontext.hpp"
#include <components/compiler/scriptparser.hpp> #include "../mwscript/extensions.hpp"
#include "../mwclass/npc.hpp" #include "../mwclass/npc.hpp"
#include "../mwmechanics/npcstats.hpp" #include "../mwmechanics/npcstats.hpp"

View file

@ -5,8 +5,8 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwgui/window_manager.hpp"
#include "../mwgui/messagebox.hpp" #include "../mwgui/messagebox.hpp"
namespace MWDialogue namespace MWDialogue

View file

@ -5,13 +5,12 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp" #include "../mwbase/soundmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwworld/player.hpp" #include "../mwworld/player.hpp"
#include "../mwworld/manualref.hpp" #include "../mwworld/manualref.hpp"
#include "../mwworld/containerstore.hpp" #include "../mwworld/containerstore.hpp"
#include "window_manager.hpp"
namespace namespace
{ {
std::string getIconPath(MWWorld::Ptr ptr) std::string getIconPath(MWWorld::Ptr ptr)
@ -27,7 +26,7 @@ namespace
namespace MWGui namespace MWGui
{ {
AlchemyWindow::AlchemyWindow(WindowManager& parWindowManager) AlchemyWindow::AlchemyWindow(MWBase::WindowManager& parWindowManager)
: WindowBase("openmw_alchemy_window.layout", parWindowManager) : WindowBase("openmw_alchemy_window.layout", parWindowManager)
, ContainerBase(0) , ContainerBase(0)
{ {

View file

@ -10,7 +10,7 @@ namespace MWGui
class AlchemyWindow : public WindowBase, public ContainerBase class AlchemyWindow : public WindowBase, public ContainerBase
{ {
public: public:
AlchemyWindow(WindowManager& parWindowManager); AlchemyWindow(MWBase::WindowManager& parWindowManager);
virtual void open(); virtual void open();

View file

@ -7,14 +7,14 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/windowmanager.hpp"
#include "window_manager.hpp"
#include "widgets.hpp" #include "widgets.hpp"
using namespace MWGui; using namespace MWGui;
using namespace Widgets; using namespace Widgets;
BirthDialog::BirthDialog(WindowManager& parWindowManager) BirthDialog::BirthDialog(MWBase::WindowManager& parWindowManager)
: WindowBase("openmw_chargen_birth.layout", parWindowManager) : WindowBase("openmw_chargen_birth.layout", parWindowManager)
{ {
// Centre dialog // Centre dialog

View file

@ -10,14 +10,13 @@
namespace MWGui namespace MWGui
{ {
/// \todo remove
using namespace MyGUI; using namespace MyGUI;
class WindowManager;
class BirthDialog : public WindowBase class BirthDialog : public WindowBase
{ {
public: public:
BirthDialog(WindowManager& parWindowManager); BirthDialog(MWBase::WindowManager& parWindowManager);
enum Gender enum Gender
{ {

View file

@ -5,16 +5,16 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp" #include "../mwbase/soundmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwworld/actiontake.hpp" #include "../mwworld/actiontake.hpp"
#include "../mwworld/player.hpp" #include "../mwworld/player.hpp"
#include "formatting.hpp" #include "formatting.hpp"
#include "window_manager.hpp"
using namespace MWGui; using namespace MWGui;
BookWindow::BookWindow (WindowManager& parWindowManager) : BookWindow::BookWindow (MWBase::WindowManager& parWindowManager) :
WindowBase("openmw_book.layout", parWindowManager) WindowBase("openmw_book.layout", parWindowManager)
{ {
getWidget(mCloseButton, "CloseButton"); getWidget(mCloseButton, "CloseButton");

View file

@ -10,7 +10,7 @@ namespace MWGui
class BookWindow : public WindowBase class BookWindow : public WindowBase
{ {
public: public:
BookWindow(WindowManager& parWindowManager); BookWindow(MWBase::WindowManager& parWindowManager);
void open(MWWorld::Ptr book); void open(MWWorld::Ptr book);
void setTakeButtonShow(bool show); void setTakeButtonShow(bool show);
@ -43,4 +43,3 @@ namespace MWGui
} }
#endif #endif

View file

@ -116,7 +116,7 @@ namespace
using namespace MWGui; using namespace MWGui;
CharacterCreation::CharacterCreation(WindowManager* _wm) CharacterCreation::CharacterCreation(MWBase::WindowManager* _wm)
: mNameDialog(0) : mNameDialog(0)
, mRaceDialog(0) , mRaceDialog(0)
, mClassChoiceDialog(0) , mClassChoiceDialog(0)

View file

@ -1,17 +1,15 @@
#ifndef CHARACTER_CREATION_HPP #ifndef CHARACTER_CREATION_HPP
#define CHARACTER_CREATION_HPP #define CHARACTER_CREATION_HPP
#include "window_manager.hpp"
#include <components/esm_store/store.hpp> #include <components/esm_store/store.hpp>
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwmechanics/stat.hpp" #include "../mwmechanics/stat.hpp"
namespace MWGui namespace MWGui
{ {
class WindowManager;
class WindowBase; class WindowBase;
class TextInputDialog; class TextInputDialog;
@ -31,7 +29,7 @@ namespace MWGui
public: public:
typedef std::vector<int> SkillList; typedef std::vector<int> SkillList;
CharacterCreation(WindowManager* _wm); CharacterCreation(MWBase::WindowManager* _wm);
~CharacterCreation(); ~CharacterCreation();
//Show a dialog //Show a dialog
@ -60,7 +58,7 @@ namespace MWGui
BirthDialog* mBirthSignDialog; BirthDialog* mBirthSignDialog;
ReviewDialog* mReviewDialog; ReviewDialog* mReviewDialog;
WindowManager* mWM; MWBase::WindowManager* mWM;
//Player data //Player data
std::string mPlayerName; std::string mPlayerName;

View file

@ -9,8 +9,8 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/windowmanager.hpp"
#include "window_manager.hpp"
#include "tooltips.hpp" #include "tooltips.hpp"
#undef min #undef min
@ -20,7 +20,7 @@ using namespace MWGui;
/* GenerateClassResultDialog */ /* GenerateClassResultDialog */
GenerateClassResultDialog::GenerateClassResultDialog(WindowManager& parWindowManager) GenerateClassResultDialog::GenerateClassResultDialog(MWBase::WindowManager& parWindowManager)
: WindowBase("openmw_chargen_generate_class_result.layout", parWindowManager) : WindowBase("openmw_chargen_generate_class_result.layout", parWindowManager)
{ {
// Centre dialog // Centre dialog
@ -77,7 +77,7 @@ void GenerateClassResultDialog::onBackClicked(MyGUI::Widget* _sender)
/* PickClassDialog */ /* PickClassDialog */
PickClassDialog::PickClassDialog(WindowManager& parWindowManager) PickClassDialog::PickClassDialog(MWBase::WindowManager& parWindowManager)
: WindowBase("openmw_chargen_class.layout", parWindowManager) : WindowBase("openmw_chargen_class.layout", parWindowManager)
{ {
// Centre dialog // Centre dialog
@ -283,7 +283,7 @@ void InfoBoxDialog::layoutVertically(MyGUI::WidgetPtr widget, int margin)
widget->setSize(width, pos); widget->setSize(width, pos);
} }
InfoBoxDialog::InfoBoxDialog(WindowManager& parWindowManager) InfoBoxDialog::InfoBoxDialog(MWBase::WindowManager& parWindowManager)
: WindowBase("openmw_infobox.layout", parWindowManager) : WindowBase("openmw_infobox.layout", parWindowManager)
, mCurrentButton(-1) , mCurrentButton(-1)
{ {
@ -367,7 +367,7 @@ void InfoBoxDialog::onButtonClicked(MyGUI::WidgetPtr _sender)
/* ClassChoiceDialog */ /* ClassChoiceDialog */
ClassChoiceDialog::ClassChoiceDialog(WindowManager& parWindowManager) ClassChoiceDialog::ClassChoiceDialog(MWBase::WindowManager& parWindowManager)
: InfoBoxDialog(parWindowManager) : InfoBoxDialog(parWindowManager)
{ {
setText(""); setText("");
@ -381,7 +381,7 @@ ClassChoiceDialog::ClassChoiceDialog(WindowManager& parWindowManager)
/* CreateClassDialog */ /* CreateClassDialog */
CreateClassDialog::CreateClassDialog(WindowManager& parWindowManager) CreateClassDialog::CreateClassDialog(MWBase::WindowManager& parWindowManager)
: WindowBase("openmw_chargen_create_class.layout", parWindowManager) : WindowBase("openmw_chargen_create_class.layout", parWindowManager)
, mSpecDialog(nullptr) , mSpecDialog(nullptr)
, mAttribDialog(nullptr) , mAttribDialog(nullptr)
@ -694,7 +694,7 @@ void CreateClassDialog::onBackClicked(MyGUI::Widget* _sender)
/* SelectSpecializationDialog */ /* SelectSpecializationDialog */
SelectSpecializationDialog::SelectSpecializationDialog(WindowManager& parWindowManager) SelectSpecializationDialog::SelectSpecializationDialog(MWBase::WindowManager& parWindowManager)
: WindowBase("openmw_chargen_select_specialization.layout", parWindowManager) : WindowBase("openmw_chargen_select_specialization.layout", parWindowManager)
{ {
// Centre dialog // Centre dialog
@ -759,7 +759,7 @@ void SelectSpecializationDialog::onCancelClicked(MyGUI::Widget* _sender)
/* SelectAttributeDialog */ /* SelectAttributeDialog */
SelectAttributeDialog::SelectAttributeDialog(WindowManager& parWindowManager) SelectAttributeDialog::SelectAttributeDialog(MWBase::WindowManager& parWindowManager)
: WindowBase("openmw_chargen_select_attribute.layout", parWindowManager) : WindowBase("openmw_chargen_select_attribute.layout", parWindowManager)
{ {
// Centre dialog // Centre dialog
@ -811,7 +811,7 @@ void SelectAttributeDialog::onCancelClicked(MyGUI::Widget* _sender)
/* SelectSkillDialog */ /* SelectSkillDialog */
SelectSkillDialog::SelectSkillDialog(WindowManager& parWindowManager) SelectSkillDialog::SelectSkillDialog(MWBase::WindowManager& parWindowManager)
: WindowBase("openmw_chargen_select_skill.layout", parWindowManager) : WindowBase("openmw_chargen_select_skill.layout", parWindowManager)
{ {
// Centre dialog // Centre dialog
@ -907,7 +907,7 @@ void SelectSkillDialog::onCancelClicked(MyGUI::Widget* _sender)
/* DescriptionDialog */ /* DescriptionDialog */
DescriptionDialog::DescriptionDialog(WindowManager& parWindowManager) DescriptionDialog::DescriptionDialog(MWBase::WindowManager& parWindowManager)
: WindowBase("openmw_chargen_class_description.layout", parWindowManager) : WindowBase("openmw_chargen_class_description.layout", parWindowManager)
{ {
// Centre dialog // Centre dialog

View file

@ -12,14 +12,13 @@
namespace MWGui namespace MWGui
{ {
/// \todo remove!
using namespace MyGUI; using namespace MyGUI;
class WindowManager;
class InfoBoxDialog : public WindowBase class InfoBoxDialog : public WindowBase
{ {
public: public:
InfoBoxDialog(WindowManager& parWindowManager); InfoBoxDialog(MWBase::WindowManager& parWindowManager);
typedef std::vector<std::string> ButtonList; typedef std::vector<std::string> ButtonList;
@ -64,13 +63,13 @@ namespace MWGui
Class_Create = 2, Class_Create = 2,
Class_Back = 3 Class_Back = 3
}; };
ClassChoiceDialog(WindowManager& parWindowManager); ClassChoiceDialog(MWBase::WindowManager& parWindowManager);
}; };
class GenerateClassResultDialog : public WindowBase class GenerateClassResultDialog : public WindowBase
{ {
public: public:
GenerateClassResultDialog(WindowManager& parWindowManager); GenerateClassResultDialog(MWBase::WindowManager& parWindowManager);
std::string getClassId() const; std::string getClassId() const;
void setClassId(const std::string &classId); void setClassId(const std::string &classId);
@ -99,7 +98,7 @@ namespace MWGui
class PickClassDialog : public WindowBase class PickClassDialog : public WindowBase
{ {
public: public:
PickClassDialog(WindowManager& parWindowManager); PickClassDialog(MWBase::WindowManager& parWindowManager);
const std::string &getClassId() const { return mCurrentClassId; } const std::string &getClassId() const { return mCurrentClassId; }
void setClassId(const std::string &classId); void setClassId(const std::string &classId);
@ -138,7 +137,7 @@ namespace MWGui
class SelectSpecializationDialog : public WindowBase class SelectSpecializationDialog : public WindowBase
{ {
public: public:
SelectSpecializationDialog(WindowManager& parWindowManager); SelectSpecializationDialog(MWBase::WindowManager& parWindowManager);
~SelectSpecializationDialog(); ~SelectSpecializationDialog();
ESM::Class::Specialization getSpecializationId() const { return mSpecializationId; } ESM::Class::Specialization getSpecializationId() const { return mSpecializationId; }
@ -169,7 +168,7 @@ namespace MWGui
class SelectAttributeDialog : public WindowBase class SelectAttributeDialog : public WindowBase
{ {
public: public:
SelectAttributeDialog(WindowManager& parWindowManager); SelectAttributeDialog(MWBase::WindowManager& parWindowManager);
~SelectAttributeDialog(); ~SelectAttributeDialog();
ESM::Attribute::AttributeID getAttributeId() const { return mAttributeId; } ESM::Attribute::AttributeID getAttributeId() const { return mAttributeId; }
@ -202,7 +201,7 @@ namespace MWGui
class SelectSkillDialog : public WindowBase class SelectSkillDialog : public WindowBase
{ {
public: public:
SelectSkillDialog(WindowManager& parWindowManager); SelectSkillDialog(MWBase::WindowManager& parWindowManager);
~SelectSkillDialog(); ~SelectSkillDialog();
ESM::Skill::SkillEnum getSkillId() const { return mSkillId; } ESM::Skill::SkillEnum getSkillId() const { return mSkillId; }
@ -238,7 +237,7 @@ namespace MWGui
class DescriptionDialog : public WindowBase class DescriptionDialog : public WindowBase
{ {
public: public:
DescriptionDialog(WindowManager& parWindowManager); DescriptionDialog(MWBase::WindowManager& parWindowManager);
~DescriptionDialog(); ~DescriptionDialog();
std::string getTextInput() const { return mTextEdit ? mTextEdit->getOnlyText() : ""; } std::string getTextInput() const { return mTextEdit ? mTextEdit->getOnlyText() : ""; }
@ -254,7 +253,7 @@ namespace MWGui
class CreateClassDialog : public WindowBase class CreateClassDialog : public WindowBase
{ {
public: public:
CreateClassDialog(WindowManager& parWindowManager); CreateClassDialog(MWBase::WindowManager& parWindowManager);
virtual ~CreateClassDialog(); virtual ~CreateClassDialog();
std::string getName() const; std::string getName() const;

View file

@ -7,7 +7,7 @@
namespace MWGui namespace MWGui
{ {
ConfirmationDialog::ConfirmationDialog(WindowManager& parWindowManager) : ConfirmationDialog::ConfirmationDialog(MWBase::WindowManager& parWindowManager) :
WindowBase("openmw_confirmation_dialog.layout", parWindowManager) WindowBase("openmw_confirmation_dialog.layout", parWindowManager)
{ {
getWidget(mMessage, "Message"); getWidget(mMessage, "Message");

View file

@ -8,7 +8,7 @@ namespace MWGui
class ConfirmationDialog : public WindowBase class ConfirmationDialog : public WindowBase
{ {
public: public:
ConfirmationDialog(WindowManager& parWindowManager); ConfirmationDialog(MWBase::WindowManager& parWindowManager);
void open(const std::string& message); void open(const std::string& message);
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void; typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;

View file

@ -11,6 +11,7 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp" #include "../mwbase/soundmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwworld/manualref.hpp" #include "../mwworld/manualref.hpp"
#include "../mwworld/containerstore.hpp" #include "../mwworld/containerstore.hpp"
@ -19,7 +20,6 @@
#include "../mwclass/container.hpp" #include "../mwclass/container.hpp"
#include "window_manager.hpp"
#include "widgets.hpp" #include "widgets.hpp"
#include "countdialog.hpp" #include "countdialog.hpp"
#include "tradewindow.hpp" #include "tradewindow.hpp"
@ -591,7 +591,7 @@ MWWorld::ContainerStore& ContainerBase::getContainerStore()
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
ContainerWindow::ContainerWindow(WindowManager& parWindowManager,DragAndDrop* dragAndDrop) ContainerWindow::ContainerWindow(MWBase::WindowManager& parWindowManager,DragAndDrop* dragAndDrop)
: ContainerBase(dragAndDrop) : ContainerBase(dragAndDrop)
, WindowBase("openmw_container_window.layout", parWindowManager) , WindowBase("openmw_container_window.layout", parWindowManager)
{ {

View file

@ -127,7 +127,7 @@ namespace MWGui
class ContainerWindow : public ContainerBase, public WindowBase class ContainerWindow : public ContainerBase, public WindowBase
{ {
public: public:
ContainerWindow(WindowManager& parWindowManager,DragAndDrop* dragAndDrop); ContainerWindow(MWBase::WindowManager& parWindowManager,DragAndDrop* dragAndDrop);
virtual ~ContainerWindow(); virtual ~ContainerWindow();

View file

@ -7,7 +7,7 @@
namespace MWGui namespace MWGui
{ {
CountDialog::CountDialog(WindowManager& parWindowManager) : CountDialog::CountDialog(MWBase::WindowManager& parWindowManager) :
WindowBase("openmw_count_window.layout", parWindowManager) WindowBase("openmw_count_window.layout", parWindowManager)
{ {
getWidget(mSlider, "CountSlider"); getWidget(mSlider, "CountSlider");

View file

@ -8,7 +8,7 @@ namespace MWGui
class CountDialog : public WindowBase class CountDialog : public WindowBase
{ {
public: public:
CountDialog(WindowManager& parWindowManager); CountDialog(MWBase::WindowManager& parWindowManager);
void open(const std::string& item, const std::string& message, const int maxCount); void open(const std::string& item, const std::string& message, const int maxCount);
typedef MyGUI::delegates::CMultiDelegate2<MyGUI::Widget*, int> EventHandle_WidgetInt; typedef MyGUI::delegates::CMultiDelegate2<MyGUI::Widget*, int> EventHandle_WidgetInt;

View file

@ -11,9 +11,9 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/dialoguemanager.hpp" #include "../mwbase/dialoguemanager.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/windowmanager.hpp"
#include "dialogue_history.hpp" #include "dialogue_history.hpp"
#include "window_manager.hpp"
#include "widgets.hpp" #include "widgets.hpp"
#include "list.hpp" #include "list.hpp"
#include "tradewindow.hpp" #include "tradewindow.hpp"
@ -42,7 +42,7 @@ std::string::size_type find_str_ci(const std::string& str, const std::string& su
} }
DialogueWindow::DialogueWindow(WindowManager& parWindowManager) DialogueWindow::DialogueWindow(MWBase::WindowManager& parWindowManager)
: WindowBase("openmw_dialogue_window.layout", parWindowManager) : WindowBase("openmw_dialogue_window.layout", parWindowManager)
, mEnabled(true) , mEnabled(true)
, mShowTrade(false) , mShowTrade(false)

View file

@ -29,7 +29,7 @@ namespace MWGui
class DialogueWindow: public WindowBase, public ReferenceInterface class DialogueWindow: public WindowBase, public ReferenceInterface
{ {
public: public:
DialogueWindow(WindowManager& parWindowManager); DialogueWindow(MWBase::WindowManager& parWindowManager);
// Events // Events
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void; typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;

View file

@ -1,5 +1,7 @@
#include "dialogue_history.hpp" #include "dialogue_history.hpp"
#include "window_manager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "widgets.hpp" #include "widgets.hpp"
#include "components/esm_store/store.hpp" #include "components/esm_store/store.hpp"
@ -71,4 +73,3 @@ void DialogueHistory::addDialogText(const UString& parText)
addText(parText); addText(parText);
addText("\n"); addText("\n");
} }

View file

@ -9,6 +9,7 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp" #include "../mwbase/soundmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwworld/class.hpp" #include "../mwworld/class.hpp"
#include "../mwworld/player.hpp" #include "../mwworld/player.hpp"
@ -16,7 +17,6 @@
#include "../mwgui/widgets.hpp" #include "../mwgui/widgets.hpp"
#include "inventorywindow.hpp" #include "inventorywindow.hpp"
#include "window_manager.hpp"
#include "container.hpp" #include "container.hpp"
#include "console.hpp" #include "console.hpp"

View file

@ -10,6 +10,7 @@
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/soundmanager.hpp" #include "../mwbase/soundmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwworld/containerstore.hpp" #include "../mwworld/containerstore.hpp"
#include "../mwworld/class.hpp" #include "../mwworld/class.hpp"
@ -18,7 +19,6 @@
#include "../mwworld/actiontake.hpp" #include "../mwworld/actiontake.hpp"
#include "../mwworld/inventorystore.hpp" #include "../mwworld/inventorystore.hpp"
#include "window_manager.hpp"
#include "widgets.hpp" #include "widgets.hpp"
#include "bookwindow.hpp" #include "bookwindow.hpp"
#include "scrollwindow.hpp" #include "scrollwindow.hpp"
@ -40,7 +40,7 @@ namespace
namespace MWGui namespace MWGui
{ {
InventoryWindow::InventoryWindow(WindowManager& parWindowManager,DragAndDrop* dragAndDrop) InventoryWindow::InventoryWindow(MWBase::WindowManager& parWindowManager,DragAndDrop* dragAndDrop)
: ContainerBase(dragAndDrop) : ContainerBase(dragAndDrop)
, WindowPinnableBase("openmw_inventory_window.layout", parWindowManager) , WindowPinnableBase("openmw_inventory_window.layout", parWindowManager)
, mTrading(false) , mTrading(false)

View file

@ -9,7 +9,7 @@ namespace MWGui
class InventoryWindow : public ContainerBase, public WindowPinnableBase class InventoryWindow : public ContainerBase, public WindowPinnableBase
{ {
public: public:
InventoryWindow(WindowManager& parWindowManager,DragAndDrop* dragAndDrop); InventoryWindow(MWBase::WindowManager& parWindowManager,DragAndDrop* dragAndDrop);
virtual void open(); virtual void open();

View file

@ -4,11 +4,10 @@
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/journal.hpp" #include "../mwbase/journal.hpp"
#include "../mwbase/soundmanager.hpp" #include "../mwbase/soundmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwdialogue/journalentry.hpp" #include "../mwdialogue/journalentry.hpp"
#include "window_manager.hpp"
namespace namespace
{ {
struct book struct book
@ -82,7 +81,7 @@ book formatText(std::string text,book mBook,int maxLine, int lineSize)
} }
MWGui::JournalWindow::JournalWindow (WindowManager& parWindowManager) MWGui::JournalWindow::JournalWindow (MWBase::WindowManager& parWindowManager)
: WindowBase("openmw_journal.layout", parWindowManager) : WindowBase("openmw_journal.layout", parWindowManager)
, mLastPos(0) , mLastPos(0)
, mVisible(false) , mVisible(false)

View file

@ -10,12 +10,10 @@
namespace MWGui namespace MWGui
{ {
class WindowManager;
class JournalWindow : public WindowBase class JournalWindow : public WindowBase
{ {
public: public:
JournalWindow(WindowManager& parWindowManager); JournalWindow(MWBase::WindowManager& parWindowManager);
void open(); void open();
virtual void setVisible(bool visible); // only used to play close sound virtual void setVisible(bool visible); // only used to play close sound

View file

@ -2,11 +2,9 @@
#include <OgreRoot.h> #include <OgreRoot.h>
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/windowmanager.hpp"
#include "window_manager.hpp"
namespace MWGui namespace MWGui
{ {

View file

@ -1,5 +1,6 @@
#include "map_window.hpp" #include "map_window.hpp"
#include "window_manager.hpp"
#include "../mwbase/windowmanager.hpp"
#include <boost/lexical_cast.hpp> #include <boost/lexical_cast.hpp>
@ -154,7 +155,7 @@ void LocalMapBase::setPlayerDir(const float x, const float y)
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
MapWindow::MapWindow(WindowManager& parWindowManager) : MapWindow::MapWindow(MWBase::WindowManager& parWindowManager) :
MWGui::WindowPinnableBase("openmw_map_window.layout", parWindowManager), MWGui::WindowPinnableBase("openmw_map_window.layout", parWindowManager),
mGlobal(false) mGlobal(false)
{ {

View file

@ -45,11 +45,11 @@ namespace MWGui
class MapWindow : public MWGui::WindowPinnableBase, public LocalMapBase class MapWindow : public MWGui::WindowPinnableBase, public LocalMapBase
{ {
public: public:
MapWindow(WindowManager& parWindowManager); MapWindow(MWBase::WindowManager& parWindowManager);
virtual ~MapWindow(){} virtual ~MapWindow(){}
void setCellName(const std::string& cellName); void setCellName(const std::string& cellName);
private: private:
void onDragStart(MyGUI::Widget* _sender, int _left, int _top, MyGUI::MouseButton _id); void onDragStart(MyGUI::Widget* _sender, int _left, int _top, MyGUI::MouseButton _id);
void onMouseDrag(MyGUI::Widget* _sender, int _left, int _top, MyGUI::MouseButton _id); void onMouseDrag(MyGUI::Widget* _sender, int _left, int _top, MyGUI::MouseButton _id);

View file

@ -2,7 +2,7 @@
using namespace MWGui; using namespace MWGui;
MessageBoxManager::MessageBoxManager (WindowManager *windowManager) MessageBoxManager::MessageBoxManager (MWBase::WindowManager *windowManager)
{ {
mWindowManager = windowManager; mWindowManager = windowManager;
// defines // defines

View file

@ -5,13 +5,13 @@
#include <MyGUI.h> #include <MyGUI.h>
#include "window_base.hpp" #include "window_base.hpp"
#include "window_manager.hpp"
#include "../mwbase/windowmanager.hpp"
#undef MessageBox #undef MessageBox
namespace MWGui namespace MWGui
{ {
class InteractiveMessageBox; class InteractiveMessageBox;
class MessageBoxManager; class MessageBoxManager;
class MessageBox; class MessageBox;
@ -25,27 +25,27 @@ namespace MWGui
class MessageBoxManager class MessageBoxManager
{ {
public: public:
MessageBoxManager (WindowManager* windowManager); MessageBoxManager (MWBase::WindowManager* windowManager);
void onFrame (float frameDuration); void onFrame (float frameDuration);
void createMessageBox (const std::string& message); void createMessageBox (const std::string& message);
bool createInteractiveMessageBox (const std::string& message, const std::vector<std::string>& buttons); bool createInteractiveMessageBox (const std::string& message, const std::vector<std::string>& buttons);
bool isInteractiveMessageBox (); bool isInteractiveMessageBox ();
void removeMessageBox (float time, MessageBox *msgbox); void removeMessageBox (float time, MessageBox *msgbox);
bool removeMessageBox (MessageBox *msgbox); bool removeMessageBox (MessageBox *msgbox);
void setMessageBoxSpeed (int speed); void setMessageBoxSpeed (int speed);
int readPressedButton (); int readPressedButton ();
WindowManager *mWindowManager; MWBase::WindowManager *mWindowManager;
private: private:
std::vector<MessageBox*> mMessageBoxes; std::vector<MessageBox*> mMessageBoxes;
InteractiveMessageBox* mInterMessageBoxe; InteractiveMessageBox* mInterMessageBoxe;
std::vector<MessageBoxManagerTimer> mTimers; std::vector<MessageBoxManagerTimer> mTimers;
float mMessageBoxSpeed; float mMessageBoxSpeed;
}; };
class MessageBox : public OEngine::GUI::Layout class MessageBox : public OEngine::GUI::Layout
{ {
public: public:
@ -53,9 +53,9 @@ namespace MWGui
void setMessage (const std::string& message); void setMessage (const std::string& message);
int getHeight (); int getHeight ();
void update (int height); void update (int height);
bool mMarkedToDelete; bool mMarkedToDelete;
protected: protected:
MessageBoxManager& mMessageBoxManager; MessageBoxManager& mMessageBoxManager;
int mHeight; int mHeight;
@ -65,16 +65,16 @@ namespace MWGui
int mBottomPadding; int mBottomPadding;
int mNextBoxPadding; int mNextBoxPadding;
}; };
class InteractiveMessageBox : public OEngine::GUI::Layout class InteractiveMessageBox : public OEngine::GUI::Layout
{ {
public: public:
InteractiveMessageBox (MessageBoxManager& parMessageBoxManager, const std::string& message, const std::vector<std::string>& buttons); InteractiveMessageBox (MessageBoxManager& parMessageBoxManager, const std::string& message, const std::vector<std::string>& buttons);
void mousePressed (MyGUI::Widget* _widget); void mousePressed (MyGUI::Widget* _widget);
int readPressedButton (); int readPressedButton ();
bool mMarkedToDelete; bool mMarkedToDelete;
private: private:
MessageBoxManager& mMessageBoxManager; MessageBoxManager& mMessageBoxManager;
MyGUI::EditPtr mMessageWidget; MyGUI::EditPtr mMessageWidget;

View file

@ -10,15 +10,15 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/windowmanager.hpp"
#include "window_manager.hpp"
#include "widgets.hpp" #include "widgets.hpp"
#include "tooltips.hpp" #include "tooltips.hpp"
using namespace MWGui; using namespace MWGui;
using namespace Widgets; using namespace Widgets;
RaceDialog::RaceDialog(WindowManager& parWindowManager) RaceDialog::RaceDialog(MWBase::WindowManager& parWindowManager)
: WindowBase("openmw_chargen_race.layout", parWindowManager) : WindowBase("openmw_chargen_race.layout", parWindowManager)
, mGenderIndex(0) , mGenderIndex(0)
, mFaceIndex(0) , mFaceIndex(0)

View file

@ -24,7 +24,7 @@ namespace MWGui
class RaceDialog : public WindowBase class RaceDialog : public WindowBase
{ {
public: public:
RaceDialog(WindowManager& parWindowManager); RaceDialog(MWBase::WindowManager& parWindowManager);
enum Gender enum Gender
{ {

View file

@ -9,8 +9,8 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/windowmanager.hpp"
#include "window_manager.hpp"
#include "widgets.hpp" #include "widgets.hpp"
#include "tooltips.hpp" #include "tooltips.hpp"
@ -22,7 +22,7 @@ using namespace Widgets;
const int ReviewDialog::sLineHeight = 18; const int ReviewDialog::sLineHeight = 18;
ReviewDialog::ReviewDialog(WindowManager& parWindowManager) ReviewDialog::ReviewDialog(MWBase::WindowManager& parWindowManager)
: WindowBase("openmw_chargen_review.layout", parWindowManager) : WindowBase("openmw_chargen_review.layout", parWindowManager)
, mLastPos(0) , mLastPos(0)
{ {

View file

@ -30,7 +30,7 @@ namespace MWGui
}; };
typedef std::vector<int> SkillList; typedef std::vector<int> SkillList;
ReviewDialog(WindowManager& parWindowManager); ReviewDialog(MWBase::WindowManager& parWindowManager);
void setPlayerName(const std::string &name); void setPlayerName(const std::string &name);
void setRace(const std::string &raceId); void setRace(const std::string &raceId);

View file

@ -3,16 +3,16 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp" #include "../mwbase/soundmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwworld/actiontake.hpp" #include "../mwworld/actiontake.hpp"
#include "../mwworld/player.hpp" #include "../mwworld/player.hpp"
#include "formatting.hpp" #include "formatting.hpp"
#include "window_manager.hpp"
using namespace MWGui; using namespace MWGui;
ScrollWindow::ScrollWindow (WindowManager& parWindowManager) : ScrollWindow::ScrollWindow (MWBase::WindowManager& parWindowManager) :
WindowBase("openmw_scroll.layout", parWindowManager) WindowBase("openmw_scroll.layout", parWindowManager)
{ {
getWidget(mTextView, "TextView"); getWidget(mTextView, "TextView");

View file

@ -10,7 +10,7 @@ namespace MWGui
class ScrollWindow : public WindowBase class ScrollWindow : public WindowBase
{ {
public: public:
ScrollWindow (WindowManager& parWindowManager); ScrollWindow (MWBase::WindowManager& parWindowManager);
void open (MWWorld::Ptr scroll); void open (MWWorld::Ptr scroll);
void setTakeButtonShow(bool show); void setTakeButtonShow(bool show);

View file

@ -14,10 +14,10 @@
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp" #include "../mwbase/soundmanager.hpp"
#include "../mwbase/inputmanager.hpp" #include "../mwbase/inputmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwrender/renderingmanager.hpp" #include "../mwrender/renderingmanager.hpp"
#include "window_manager.hpp"
#include "confirmationdialog.hpp" #include "confirmationdialog.hpp"
namespace namespace
@ -81,7 +81,7 @@ namespace
namespace MWGui namespace MWGui
{ {
SettingsWindow::SettingsWindow(WindowManager& parWindowManager) : SettingsWindow::SettingsWindow(MWBase::WindowManager& parWindowManager) :
WindowBase("openmw_settings_window.layout", parWindowManager) WindowBase("openmw_settings_window.layout", parWindowManager)
{ {
getWidget(mOkButton, "OkButton"); getWidget(mOkButton, "OkButton");

View file

@ -13,7 +13,7 @@ namespace MWGui
class SettingsWindow : public WindowBase class SettingsWindow : public WindowBase
{ {
public: public:
SettingsWindow(WindowManager& parWindowManager); SettingsWindow(MWBase::WindowManager& parWindowManager);
private: private:
static int const sFovMin = 30; static int const sFovMin = 30;
@ -77,4 +77,3 @@ namespace MWGui
} }
#endif #endif

View file

@ -9,6 +9,7 @@
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/soundmanager.hpp" #include "../mwbase/soundmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwworld/player.hpp" #include "../mwworld/player.hpp"
#include "../mwworld/inventorystore.hpp" #include "../mwworld/inventorystore.hpp"
@ -17,7 +18,6 @@
#include "../mwmechanics/creaturestats.hpp" #include "../mwmechanics/creaturestats.hpp"
#include "../mwmechanics/spellsuccess.hpp" #include "../mwmechanics/spellsuccess.hpp"
#include "window_manager.hpp"
#include "inventorywindow.hpp" #include "inventorywindow.hpp"
#include "confirmationdialog.hpp" #include "confirmationdialog.hpp"
@ -42,7 +42,7 @@ namespace
namespace MWGui namespace MWGui
{ {
SpellWindow::SpellWindow(WindowManager& parWindowManager) SpellWindow::SpellWindow(MWBase::WindowManager& parWindowManager)
: WindowPinnableBase("openmw_spell_window.layout", parWindowManager) : WindowPinnableBase("openmw_spell_window.layout", parWindowManager)
, mHeight(0) , mHeight(0)
, mWidth(0) , mWidth(0)

View file

@ -8,7 +8,7 @@ namespace MWGui
class SpellWindow : public WindowPinnableBase class SpellWindow : public WindowPinnableBase
{ {
public: public:
SpellWindow(WindowManager& parWindowManager); SpellWindow(MWBase::WindowManager& parWindowManager);
void updateSpells(); void updateSpells();

View file

@ -9,20 +9,20 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/mechanicsmanager.hpp" #include "../mwbase/mechanicsmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwworld/player.hpp" #include "../mwworld/player.hpp"
#include "../mwworld/class.hpp" #include "../mwworld/class.hpp"
#include "../mwmechanics/npcstats.hpp" #include "../mwmechanics/npcstats.hpp"
#include "window_manager.hpp"
#include "tooltips.hpp" #include "tooltips.hpp"
using namespace MWGui; using namespace MWGui;
const int StatsWindow::sLineHeight = 18; const int StatsWindow::sLineHeight = 18;
StatsWindow::StatsWindow (WindowManager& parWindowManager) StatsWindow::StatsWindow (MWBase::WindowManager& parWindowManager)
: WindowPinnableBase("openmw_stats_window.layout", parWindowManager) : WindowPinnableBase("openmw_stats_window.layout", parWindowManager)
, mSkillAreaWidget(NULL) , mSkillAreaWidget(NULL)
, mSkillClientWidget(NULL) , mSkillClientWidget(NULL)

View file

@ -22,7 +22,7 @@ namespace MWGui
typedef std::vector<int> SkillList; typedef std::vector<int> SkillList;
StatsWindow(WindowManager& parWindowManager); StatsWindow(MWBase::WindowManager& parWindowManager);
/// automatically updates all the data in the stats window, but only if it has changed. /// automatically updates all the data in the stats window, but only if it has changed.
void onFrame(); void onFrame();
@ -82,4 +82,3 @@ namespace MWGui
}; };
} }
#endif #endif

View file

@ -1,9 +1,10 @@
#include "text_input.hpp" #include "text_input.hpp"
#include "window_manager.hpp"
#include "../mwbase/windowmanager.hpp"
using namespace MWGui; using namespace MWGui;
TextInputDialog::TextInputDialog(WindowManager& parWindowManager) TextInputDialog::TextInputDialog(MWBase::WindowManager& parWindowManager)
: WindowBase("openmw_text_input.layout", parWindowManager) : WindowBase("openmw_text_input.layout", parWindowManager)
{ {
// Centre dialog // Centre dialog

View file

@ -18,7 +18,7 @@ namespace MWGui
class TextInputDialog : public WindowBase class TextInputDialog : public WindowBase
{ {
public: public:
TextInputDialog(WindowManager& parWindowManager); TextInputDialog(MWBase::WindowManager& parWindowManager);
std::string getTextInput() const { return mTextEdit ? mTextEdit->getOnlyText() : ""; } std::string getTextInput() const { return mTextEdit ? mTextEdit->getOnlyText() : ""; }
void setTextInput(const std::string &text) { if (mTextEdit) mTextEdit->setOnlyText(text); } void setTextInput(const std::string &text) { if (mTextEdit) mTextEdit->setOnlyText(text); }

View file

@ -8,16 +8,16 @@
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwworld/class.hpp" #include "../mwworld/class.hpp"
#include "window_manager.hpp"
#include "widgets.hpp" #include "widgets.hpp"
using namespace MWGui; using namespace MWGui;
using namespace MyGUI; using namespace MyGUI;
ToolTips::ToolTips(WindowManager* windowManager) : ToolTips::ToolTips(MWBase::WindowManager* windowManager) :
Layout("openmw_tooltips.layout") Layout("openmw_tooltips.layout")
, mGameMode(true) , mGameMode(true)
, mWindowManager(windowManager) , mWindowManager(windowManager)

View file

@ -9,8 +9,6 @@
namespace MWGui namespace MWGui
{ {
class WindowManager;
// Info about tooltip that is supplied by the MWWorld::Class object // Info about tooltip that is supplied by the MWWorld::Class object
struct ToolTipInfo struct ToolTipInfo
{ {
@ -29,7 +27,7 @@ namespace MWGui
class ToolTips : public OEngine::GUI::Layout class ToolTips : public OEngine::GUI::Layout
{ {
public: public:
ToolTips(WindowManager* windowManager); ToolTips(MWBase::WindowManager* windowManager);
void onFrame(float frameDuration); void onFrame(float frameDuration);
@ -45,7 +43,7 @@ namespace MWGui
void setFocusObject(const MWWorld::Ptr& focus); void setFocusObject(const MWWorld::Ptr& focus);
void setFocusObjectScreenCoords(float min_x, float min_y, float max_x, float max_y); void setFocusObjectScreenCoords(float min_x, float min_y, float max_x, float max_y);
///< set the screen-space position of the tooltip for focused object ///< set the screen-space position of the tooltip for focused object
static std::string getValueString(const int value, const std::string& prefix); static std::string getValueString(const int value, const std::string& prefix);
///< @return "prefix: value" or "" if value is 0 ///< @return "prefix: value" or "" if value is 0
@ -71,7 +69,7 @@ namespace MWGui
private: private:
MyGUI::Widget* mDynamicToolTipBox; MyGUI::Widget* mDynamicToolTipBox;
WindowManager* mWindowManager; MWBase::WindowManager* mWindowManager;
MWWorld::Ptr mFocusObject; MWWorld::Ptr mFocusObject;

View file

@ -5,16 +5,16 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp" #include "../mwbase/soundmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwworld/inventorystore.hpp" #include "../mwworld/inventorystore.hpp"
#include "../mwworld/manualref.hpp" #include "../mwworld/manualref.hpp"
#include "window_manager.hpp"
#include "inventorywindow.hpp" #include "inventorywindow.hpp"
namespace MWGui namespace MWGui
{ {
TradeWindow::TradeWindow(WindowManager& parWindowManager) : TradeWindow::TradeWindow(MWBase::WindowManager& parWindowManager) :
WindowBase("openmw_trade_window.layout", parWindowManager) WindowBase("openmw_trade_window.layout", parWindowManager)
, ContainerBase(NULL) // no drag&drop , ContainerBase(NULL) // no drag&drop
, mCurrentBalance(0) , mCurrentBalance(0)

View file

@ -23,7 +23,7 @@ namespace MWGui
class TradeWindow : public ContainerBase, public WindowBase class TradeWindow : public ContainerBase, public WindowBase
{ {
public: public:
TradeWindow(WindowManager& parWindowManager); TradeWindow(MWBase::WindowManager& parWindowManager);
void startTrade(MWWorld::Ptr actor); void startTrade(MWWorld::Ptr actor);

View file

@ -6,8 +6,7 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/windowmanager.hpp"
#include "window_manager.hpp"
#undef min #undef min
#undef max #undef max

View file

@ -10,14 +10,19 @@
#undef MYGUI_EXPORT #undef MYGUI_EXPORT
#define MYGUI_EXPORT #define MYGUI_EXPORT
namespace MWBase
{
class WindowManager;
}
/* /*
This file contains various custom widgets used in OpenMW. This file contains various custom widgets used in OpenMW.
*/ */
namespace MWGui namespace MWGui
{ {
/// \todo remove!
using namespace MyGUI; using namespace MyGUI;
class WindowManager;
namespace Widgets namespace Widgets
{ {
@ -81,12 +86,12 @@ namespace MWGui
typedef MWMechanics::Stat<float> SkillValue; typedef MWMechanics::Stat<float> SkillValue;
void setWindowManager(WindowManager *m) { mManager = m; } void setWindowManager(MWBase::WindowManager *m) { mManager = m; } /// \todo remove
void setSkillId(ESM::Skill::SkillEnum skillId); void setSkillId(ESM::Skill::SkillEnum skillId);
void setSkillNumber(int skillId); void setSkillNumber(int skillId);
void setSkillValue(const SkillValue& value); void setSkillValue(const SkillValue& value);
WindowManager *getWindowManager() const { return mManager; } MWBase::WindowManager *getWindowManager() const { return mManager; }
ESM::Skill::SkillEnum getSkillId() const { return mSkillId; } ESM::Skill::SkillEnum getSkillId() const { return mSkillId; }
const SkillValue& getSkillValue() const { return mValue; } const SkillValue& getSkillValue() const { return mValue; }
@ -109,7 +114,7 @@ namespace MWGui
void updateWidgets(); void updateWidgets();
WindowManager *mManager; MWBase::WindowManager *mManager;
ESM::Skill::SkillEnum mSkillId; ESM::Skill::SkillEnum mSkillId;
SkillValue mValue; SkillValue mValue;
MyGUI::WidgetPtr mSkillNameWidget, mSkillValueWidget; MyGUI::WidgetPtr mSkillNameWidget, mSkillValueWidget;
@ -124,11 +129,11 @@ namespace MWGui
typedef MWMechanics::Stat<int> AttributeValue; typedef MWMechanics::Stat<int> AttributeValue;
void setWindowManager(WindowManager *m) { mManager = m; } void setWindowManager(MWBase::WindowManager *m) { mManager = m; }
void setAttributeId(int attributeId); void setAttributeId(int attributeId);
void setAttributeValue(const AttributeValue& value); void setAttributeValue(const AttributeValue& value);
WindowManager *getWindowManager() const { return mManager; } MWBase::WindowManager *getWindowManager() const { return mManager; }
int getAttributeId() const { return mId; } int getAttributeId() const { return mId; }
const AttributeValue& getAttributeValue() const { return mValue; } const AttributeValue& getAttributeValue() const { return mValue; }
@ -151,7 +156,7 @@ namespace MWGui
void updateWidgets(); void updateWidgets();
WindowManager *mManager; MWBase::WindowManager *mManager;
int mId; int mId;
AttributeValue mValue; AttributeValue mValue;
MyGUI::WidgetPtr mAttributeNameWidget, mAttributeValueWidget; MyGUI::WidgetPtr mAttributeNameWidget, mAttributeValueWidget;
@ -170,7 +175,7 @@ namespace MWGui
typedef MWMechanics::Stat<int> SpellValue; typedef MWMechanics::Stat<int> SpellValue;
void setWindowManager(WindowManager* parWindowManager) { mWindowManager = parWindowManager; } void setWindowManager(MWBase::WindowManager* parWindowManager) { mWindowManager = parWindowManager; }
void setSpellId(const std::string &id); void setSpellId(const std::string &id);
/** /**
@ -192,7 +197,7 @@ namespace MWGui
private: private:
void updateWidgets(); void updateWidgets();
WindowManager* mWindowManager; MWBase::WindowManager* mWindowManager;
std::string mId; std::string mId;
MyGUI::TextBox* mSpellNameWidget; MyGUI::TextBox* mSpellNameWidget;
}; };
@ -212,7 +217,7 @@ namespace MWGui
EF_Constant = 0x02 // constant effect means that duration will not be displayed EF_Constant = 0x02 // constant effect means that duration will not be displayed
}; };
void setWindowManager(WindowManager* parWindowManager) { mWindowManager = parWindowManager; } void setWindowManager(MWBase::WindowManager* parWindowManager) { mWindowManager = parWindowManager; }
void setEffectList(const SpellEffectList& list); void setEffectList(const SpellEffectList& list);
static SpellEffectList effectListFromESM(const ESM::EffectList* effects); static SpellEffectList effectListFromESM(const ESM::EffectList* effects);
@ -234,7 +239,7 @@ namespace MWGui
private: private:
void updateWidgets(); void updateWidgets();
WindowManager* mWindowManager; MWBase::WindowManager* mWindowManager;
SpellEffectList mEffectList; SpellEffectList mEffectList;
}; };
typedef MWEffectList* MWEffectListPtr; typedef MWEffectList* MWEffectListPtr;
@ -247,7 +252,7 @@ namespace MWGui
typedef ESM::ENAMstruct SpellEffectValue; typedef ESM::ENAMstruct SpellEffectValue;
void setWindowManager(WindowManager* parWindowManager) { mWindowManager = parWindowManager; } void setWindowManager(MWBase::WindowManager* parWindowManager) { mWindowManager = parWindowManager; }
void setSpellEffect(const SpellEffectParams& params); void setSpellEffect(const SpellEffectParams& params);
std::string effectIDToString(const short effectID); std::string effectIDToString(const short effectID);
@ -262,12 +267,12 @@ namespace MWGui
virtual ~MWSpellEffect(); virtual ~MWSpellEffect();
virtual void initialiseOverride(); virtual void initialiseOverride();
private: private:
void updateWidgets(); void updateWidgets();
WindowManager* mWindowManager; MWBase::WindowManager* mWindowManager;
SpellEffectParams mEffectParams; SpellEffectParams mEffectParams;
MyGUI::ImageBox* mImageWidget; MyGUI::ImageBox* mImageWidget;
MyGUI::TextBox* mTextWidget; MyGUI::TextBox* mTextWidget;

View file

@ -1,11 +1,12 @@
#include "window_base.hpp" #include "window_base.hpp"
#include "window_manager.hpp"
#include <components/settings/settings.hpp> #include <components/settings/settings.hpp>
#include "../mwbase/windowmanager.hpp"
using namespace MWGui; using namespace MWGui;
WindowBase::WindowBase(const std::string& parLayout, WindowManager& parWindowManager) WindowBase::WindowBase(const std::string& parLayout, MWBase::WindowManager& parWindowManager)
: Layout(parLayout) : Layout(parLayout)
, mWindowManager(parWindowManager) , mWindowManager(parWindowManager)
{ {

View file

@ -3,6 +3,11 @@
#include <openengine/gui/layout.hpp> #include <openengine/gui/layout.hpp>
namespace MWBase
{
class WindowManager;
}
namespace MWGui namespace MWGui
{ {
class WindowManager; class WindowManager;
@ -10,7 +15,7 @@ namespace MWGui
class WindowBase: public OEngine::GUI::Layout class WindowBase: public OEngine::GUI::Layout
{ {
public: public:
WindowBase(const std::string& parLayout, WindowManager& parWindowManager); WindowBase(const std::string& parLayout, MWBase::WindowManager& parWindowManager);
// Events // Events
typedef MyGUI::delegates::CMultiDelegate1<WindowBase*> EventHandle_WindowBase; typedef MyGUI::delegates::CMultiDelegate1<WindowBase*> EventHandle_WindowBase;
@ -25,9 +30,9 @@ namespace MWGui
EventHandle_WindowBase eventDone; EventHandle_WindowBase eventDone;
protected: protected:
WindowManager& mWindowManager; /// \todo remove
MWBase::WindowManager& mWindowManager;
}; };
} }
#endif #endif

View file

@ -1,274 +0,0 @@
#ifndef MWGUI_WINDOWMANAGER_H
#define MWGUI_WINDOWMANAGER_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.
MyGUI should be initialized separately before creating instances of
this class.
**/
#include <vector>
#include <string>
#include <components/settings/settings.hpp>
#include <components/esm/loadclas.hpp>
#include "../mwmechanics/stat.hpp"
#include "mode.hpp"
namespace MyGUI
{
class Gui;
class Widget;
class UString;
}
namespace Compiler
{
class Extensions;
}
namespace MWWorld
{
class Ptr;
class CellStore;
}
namespace OEngine
{
namespace GUI
{
class Layout;
class MyGUIManager;
}
namespace Render
{
class OgreRenderer;
}
}
namespace MWGui
{
class WindowBase;
class HUD;
class MapWindow;
class MainMenu;
class StatsWindow;
class InventoryWindow;
class Console;
class JournalWindow;
class CharacterCreation;
class ContainerWindow;
class DragAndDrop;
class InventoryWindow;
class ToolTips;
class ScrollWindow;
class BookWindow;
class TextInputDialog;
class InfoBoxDialog;
class DialogueWindow;
class MessageBoxManager;
class CountDialog;
class TradeWindow;
class SettingsWindow;
class ConfirmationDialog;
class AlchemyWindow;
class SpellWindow;
class WindowManager
{
public:
typedef std::pair<std::string, int> Faction;
typedef std::vector<Faction> FactionList;
typedef std::vector<int> SkillList;
WindowManager(const Compiler::Extensions& extensions, int fpsLevel, bool newGame, OEngine::Render::OgreRenderer *mOgre, const std::string& logpath, bool consoleOnlyScripts);
virtual ~WindowManager();
/**
* Should be called each frame to update windows/gui elements.
* This could mean updating sizes of gui elements or opening
* new dialogs.
*/
void update();
void pushGuiMode(GuiMode mode);
void popGuiMode();
void removeGuiMode(GuiMode mode); ///< can be anywhere in the stack
GuiMode getMode() const;
bool isGuiMode() const;
void toggleVisible(GuiWindow wnd);
// Disallow all inventory mode windows
void disallowAll();
// Allow one or more windows
void allow(GuiWindow wnd);
bool isAllowed(GuiWindow wnd) const;
/// \todo investigate, if we really need to expose every single lousy UI element to the outside world
MWGui::DialogueWindow* getDialogueWindow();
MWGui::ContainerWindow* getContainerWindow();
MWGui::InventoryWindow* getInventoryWindow();
MWGui::BookWindow* getBookWindow();
MWGui::ScrollWindow* getScrollWindow();
MWGui::CountDialog* getCountDialog();
MWGui::ConfirmationDialog* getConfirmationDialog();
MWGui::TradeWindow* getTradeWindow();
MWGui::SpellWindow* getSpellWindow();
MWGui::Console* getConsole();
MyGUI::Gui* getGui() const;
void wmUpdateFps(float fps, unsigned int triangleCount, unsigned int batchCount);
///< Set value for the given ID.
void setValue (const std::string& id, const MWMechanics::Stat<int>& value);
void setValue (int parSkill, const MWMechanics::Stat<float>& value);
void setValue (const std::string& id, const MWMechanics::DynamicStat<int>& value);
void setValue (const std::string& id, const std::string& value);
void setValue (const std::string& id, int value);
void setPlayerClass (const ESM::Class &class_); ///< set current class of player
void configureSkills (const SkillList& major, const SkillList& minor); ///< configure skill groups, each set contains the skill ID for that group.
void setReputation (int reputation); ///< set the current reputation value
void setBounty (int bounty); ///< set the current bounty value
void updateSkillArea(); ///< update display of skills, factions, birth sign, reputation and bounty
void changeCell(MWWorld::CellStore* cell); ///< change the active cell
void setPlayerPos(const float x, const float y); ///< set player position in map space
void setPlayerDir(const float x, const float y); ///< set player view direction in map space
void setFocusObject(const MWWorld::Ptr& focus);
void setFocusObjectScreenCoords(float min_x, float min_y, float max_x, float max_y);
void setMouseVisible(bool visible);
void getMousePosition(int &x, int &y);
void getMousePosition(float &x, float &y);
void setDragDrop(bool dragDrop);
bool getWorldMouseOver();
void toggleFogOfWar();
void toggleFullHelp(); ///< show extra info in item tooltips (owner, script)
bool getFullHelp() const;
void setInteriorMapTexture(const int x, const int y);
///< set the index of the map texture that should be used (for interiors)
// sets the visibility of the hud health/magicka/stamina bars
void setHMSVisibility(bool visible);
// sets the visibility of the hud minimap
void setMinimapVisibility(bool visible);
void setWeaponVisibility(bool visible);
void setSpellVisibility(bool visible);
void setSelectedSpell(const std::string& spellId, int successChancePercent);
void setSelectedEnchantItem(const MWWorld::Ptr& item, int chargePercent);
void setSelectedWeapon(const MWWorld::Ptr& item, int durabilityPercent);
void unsetSelectedSpell();
void unsetSelectedWeapon();
void removeDialog(OEngine::GUI::Layout* dialog); ///< Hides dialog and schedules dialog to be deleted.
void messageBox (const std::string& message, const std::vector<std::string>& buttons);
int readPressedButton (); ///< returns the index of the pressed button or -1 if no button was pressed (->MessageBoxmanager->InteractiveMessageBox)
void onFrame (float frameDuration);
/// \todo get rid of this stuff. Move it to the respective UI element classes, if needed.
std::map<int, MWMechanics::Stat<float> > getPlayerSkillValues();
std::map<int, MWMechanics::Stat<int> > getPlayerAttributeValues();
SkillList getPlayerMinorSkills();
SkillList getPlayerMajorSkills();
/**
* 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.
*/
const std::string &getGameSettingString(const std::string &id, const std::string &default_);
void processChangedSettings(const Settings::CategorySettingVector& changed);
void executeInConsole (const std::string& path);
private:
OEngine::GUI::MyGUIManager *mGuiManager;
HUD *mHud;
MapWindow *mMap;
MainMenu *mMenu;
ToolTips *mToolTips;
StatsWindow *mStatsWindow;
MessageBoxManager *mMessageBoxManager;
Console *mConsole;
JournalWindow* mJournal;
DialogueWindow *mDialogueWindow;
ContainerWindow *mContainerWindow;
DragAndDrop* mDragAndDrop;
InventoryWindow *mInventoryWindow;
ScrollWindow* mScrollWindow;
BookWindow* mBookWindow;
CountDialog* mCountDialog;
TradeWindow* mTradeWindow;
SettingsWindow* mSettingsWindow;
ConfirmationDialog* mConfirmationDialog;
AlchemyWindow* mAlchemyWindow;
SpellWindow* mSpellWindow;
CharacterCreation* mCharGen;
/// \todo get rid of this stuff. Move it to the respective UI element classes, if needed.
// Various stats about player as needed by window manager
ESM::Class mPlayerClass;
std::string mPlayerName;
std::string mPlayerRaceId;
std::map<int, MWMechanics::Stat<int> > mPlayerAttributes;
SkillList mPlayerMajorSkills, mPlayerMinorSkills;
std::map<int, MWMechanics::Stat<float> > mPlayerSkillValues;
MWMechanics::DynamicStat<int> mPlayerHealth, mPlayerMagicka, mPlayerFatigue;
MyGUI::Gui *mGui; // Gui
std::vector<GuiMode> mGuiModes;
std::vector<OEngine::GUI::Layout*> mGarbageDialogs;
void cleanupGarbage();
GuiWindow mShown; // Currently shown windows in inventory mode
/* 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;
void updateVisible(); // Update visibility of all windows based on mode, shown and allowed settings
int mShowFPSLevel;
float mFPS;
unsigned int mTriangleCount;
unsigned int mBatchCount;
void onDialogueWindowBye();
/**
* 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 \a _tag and place the result in \a _result
*/
void onRetrieveTag(const MyGUI::UString& _tag, MyGUI::UString& _result);
};
}
#endif

View file

@ -1,9 +1,10 @@
#include "window_pinnable_base.hpp" #include "window_pinnable_base.hpp"
#include "window_manager.hpp"
#include "../mwbase/windowmanager.hpp"
using namespace MWGui; using namespace MWGui;
WindowPinnableBase::WindowPinnableBase(const std::string& parLayout, WindowManager& parWindowManager) WindowPinnableBase::WindowPinnableBase(const std::string& parLayout, MWBase::WindowManager& parWindowManager)
: WindowBase(parLayout, parWindowManager), mPinned(false), mVisible(false) : WindowBase(parLayout, parWindowManager), mPinned(false), mVisible(false)
{ {
MyGUI::WindowPtr t = static_cast<MyGUI::WindowPtr>(mMainWidget); MyGUI::WindowPtr t = static_cast<MyGUI::WindowPtr>(mMainWidget);
@ -30,4 +31,3 @@ void WindowPinnableBase::onWindowButtonPressed(MyGUI::Window* sender, const std:
eventDone(this); eventDone(this);
} }

View file

@ -10,13 +10,13 @@ namespace MWGui
class WindowPinnableBase: public WindowBase class WindowPinnableBase: public WindowBase
{ {
public: public:
WindowPinnableBase(const std::string& parLayout, WindowManager& parWindowManager); WindowPinnableBase(const std::string& parLayout, MWBase::WindowManager& parWindowManager);
void setVisible(bool b); void setVisible(bool b);
bool pinned() { return mPinned; } bool pinned() { return mPinned; }
private: private:
void onWindowButtonPressed(MyGUI::Window* sender, const std::string& eventName); void onWindowButtonPressed(MyGUI::Window* sender, const std::string& eventName);
protected: protected:
virtual void onPinToggled() = 0; virtual void onPinToggled() = 0;
@ -26,4 +26,3 @@ namespace MWGui
} }
#endif #endif

View file

@ -1,4 +1,4 @@
#include "window_manager.hpp" #include "windowmanagerimp.hpp"
#include <cassert> #include <cassert>
#include <iterator> #include <iterator>

View file

@ -0,0 +1,254 @@
#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.
MyGUI should be initialized separately before creating instances of
this class.
**/
#include <vector>
#include <string>
#include <components/esm/loadclas.hpp>
#include "../mwbase/windowmanager.hpp"
namespace MyGUI
{
class Gui;
class Widget;
class UString;
}
namespace Compiler
{
class Extensions;
}
namespace OEngine
{
namespace GUI
{
class Layout;
class MyGUIManager;
}
namespace Render
{
class OgreRenderer;
}
}
namespace MWGui
{
class WindowBase;
class HUD;
class MapWindow;
class MainMenu;
class StatsWindow;
class InventoryWindow;
class JournalWindow;
class CharacterCreation;
class DragAndDrop;
class ToolTips;
class TextInputDialog;
class InfoBoxDialog;
class MessageBoxManager;
class SettingsWindow;
class AlchemyWindow;
class WindowManager : public MWBase::WindowManager
{
public:
typedef std::pair<std::string, int> Faction;
typedef std::vector<Faction> FactionList;
WindowManager(const Compiler::Extensions& extensions, int fpsLevel, bool newGame, OEngine::Render::OgreRenderer *mOgre, const std::string& logpath, bool consoleOnlyScripts);
virtual ~WindowManager();
/**
* Should be called each frame to update windows/gui elements.
* This could mean updating sizes of gui elements or opening
* new dialogs.
*/
virtual void update();
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 isGuiMode() const;
virtual void toggleVisible(GuiWindow wnd);
// Disallow all inventory mode windows
virtual void disallowAll();
// Allow one or more windows
virtual void allow(GuiWindow wnd);
virtual bool isAllowed(GuiWindow wnd) const;
/// \todo investigate, if we really need to expose every single lousy UI element to the outside world
virtual MWGui::DialogueWindow* getDialogueWindow();
virtual MWGui::ContainerWindow* getContainerWindow();
virtual MWGui::InventoryWindow* getInventoryWindow();
virtual MWGui::BookWindow* getBookWindow();
virtual MWGui::ScrollWindow* getScrollWindow();
virtual MWGui::CountDialog* getCountDialog();
virtual MWGui::ConfirmationDialog* getConfirmationDialog();
virtual MWGui::TradeWindow* getTradeWindow();
virtual MWGui::SpellWindow* getSpellWindow();
virtual MWGui::Console* getConsole();
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);
virtual void setValue (int parSkill, const MWMechanics::Stat<float>& value);
virtual void setValue (const std::string& id, const MWMechanics::DynamicStat<int>& value);
virtual void setValue (const std::string& id, const std::string& value);
virtual void setValue (const std::string& id, int value);
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 setMouseVisible(bool visible);
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)
// sets the visibility of the hud health/magicka/stamina bars
virtual void setHMSVisibility(bool visible);
// sets the visibility of the hud minimap
virtual void setMinimapVisibility(bool visible);
virtual void setWeaponVisibility(bool visible);
virtual void setSpellVisibility(bool visible);
virtual void setSelectedSpell(const std::string& spellId, int successChancePercent);
virtual void setSelectedEnchantItem(const MWWorld::Ptr& item, int chargePercent);
virtual void setSelectedWeapon(const MWWorld::Ptr& item, int durabilityPercent);
virtual void unsetSelectedSpell();
virtual void unsetSelectedWeapon();
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);
virtual int readPressedButton (); ///< returns the index of the pressed button or -1 if no button was pressed (->MessageBoxmanager->InteractiveMessageBox)
virtual void onFrame (float frameDuration);
/// \todo get rid of this stuff. Move it to the respective UI element classes, if needed.
virtual std::map<int, MWMechanics::Stat<float> > getPlayerSkillValues();
virtual std::map<int, MWMechanics::Stat<int> > getPlayerAttributeValues();
virtual SkillList getPlayerMinorSkills();
virtual SkillList getPlayerMajorSkills();
/**
* 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.
*/
virtual const std::string &getGameSettingString(const std::string &id, const std::string &default_);
virtual void processChangedSettings(const Settings::CategorySettingVector& changed);
virtual void executeInConsole (const std::string& path);
private:
OEngine::GUI::MyGUIManager *mGuiManager;
HUD *mHud;
MapWindow *mMap;
MainMenu *mMenu;
ToolTips *mToolTips;
StatsWindow *mStatsWindow;
MessageBoxManager *mMessageBoxManager;
Console *mConsole;
JournalWindow* mJournal;
DialogueWindow *mDialogueWindow;
ContainerWindow *mContainerWindow;
DragAndDrop* mDragAndDrop;
InventoryWindow *mInventoryWindow;
ScrollWindow* mScrollWindow;
BookWindow* mBookWindow;
CountDialog* mCountDialog;
TradeWindow* mTradeWindow;
SettingsWindow* mSettingsWindow;
ConfirmationDialog* mConfirmationDialog;
AlchemyWindow* mAlchemyWindow;
SpellWindow* mSpellWindow;
CharacterCreation* mCharGen;
/// \todo get rid of this stuff. Move it to the respective UI element classes, if needed.
// Various stats about player as needed by window manager
ESM::Class mPlayerClass;
std::string mPlayerName;
std::string mPlayerRaceId;
std::map<int, MWMechanics::Stat<int> > mPlayerAttributes;
SkillList mPlayerMajorSkills, mPlayerMinorSkills;
std::map<int, MWMechanics::Stat<float> > mPlayerSkillValues;
MWMechanics::DynamicStat<int> mPlayerHealth, mPlayerMagicka, mPlayerFatigue;
MyGUI::Gui *mGui; // Gui
std::vector<GuiMode> mGuiModes;
std::vector<OEngine::GUI::Layout*> mGarbageDialogs;
void cleanupGarbage();
GuiWindow mShown; // Currently shown windows in inventory mode
/* 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;
void updateVisible(); // Update visibility of all windows based on mode, shown and allowed settings
int mShowFPSLevel;
float mFPS;
unsigned int mTriangleCount;
unsigned int mBatchCount;
void onDialogueWindowBye();
/**
* 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 \a _tag and place the result in \a _result
*/
void onRetrieveTag(const MyGUI::UString& _tag, MyGUI::UString& _result);
};
}
#endif

View file

@ -9,7 +9,7 @@
#include <openengine/ogre/renderer.hpp> #include <openengine/ogre/renderer.hpp>
#include "../mwgui/window_manager.hpp" #include "../mwbase/windowmanager.hpp"
#include <mangle/input/servers/ois_driver.hpp> #include <mangle/input/servers/ois_driver.hpp>
#include <mangle/input/filters/eventlist.hpp> #include <mangle/input/filters/eventlist.hpp>
@ -83,7 +83,7 @@ namespace MWInput
MouseLookEventPtr mouse; MouseLookEventPtr mouse;
OEngine::GUI::EventInjectorPtr guiEvents; OEngine::GUI::EventInjectorPtr guiEvents;
MWWorld::Player &player; MWWorld::Player &player;
MWGui::WindowManager &windows; MWBase::WindowManager &windows;
OMW::Engine& mEngine; OMW::Engine& mEngine;
bool mDragDrop; bool mDragDrop;
@ -230,7 +230,7 @@ private:
public: public:
InputImpl(OEngine::Render::OgreRenderer &_ogre, InputImpl(OEngine::Render::OgreRenderer &_ogre,
MWWorld::Player &_player, MWWorld::Player &_player,
MWGui::WindowManager &_windows, MWBase::WindowManager &_windows,
bool debug, bool debug,
OMW::Engine& engine) OMW::Engine& engine)
: ogre(_ogre), : ogre(_ogre),
@ -457,7 +457,7 @@ private:
/***CONSTRUCTOR***/ /***CONSTRUCTOR***/
MWInputManager::MWInputManager(OEngine::Render::OgreRenderer &ogre, MWInputManager::MWInputManager(OEngine::Render::OgreRenderer &ogre,
MWWorld::Player &player, MWWorld::Player &player,
MWGui::WindowManager &windows, MWBase::WindowManager &windows,
bool debug, bool debug,
OMW::Engine& engine) OMW::Engine& engine)
{ {

View file

@ -20,7 +20,7 @@ namespace MWWorld
class Player; class Player;
} }
namespace MWGui namespace MWBase
{ {
class WindowManager; class WindowManager;
} }
@ -47,7 +47,7 @@ namespace MWInput
public: public:
MWInputManager(OEngine::Render::OgreRenderer &_ogre, MWInputManager(OEngine::Render::OgreRenderer &_ogre,
MWWorld::Player&_player, MWWorld::Player&_player,
MWGui::WindowManager &_windows, MWBase::WindowManager &_windows,
bool debug, bool debug,
OMW::Engine& engine); OMW::Engine& engine);
virtual ~MWInputManager(); virtual ~MWInputManager();

View file

@ -5,12 +5,11 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwworld/class.hpp" #include "../mwworld/class.hpp"
#include "../mwworld/player.hpp" #include "../mwworld/player.hpp"
#include "../mwgui/window_manager.hpp"
namespace MWMechanics namespace MWMechanics
{ {
void MechanicsManager::buildPlayer() void MechanicsManager::buildPlayer()
@ -265,8 +264,8 @@ namespace MWMechanics
MWBase::Environment::get().getWorld()->getPlayer().getClass().name); MWBase::Environment::get().getWorld()->getPlayer().getClass().name);
mUpdatePlayer = false; mUpdatePlayer = false;
MWGui::WindowManager::SkillList majorSkills (5); MWBase::WindowManager::SkillList majorSkills (5);
MWGui::WindowManager::SkillList minorSkills (5); MWBase::WindowManager::SkillList minorSkills (5);
for (int i=0; i<5; ++i) for (int i=0; i<5; ++i)
{ {

View file

@ -8,8 +8,7 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwgui/window_manager.hpp"
#include "renderconst.hpp" #include "renderconst.hpp"
#include "renderingmanager.hpp" #include "renderingmanager.hpp"

View file

@ -24,12 +24,11 @@
#include "../mwbase/world.hpp" // these includes can be removed once the static-hack is gone #include "../mwbase/world.hpp" // these includes can be removed once the static-hack is gone
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/inputmanager.hpp" // FIXME #include "../mwbase/inputmanager.hpp" // FIXME
#include "../mwbase/windowmanager.hpp" // FIXME
#include "../mwworld/ptr.hpp" #include "../mwworld/ptr.hpp"
#include "../mwworld/player.hpp" #include "../mwworld/player.hpp"
#include "../mwgui/window_manager.hpp" // FIXME
#include "shadows.hpp" #include "shadows.hpp"
#include "localmap.hpp" #include "localmap.hpp"
#include "water.hpp" #include "water.hpp"

View file

@ -8,8 +8,7 @@
#include <components/interpreter/opcodes.hpp> #include <components/interpreter/opcodes.hpp>
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwgui/window_manager.hpp"
#include "interpretercontext.hpp" #include "interpretercontext.hpp"

View file

@ -10,12 +10,11 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/scriptmanager.hpp" #include "../mwbase/scriptmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwworld/class.hpp" #include "../mwworld/class.hpp"
#include "../mwworld/player.hpp" #include "../mwworld/player.hpp"
#include "../mwgui/window_manager.hpp"
#include "locals.hpp" #include "locals.hpp"
#include "globalscripts.hpp" #include "globalscripts.hpp"

View file

@ -1,7 +1,7 @@
#include "actionalchemy.hpp" #include "actionalchemy.hpp"
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwgui/window_manager.hpp" #include "../mwbase/windowmanager.hpp"
namespace MWWorld namespace MWWorld
{ {

View file

@ -1,9 +1,8 @@
#include "actionopen.hpp" #include "actionopen.hpp"
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwclass/container.hpp"
#include "../mwgui/window_manager.hpp"
#include "../mwgui/container.hpp" #include "../mwgui/container.hpp"
#include "class.hpp" #include "class.hpp"

View file

@ -1,7 +1,8 @@
#include "actionread.hpp" #include "actionread.hpp"
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwgui/window_manager.hpp" #include "../mwbase/windowmanager.hpp"
#include "../mwgui/bookwindow.hpp" #include "../mwgui/bookwindow.hpp"
#include "../mwgui/scrollwindow.hpp" #include "../mwgui/scrollwindow.hpp"

View file

@ -3,8 +3,7 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwgui/window_manager.hpp"
#include "class.hpp" #include "class.hpp"
#include "containerstore.hpp" #include "containerstore.hpp"

View file

@ -6,8 +6,7 @@
#include "../mwbase/world.hpp" /// FIXME #include "../mwbase/world.hpp" /// FIXME
#include "../mwbase/soundmanager.hpp" #include "../mwbase/soundmanager.hpp"
#include "../mwbase/mechanicsmanager.hpp" #include "../mwbase/mechanicsmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwgui/window_manager.hpp"
#include "player.hpp" #include "player.hpp"
#include "localscripts.hpp" #include "localscripts.hpp"

View file

@ -6,12 +6,11 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/soundmanager.hpp" #include "../mwbase/soundmanager.hpp"
#include "../mwbase/mechanicsmanager.hpp" #include "../mwbase/mechanicsmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwrender/sky.hpp" #include "../mwrender/sky.hpp"
#include "../mwrender/player.hpp" #include "../mwrender/player.hpp"
#include "../mwgui/window_manager.hpp"
#include "player.hpp" #include "player.hpp"
#include "manualref.hpp" #include "manualref.hpp"
#include "cellfunctors.hpp" #include "cellfunctors.hpp"