MCPcopy Create free account
hub / github.com/deathkiller/jazz2-native / OnAfterInitialize

Method OnAfterInitialize

Sources/Main.cpp:1475–1497  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1473}
1474
1475void GameEventHandler::OnAfterInitialize()
1476{
1477#if (defined(DEATH_TARGET_WINDOWS) && !defined(DEATH_TARGET_WINDOWS_RT)) || defined(DEATH_TARGET_UNIX)
1478 if (PreferencesCache::EnableDiscordIntegration) {
1479 DiscordRpcClient::Get().Connect("591586859960762378"_s);
1480 }
1481#endif
1482
1483 if (PreferencesCache::Language[0] != '\0') {
1484 auto& resolver = ContentResolver::Get();
1485 auto& i18n = I18n::Get();
1486 if (!i18n.LoadFromFile(fs::CombinePath({ resolver.GetCachePath(), "Translations"_s, String(PreferencesCache::Language + ".mo"_s) }))) {
1487 i18n.LoadFromFile(fs::CombinePath({ resolver.GetContentPath(), "Translations"_s, String(PreferencesCache::Language + ".mo"_s) }));
1488 }
1489 }
1490
1491#if defined(DEATH_TARGET_EMSCRIPTEN)
1492 // All required files are already included in Emscripten version, so nothing is verified
1493 _flags |= Flags::IsVerified | Flags::IsPlayable;
1494#else
1495 RefreshCache();
1496#endif
1497}
1498
1499void GameEventHandler::SetStateHandler(std::shared_ptr<IStateHandler>&& handler)
1500{

Callers 1

OnInitializeMethod · 0.80

Calls 5

ConnectMethod · 0.80
GetCachePathMethod · 0.80
GetContentPathMethod · 0.80
StringClass · 0.50
LoadFromFileMethod · 0.45

Tested by

no test coverage detected