diff options
author | asuratva <asuratva@proton.me> | 2025-06-05 21:18:56 +0000 |
---|---|---|
committer | Fedja Beader <fedja@protonmail.ch> | 2025-06-05 21:18:56 +0000 |
commit | c9925d7b4371f347dbcb95c4b5411d61d4f36c0a (patch) | |
tree | 785c4e2c4444465958edde6e3a01a3fe400d9d1e /src | |
parent | a1bd5c468bd97e1a2af762da38396d9176748f9e (diff) | |
download | manaplus-c9925d7b4371f347dbcb95c4b5411d61d4f36c0a.tar.gz manaplus-c9925d7b4371f347dbcb95c4b5411d61d4f36c0a.tar.bz2 manaplus-c9925d7b4371f347dbcb95c4b5411d61d4f36c0a.tar.xz manaplus-c9925d7b4371f347dbcb95c4b5411d61d4f36c0a.zip |
Change overweight notification from widget to speech bubble.
Having the widget pop up in the middle of a fight when shooting arrows makes you go below 50% weight is kinda annoying. This changes the notification to a speech bubble on player which is less intrusive.
Squashed with:
* Move messages to top of branch (so they can be integrated to dialog with
fewer changes).
* Adjust overweight message.
* Fix linter issue. Shortened long line
****
mana/plus!184
Co-authored-by: Fedja Beader <fedja@protonmail.ch>
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/dialogsmanager.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/gui/dialogsmanager.cpp b/src/gui/dialogsmanager.cpp index 2383d2bb0..655ef0c2c 100644 --- a/src/gui/dialogsmanager.cpp +++ b/src/gui/dialogsmanager.cpp @@ -26,6 +26,8 @@ #include "configuration.h" #include "settings.h" +#include "being/localplayer.h" + #include "being/playerinfo.h" #include "const/sound.h" @@ -192,6 +194,11 @@ void DialogsManager::attributeChanged(const AttributesT id, const int total = CAST_S32(oldVal); if (newVal >= max && total < max) { + const std::string overweightMessage( + // TRANSLATORS: overweight message in speech bubble + _("Warning: You are overburdened," + " you have difficulty regenerating.")); + /* weightNoticeTime = cur_time + 5; CREATEWIDGETV(weightNotice, OkDialog, std::string(), @@ -208,9 +215,17 @@ void DialogsManager::attributeChanged(const AttributesT id, 260); weightNotice->addActionListener( &weightListener); + */ + if (localPlayer != nullptr) + localPlayer->setSpeech(overweightMessage); } else if (newVal < max && total >= max) { + const std::string underweightMessage( + // TRANSLATORS: overweight message in speech bubble + _("You are no longer overburdened," + " regeneration back to normal.")); + /* weightNoticeTime = cur_time + 5; CREATEWIDGETV(weightNotice, OkDialog, std::string(), @@ -227,6 +242,9 @@ void DialogsManager::attributeChanged(const AttributesT id, 260); weightNotice->addActionListener( &weightListener); + */ + if (localPlayer != nullptr) + localPlayer->setSpeech(underweightMessage); } } } |