1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 21:49:56 +00:00
openmw-tes3mp/apps/openmw/mwgui/alchemywindow.hpp
2019-05-17 10:49:00 +04:00

83 lines
2.1 KiB
C++

#ifndef MWGUI_ALCHEMY_H
#define MWGUI_ALCHEMY_H
#include <memory>
#include <vector>
#include <MyGUI_ControllerItem.h>
#include <components/widgets/numericeditbox.hpp>
#include "windowbase.hpp"
namespace MWMechanics
{
class Alchemy;
}
namespace MWGui
{
class ItemView;
class ItemWidget;
class SortFilterItemModel;
class AlchemyWindow : public WindowBase
{
public:
AlchemyWindow();
virtual void onOpen();
void onResChange(int, int) { center(); }
private:
static const float sCountChangeInitialPause; // in seconds
static const float sCountChangeInterval; // in seconds
std::string mSuggestedPotionName;
ItemView* mItemView;
SortFilterItemModel* mSortModel;
MyGUI::Button* mCreateButton;
MyGUI::Button* mCancelButton;
MyGUI::Widget* mEffectsBox;
MyGUI::Button* mIncreaseButton;
MyGUI::Button* mDecreaseButton;
MyGUI::EditBox* mNameEdit;
Gui::NumericEditBox* mBrewCountEdit;
void onCancelButtonClicked(MyGUI::Widget* _sender);
void onCreateButtonClicked(MyGUI::Widget* _sender);
void onIngredientSelected(MyGUI::Widget* _sender);
void onAccept(MyGUI::EditBox*);
void onIncreaseButtonPressed(MyGUI::Widget* _sender, int _left, int _top, MyGUI::MouseButton _id);
void onDecreaseButtonPressed(MyGUI::Widget* _sender, int _left, int _top, MyGUI::MouseButton _id);
void onCountButtonReleased(MyGUI::Widget* _sender, int _left, int _top, MyGUI::MouseButton _id);
void onCountValueChanged(int value);
void onRepeatClick(MyGUI::Widget* widget, MyGUI::ControllerItem* controller);
void addRepeatController(MyGUI::Widget* widget);
void onIncreaseButtonTriggered();
void onDecreaseButtonTriggered();
void onSelectedItem(int index);
void removeIngredient(MyGUI::Widget* ingredient);
void createPotions(int count);
void update();
std::unique_ptr<MWMechanics::Alchemy> mAlchemy;
std::vector<ItemWidget*> mApparatus;
std::vector<ItemWidget*> mIngredients;
};
}
#endif