1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-03-28 21:06:41 +00:00

Starting inventory window

This commit is contained in:
gugus 2012-04-21 10:51:01 +02:00
parent 489261a6ae
commit 1e8d894e1c
6 changed files with 69 additions and 3 deletions

View file

@ -41,6 +41,23 @@ ContainerWindow::ContainerWindow(WindowManager& parWindowManager,MWWorld::Enviro
setText("TakeButton","Take All"); setText("TakeButton","Take All");
} }
ContainerWindow::ContainerWindow(WindowManager& parWindowManager,MWWorld::Environment& environment,std::string guiFile)
: WindowBase(guiFile, parWindowManager),
mEnvironment(environment)
{
setText("_Main", "Name of Container");
//center();
adjustWindowCaption();
getWidget(containerWidget, "Items");
//getWidget(takeButton, "TakeButton");
//getWidget(closeButton, "CloseButton");
//closeButton->eventMouseButtonClick += MyGUI::newDelegate(this, &ContainerWindow::onByeClicked);
//setText("CloseButton","Close");
//setText("TakeButton","Take All");
}
ContainerWindow::~ContainerWindow() ContainerWindow::~ContainerWindow()
{ {
} }
@ -60,7 +77,7 @@ void ContainerWindow::open(MWWorld::Ptr& container)
MWWorld::ContainerStore& containerStore = MWWorld::Class::get(container).getContainerStore(container); MWWorld::ContainerStore& containerStore = MWWorld::Class::get(container).getContainerStore(container);
MWWorld::ManualRef furRef (mWindowManager.getStore(), "fur_cuirass"); /*MWWorld::ManualRef furRef (mWindowManager.getStore(), "fur_cuirass");
furRef.getPtr().getRefData().setCount (5); furRef.getPtr().getRefData().setCount (5);
MWWorld::ManualRef bukkitRef (mWindowManager.getStore(), "misc_com_bucket_01"); MWWorld::ManualRef bukkitRef (mWindowManager.getStore(), "misc_com_bucket_01");
MWWorld::ManualRef broomRef (mWindowManager.getStore(), "misc_com_broom_01"); MWWorld::ManualRef broomRef (mWindowManager.getStore(), "misc_com_broom_01");
@ -89,7 +106,7 @@ void ContainerWindow::open(MWWorld::Ptr& container)
containerStore.add(bukkitRef.getPtr()); containerStore.add(bukkitRef.getPtr());
containerStore.add(bukkitRef.getPtr()); containerStore.add(bukkitRef.getPtr());
containerStore.add(bukkitRef.getPtr()); containerStore.add(bukkitRef.getPtr());
containerStore.add(goldRef.getPtr()); containerStore.add(goldRef.getPtr());*/

View file

@ -36,6 +36,7 @@ namespace MWGui
{ {
public: public:
ContainerWindow(WindowManager& parWindowManager,MWWorld::Environment& environment); ContainerWindow(WindowManager& parWindowManager,MWWorld::Environment& environment);
ContainerWindow(WindowManager& parWindowManager,MWWorld::Environment& environment,std::string guiFile);
void open(MWWorld::Ptr& container); void open(MWWorld::Ptr& container);

View file

@ -0,0 +1,11 @@
#include "inventorywindow.hpp"
namespace MWGui
{
InventoryWindow::InventoryWindow(WindowManager& parWindowManager,MWWorld::Environment& environment)
:ContainerWindow(parWindowManager,environment,"openmw_inventory_window_layout.xml")
{
}
}

View file

@ -0,0 +1,30 @@
#ifndef MGUI_Inventory_H
#define MGUI_Inventory_H
#include "container.hpp"
namespace MWWorld
{
class Environment;
}
namespace MyGUI
{
class Gui;
class Widget;
}
namespace MWGui
{
class WindowManager;
}
namespace MWGui
{
class InventoryWindow : public MWGui::ContainerWindow
{
public:
InventoryWindow(WindowManager& parWindowManager,MWWorld::Environment& environment);
};
}
#endif // Inventory_H

View file

@ -8,6 +8,7 @@
#include "stats_window.hpp" #include "stats_window.hpp"
#include "messagebox.hpp" #include "messagebox.hpp"
#include "container.hpp" #include "container.hpp"
#include "inventorywindow.hpp"
#include "../mwmechanics/mechanicsmanager.hpp" #include "../mwmechanics/mechanicsmanager.hpp"
#include "../mwinput/inputmanager.hpp" #include "../mwinput/inputmanager.hpp"
@ -82,6 +83,7 @@ WindowManager::WindowManager(MWWorld::Environment& environment,
mMessageBoxManager = new MessageBoxManager(this); mMessageBoxManager = new MessageBoxManager(this);
dialogueWindow = new DialogueWindow(*this,environment); dialogueWindow = new DialogueWindow(*this,environment);
containerWindow = new ContainerWindow(*this,environment); containerWindow = new ContainerWindow(*this,environment);
mInventoryWindow = new InventoryWindow(*this,environment);
// The HUD is always on // The HUD is always on
hud->setVisible(true); hud->setVisible(true);
@ -121,6 +123,7 @@ WindowManager::~WindowManager()
delete mJournal; delete mJournal;
delete dialogueWindow; delete dialogueWindow;
delete containerWindow; delete containerWindow;
delete mInventoryWindow;
delete mCharGen; delete mCharGen;
cleanupGarbage(); cleanupGarbage();
@ -182,6 +185,7 @@ void WindowManager::updateVisible()
mJournal->setVisible(false); mJournal->setVisible(false);
dialogueWindow->setVisible(false); dialogueWindow->setVisible(false);
containerWindow->setVisible(false); containerWindow->setVisible(false);
mInventoryWindow->setVisible(false);
// Mouse is visible whenever we're not in game mode // Mouse is visible whenever we're not in game mode
MyGUI::PointerManager::getInstance().setVisible(isGuiMode()); MyGUI::PointerManager::getInstance().setVisible(isGuiMode());
@ -217,11 +221,12 @@ void WindowManager::updateVisible()
// Show the windows we want // Show the windows we want
map -> setVisible( (eff & GW_Map) != 0 ); map -> setVisible( (eff & GW_Map) != 0 );
stats -> setVisible( (eff & GW_Stats) != 0 ); stats -> setVisible( (eff & GW_Stats) != 0 );
mInventoryWindow->setVisible(true);
break; break;
} }
case GM_Container: case GM_Container:
containerWindow->setVisible(true); containerWindow->setVisible(true);
mInventoryWindow->setVisible(true);
break; break;
case GM_Dialogue: case GM_Dialogue:
dialogueWindow->open(); dialogueWindow->open();

View file

@ -63,6 +63,7 @@ namespace MWGui
class JournalWindow; class JournalWindow;
class CharacterCreation; class CharacterCreation;
class ContainerWindow; class ContainerWindow;
class InventoryWindow;
class TextInputDialog; class TextInputDialog;
class InfoBoxDialog; class InfoBoxDialog;
class DialogueWindow; class DialogueWindow;
@ -204,6 +205,7 @@ namespace MWGui
JournalWindow* mJournal; JournalWindow* mJournal;
DialogueWindow *dialogueWindow; DialogueWindow *dialogueWindow;
ContainerWindow *containerWindow; ContainerWindow *containerWindow;
InventoryWindow *mInventoryWindow;
CharacterCreation* mCharGen; CharacterCreation* mCharGen;
// Various stats about player as needed by window manager // Various stats about player as needed by window manager