From ccf8cc004d07d642a53f8b34740a7751ccb7874d Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Sun, 26 Dec 2021 08:13:24 +0000 Subject: [PATCH] Spell book: Fix "Level 0 - Unusable" overlap Removes the display of mana and damage for unusable spells and moves the "Unusable" text onto the second line, fixing the overlap. --- Source/panels/spell_book.cpp | 34 +++++++++++++++++----------------- Translations/bg.po | 4 ++-- Translations/es.po | 4 ++-- Translations/it.po | 4 ++-- Translations/ja.po | 4 ++-- Translations/sv.po | 4 ++-- Translations/uk.po | 4 ++-- Translations/zh_CN.po | 4 ++-- 8 files changed, 31 insertions(+), 31 deletions(-) diff --git a/Source/panels/spell_book.cpp b/Source/panels/spell_book.cpp index 52c91be46..d29471bc9 100644 --- a/Source/panels/spell_book.cpp +++ b/Source/panels/spell_book.cpp @@ -158,26 +158,26 @@ void DrawSpellBook(const Surface &out) } break; default: { int mana = GetManaAmount(player, sn) >> 6; - if (sn != SPL_BONESPIRIT) { - int min; - int max; - GetDamageAmt(sn, &min, &max); - if (min != -1) { - if (sn == SPL_HEAL || sn == SPL_HEALOTHER) { - PrintSBookStr(out, line1, fmt::format(_(/* TRANSLATORS: UI constrains, keep short please.*/ "Heals: {:d} - {:d}"), min, max), UiFlags::AlignRight); - } else { - PrintSBookStr(out, line1, fmt::format(_(/* TRANSLATORS: UI constrains, keep short please.*/ "Damage: {:d} - {:d}"), min, max), UiFlags::AlignRight); - } - } - } else { - PrintSBookStr(out, line1, _(/* TRANSLATORS: UI constrains, keep short please.*/ "Dmg: 1/3 target hp"), UiFlags::AlignRight); - } - PrintSBookStr(out, line1, fmt::format(pgettext(/* TRANSLATORS: UI constrains, keep short please.*/ "spellbook", "Mana: {:d}"), mana)); int lvl = std::max(player._pSplLvl[sn] + player._pISplLvlAdd, 0); + PrintSBookStr(out, line0, fmt::format(pgettext(/* TRANSLATORS: UI constrains, keep short please.*/ "spellbook", "Level {:d}"), lvl), UiFlags::AlignRight); if (lvl == 0) { - PrintSBookStr(out, line0, _("Level 0 - Unusable"), UiFlags::AlignRight); + PrintSBookStr(out, line1, _("Unusable"), UiFlags::AlignRight); } else { - PrintSBookStr(out, line0, fmt::format(pgettext(/* TRANSLATORS: UI constrains, keep short please.*/ "spellbook", "Level {:d}"), lvl), UiFlags::AlignRight); + if (sn != SPL_BONESPIRIT) { + int min; + int max; + GetDamageAmt(sn, &min, &max); + if (min != -1) { + if (sn == SPL_HEAL || sn == SPL_HEALOTHER) { + PrintSBookStr(out, line1, fmt::format(_(/* TRANSLATORS: UI constrains, keep short please.*/ "Heals: {:d} - {:d}"), min, max), UiFlags::AlignRight); + } else { + PrintSBookStr(out, line1, fmt::format(_(/* TRANSLATORS: UI constrains, keep short please.*/ "Damage: {:d} - {:d}"), min, max), UiFlags::AlignRight); + } + } + } else { + PrintSBookStr(out, line1, _(/* TRANSLATORS: UI constrains, keep short please.*/ "Dmg: 1/3 target hp"), UiFlags::AlignRight); + } + PrintSBookStr(out, line1, fmt::format(pgettext(/* TRANSLATORS: UI constrains, keep short please.*/ "spellbook", "Mana: {:d}"), mana)); } } break; } diff --git a/Translations/bg.po b/Translations/bg.po index 4d48b928d..498a97686 100644 --- a/Translations/bg.po +++ b/Translations/bg.po @@ -6611,8 +6611,8 @@ msgid "Mana: {:d}" msgstr "Мана: {:d}" #: Source/panels/spell_book.cpp:178 -msgid "Level 0 - Unusable" -msgstr "Ниво 0 - Неизползваемо" +msgid "Unusable" +msgstr "Неизползваемо" #. TRANSLATORS: UI constrains, keep short please. #: Source/panels/spell_book.cpp:180 diff --git a/Translations/es.po b/Translations/es.po index 4fd1b820b..c67225cc8 100644 --- a/Translations/es.po +++ b/Translations/es.po @@ -6791,8 +6791,8 @@ msgid "Mana: {:d}" msgstr "Maná: {:d}" #: Source/panels/spell_book.cpp:178 -msgid "Level 0 - Unusable" -msgstr "Nivel0: Inutilizable" +msgid "Unusable" +msgstr "Inutilizable" #. TRANSLATORS: UI constrains, keep short please. #: Source/panels/spell_book.cpp:180 diff --git a/Translations/it.po b/Translations/it.po index 6e90288a2..93e3f327a 100644 --- a/Translations/it.po +++ b/Translations/it.po @@ -6763,8 +6763,8 @@ msgid "Mana: {:d}" msgstr "Mana: {:d}" #: Source/panels/spell_book.cpp:178 -msgid "Level 0 - Unusable" -msgstr "Livello 0 - Inusabile" +msgid "Unusable" +msgstr "Inusabile" #. TRANSLATORS: UI constrains, keep short please. #: Source/panels/spell_book.cpp:180 diff --git a/Translations/ja.po b/Translations/ja.po index d8253425d..f8893912e 100644 --- a/Translations/ja.po +++ b/Translations/ja.po @@ -6369,8 +6369,8 @@ msgid "Mana: {:d}" msgstr "マナ {:d}" #: Source/panels/spell_book.cpp:178 -msgid "Level 0 - Unusable" -msgstr "Lvl 0 - 使え​ない" +msgid "Unusable" +msgstr "使え​ない" #. TRANSLATORS: UI constrains, keep short please. #: Source/panels/spell_book.cpp:180 diff --git a/Translations/sv.po b/Translations/sv.po index 42e2b8cbb..944a544ba 100644 --- a/Translations/sv.po +++ b/Translations/sv.po @@ -6475,8 +6475,8 @@ msgid "Mana: {:d}" msgstr "Mana: {:d}" #: Source/panels/spell_book.cpp:178 -msgid "Level 0 - Unusable" -msgstr "Nivå 0 - Oanvändbar" +msgid "Unusable" +msgstr "Oanvändbar" #. TRANSLATORS: UI constrains, keep short please. #: Source/panels/spell_book.cpp:180 diff --git a/Translations/uk.po b/Translations/uk.po index 4a6cd6d76..a5e7e70bd 100644 --- a/Translations/uk.po +++ b/Translations/uk.po @@ -6436,8 +6436,8 @@ msgid "Mana: {:d}" msgstr "Мана: {:d}" #: Source/panels/spell_book.cpp:178 -msgid "Level 0 - Unusable" -msgstr "0-вий Рівень Чар - Непридатні" +msgid "Unusable" +msgstr "Непридатні" #. TRANSLATORS: UI constrains, keep short please. #: Source/panels/spell_book.cpp:180 diff --git a/Translations/zh_CN.po b/Translations/zh_CN.po index 3c282a41f..6ca27ed26 100644 --- a/Translations/zh_CN.po +++ b/Translations/zh_CN.po @@ -1031,8 +1031,8 @@ msgid "Mana: {:d}" msgstr "法力 {:d}" #: Source/control.cpp:1623 -msgid "Level 0 - Unusable" -msgstr "法术​等级 0 - 无法​使用" +msgid "Unusable" +msgstr "无法​使用" #. TRANSLATORS: UI constrains, keep short please. #: Source/control.cpp:1625