3 entity makeXonoticInputBox_T(float doEditColorCodes, string theCvar, string theTooltip)
6 me = NEW(XonoticInputBox);
7 me.configureXonoticInputBox(me, doEditColorCodes, theCvar, theTooltip);
10 entity makeXonoticInputBox(float doEditColorCodes, string theCvar)
12 return makeXonoticInputBox_T(doEditColorCodes, theCvar, string_null);
14 void XonoticInputBox_configureXonoticInputBox(entity me, float doEditColorCodes, string theCvar, string theTooltip)
16 me.configureInputBox(me, "", 0, me.fontSize, me.image);
17 me.editColorCodes = doEditColorCodes;
18 me.cvarName = (theCvar) ? theCvar : string_null;
20 setZonedTooltip(me, theTooltip, theCvar);
21 me.cursorPos = strlen(me.text);
23 void XonoticInputBox_focusLeave(entity me)
27 void XonoticInputBox_setText(entity me, string val)
31 SUPER(XonoticInputBox).setText(me, val);
33 me.onChange(me, me.onChangeEntity);
34 if(me.saveImmediately)
38 SUPER(XonoticInputBox).setText(me, val);
40 void XonoticInputBox_loadCvars(entity me)
44 SUPER(XonoticInputBox).setText(me, cvar_string(me.cvarName));
46 void XonoticInputBox_saveCvars(entity me)
50 cvar_set(me.cvarName, me.text);
51 CheckSendCvars(me, me.cvarName);
53 float XonoticInputBox_keyDown(entity me, float key, float ascii, float shift)
57 if(key == K_ENTER || key == K_KP_ENTER)
65 me.onEnter(me, me.onEnterEntity);
67 if(SUPER(XonoticInputBox).keyDown(me, key, ascii, shift))