2013-03-30 14:51:07 +00:00
|
|
|
#include "soulgemdialog.hpp"
|
|
|
|
|
|
|
|
#include "../mwbase/environment.hpp"
|
2015-01-10 02:56:06 +00:00
|
|
|
#include "../mwbase/windowmanager.hpp"
|
2013-03-30 14:51:07 +00:00
|
|
|
|
|
|
|
#include "messagebox.hpp"
|
|
|
|
|
|
|
|
namespace MWGui
|
|
|
|
{
|
|
|
|
|
|
|
|
void SoulgemDialog::show(const MWWorld::Ptr &soulgem)
|
|
|
|
{
|
|
|
|
mSoulgem = soulgem;
|
|
|
|
std::vector<std::string> buttons;
|
|
|
|
buttons.push_back("#{sRechargeEnchantment}");
|
|
|
|
buttons.push_back("#{sMake Enchantment}");
|
|
|
|
mManager->createInteractiveMessageBox("#{sDoYouWantTo}", buttons);
|
|
|
|
mManager->eventButtonPressed += MyGUI::newDelegate(this, &SoulgemDialog::onButtonPressed);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SoulgemDialog::onButtonPressed(int button)
|
|
|
|
{
|
|
|
|
if (button == 0)
|
|
|
|
{
|
2013-11-19 05:48:47 +00:00
|
|
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Recharge);
|
|
|
|
MWBase::Environment::get().getWindowManager()->startRecharge(mSoulgem);
|
2013-03-30 14:51:07 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Enchanting);
|
|
|
|
MWBase::Environment::get().getWindowManager()->startSelfEnchanting(mSoulgem);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|