2012-09-27 06:47:47 +00:00
|
|
|
#ifndef MWGUI_ENCHANTINGDIALOG_H
|
|
|
|
#define MWGUI_ENCHANTINGDIALOG_H
|
|
|
|
|
2012-10-03 13:36:10 +00:00
|
|
|
#include "spellcreationdialog.hpp"
|
2012-09-27 06:47:47 +00:00
|
|
|
|
|
|
|
#include "../mwbase/windowmanager.hpp"
|
|
|
|
|
2013-03-28 16:41:00 +00:00
|
|
|
#include "../mwmechanics/enchanting.hpp"
|
|
|
|
|
2012-09-27 06:47:47 +00:00
|
|
|
namespace MWGui
|
|
|
|
{
|
|
|
|
|
2013-03-16 18:00:14 +00:00
|
|
|
class ItemSelectionDialog;
|
2014-06-05 20:13:18 +00:00
|
|
|
class ItemWidget;
|
2013-03-16 18:00:14 +00:00
|
|
|
|
2012-10-03 13:36:10 +00:00
|
|
|
class EnchantingDialog : public WindowBase, public ReferenceInterface, public EffectEditorBase
|
2012-09-27 06:47:47 +00:00
|
|
|
{
|
|
|
|
public:
|
2013-04-10 18:46:21 +00:00
|
|
|
EnchantingDialog();
|
2013-03-16 18:00:14 +00:00
|
|
|
virtual ~EnchantingDialog();
|
2012-09-27 06:47:47 +00:00
|
|
|
|
2020-10-16 18:18:54 +00:00
|
|
|
void onOpen() override;
|
2014-05-27 03:13:37 +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
|
|
|
|
2014-06-05 20:13:18 +00:00
|
|
|
void setSoulGem (const MWWorld::Ptr& gem);
|
|
|
|
void setItem (const MWWorld::Ptr& item);
|
|
|
|
|
2017-09-22 19:26:41 +00:00
|
|
|
/// Actor Ptr: buy enchantment from this actor
|
|
|
|
/// Soulgem Ptr: player self-enchant
|
2020-10-16 18:18:54 +00:00
|
|
|
void setPtr(const MWWorld::Ptr& ptr) override;
|
2012-09-27 06:47:47 +00:00
|
|
|
|
2020-10-16 18:18:54 +00:00
|
|
|
void resetReference() override;
|
2014-07-29 13:32:22 +00:00
|
|
|
|
2012-09-27 06:47:47 +00:00
|
|
|
protected:
|
2020-10-16 18:18:54 +00:00
|
|
|
void onReferenceUnavailable() override;
|
|
|
|
void notifyEffectsChanged() override;
|
2012-10-03 13:06:54 +00:00
|
|
|
|
|
|
|
void onCancelButtonClicked(MyGUI::Widget* sender);
|
2013-03-16 18:00:14 +00:00
|
|
|
void onSelectItem (MyGUI::Widget* sender);
|
|
|
|
void onSelectSoul (MyGUI::Widget* sender);
|
|
|
|
|
|
|
|
void onItemSelected(MWWorld::Ptr item);
|
|
|
|
void onItemCancel();
|
|
|
|
void onSoulSelected(MWWorld::Ptr item);
|
|
|
|
void onSoulCancel();
|
2013-03-28 16:41:00 +00:00
|
|
|
void onBuyButtonClicked(MyGUI::Widget* sender);
|
2013-03-16 18:00:14 +00:00
|
|
|
void updateLabels();
|
2013-03-28 16:41:00 +00:00
|
|
|
void onTypeButtonClicked(MyGUI::Widget* sender);
|
2017-09-24 11:05:52 +00:00
|
|
|
void onAccept(MyGUI::EditBox* sender);
|
2013-03-16 18:00:14 +00:00
|
|
|
|
|
|
|
ItemSelectionDialog* mItemSelectionDialog;
|
2012-10-03 13:06:54 +00:00
|
|
|
|
2017-06-01 06:00:15 +00:00
|
|
|
MyGUI::Widget* mChanceLayout;
|
|
|
|
|
2012-10-03 13:06:54 +00:00
|
|
|
MyGUI::Button* mCancelButton;
|
2014-06-05 20:13:18 +00:00
|
|
|
ItemWidget* mItemBox;
|
|
|
|
ItemWidget* mSoulBox;
|
2013-03-16 18:00:14 +00:00
|
|
|
|
|
|
|
MyGUI::Button* mTypeButton;
|
|
|
|
MyGUI::Button* mBuyButton;
|
|
|
|
|
2017-09-24 11:05:52 +00:00
|
|
|
MyGUI::EditBox* mName;
|
2013-03-16 18:00:14 +00:00
|
|
|
MyGUI::TextBox* mEnchantmentPoints;
|
|
|
|
MyGUI::TextBox* mCastCost;
|
|
|
|
MyGUI::TextBox* mCharge;
|
2017-06-01 06:00:15 +00:00
|
|
|
MyGUI::TextBox* mSuccessChance;
|
2013-03-16 18:00:14 +00:00
|
|
|
MyGUI::TextBox* mPrice;
|
2013-04-03 16:02:30 +00:00
|
|
|
MyGUI::TextBox* mPriceText;
|
2013-03-16 18:00:14 +00:00
|
|
|
|
2013-03-28 16:41:00 +00:00
|
|
|
MWMechanics::Enchanting mEnchanting;
|
|
|
|
ESM::EffectList mEffectList;
|
2012-09-27 06:47:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|