You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openmw-tes3mp/apps/openmw/mwgui/soulgemdialog.cpp

34 lines
910 B
C++

#include "soulgemdialog.hpp"
#include "../mwbase/environment.hpp"
#include "../mwbase/windowmanager.hpp"
#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)
{
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Recharge, mSoulgem);
}
else
{
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Enchanting, mSoulgem);
}
}
}