From: terencehill Date: Sun, 30 Aug 2015 19:15:56 +0000 (+0200) Subject: Move tooltip functions around X-Git-Tag: xonotic-v0.8.2~1808^2~17 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4eff74c7407e98dd7965ef9c7db49c14e265b402;p=xonotic%2Fxonotic-data.pk3dir.git Move tooltip functions around --- diff --git a/qcsrc/menu/xonotic/util.qc b/qcsrc/menu/xonotic/util.qc index 56c816dab..1b216a14b 100644 --- a/qcsrc/menu/xonotic/util.qc +++ b/qcsrc/menu/xonotic/util.qc @@ -17,32 +17,6 @@ float GL_Have_TextureCompression() return (GL_CheckExtension("GL_EXT_texture_compression_s3tc") && GL_CheckExtension("GL_ARB_texture_compression")); } -void setZonedTooltip(entity e, string theTooltip, string theCvar) -{ - if(theTooltip == "") // no tooltip, use cvar description then - { - if(theCvar != "" && prvm_language == "en") - { - string t = cvar_description(theCvar); - if(t != "" && t != "custom cvar") - theTooltip = t; - } - } - else if(theTooltip == "-") // no cvar description as tooltip - { - theTooltip = string_null; - } - - if(e.tooltip) - strunzone(e.tooltip); - e.tooltip = (theTooltip != "") ? strzone(theTooltip) : string_null; -} - -void clearTooltip(entity e) -{ - setZonedTooltip(e, string_null, string_null); -} - .entity parent, firstChild, nextSibling; void forAllDescendants(entity root, void(entity, entity) funcPre, void(entity, entity) funcPost, entity pass) { @@ -267,6 +241,32 @@ void setDependentWeird(entity e, float(entity) func) setDependent_Check(e); } +void setZonedTooltip(entity e, string theTooltip, string theCvar) +{ + if(theTooltip == "") // no tooltip, use cvar description then + { + if(theCvar != "" && prvm_language == "en") + { + string t = cvar_description(theCvar); + if(t != "" && t != "custom cvar") + theTooltip = t; + } + } + else if(theTooltip == "-") // no cvar description as tooltip + { + theTooltip = string_null; + } + + if(e.tooltip) + strunzone(e.tooltip); + e.tooltip = (theTooltip != "") ? strzone(theTooltip) : string_null; +} + +void clearTooltip(entity e) +{ + setZonedTooltip(e, string_null, string_null); +} + // URI SYSTEM //////////////////////////////////////////////////////// float _Nex_ExtResponseSystem_Queried;