forked from mirror/openmw-tes3mp
more clean-up. Container window shows up! But there is no working close button.
This commit is contained in:
parent
78c8a22cd1
commit
58d05fa503
6 changed files with 12 additions and 76 deletions
|
@ -16,6 +16,7 @@
|
||||||
#include "../mwclass/container.hpp"
|
#include "../mwclass/container.hpp"
|
||||||
#include "../mwworld/containerstore.hpp"
|
#include "../mwworld/containerstore.hpp"
|
||||||
#include <boost/lexical_cast.hpp>
|
#include <boost/lexical_cast.hpp>
|
||||||
|
#include "../mwworld/class.hpp"
|
||||||
|
|
||||||
|
|
||||||
using namespace MWGui;
|
using namespace MWGui;
|
||||||
|
@ -101,49 +102,7 @@ void ContainerWindow::open(MWWorld::Ptr& container)
|
||||||
std::string path = std::string("icons\\");
|
std::string path = std::string("icons\\");
|
||||||
|
|
||||||
|
|
||||||
//path += iter.getInventoryIcon();
|
path+=MWWorld::Class::get(*iter).getInventoryIcon(*iter);
|
||||||
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++;
|
count++;
|
||||||
|
|
||||||
if(count % 8 == 0)
|
if(count % 8 == 0)
|
||||||
|
|
|
@ -173,4 +173,9 @@ namespace MWWorld
|
||||||
{
|
{
|
||||||
throw std::runtime_error ("class does not have an down sound");
|
throw std::runtime_error ("class does not have an down sound");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string Class::getInventoryIcon (const MWWorld::Ptr& ptr) const
|
||||||
|
{
|
||||||
|
throw std::runtime_error ("class does not have any inventory icon");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -174,6 +174,9 @@ namespace MWWorld
|
||||||
virtual std::string getDownSoundId (const Ptr& ptr, const MWWorld::Environment& environment) const;
|
virtual std::string getDownSoundId (const Ptr& ptr, const MWWorld::Environment& environment) const;
|
||||||
///< Return the down sound ID of \a ptr or throw an exception, if class does not support ID retrieval
|
///< Return the down sound ID of \a ptr or throw an exception, if class does not support ID retrieval
|
||||||
/// (default implementation: throw an exception)
|
/// (default implementation: throw an exception)
|
||||||
|
|
||||||
|
virtual std::string getInventoryIcon (const MWWorld::Ptr& ptr) const;
|
||||||
|
///< Return name of inventory icon.
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -457,33 +457,3 @@ bool MWWorld::operator!= (const ContainerStoreIterator& left, const ContainerSto
|
||||||
{
|
{
|
||||||
return !(left==right);
|
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,8 +161,6 @@ namespace MWWorld
|
||||||
|
|
||||||
const ContainerStore *getContainerStore() const;
|
const ContainerStore *getContainerStore() const;
|
||||||
|
|
||||||
std::string getInventoryIcon();
|
|
||||||
|
|
||||||
friend class ContainerStore;
|
friend class ContainerStore;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
<List file="openmw_journal_skin.xml" />
|
<List file="openmw_journal_skin.xml" />
|
||||||
<List file="openmw_map_window_skin.xml" />
|
<List file="openmw_map_window_skin.xml" />
|
||||||
<List file="openmw_dialogue_window_skin.xml" />
|
<List file="openmw_dialogue_window_skin.xml" />
|
||||||
|
<List file="openmw_container_window_layout.xml" />
|
||||||
<List file="openmw_settings.xml" />
|
<List file="openmw_settings.xml" />
|
||||||
</MyGUI>
|
</MyGUI>
|
||||||
</MyGUI>
|
</MyGUI>
|
||||||
|
|
Loading…
Reference in a new issue