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

Function Scroll_ListBox_AutoFunc

code/ui/ui_shared.cpp:10485–10505  ·  view source on GitHub ↗

================= Scroll_ListBox_AutoFunc ================= */

Source from the content-addressed store, hash-verified

10483=================
10484*/
10485static void Scroll_ListBox_AutoFunc(void *p)
10486{
10487 scrollInfo_t *si = (scrollInfo_t*)p;
10488 if (DC->realTime > si->nextScrollTime)
10489 {
10490 // need to scroll which is done by simulating a click to the item
10491 // this is done a bit sideways as the autoscroll "knows" that the item is a listbox
10492 // so it calls it directly
10493 Item_ListBox_HandleKey(si->item, si->scrollKey, qtrue, qfalse);
10494 si->nextScrollTime = DC->realTime + si->adjustValue;
10495 }
10496
10497 if (DC->realTime > si->nextAdjustTime)
10498 {
10499 si->nextAdjustTime = DC->realTime + SCROLL_TIME_ADJUST;
10500 if (si->adjustValue > SCROLL_TIME_FLOOR)
10501 {
10502 si->adjustValue -= SCROLL_TIME_ADJUSTOFFSET;
10503 }
10504 }
10505}
10506
10507/*
10508=================

Callers

nothing calls this directly

Calls 1

Item_ListBox_HandleKeyFunction · 0.70

Tested by

no test coverage detected