From 4eff74c7407e98dd7965ef9c7db49c14e265b402 Mon Sep 17 00:00:00 2001 From: terencehill Date: Sun, 30 Aug 2015 21:15:56 +0200 Subject: [PATCH] Move tooltip functions around --- qcsrc/menu/xonotic/util.qc | 52 +++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 26 deletions(-) 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; -- 2.39.2