1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 02:19:55 +00:00
openmw-tes3mp/apps/openmw/mwgui/spellbuyingwindow.hpp

65 lines
1.5 KiB
C++
Raw Normal View History

#ifndef MWGUI_SpellBuyingWINDOW_H
#define MWGUI_SpellBuyingWINDOW_H
2012-09-08 22:17:03 +00:00
#include "windowbase.hpp"
2012-09-22 22:36:20 +00:00
#include "referenceinterface.hpp"
2012-09-08 22:17:03 +00:00
2019-02-18 22:10:55 +00:00
namespace ESM
{
struct Spell;
}
2017-07-27 09:20:18 +00:00
2012-09-08 22:17:03 +00:00
namespace MyGUI
{
class Gui;
class Widget;
}
namespace MWGui
{
class WindowManager;
}
namespace MWGui
{
2012-09-22 22:36:20 +00:00
class SpellBuyingWindow : public ReferenceInterface, public WindowBase
2012-09-08 22:17:03 +00:00
{
public:
SpellBuyingWindow();
2012-09-08 22:17:03 +00:00
void setPtr(const MWWorld::Ptr& actor);
void setPtr(const MWWorld::Ptr& actor, int startOffset);
2012-09-08 22:17:03 +00:00
void onFrame(float dt) { checkReferenceAvailable(); }
2017-09-23 20:16:56 +00:00
void clear() { resetReference(); }
2017-09-23 20:07:30 +00:00
void onResChange(int, int) { center(); }
2012-09-08 22:17:03 +00:00
protected:
MyGUI::Button* mCancelButton;
MyGUI::TextBox* mPlayerGold;
2012-09-10 12:10:01 +00:00
MyGUI::ScrollView* mSpellsView;
2012-09-08 22:17:03 +00:00
std::map<MyGUI::Widget*, std::string> mSpellsWidgetMap;
2012-09-08 22:17:03 +00:00
void onCancelButtonClicked(MyGUI::Widget* _sender);
void onSpellButtonClick(MyGUI::Widget* _sender);
void onMouseWheel(MyGUI::Widget* _sender, int _rel);
2017-07-27 09:20:18 +00:00
void addSpell(const ESM::Spell& spell);
void clearSpells();
int mCurrentY;
2012-09-08 22:17:03 +00:00
void updateLabels();
virtual void onReferenceUnavailable();
bool playerHasSpell (const std::string& id);
2017-07-27 09:20:18 +00:00
private:
static bool sortSpells (const ESM::Spell* left, const ESM::Spell* right);
2012-09-08 22:17:03 +00:00
};
}
#endif