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

Function UI_CheckVid1Data

code/ui/ui_main.cpp:6398–6431  ·  view source on GitHub ↗

================= UI_CheckVid1Data ================= */

Source from the content-addressed store, hash-verified

6396=================
6397*/
6398void UI_CheckVid1Data(const char *menuTo,const char *warningMenuName)
6399{
6400 menuDef_t *menu;
6401 itemDef_t *applyChanges;
6402
6403 menu = Menu_GetFocused(); // Get current menu (either video or ingame video, I would assume)
6404
6405 if (!menu)
6406 {
6407 Com_Printf(S_COLOR_YELLOW"WARNING: No videoMenu was found. Video data could not be checked\n");
6408 return;
6409 }
6410
6411 applyChanges = (itemDef_s *) Menu_FindItemByName(menu, "applyChanges");
6412
6413 if (!applyChanges)
6414 {
6415// Menus_CloseAll();
6416 Menus_OpenByName(menuTo);
6417 return;
6418 }
6419
6420 if ((applyChanges->window.flags & WINDOW_VISIBLE)) // Is the APPLY CHANGES button active?
6421 {
6422// Menus_SaveGoToMenu(menuTo); // Save menu you're going to
6423// Menus_HideItems(menu->window.name); // HIDE videMenu in case you have to come back
6424 Menus_OpenByName(warningMenuName); // Give warning
6425 }
6426 else
6427 {
6428// Menus_CloseAll();
6429// Menus_OpenByName(menuTo);
6430 }
6431}
6432
6433/*
6434=================

Callers 1

UI_RunMenuScriptFunction · 0.85

Calls 4

Menu_GetFocusedFunction · 0.70
Menu_FindItemByNameFunction · 0.70
Menus_OpenByNameFunction · 0.70
Com_PrintfFunction · 0.50

Tested by

no test coverage detected