1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-29 01:15:31 +00:00
openmw-tes3mp/apps/openmw/mwgui/spellswindow.hpp

71 lines
2 KiB
C++
Raw Normal View History

2012-09-08 22:17:03 +00:00
#ifndef MWGUI_SPELLSWINDOW_H
#define MWGUI_SPELLSWINDOW_H
#include "container.hpp"
#include "window_base.hpp"
#include "../mwworld/ptr.hpp"
namespace MyGUI
{
class Gui;
class Widget;
}
namespace MWGui
{
class WindowManager;
}
namespace MWGui
{
class SpellsWindow : public ContainerBase, public WindowBase
{
public:
SpellsWindow(MWBase::WindowManager& parWindowManager);
void startSpells(MWWorld::Ptr actor);
protected:
MyGUI::Button* mCancelButton;
MyGUI::TextBox* mPlayerGold;
MyGUI::TextBox* mSpells;
MyGUI::TextBox* mSelect;
MyGUI::WidgetPtr mSpellsBoxWidget, mSpellsClientWidget;
MyGUI::ScrollBar* mSpellsScrollerWidget;
std::map<MyGUI::Widget*, const ESM::Spell*> mSpellsWidgetMap;
std::map<const ESM::Spell*, int> mSpellsPriceMap;
std::vector<MyGUI::WidgetPtr> mSpellsWidgets;
void onWindowResize(MyGUI::Window* _sender);
void onFilterChanged(MyGUI::Widget* _sender);
void onCancelButtonClicked(MyGUI::Widget* _sender);
void onFocus(MyGUI::Widget* _sender, MyGUI::Widget* _old);
void onFocusLost(MyGUI::Widget* _sender, MyGUI::Widget* _old);
void onSpellButtonClick(MyGUI::Widget* _sender);
void addSpell(std::string spellID);
void clearSpells();
void updateScroller();
void onScrollChangePosition(MyGUI::ScrollBar* scroller, size_t pos);
void onMouseWheel(MyGUI::Widget* _sender, int _rel);
int mLastPos,mCurrentY;
static const int sLineHeight;
// don't show items that the NPC has equipped in his trade-window.
virtual bool ignoreEquippedItems() { return true; }
virtual bool isTrading() { return true; }
virtual bool isTradeWindow() { return true; }
void updateLabels();
virtual void onReferenceUnavailable();
};
}
#endif