mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 22:23:51 +00:00
Merge pull request #1305 from akortunov/enchantchance
Show success chance when self-enchanting
This commit is contained in:
commit
516e99c6e7
5 changed files with 45 additions and 1 deletions
|
@ -8,6 +8,7 @@
|
||||||
#include <MyGUI_ScrollView.h>
|
#include <MyGUI_ScrollView.h>
|
||||||
|
|
||||||
#include <components/widgets/list.hpp>
|
#include <components/widgets/list.hpp>
|
||||||
|
#include <components/settings/settings.hpp>
|
||||||
|
|
||||||
#include "../mwbase/environment.hpp"
|
#include "../mwbase/environment.hpp"
|
||||||
#include "../mwbase/world.hpp"
|
#include "../mwbase/world.hpp"
|
||||||
|
@ -43,6 +44,8 @@ namespace MWGui
|
||||||
getWidget(mEnchantmentPoints, "Enchantment");
|
getWidget(mEnchantmentPoints, "Enchantment");
|
||||||
getWidget(mCastCost, "CastCost");
|
getWidget(mCastCost, "CastCost");
|
||||||
getWidget(mCharge, "Charge");
|
getWidget(mCharge, "Charge");
|
||||||
|
getWidget(mSuccessChance, "SuccessChance");
|
||||||
|
getWidget(mChanceLayout, "ChanceLayout");
|
||||||
getWidget(mTypeButton, "TypeButton");
|
getWidget(mTypeButton, "TypeButton");
|
||||||
getWidget(mBuyButton, "BuyButton");
|
getWidget(mBuyButton, "BuyButton");
|
||||||
getWidget(mPrice, "PriceLabel");
|
getWidget(mPrice, "PriceLabel");
|
||||||
|
@ -115,6 +118,9 @@ namespace MWGui
|
||||||
|
|
||||||
mCharge->setCaption(MyGUI::utility::toString(mEnchanting.getGemCharge()));
|
mCharge->setCaption(MyGUI::utility::toString(mEnchanting.getGemCharge()));
|
||||||
|
|
||||||
|
int successChance = int(mEnchanting.getEnchantChance());
|
||||||
|
mSuccessChance->setCaption(MyGUI::utility::toString(std::max(0, successChance)));
|
||||||
|
|
||||||
std::stringstream castCost;
|
std::stringstream castCost;
|
||||||
castCost << mEnchanting.getEffectiveCastCost();
|
castCost << mEnchanting.getEffectiveCastCost();
|
||||||
mCastCost->setCaption(castCost.str());
|
mCastCost->setCaption(castCost.str());
|
||||||
|
@ -144,11 +150,15 @@ namespace MWGui
|
||||||
|
|
||||||
void EnchantingDialog::startEnchanting (MWWorld::Ptr actor)
|
void EnchantingDialog::startEnchanting (MWWorld::Ptr actor)
|
||||||
{
|
{
|
||||||
|
mName->setCaption("");
|
||||||
|
|
||||||
mEnchanting.setSelfEnchanting(false);
|
mEnchanting.setSelfEnchanting(false);
|
||||||
mEnchanting.setEnchanter(actor);
|
mEnchanting.setEnchanter(actor);
|
||||||
|
|
||||||
mBuyButton->setCaptionWithReplacing("#{sBuy}");
|
mBuyButton->setCaptionWithReplacing("#{sBuy}");
|
||||||
|
|
||||||
|
mChanceLayout->setVisible(false);
|
||||||
|
|
||||||
mPtr = actor;
|
mPtr = actor;
|
||||||
|
|
||||||
setSoulGem(MWWorld::Ptr());
|
setSoulGem(MWWorld::Ptr());
|
||||||
|
@ -162,6 +172,8 @@ namespace MWGui
|
||||||
|
|
||||||
void EnchantingDialog::startSelfEnchanting(MWWorld::Ptr soulgem)
|
void EnchantingDialog::startSelfEnchanting(MWWorld::Ptr soulgem)
|
||||||
{
|
{
|
||||||
|
mName->setCaption("");
|
||||||
|
|
||||||
MWWorld::Ptr player = MWMechanics::getPlayer();
|
MWWorld::Ptr player = MWMechanics::getPlayer();
|
||||||
|
|
||||||
mEnchanting.setSelfEnchanting(true);
|
mEnchanting.setSelfEnchanting(true);
|
||||||
|
@ -169,6 +181,10 @@ namespace MWGui
|
||||||
|
|
||||||
mBuyButton->setCaptionWithReplacing("#{sCreate}");
|
mBuyButton->setCaptionWithReplacing("#{sCreate}");
|
||||||
|
|
||||||
|
bool enabled = Settings::Manager::getBool("show enchant chance","GUI");
|
||||||
|
|
||||||
|
mChanceLayout->setVisible(enabled);
|
||||||
|
|
||||||
mPtr = player;
|
mPtr = player;
|
||||||
startEditing();
|
startEditing();
|
||||||
|
|
||||||
|
|
|
@ -49,6 +49,8 @@ namespace MWGui
|
||||||
|
|
||||||
ItemSelectionDialog* mItemSelectionDialog;
|
ItemSelectionDialog* mItemSelectionDialog;
|
||||||
|
|
||||||
|
MyGUI::Widget* mChanceLayout;
|
||||||
|
|
||||||
MyGUI::Button* mCancelButton;
|
MyGUI::Button* mCancelButton;
|
||||||
ItemWidget* mItemBox;
|
ItemWidget* mItemBox;
|
||||||
ItemWidget* mSoulBox;
|
ItemWidget* mSoulBox;
|
||||||
|
@ -60,6 +62,7 @@ namespace MWGui
|
||||||
MyGUI::TextBox* mEnchantmentPoints;
|
MyGUI::TextBox* mEnchantmentPoints;
|
||||||
MyGUI::TextBox* mCastCost;
|
MyGUI::TextBox* mCastCost;
|
||||||
MyGUI::TextBox* mCharge;
|
MyGUI::TextBox* mCharge;
|
||||||
|
MyGUI::TextBox* mSuccessChance;
|
||||||
MyGUI::TextBox* mPrice;
|
MyGUI::TextBox* mPrice;
|
||||||
MyGUI::TextBox* mPriceText;
|
MyGUI::TextBox* mPriceText;
|
||||||
|
|
||||||
|
|
|
@ -127,3 +127,14 @@ The default value is "1.0 0.15 0.15 1.0" which is a bright red color.
|
||||||
This setting can only be configured by editing the settings configuration file.
|
This setting can only be configured by editing the settings configuration file.
|
||||||
This setting has no effect if the crosshair setting in the HUD Settings Section is false.
|
This setting has no effect if the crosshair setting in the HUD Settings Section is false.
|
||||||
This setting has no effect if the show owned setting in the Game Settings Section is false.
|
This setting has no effect if the show owned setting in the Game Settings Section is false.
|
||||||
|
|
||||||
|
show enchant chance
|
||||||
|
----------------
|
||||||
|
|
||||||
|
:Type: boolean
|
||||||
|
:Range: True/False
|
||||||
|
:Default: False
|
||||||
|
|
||||||
|
Whether or not the chance of success will be displayed in the enchanting menu.
|
||||||
|
|
||||||
|
The default value is false. This setting can only be configured by editing the settings configuration file.
|
||||||
|
|
|
@ -52,7 +52,7 @@
|
||||||
</Widget>
|
</Widget>
|
||||||
|
|
||||||
<!-- Values -->
|
<!-- Values -->
|
||||||
<Widget type="VBox" position="320 7 222 72">
|
<Widget type="VBox" position="320 7 222 80">
|
||||||
<Widget type="HBox">
|
<Widget type="HBox">
|
||||||
<UserString key="HStretch" value="true"/>
|
<UserString key="HStretch" value="true"/>
|
||||||
<Widget type="AutoSizedTextBox" skin="NormalText">
|
<Widget type="AutoSizedTextBox" skin="NormalText">
|
||||||
|
@ -95,6 +95,17 @@
|
||||||
<UserString key="HStretch" value="true"/>
|
<UserString key="HStretch" value="true"/>
|
||||||
</Widget>
|
</Widget>
|
||||||
</Widget>
|
</Widget>
|
||||||
|
<Widget type="HBox" name="ChanceLayout">
|
||||||
|
<UserString key="HStretch" value="true"/>
|
||||||
|
<Widget type="AutoSizedTextBox" skin="NormalText">
|
||||||
|
<Property key="Caption" value="#{sEnchantmentMenu6}:"/>
|
||||||
|
</Widget>
|
||||||
|
<Widget type="AutoSizedTextBox" skin="SandText" name="SuccessChance">
|
||||||
|
<Property key="Caption" value="39"/>
|
||||||
|
<Property key="TextAlign" value="Right VCenter"/>
|
||||||
|
<UserString key="HStretch" value="true"/>
|
||||||
|
</Widget>
|
||||||
|
</Widget>
|
||||||
</Widget>
|
</Widget>
|
||||||
|
|
||||||
<!-- Available effects -->
|
<!-- Available effects -->
|
||||||
|
|
|
@ -141,6 +141,9 @@ werewolf overlay = true
|
||||||
color background owned = 0.15 0.0 0.0 1.0
|
color background owned = 0.15 0.0 0.0 1.0
|
||||||
color crosshair owned = 1.0 0.15 0.15 1.0
|
color crosshair owned = 1.0 0.15 0.15 1.0
|
||||||
|
|
||||||
|
# Show success probability in self-enchant dialog
|
||||||
|
show enchant chance = false
|
||||||
|
|
||||||
[HUD]
|
[HUD]
|
||||||
|
|
||||||
# Displays the crosshair or reticle when not in GUI mode.
|
# Displays the crosshair or reticle when not in GUI mode.
|
||||||
|
|
Loading…
Reference in a new issue