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

Function UI_AdjustSaveGameListBox

code/ui/ui_main.cpp:6474–6501  ·  view source on GitHub ↗

======================= UI_AdjustSaveGameListBox ======================= */ Yeah I could get fired for this... in a world of good and bad, this is bad I wish we passed in the menu item to RunScript(), oh well...

Source from the content-addressed store, hash-verified

6472// Yeah I could get fired for this... in a world of good and bad, this is bad
6473// I wish we passed in the menu item to RunScript(), oh well...
6474void UI_AdjustSaveGameListBox( int currentLine )
6475{
6476 menuDef_t *menu;
6477 itemDef_t *item;
6478
6479 // could be in either the ingame or shell load menu (I know, I know it's bad)
6480 menu = Menus_FindByName("loadgameMenu");
6481 if( !menu )
6482 {
6483 menu = Menus_FindByName("ingameloadMenu");
6484 }
6485
6486 if (menu)
6487 {
6488 item = (itemDef_s *) Menu_FindItemByName((menuDef_t *) menu, "loadgamelist");
6489 if (item)
6490 {
6491 listBoxDef_t *listPtr = (listBoxDef_t*)item->typeData;
6492 if( listPtr )
6493 {
6494 listPtr->cursorPos = currentLine;
6495 }
6496
6497 item->cursorPos = currentLine;
6498 }
6499 }
6500
6501}
6502
6503/*
6504=================

Callers 2

UI_RunMenuScriptFunction · 0.85
UI_FeederCountFunction · 0.85

Calls 2

Menus_FindByNameFunction · 0.70
Menu_FindItemByNameFunction · 0.70

Tested by

no test coverage detected