X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fmenu%2Fxonotic%2Fcommandbutton.qc;h=fa15bdbbd7938da53d8f5db17f80ff80fa2995b9;hb=49fba42e5b6ee97f5433d6421b920e91a738177c;hp=8ee4e7de3a75503215591c49e643a68768c580bf;hpb=6dc9591eba337374f2b4348a6a6deaa1cb6887d0;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/menu/xonotic/commandbutton.qc b/qcsrc/menu/xonotic/commandbutton.qc index 8ee4e7de3a..fa15bdbbd7 100644 --- a/qcsrc/menu/xonotic/commandbutton.qc +++ b/qcsrc/menu/xonotic/commandbutton.qc @@ -1,26 +1,16 @@ -#ifndef COMMANDBUTTON_CLOSE -# define COMMANDBUTTON_CLOSE 1 -# define COMMANDBUTTON_APPLY 2 -//# define COMMANDBUTTON_REVERT 4 -#endif +#include "commandbutton.qh" -#ifdef INTERFACE -CLASS(XonoticCommandButton) EXTENDS(XonoticButton) - METHOD(XonoticCommandButton, configureXonoticCommandButton, void(entity, string, vector, string, float)) - ATTRIB(XonoticCommandButton, onClickCommand, string, string_null) - ATTRIB(XonoticCommandButton, flags, float, 0) -ENDCLASS(XonoticCommandButton) -entity makeXonoticCommandButton(string theText, vector theColor, string theCommand, float closesMenu); -#endif - -#ifdef IMPLEMENTATION -entity makeXonoticCommandButton(string theText, vector theColor, string theCommand, float theFlags) +entity makeXonoticCommandButton_T(string theText, vector theColor, string theCommand, int theFlags, string theTooltip) { entity me; - me = spawnXonoticCommandButton(); - me.configureXonoticCommandButton(me, theText, theColor, theCommand, theFlags); + me = NEW(XonoticCommandButton); + me.configureXonoticCommandButton(me, theText, theColor, theCommand, theFlags, theTooltip); return me; } +entity makeXonoticCommandButton(string theText, vector theColor, string theCommand, int theFlags) +{ + return makeXonoticCommandButton_T(theText, theColor, theCommand, theFlags, string_null); +} void XonoticCommandButton_Click(entity me, entity other) { @@ -33,12 +23,11 @@ void XonoticCommandButton_Click(entity me, entity other) m_goto(string_null); } -void XonoticCommandButton_configureXonoticCommandButton(entity me, string theText, vector theColor, string theCommand, float theFlags) +void XonoticCommandButton_configureXonoticCommandButton(entity me, string theText, vector theColor, string theCommand, int theFlags, string theTooltip) { - me.configureXonoticButton(me, theText, theColor); + me.configureXonoticButton(me, theText, theColor, theTooltip); me.onClickCommand = theCommand; me.flags = theFlags; me.onClick = XonoticCommandButton_Click; me.onClickEntity = me; } -#endif