Browse Source

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.
pull/3852/head
Gleb Mazovetskiy 4 years ago
parent
commit
ccf8cc004d
  1. 34
      Source/panels/spell_book.cpp
  2. 4
      Translations/bg.po
  3. 4
      Translations/es.po
  4. 4
      Translations/it.po
  5. 4
      Translations/ja.po
  6. 4
      Translations/sv.po
  7. 4
      Translations/uk.po
  8. 4
      Translations/zh_CN.po

34
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;
}

4
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

4
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

4
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

4
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

4
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

4
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

4
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

Loading…
Cancel
Save