r4323 - in trunk/data/qcsrc: client server
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Wed Sep 3 15:29:22 EDT 2008
Author: div0
Date: 2008-09-03 15:29:22 -0400 (Wed, 03 Sep 2008)
New Revision: 4323
Modified:
trunk/data/qcsrc/client/sbar.qc
trunk/data/qcsrc/server/cl_weapons.qc
trunk/data/qcsrc/server/w_minstanex.qc
Log:
fix sbar_hudselector 0 HUD
Modified: trunk/data/qcsrc/client/sbar.qc
===================================================================
--- trunk/data/qcsrc/client/sbar.qc 2008-09-03 19:18:48 UTC (rev 4322)
+++ trunk/data/qcsrc/client/sbar.qc 2008-09-03 19:29:22 UTC (rev 4323)
@@ -28,11 +28,23 @@
}
float weaponspace[10];
+float weapon_first, weapon_last;
void Sbar_DrawWeapon_Clear()
{
float idx;
+ weapon_first = -2;
+ weapon_last = -1;
for(idx = 0; idx < 10; ++idx)
weaponspace[idx] = 0;
+ for(idx = 0; idx <= 23; ++idx)
+ {
+ if(weaponimpulse[idx] >= 0)
+ {
+ if(weapon_first < 0)
+ weapon_first = idx;
+ weapon_last = idx;
+ }
+ }
}
void Sbar_DrawWeapon(float nr, float fade, float active)
{
@@ -76,11 +88,14 @@
const float w2_width = 300, w2_height = 100, w2_space = 10;
const float w2_scale = 0.4;
- pos_x = vid_conwidth - (w2_width + w2_space) * w2_scale;
- pos_y = (w2_height + w2_space) * w2_scale * nr + w2_space;
+ float f;
+ f = 9 / (weapon_last + 1 - weapon_first);
+
+ pos_x = vid_conwidth - (w2_width + w2_space) * w2_scale * f;
+ pos_y = (w2_height + w2_space) * w2_scale * nr * f + w2_space;
pos_z = 0;
- vsize_x = w2_width * w2_scale;
- vsize_y = w2_height * w2_scale;
+ vsize_x = w2_width * w2_scale * f;
+ vsize_y = w2_height * w2_scale * f;
vsize_z = 0;
drawpic(pos, strcat("gfx/inv_weapon", ftos(nr)), vsize, color, value * fade * sbar_alpha_fg, 0);
@@ -1505,7 +1520,7 @@
{
stat_items = getstati(STAT_ITEMS);
- stat_weapons = getstati(STAT_ITEMS);
+ stat_weapons = getstati(STAT_WEAPONS);
sbar_x = (vid_conwidth - 640.0)*0.5;
sbar_y = vid_conheight - 47;
@@ -1515,7 +1530,7 @@
x = 1.0;
Sbar_DrawWeapon_Clear();
- for(i = WEP_FIRST; i <= WEP_LAST; ++i)
+ for(i = 1; i <= 24; ++i)
{
if(weaponimpulse[i-1] >= 0)
if(stat_weapons & x)
Modified: trunk/data/qcsrc/server/cl_weapons.qc
===================================================================
--- trunk/data/qcsrc/server/cl_weapons.qc 2008-09-03 19:18:48 UTC (rev 4322)
+++ trunk/data/qcsrc/server/cl_weapons.qc 2008-09-03 19:29:22 UTC (rev 4323)
@@ -450,6 +450,7 @@
void RegisterWeapons()
{
+ register_dummy_weapon();
// %weaponaddpoint
register_weapon(WEP_LASER, w_laser, 0, 1, 1, "laser", "laser", "Laser");
register_weapon(WEP_SHOTGUN, w_shotgun, IT_SHELLS, 2, 1, "shotgun", "shotgun", "Shotgun");
Modified: trunk/data/qcsrc/server/w_minstanex.qc
===================================================================
--- trunk/data/qcsrc/server/w_minstanex.qc 2008-09-03 19:18:48 UTC (rev 4322)
+++ trunk/data/qcsrc/server/w_minstanex.qc 2008-09-03 19:29:22 UTC (rev 4323)
@@ -139,9 +139,9 @@
else if (req == WR_PRECACHE)
{
precache_model ("models/nexflash.md3");
- precache_model ("models/weapons/g_nex.md3");
- precache_model ("models/weapons/v_nex.md3");
- precache_model ("models/weapons/w_nex.zym");
+ precache_model ("models/weapons/g_minstanex.md3");
+ precache_model ("models/weapons/v_minstanex.md3");
+ precache_model ("models/weapons/w_minstanex.zym");
precache_sound ("weapons/nexfire.wav");
precache_sound ("weapons/neximpact.wav");
w_laser(WR_PRECACHE);
More information about the nexuiz-commits
mailing list