MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / SetLanguage

Function SetLanguage

engine/Poseidon/UI/Locale/Stringtable/Stringtable.cpp:777–801  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

775{
776 GStringTable.Clear();
777 ++GLanguageGeneration;
778}
779
780// Language-change callback registry
781
782struct LangCallbackEntry
783{
784 int token;
785 LanguageChangedCallback cb;
786};
787
788// Leaked on exit by design: UI dialogs (e.g. DisplayMain) unregister from their
789// destructors, which may run during static destruction. If this vector had
790// already been destroyed, the unregister would crash. Leaking a few bytes on
791// shutdown is the price for crash-free teardown.
792static std::vector<LangCallbackEntry>& GetLangCallbacks()
793{
794 static std::vector<LangCallbackEntry>* callbacks = new std::vector<LangCallbackEntry>();
795 return *callbacks;
796}
797
798static int& NextLangToken()
799{
800 static int token = 0;
801 return token;
802}
803
804int RegisterLanguageChangedCallback(LanguageChangedCallback cb)

Callers 15

DrawGameTabFunction · 0.85
SetRowValueMethod · 0.85
ApplyToRuntimeFunction · 0.85
TriSetLanguageFunction · 0.85
test_ai.cppFile · 0.85
LoadMainMenuStringtableFunction · 0.85
LoadMainMenuStringtableFunction · 0.85

Calls 3

stricmpFunction · 0.50
GetLengthMethod · 0.45
SetLanguageMethod · 0.45

Tested by 10

TriSetLanguageFunction · 0.68
LoadMainMenuStringtableFunction · 0.68
LoadMainMenuStringtableFunction · 0.68
LoadMainMenuStringtableFunction · 0.68
LoadMainMenuStringtableFunction · 0.68
LoadMainMenuStringtableFunction · 0.68
LoadMainMenuStringtableFunction · 0.68
LoadRemasterStringtableFunction · 0.68