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

Function UI_ResetCharacterListBoxes

code/ui/ui_main.cpp:5393–5449  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5391#endif // !JK2_MODE
5392
5393static void UI_ResetCharacterListBoxes( void )
5394{
5395
5396 itemDef_t *item;
5397 menuDef_t *menu;
5398 listBoxDef_t *listPtr;
5399
5400 menu = Menus_FindByName("characterMenu");
5401
5402
5403 if (menu)
5404 {
5405 item = (itemDef_s *) Menu_FindItemByName((menuDef_t *) menu, "headlistbox");
5406 if (item)
5407 {
5408 listBoxDef_t *listPtr = (listBoxDef_t*)item->typeData;
5409 if( listPtr )
5410 {
5411 listPtr->cursorPos = 0;
5412 }
5413 item->cursorPos = 0;
5414 }
5415
5416 item = (itemDef_s *) Menu_FindItemByName((menuDef_t *) menu, "torsolistbox");
5417 if (item)
5418 {
5419 listPtr = (listBoxDef_t*)item->typeData;
5420 if( listPtr )
5421 {
5422 listPtr->cursorPos = 0;
5423 }
5424 item->cursorPos = 0;
5425 }
5426
5427 item = (itemDef_s *) Menu_FindItemByName((menuDef_t *) menu, "lowerlistbox");
5428 if (item)
5429 {
5430 listPtr = (listBoxDef_t*)item->typeData;
5431 if( listPtr )
5432 {
5433 listPtr->cursorPos = 0;
5434 }
5435 item->cursorPos = 0;
5436 }
5437
5438 item = (itemDef_t *) Menu_FindItemByName((menuDef_t *) menu, "colorbox");
5439 if (item)
5440 {
5441 listPtr = (listBoxDef_t*)item->typeData;
5442 if( listPtr )
5443 {
5444 listPtr->cursorPos = 0;
5445 }
5446 item->cursorPos = 0;
5447 }
5448 }
5449}
5450

Callers 1

UI_RunMenuScriptFunction · 0.70

Calls 2

Menus_FindByNameFunction · 0.70
Menu_FindItemByNameFunction · 0.70

Tested by

no test coverage detected