]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/button.qc
Merge branch 'master' into Mario/waterjump_fix
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / button.qc
index cbc7c47c40acbb84a88f39c154b7299428559531..d86c4a4537b062fab660bbe5e180cd82976fb266 100644 (file)
@@ -1,31 +1,18 @@
-#ifdef INTERFACE
-CLASS(XonoticButton) EXTENDS(Button)
-       METHOD(XonoticButton, configureXonoticButton, void(entity, string, vector))
-       ATTRIB(XonoticButton, fontSize, float, SKINFONTSIZE_NORMAL)
-       ATTRIB(XonoticButton, image, string, SKINGFX_BUTTON)
-       ATTRIB(XonoticButton, grayImage, string, SKINGFX_BUTTON_GRAY)
-       ATTRIB(XonoticButton, color, vector, SKINCOLOR_BUTTON_N)
-       ATTRIB(XonoticButton, colorC, vector, SKINCOLOR_BUTTON_C)
-       ATTRIB(XonoticButton, colorF, vector, SKINCOLOR_BUTTON_F)
-       ATTRIB(XonoticButton, colorD, vector, SKINCOLOR_BUTTON_D)
-       ATTRIB(XonoticButton, alpha, float, SKINALPHA_TEXT)
-       ATTRIB(XonoticButton, disabledAlpha, float, SKINALPHA_DISABLED)
-       ATTRIB(XonoticButton, marginLeft, float, SKINMARGIN_BUTTON) // chars
-       ATTRIB(XonoticButton, marginRight, float, SKINMARGIN_BUTTON) // chars
-ENDCLASS(XonoticButton)
-entity makeXonoticButton(string theText, vector theColor);
-#endif
+#include "button.qh"
 
-#ifdef IMPLEMENTATION
-entity makeXonoticButton(string theText, vector theColor)
+entity makeXonoticButton_T(string theText, vector theColor, string theTooltip)
 {
        entity me;
-       me = spawnXonoticButton();
-       me.configureXonoticButton(me, theText, theColor);
+       me = NEW(XonoticButton);
+       me.configureXonoticButton(me, theText, theColor, theTooltip);
        return me;
 }
+entity makeXonoticButton(string theText, vector theColor)
+{
+       return makeXonoticButton_T(theText, theColor, string_null);
+}
 
-void XonoticButton_configureXonoticButton(entity me, string theText, vector theColor)
+void XonoticButton_configureXonoticButton(entity me, string theText, vector theColor, string theTooltip)
 {
        if(theColor == '0 0 0')
        {
@@ -38,6 +25,5 @@ void XonoticButton_configureXonoticButton(entity me, string theText, vector theC
                me.colorC = theColor;
                me.colorF = theColor;
        }
-       me.tooltip = getZonedTooltipForIdentifier(strcat(currentDialog.classname, "/", me.text));
+       setZonedTooltip(me, theTooltip, string_null);
 }
-#endif