]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/inputbox.qc
Hardcode tooltips
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / inputbox.qc
index 0ff3aaee366b1f0d788bf92c009be0ca7893d74e..6b532a0b32e0d7b3635806b894f7e6b8905aa1fe 100644 (file)
@@ -2,9 +2,10 @@
 #define INPUTBOX_H
 #include "../item/inputbox.qc"
 CLASS(XonoticInputBox, InputBox)
-       METHOD(XonoticInputBox, configureXonoticInputBox, void(entity, float, string));
+       METHOD(XonoticInputBox, configureXonoticInputBox, void(entity, float, string, string));
        METHOD(XonoticInputBox, focusLeave, void(entity));
        METHOD(XonoticInputBox, setText, void(entity, string));
+       METHOD(XonoticInputBox, keyDown, float(entity, float, float, float));
        ATTRIB(XonoticInputBox, fontSize, float, SKINFONTSIZE_NORMAL)
        ATTRIB(XonoticInputBox, image, string, SKINGFX_INPUTBOX)
        ATTRIB(XonoticInputBox, onChange, void(entity, entity), func_null)
@@ -29,29 +30,33 @@ CLASS(XonoticInputBox, InputBox)
        METHOD(XonoticInputBox, loadCvars, void(entity));
        METHOD(XonoticInputBox, saveCvars, void(entity));
        ATTRIB(XonoticInputBox, sendCvars, float, 0)
-       METHOD(XonoticInputBox, keyDown, float(entity, float, float, float));
 
        ATTRIB(XonoticInputBox, saveImmediately, float, 0)
 ENDCLASS(XonoticInputBox)
+entity makeXonoticInputBox_T(float, string, string theTooltip);
 entity makeXonoticInputBox(float, string);
 #endif
 
 #ifdef IMPLEMENTATION
-entity makeXonoticInputBox(float doEditColorCodes, string theCvar)
+entity makeXonoticInputBox_T(float doEditColorCodes, string theCvar, string theTooltip)
 {
        entity me;
        me = NEW(XonoticInputBox);
-       me.configureXonoticInputBox(me, doEditColorCodes, theCvar);
+       me.configureXonoticInputBox(me, doEditColorCodes, theCvar, theTooltip);
        return me;
 }
-void XonoticInputBox_configureXonoticInputBox(entity me, float doEditColorCodes, string theCvar)
+entity makeXonoticInputBox(float doEditColorCodes, string theCvar)
+{
+       return makeXonoticInputBox_T(doEditColorCodes, theCvar, string_null);
+}
+void XonoticInputBox_configureXonoticInputBox(entity me, float doEditColorCodes, string theCvar, string theTooltip)
 {
        me.configureInputBox(me, "", 0, me.fontSize, me.image);
        me.editColorCodes = doEditColorCodes;
        if(theCvar)
        {
                me.cvarName = theCvar;
-               me.tooltip = getZonedTooltipForIdentifier(theCvar);
+               me.tooltip = getZonedTooltip(theTooltip, theCvar);
                me.loadCvars(me);
        }
        me.cursorPos = strlen(me.text);