Example #1
0
    void EnchantingDialog::setPtr (const MWWorld::Ptr& ptr)
    {
        mName->setCaption("");

        if (ptr.getClass().isActor())
        {
            mEnchanting.setSelfEnchanting(false);
            mEnchanting.setEnchanter(ptr);
            mBuyButton->setCaptionWithReplacing("#{sBuy}");
            mChanceLayout->setVisible(false);
            mPtr = ptr;
            setSoulGem(MWWorld::Ptr());
            mPrice->setVisible(true);
            mPriceText->setVisible(true);
        }
        else
        {
            mEnchanting.setSelfEnchanting(true);
            mEnchanting.setEnchanter(MWMechanics::getPlayer());
            mBuyButton->setCaptionWithReplacing("#{sCreate}");
            bool enabled = Settings::Manager::getBool("show enchant chance","Game");
            mChanceLayout->setVisible(enabled);
            mPtr = MWMechanics::getPlayer();
            setSoulGem(ptr);
            mPrice->setVisible(false);
            mPriceText->setVisible(false);
        }

        setItem(MWWorld::Ptr());
        startEditing ();
        updateLabels();
    }
    void EnchantingDialog::startSelfEnchanting(MWWorld::Ptr soulgem)
    {
        mName->setCaption("");

        MWWorld::Ptr player = MWMechanics::getPlayer();

        mEnchanting.setSelfEnchanting(true);
        mEnchanting.setEnchanter(player);

        mBuyButton->setCaptionWithReplacing("#{sCreate}");

        bool enabled = Settings::Manager::getBool("show enchant chance","Game");

        mChanceLayout->setVisible(enabled);

        mPtr = player;
        startEditing();

        setSoulGem(soulgem);
        setItem(MWWorld::Ptr());

        mPrice->setVisible(false);
        mPriceText->setVisible(false);
        updateLabels();
    }
Example #3
0
    void EnchantingDialog::open()
    {
        center();

        setSoulGem(MWWorld::Ptr());
        setItem(MWWorld::Ptr());
    }
 void EnchantingDialog::resetReference()
 {
     ReferenceInterface::resetReference();
     setItem(MWWorld::Ptr());
     setSoulGem(MWWorld::Ptr());
     mPtr = MWWorld::Ptr();
     mEnchanting.setEnchanter(MWWorld::Ptr());
 }
Example #5
0
    void EnchantingDialog::onSoulSelected(MWWorld::Ptr item)
    {
        mItemSelectionDialog->setVisible(false);
        mEnchanting.setSoulGem(item);

        if(mEnchanting.getGemCharge()==0)
        {
            MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage32}");
            return;
        }

        setSoulGem(item);
    }
    void EnchantingDialog::startEnchanting (MWWorld::Ptr actor)
    {
        mEnchanting.setSelfEnchanting(false);
        mEnchanting.setEnchanter(actor);

        mBuyButton->setCaptionWithReplacing("#{sBuy}");

        mPtr = actor;

        setSoulGem(MWWorld::Ptr());
        setItem(MWWorld::Ptr());

        startEditing ();
        mPrice->setVisible(true);
        mPriceText->setVisible(true);
        updateLabels();
    }
Example #7
0
    void EnchantingDialog::startSelfEnchanting(MWWorld::Ptr soulgem)
    {
        MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();

        mEnchanting.setSelfEnchanting(true);
        mEnchanting.setEnchanter(player);

        mPtr = player;
        startEditing();
        mEnchanting.setSoulGem(soulgem);

        setSoulGem(soulgem);

        mPrice->setVisible(false);
        mPriceText->setVisible(false);
        updateLabels();
    }
    void EnchantingDialog::startSelfEnchanting(MWWorld::Ptr soulgem)
    {
        MWWorld::Ptr player = MWMechanics::getPlayer();

        mEnchanting.setSelfEnchanting(true);
        mEnchanting.setEnchanter(player);

        mBuyButton->setCaptionWithReplacing("#{sCreate}");

        mPtr = player;
        startEditing();

        setSoulGem(soulgem);
        setItem(MWWorld::Ptr());

        mPrice->setVisible(false);
        mPriceText->setVisible(false);
        updateLabels();
    }
Example #9
0
    void EnchantingDialog::onSelectSoul(MyGUI::Widget *sender)
    {
        if (mEnchanting.getGem().isEmpty())
        {
            delete mItemSelectionDialog;
            mItemSelectionDialog = new ItemSelectionDialog("#{sSoulGemsWithSouls}");
            mItemSelectionDialog->eventItemSelected += MyGUI::newDelegate(this, &EnchantingDialog::onSoulSelected);
            mItemSelectionDialog->eventDialogCanceled += MyGUI::newDelegate(this, &EnchantingDialog::onSoulCancel);
            mItemSelectionDialog->setVisible(true);
            mItemSelectionDialog->openContainer(MWBase::Environment::get().getWorld()->getPlayerPtr());
            mItemSelectionDialog->setFilter(SortFilterItemModel::Filter_OnlyChargedSoulstones);

            //MWBase::Environment::get().getWindowManager()->messageBox("#{sInventorySelectNoSoul}");
        }
        else
        {
            setSoulGem(MWWorld::Ptr());
        }
    }