X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fmenu%2Fxonotic%2Fbutton.qc;h=d86c4a4537b062fab660bbe5e180cd82976fb266;hb=6afdf61d7ac0614d3a0c1bee447bfebc54566730;hp=cbc7c47c40acbb84a88f39c154b7299428559531;hpb=15a18e8ca7c55ac8187b9ea266d15c2d6e0cb869;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/menu/xonotic/button.qc b/qcsrc/menu/xonotic/button.qc index cbc7c47c4..d86c4a453 100644 --- a/qcsrc/menu/xonotic/button.qc +++ b/qcsrc/menu/xonotic/button.qc @@ -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