diff --git a/apps/openmw/mwgui/container.hpp b/apps/openmw/mwgui/container.hpp index 3802d21afb..5bb0192337 100644 --- a/apps/openmw/mwgui/container.hpp +++ b/apps/openmw/mwgui/container.hpp @@ -44,8 +44,8 @@ namespace MWGui void Update(); virtual ~ContainerWindow(); + protected: - private: MWWorld::Environment& mEnvironment; std::vector containerWidgets; MyGUI::WidgetPtr containerWidget; diff --git a/apps/openmw/mwgui/inventorywindow.cpp b/apps/openmw/mwgui/inventorywindow.cpp index 7f3884bc17..188cc3796f 100644 --- a/apps/openmw/mwgui/inventorywindow.cpp +++ b/apps/openmw/mwgui/inventorywindow.cpp @@ -1,5 +1,23 @@ #include "inventorywindow.hpp" +#include +#include +#include "window_manager.hpp" +#include "widgets.hpp" +#include "../mwworld/environment.hpp" +#include "../mwworld/manualref.hpp" +#include +#include +#include + +#include +#include +#include "../mwclass/container.hpp" +#include "../mwworld/containerstore.hpp" +#include +#include "../mwworld/class.hpp" +#include "../mwworld/world.hpp" +#include "../mwworld/player.hpp" namespace MWGui { @@ -8,4 +26,9 @@ namespace MWGui { } + void InventoryWindow::openInventory() + { + open(mEnvironment.mWorld->getPlayer().getPlayer()); + } + } \ No newline at end of file diff --git a/apps/openmw/mwgui/inventorywindow.hpp b/apps/openmw/mwgui/inventorywindow.hpp index ce177014a1..bf9be43757 100644 --- a/apps/openmw/mwgui/inventorywindow.hpp +++ b/apps/openmw/mwgui/inventorywindow.hpp @@ -25,6 +25,8 @@ namespace MWGui { public: InventoryWindow(WindowManager& parWindowManager,MWWorld::Environment& environment); + + void openInventory(); }; } #endif // Inventory_H diff --git a/apps/openmw/mwgui/window_manager.cpp b/apps/openmw/mwgui/window_manager.cpp index 065141963e..c15f7077dd 100644 --- a/apps/openmw/mwgui/window_manager.cpp +++ b/apps/openmw/mwgui/window_manager.cpp @@ -222,11 +222,13 @@ void WindowManager::updateVisible() map -> setVisible( (eff & GW_Map) != 0 ); stats -> setVisible( (eff & GW_Stats) != 0 ); mInventoryWindow->setVisible(true); + mInventoryWindow->openInventory(); break; } case GM_Container: containerWindow->setVisible(true); mInventoryWindow->setVisible(true); + mInventoryWindow->openInventory(); break; case GM_Dialogue: dialogueWindow->open();