Xonotic
borderimage.qc
Go to the documentation of this file.
1 #include "borderimage.qh"
2 
3 #include "nexposee.qh"
4 #include "dialog.qh"
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  }
20  void BorderImage_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize)
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  }
43  void BorderImage_configureBorderImage(entity me, string theTitle, float sz, vector theColor, string path, float theBorderHeight)
44  {
45  me.configureLabel(me, theTitle, sz, 0.5);
46  me.src = path;
47  me.color = theColor;
48  me.borderHeight = theBorderHeight;
49  }
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  }
const vector eY
Definition: vector.qh:45
void BorderImage_configureBorderImage(entity me, string theTitle, float sz, vector theColor, string path, float theBorderHeight)
Definition: borderimage.qc:43
entity() spawn
#define SUPER(cname)
Definition: oo.qh:219
void BorderImage_recalcPositionWithText(entity me, string t)
Definition: borderimage.qc:5
void BorderImage_draw(entity me)
Definition: borderimage.qc:50
vector(float skel, float bonenum) _skel_get_boneabs_hidden
const vector eX
Definition: vector.qh:44
void BorderImage_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize)
Definition: borderimage.qc:20