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