1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 21:19:57 +00:00
openmw-tes3mp/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 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
{
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) override;
void setPtr(const MWWorld::Ptr& actor, int startOffset);
2012-09-08 22:17:03 +00:00
void onFrame(float dt) override { checkReferenceAvailable(); }
void clear() override { resetReference(); }
void onResChange(int, int) override { center(); }
2017-09-23 20:07:30 +00:00
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();
void onReferenceUnavailable() override;
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