1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-24 03:47:18 +02:00

move hardcoded strings to JSON file

This commit is contained in:
Andrey Filipenkov 2022-09-18 15:39:08 +03:00
parent 90d355dd05
commit 0163190ac5
4 changed files with 10 additions and 5 deletions

View File

@ -1217,7 +1217,7 @@ void CAdvMapInt::keyPressed(const SDL_KeyboardEvent & key)
if(itr != LOCPLINT->towns.end())
LOCPLINT->showThievesGuildWindow(*itr);
else
LOCPLINT->showInfoDialog("No available town with tavern!");
LOCPLINT->showInfoDialog(CGI->generaltexth->localizedTexts["adventureMap"]["noTownWithTavern"].String());
}
return;
case SDLK_i:
@ -1249,7 +1249,7 @@ void CAdvMapInt::keyPressed(const SDL_KeyboardEvent & key)
case SDLK_r:
if(isActive() && LOCPLINT->ctrlPressed())
{
LOCPLINT->showYesNoDialog("Are you sure you want to restart game?",
LOCPLINT->showYesNoDialog(CGI->generaltexth->localizedTexts["adventureMap"]["confirmRestartGame"].String(),
[](){ LOCPLINT->sendCustomEvent(EUserEvent::RESTART_GAME); }, nullptr);
}
return;
@ -1308,7 +1308,7 @@ void CAdvMapInt::keyPressed(const SDL_KeyboardEvent & key)
if(townWithMarket) //if any town has marketplace, open window
GH.pushIntT<CMarketplaceWindow>(townWithMarket);
else //if not - complain
LOCPLINT->showInfoDialog("No available marketplace!");
LOCPLINT->showInfoDialog(CGI->generaltexth->localizedTexts["adventureMap"]["noTownWithMarket"].String());
}
else if(isActive()) //no ctrl, advmapint is on the top => switch to town
{

View File

@ -851,7 +851,7 @@ void CCastleBuildings::enterToTheQuickRecruitmentWindow()
if(hasSomeoneToRecruit)
GH.pushIntT<QuickRecruitmentWindow>(town, pos);
else
CInfoWindow::showInfoDialog("There are no creatures to recruit", {});
CInfoWindow::showInfoDialog(CGI->generaltexth->localizedTexts["townHall"]["noCreaturesToRecruit"].String(), {});
}
void CCastleBuildings::enterFountain(const BuildingID & building, BuildingSubID::EBuildingSubID subID, BuildingID::EBuildingID upgrades)

View File

@ -562,7 +562,7 @@ void CSpellWindow::SpellArea::clickLeft(tribool down, bool previousState)
if(!texts.empty())
owner->myInt->showInfoDialog(texts.front());
else
owner->myInt->showInfoDialog("Unknown problem with this spell, no more information available.");
owner->myInt->showInfoDialog(CGI->generaltexth->localizedTexts["adventureMap"]["spellUnknownProblem"].String());
}
}
else //adventure spell

View File

@ -21,6 +21,10 @@
"Impossible"
]
},
"confirmRestartGame" : "Are you sure you want to restart game?",
"noTownWithMarket": "No available marketplace!",
"noTownWithTavern": "No available town with tavern!",
"spellUnknownProblem": "Unknown problem with this spell, no more information available.",
"playerAttacked" : "Player has been attacked: %s"
},
"systemOptions" :
@ -44,6 +48,7 @@
"townHall" :
{
"missingBase" : "Base building %s must be built first",
"noCreaturesToRecruit" : "There are no creatures to recruit!",
"greetingManaVortex" : "As you near the %s your body is filled with new energy. You have doubled your normal spell points.",
"greetingKnowledge" : "You study the glyphs on the %s and gain insight into the workings of various magics (+1 Knowledge).",
"greetingSpellPower" : "The %s teaches you new ways to focus your magical powers (+1 Power).",