From: terencehill Date: Sat, 1 Mar 2025 13:21:19 +0000 (+0000) Subject: Merge "Get rid of the lag when opening 2 menu window tabs" X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=88c391b0c93fbedb11d65c4ba31f7db2207f4d49;p=xonotic%2Fxonotic-data.pk3dir.git Merge "Get rid of the lag when opening 2 menu window tabs" Source branch: 'terencehill/menu_performance_improvements' Target branch: 'master' See merge request xonotic/xonotic-data.pk3dir!1453 --- 88c391b0c93fbedb11d65c4ba31f7db2207f4d49 diff --cc qcsrc/common/mutators/mutator/nades/nades.qh index 84e5a352a,6880befba..b92da50f4 --- a/qcsrc/common/mutators/mutator/nades/nades.qh +++ b/qcsrc/common/mutators/mutator/nades/nades.qh @@@ -14,13 -14,22 +14,24 @@@ CLASS(Nade, Object ATTRIB(Nade, m_name, string, _("Grenade")); ATTRIB(Nade, m_icon, string, "nade_normal"); ATTRIB(Nade, m_alpha, float, 1); + ATTRIB(Nade, netname, string, "random"); + ATTRIB(Nade, impulse, int, 0); // legacy number for selection, do not add to new nade types 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("hud_skin"), this.m_icon)); + #ifndef SVQC + METHOD(Nade, display, void(entity this, void(string name, string icon) returns)) + { + string img = sprintf("/gfx/hud/%s/%s", cvar_string("hud_skin"), this.m_icon); + #ifdef CSQC + if (precache_pic(img) == "") + #endif + #ifdef MENUQC + if (draw_PreloadPicture(img) == "") + #endif + img = sprintf("/gfx/hud/default/%s", this.m_icon); + returns(this.m_name, img); } + #endif ENDCLASS(Nade) REGISTER_NADE(Null, NEW(Nade));