1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Renamed LibClasses * VLC to GameLibrary * LIBRARY

This commit is contained in:
Ivan Savenko
2025-02-14 16:23:37 +00:00
parent 156de5b17e
commit 645b95ba02
287 changed files with 2032 additions and 2032 deletions

View File

@@ -59,7 +59,7 @@
#include "../../lib/CConfigHandler.h"
#include "../../lib/GameConstants.h"
#include "../../lib/CRandomGenerator.h"
#include "../../lib/VCMI_Lib.h"
#include "../../lib/GameLibrary.h"
std::shared_ptr<CMainMenu> CMM;
ISelectionScreenInfo * SEL = nullptr;
@@ -207,7 +207,7 @@ static std::function<void()> genCommand(CMenuScreen * menu, std::vector<std::str
break;
case 4: //exit
{
return []() { CInfoWindow::showYesNoDialog(VLC->generaltexth->allTexts[69], std::vector<std::shared_ptr<CComponent>>(), do_quit, 0, PlayerColor(1)); };
return []() { CInfoWindow::showYesNoDialog(LIBRARY->generaltexth->allTexts[69], std::vector<std::shared_ptr<CComponent>>(), do_quit, 0, PlayerColor(1)); };
}
break;
case 5: //highscores
@@ -227,7 +227,7 @@ std::shared_ptr<CButton> CMenuEntry::createButton(CMenuScreen * parent, const Js
std::pair<std::string, std::string> help;
if(!button["help"].isNull() && button["help"].Float() > 0)
help = VLC->generaltexth->zelp[(size_t)button["help"].Float()];
help = LIBRARY->generaltexth->zelp[(size_t)button["help"].Float()];
int posx = static_cast<int>(button["x"].Float());
if(posx < 0)
@@ -447,7 +447,7 @@ void CMainMenu::openCampaignScreen(std::string name)
if (!campaignsFound)
{
CInfoWindow::showInfoDialog(VLC->generaltexth->translate("vcmi.client.errors.missingCampaigns"), std::vector<std::shared_ptr<CComponent>>(), PlayerColor(1));
CInfoWindow::showInfoDialog(LIBRARY->generaltexth->translate("vcmi.client.errors.missingCampaigns"), std::vector<std::shared_ptr<CComponent>>(), PlayerColor(1));
return;
}
@@ -459,7 +459,7 @@ void CMainMenu::startTutorial()
ResourcePath tutorialMap("Maps/Tutorial.tut", EResType::MAP);
if(!CResourceHandler::get()->existsResource(tutorialMap))
{
CInfoWindow::showInfoDialog(VLC->generaltexth->translate("core.genrltxt.742"), std::vector<std::shared_ptr<CComponent>>(), PlayerColor(1));
CInfoWindow::showInfoDialog(LIBRARY->generaltexth->translate("core.genrltxt.742"), std::vector<std::shared_ptr<CComponent>>(), PlayerColor(1));
return;
}
@@ -510,20 +510,20 @@ CMultiMode::CMultiMode(ESelectionScreen ScreenType)
}
textTitle = std::make_shared<CTextBox>("", Rect(7, 18, 440, 50), 0, FONT_BIG, ETextAlignment::CENTER, Colors::WHITE);
textTitle->setText(VLC->generaltexth->zelp[263].second);
textTitle->setText(LIBRARY->generaltexth->zelp[263].second);
statusBar = CGStatusBar::create(std::make_shared<CPicture>(background->getSurface(), Rect(7, 465, 440, 18), 7, 465));
playerName = std::make_shared<CTextInput>(Rect(19, 436, 334, 16), background->getSurface());
playerName->setText(getPlayersNames()[0]);
playerName->setCallback(std::bind(&CMultiMode::onNameChange, this, _1));
buttonHotseat = std::make_shared<CButton>(Point(373, 78 + 57 * 0), AnimationPath::builtin("MUBHOT.DEF"), VLC->generaltexth->zelp[266], std::bind(&CMultiMode::hostTCP, this, EShortcut::MAIN_MENU_HOTSEAT), EShortcut::MAIN_MENU_HOTSEAT);
buttonLobby = std::make_shared<CButton>(Point(373, 78 + 57 * 1), AnimationPath::builtin("MUBONL.DEF"), VLC->generaltexth->zelp[265], std::bind(&CMultiMode::openLobby, this), EShortcut::MAIN_MENU_LOBBY);
buttonHotseat = std::make_shared<CButton>(Point(373, 78 + 57 * 0), AnimationPath::builtin("MUBHOT.DEF"), LIBRARY->generaltexth->zelp[266], std::bind(&CMultiMode::hostTCP, this, EShortcut::MAIN_MENU_HOTSEAT), EShortcut::MAIN_MENU_HOTSEAT);
buttonLobby = std::make_shared<CButton>(Point(373, 78 + 57 * 1), AnimationPath::builtin("MUBONL.DEF"), LIBRARY->generaltexth->zelp[265], std::bind(&CMultiMode::openLobby, this), EShortcut::MAIN_MENU_LOBBY);
buttonHost = std::make_shared<CButton>(Point(373, 78 + 57 * 3), AnimationPath::builtin("MUBHOST.DEF"), CButton::tooltip(VLC->generaltexth->translate("vcmi.mainMenu.hostTCP"), ""), std::bind(&CMultiMode::hostTCP, this, EShortcut::MAIN_MENU_HOST_GAME), EShortcut::MAIN_MENU_HOST_GAME);
buttonJoin = std::make_shared<CButton>(Point(373, 78 + 57 * 4), AnimationPath::builtin("MUBJOIN.DEF"), CButton::tooltip(VLC->generaltexth->translate("vcmi.mainMenu.joinTCP"), ""), std::bind(&CMultiMode::joinTCP, this, EShortcut::MAIN_MENU_JOIN_GAME), EShortcut::MAIN_MENU_JOIN_GAME);
buttonHost = std::make_shared<CButton>(Point(373, 78 + 57 * 3), AnimationPath::builtin("MUBHOST.DEF"), CButton::tooltip(LIBRARY->generaltexth->translate("vcmi.mainMenu.hostTCP"), ""), std::bind(&CMultiMode::hostTCP, this, EShortcut::MAIN_MENU_HOST_GAME), EShortcut::MAIN_MENU_HOST_GAME);
buttonJoin = std::make_shared<CButton>(Point(373, 78 + 57 * 4), AnimationPath::builtin("MUBJOIN.DEF"), CButton::tooltip(LIBRARY->generaltexth->translate("vcmi.mainMenu.joinTCP"), ""), std::bind(&CMultiMode::joinTCP, this, EShortcut::MAIN_MENU_JOIN_GAME), EShortcut::MAIN_MENU_JOIN_GAME);
buttonCancel = std::make_shared<CButton>(Point(373, 424), AnimationPath::builtin("MUBCANC.DEF"), VLC->generaltexth->zelp[288], [=](){ close();}, EShortcut::GLOBAL_CANCEL);
buttonCancel = std::make_shared<CButton>(Point(373, 424), AnimationPath::builtin("MUBCANC.DEF"), LIBRARY->generaltexth->zelp[288], [=](){ close();}, EShortcut::GLOBAL_CANCEL);
}
void CMultiMode::openLobby()
@@ -552,7 +552,7 @@ std::vector<std::string> CMultiMode::getPlayersNames()
std::string playerNameStr = settings["general"]["playerName"].String();
if (playerNameStr == "Player")
playerNameStr = VLC->generaltexth->translate("core.genrltxt.434");
playerNameStr = LIBRARY->generaltexth->translate("core.genrltxt.434");
playerNames.push_back(playerNameStr);
for (const auto & playerName : settings["general"]["multiPlayerNames"].Vector())
@@ -584,14 +584,14 @@ CMultiPlayers::CMultiPlayers(const std::vector<std::string>& playerNames, ESelec
switch (shortcut)
{
case EShortcut::MAIN_MENU_HOTSEAT:
text = VLC->generaltexth->allTexts[446];
text = LIBRARY->generaltexth->allTexts[446];
boost::replace_all(text, "\t", "\n");
break;
case EShortcut::MAIN_MENU_HOST_GAME:
text = VLC->generaltexth->translate("vcmi.mainMenu.hostTCP");
text = LIBRARY->generaltexth->translate("vcmi.mainMenu.hostTCP");
break;
case EShortcut::MAIN_MENU_JOIN_GAME:
text = VLC->generaltexth->translate("vcmi.mainMenu.joinTCP");
text = LIBRARY->generaltexth->translate("vcmi.mainMenu.joinTCP");
break;
}
@@ -603,8 +603,8 @@ CMultiPlayers::CMultiPlayers(const std::vector<std::string>& playerNames, ESelec
inputNames[i]->setCallback(std::bind(&CMultiPlayers::onChange, this, _1));
}
buttonOk = std::make_shared<CButton>(Point(95, 338), AnimationPath::builtin("MUBCHCK.DEF"), VLC->generaltexth->zelp[560], std::bind(&CMultiPlayers::enterSelectionScreen, this), EShortcut::GLOBAL_ACCEPT);
buttonCancel = std::make_shared<CButton>(Point(205, 338), AnimationPath::builtin("MUBCANC.DEF"), VLC->generaltexth->zelp[561], [=](){ close();}, EShortcut::GLOBAL_CANCEL);
buttonOk = std::make_shared<CButton>(Point(95, 338), AnimationPath::builtin("MUBCHCK.DEF"), LIBRARY->generaltexth->zelp[560], std::bind(&CMultiPlayers::enterSelectionScreen, this), EShortcut::GLOBAL_ACCEPT);
buttonCancel = std::make_shared<CButton>(Point(205, 338), AnimationPath::builtin("MUBCANC.DEF"), LIBRARY->generaltexth->zelp[561], [=](){ close();}, EShortcut::GLOBAL_CANCEL);
statusBar = CGStatusBar::create(std::make_shared<CPicture>(background->getSurface(), Rect(7, 381, 348, 18), 7, 381));
for(int i = 0; i < playerNames.size(); i++)
@@ -661,16 +661,16 @@ CSimpleJoinScreen::CSimpleJoinScreen(bool host)
textTitle = std::make_shared<CTextBox>("", Rect(20, 10, 205, 50), 0, FONT_BIG, ETextAlignment::CENTER, Colors::WHITE);
inputAddress = std::make_shared<CTextInput>(Rect(25, 68, 175, 16), background->getSurface());
inputPort = std::make_shared<CTextInput>(Rect(25, 115, 175, 16), background->getSurface());
buttonOk = std::make_shared<CButton>(Point(26, 142), AnimationPath::builtin("MUBCHCK.DEF"), VLC->generaltexth->zelp[560], std::bind(&CSimpleJoinScreen::connectToServer, this), EShortcut::GLOBAL_ACCEPT);
buttonOk = std::make_shared<CButton>(Point(26, 142), AnimationPath::builtin("MUBCHCK.DEF"), LIBRARY->generaltexth->zelp[560], std::bind(&CSimpleJoinScreen::connectToServer, this), EShortcut::GLOBAL_ACCEPT);
if(host && !settings["session"]["donotstartserver"].Bool())
{
textTitle->setText(VLC->generaltexth->translate("vcmi.mainMenu.serverConnecting"));
textTitle->setText(LIBRARY->generaltexth->translate("vcmi.mainMenu.serverConnecting"));
buttonOk->block(true);
startConnection();
}
else
{
textTitle->setText(VLC->generaltexth->translate("vcmi.mainMenu.serverAddressEnter"));
textTitle->setText(LIBRARY->generaltexth->translate("vcmi.mainMenu.serverAddressEnter"));
inputAddress->setCallback(std::bind(&CSimpleJoinScreen::onChange, this, _1));
inputPort->setCallback(std::bind(&CSimpleJoinScreen::onChange, this, _1));
inputPort->setFilterNumber(0, 65535);
@@ -680,13 +680,13 @@ CSimpleJoinScreen::CSimpleJoinScreen(bool host)
inputPort->setText(std::to_string(host ? GAME->server().getLocalPort() : GAME->server().getRemotePort()));
buttonOk->block(inputAddress->getText().empty() || inputPort->getText().empty());
buttonCancel = std::make_shared<CButton>(Point(142, 142), AnimationPath::builtin("MUBCANC.DEF"), VLC->generaltexth->zelp[561], std::bind(&CSimpleJoinScreen::leaveScreen, this), EShortcut::GLOBAL_CANCEL);
buttonCancel = std::make_shared<CButton>(Point(142, 142), AnimationPath::builtin("MUBCANC.DEF"), LIBRARY->generaltexth->zelp[561], std::bind(&CSimpleJoinScreen::leaveScreen, this), EShortcut::GLOBAL_CANCEL);
statusBar = CGStatusBar::create(std::make_shared<CPicture>(background->getSurface(), Rect(7, 186, 218, 18), 7, 186));
}
void CSimpleJoinScreen::connectToServer()
{
textTitle->setText(VLC->generaltexth->translate("vcmi.mainMenu.serverConnecting"));
textTitle->setText(LIBRARY->generaltexth->translate("vcmi.mainMenu.serverConnecting"));
buttonOk->block(true);
ENGINE->input().stopTextInput();
@@ -695,7 +695,7 @@ void CSimpleJoinScreen::connectToServer()
void CSimpleJoinScreen::leaveScreen()
{
textTitle->setText(VLC->generaltexth->translate("vcmi.mainMenu.serverClosing"));
textTitle->setText(LIBRARY->generaltexth->translate("vcmi.mainMenu.serverClosing"));
GAME->server().setState(EClientState::CONNECTION_CANCELLED);
}