]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/radiobutton.qc
Merge branch 'terencehill/obsolete_cvars_removal' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / radiobutton.qc
index 65f2486f2111e57d749bc28ff73ac2aff1254afa..27282207795580b122182c1b38c5c47546594d7f 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,26 +22,27 @@ 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)
 {
-       if(theCvar)
-       {
-               me.cvarName = theCvar;
-               me.cvarValue = theValue;
-               me.tooltip = getZonedTooltipForIdentifier(theCvar);
-               me.loadCvars(me);
-       }
+       return makeXonoticRadioButton_T(theGroup, theCvar, theValue, theText, string_null);
+}
+void XonoticRadioButton_configureXonoticRadioButton(entity me, float theGroup, string theCvar, string theValue, string theText, string theTooltip)
+{
+       me.cvarName = (theCvar) ? theCvar : string_null;
+       me.loadCvars(me);
+       setZonedTooltip(me, theTooltip, theCvar);
        me.configureRadioButton(me, theText, me.fontSize, me.image, theGroup, 0);
 }
 void XonoticRadioButton_setChecked(entity me, float val)