MCPcopy Create free account
hub / github.com/JACoders/OpenJK / UI_Load

Function UI_Load

code/ui/ui_main.cpp:3002–3037  ·  view source on GitHub ↗

================= UI_Load ================= */

Source from the content-addressed store, hash-verified

3000=================
3001*/
3002void UI_Load(void)
3003{
3004 const char *menuSet;
3005 char lastName[1024];
3006 menuDef_t *menu = Menu_GetFocused();
3007
3008 if (menu && menu->window.name)
3009 {
3010 strcpy(lastName, menu->window.name);
3011 }
3012 else
3013 {
3014 lastName[0] = 0;
3015 }
3016
3017#ifndef JK2_MODE
3018 if (uiInfo.inGameLoad)
3019 {
3020 menuSet= "ui/ingame.txt";
3021 }
3022 else
3023#endif
3024 {
3025 menuSet= UI_Cvar_VariableString("ui_menuFiles");
3026 }
3027 if (menuSet == NULL || menuSet[0] == '\0')
3028 {
3029 menuSet = "ui/menus.txt";
3030 }
3031
3032 String_Init();
3033
3034 UI_LoadMenus(menuSet, qtrue);
3035 Menus_CloseAll();
3036 Menus_ActivateByName(lastName);
3037}
3038
3039/*
3040=================

Callers 1

UI_ConsoleCommandFunction · 0.70

Calls 6

Menu_GetFocusedFunction · 0.70
UI_Cvar_VariableStringFunction · 0.70
String_InitFunction · 0.70
UI_LoadMenusFunction · 0.70
Menus_CloseAllFunction · 0.70
Menus_ActivateByNameFunction · 0.70

Tested by

no test coverage detected