diff --git a/Mods/vcmi/config/vcmi/english.json b/Mods/vcmi/config/vcmi/english.json index 11ed66eaa..d6c27e5b0 100644 --- a/Mods/vcmi/config/vcmi/english.json +++ b/Mods/vcmi/config/vcmi/english.json @@ -59,9 +59,9 @@ "vcmi.spellBook.search" : "search...", - "vcmi.spellResearch.canNotAfford" : "You can't afford to research a spell.", + "vcmi.spellResearch.canNotAfford" : "You can't afford to replace {%SPELL1} with {%SPELL2}. But you can still discard this spell and continue spell research.", "vcmi.spellResearch.comeAgain" : "Research has already been done today. Come back tomorrow.", - "vcmi.spellResearch.pay" : "Would you like to research this new spell and replace the old one or skip this spell?", + "vcmi.spellResearch.pay" : "Would you like to replace {%SPELL1} with {%SPELL2}? Or discard this spell and continue spell research?", "vcmi.spellResearch.research" : "Research this Spell", "vcmi.spellResearch.skip" : "Skip this Spell", "vcmi.spellResearch.abort" : "Abort", diff --git a/Mods/vcmi/config/vcmi/german.json b/Mods/vcmi/config/vcmi/german.json index 38f5428e8..e1934f370 100644 --- a/Mods/vcmi/config/vcmi/german.json +++ b/Mods/vcmi/config/vcmi/german.json @@ -58,9 +58,9 @@ "vcmi.spellBook.search" : "suchen...", - "vcmi.spellResearch.canNotAfford" : "Ihr könnt es Euch nicht leisten, einen Zauberspruch zu erforschen.", + "vcmi.spellResearch.canNotAfford" : "Ihr könnt es Euch nicht leisten, {%SPELL1} durch {%SPELL2} zu ersetzen. Aber Ihr könnt diesen Zauberspruch trotzdem verwerfen und die Zauberspruchforschung fortsetzen.", "vcmi.spellResearch.comeAgain" : "Die Forschung wurde heute bereits abgeschlossen. Kommt morgen wieder.", - "vcmi.spellResearch.pay" : "Möchtet Ihr diesen neuen Zauberspruch erforschen und den alten ersetzen oder diesen überspringen?", + "vcmi.spellResearch.pay" : "Möchtet Ihr {%SPELL1} durch {%SPELL2} ersetzen? Oder diesen Zauberspruch verwerfen und die Zauberspruchforschung fortsetzen?", "vcmi.spellResearch.research" : "Erforsche diesen Zauberspruch", "vcmi.spellResearch.skip" : "Überspringe diesen Zauberspruch", "vcmi.spellResearch.abort" : "Abbruch", diff --git a/client/windows/CCastleInterface.cpp b/client/windows/CCastleInterface.cpp index abb4fa036..9bc5e1ae6 100644 --- a/client/windows/CCastleInterface.cpp +++ b/client/windows/CCastleInterface.cpp @@ -2053,19 +2053,24 @@ void CMageGuildScreen::Scroll::clickPressed(const Point & cursorPosition) auto cost = costBase * std::pow(town->spellResearchCounter + 1, costExponent); std::vector> resComps; - resComps.push_back(std::make_shared(ComponentType::SPELL, town->spells[level].at(town->spellsAtLevel(level, false)))); + auto newSpell = town->spells[level].at(town->spellsAtLevel(level, false)); + resComps.push_back(std::make_shared(ComponentType::SPELL, spell->id)); + resComps.push_back(std::make_shared(ComponentType::SPELL, newSpell)); resComps.back()->newLine = true; for(TResources::nziterator i(cost); i.valid(); i++) { resComps.push_back(std::make_shared(ComponentType::RESOURCE, i->resType, i->resVal, CComponent::ESize::medium)); } - auto showSpellResearchDialog = [this, resComps, town, cost](){ + auto showSpellResearchDialog = [this, resComps, town, cost, newSpell](){ std::vector>> pom; pom.emplace_back(AnimationPath::builtin("ibuy30.DEF"), nullptr); pom.emplace_back(AnimationPath::builtin("hsbtns4.DEF"), nullptr); pom.emplace_back(AnimationPath::builtin("ICANCEL.DEF"), nullptr); + auto text = CGI->generaltexth->translate(LOCPLINT->cb->getResourceAmount().canAfford(cost) ? "vcmi.spellResearch.pay" : "vcmi.spellResearch.canNotAfford"); + boost::replace_first(text, "%SPELL1", spell->id.toSpell()->getNameTranslated()); + boost::replace_first(text, "%SPELL2", newSpell.toSpell()->getNameTranslated()); auto temp = std::make_shared(text, LOCPLINT->playerID, resComps, pom); temp->buttons[0]->addCallback([this, town](){ LOCPLINT->cb->spellResearch(town, spell->id, true); });