2012-09-09 14:10:07 -04:00
|
|
|
#ifndef MWGUI_SpellBuyingWINDOW_H
|
|
|
|
#define MWGUI_SpellBuyingWINDOW_H
|
2012-09-08 18:17:03 -04:00
|
|
|
|
2013-04-10 00:32:05 -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:
|
2013-04-10 14:46:21 -04:00
|
|
|
SpellBuyingWindow();
|
2012-09-08 18:17:03 -04:00
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
void setPtr(const MWWorld::Ptr& actor) override;
|
2017-09-22 21:26:41 +02:00
|
|
|
void setPtr(const MWWorld::Ptr& actor, int startOffset);
|
2012-09-08 18:17:03 -04:00
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
void onFrame(float dt) override { checkReferenceAvailable(); }
|
|
|
|
void clear() override { resetReference(); }
|
2017-09-23 22:00:15 +02:00
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
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
|
|
|
|
2012-09-09 21:03:39 +02: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);
|
2012-09-09 14:10:07 -04:00
|
|
|
void clearSpells();
|
2017-10-15 17:03:11 +02:00
|
|
|
int mCurrentY;
|
2012-09-08 18:17:03 -04:00
|
|
|
|
|
|
|
void updateLabels();
|
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
void onReferenceUnavailable() override;
|
2013-03-06 15:11:40 +01:00
|
|
|
|
|
|
|
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
|