/** * @brief Adjust game for new language: reregister fonts, etc. */ static void CL_NewLanguage (void) { R_FontShutdown(); R_FontInit(); UI_InitFonts(); R_FontSetTruncationMarker(_("...")); }
/** * @brief Reloads the ui scripts and reinitializes the ui */ static void UI_Restart_f (void) { typedef std::vector<std::string> Names; Names names; for (int i = 0; i < ui_global.windowStackPos; i++) { names.push_back(std::string(ui_global.windowStack[i]->name)); } UI_Shutdown(); CLMN_Shutdown(); R_FontShutdown(); UI_Init(); R_FontInit(); Com_Printf("%i ui script files\n", FS_BuildFileList("ufos/ui/*.ufo")); FS_NextScriptHeader(nullptr, nullptr, nullptr); const char* type, *name, *text; text = nullptr; while ((type = FS_NextScriptHeader("ufos/*.ufo", &name, &text)) != nullptr) { if (Q_streq(type, "font")) UI_ParseFont(name, &text); else if (Q_streq(type, "menu_model")) UI_ParseUIModel(name, &text); else if (Q_streq(type, "sprite")) UI_ParseSprite(name, &text); } UI_Reinit(); FS_NextScriptHeader(nullptr, nullptr, nullptr); text = nullptr; while ((type = FS_NextScriptHeader("ufos/ui/*.ufo", &name, &text)) != nullptr) { if (Q_streq(type, "window")) UI_ParseWindow(type, name, &text); else if (Q_streq(type, "component")) UI_ParseComponent(type, name, &text); else if (Q_streq(type, "menu_model")) UI_ParseUIModel(name, &text); else if (Q_streq(type, "sprite")) UI_ParseSprite(name, &text); else if (Q_streq(type, "lua")) UI_ParseAndLoadLuaScript(name, &text); } CLMN_Init(); for (Names::iterator i = names.begin(); i != names.end(); ++i) { UI_PushWindow(i->c_str()); } }
/** * @sa R_Init */ void R_Shutdown (void) { const cmdList_t *commands; for (commands = r_commands; commands->name; commands++) Cmd_RemoveCommand(commands->name); R_ShutdownThreads(); R_ShutdownModels(true); R_ShutdownImages(); R_ShutdownPrograms(); R_FontShutdown(); R_ShutdownFBObjects(); /* shut down OS specific OpenGL stuff like contexts, etc. */ Rimp_Shutdown(); }