mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-02 06:45:33 +00:00
Starting inventory window
This commit is contained in:
parent
489261a6ae
commit
1e8d894e1c
6 changed files with 69 additions and 3 deletions
|
@ -41,6 +41,23 @@ ContainerWindow::ContainerWindow(WindowManager& parWindowManager,MWWorld::Enviro
|
|||
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()
|
||||
{
|
||||
}
|
||||
|
@ -60,7 +77,7 @@ void ContainerWindow::open(MWWorld::Ptr& 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);
|
||||
MWWorld::ManualRef bukkitRef (mWindowManager.getStore(), "misc_com_bucket_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(goldRef.getPtr());
|
||||
containerStore.add(goldRef.getPtr());*/
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@ namespace MWGui
|
|||
{
|
||||
public:
|
||||
ContainerWindow(WindowManager& parWindowManager,MWWorld::Environment& environment);
|
||||
ContainerWindow(WindowManager& parWindowManager,MWWorld::Environment& environment,std::string guiFile);
|
||||
|
||||
|
||||
void open(MWWorld::Ptr& container);
|
||||
|
|
11
apps/openmw/mwgui/inventorywindow.cpp
Normal file
11
apps/openmw/mwgui/inventorywindow.cpp
Normal 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")
|
||||
{
|
||||
}
|
||||
|
||||
}
|
30
apps/openmw/mwgui/inventorywindow.hpp
Normal file
30
apps/openmw/mwgui/inventorywindow.hpp
Normal 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
|
|
@ -8,6 +8,7 @@
|
|||
#include "stats_window.hpp"
|
||||
#include "messagebox.hpp"
|
||||
#include "container.hpp"
|
||||
#include "inventorywindow.hpp"
|
||||
|
||||
#include "../mwmechanics/mechanicsmanager.hpp"
|
||||
#include "../mwinput/inputmanager.hpp"
|
||||
|
@ -82,6 +83,7 @@ WindowManager::WindowManager(MWWorld::Environment& environment,
|
|||
mMessageBoxManager = new MessageBoxManager(this);
|
||||
dialogueWindow = new DialogueWindow(*this,environment);
|
||||
containerWindow = new ContainerWindow(*this,environment);
|
||||
mInventoryWindow = new InventoryWindow(*this,environment);
|
||||
|
||||
// The HUD is always on
|
||||
hud->setVisible(true);
|
||||
|
@ -121,6 +123,7 @@ WindowManager::~WindowManager()
|
|||
delete mJournal;
|
||||
delete dialogueWindow;
|
||||
delete containerWindow;
|
||||
delete mInventoryWindow;
|
||||
delete mCharGen;
|
||||
|
||||
cleanupGarbage();
|
||||
|
@ -182,6 +185,7 @@ void WindowManager::updateVisible()
|
|||
mJournal->setVisible(false);
|
||||
dialogueWindow->setVisible(false);
|
||||
containerWindow->setVisible(false);
|
||||
mInventoryWindow->setVisible(false);
|
||||
|
||||
// Mouse is visible whenever we're not in game mode
|
||||
MyGUI::PointerManager::getInstance().setVisible(isGuiMode());
|
||||
|
@ -217,11 +221,12 @@ void WindowManager::updateVisible()
|
|||
// Show the windows we want
|
||||
map -> setVisible( (eff & GW_Map) != 0 );
|
||||
stats -> setVisible( (eff & GW_Stats) != 0 );
|
||||
|
||||
mInventoryWindow->setVisible(true);
|
||||
break;
|
||||
}
|
||||
case GM_Container:
|
||||
containerWindow->setVisible(true);
|
||||
mInventoryWindow->setVisible(true);
|
||||
break;
|
||||
case GM_Dialogue:
|
||||
dialogueWindow->open();
|
||||
|
|
|
@ -63,6 +63,7 @@ namespace MWGui
|
|||
class JournalWindow;
|
||||
class CharacterCreation;
|
||||
class ContainerWindow;
|
||||
class InventoryWindow;
|
||||
class TextInputDialog;
|
||||
class InfoBoxDialog;
|
||||
class DialogueWindow;
|
||||
|
@ -204,6 +205,7 @@ namespace MWGui
|
|||
JournalWindow* mJournal;
|
||||
DialogueWindow *dialogueWindow;
|
||||
ContainerWindow *containerWindow;
|
||||
InventoryWindow *mInventoryWindow;
|
||||
CharacterCreation* mCharGen;
|
||||
|
||||
// Various stats about player as needed by window manager
|
||||
|
|
Loading…
Reference in a new issue