METHOD(XonoticInputBox, setText, void(entity, string))
ATTRIB(XonoticInputBox, fontSize, float, SKINFONTSIZE_NORMAL)
ATTRIB(XonoticInputBox, image, string, SKINGFX_INPUTBOX)
- ATTRIB(XonoticInputBox, onChange, void(entity, entity), SUB_Null)
+ ATTRIB(XonoticInputBox, onChange, void(entity, entity), func_null)
ATTRIB(XonoticInputBox, onChangeEntity, entity, NULL)
- ATTRIB(XonoticInputBox, onEnter, void(entity, entity), SUB_Null)
+ ATTRIB(XonoticInputBox, onEnter, void(entity, entity), func_null)
ATTRIB(XonoticInputBox, onEnterEntity, entity, NULL)
ATTRIB(XonoticInputBox, marginLeft, float, SKINMARGIN_INPUTBOX_CHARS)
ATTRIB(XonoticInputBox, marginRight, float, SKINMARGIN_INPUTBOX_CHARS)
if(me.text != new)
{
SUPER(XonoticInputBox).setText(me, new);
- me.onChange(me, me.onChangeEntity);
+ if(me.onChange)
+ me.onChange(me, me.onChangeEntity);
if(me.saveImmediately)
me.saveCvars(me);
}
}
void XonoticInputBox_loadCvars(entity me)
{
- if not(me.cvarName)
+ if (!me.cvarName)
return;
SUPER(XonoticInputBox).setText(me, cvar_string(me.cvarName));
}
void XonoticInputBox_saveCvars(entity me)
{
- if not(me.cvarName)
+ if (!me.cvarName)
return;
cvar_set(me.cvarName, me.text);
}
me.saveCvars(me);
r = 1;
}
- me.onEnter(me, me.onEnterEntity);
+ if(me.onEnter)
+ me.onEnter(me, me.onEnterEntity);
}
if(SUPER(XonoticInputBox).keyDown(me, key, ascii, shift))
r = 1;