]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/radiobutton.qc
Hardcode tooltips
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / radiobutton.qc
index 65f2486f2111e57d749bc28ff73ac2aff1254afa..ef919d8ad2dc89713c6387badf562cb3f8c1373d 100644 (file)
@@ -2,7 +2,7 @@
 #define RADIOBUTTON_H
 #include "../item/radiobutton.qc"
 CLASS(XonoticRadioButton, RadioButton)
-       METHOD(XonoticRadioButton, configureXonoticRadioButton, void(entity, float, string, string, string));
+       METHOD(XonoticRadioButton, configureXonoticRadioButton, void(entity, float, string, string, string, string));
        METHOD(XonoticRadioButton, draw, void(entity));
        METHOD(XonoticRadioButton, setChecked, void(entity, float));
        ATTRIB(XonoticRadioButton, fontSize, float, SKINFONTSIZE_NORMAL)
@@ -22,24 +22,28 @@ CLASS(XonoticRadioButton, RadioButton)
        ATTRIB(XonoticRadioButton, alpha, float, SKINALPHA_TEXT)
        ATTRIB(XonoticRadioButton, disabledAlpha, float, SKINALPHA_DISABLED)
 ENDCLASS(XonoticRadioButton)
+entity makeXonoticRadioButton_T(float, string, string, string, string theTooltip);
 entity makeXonoticRadioButton(float, string, string, string);
 #endif
 
 #ifdef IMPLEMENTATION
-entity makeXonoticRadioButton(float theGroup, string theCvar, string theValue, string theText)
+entity makeXonoticRadioButton_T(float theGroup, string theCvar, string theValue, string theText, string theTooltip)
 {
        entity me;
        me = NEW(XonoticRadioButton);
-       me.configureXonoticRadioButton(me, theGroup, theCvar, theValue, theText);
+       me.configureXonoticRadioButton(me, theGroup, theCvar, theValue, theText, theTooltip);
        return me;
 }
-void XonoticRadioButton_configureXonoticRadioButton(entity me, float theGroup, string theCvar, string theValue, string theText)
+entity makeXonoticRadioButton(float theGroup, string theCvar, string theValue, string theText)
+{
+       return makeXonoticRadioButton_T(theGroup, theCvar, theValue, theText, string_null);
+}
+void XonoticRadioButton_configureXonoticRadioButton(entity me, float theGroup, string theCvar, string theValue, string theText, string theTooltip)
 {
        if(theCvar)
        {
                me.cvarName = theCvar;
-               me.cvarValue = theValue;
-               me.tooltip = getZonedTooltipForIdentifier(theCvar);
+               me.tooltip = getZonedTooltip(theTooltip, theCvar);
                me.loadCvars(me);
        }
        me.configureRadioButton(me, theText, me.fontSize, me.image, theGroup, 0);