]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/items/item/armor.qh
Add proper health / armor icons (used by the ItemStats and ItemsTime panels)
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / items / item / armor.qh
index e5ae8e36bd3bd1860080dc39f05f1c0552dc8190..f8cabaa0595f08bacfde5fbf9b14c5ffae0654d4 100644 (file)
@@ -40,7 +40,11 @@ REGISTER_ITEM(ArmorSmall, Armor) {
 #endif
     this.netname                =   "armor_small";
     this.m_name                 =   _("Small armor");
-    this.m_icon                 =   "armor";
+    this.m_icon                 =   "armor_small";
+#ifdef CSQC
+    if(precache_pic(strcat("gfx/hud/luma/", this.m_icon)) == "")
+       this.m_icon             =   "armor"; // compatible with Xonotic v0.8.2 or lower
+#endif
 #ifdef SVQC
     this.m_itemid               =   IT_RESOURCE;
     this.m_respawntime          =   GET(g_pickup_respawntime_short);
@@ -78,7 +82,11 @@ REGISTER_ITEM(ArmorMedium, Armor) {
 #endif
     this.netname                =   "armor_medium";
     this.m_name                 =   _("Medium armor");
-    this.m_icon                 =   "armor";
+    this.m_icon                 =   "armor_medium";
+#ifdef CSQC
+    if(precache_pic(strcat("gfx/hud/luma/", this.m_icon)) == "")
+       this.m_icon             =   "armor"; // compatible with Xonotic v0.8.2 or lower
+#endif
 #ifdef SVQC
     this.m_itemid               =   IT_RESOURCE;
     this.m_respawntime          =   GET(g_pickup_respawntime_medium);
@@ -116,7 +124,11 @@ REGISTER_ITEM(ArmorBig, Armor) {
 #endif
     this.netname                =   "armor_big";
     this.m_name                 =   _("Big armor");
-    this.m_icon                 =   "armor";
+    this.m_icon                 =   "armor_big";
+#ifdef CSQC
+    if(precache_pic(strcat("gfx/hud/luma/", this.m_icon)) == "")
+       this.m_icon             =   "armor"; // compatible with Xonotic v0.8.2 or lower
+#endif
     this.m_color                =   '0 1 0';
     this.m_waypoint             =   _("Big armor");
 #ifdef SVQC
@@ -156,7 +168,11 @@ REGISTER_ITEM(ArmorMega, Armor) {
 #endif
     this.netname                =   "armor_mega";
     this.m_name                 =   _("Mega armor");
-    this.m_icon                 =   "item_large_armor";
+    this.m_icon                 =   "armor_mega";
+#ifdef CSQC
+    if(precache_pic(strcat("gfx/hud/luma/", this.m_icon)) == "")
+       this.m_icon             =   "item_large_armor"; // compatible with Xonotic v0.8.2 or lower
+#endif
     this.m_color                =   '0 1 0';
     this.m_waypoint             =   _("Mega armor");
     this.m_waypointblink        =   2;