1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 15:35:23 +00:00
OpenMW/apps/openmw/mwgui/spellbuyingwindow.hpp

60 lines
1.4 KiB
C++
Raw Normal View History

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