]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
why do i store the edict when i call this function every frame anyway... stupid ...
authorFruitieX <fruitiex@gmail.com>
Wed, 13 Apr 2011 07:37:01 +0000 (10:37 +0300)
committerFruitieX <fruitiex@gmail.com>
Wed, 13 Apr 2011 07:37:01 +0000 (10:37 +0300)
defaultXonotic.cfg
hud_luminos.cfg
qcsrc/client/hud.qc
qcsrc/client/hud.qh
qcsrc/server/cl_player.qc

index c7cd0d032a88ea6a664a4ca983a60d9b9bc4491f..3de99c2fc54a22f2d0b77a59cbd2f34467c5423d 100644 (file)
@@ -1486,6 +1486,10 @@ seta hud_contents_slime_color "0 0.4 0.1"
 seta hud_contents_water_alpha 0.5 "alpha of the water color blend when inside it"
 seta hud_contents_water_color "0.4 0.3 0.3"
 
+seta hud_shownames 1 "draw names and health/armor of nearby players"
+seta hud_shownames_enemies 1 "also draw names of enemies"
+seta hud_shownames_status 1 "draw health/armor status of teammates"
+
 // scoreboard
 seta scoreboard_columns default
 seta scoreboard_border_thickness 1 "scoreboard border thickness"
index de45c860930a06e6d3342157f549e8c82aee8f4f..7196d32c892a38c298f8f0bda1b98fc53234e66f 100644 (file)
@@ -233,14 +233,4 @@ seta hud_panel_physics_acceleration_progressbar_mode "0"
 seta hud_panel_physics_progressbar "1"
 seta hud_panel_physics_text "1"
 
-seta hud_panel_shownames 1
-seta hud_panel_shownames_pos "0.350000 0.700000"
-seta hud_panel_shownames_size "0.300000 0.050000"
-seta hud_panel_shownames_bg "0"
-seta hud_panel_shownames_bg_color ""
-seta hud_panel_shownames_bg_color_team ""
-seta hud_panel_shownames_bg_alpha ""
-seta hud_panel_shownames_bg_border ""
-seta hud_panel_shownames_bg_padding "0"
-
 menu_sync
index e918469416f3c6e2b6dfff38365a3f147bbbec71..29a3af193852c675251c11147b1a7b8a8af9ebee 100644 (file)
@@ -4208,88 +4208,7 @@ void HUD_InfoMessages(void)
        }
 }
 
-// ShowNames (#15)
-//
-float shownames_alpha;
-void HUD_ShowNames(void)
-{
-    if(shownames_time < time && shownames_alpha == 0 && !autocvar__hud_configure)
-        return;
-
-    if(autocvar__hud_configure)
-    {
-        shownames_alpha = 1;
-    }
-    else
-    {
-        if(shownames_time < time)
-            shownames_alpha = bound(0, shownames_alpha - 2 * frametime, 1);
-        else
-            shownames_alpha = bound(0, shownames_alpha + 4 * frametime, 1);
-    }
-
-       if(!autocvar_hud_panel_shownames && !autocvar__hud_configure)
-               return;
-
-       hud_configure_active_panel = HUD_PANEL_SHOWNAMES;
-       HUD_Panel_UpdateCvars(shownames);
-    panel_fg_alpha *= shownames_alpha;
-       vector myPos, mySize;
-       myPos = panel_pos;
-       mySize = panel_size;
-
-       HUD_Panel_DrawBg(shownames_alpha);
-       if(panel_bg_padding)
-       {
-               myPos += '1 1 0' * panel_bg_padding;
-               mySize -= '2 2 0' * panel_bg_padding;
-       }
-
-    vector iconpos, iconsize;
-    vector namepos, namesize;
-    if(mySize_x/mySize_y > 6)
-    {
-        iconpos = myPos;
-        iconsize = eX * 2 * mySize_y + eY * mySize_y;
-
-        namepos = myPos + eX * 2 * mySize_y;
-        namesize = eX * mySize_x - eX * 2 * mySize_y + eY * mySize_y;
-    }
-    else
-    {
-        iconpos = myPos + eX * 0.5 * mySize_x - eX * 0.5 * mySize_y;
-        iconsize = eX * mySize_y + eY * 0.5 * mySize_y;
-
-        namepos = myPos + eY * 0.5 * mySize_y;
-        namesize = eX * mySize_x + eY * 0.5 * mySize_y;
-    }
-
-    if(shownames_health > 0) // otherwise player is an enemy
-    {
-        // "ghost" backgrounds
-        drawpic_aspect_skin(iconpos, "health", '1 1 0' * iconsize_y, '0 0 0', panel_fg_alpha * 0.5, DRAWFLAG_NORMAL);
-        drawpic_aspect_skin(iconpos + '0.5 0 0' * iconsize_x, "armor", '1 1 0' * iconsize_y, '0 0 0', panel_fg_alpha * 0.5, DRAWFLAG_NORMAL);
-
-        drawsetcliparea(0, myPos_y + iconsize_y - iconsize_y * min(1, shownames_health/autocvar_hud_panel_healtharmor_maxhealth), vid_conwidth, myPos_y + iconsize_y);
-        drawpic_aspect_skin(iconpos, "health", '1 1 0' * iconsize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-
-        drawsetcliparea(0, myPos_y + iconsize_y - iconsize_y * min(1, shownames_armor/autocvar_hud_panel_healtharmor_maxarmor), vid_conwidth, myPos_y + iconsize_y);
-        drawpic_aspect_skin(iconpos + '0.5 0 0' * iconsize_x, "armor", '1 1 0' * iconsize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-        drawresetcliparea();
-    }
-    else
-    {
-        drawpic_aspect_skin(iconpos, "health_unknown", '1 1 0' * iconsize_y, '0 0 0', panel_fg_alpha, DRAWFLAG_NORMAL);
-        drawpic_aspect_skin(iconpos + '0.5 0 0' * iconsize_x, "armor_unknown", '1 1 0' * iconsize_y, '0 0 0', panel_fg_alpha, DRAWFLAG_NORMAL);
-    }
-
-    if(autocvar__hud_configure)
-        drawcolorcodedstring_aspect(namepos, "Player1234", namesize, panel_fg_alpha, DRAWFLAG_NORMAL);
-    else
-        drawcolorcodedstring_aspect(namepos, shownames_netname, namesize, panel_fg_alpha, DRAWFLAG_NORMAL);
-}
-
-// Physics panel (#16)
+// Physics panel (#15)
 //
 vector acc_prevspeed;
 float acc_prevtime, acc_avg, top_speed, top_speed_time;
@@ -4563,8 +4482,6 @@ switch (id) {\
                 HUD_InfoMessages(); break;\
        case (HUD_PANEL_PHYSICS):\
                 HUD_Physics(); break;\
-       case (HUD_PANEL_SHOWNAMES):\
-                HUD_ShowNames(); break;\
 } ENDS_WITH_CURLY_BRACE
 
 void HUD_Main (void)
index 0f9c8bb44c730caab766b2e06621b47a6358a675..d2fbfebef2603ca71bc6ee2fc470cfbc47076f44 100644 (file)
@@ -283,7 +283,6 @@ if(menu_enabled == 2 && hud_configure_active_panel == highlightedPanel) {\
 switch(id) { \
        case HUD_PANEL_INFOMESSAGES: HUD_Panel_UpdateCvars(infomessages) break; \
        case HUD_PANEL_PHYSICS: HUD_Panel_UpdateCvars(physics); break;\
-       case HUD_PANEL_SHOWNAMES: HUD_Panel_UpdateCvars(shownames) break; \
 }
 
 #define HUD_Panel_UpdateCvarsForId(id) \
@@ -321,7 +320,6 @@ HUD_Panel_GetBorder()
 switch(id) { \
        case HUD_PANEL_INFOMESSAGES: HUD_Panel_UpdatePosSize(infomessages) break;\
        case HUD_PANEL_PHYSICS: HUD_Panel_UpdatePosSize(physics); break;\
-       case HUD_PANEL_SHOWNAMES: HUD_Panel_UpdatePosSize(shownames)\
 }
 
 #define HUD_Panel_UpdatePosSizeForId(id) \
index 5f0a08ef78eeddd1d590103222942f86f7b36cbf..0f5db8b65d88b4a25315732e6d96c8013d655ed1 100644 (file)
@@ -732,7 +732,6 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
        }
 }
 
-.float the_entnum;
 // sendflags use: 1 = origin, 2 = health/armor, 0x80 = same team (includes health)
 float SendEntity_ShowNames(entity to, float sendflags)
 {
@@ -746,7 +745,7 @@ float SendEntity_ShowNames(entity to, float sendflags)
     else
         sendflags &~= 2;
     WriteByte(MSG_ENTITY, sendflags);
-    WriteByte(MSG_ENTITY, self.the_entnum);
+    WriteByte(MSG_ENTITY, num_for_edict(self.owner));
     if(sendflags & 1)
     {
         WriteShort(MSG_ENTITY, rint(self.origin_x));
@@ -774,10 +773,6 @@ void shownames_think()
         self.armorvalue = floor(self.owner.armorvalue);
         self.SendFlags |= 2;
     }
-    if(self.the_entnum != num_for_edict(self.owner))
-    {
-        self.the_entnum = num_for_edict(self.owner);
-    }
     self.nextthink = time;
 }