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

Function Item_Paint

code/ui/ui_shared.cpp:7770–8372  ·  view source on GitHub ↗

================= Item_Paint ================= */

Source from the content-addressed store, hash-verified

7768=================
7769*/
7770static qboolean Item_Paint(itemDef_t *item, qboolean bDraw)
7771{
7772 int xPos,textWidth;
7773 vec4_t red;
7774 menuDef_t *parent;
7775 red[0] = red[3] = 1;
7776 red[1] = red[2] = 0;
7777
7778 if (item == NULL)
7779 {
7780 return qfalse;
7781 }
7782
7783 parent = (menuDef_t*)item->parent;
7784
7785 if (item->window.flags & WINDOW_SCRIPTWAITING)
7786 {
7787 if (DC->realTime > item->window.delayTime)
7788 { // Time has elapsed, resume running whatever script we saved
7789 item->window.flags &= ~WINDOW_SCRIPTWAITING;
7790 Item_RunScript(item, item->window.delayedScript);
7791 }
7792 }
7793
7794 if (item->window.flags & WINDOW_ORBITING)
7795 {
7796 if (DC->realTime > item->window.nextTime)
7797 {
7798 float rx, ry, a, c, s, w, h;
7799 item->window.nextTime = DC->realTime + item->window.offsetTime;
7800 // translate
7801 w = item->window.rectClient.w / 2;
7802 h = item->window.rectClient.h / 2;
7803 rx = item->window.rectClient.x + w - item->window.rectEffects.x;
7804 ry = item->window.rectClient.y + h - item->window.rectEffects.y;
7805 a = (float) (3 * M_PI / 180);
7806 c = cos(a);
7807 s = sin(a);
7808 item->window.rectClient.x = (rx * c - ry * s) + item->window.rectEffects.x - w;
7809 item->window.rectClient.y = (rx * s + ry * c) + item->window.rectEffects.y - h;
7810 Item_UpdatePosition(item);
7811
7812 }
7813 }
7814
7815
7816 if (item->window.flags & WINDOW_INTRANSITION)
7817 {
7818 if (DC->realTime > item->window.nextTime)
7819 {
7820 int done = 0;
7821 item->window.nextTime = DC->realTime + item->window.offsetTime;
7822
7823 // transition the x,y
7824 if (item->window.rectClient.x == item->window.rectEffects.x)
7825 {
7826 done++;
7827 }

Callers 1

Menu_PaintFunction · 0.70

Calls 15

Item_RunScriptFunction · 0.70
Item_UpdatePositionFunction · 0.70
Item_EnableShowViaCvarFunction · 0.70
Display_KeyBindPendingFunction · 0.70
Item_TextColorFunction · 0.70
Window_PaintFunction · 0.70
Item_OwnerDraw_PaintFunction · 0.70
Item_Text_PaintFunction · 0.70
Item_TextField_PaintFunction · 0.70
Item_ListBox_PaintFunction · 0.70
Item_TextScroll_PaintFunction · 0.70
Item_Model_PaintFunction · 0.70

Tested by

no test coverage detected