Xonotic
borderimage.qc File Reference
#include "borderimage.qh"
#include "nexposee.qh"
#include "dialog.qh"
+ Include dependency graph for borderimage.qc:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void BorderImage_configureBorderImage (entity me, string theTitle, float sz, vector theColor, string path, float theBorderHeight)
 
void BorderImage_draw (entity me)
 
void BorderImage_recalcPositionWithText (entity me, string t)
 
void BorderImage_resizeNotify (entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize)
 

Function Documentation

◆ BorderImage_configureBorderImage()

void BorderImage_configureBorderImage ( entity  me,
string  theTitle,
float  sz,
vector  theColor,
string  path,
float  theBorderHeight 
)

Definition at line 43 of file borderimage.qc.

44  {
45  me.configureLabel(me, theTitle, sz, 0.5);
46  me.src = path;
47  me.color = theColor;
48  me.borderHeight = theBorderHeight;
49  }

◆ BorderImage_draw()

void BorderImage_draw ( entity  me)

Definition at line 50 of file borderimage.qc.

References boxToGlobalSize(), draw_BorderPicture(), draw_fontscale, globalToBoxSize(), SUPER, and vector().

51  {
52  if (me.src) draw_BorderPicture('0 0 0', me.src, '1 1 0', me.color, 1, me.borderVec);
53 
54  if (me.fontSize > 0)
55  {
56  if (me.recalcPos) me.recalcPositionWithText(me, me.text);
57 
58  if (me.isNexposeeTitleBar)
59  {
60  vector ro, rf, df;
61 
62  // me.parent.Nexposee_animationFactor 0 (small) or 1 (full)
63  // default values are for 1
64  ro = me.realOrigin;
65  rf = me.realFontSize;
66  df = draw_fontscale;
67  me.realOrigin = ro * me.parent.Nexposee_animationFactor + me.realOrigin_Nexposeed * (1 - me.parent.Nexposee_animationFactor);
68  me.realFontSize = rf * me.parent.Nexposee_animationFactor + me.realFontSize_Nexposeed * (1 - me.parent.Nexposee_animationFactor);
69  draw_fontscale = globalToBoxSize(boxToGlobalSize(df, me.realFontSize), rf);
70 
71  SUPER(BorderImage).draw(me);
72 
73  // me.Nexposee_animationState 0 (small) or 1 (full)
74  // default values are for 1
75  me.realOrigin = ro;
76  me.realFontSize = rf;
77  draw_fontscale = df;
78  }
79  else
80  {
81  SUPER(BorderImage).draw(me);
82  }
83  }
84  else
85  {
86  SUPER(BorderImage).draw(me);
87  }
88  }
#define SUPER(cname)
Definition: oo.qh:219
vector(float skel, float bonenum) _skel_get_boneabs_hidden
+ Here is the call graph for this function:

◆ BorderImage_recalcPositionWithText()

void BorderImage_recalcPositionWithText ( entity  me,
string  t 
)

Definition at line 5 of file borderimage.qc.

References boxToGlobal(), boxToGlobalSize(), conheight, conwidth, eX, eY, SUPER, and vector().

6  {
7  if (me.isNexposeeTitleBar)
8  {
9  vector scrs;
10  scrs = eX * conwidth + eY * conheight;
11  me.resizeNotify(me, me.saveRelOrigin, me.saveRelSize, boxToGlobal(me.parent.Nexposee_smallOrigin, '0 0 0', scrs), boxToGlobalSize(me.parent.Nexposee_smallSize, scrs));
12  SUPER(BorderImage).recalcPositionWithText(me, t);
13  me.realOrigin_y = me.realFontSize.y * me.zoomedOutTitleBarPosition;
14  me.realOrigin_Nexposeed = me.realOrigin;
15  me.realFontSize_Nexposeed = me.realFontSize;
16  me.resizeNotify(me, me.saveRelOrigin, me.saveRelSize, boxToGlobal(me.parent.Nexposee_initialOrigin, '0 0 0', scrs), boxToGlobalSize(me.parent.Nexposee_initialSize, scrs));
17  }
18  SUPER(BorderImage).recalcPositionWithText(me, t);
19  }
const vector eY
Definition: vector.qh:45
#define SUPER(cname)
Definition: oo.qh:219
vector(float skel, float bonenum) _skel_get_boneabs_hidden
const vector eX
Definition: vector.qh:44
+ Here is the call graph for this function:

◆ BorderImage_resizeNotify()

void BorderImage_resizeNotify ( entity  me,
vector  relOrigin,
vector  relSize,
vector  absOrigin,
vector  absSize 
)

Definition at line 20 of file borderimage.qc.

References SUPER.

21  {
22  me.isNexposeeTitleBar = 0;
23  if (me.zoomedOutTitleBar)
24  if (me.parent.parent.instanceOfNexposee)
25  if (me.parent.instanceOfDialog)
26  if (me == me.parent.frame) me.isNexposeeTitleBar = 1;
27  me.saveRelOrigin = relOrigin;
28  me.saveRelSize = relSize;
29  SUPER(BorderImage).resizeNotify(me, relOrigin, relSize, absOrigin, absSize);
30  me.borderVec_x = me.borderHeight / absSize.x;
31  me.borderVec_y = me.borderHeight / absSize.y;
32  me.realOrigin_y = 0.5 * (me.borderVec.y - me.realFontSize.y);
33  if (me.closeButton)
34  {
35  // move the close button to the right place
36  me.closeButton.Container_origin = '1 0 0' * (1 - me.borderVec.x);
37  me.closeButton.Container_size = me.borderVec;
38  me.closeButton.color = me.color;
39  me.closeButton.colorC = me.color;
40  me.closeButton.colorF = me.color;
41  }
42  }
#define SUPER(cname)
Definition: oo.qh:219