1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +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()) if(itr != LOCPLINT->towns.end())
LOCPLINT->showThievesGuildWindow(*itr); LOCPLINT->showThievesGuildWindow(*itr);
else else
LOCPLINT->showInfoDialog("No available town with tavern!"); LOCPLINT->showInfoDialog(CGI->generaltexth->localizedTexts["adventureMap"]["noTownWithTavern"].String());
} }
return; return;
case SDLK_i: case SDLK_i:
@@ -1249,7 +1249,7 @@ void CAdvMapInt::keyPressed(const SDL_KeyboardEvent & key)
case SDLK_r: case SDLK_r:
if(isActive() && LOCPLINT->ctrlPressed()) 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); [](){ LOCPLINT->sendCustomEvent(EUserEvent::RESTART_GAME); }, nullptr);
} }
return; return;
@@ -1308,7 +1308,7 @@ void CAdvMapInt::keyPressed(const SDL_KeyboardEvent & key)
if(townWithMarket) //if any town has marketplace, open window if(townWithMarket) //if any town has marketplace, open window
GH.pushIntT<CMarketplaceWindow>(townWithMarket); GH.pushIntT<CMarketplaceWindow>(townWithMarket);
else //if not - complain 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 else if(isActive()) //no ctrl, advmapint is on the top => switch to town
{ {

View File

@@ -851,7 +851,7 @@ void CCastleBuildings::enterToTheQuickRecruitmentWindow()
if(hasSomeoneToRecruit) if(hasSomeoneToRecruit)
GH.pushIntT<QuickRecruitmentWindow>(town, pos); GH.pushIntT<QuickRecruitmentWindow>(town, pos);
else 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) 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()) if(!texts.empty())
owner->myInt->showInfoDialog(texts.front()); owner->myInt->showInfoDialog(texts.front());
else 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 else //adventure spell

View File

@@ -21,6 +21,10 @@
"Impossible" "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" "playerAttacked" : "Player has been attacked: %s"
}, },
"systemOptions" : "systemOptions" :
@@ -44,6 +48,7 @@
"townHall" : "townHall" :
{ {
"missingBase" : "Base building %s must be built first", "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.", "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).", "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).", "greetingSpellPower" : "The %s teaches you new ways to focus your magical powers (+1 Power).",