mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-03 09:19:41 +00:00
cleaning up hircine work
This commit is contained in:
parent
9ec1e55aaf
commit
b309d245c5
36 changed files with 506 additions and 6 deletions
|
@ -24,7 +24,7 @@ add_openmw_dir (mwinput
|
|||
|
||||
add_openmw_dir (mwgui
|
||||
layouts text_input widgets race class birth review window_manager console dialogue
|
||||
dialogue_history window_base stats_window messagebox journalwindow charactercreation
|
||||
dialogue_history window_base stats_window messagebox journalwindow charactercreation container
|
||||
)
|
||||
|
||||
add_openmw_dir (mwdialogue
|
||||
|
@ -45,7 +45,7 @@ add_openmw_dir (mwsound
|
|||
add_openmw_dir (mwworld
|
||||
refdata world physicssystem scene environment globals class action nullaction actionteleport
|
||||
containerstore actiontalk actiontake manualref player cellfunctors
|
||||
cells localscripts customdata weather inventorystore ptr
|
||||
cells localscripts customdata weather inventorystore ptr actionopen
|
||||
)
|
||||
|
||||
add_openmw_dir (mwclass
|
||||
|
|
|
@ -86,4 +86,14 @@ namespace MWClass
|
|||
{
|
||||
return std::string("Item Apparatus Down");
|
||||
}
|
||||
|
||||
|
||||
std::string Apparatus::getInventoryIcon (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
ESMS::LiveCellRef<ESM::Apparatus, MWWorld::RefData> *ref =
|
||||
ptr.get<ESM::Apparatus>();
|
||||
|
||||
return ref->base->icon;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -32,6 +32,9 @@ namespace MWClass
|
|||
|
||||
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const;
|
||||
///< Return the put down sound Id
|
||||
|
||||
virtual std::string getInventoryIcon (const MWWorld::Ptr& ptr) const;
|
||||
///< Return name of inventory icon.
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -188,4 +188,12 @@ namespace MWClass
|
|||
else
|
||||
return std::string("Item Armor Heavy Down");
|
||||
}
|
||||
|
||||
std::string Armor::getInventoryIcon (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
ESMS::LiveCellRef<ESM::Armor, MWWorld::RefData> *ref =
|
||||
ptr.get<ESM::Armor>();
|
||||
|
||||
return ref->base->icon;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,6 +47,9 @@ namespace MWClass
|
|||
|
||||
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr, const MWWorld::Environment& environment) const;
|
||||
///< Return the put down sound Id
|
||||
|
||||
virtual std::string getInventoryIcon (const MWWorld::Ptr& ptr) const;
|
||||
///< Return name of inventory icon.
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -88,4 +88,12 @@ namespace MWClass
|
|||
{
|
||||
return std::string("Item Book Down");
|
||||
}
|
||||
std::string Book::getInventoryIcon (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
ESMS::LiveCellRef<ESM::Book, MWWorld::RefData> *ref =
|
||||
ptr.get<ESM::Book>();
|
||||
|
||||
return ref->base->icon;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -32,6 +32,9 @@ namespace MWClass
|
|||
|
||||
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr, const MWWorld::Environment& environment) const;
|
||||
///< Return the put down sound Id
|
||||
|
||||
virtual std::string getInventoryIcon (const MWWorld::Ptr& ptr) const;
|
||||
///< Return name of inventory icon.
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -153,4 +153,12 @@ namespace MWClass
|
|||
}
|
||||
return std::string("Item Clothes Down");
|
||||
}
|
||||
|
||||
std::string Clothing::getInventoryIcon (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
ESMS::LiveCellRef<ESM::Clothing, MWWorld::RefData> *ref =
|
||||
ptr.get<ESM::Clothing>();
|
||||
|
||||
return ref->base->icon;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,6 +41,9 @@ namespace MWClass
|
|||
|
||||
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr, const MWWorld::Environment& environment) const;
|
||||
///< Return the put down sound Id
|
||||
|
||||
virtual std::string getInventoryIcon (const MWWorld::Ptr& ptr) const;
|
||||
///< Return name of inventory icon.
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include "../mwworld/environment.hpp"
|
||||
|
||||
#include "../mwrender/objects.hpp"
|
||||
#include "../mwworld/actionopen.hpp"
|
||||
|
||||
#include "../mwsound/soundmanager.hpp"
|
||||
|
||||
|
@ -81,6 +82,7 @@ namespace MWClass
|
|||
const std::string lockedSound = "LockedChest";
|
||||
const std::string trapActivationSound = "Disarm Trap Fail";
|
||||
|
||||
|
||||
if (ptr.getCellRef().lockLevel>0)
|
||||
{
|
||||
// TODO check for key
|
||||
|
@ -94,7 +96,8 @@ namespace MWClass
|
|||
if(ptr.getCellRef().trap.empty())
|
||||
{
|
||||
// Not trapped, Inventory GUI goes here
|
||||
return boost::shared_ptr<MWWorld::Action> (new MWWorld::NullAction);
|
||||
//return boost::shared_ptr<MWWorld::Action> (new MWWorld::NullAction);
|
||||
return boost::shared_ptr<MWWorld::Action> (new MWWorld::ActionOpen(ptr));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -137,4 +140,6 @@ namespace MWClass
|
|||
|
||||
registerClass (typeid (ESM::Container).name(), instance);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -84,4 +84,12 @@ namespace MWClass
|
|||
{
|
||||
return std::string("Item Ingredient Down");
|
||||
}
|
||||
|
||||
std::string Ingredient::getInventoryIcon (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
ESMS::LiveCellRef<ESM::Ingredient, MWWorld::RefData> *ref =
|
||||
ptr.get<ESM::Ingredient>();
|
||||
|
||||
return ref->base->icon;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,6 +32,9 @@ namespace MWClass
|
|||
|
||||
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr, const MWWorld::Environment& environment) const;
|
||||
///< Return the put down sound Id
|
||||
|
||||
virtual std::string getInventoryIcon (const MWWorld::Ptr& ptr) const;
|
||||
///< Return name of inventory icon.
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -126,4 +126,12 @@ namespace MWClass
|
|||
{
|
||||
return std::string("Item Misc Down");
|
||||
}
|
||||
|
||||
std::string Light::getInventoryIcon (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
ESMS::LiveCellRef<ESM::Light, MWWorld::RefData> *ref =
|
||||
ptr.get<ESM::Light>();
|
||||
|
||||
return ref->base->icon;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,6 +41,9 @@ namespace MWClass
|
|||
|
||||
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr, const MWWorld::Environment& environment) const;
|
||||
///< Return the put down sound Id
|
||||
|
||||
virtual std::string getInventoryIcon (const MWWorld::Ptr& ptr) const;
|
||||
///< Return name of inventory icon.
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -97,4 +97,12 @@ namespace MWClass
|
|||
{
|
||||
return std::string("Item Lockpick Down");
|
||||
}
|
||||
|
||||
std::string Lockpick::getInventoryIcon (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
ESMS::LiveCellRef<ESM::Tool, MWWorld::RefData> *ref =
|
||||
ptr.get<ESM::Tool>();
|
||||
|
||||
return ref->base->icon;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,6 +36,9 @@ namespace MWClass
|
|||
|
||||
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr, const MWWorld::Environment& environment) const;
|
||||
///< Return the put down sound Id
|
||||
|
||||
virtual std::string getInventoryIcon (const MWWorld::Ptr& ptr) const;
|
||||
///< Return name of inventory icon.
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -100,4 +100,12 @@ namespace MWClass
|
|||
}
|
||||
return std::string("Item Misc Down");
|
||||
}
|
||||
|
||||
std::string Miscellaneous::getInventoryIcon (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
ESMS::LiveCellRef<ESM::Miscellaneous, MWWorld::RefData> *ref =
|
||||
ptr.get<ESM::Miscellaneous>();
|
||||
|
||||
return ref->base->icon;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,6 +32,9 @@ namespace MWClass
|
|||
|
||||
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr, const MWWorld::Environment& environment) const;
|
||||
///< Return the put down sound Id
|
||||
|
||||
virtual std::string getInventoryIcon (const MWWorld::Ptr& ptr) const;
|
||||
///< Return name of inventory icon.
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -86,4 +86,13 @@ namespace MWClass
|
|||
{
|
||||
return std::string("Item Potion Down");
|
||||
}
|
||||
|
||||
|
||||
std::string Potion::getInventoryIcon (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
ESMS::LiveCellRef<ESM::Potion, MWWorld::RefData> *ref =
|
||||
ptr.get<ESM::Potion>();
|
||||
|
||||
return ref->base->icon;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,6 +32,9 @@ namespace MWClass
|
|||
|
||||
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr, const MWWorld::Environment& environment) const;
|
||||
///< Return the put down sound Id
|
||||
|
||||
virtual std::string getInventoryIcon (const MWWorld::Ptr& ptr) const;
|
||||
///< Return name of inventory icon.
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -96,4 +96,12 @@ namespace MWClass
|
|||
{
|
||||
return std::string("Item Probe Down");
|
||||
}
|
||||
|
||||
std::string Probe::getInventoryIcon (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
ESMS::LiveCellRef<ESM::Probe, MWWorld::RefData> *ref =
|
||||
ptr.get<ESM::Probe>();
|
||||
|
||||
return ref->base->icon;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,6 +36,9 @@ namespace MWClass
|
|||
|
||||
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr, const MWWorld::Environment& environment) const;
|
||||
///< Return the put down sound Id
|
||||
|
||||
virtual std::string getInventoryIcon (const MWWorld::Ptr& ptr) const;
|
||||
///< Return name of inventory icon.
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -86,4 +86,12 @@ namespace MWClass
|
|||
{
|
||||
return std::string("Item Repair Down");
|
||||
}
|
||||
|
||||
std::string Repair::getInventoryIcon (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
ESMS::LiveCellRef<ESM::Repair, MWWorld::RefData> *ref =
|
||||
ptr.get<ESM::Repair>();
|
||||
|
||||
return ref->base->icon;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,6 +32,9 @@ namespace MWClass
|
|||
|
||||
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr, const MWWorld::Environment& environment) const;
|
||||
///< Return the put down sound Id
|
||||
|
||||
virtual std::string getInventoryIcon (const MWWorld::Ptr& ptr) const;
|
||||
///< Return name of inventory icon.
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -237,4 +237,13 @@ namespace MWClass
|
|||
|
||||
return std::string("Item Misc Down");
|
||||
}
|
||||
|
||||
|
||||
std::string Weapon::getInventoryIcon (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
ESMS::LiveCellRef<ESM::Weapon, MWWorld::RefData> *ref =
|
||||
ptr.get<ESM::Weapon>();
|
||||
|
||||
return ref->base->icon;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,6 +47,11 @@ namespace MWClass
|
|||
|
||||
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr, const MWWorld::Environment& environment) const;
|
||||
///< Return the put down sound Id
|
||||
|
||||
virtual std::string getInventoryIcon (const MWWorld::Ptr& ptr) const;
|
||||
///< Return name of inventory icon.
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
|
191
apps/openmw/mwgui/container.cpp
Normal file
191
apps/openmw/mwgui/container.cpp
Normal file
|
@ -0,0 +1,191 @@
|
|||
#include "container.hpp"
|
||||
|
||||
#include <iterator>
|
||||
#include <algorithm>
|
||||
#include "window_manager.hpp"
|
||||
#include "widgets.hpp"
|
||||
|
||||
#include "../mwworld/environment.hpp"
|
||||
#include "../mwworld/manualref.hpp"
|
||||
#include <cmath>
|
||||
#include <algorithm>
|
||||
#include <iterator>
|
||||
|
||||
#include <assert.h>
|
||||
#include <iostream>
|
||||
#include "../mwclass/container.hpp"
|
||||
#include "../mwworld/containerstore.hpp"
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
|
||||
using namespace MWGui;
|
||||
using namespace Widgets;
|
||||
|
||||
|
||||
ContainerWindow::ContainerWindow(WindowManager& parWindowManager,MWWorld::Environment& environment)
|
||||
: WindowBase("openmw_container_window_layout.xml", parWindowManager),
|
||||
mEnvironment(environment)
|
||||
{
|
||||
setText("_Main", "Name of Container");
|
||||
setVisible(false);
|
||||
|
||||
getWidget(containerWidget, "Items");
|
||||
getWidget(takeButton, "TakeButton");
|
||||
getWidget(closeButton, "CloseButton");
|
||||
|
||||
setText("CloseButton","Close");
|
||||
setText("TakeButton","Take All");
|
||||
|
||||
//ctor
|
||||
}
|
||||
|
||||
ContainerWindow::~ContainerWindow()
|
||||
{
|
||||
//dtor
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
void ContainerWindow::setName(std::string contName)
|
||||
{
|
||||
setText("_Main", contName);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ContainerWindow::open(MWWorld::Ptr& container)
|
||||
{
|
||||
setName(MWWorld::Class::get(container).getName(container));
|
||||
//MWWorld::ContainerStore* containerStore = container.getContainerStore();
|
||||
|
||||
MWWorld::ContainerStore& containerStore = MWWorld::Class::get(container).getContainerStore(container);
|
||||
|
||||
|
||||
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");
|
||||
MWWorld::ManualRef goldRef (mWindowManager.getStore(), "gold_100");
|
||||
|
||||
containerStore.add(furRef.getPtr());
|
||||
containerStore.add(furRef.getPtr());
|
||||
containerStore.add(furRef.getPtr());
|
||||
containerStore.add(broomRef.getPtr());
|
||||
containerStore.add(broomRef.getPtr());
|
||||
containerStore.add(broomRef.getPtr());
|
||||
containerStore.add(broomRef.getPtr());
|
||||
containerStore.add(broomRef.getPtr());
|
||||
containerStore.add(broomRef.getPtr());
|
||||
containerStore.add(broomRef.getPtr());
|
||||
containerStore.add(broomRef.getPtr());
|
||||
containerStore.add(broomRef.getPtr());
|
||||
containerStore.add(broomRef.getPtr());
|
||||
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(bukkitRef.getPtr());
|
||||
containerStore.add(bukkitRef.getPtr());
|
||||
containerStore.add(bukkitRef.getPtr());
|
||||
containerStore.add(bukkitRef.getPtr());
|
||||
containerStore.add(goldRef.getPtr());
|
||||
|
||||
|
||||
|
||||
// ESMS::LiveCellRef<ESM::Armor, MWWorld::RefData> *ref = iter->get<ESM::Armor>();
|
||||
|
||||
|
||||
int x = 4;
|
||||
int y = 4;
|
||||
int count = 0;
|
||||
|
||||
for (MWWorld::ContainerStoreIterator iter (containerStore.begin()); iter!=containerStore.end(); ++iter)
|
||||
{
|
||||
std::string path = std::string("icons\\");
|
||||
|
||||
|
||||
path += iter.getInventoryIcon();
|
||||
// switch (iter.getType())
|
||||
// {
|
||||
//
|
||||
// case MWWorld::ContainerStore::Type_Potion:
|
||||
// path += iter->get<ESM::Potion>()->base->icon;
|
||||
// break;
|
||||
// case MWWorld::ContainerStore::Type_Apparatus:
|
||||
// path += iter->get<ESM::Apparatus>()->base->icon;
|
||||
// break;
|
||||
// case MWWorld::ContainerStore::Type_Armor:
|
||||
// path += iter->get<ESM::Armor>()->base->icon;
|
||||
// break;
|
||||
// case MWWorld::ContainerStore::Type_Book:
|
||||
// path += iter->get<ESM::Book>()->base->icon;
|
||||
// break;
|
||||
// case MWWorld::ContainerStore::Type_Clothing:
|
||||
// path += iter->get<ESM::Clothing>()->base->icon;
|
||||
// break;
|
||||
// case MWWorld::ContainerStore::Type_Ingredient:
|
||||
// path += iter->get<ESM::Ingredient>()->base->icon;
|
||||
// break;
|
||||
// case MWWorld::ContainerStore::Type_Light:
|
||||
// path += iter->get<ESM::Light>()->base->icon;
|
||||
// break;
|
||||
// case MWWorld::ContainerStore::Type_Lockpick:
|
||||
// path += iter->get<ESM::Tool>()->base->icon;
|
||||
// break;
|
||||
// case MWWorld::ContainerStore::Type_Miscellaneous:
|
||||
// path += iter->get<ESM::Miscellaneous>()->base->icon;
|
||||
// break;
|
||||
// case MWWorld::ContainerStore::Type_Probe:
|
||||
// path += iter->get<ESM::Probe>()->base->icon;
|
||||
// break;
|
||||
// case MWWorld::ContainerStore::Type_Repair:
|
||||
// path += iter->get<ESM::Repair>()->base->icon;
|
||||
// break;
|
||||
// case MWWorld::ContainerStore::Type_Weapon:
|
||||
// path += iter->get<ESM::Weapon>()->base->icon;
|
||||
// break;
|
||||
//
|
||||
//
|
||||
// }
|
||||
count++;
|
||||
|
||||
if(count % 8 == 0)
|
||||
{
|
||||
y += 36;
|
||||
x = 4;
|
||||
count = 0;
|
||||
}
|
||||
x += 36;
|
||||
|
||||
|
||||
MyGUI::ImageBox* image = containerWidget->createWidget<MyGUI::ImageBox>("ImageBox", MyGUI::IntCoord(x, y, 32, 32), MyGUI::Align::Default);
|
||||
MyGUI::TextBox* text = containerWidget->createWidget<MyGUI::TextBox>("SandBrightText", MyGUI::IntCoord(x, y, 18, 18), MyGUI::Align::Default, std::string("Label"));
|
||||
|
||||
if(iter->getRefData().getCount() > 1)
|
||||
text->setCaption(boost::lexical_cast<std::string>(iter->getRefData().getCount()));
|
||||
|
||||
|
||||
containerWidgets.push_back(image);
|
||||
|
||||
|
||||
int pos = path.rfind(".");
|
||||
path.erase(pos);
|
||||
path.append(".dds");
|
||||
|
||||
//std::cout << path << std::endl;
|
||||
image->setImageTexture(path);
|
||||
}
|
||||
|
||||
|
||||
setVisible(true);
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
62
apps/openmw/mwgui/container.hpp
Normal file
62
apps/openmw/mwgui/container.hpp
Normal file
|
@ -0,0 +1,62 @@
|
|||
#ifndef MGUI_CONTAINER_H
|
||||
#define MGUI_CONTAINER_H
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
#include "../mwclass/container.hpp"
|
||||
#include <sstream>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include "window_base.hpp"
|
||||
#include "../mwworld/ptr.hpp"
|
||||
#include "../mwworld/containerstore.hpp"
|
||||
|
||||
namespace MWWorld
|
||||
{
|
||||
class Environment;
|
||||
}
|
||||
|
||||
namespace MyGUI
|
||||
{
|
||||
class Gui;
|
||||
class Widget;
|
||||
}
|
||||
|
||||
namespace MWGui
|
||||
{
|
||||
class WindowManager;
|
||||
}
|
||||
|
||||
|
||||
namespace MWGui
|
||||
{
|
||||
|
||||
|
||||
class ContainerWindow : public WindowBase
|
||||
{
|
||||
public:
|
||||
ContainerWindow(WindowManager& parWindowManager,MWWorld::Environment& environment);
|
||||
|
||||
|
||||
void open(MWWorld::Ptr& container);
|
||||
void setName(std::string contName);
|
||||
void Update();
|
||||
|
||||
virtual ~ContainerWindow();
|
||||
protected:
|
||||
private:
|
||||
MWWorld::Environment& mEnvironment;
|
||||
std::vector<MyGUI::WidgetPtr> containerWidgets;
|
||||
MyGUI::WidgetPtr containerWidget;
|
||||
|
||||
MyGUI::ButtonPtr takeButton;
|
||||
MyGUI::ButtonPtr closeButton;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//MWWorld::Ptr& mContainer;
|
||||
};
|
||||
}
|
||||
#endif // CONTAINER_H
|
|
@ -6,6 +6,7 @@
|
|||
#include "dialogue_history.hpp"
|
||||
#include "stats_window.hpp"
|
||||
#include "messagebox.hpp"
|
||||
#include "container.hpp"
|
||||
|
||||
#include "../mwmechanics/mechanicsmanager.hpp"
|
||||
#include "../mwinput/inputmanager.hpp"
|
||||
|
@ -52,6 +53,7 @@ WindowManager::WindowManager(MWWorld::Environment& environment,
|
|||
mJournal = new JournalWindow(*this);
|
||||
mMessageBoxManager = new MessageBoxManager(this);
|
||||
dialogueWindow = new DialogueWindow(*this,environment);
|
||||
containerWindow = new ContainerWindow(*this,environment);
|
||||
|
||||
// The HUD is always on
|
||||
hud->setVisible(true);
|
||||
|
@ -90,7 +92,7 @@ WindowManager::~WindowManager()
|
|||
delete stats;
|
||||
delete mJournal;
|
||||
delete dialogueWindow;
|
||||
|
||||
delete containerWindow;
|
||||
delete mCharGen;
|
||||
|
||||
cleanupGarbage();
|
||||
|
|
|
@ -62,7 +62,7 @@ namespace MWGui
|
|||
class Console;
|
||||
class JournalWindow;
|
||||
class CharacterCreation;
|
||||
|
||||
class ContainerWindow;
|
||||
class TextInputDialog;
|
||||
class InfoBoxDialog;
|
||||
class DialogueWindow;
|
||||
|
@ -127,6 +127,8 @@ namespace MWGui
|
|||
|
||||
MWGui::DialogueWindow* getDialogueWindow() {return dialogueWindow;}
|
||||
|
||||
MWGui::ContainerWindow* getContainerWindow() {return containerWindow;}
|
||||
|
||||
MyGUI::Gui* getGui() const { return gui; }
|
||||
|
||||
void wmUpdateFps(float fps, size_t triangleCount, size_t batchCount)
|
||||
|
@ -191,7 +193,7 @@ namespace MWGui
|
|||
Console *console;
|
||||
JournalWindow* mJournal;
|
||||
DialogueWindow *dialogueWindow;
|
||||
|
||||
ContainerWindow *containerWindow;
|
||||
CharacterCreation* mCharGen;
|
||||
|
||||
// Various stats about player as needed by window manager
|
||||
|
|
21
apps/openmw/mwworld/actionopen.cpp
Normal file
21
apps/openmw/mwworld/actionopen.cpp
Normal file
|
@ -0,0 +1,21 @@
|
|||
#include "actionopen.hpp"
|
||||
|
||||
#include "environment.hpp"
|
||||
#include "class.hpp"
|
||||
#include "world.hpp"
|
||||
#include "containerstore.hpp"
|
||||
#include "../mwclass/container.hpp"
|
||||
#include "../mwgui/window_manager.hpp"
|
||||
#include "../mwgui/container.hpp"
|
||||
|
||||
namespace MWWorld
|
||||
{
|
||||
ActionOpen::ActionOpen (const MWWorld::Ptr& container) : mContainer (container) {
|
||||
mContainer = container;
|
||||
}
|
||||
|
||||
void ActionOpen::execute (Environment& environment)
|
||||
{
|
||||
environment.mWindowManager->getContainerWindow()->open(mContainer);
|
||||
}
|
||||
}
|
22
apps/openmw/mwworld/actionopen.hpp
Normal file
22
apps/openmw/mwworld/actionopen.hpp
Normal file
|
@ -0,0 +1,22 @@
|
|||
|
||||
#ifndef GAME_MWWORLD_ACTIONOPEN_H
|
||||
#define GAME_MWWORLD_ACTIONOPEN_H
|
||||
|
||||
#include "action.hpp"
|
||||
#include "ptr.hpp"
|
||||
|
||||
|
||||
namespace MWWorld
|
||||
{
|
||||
class ActionOpen : public Action
|
||||
{
|
||||
Ptr mContainer;
|
||||
|
||||
public:
|
||||
ActionOpen (const Ptr& container);
|
||||
///< \param The Container the Player has activated.
|
||||
virtual void execute (Environment& environment);
|
||||
};
|
||||
}
|
||||
|
||||
#endif // ACTIONOPEN_H
|
|
@ -457,3 +457,33 @@ bool MWWorld::operator!= (const ContainerStoreIterator& left, const ContainerSto
|
|||
{
|
||||
return !(left==right);
|
||||
}
|
||||
|
||||
|
||||
std::string MWWorld::ContainerStoreIterator::getInventoryIcon()
|
||||
{
|
||||
Ptr ptr;
|
||||
|
||||
switch (mType)
|
||||
{
|
||||
case ContainerStore::Type_Potion: ptr = MWWorld::Ptr (&*mPotion, 0); break;
|
||||
case ContainerStore::Type_Apparatus: ptr = MWWorld::Ptr (&*mApparatus, 0); break;
|
||||
case ContainerStore::Type_Armor: ptr = MWWorld::Ptr (&*mArmor, 0); break;
|
||||
case ContainerStore::Type_Book: ptr = MWWorld::Ptr (&*mBook, 0); break;
|
||||
case ContainerStore::Type_Clothing: ptr = MWWorld::Ptr (&*mClothing, 0); break;
|
||||
case ContainerStore::Type_Ingredient: ptr = MWWorld::Ptr (&*mIngredient, 0); break;
|
||||
case ContainerStore::Type_Light: ptr = MWWorld::Ptr (&*mLight, 0); break;
|
||||
case ContainerStore::Type_Lockpick: ptr = MWWorld::Ptr (&*mLockpick, 0); break;
|
||||
case ContainerStore::Type_Miscellaneous: ptr = MWWorld::Ptr (&*mMiscellaneous, 0); break;
|
||||
case ContainerStore::Type_Probe: ptr = MWWorld::Ptr (&*mProbe, 0); break;
|
||||
case ContainerStore::Type_Repair: ptr = MWWorld::Ptr (&*mRepair, 0); break;
|
||||
case ContainerStore::Type_Weapon: ptr = MWWorld::Ptr (&*mWeapon, 0); break;
|
||||
}
|
||||
|
||||
if (ptr.isEmpty())
|
||||
throw std::runtime_error ("invalid iterator");
|
||||
|
||||
|
||||
std::string s = ptr.getInventoryIcon();
|
||||
|
||||
return s;
|
||||
}
|
||||
|
|
|
@ -161,6 +161,8 @@ namespace MWWorld
|
|||
|
||||
const ContainerStore *getContainerStore() const;
|
||||
|
||||
std::string getInventoryIcon();
|
||||
|
||||
friend class ContainerStore;
|
||||
};
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ configure_file("${SDIR}/openmw_chargen_review_layout.xml" "${DDIR}/openmw_charge
|
|||
configure_file("${SDIR}/openmw_dialogue_window_layout.xml" "${DDIR}/openmw_dialogue_window_layout.xml" COPYONLY)
|
||||
configure_file("${SDIR}/openmw_dialogue_window_skin.xml" "${DDIR}/openmw_dialogue_window_skin.xml" COPYONLY)
|
||||
configure_file("${SDIR}/openmw_inventory_window_layout.xml" "${DDIR}/openmw_inventory_window_layout.xml" COPYONLY)
|
||||
configure_file("${SDIR}/openmw_container_window_layout.xml" "${DDIR}/openmw_container_window_layout.xml" COPYONLY)
|
||||
configure_file("${SDIR}/openmw_layers.xml" "${DDIR}/openmw_layers.xml" COPYONLY)
|
||||
configure_file("${SDIR}/openmw_mainmenu_layout.xml" "${DDIR}/openmw_mainmenu_layout.xml" COPYONLY)
|
||||
configure_file("${SDIR}/openmw_mainmenu_skin.xml" "${DDIR}/openmw_mainmenu_skin.xml" COPYONLY)
|
||||
|
|
24
files/mygui/openmw_container_window_layout.xml
Normal file
24
files/mygui/openmw_container_window_layout.xml
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<MyGUI type="Layout">
|
||||
<Widget type="Window" skin="MW_Window" layer="Windows" position="900 500 600 300" name="_Main">
|
||||
|
||||
<!-- HEADER
|
||||
<Widget type="TextBox" skin="HeaderText" position="0 0 588 18" name="ContainerName" align="ALIGN_LEFT ALIGN_TOP">
|
||||
<Property key="Caption" value="Name"/>
|
||||
<Property key="TextAlign" value="ALIGN_CENTER"/>
|
||||
</Widget>-->
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Items in inventory -->
|
||||
<Widget type="Widget" skin="MW_Box" position="5 10 570 220" name="Items"/>
|
||||
|
||||
<Widget type="Widget" position="300 235 300 24" align="ALIGN_TOP ALIGN_LEFT" name="Buttons">
|
||||
<Widget type="Button" skin="MW_Button" position="100 0 75 24" name="TakeButton"/>
|
||||
<Widget type="Button" skin="MW_Button" position="180 0 60 24" name="CloseButton"/>
|
||||
</Widget>
|
||||
|
||||
</Widget>
|
||||
</MyGUI>
|
Loading…
Reference in a new issue