Localized strings and new menus.

This commit is contained in:
sr0 2015-12-30 04:19:52 +01:00
parent 6187f47e30
commit 9818fa7b21
5 changed files with 28 additions and 1 deletions

2
.gitignore vendored
View File

@ -17,6 +17,8 @@ $RECYCLE.BIN/
# =========================
# Operating System Files
# =========================
# Windows
*.lnk
# OSX
# =========================

View File

@ -129,6 +129,18 @@ namespace Components
{
// TODO: Register string dvars here
// TODO: Support multiple languages here and find a better place for this. :/
if (std::string(Game::Win_GetLanguage()) == "german")
{
Localization::Set("MP_SEARCHING_FOR_PLAYER", "Warte");
Localization::Set("MENU_WAITING_FOR_MORE_PLAYERS_TEAMS", "Auf weitere Spieler zum Teamausgleich warten");
}
else
{
Localization::Set("MP_SEARCHING_FOR_PLAYER", "Waiting");
Localization::Set("MENU_WAITING_FOR_MORE_PLAYERS_TEAMS", "Waiting for more players to balance teams");
}
return Dvar::Register<const char*>(name, "Unknown Soldier", Dvar::Flag(flag | Game::dvar_flag::DVAR_FLAG_SAVED).val, description).Get<Game::dvar_t*>();
}

View File

@ -34,6 +34,9 @@ namespace Components
Utils::Hook(0x629B90, Localization::Get, HOOK_JUMP).Install()->Quick();
//Localization::Set("MENU_MULTIPLAYER_CAPS", "^5Fotze");
Localization::Set("MENU_SEARCHINGFORGAMES_100MS", "");
Localization::UseLocalization = Dvar::Register<bool>("ui_localize", true, Game::dvar_flag::DVAR_FLAG_NONE, "Use localization strings");
}

View File

@ -252,6 +252,16 @@ namespace Components
}
}
// TODO: beautify
if (!_stricmp(menuList->name, "ui_mp/code.txt"))
{
std::vector<Game::menuDef_t*> _menus = Menus::LoadMenu("ui_mp/theater_menu.menu");
std::vector<Game::menuDef_t*> _menus2 = Menus::LoadMenu("ui_mp/pc_options_multi.menu");
for (auto newMenu : _menus) { menus.push_back(newMenu); }
for (auto newMenu : _menus2) { menus.push_back(newMenu); }
}
// Allocate new menu list
Game::MenuList* newList = (Game::MenuList*)calloc(1, sizeof(Game::MenuList));
newList->name = _strdup(menuList->name);

View File

@ -112,7 +112,7 @@ namespace Components
Utils::Hook::Set<BYTE>(0x5A969E, 0xEB);
// Patch party_minplayers to 1 and protect it
Utils::Hook(0x4D5D51, Party::RegisterMinPlayers, HOOK_CALL).Install()->Quick();
//Utils::Hook(0x4D5D51, Party::RegisterMinPlayers, HOOK_CALL).Install()->Quick();
Command::Add("connect", [] (Command::Params params)
{