mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-22 07:53:52 +00:00
Build fix
This commit is contained in:
parent
9089df3080
commit
4443e22387
3 changed files with 25 additions and 17 deletions
|
@ -19,6 +19,8 @@
|
||||||
#include "windowmanagerimp.hpp"
|
#include "windowmanagerimp.hpp"
|
||||||
#include "itemselection.hpp"
|
#include "itemselection.hpp"
|
||||||
|
|
||||||
|
#include "spellwindow.hpp"
|
||||||
|
|
||||||
|
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
|
|
|
@ -20,6 +20,26 @@
|
||||||
|
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
|
|
||||||
|
bool sortItems(const MWWorld::Ptr& left, const MWWorld::Ptr& right)
|
||||||
|
{
|
||||||
|
int cmp = left.getClass().getName(left).compare(
|
||||||
|
right.getClass().getName(right));
|
||||||
|
return cmp < 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool sortSpells(const std::string& left, const std::string& right)
|
||||||
|
{
|
||||||
|
const MWWorld::Store<ESM::Spell> &spells =
|
||||||
|
MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>();
|
||||||
|
|
||||||
|
const ESM::Spell* a = spells.find(left);
|
||||||
|
const ESM::Spell* b = spells.find(right);
|
||||||
|
|
||||||
|
int cmp = a->mName.compare(b->mName);
|
||||||
|
return cmp < 0;
|
||||||
|
}
|
||||||
|
|
||||||
SpellWindow::SpellWindow(DragAndDrop* drag)
|
SpellWindow::SpellWindow(DragAndDrop* drag)
|
||||||
: WindowPinnableBase("openmw_spell_window.layout")
|
: WindowPinnableBase("openmw_spell_window.layout")
|
||||||
, NoDrop(drag, mMainWidget)
|
, NoDrop(drag, mMainWidget)
|
||||||
|
|
|
@ -2,29 +2,15 @@
|
||||||
#define MWGUI_SPELLWINDOW_H
|
#define MWGUI_SPELLWINDOW_H
|
||||||
|
|
||||||
#include "windowpinnablebase.hpp"
|
#include "windowpinnablebase.hpp"
|
||||||
|
#include "../mwworld/ptr.hpp"
|
||||||
|
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
class SpellIcons;
|
class SpellIcons;
|
||||||
|
|
||||||
bool sortItems(const MWWorld::Ptr& left, const MWWorld::Ptr& right)
|
bool sortItems(const MWWorld::Ptr& left, const MWWorld::Ptr& right);
|
||||||
{
|
|
||||||
int cmp = left.getClass().getName(left).compare(
|
|
||||||
right.getClass().getName(right));
|
|
||||||
return cmp < 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool sortSpells(const std::string& left, const std::string& right)
|
bool sortSpells(const std::string& left, const std::string& right);
|
||||||
{
|
|
||||||
const MWWorld::Store<ESM::Spell> &spells =
|
|
||||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>();
|
|
||||||
|
|
||||||
const ESM::Spell* a = spells.find(left);
|
|
||||||
const ESM::Spell* b = spells.find(right);
|
|
||||||
|
|
||||||
int cmp = a->mName.compare(b->mName);
|
|
||||||
return cmp < 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
class SpellWindow : public WindowPinnableBase, public NoDrop
|
class SpellWindow : public WindowPinnableBase, public NoDrop
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue