Cleaned up warnings.
This commit is contained in:
parent
4bdefa4cd7
commit
80d06e7dcd
86 changed files with 466 additions and 412 deletions
|
@ -18,8 +18,6 @@ var int g_voxcount;
|
|||
var int g_voxpos;
|
||||
var float g_voxtime = 0.0f;
|
||||
|
||||
var int g_iSoundStyleCurrent;
|
||||
|
||||
class CCSAmbientSound {
|
||||
float m_flVolume;
|
||||
float m_flAttn;
|
||||
|
|
|
@ -76,8 +76,6 @@ int PointMessage_Visible( vector p1, vector p2, vector ang)
|
|||
|
||||
void PointMessage_Draw(void)
|
||||
{
|
||||
string msg;
|
||||
float distance;
|
||||
vector vecPlayer;
|
||||
|
||||
#ifdef WASTES
|
||||
|
|
|
@ -30,7 +30,7 @@ class trigger_cdaudio : CBaseTrigger
|
|||
|
||||
void trigger_cdaudio :: Trigger ( void )
|
||||
{
|
||||
if (!other.flags & FL_CLIENT) {
|
||||
if (!(other.flags & FL_CLIENT)) {
|
||||
return;
|
||||
}
|
||||
#ifdef GS_DEVELOPER
|
||||
|
|
|
@ -94,7 +94,7 @@ void menu_controls_update(void)
|
|||
|
||||
c = ctrl_lbActBind3.GetCount();
|
||||
|
||||
for (int i = 0; i < c; i++) {
|
||||
for (i = 0; i < c; i++) {
|
||||
string cmd = ctrl_lbActBind3.GetItem(i);
|
||||
|
||||
if (cmd == " ") {
|
||||
|
|
|
@ -103,7 +103,7 @@ void inet_btnrefresh(void)
|
|||
stof(gethostcachestring(srv_fldPlayers, i)),
|
||||
stof(gethostcachestring(srv_fldMaxplayers, i))
|
||||
);
|
||||
ping = sprintf("%d", gethostcachevalue(srv_fldPing, i));
|
||||
ping = sprintf("%d", stof(gethostcachestring(srv_fldPing, i)));
|
||||
inet_lbServers_Name.AddEntry(gethostcachestring(srv_fldName, i));
|
||||
inet_lbServers_Ping.AddEntry(ping);
|
||||
inet_lbServers_Map.AddEntry(gethostcachestring(srv_fldMap, i));
|
||||
|
|
|
@ -97,7 +97,7 @@ void lan_btnrefresh(void)
|
|||
stof(gethostcachestring(srv_fldPlayers, i)),
|
||||
stof(gethostcachestring(srv_fldMaxplayers, i))
|
||||
);
|
||||
ping = sprintf("%d", gethostcachevalue(srv_fldPing, i));
|
||||
ping = sprintf("%d", stof(gethostcachestring(srv_fldPing, i)));
|
||||
lan_lbServers_Name.AddEntry(gethostcachestring(srv_fldName, i));
|
||||
lan_lbServers_Ping.AddEntry(ping);
|
||||
lan_lbServers_Map.AddEntry(gethostcachestring(srv_fldMap, i));
|
||||
|
|
|
@ -107,8 +107,6 @@ void monster_zombie::vPain(int iHitBody)
|
|||
|
||||
void monster_zombie::vDeath(int iHitBody)
|
||||
{
|
||||
int r;
|
||||
|
||||
think = Respawn;
|
||||
nextthink = time + 10.0f;
|
||||
|
||||
|
|
|
@ -316,7 +316,7 @@ w_displacer_hud(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_displacer_hudpic(int selected, vector pos)
|
||||
w_displacer_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -327,7 +327,7 @@ w_displacer_hudpic(int selected, vector pos)
|
|||
[0,180/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -338,7 +338,7 @@ w_displacer_hudpic(int selected, vector pos)
|
|||
[0,180/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -325,7 +325,7 @@ w_eagle_aimanim(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_eagle_hudpic(int selected, vector pos)
|
||||
w_eagle_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -336,7 +336,7 @@ w_eagle_hudpic(int selected, vector pos)
|
|||
[0,90/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -347,7 +347,7 @@ w_eagle_hudpic(int selected, vector pos)
|
|||
[0,90/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -235,7 +235,7 @@ w_grapple_aimanim(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_grapple_hudpic(int selected, vector pos)
|
||||
w_grapple_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -246,7 +246,7 @@ w_grapple_hudpic(int selected, vector pos)
|
|||
[0,45/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -257,7 +257,7 @@ w_grapple_hudpic(int selected, vector pos)
|
|||
[0,45/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -204,7 +204,7 @@ w_knife_aimanim(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_knife_hudpic(int selected, vector pos)
|
||||
w_knife_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -215,7 +215,7 @@ w_knife_hudpic(int selected, vector pos)
|
|||
[0,90/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -226,7 +226,7 @@ w_knife_hudpic(int selected, vector pos)
|
|||
[0,90/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -262,7 +262,7 @@ w_m249_aimanim(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_m249_hudpic(int selected, vector pos)
|
||||
w_m249_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -273,7 +273,7 @@ w_m249_hudpic(int selected, vector pos)
|
|||
[0,135/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -284,7 +284,7 @@ w_m249_hudpic(int selected, vector pos)
|
|||
[0,135/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -131,7 +131,7 @@ penguin_die(int i)
|
|||
{
|
||||
/* clear this first to avoid infinite recursion */
|
||||
self.customphysics = __NULL__;
|
||||
self.vDeath = Empty;
|
||||
self.vDeath = __NULL__;
|
||||
|
||||
/* now we can explodededededed */
|
||||
Effect_CreateExplosion(self.origin);
|
||||
|
@ -313,17 +313,17 @@ w_penguin_hud(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_penguin_hudpic(int s, vector pos)
|
||||
w_penguin_hudpic(int s, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (s) {
|
||||
drawsubpic(pos, [170,45], "sprites/640hudof04.spr_0.tga",
|
||||
[0,180/256], [170/256,45/256],
|
||||
g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||
g_hud_color, a, DRAWFLAG_ADDITIVE);
|
||||
} else {
|
||||
drawsubpic(pos, [170,45], "sprites/640hudof03.spr_0.tga",
|
||||
[0,180/256], [170/256,45/256],
|
||||
g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||
g_hud_color, a, DRAWFLAG_ADDITIVE);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -278,7 +278,7 @@ w_pipewrench_aimanim(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_pipewrench_hudpic(int selected, vector pos)
|
||||
w_pipewrench_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -289,7 +289,7 @@ w_pipewrench_hudpic(int selected, vector pos)
|
|||
[0,0],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -300,7 +300,7 @@ w_pipewrench_hudpic(int selected, vector pos)
|
|||
[0,0],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -255,7 +255,7 @@ w_shockrifle_aimanim(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_shockrifle_hudpic(int selected, vector pos)
|
||||
w_shockrifle_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -266,7 +266,7 @@ w_shockrifle_hudpic(int selected, vector pos)
|
|||
[0,45/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -277,7 +277,7 @@ w_shockrifle_hudpic(int selected, vector pos)
|
|||
[0,45/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -256,13 +256,13 @@ w_sniperrifle_aimanim(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_sniperrifle_hudpic(int s, vector pos)
|
||||
w_sniperrifle_hudpic(int s, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (s) {
|
||||
drawsubpic(pos, [170,45], "sprites/640hudof04.spr_0.tga", [0,135/256], [170/256,45/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||
drawsubpic(pos, [170,45], "sprites/640hudof04.spr_0.tga", [0,135/256], [170/256,45/256], g_hud_color, a, DRAWFLAG_ADDITIVE);
|
||||
} else {
|
||||
drawsubpic(pos, [170,45], "sprites/640hudof03.spr_0.tga", [0,135/256], [170/256,45/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||
drawsubpic(pos, [170,45], "sprites/640hudof03.spr_0.tga", [0,135/256], [170/256,45/256], g_hud_color, a, DRAWFLAG_ADDITIVE);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -314,7 +314,7 @@ w_sporelauncher_aimanim(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_sporelauncher_hudpic(int selected, vector pos)
|
||||
w_sporelauncher_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -325,7 +325,7 @@ w_sporelauncher_hudpic(int selected, vector pos)
|
|||
[0,0],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -336,7 +336,7 @@ w_sporelauncher_hudpic(int selected, vector pos)
|
|||
[0,0],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -293,7 +293,7 @@ w_ap9_hud(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_ap9_hudpic(int selected, vector pos)
|
||||
w_ap9_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -304,7 +304,7 @@ w_ap9_hudpic(int selected, vector pos)
|
|||
[0,90/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -315,7 +315,7 @@ w_ap9_hudpic(int selected, vector pos)
|
|||
[0,0],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -263,7 +263,7 @@ w_chaingun_aimanim(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_chaingun_hudpic(int selected, vector pos)
|
||||
w_chaingun_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -274,7 +274,7 @@ w_chaingun_hudpic(int selected, vector pos)
|
|||
[0,90/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -285,7 +285,7 @@ w_chaingun_hudpic(int selected, vector pos)
|
|||
[0,45/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -206,7 +206,7 @@ w_flame_aimanim(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_flame_hudpic(int selected, vector pos)
|
||||
w_flame_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
|
||||
|
@ -218,7 +218,7 @@ if (selected) {
|
|||
[0,45/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -229,7 +229,7 @@ if (selected) {
|
|||
[0,0/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -295,7 +295,7 @@ w_glock_hud(void)
|
|||
#endif
|
||||
}
|
||||
void
|
||||
w_glock_hudpic(int selected, vector pos)
|
||||
w_glock_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -306,7 +306,7 @@ w_glock_hudpic(int selected, vector pos)
|
|||
[0,135/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -317,7 +317,7 @@ w_glock_hudpic(int selected, vector pos)
|
|||
[0,45/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -223,13 +223,13 @@ w_handgrenade_aimanim(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_handgrenade_hudpic(int s, vector pos)
|
||||
w_handgrenade_hudpic(int s, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (s) {
|
||||
drawsubpic(pos, [170,45], "sprites/640hud6.spr_0.tga", [0,0], [170/256,45/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||
drawsubpic(pos, [170,45], "sprites/640hud6.spr_0.tga", [0,0], [170/256,45/256], g_hud_color, a, DRAWFLAG_ADDITIVE);
|
||||
} else {
|
||||
drawsubpic(pos, [170,45], "sprites/640hud3.spr_0.tga", [0,0], [170/256,45/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||
drawsubpic(pos, [170,45], "sprites/640hud3.spr_0.tga", [0,0], [170/256,45/256], g_hud_color, a, DRAWFLAG_ADDITIVE);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -179,7 +179,7 @@ w_medkit_crosshair(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_medkit_hudpic(int selected, vector pos)
|
||||
w_medkit_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -190,7 +190,7 @@ w_medkit_hudpic(int selected, vector pos)
|
|||
[0,180/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -201,7 +201,7 @@ w_medkit_hudpic(int selected, vector pos)
|
|||
[0,90/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -184,7 +184,7 @@ w_shovel_aimanim(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_shovel_hudpic(int selected, vector pos)
|
||||
w_shovel_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -195,7 +195,7 @@ w_shovel_hudpic(int selected, vector pos)
|
|||
[0,135/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -206,7 +206,7 @@ w_shovel_hudpic(int selected, vector pos)
|
|||
[0,90/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -290,7 +290,7 @@ w_sniper_aimanim(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_sniper_hudpic(int selected, vector pos)
|
||||
w_sniper_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -301,7 +301,7 @@ w_sniper_hudpic(int selected, vector pos)
|
|||
[0,45/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -312,7 +312,7 @@ w_sniper_hudpic(int selected, vector pos)
|
|||
[0,45/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -273,7 +273,7 @@ w_sniper2_aimanim(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_sniper2_hudpic(int selected, vector pos)
|
||||
w_sniper2_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -284,7 +284,7 @@ w_sniper2_hudpic(int selected, vector pos)
|
|||
[0,45/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -295,7 +295,7 @@ w_sniper2_hudpic(int selected, vector pos)
|
|||
[0,45/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -81,7 +81,6 @@ void
|
|||
w_spanner_primary(void)
|
||||
{
|
||||
int anim = 0;
|
||||
int r;
|
||||
vector src;
|
||||
player pl = (player)self;
|
||||
|
||||
|
@ -128,6 +127,7 @@ w_spanner_primary(void)
|
|||
}
|
||||
|
||||
if (trace_ent.takedamage) {
|
||||
int r;
|
||||
Damage_Apply(trace_ent, self, 10, WEAPON_SPANNER, DMG_BLUNT );
|
||||
|
||||
if (!trace_ent.iBleeds) {
|
||||
|
@ -176,7 +176,7 @@ w_spanner_aimanim(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_spanner_hudpic(int selected, vector pos)
|
||||
w_spanner_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -187,7 +187,7 @@ w_spanner_hudpic(int selected, vector pos)
|
|||
[0,180/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -198,7 +198,7 @@ w_spanner_hudpic(int selected, vector pos)
|
|||
[0,135/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -260,7 +260,7 @@ w_taurus_hud(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_taurus_hudpic(int selected, vector pos)
|
||||
w_taurus_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -271,7 +271,7 @@ w_taurus_hudpic(int selected, vector pos)
|
|||
[0,45/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -282,7 +282,7 @@ w_taurus_hudpic(int selected, vector pos)
|
|||
[0,45/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -62,6 +62,7 @@ int
|
|||
w_bradnailer_pickup(int new)
|
||||
{
|
||||
/* TODO */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -202,7 +203,7 @@ w_bradnailer_release(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_bradnailer_hudpic(int selected, vector pos)
|
||||
w_bradnailer_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -213,7 +214,7 @@ w_bradnailer_hudpic(int selected, vector pos)
|
|||
[0,45/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -224,7 +225,7 @@ w_bradnailer_hudpic(int selected, vector pos)
|
|||
[0,45/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ w_cmlwbr_release(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_cmlwbr_hudpic(int selected, vector pos)
|
||||
w_cmlwbr_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -100,7 +100,7 @@ w_cmlwbr_hudpic(int selected, vector pos)
|
|||
[0,45/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -111,7 +111,7 @@ w_cmlwbr_hudpic(int selected, vector pos)
|
|||
[0,45/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@ w_heaterpipe_release(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_heaterpipe_hudpic(int selected, vector pos)
|
||||
w_heaterpipe_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -89,7 +89,7 @@ w_heaterpipe_hudpic(int selected, vector pos)
|
|||
[0,45/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -100,7 +100,7 @@ w_heaterpipe_hudpic(int selected, vector pos)
|
|||
[0,45/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -134,7 +134,7 @@ w_nailgun_release(void)
|
|||
|
||||
|
||||
void
|
||||
w_nailgun_hudpic(int selected, vector pos)
|
||||
w_nailgun_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -145,7 +145,7 @@ w_nailgun_hudpic(int selected, vector pos)
|
|||
[0,45/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -156,7 +156,7 @@ w_nailgun_hudpic(int selected, vector pos)
|
|||
[0,45/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -240,13 +240,13 @@ w_pipebomb_hud(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_pipebomb_hudpic(int s, vector pos)
|
||||
w_pipebomb_hudpic(int s, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (s) {
|
||||
drawsubpic(pos, [170,45], "sprites/640hud6.spr_0.tga", [0,45/256], [170/256,45/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||
drawsubpic(pos, [170,45], "sprites/640hud6.spr_0.tga", [0,45/256], [170/256,45/256], g_hud_color, a, DRAWFLAG_ADDITIVE);
|
||||
} else {
|
||||
drawsubpic(pos, [170,45], "sprites/640hud3.spr_0.tga", [0,45/256], [170/256,45/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||
drawsubpic(pos, [170,45], "sprites/640hud3.spr_0.tga", [0,45/256], [170/256,45/256], g_hud_color, a, DRAWFLAG_ADDITIVE);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -232,13 +232,13 @@ float w_shotgun_aimanim(void)
|
|||
return self.flags & FL_CROUCHING ? ANIM_CR_AIMSHOTGUN : ANIM_AIMSHOTGUN;
|
||||
}
|
||||
|
||||
void w_shotgun_hudpic(int s, vector pos)
|
||||
void w_shotgun_hudpic(int s, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (s) {
|
||||
drawsubpic(pos, [170,45], "sprites/640hud4.spr_0.tga", [0,180/256], [170/256,45/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||
drawsubpic(pos, [170,45], "sprites/640hud4.spr_0.tga", [0,180/256], [170/256,45/256], g_hud_color, a, DRAWFLAG_ADDITIVE);
|
||||
} else {
|
||||
drawsubpic(pos, [170,45], "sprites/640hud1.spr_0.tga", [0,180/256], [170/256,45/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||
drawsubpic(pos, [170,45], "sprites/640hud1.spr_0.tga", [0,180/256], [170/256,45/256], g_hud_color, a, DRAWFLAG_ADDITIVE);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@ w_xs_release(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_xs_hudpic(int selected, vector pos)
|
||||
w_xs_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -102,7 +102,7 @@ w_xs_hudpic(int selected, vector pos)
|
|||
[0,45/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -113,7 +113,7 @@ w_xs_hudpic(int selected, vector pos)
|
|||
[0,45/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -98,7 +98,7 @@ w_aicore_aimanim(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_aicore_hudpic(int selected, vector pos)
|
||||
w_aicore_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
drawpic(
|
||||
|
@ -106,7 +106,7 @@ w_aicore_hudpic(int selected, vector pos)
|
|||
"gfx/vgui/640_weapon_aicore0.tga",
|
||||
[170,43],
|
||||
[1,1,1],
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_NORMAL
|
||||
);
|
||||
#endif
|
||||
|
|
|
@ -227,7 +227,7 @@ w_beamgun_hud(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_beamgun_hudpic(int selected, vector pos)
|
||||
w_beamgun_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
drawpic(
|
||||
|
@ -235,7 +235,7 @@ w_beamgun_hudpic(int selected, vector pos)
|
|||
"gfx/vgui/640_weapon_beamgun0.tga",
|
||||
[170,43],
|
||||
[1,1,1],
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_NORMAL
|
||||
);
|
||||
#endif
|
||||
|
|
|
@ -315,7 +315,7 @@ w_chemicalgun_hud(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_chemicalgun_hudpic(int selected, vector pos)
|
||||
w_chemicalgun_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
drawpic(
|
||||
|
@ -323,7 +323,7 @@ w_chemicalgun_hudpic(int selected, vector pos)
|
|||
"gfx/vgui/640_weapon_SPchemicalgun0.tga",
|
||||
[170,43],
|
||||
[1,1,1],
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_NORMAL
|
||||
);
|
||||
#endif
|
||||
|
|
|
@ -334,7 +334,7 @@ w_dml_hud(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_dml_hudpic(int selected, vector pos)
|
||||
w_dml_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
drawpic(
|
||||
|
@ -342,7 +342,7 @@ w_dml_hudpic(int selected, vector pos)
|
|||
"gfx/vgui/640_weapon_dml0.tga",
|
||||
[170,43],
|
||||
[1,1,1],
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_NORMAL
|
||||
);
|
||||
#endif
|
||||
|
|
|
@ -243,6 +243,7 @@ w_fists_pmodel(void)
|
|||
} else {
|
||||
return "";
|
||||
}*/
|
||||
return "";
|
||||
}
|
||||
|
||||
string
|
||||
|
@ -273,7 +274,7 @@ w_fists_pickup(int new)
|
|||
}
|
||||
|
||||
void
|
||||
w_fists_hudpic(int selected, vector pos)
|
||||
w_fists_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
drawpic(
|
||||
|
@ -281,7 +282,7 @@ w_fists_hudpic(int selected, vector pos)
|
|||
"gfx/vgui/640_weapon_fists0.tga",
|
||||
[170,43],
|
||||
[1,1,1],
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_NORMAL
|
||||
);
|
||||
#endif
|
||||
|
|
|
@ -332,7 +332,7 @@ w_gausspistol_hud(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_gausspistol_hudpic(int selected, vector pos)
|
||||
w_gausspistol_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
drawpic(
|
||||
|
@ -340,7 +340,7 @@ w_gausspistol_hudpic(int selected, vector pos)
|
|||
"gfx/vgui/640_weapon_gaussPistol0.tga",
|
||||
[170,43],
|
||||
[1,1,1],
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_NORMAL
|
||||
);
|
||||
#endif
|
||||
|
|
|
@ -192,7 +192,7 @@ w_grenade_hud(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_grenade_hudpic(int selected, vector pos)
|
||||
w_grenade_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
drawpic(
|
||||
|
@ -200,7 +200,7 @@ w_grenade_hudpic(int selected, vector pos)
|
|||
"gfx/vgui/640_weapon_dmlGrenade0.tga",
|
||||
[170,43],
|
||||
[1,1,1],
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_NORMAL
|
||||
);
|
||||
#endif
|
||||
|
|
|
@ -244,7 +244,7 @@ w_minigun_hud(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_minigun_hudpic(int selected, vector pos)
|
||||
w_minigun_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
drawpic(
|
||||
|
@ -252,7 +252,7 @@ w_minigun_hudpic(int selected, vector pos)
|
|||
"gfx/vgui/640_weapon_minigun0.tga",
|
||||
[170,43],
|
||||
[1,1,1],
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_NORMAL
|
||||
);
|
||||
#endif
|
||||
|
|
|
@ -298,7 +298,7 @@ w_shotgun_hud(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_shotgun_hudpic(int selected, vector pos)
|
||||
w_shotgun_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
drawpic(
|
||||
|
@ -306,7 +306,7 @@ w_shotgun_hudpic(int selected, vector pos)
|
|||
"gfx/vgui/640_weapon_shotgun0.tga",
|
||||
[170,43],
|
||||
[1,1,1],
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_NORMAL
|
||||
);
|
||||
#endif
|
||||
|
|
|
@ -217,13 +217,13 @@ float w_cannon_aimanim(void)
|
|||
return self.flags & FL_CROUCHING ? ANIM_CR_AIMSHOTGUN : ANIM_AIMSHOTGUN;
|
||||
}
|
||||
|
||||
void w_cannon_hudpic(int s, vector pos)
|
||||
void w_cannon_hudpic(int s, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (s) {
|
||||
drawsubpic(pos, [170,45], "sprites/w_cannon.spr_0.tga", [0,48/256], [170/256,45/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||
drawsubpic(pos, [170,45], "sprites/w_cannon.spr_0.tga", [0,48/256], [170/256,45/256], g_hud_color, a, DRAWFLAG_ADDITIVE);
|
||||
} else {
|
||||
drawsubpic(pos, [170,45], "sprites/w_cannon.spr_0.tga", [0,0], [170/256,45/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||
drawsubpic(pos, [170,45], "sprites/w_cannon.spr_0.tga", [0,0], [170/256,45/256], g_hud_color, a, DRAWFLAG_ADDITIVE);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -136,17 +136,17 @@ float w_chainsaw_aimanim(void)
|
|||
return self.flags & FL_CROUCHING ? ANIM_CR_AIMSQUEAK : ANIM_AIMSQUEAK;
|
||||
}
|
||||
|
||||
void w_chainsaw_hudpic(int s, vector pos)
|
||||
void w_chainsaw_hudpic(int s, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (s) {
|
||||
drawsubpic(pos, [170,45], "sprites/chainsaw.spr_0.tga",
|
||||
[0,48/256], [170/256,45/256],
|
||||
g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||
g_hud_color, a, DRAWFLAG_ADDITIVE);
|
||||
} else {
|
||||
drawsubpic(pos, [170,45], "sprites/chainsaw.spr_0.tga",
|
||||
[0,0], [170/256,45/256],
|
||||
g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||
g_hud_color, a, DRAWFLAG_ADDITIVE);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -202,13 +202,13 @@ float w_hammer_aimanim(void)
|
|||
return self.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
|
||||
}
|
||||
|
||||
void w_hammer_hudpic(int s, vector pos)
|
||||
void w_hammer_hudpic(int s, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (s) {
|
||||
drawsubpic(pos, [170,45], "sprites/hammer.spr_0.tga", [0,48/256], [170/256,45/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||
drawsubpic(pos, [170,45], "sprites/hammer.spr_0.tga", [0,48/256], [170/256,45/256], g_hud_color, a, DRAWFLAG_ADDITIVE);
|
||||
} else {
|
||||
drawsubpic(pos, [170,45], "sprites/hammer.spr_0.tga", [0,0], [170/256,45/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||
drawsubpic(pos, [170,45], "sprites/hammer.spr_0.tga", [0,0], [170/256,45/256], g_hud_color, a, DRAWFLAG_ADDITIVE);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ w_asscan_aimanim(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_asscan_hudpic(int selected, vector pos)
|
||||
w_asscan_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -72,7 +72,7 @@ w_asscan_hudpic(int selected, vector pos)
|
|||
[0,90/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -83,7 +83,7 @@ w_asscan_hudpic(int selected, vector pos)
|
|||
[0,45/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ w_autorifle_aimanim(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_autorifle_hudpic(int selected, vector pos)
|
||||
w_autorifle_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -72,7 +72,7 @@ w_autorifle_hudpic(int selected, vector pos)
|
|||
[0,0],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -83,7 +83,7 @@ w_autorifle_hudpic(int selected, vector pos)
|
|||
[0,0],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -179,7 +179,7 @@ w_crowbar_aimanim(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_crowbar_hudpic(int selected, vector pos)
|
||||
w_crowbar_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -190,7 +190,7 @@ w_crowbar_hudpic(int selected, vector pos)
|
|||
[0,0],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -201,7 +201,7 @@ w_crowbar_hudpic(int selected, vector pos)
|
|||
[0,0],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -238,13 +238,13 @@ w_dbs_aimanim(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_dbs_hudpic(int s, vector pos)
|
||||
w_dbs_hudpic(int s, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (s) {
|
||||
drawsubpic(pos, [170,45], "sprites/640hud4.spr_0.tga", [0,180/256], [170/256,45/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||
drawsubpic(pos, [170,45], "sprites/640hud4.spr_0.tga", [0,180/256], [170/256,45/256], g_hud_color, a, DRAWFLAG_ADDITIVE);
|
||||
} else {
|
||||
drawsubpic(pos, [170,45], "sprites/640hud1.spr_0.tga", [0,180/256], [170/256,45/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||
drawsubpic(pos, [170,45], "sprites/640hud1.spr_0.tga", [0,180/256], [170/256,45/256], g_hud_color, a, DRAWFLAG_ADDITIVE);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ w_flamer_aimanim(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_flamer_hudpic(int selected, vector pos)
|
||||
w_flamer_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -72,7 +72,7 @@ w_flamer_hudpic(int selected, vector pos)
|
|||
[0,45/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -83,7 +83,7 @@ w_flamer_hudpic(int selected, vector pos)
|
|||
[0,45/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ w_glauncher_aimanim(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_glauncher_hudpic(int selected, vector pos)
|
||||
w_glauncher_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -72,7 +72,7 @@ w_glauncher_hudpic(int selected, vector pos)
|
|||
[0,135/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -83,7 +83,7 @@ w_glauncher_hudpic(int selected, vector pos)
|
|||
[0,135/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ w_grapple_aimanim(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_grapple_hudpic(int selected, vector pos)
|
||||
w_grapple_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -72,7 +72,7 @@ w_grapple_hudpic(int selected, vector pos)
|
|||
[0,0],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -83,7 +83,7 @@ w_grapple_hudpic(int selected, vector pos)
|
|||
[0,0],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ w_incendiary_aimanim(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_incendiary_hudpic(int selected, vector pos)
|
||||
w_incendiary_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -72,7 +72,7 @@ w_incendiary_hudpic(int selected, vector pos)
|
|||
[0,90/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -83,7 +83,7 @@ w_incendiary_hudpic(int selected, vector pos)
|
|||
[0,0],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ w_knife_aimanim(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_knife_hudpic(int selected, vector pos)
|
||||
w_knife_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -72,7 +72,7 @@ w_knife_hudpic(int selected, vector pos)
|
|||
[0,135/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -83,7 +83,7 @@ w_knife_hudpic(int selected, vector pos)
|
|||
[0,90/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ w_medkit_aimanim(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_medkit_hudpic(int selected, vector pos)
|
||||
w_medkit_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -72,7 +72,7 @@ w_medkit_hudpic(int selected, vector pos)
|
|||
[0,180/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -83,7 +83,7 @@ w_medkit_hudpic(int selected, vector pos)
|
|||
[0,90/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ w_nailgun_aimanim(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_nailgun_hudpic(int selected, vector pos)
|
||||
w_nailgun_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -72,7 +72,7 @@ w_nailgun_hudpic(int selected, vector pos)
|
|||
[0,90/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -83,7 +83,7 @@ w_nailgun_hudpic(int selected, vector pos)
|
|||
[0,90/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ w_pipebomb_aimanim(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_pipebomb_hudpic(int selected, vector pos)
|
||||
w_pipebomb_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -73,7 +73,7 @@ w_pipebomb_hudpic(int selected, vector pos)
|
|||
[0,90/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -84,7 +84,7 @@ w_pipebomb_hudpic(int selected, vector pos)
|
|||
[0,90/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ w_railgun_aimanim(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_railgun_hudpic(int selected, vector pos)
|
||||
w_railgun_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -72,7 +72,7 @@ w_railgun_hudpic(int selected, vector pos)
|
|||
[0,0],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -83,7 +83,7 @@ w_railgun_hudpic(int selected, vector pos)
|
|||
[0,0],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -61,13 +61,13 @@ w_rpg_aimanim(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_rpg_hudpic(int selected, vector pos)
|
||||
w_rpg_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
drawsubpic(pos, [170,45], "sprites/640hud5.spr_0.tga", [0,45/256], [170/256,45/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||
drawsubpic(pos, [170,45], "sprites/640hud5.spr_0.tga", [0,45/256], [170/256,45/256], g_hud_color, a, DRAWFLAG_ADDITIVE);
|
||||
} else {
|
||||
drawsubpic(pos, [170,45], "sprites/640hud2.spr_0.tga", [0,45/256], [170/256,45/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||
drawsubpic(pos, [170,45], "sprites/640hud2.spr_0.tga", [0,45/256], [170/256,45/256], g_hud_color, a, DRAWFLAG_ADDITIVE);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -237,13 +237,13 @@ w_sbs_aimanim(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_sbs_hudpic(int s, vector pos)
|
||||
w_sbs_hudpic(int s, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (s) {
|
||||
drawsubpic(pos, [170,45], "sprites/tfchud02.spr_0.tga", [0,180/256], [170/256,45/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||
drawsubpic(pos, [170,45], "sprites/tfchud02.spr_0.tga", [0,180/256], [170/256,45/256], g_hud_color, a, DRAWFLAG_ADDITIVE);
|
||||
} else {
|
||||
drawsubpic(pos, [170,45], "sprites/tfchud01.spr_0.tga", [0,180/256], [170/256,45/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||
drawsubpic(pos, [170,45], "sprites/tfchud01.spr_0.tga", [0,180/256], [170/256,45/256], g_hud_color, a, DRAWFLAG_ADDITIVE);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ w_sniper_aimanim(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_sniper_hudpic(int selected, vector pos)
|
||||
w_sniper_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -72,7 +72,7 @@ w_sniper_hudpic(int selected, vector pos)
|
|||
[0,45/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -83,7 +83,7 @@ w_sniper_hudpic(int selected, vector pos)
|
|||
[0,45/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ w_supernail_aimanim(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_supernail_hudpic(int selected, vector pos)
|
||||
w_supernail_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -72,7 +72,7 @@ w_supernail_hudpic(int selected, vector pos)
|
|||
[0,135/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -83,7 +83,7 @@ w_supernail_hudpic(int selected, vector pos)
|
|||
[0,135/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ w_tranquil_aimanim(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_tranquil_hudpic(int selected, vector pos)
|
||||
w_tranquil_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -72,7 +72,7 @@ w_tranquil_hudpic(int selected, vector pos)
|
|||
[0,135/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -83,7 +83,7 @@ w_tranquil_hudpic(int selected, vector pos)
|
|||
[0,45/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -182,7 +182,7 @@ w_umbrella_aimanim(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_umbrella_hudpic(int selected, vector pos)
|
||||
w_umbrella_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -193,7 +193,7 @@ w_umbrella_hudpic(int selected, vector pos)
|
|||
[0,0],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -204,7 +204,7 @@ w_umbrella_hudpic(int selected, vector pos)
|
|||
[0,0],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -172,7 +172,7 @@ w_wrench_aimanim(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_wrench_hudpic(int selected, vector pos)
|
||||
w_wrench_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -183,7 +183,7 @@ w_wrench_hudpic(int selected, vector pos)
|
|||
[0,180/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -194,7 +194,7 @@ w_wrench_hudpic(int selected, vector pos)
|
|||
[0,135/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
int input_sequence;
|
||||
noref int input_sequence;
|
||||
class player
|
||||
{
|
||||
float health;
|
||||
|
|
|
@ -102,14 +102,15 @@ void
|
|||
w_hornetgun_shoothornet(void)
|
||||
{
|
||||
static void Hornet_Touch(void) {
|
||||
string snd;
|
||||
int r = floor(random(1,4));
|
||||
if (other.takedamage == DAMAGE_YES) {
|
||||
Damage_Apply(other, self.owner, 10, WEAPON_HORNETGUN, DMG_GENERIC);
|
||||
string sample = sprintf("hornet/ag_hornethit%i.wav", r);
|
||||
snd = sprintf("hornet/ag_hornethit%i.wav", r);
|
||||
} else {
|
||||
string sample = sprintf("hornet/ag_buzz%i.wav", r);
|
||||
snd = sprintf("hornet/ag_buzz%i.wav", r);
|
||||
}
|
||||
sound(self, CHAN_BODY, sample, 1, ATTN_NORM);
|
||||
sound(self, CHAN_BODY, snd, 1, ATTN_NORM);
|
||||
remove(self);
|
||||
}
|
||||
|
||||
|
|
|
@ -223,7 +223,6 @@ void w_tripmine_primary(void)
|
|||
|
||||
void w_tripmine_release(void)
|
||||
{
|
||||
int r;
|
||||
player pl = (player)self;
|
||||
|
||||
if (pl.w_idle_next > 0.0) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2016-2019 Marco Hladik <marco@icculus.org>
|
||||
* Copyright (c) 2016-2020 Marco Hladik <marco@icculus.org>
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
@ -31,7 +31,8 @@ typedef struct
|
|||
int iFlags;
|
||||
} font_s;
|
||||
|
||||
void Font_Load ( string strFile, font_s &fntNew )
|
||||
void
|
||||
Font_Load ( string strFile, font_s &fntNew )
|
||||
{
|
||||
#ifdef CLASSIC_VGUI
|
||||
fntNew.iID = (int)loadfont( "", "gfx/conchars", "12", -1, 0, 0 );
|
||||
|
@ -82,19 +83,22 @@ void Font_Load ( string strFile, font_s &fntNew )
|
|||
#endif
|
||||
}
|
||||
|
||||
void Font_DrawText ( vector vecOrigin, string strText, font_s fnt )
|
||||
void
|
||||
Font_DrawText ( vector vecOrigin, string strText, font_s fnt )
|
||||
{
|
||||
drawfont = (float)fnt.iID;
|
||||
drawstring( vecOrigin, strText, [ fnt.iScale, fnt.iScale ], fnt.vecColor, fnt.flAlpha, (float)fnt.iFlags );
|
||||
}
|
||||
|
||||
void Font_DrawField ( vector vecOrigin, vector vecSize, string strText, font_s fnt, int iAlignFlags )
|
||||
void
|
||||
Font_DrawField ( vector vecOrigin, vector vecSize, string strText, font_s fnt, int iAlignFlags )
|
||||
{
|
||||
drawfont = (float)fnt.iID;
|
||||
drawtextfield( vecOrigin, vecSize, (float)iAlignFlags, strText );
|
||||
}
|
||||
|
||||
string Font_RGBtoHex(vector vecColor)
|
||||
string
|
||||
Font_RGBtoHex(vector vecColor)
|
||||
{
|
||||
static string numtohex(float x) {
|
||||
x = rint(x * 15);
|
||||
|
|
109
src/vgui/ui.cpp
109
src/vgui/ui.cpp
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2016-2019 Marco Hladik <marco@icculus.org>
|
||||
* Copyright (c) 2016-2020 Marco Hladik <marco@icculus.org>
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
@ -18,14 +18,15 @@ font_s g_fntDefault;
|
|||
var int g_vguiWidgetCount;
|
||||
|
||||
#ifdef CLASSIC_VGUI
|
||||
#define UI_MAINCOLOR '255 200 0' / 255
|
||||
#define UI_MAINCOLOR [255,200,0] / 255
|
||||
#define UI_MAINALPHA 255
|
||||
#else
|
||||
var vector UI_MAINCOLOR;
|
||||
var float UI_MAINALPHA;
|
||||
#endif
|
||||
|
||||
int Util_MouseAbove(vector vecMousePos, vector vecPos, vector vecSize)
|
||||
int
|
||||
Util_MouseAbove(vector vecMousePos, vector vecPos, vector vecSize)
|
||||
{
|
||||
if (vecMousePos[0] >= vecPos[0] && vecMousePos[0] <= vecPos[0] + vecSize[0]) {
|
||||
if (vecMousePos[1] >= vecPos[1] && vecMousePos[1] <= vecPos[1] + vecSize[1]) {
|
||||
|
@ -42,114 +43,130 @@ class CUIWidget
|
|||
CUIWidget m_parent;
|
||||
int m_iFlags;
|
||||
|
||||
virtual void( CUIWidget ) Add;
|
||||
virtual void( int ) FlagAdd;
|
||||
virtual void( int ) FlagRemove;
|
||||
virtual void( vector ) SetPos;
|
||||
virtual void(CUIWidget) Add;
|
||||
virtual void(int) FlagAdd;
|
||||
virtual void(int) FlagRemove;
|
||||
virtual void(vector) SetPos;
|
||||
virtual vector() GetPos;
|
||||
virtual int() GetPosWidth;
|
||||
virtual int() GetPosHeight;
|
||||
virtual void( ) Draw;
|
||||
virtual void( float, float, float, float ) Input;
|
||||
virtual void() Draw;
|
||||
virtual void(float, float, float, float) Input;
|
||||
};
|
||||
|
||||
void CUIWidget :: SetPos ( vector vecPos )
|
||||
void
|
||||
CUIWidget::SetPos(vector vecPos)
|
||||
{
|
||||
m_vecOrigin = vecPos;
|
||||
}
|
||||
vector CUIWidget :: GetPos ( void )
|
||||
|
||||
vector
|
||||
CUIWidget::GetPos(void)
|
||||
{
|
||||
return m_vecOrigin;
|
||||
}
|
||||
int CUIWidget :: GetPosWidth ( void )
|
||||
|
||||
int
|
||||
CUIWidget::GetPosWidth(void)
|
||||
{
|
||||
return m_vecOrigin[0];
|
||||
}
|
||||
int CUIWidget :: GetPosHeight ( void )
|
||||
|
||||
int
|
||||
CUIWidget::GetPosHeight(void)
|
||||
{
|
||||
return m_vecOrigin[1];
|
||||
}
|
||||
|
||||
void CUIWidget :: FlagAdd ( int iFlag )
|
||||
void
|
||||
CUIWidget::FlagAdd(int iFlag)
|
||||
{
|
||||
m_iFlags |= iFlag;
|
||||
}
|
||||
void CUIWidget :: FlagRemove ( int iFlag )
|
||||
|
||||
void
|
||||
CUIWidget::FlagRemove(int iFlag)
|
||||
{
|
||||
m_iFlags -= ( m_iFlags & iFlag );
|
||||
m_iFlags -= (m_iFlags & iFlag);
|
||||
}
|
||||
|
||||
void CUIWidget :: Add ( CUIWidget wNew )
|
||||
void
|
||||
CUIWidget::Add(CUIWidget wNew)
|
||||
{
|
||||
CUIWidget wNext = this;
|
||||
CUIWidget wParent;
|
||||
do {
|
||||
wParent = wNext;
|
||||
wNext = wNext.m_next;
|
||||
} while ( wNext );
|
||||
} while (wNext);
|
||||
wParent.m_next = wNew;
|
||||
wNew.m_parent = this;
|
||||
}
|
||||
|
||||
void CUIWidget :: Draw ( void )
|
||||
void
|
||||
CUIWidget::Draw(void)
|
||||
{
|
||||
CUIWidget wNext = this;
|
||||
do {
|
||||
wNext = wNext.m_next;
|
||||
if ( wNext && wNext.m_iFlags & 1 && wNext.m_parent.m_iFlags & 1 ) {
|
||||
if (wNext && wNext.m_iFlags & 1 && wNext.m_parent.m_iFlags & 1) {
|
||||
wNext.Draw();
|
||||
}
|
||||
} while ( wNext );
|
||||
} while (wNext);
|
||||
}
|
||||
|
||||
void CUIWidget :: Input ( float flEVType, float flKey, float flChar, float flDevID )
|
||||
void
|
||||
CUIWidget::Input(float flEVType, float flKey, float flChar, float flDevID)
|
||||
{
|
||||
CUIWidget wNext = this;
|
||||
|
||||
g_vguiWidgetCount = 0;
|
||||
do {
|
||||
wNext = wNext.m_next;
|
||||
if ( wNext && wNext.m_iFlags & 1 && wNext.m_parent.m_iFlags & 1 ) {
|
||||
if (wNext && wNext.m_iFlags & 1 && wNext.m_parent.m_iFlags & 1) {
|
||||
g_vguiWidgetCount++;
|
||||
wNext.Input( flEVType, flKey, flChar, flDevID );
|
||||
wNext.Input(flEVType, flKey, flChar, flDevID);
|
||||
}
|
||||
} while ( wNext );
|
||||
} while (wNext);
|
||||
}
|
||||
|
||||
void UISystem_Init ( void )
|
||||
void
|
||||
UISystem_Init(void)
|
||||
{
|
||||
/* we support fancier stuff in non-classic mode */
|
||||
#ifndef CLASSIC_VGUI
|
||||
string strTemp;
|
||||
string strUIFile = "scripts/ui_style.txt";
|
||||
filestream fileUI = fopen( strUIFile, FILE_READ );
|
||||
|
||||
UI_MAINCOLOR = '68 68 68' / 255;
|
||||
filestream fileUI = fopen(strUIFile, FILE_READ);
|
||||
|
||||
UI_MAINCOLOR = [68,68,68] / 255;
|
||||
UI_MAINALPHA = 1.0f;
|
||||
|
||||
if ( fileUI >= 0 ) {
|
||||
while ( ( strTemp = fgets( fileUI ) ) ) {
|
||||
if ( tokenizebyseparator( strTemp, "=" ) == 2 ) {
|
||||
switch ( argv( 0 ) ) {
|
||||
|
||||
if (fileUI >= 0) {
|
||||
while ((strTemp = fgets(fileUI))) {
|
||||
if (tokenizebyseparator(strTemp, "=") == 2) {
|
||||
switch (argv(0)) {
|
||||
case "COLOR":
|
||||
UI_MAINCOLOR = stov( argv( 1 ) ) / 255;
|
||||
UI_MAINCOLOR = stov(argv(1)) / 255;
|
||||
break;
|
||||
case "ALPHA":
|
||||
UI_MAINALPHA = stof( argv( 1 ) ) / 255;
|
||||
UI_MAINALPHA = stof(argv(1)) / 255;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
fclose( fileUI );
|
||||
fclose(fileUI);
|
||||
} else {
|
||||
error( sprintf( "[MENU] Cannot load UI file %s!", strUIFile ) );
|
||||
error(sprintf("[MENU] Cannot load UI file %s!", strUIFile));
|
||||
}
|
||||
#endif
|
||||
Font_Load( "scripts/ui_font.txt", g_fntDefault );
|
||||
precache_pic( "textures/ui/steam/icon_radiosel" );
|
||||
precache_pic( "textures/ui/steam/icon_radiounsel" );
|
||||
precache_pic( "textures/ui/steam/icon_checked" );
|
||||
precache_pic( "textures/ui/steam/icon_emptybox" );
|
||||
precache_pic( "textures/ui/steam/icon_down" );
|
||||
precache_pic( "textures/ui/steam/icon_up" );
|
||||
precache_pic( "textures/ui/steam/icon_close" );
|
||||
|
||||
Font_Load("scripts/ui_font.txt", g_fntDefault);
|
||||
precache_pic("textures/ui/steam/icon_radiosel");
|
||||
precache_pic("textures/ui/steam/icon_radiounsel");
|
||||
precache_pic("textures/ui/steam/icon_checked");
|
||||
precache_pic("textures/ui/steam/icon_emptybox");
|
||||
precache_pic("textures/ui/steam/icon_down");
|
||||
precache_pic("textures/ui/steam/icon_up");
|
||||
precache_pic("textures/ui/steam/icon_close");
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2016-2019 Marco Hladik <marco@icculus.org>
|
||||
* Copyright (c) 2016-2020 Marco Hladik <marco@icculus.org>
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
@ -14,77 +14,6 @@
|
|||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
enumflags
|
||||
{
|
||||
VIEW_VISIBLE
|
||||
};
|
||||
|
||||
class CUI3DView : CUIWidget
|
||||
{
|
||||
vector m_vecSize;
|
||||
vector m_vec3DPos;
|
||||
vector m_vec3DAngles;
|
||||
float m_flFOV;
|
||||
|
||||
void() CUI3DView;
|
||||
virtual void() m_vDrawFunc = 0;
|
||||
virtual void( float, float, float, float ) m_vInputFunc = 0;
|
||||
virtual void() Draw;
|
||||
virtual void( vector ) SetSize;
|
||||
virtual vector() GetSize;
|
||||
virtual void( vector ) Set3DAngles;
|
||||
virtual vector() Get3DAngles;
|
||||
virtual void( vector ) Set3DPos;
|
||||
virtual vector() Get3DPos;
|
||||
virtual void( void() ) SetDrawFunc;
|
||||
virtual void( void(float, float, float, float) ) SetInputFunc;
|
||||
virtual void( float, float, float, float ) Input;
|
||||
};
|
||||
|
||||
void CUI3DView :: CUI3DView ( void )
|
||||
{
|
||||
m_flFOV = 90;
|
||||
m_vecSize = '64 64';
|
||||
m_vec3DPos = m_vec3DAngles = '0 0 0';
|
||||
m_iFlags = VIEW_VISIBLE;
|
||||
}
|
||||
|
||||
void CUI3DView :: SetSize ( vector vecSize )
|
||||
{
|
||||
m_vecSize = vecSize;
|
||||
}
|
||||
vector CUI3DView :: GetSize ( void)
|
||||
{
|
||||
return m_vecSize;
|
||||
}
|
||||
|
||||
void CUI3DView :: Set3DAngles ( vector vecAngles )
|
||||
{
|
||||
m_vec3DAngles = vecAngles;
|
||||
}
|
||||
vector CUI3DView :: Get3DAngles ( void)
|
||||
{
|
||||
return m_vec3DAngles;
|
||||
}
|
||||
|
||||
void CUI3DView :: Set3DPos ( vector vecPos )
|
||||
{
|
||||
m_vec3DPos = vecPos;
|
||||
}
|
||||
vector CUI3DView :: Get3DPos ( void)
|
||||
{
|
||||
return m_vec3DPos;
|
||||
}
|
||||
|
||||
void CUI3DView :: SetDrawFunc ( void() vFunc )
|
||||
{
|
||||
m_vDrawFunc = vFunc;
|
||||
}
|
||||
void CUI3DView :: SetInputFunc ( void(float, float, float, float) vFunc )
|
||||
{
|
||||
m_vInputFunc = vFunc;
|
||||
}
|
||||
|
||||
noref .vector origin;
|
||||
noref .vector angles;
|
||||
noref .vector mins;
|
||||
|
@ -92,23 +21,112 @@ noref .vector maxs;
|
|||
noref .string model;
|
||||
noref .float frame, frame2, lerpfrac, renderflags, frame1time;
|
||||
|
||||
void CUI3DView :: Draw ( void )
|
||||
enumflags
|
||||
{
|
||||
if ( m_vDrawFunc ) {
|
||||
clearscene();
|
||||
setproperty( VF_VIEWPORT, m_vecOrigin + m_parent.m_vecOrigin, m_vecSize );
|
||||
setproperty( VF_AFOV, 90 );
|
||||
setproperty( VF_ORIGIN, m_vec3DPos );
|
||||
setproperty( VF_ANGLES, m_vec3DAngles );
|
||||
//setproperty( VF_PERSPECTIVE, 1 );
|
||||
m_vDrawFunc();
|
||||
renderscene();
|
||||
}
|
||||
VIEW_VISIBLE
|
||||
};
|
||||
|
||||
class CUI3DView:CUIWidget
|
||||
{
|
||||
vector m_vecSize;
|
||||
vector m_vec3DPos;
|
||||
vector m_vec3DAngles;
|
||||
float m_flFOV;
|
||||
|
||||
void() CUI3DView;
|
||||
virtual void() m_vDrawFunc = 0;
|
||||
virtual void(float, float, float, float) m_vInputFunc = 0;
|
||||
virtual void() Draw;
|
||||
virtual vector() GetSize;
|
||||
virtual vector() Get3DPos;
|
||||
virtual vector() Get3DAngles;
|
||||
virtual void(vector) SetSize;
|
||||
virtual void(vector) Set3DPos;
|
||||
virtual void(vector) Set3DAngles;
|
||||
virtual void(void()) SetDrawFunc;
|
||||
virtual void(void(float, float, float, float)) SetInputFunc;
|
||||
virtual void(float, float, float, float) Input;
|
||||
};
|
||||
|
||||
void
|
||||
CUI3DView::CUI3DView(void)
|
||||
{
|
||||
m_flFOV = 90;
|
||||
m_vecSize = [64,64];
|
||||
m_vec3DPos = m_vec3DAngles = [0,0,0];
|
||||
m_iFlags = VIEW_VISIBLE;
|
||||
}
|
||||
|
||||
void CUI3DView :: Input ( float flEVType, float flKey, float flChar, float flDevID )
|
||||
void
|
||||
CUI3DView::SetSize(vector vecSize)
|
||||
{
|
||||
if ( m_vInputFunc ) {
|
||||
m_vInputFunc( flEVType, flKey, flChar, flDevID );
|
||||
}
|
||||
m_vecSize = vecSize;
|
||||
}
|
||||
|
||||
vector
|
||||
CUI3DView::GetSize(void)
|
||||
{
|
||||
return m_vecSize;
|
||||
}
|
||||
|
||||
void
|
||||
CUI3DView::Set3DAngles(vector vecAngles)
|
||||
{
|
||||
m_vec3DAngles = vecAngles;
|
||||
}
|
||||
|
||||
vector
|
||||
CUI3DView::Get3DAngles(void)
|
||||
{
|
||||
return m_vec3DAngles;
|
||||
}
|
||||
|
||||
void
|
||||
CUI3DView::Set3DPos(vector vecPos)
|
||||
{
|
||||
m_vec3DPos = vecPos;
|
||||
}
|
||||
|
||||
vector
|
||||
CUI3DView::Get3DPos(void)
|
||||
{
|
||||
return m_vec3DPos;
|
||||
}
|
||||
|
||||
void
|
||||
CUI3DView::SetDrawFunc(void() vFunc)
|
||||
{
|
||||
m_vDrawFunc = vFunc;
|
||||
}
|
||||
|
||||
void
|
||||
CUI3DView::SetInputFunc(void(float, float, float, float) vFunc)
|
||||
{
|
||||
m_vInputFunc = vFunc;
|
||||
}
|
||||
|
||||
void
|
||||
CUI3DView::Draw(void)
|
||||
{
|
||||
if (!m_vDrawFunc) {
|
||||
return;
|
||||
}
|
||||
|
||||
clearscene();
|
||||
setproperty(VF_VIEWPORT, m_vecOrigin + m_parent.m_vecOrigin, m_vecSize);
|
||||
setproperty(VF_AFOV, 90);
|
||||
setproperty(VF_ORIGIN, m_vec3DPos);
|
||||
setproperty(VF_ANGLES, m_vec3DAngles);
|
||||
m_vDrawFunc();
|
||||
renderscene();
|
||||
}
|
||||
|
||||
void
|
||||
CUI3DView::Input(float flEVType, float flKey, float flChar, float flDevID)
|
||||
{
|
||||
if (!m_vInputFunc) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_vInputFunc(flEVType, flKey, flChar, flDevID);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2016-2019 Marco Hladik <marco@icculus.org>
|
||||
* Copyright (c) 2016-2020 Marco Hladik <marco@icculus.org>
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
@ -22,7 +22,7 @@ enumflags
|
|||
BUTTON_LASTACTIVE
|
||||
};
|
||||
|
||||
class CUIButton : CUIWidget
|
||||
class CUIButton:CUIWidget
|
||||
{
|
||||
vector m_vecColor;
|
||||
float m_flAlpha;
|
||||
|
@ -30,119 +30,138 @@ class CUIButton : CUIWidget
|
|||
string m_strTitle;
|
||||
string m_strTitleActive;
|
||||
string m_strIcon;
|
||||
|
||||
|
||||
void() CUIButton;
|
||||
virtual void() m_vFunc = 0;
|
||||
virtual void() Draw;
|
||||
virtual void( vector ) SetSize;
|
||||
virtual vector() GetSize;
|
||||
virtual int() GetSizeWidth;
|
||||
virtual int() GetSizeHeight;
|
||||
virtual void( string ) SetTitle;
|
||||
virtual void( string ) SetIcon;
|
||||
virtual void( void() ) SetFunc;
|
||||
virtual void( float, float, float, float ) Input;
|
||||
virtual void(vector) SetSize;
|
||||
virtual void(string) SetTitle;
|
||||
virtual void(string) SetIcon;
|
||||
virtual void(void()) SetFunc;
|
||||
virtual void(float, float, float, float) Input;
|
||||
};
|
||||
|
||||
void CUIButton :: CUIButton ( void )
|
||||
void
|
||||
CUIButton::CUIButton(void)
|
||||
{
|
||||
m_vecColor = UI_MAINCOLOR;
|
||||
m_flAlpha = 1.0f;
|
||||
m_vecSize = '96 24';
|
||||
m_vecSize = [96,24];
|
||||
m_iFlags = BUTTON_VISIBLE;
|
||||
}
|
||||
|
||||
void CUIButton :: SetSize ( vector vecSize )
|
||||
void
|
||||
CUIButton::SetSize(vector vecSize)
|
||||
{
|
||||
m_vecSize = vecSize;
|
||||
}
|
||||
vector CUIButton :: GetSize ( void )
|
||||
|
||||
vector
|
||||
CUIButton::GetSize(void)
|
||||
{
|
||||
return m_vecSize;
|
||||
}
|
||||
int CUIButton :: GetSizeWidth ( void )
|
||||
|
||||
int
|
||||
CUIButton::GetSizeWidth(void)
|
||||
{
|
||||
return m_vecSize[0];
|
||||
}
|
||||
int CUIButton :: GetSizeHeight ( void )
|
||||
|
||||
int
|
||||
CUIButton::GetSizeHeight(void)
|
||||
{
|
||||
return m_vecSize[1];
|
||||
}
|
||||
|
||||
void CUIButton :: SetTitle ( string strName )
|
||||
void
|
||||
CUIButton::SetTitle(string strName)
|
||||
{
|
||||
vector newsize;
|
||||
int scale;
|
||||
|
||||
m_strTitle = strName;
|
||||
m_strTitleActive = sprintf( "^3%s", m_strTitle );
|
||||
m_strTitleActive = sprintf("^3%s", m_strTitle);
|
||||
drawfont = g_fntDefault.iID;
|
||||
SetSize( [ stringwidth( m_strTitle, TRUE, [ g_fntDefault.iScale, g_fntDefault.iScale ] ) + 16, 24 ] );
|
||||
|
||||
scale = g_fntDefault.iScale;
|
||||
newsize[0] = stringwidth(m_strTitle, TRUE, [scale, scale]) + 16;
|
||||
newsize[1] = 24;
|
||||
SetSize(newsize);
|
||||
}
|
||||
void CUIButton :: SetIcon ( string strName )
|
||||
void
|
||||
CUIButton::SetIcon(string strName)
|
||||
{
|
||||
m_strIcon = strName;
|
||||
}
|
||||
void CUIButton :: SetFunc ( void() vFunc )
|
||||
void
|
||||
CUIButton::SetFunc(void() vFunc)
|
||||
{
|
||||
m_vFunc = vFunc;
|
||||
}
|
||||
|
||||
void CUIButton :: Draw ( void )
|
||||
void
|
||||
CUIButton::Draw(void)
|
||||
{
|
||||
|
||||
#ifndef CLASSIC_VGUI
|
||||
drawfill( m_parent.m_vecOrigin + m_vecOrigin, m_vecSize, m_vecColor, m_flAlpha );
|
||||
drawfill(m_parent.m_vecOrigin + m_vecOrigin, m_vecSize, m_vecColor, m_flAlpha);
|
||||
|
||||
if ( m_iFlags & BUTTON_DOWN ) {
|
||||
drawfill( m_parent.m_vecOrigin + m_vecOrigin + [ 0, m_vecSize[1] - 1], [m_vecSize[0], 1], '1 1 1', 0.5f );
|
||||
drawfill( m_parent.m_vecOrigin + m_vecOrigin, [m_vecSize[0], 1], '0 0 0', 0.5f );
|
||||
drawfill( m_parent.m_vecOrigin + m_vecOrigin + [ 0, 1], [1, m_vecSize[1] - 2], '0 0 0', 0.5f );
|
||||
drawfill( m_parent.m_vecOrigin + m_vecOrigin + [ m_vecSize[0] - 1, 1], [1, m_vecSize[1] - 2], '1 1 1', 0.5f );
|
||||
if (m_iFlags & BUTTON_DOWN) {
|
||||
drawfill(m_parent.m_vecOrigin + m_vecOrigin + [0, m_vecSize[1] - 1], [m_vecSize[0], 1], [1,1,1], 0.5f);
|
||||
drawfill(m_parent.m_vecOrigin + m_vecOrigin, [m_vecSize[0], 1], [0,0,0], 0.5f);
|
||||
drawfill(m_parent.m_vecOrigin + m_vecOrigin + [0, 1], [1, m_vecSize[1] - 2], [0,0,0], 0.5f);
|
||||
drawfill(m_parent.m_vecOrigin + m_vecOrigin + [m_vecSize[0] - 1, 1], [1, m_vecSize[1] - 2], [1,1,1], 0.5f);
|
||||
} else {
|
||||
drawfill( m_parent.m_vecOrigin + m_vecOrigin + [ 0, m_vecSize[1] - 1], [m_vecSize[0], 1], '0 0 0', 0.5f );
|
||||
drawfill( m_parent.m_vecOrigin + m_vecOrigin, [m_vecSize[0], 1], '1 1 1', 0.5f );
|
||||
drawfill( m_parent.m_vecOrigin + m_vecOrigin + [ 0, 1], [1, m_vecSize[1] - 2], '1 1 1', 0.5f );
|
||||
drawfill( m_parent.m_vecOrigin + m_vecOrigin + [ m_vecSize[0] - 1, 1], [1, m_vecSize[1] - 2], '0 0 0', 0.5f );
|
||||
drawfill(m_parent.m_vecOrigin + m_vecOrigin + [0, m_vecSize[1] - 1], [m_vecSize[0], 1], [0,0,0], 0.5f);
|
||||
drawfill(m_parent.m_vecOrigin + m_vecOrigin, [m_vecSize[0], 1], [1,1,1], 0.5f);
|
||||
drawfill(m_parent.m_vecOrigin + m_vecOrigin + [0, 1], [1, m_vecSize[1] - 2], [1,1,1], 0.5f);
|
||||
drawfill(m_parent.m_vecOrigin + m_vecOrigin + [m_vecSize[0] - 1, 1], [1, m_vecSize[1] - 2], [0,0,0], 0.5f);
|
||||
}
|
||||
#else
|
||||
if ( m_iFlags & BUTTON_DOWN ) {
|
||||
drawfill( m_parent.m_vecOrigin + m_vecOrigin, m_vecSize, m_vecColor, 0.25f );
|
||||
if (m_iFlags & BUTTON_DOWN) {
|
||||
drawfill(m_parent.m_vecOrigin + m_vecOrigin, m_vecSize, m_vecColor, 0.25f);
|
||||
}
|
||||
drawfill( m_parent.m_vecOrigin + m_vecOrigin + [ 0, m_vecSize[1] - 1], [m_vecSize[0], 1], m_vecColor, 1.0f );
|
||||
drawfill( m_parent.m_vecOrigin + m_vecOrigin, [m_vecSize[0], 1], m_vecColor, 1.0f );
|
||||
drawfill( m_parent.m_vecOrigin + m_vecOrigin + [ 0, 1], [1, m_vecSize[1] - 2], m_vecColor, 1.0f );
|
||||
drawfill( m_parent.m_vecOrigin + m_vecOrigin + [ m_vecSize[0] - 1, 1], [1, m_vecSize[1] - 2], m_vecColor, 1.0f );
|
||||
drawfill(m_parent.m_vecOrigin + m_vecOrigin + [0, m_vecSize[1] - 1], [m_vecSize[0], 1], m_vecColor, 1.0f);
|
||||
drawfill(m_parent.m_vecOrigin + m_vecOrigin, [m_vecSize[0], 1], m_vecColor, 1.0f);
|
||||
drawfill(m_parent.m_vecOrigin + m_vecOrigin + [0, 1], [1, m_vecSize[1] - 2], m_vecColor, 1.0f);
|
||||
drawfill(m_parent.m_vecOrigin + m_vecOrigin + [m_vecSize[0] - 1, 1], [1, m_vecSize[1] - 2], m_vecColor, 1.0f);
|
||||
#endif
|
||||
|
||||
if ( m_strTitle ) {
|
||||
if ( m_iFlags & BUTTON_LASTACTIVE ) {
|
||||
Font_DrawText( m_parent.m_vecOrigin + m_vecOrigin + [ 8, 8 ], m_strTitleActive, g_fntDefault );
|
||||
if (m_strTitle) {
|
||||
if (m_iFlags & BUTTON_LASTACTIVE) {
|
||||
Font_DrawText(m_parent.m_vecOrigin + m_vecOrigin + [8, 8], m_strTitleActive, g_fntDefault);
|
||||
} else {
|
||||
Font_DrawText( m_parent.m_vecOrigin + m_vecOrigin + [ 8, 8 ], m_strTitle, g_fntDefault );
|
||||
Font_DrawText(m_parent.m_vecOrigin + m_vecOrigin + [8, 8], m_strTitle, g_fntDefault);
|
||||
}
|
||||
}
|
||||
if ( m_strIcon ) {
|
||||
drawpic( m_parent.m_vecOrigin + m_vecOrigin + '2 2', m_strIcon, '16 16', '1 1 1', 1.0f, 0);
|
||||
if (m_strIcon) {
|
||||
drawpic(m_parent.m_vecOrigin + m_vecOrigin + [2,2], m_strIcon, [16,16], [1,1,1], 1.0f, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void CUIButton :: Input ( float flEVType, float flKey, float flChar, float flDevID )
|
||||
void
|
||||
CUIButton::Input(float flEVType, float flKey, float flChar, float flDevID)
|
||||
{
|
||||
if ( flEVType == IE_KEYDOWN ) {
|
||||
if ( flKey == K_MOUSE1 ) {
|
||||
FlagRemove( BUTTON_LASTACTIVE );
|
||||
if ( Util_MouseAbove( getmousepos(), m_parent.m_vecOrigin + m_vecOrigin, m_vecSize ) ) {
|
||||
//m_iFlags |= BUTTON_DOWN;
|
||||
FlagAdd( BUTTON_DOWN );
|
||||
FlagAdd( BUTTON_LASTACTIVE );
|
||||
if (flEVType == IE_KEYDOWN) {
|
||||
if (flKey == K_MOUSE1) {
|
||||
FlagRemove(BUTTON_LASTACTIVE);
|
||||
if (Util_MouseAbove(getmousepos(), m_parent.m_vecOrigin + m_vecOrigin, m_vecSize)) {
|
||||
FlagAdd(BUTTON_DOWN);
|
||||
FlagAdd(BUTTON_LASTACTIVE);
|
||||
}
|
||||
}
|
||||
} else if ( flEVType == IE_KEYUP ) {
|
||||
if ( flKey == K_MOUSE1 ) {
|
||||
if ( m_iFlags & BUTTON_DOWN && Util_MouseAbove( getmousepos(), m_parent.m_vecOrigin + m_vecOrigin, m_vecSize ) ) {
|
||||
if ( m_vFunc ) {
|
||||
} else if (flEVType == IE_KEYUP) {
|
||||
if (flKey == K_MOUSE1) {
|
||||
if (m_iFlags & BUTTON_DOWN && Util_MouseAbove(getmousepos(), m_parent.m_vecOrigin + m_vecOrigin, m_vecSize)) {
|
||||
if (m_vFunc) {
|
||||
m_vFunc();
|
||||
}
|
||||
}
|
||||
FlagRemove( BUTTON_DOWN );
|
||||
FlagRemove(BUTTON_DOWN);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2016-2019 Marco Hladik <marco@icculus.org>
|
||||
* Copyright (c) 2016-2020 Marco Hladik <marco@icculus.org>
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
@ -42,7 +42,7 @@ void CUICheckbox :: CUICheckbox ( void )
|
|||
{
|
||||
m_vecColor = UI_MAINCOLOR;
|
||||
m_flAlpha = 1.0f;
|
||||
m_vecSize = '96 18';
|
||||
m_vecSize = [96,18];
|
||||
m_iFlags = CHECKBOX_VISIBLE;
|
||||
}
|
||||
|
||||
|
@ -77,16 +77,16 @@ void CUICheckbox :: Draw ( void )
|
|||
drawfill( m_parent.m_vecOrigin + m_vecOrigin, m_vecSize, m_vecColor, m_flAlpha );
|
||||
|
||||
if ( m_iFlags & CHECKBOX_DOWN ) {
|
||||
drawfill( m_parent.m_vecOrigin + m_vecOrigin, [m_vecSize[0], 1], '0 0 0', 0.5f );
|
||||
drawfill( m_parent.m_vecOrigin + m_vecOrigin + [ 0, m_vecSize[1] - 1], [m_vecSize[0], 1], '1 1 1', 0.5f );
|
||||
drawfill( m_parent.m_vecOrigin + m_vecOrigin + [ 0, 1], [1, m_vecSize[1] - 2], '0 0 0', 0.5f );
|
||||
drawfill( m_parent.m_vecOrigin + m_vecOrigin + [ m_vecSize[0] - 1, 1], [1, m_vecSize[1] - 2], '1 1 1', 0.5f );
|
||||
drawfill( m_parent.m_vecOrigin + m_vecOrigin, [m_vecSize[0], 1], [0,0,0], 0.5f );
|
||||
drawfill( m_parent.m_vecOrigin + m_vecOrigin + [ 0, m_vecSize[1] - 1], [m_vecSize[0], 1], [1,1,1], 0.5f );
|
||||
drawfill( m_parent.m_vecOrigin + m_vecOrigin + [ 0, 1], [1, m_vecSize[1] - 2], [0,0,0], 0.5f );
|
||||
drawfill( m_parent.m_vecOrigin + m_vecOrigin + [ m_vecSize[0] - 1, 1], [1, m_vecSize[1] - 2], [1,1,1], 0.5f );
|
||||
}
|
||||
|
||||
if ( m_iFlags & CHECKBOX_CHECKED ) {
|
||||
drawpic( m_parent.m_vecOrigin + m_vecOrigin, "textures/ui/steam/icon_checked", '16 16', '1 1 1', 1.0f, 0);
|
||||
drawpic( m_parent.m_vecOrigin + m_vecOrigin, "textures/ui/steam/icon_checked", [16,16], [1,1,1], 1.0f, 0);
|
||||
} else {
|
||||
drawpic( m_parent.m_vecOrigin + m_vecOrigin, "textures/ui/steam/icon_emptybox", '16 16', '1 1 1', 1.0f, 0);
|
||||
drawpic( m_parent.m_vecOrigin + m_vecOrigin, "textures/ui/steam/icon_emptybox", [16,16], [1,1,1], 1.0f, 0);
|
||||
}
|
||||
#else
|
||||
if ( m_iFlags & CHECKBOX_DOWN ) {
|
||||
|
@ -97,9 +97,9 @@ void CUICheckbox :: Draw ( void )
|
|||
}
|
||||
|
||||
if ( m_iFlags & CHECKBOX_CHECKED ) {
|
||||
drawpic( m_parent.m_vecOrigin + m_vecOrigin, "textures/ui/steam/icon_checked", '16 16', m_vecColor, 1.0f, 0);
|
||||
drawpic( m_parent.m_vecOrigin + m_vecOrigin, "textures/ui/steam/icon_checked", [16,16], m_vecColor, 1.0f, 0);
|
||||
} else {
|
||||
drawpic( m_parent.m_vecOrigin + m_vecOrigin, "textures/ui/steam/icon_emptybox", '16 16', m_vecColor, 1.0f, 0);
|
||||
drawpic( m_parent.m_vecOrigin + m_vecOrigin, "textures/ui/steam/icon_emptybox", [16,16], m_vecColor, 1.0f, 0);
|
||||
}
|
||||
#endif
|
||||
if ( m_strTitle ) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2016-2019 Marco Hladik <marco@icculus.org>
|
||||
* Copyright (c) 2016-2020 Marco Hladik <marco@icculus.org>
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
@ -28,7 +28,7 @@ class CUILabel : CUIWidget
|
|||
|
||||
void CUILabel :: CUILabel ( void )
|
||||
{
|
||||
m_vecSize = '96 16';
|
||||
m_vecSize = [96,16];
|
||||
m_iFlags = BUTTON_VISIBLE;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2016-2019 Marco Hladik <marco@icculus.org>
|
||||
* Copyright (c) 2016-2020 Marco Hladik <marco@icculus.org>
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
@ -49,7 +49,7 @@ class CUIList : CUIWidget
|
|||
|
||||
void CUIList :: CUIList ( void )
|
||||
{
|
||||
m_vecSize = '96 16';
|
||||
m_vecSize = [96,16];
|
||||
m_iFlags = 1;
|
||||
m_iSelected = -1;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2016-2019 Marco Hladik <marco@icculus.org>
|
||||
* Copyright (c) 2016-2020 Marco Hladik <marco@icculus.org>
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
@ -36,7 +36,7 @@ class CUIListBox : CUIWidget
|
|||
|
||||
void CUIListBox :: CUIListBox ( void )
|
||||
{
|
||||
m_vecSize = '96 16';
|
||||
m_vecSize = [96,16];
|
||||
m_iFlags = 1;
|
||||
m_iSelected = -1;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2016-2019 Marco Hladik <marco@icculus.org>
|
||||
* Copyright (c) 2016-2020 Marco Hladik <marco@icculus.org>
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
@ -47,7 +47,7 @@ void CUIMenuButton :: CUIMenuButton ( void )
|
|||
{
|
||||
m_vecColor = UI_MAINCOLOR;
|
||||
m_flAlpha = 1.0f;
|
||||
m_vecSize = '96 24';
|
||||
m_vecSize = [96,24];
|
||||
m_iFlags = MBUTTON_VISIBLE | MBUTTON_SHOWOFFLINE | MBUTTON_SHOWSP | MBUTTON_SHOWMP;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2016-2019 Marco Hladik <marco@icculus.org>
|
||||
* Copyright (c) 2016-2020 Marco Hladik <marco@icculus.org>
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
@ -38,7 +38,7 @@ class CUIPic : CUIWidget
|
|||
|
||||
void CUIPic :: CUIPic ( void )
|
||||
{
|
||||
m_vecSize = '16 16';
|
||||
m_vecSize = [16,16];
|
||||
m_iFlags = IMAGE_VISIBLE;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2016-2019 Marco Hladik <marco@icculus.org>
|
||||
* Copyright (c) 2016-2020 Marco Hladik <marco@icculus.org>
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
@ -44,7 +44,7 @@ void CUIRadio :: CUIRadio ( void )
|
|||
{
|
||||
m_vecColor = UI_MAINCOLOR;
|
||||
m_flAlpha = 1.0f;
|
||||
m_vecSize = '96 24';
|
||||
m_vecSize = [96,24];
|
||||
m_iFlags = RADIO_VISIBLE;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2016-2019 Marco Hladik <marco@icculus.org>
|
||||
* Copyright (c) 2016-2020 Marco Hladik <marco@icculus.org>
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2016-2019 Marco Hladik <marco@icculus.org>
|
||||
* Copyright (c) 2016-2020 Marco Hladik <marco@icculus.org>
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
@ -38,7 +38,7 @@ void CUISlider :: CUISlider ( void )
|
|||
{
|
||||
m_vecColor = '76 88 68' / 255;
|
||||
m_flAlpha = 1.0f;
|
||||
m_vecSize = '96 24';
|
||||
m_vecSize = [96,24];
|
||||
m_iFlags = BUTTON_VISIBLE;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2016-2019 Marco Hladik <marco@icculus.org>
|
||||
* Copyright (c) 2016-2020 Marco Hladik <marco@icculus.org>
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
@ -33,7 +33,7 @@ class CUITabView : CUIWidget
|
|||
|
||||
void CUITabView :: CUITabView ( void )
|
||||
{
|
||||
m_vecSize = '96 16';
|
||||
m_vecSize = [96,16];
|
||||
m_iFlags = BUTTON_VISIBLE;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2016-2019 Marco Hladik <marco@icculus.org>
|
||||
* Copyright (c) 2016-2020 Marco Hladik <marco@icculus.org>
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
@ -42,7 +42,7 @@ void CUITextBox :: CUITextBox ( void )
|
|||
{
|
||||
m_vecColor = UI_MAINCOLOR;
|
||||
m_flAlpha = 1.0f;
|
||||
m_vecSize = '96 24';
|
||||
m_vecSize = [96,24];
|
||||
m_iFlags = BUTTON_VISIBLE;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2016-2019 Marco Hladik <marco@icculus.org>
|
||||
* Copyright (c) 2016-2020 Marco Hladik <marco@icculus.org>
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
@ -73,7 +73,7 @@ void CUIWindow :: CUIWindow ( void )
|
|||
m_vecColor = UI_MAINCOLOR;
|
||||
m_flAlpha = 1.0f;
|
||||
|
||||
m_vecMinSize = '64 64';
|
||||
m_vecMinSize = [64,64];
|
||||
m_vecMaxSize = '640 480'; // TODO: Make this the screen res
|
||||
|
||||
m_strTitle = "Window";
|
||||
|
|
Loading…
Reference in a new issue