summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-02-28 16:18:47 +0300
committerAndrei Karas <akaras@inbox.ru>2017-02-28 16:18:47 +0300
commitd9dab8f2d9436b84a318cd5df171ba96dd4ec5ac (patch)
treec90aa6fdafa9481610168368acf7a1017fe75491 /src/gui
parentc24610711a456f5f572cef6f64f5620aa2e48669 (diff)
downloadplus-d9dab8f2d9436b84a318cd5df171ba96dd4ec5ac.tar.gz
plus-d9dab8f2d9436b84a318cd5df171ba96dd4ec5ac.tar.bz2
plus-d9dab8f2d9436b84a318cd5df171ba96dd4ec5ac.tar.xz
plus-d9dab8f2d9436b84a318cd5df171ba96dd4ec5ac.zip
Add paths.xml option overweightPercent for show overweight message.
Default value: 50
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/dialogsmanager.cpp5
-rw-r--r--src/gui/widgets/tabs/setup_other.cpp1
2 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/dialogsmanager.cpp b/src/gui/dialogsmanager.cpp
index c1ed960be..b4a3cc6ea 100644
--- a/src/gui/dialogsmanager.cpp
+++ b/src/gui/dialogsmanager.cpp
@@ -166,8 +166,11 @@ void DialogsManager::attributeChanged(const AttributesT id,
{
if (!weightNotice && config.getBoolValue("weightMsg"))
{
+ int percent = settings.overweightPercent;
+ if (percent < 1)
+ percent = 50;
const int max = PlayerInfo::getAttribute(
- Attributes::MAX_WEIGHT) / 2;
+ Attributes::MAX_WEIGHT) * percent / 100;
const int total = oldVal;
if (newVal >= max && total < max)
{
diff --git a/src/gui/widgets/tabs/setup_other.cpp b/src/gui/widgets/tabs/setup_other.cpp
index 8ed123a4d..656192f18 100644
--- a/src/gui/widgets/tabs/setup_other.cpp
+++ b/src/gui/widgets/tabs/setup_other.cpp
@@ -275,7 +275,6 @@ Setup_Other::Setup_Other(const Widget2 *const widget) :
new SetupItemCheckBox(_("Enable weight notifications"), "",
"weightMsg", this, "weightMsgEvent");
-
// TRANSLATORS: settings group
new SetupItemLabel(_("Shop"), "", this);