X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=qcsrc%2Fmenu%2Fxonotic%2Fcommandbutton.qc;h=8e691a036bab1d97301c55b229aec9afa47cdb04;hb=HEAD;hp=8ee4e7de3a75503215591c49e643a68768c580bf;hpb=4e85c153239969d8dccea38031e18ddb24b6c935;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/menu/xonotic/commandbutton.qc b/qcsrc/menu/xonotic/commandbutton.qc index 8ee4e7de3..ec03633eb 100644 --- a/qcsrc/menu/xonotic/commandbutton.qc +++ b/qcsrc/menu/xonotic/commandbutton.qc @@ -1,26 +1,17 @@ -#ifndef COMMANDBUTTON_CLOSE -# define COMMANDBUTTON_CLOSE 1 -# define COMMANDBUTTON_APPLY 2 -//# define COMMANDBUTTON_REVERT 4 -#endif +#include "commandbutton.qh" +#include "dialog.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) { @@ -30,15 +21,14 @@ void XonoticCommandButton_Click(entity me, entity other) //if(me.flags & COMMANDBUTTON_REVERT) // loadAllCvars(me.parent); if(me.flags & COMMANDBUTTON_CLOSE) - m_goto(string_null); + me.parent.close(me.parent); } -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