From f295069112573d9b9e2ae4439d825c870f3a9dd5 Mon Sep 17 00:00:00 2001 From: otta8634 Date: Tue, 28 Jan 2025 21:39:33 +0800 Subject: [PATCH] Use hud_skin when fetching images from /gfx/hud/ Previously some display methods (of Weapon, GameItem, StatusEffects, and Nades) tried to access `/gfx/hud/{menu_skin}`, when they should be accessing `/gfx/hud/{hud_skin}`. This was introduced by 51c7e0a875. Until !1412 this didn't cause any visible bugs because the display methods were never called, and consequently (after !1412) on menu skins other than `luma`, some or all weapon icons wouldn't show in the list. This change fixes that issue. --- qcsrc/common/items/item.qh | 2 +- qcsrc/common/mutators/mutator/buffs/buffs.qh | 2 +- qcsrc/common/mutators/mutator/nades/nades.qh | 2 +- qcsrc/common/mutators/mutator/status_effects/all.qh | 2 +- qcsrc/common/weapons/weapon.qh | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/qcsrc/common/items/item.qh b/qcsrc/common/items/item.qh index 1b29d71bd..fb8ea45a2 100644 --- a/qcsrc/common/items/item.qh +++ b/qcsrc/common/items/item.qh @@ -135,7 +135,7 @@ CLASS(GameItem, Object) METHOD(GameItem, display, void(GameItem this, void(string name, string icon) returns)) { TC(GameItem, this); - returns(this.m_name, this.m_icon ? sprintf("/gfx/hud/%s/%s", cvar_string("menu_skin"), this.m_icon) : string_null); + returns(this.m_name, this.m_icon ? sprintf("/gfx/hud/%s/%s", cvar_string("hud_skin"), this.m_icon) : string_null); } METHOD(GameItem, show, void(GameItem this)) { diff --git a/qcsrc/common/mutators/mutator/buffs/buffs.qh b/qcsrc/common/mutators/mutator/buffs/buffs.qh index c4580212e..b936cac65 100644 --- a/qcsrc/common/mutators/mutator/buffs/buffs.qh +++ b/qcsrc/common/mutators/mutator/buffs/buffs.qh @@ -23,7 +23,7 @@ CLASS(Buff, StatusEffect) ATTRIB(Buff, m_lifetime, float, 60); ATTRIB(Buff, m_sprite, string, ""); METHOD(Buff, display, void(entity this, void(string name, string icon) returns)) { - returns(this.m_name, sprintf("/gfx/hud/%s/%s", cvar_string("menu_skin"), this.m_icon)); + returns(this.m_name, sprintf("/gfx/hud/%s/%s", cvar_string("hud_skin"), this.m_icon)); } #ifdef SVQC METHOD(Buff, m_time, float(Buff this)) diff --git a/qcsrc/common/mutators/mutator/nades/nades.qh b/qcsrc/common/mutators/mutator/nades/nades.qh index b328d2ed7..456fb608a 100644 --- a/qcsrc/common/mutators/mutator/nades/nades.qh +++ b/qcsrc/common/mutators/mutator/nades/nades.qh @@ -17,7 +17,7 @@ CLASS(Nade, Object) ATTRIBARRAY(Nade, m_projectile, int, 2); ATTRIBARRAY(Nade, m_trail, entity, 2); METHOD(Nade, display, void(entity this, void(string name, string icon) returns)) { - returns(this.m_name, sprintf("/gfx/hud/%s/%s", cvar_string("menu_skin"), this.m_icon)); + returns(this.m_name, sprintf("/gfx/hud/%s/%s", cvar_string("hud_skin"), this.m_icon)); } ENDCLASS(Nade) diff --git a/qcsrc/common/mutators/mutator/status_effects/all.qh b/qcsrc/common/mutators/mutator/status_effects/all.qh index 05ab15776..b2f8ec4e5 100644 --- a/qcsrc/common/mutators/mutator/status_effects/all.qh +++ b/qcsrc/common/mutators/mutator/status_effects/all.qh @@ -54,6 +54,6 @@ CLASS(StatusEffect, Object) METHOD(StatusEffect, display, void(StatusEffect this, void(string name, string icon) returns)) { TC(StatusEffect, this); - returns(this.m_name, this.m_icon ? sprintf("/gfx/hud/%s/%s", cvar_string("menu_skin"), this.m_icon) : string_null); + returns(this.m_name, this.m_icon ? sprintf("/gfx/hud/%s/%s", cvar_string("hud_skin"), this.m_icon) : string_null); } ENDCLASS(StatusEffect) diff --git a/qcsrc/common/weapons/weapon.qh b/qcsrc/common/weapons/weapon.qh index 4cc04b26e..0a7813428 100644 --- a/qcsrc/common/weapons/weapon.qh +++ b/qcsrc/common/weapons/weapon.qh @@ -127,7 +127,7 @@ CLASS(Weapon, Object) /** (SERVER) update cvar based properties */ METHOD(Weapon, wr_update, void(Weapon this)) {} METHOD(Weapon, display, void(entity this, void(string name, string icon) returns)) { - returns(this.m_name, this.model2 ? sprintf("/gfx/hud/%s/%s", cvar_string("menu_skin"), this.model2) : string_null); + returns(this.m_name, this.model2 ? sprintf("/gfx/hud/%s/%s", cvar_string("hud_skin"), this.model2) : string_null); } ENDCLASS(Weapon) -- 2.39.5