Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
crosshairpreview.qc
Go to the documentation of this file.
1
#include "
crosshairpreview.qh
"
2
3
entity
makeXonoticCrosshairPreview
()
4
{
5
entity
me;
6
me =
NEW
(
XonoticCrosshairPreview
);
7
me.configureXonoticCrosshairPreview(me);
8
return
me;
9
}
10
11
void
XonoticCrosshairPreview_configureXonoticCrosshairPreview
(
entity
me)
12
{
13
me.src =
strzone
(
strcat
(
"/gfx/crosshair"
,
cvar_string
(
"crosshair"
)));
14
me.src2 =
"/gfx/crosshairdot"
;
15
}
16
17
void
XonoticCrosshairPreview_draw
(
entity
me)
18
{
19
float
save;
20
save =
draw_alpha
;
21
if
(me.disabled)
22
draw_alpha
*= me.disabledAlpha;
23
24
vector
sz, rgb;
25
float
a;
26
rgb =
stov
(
cvar_string
(
"crosshair_color"
));
27
a =
cvar
(
"crosshair_alpha"
);
28
strcpy
(me.src,
strcat
(
"/gfx/crosshair"
,
cvar_string
(
"crosshair"
)));
29
30
sz =
draw_PictureSize
(me.src);
31
sz =
globalToBoxSize
(sz, me.size);
32
sz = sz *
cvar
(
"crosshair_size"
);
33
34
draw_Picture
(
'0.5 0.5 0'
- 0.5 * sz, me.src, sz, rgb, a);
35
if
(
cvar
(
"crosshair_dot"
))
36
{
37
if
(
cvar
(
"crosshair_dot_color_custom"
) && (
cvar_string
(
"crosshair_dot_color"
) !=
"0"
))
38
rgb =
stov
(
cvar_string
(
"crosshair_dot_color"
));
39
40
draw_Picture
(
'0.5 0.5 0'
- 0.5 * sz *
cvar
(
"crosshair_dot_size"
), me.src2, sz *
cvar
(
"crosshair_dot_size"
), rgb, a *
cvar
(
"crosshair_dot_alpha"
));
41
}
42
43
draw_alpha
= save;
44
45
SUPER
(
XonoticCrosshairPreview
).draw(me);
46
}
entity
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
XonoticCrosshairPreview
Definition
crosshairpreview.qh:4
XonoticCrosshairPreview_configureXonoticCrosshairPreview
void XonoticCrosshairPreview_configureXonoticCrosshairPreview(entity me)
Definition
crosshairpreview.qc:11
XonoticCrosshairPreview_draw
void XonoticCrosshairPreview_draw(entity me)
Definition
crosshairpreview.qc:17
makeXonoticCrosshairPreview
entity makeXonoticCrosshairPreview()
Definition
crosshairpreview.qc:3
crosshairpreview.qh
draw_Picture
void draw_Picture(vector theOrigin, string pic, vector theSize, vector theColor, float theAlpha)
Definition
draw.qc:72
draw_PictureSize
vector draw_PictureSize(string pic)
Definition
draw.qc:80
globalToBoxSize
vector globalToBoxSize(vector v, vector theScale)
Definition
draw.qc:38
draw_alpha
float draw_alpha
Definition
draw.qh:9
cvar
float cvar(string name)
stov
vector stov(string s)
cvar_string
const string cvar_string(string name)
strzone
string strzone(string s)
strcat
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
NEW
#define NEW(cname,...)
Definition
oo.qh:117
SUPER
#define SUPER(cname)
Definition
oo.qh:231
vector
vector
Definition
self.qh:92
strcpy
#define strcpy(this, s)
Definition
string.qh:52
menu
xonotic
crosshairpreview.qc
Generated on
for Xonotic QuakeC by
1.14.0