}
void XonoticInputBox_setText(entity me, string val)
{
- if(me.text != val)
- {
+ if (me.text != val) {
SUPER(XonoticInputBox).setText(me, val);
- if(me.onChange)
+ if (me.onChange) {
me.onChange(me, me.onChangeEntity);
- if(me.saveImmediately)
+ }
+ if (me.saveImmediately) {
me.saveCvars(me);
- }
- else
+ }
+ } else {
SUPER(XonoticInputBox).setText(me, val);
+ }
}
void XonoticInputBox_loadCvars(entity me)
{
- if (!me.cvarName)
+ if (!me.cvarName) {
return;
+ }
SUPER(XonoticInputBox).setText(me, cvar_string(me.cvarName));
}
void XonoticInputBox_saveCvars(entity me)
{
- if (!me.cvarName)
+ if (!me.cvarName) {
return;
+ }
cvar_set(me.cvarName, me.text);
CheckSendCvars(me, me.cvarName);
}
{
float r;
r = 0;
- if(key == K_ENTER || key == K_KP_ENTER)
- {
- if(me.cvarName)
- {
+ if (key == K_ENTER || key == K_KP_ENTER) {
+ if (me.cvarName) {
me.saveCvars(me);
r = 1;
}
- if(me.onEnter)
+ if (me.onEnter) {
me.onEnter(me, me.onEnterEntity);
+ }
}
- if(SUPER(XonoticInputBox).keyDown(me, key, ascii, shift))
+ if (SUPER(XonoticInputBox).keyDown(me, key, ascii, shift)) {
r = 1;
+ }
return r;
}