From 33654535c19b22f103bcf547dc337620d6ac5feb Mon Sep 17 00:00:00 2001 From: gugus Date: Sat, 21 Apr 2012 11:05:30 +0200 Subject: [PATCH] The inventory window now display the inventory of the player --- apps/openmw/mwgui/container.hpp | 2 +- apps/openmw/mwgui/inventorywindow.cpp | 23 +++++++++++++++++++++++ apps/openmw/mwgui/inventorywindow.hpp | 2 ++ apps/openmw/mwgui/window_manager.cpp | 2 ++ 4 files changed, 28 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwgui/container.hpp b/apps/openmw/mwgui/container.hpp index 3802d21af..5bb019233 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 7f3884bc1..188cc3796 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 ce177014a..bf9be4375 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 065141963..c15f7077d 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();