X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fmenu%2Fxonotic%2Fcommandbutton.qc;h=fa15bdbbd7938da53d8f5db17f80ff80fa2995b9;hb=abf4b5a430d71fc83abbe90da9b17b457a65e149;hp=afea74cb47d80b0e618c266e24c5f39e13105640;hpb=1bc3ab0285f65c7ed0c75cbba00da2460921c973;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/menu/xonotic/commandbutton.qc b/qcsrc/menu/xonotic/commandbutton.qc index afea74cb4..fa15bdbbd 100644 --- a/qcsrc/menu/xonotic/commandbutton.qc +++ b/qcsrc/menu/xonotic/commandbutton.qc @@ -1,28 +1,16 @@ -#ifndef COMMANDBUTTON_CLOSE -# define COMMANDBUTTON_CLOSE 1 -# define COMMANDBUTTON_APPLY 2 -//# define COMMANDBUTTON_REVERT 4 -#endif +#include "commandbutton.qh" -#ifndef COMMANDBUTTON_H -#define COMMANDBUTTON_H -#include "button.qc" -CLASS(XonoticCommandButton, 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 = NEW(XonoticCommandButton); - me.configureXonoticCommandButton(me, theText, theColor, theCommand, theFlags); + 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) { @@ -35,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