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 =
NEW
(
XonoticCrosshairPreview
);
6
me.configureXonoticCrosshairPreview(me);
7
return
me;
8
}
9
10
void
XonoticCrosshairPreview_configureXonoticCrosshairPreview
(
entity
me)
11
{
12
me.src =
strzone
(
strcat
(
"/gfx/crosshair"
,
cvar_string
(
"crosshair"
)));
13
me.src2 =
"/gfx/crosshairdot"
;
14
}
15
16
void
XonoticCrosshairPreview_draw
(
entity
me)
17
{
18
float
save =
draw_alpha
;
19
if
(me.disabled)
20
draw_alpha
*= me.disabledAlpha;
21
22
vector
sz, rgb;
23
float
a;
24
rgb =
stov
(
cvar_string
(
"crosshair_color"
));
25
a =
cvar
(
"crosshair_alpha"
);
26
strcpy
(me.src,
strcat
(
"/gfx/crosshair"
,
cvar_string
(
"crosshair"
)));
27
28
sz =
draw_PictureSize
(me.src);
29
sz =
globalToBoxSize
(sz, me.size);
30
sz *=
cvar
(
"crosshair_size"
);
31
32
draw_Picture
(
'0.5 0.5 0'
- 0.5 * sz, me.src, sz, rgb, a);
33
if
(
cvar
(
"crosshair_dot"
))
34
{
35
if
(
cvar
(
"crosshair_dot_color_custom"
) && (
cvar_string
(
"crosshair_dot_color"
) !=
"0"
))
36
rgb =
stov
(
cvar_string
(
"crosshair_dot_color"
));
37
38
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"
));
39
}
40
41
draw_alpha
= save;
42
43
SUPER
(
XonoticCrosshairPreview
).draw(me);
44
}
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:10
XonoticCrosshairPreview_draw
void XonoticCrosshairPreview_draw(entity me)
Definition
crosshairpreview.qc:16
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