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)
30 SUPER(XonoticInputBox).setText(me, val);
32 me.onChange(me, me.onChangeEntity);
34 if (me.saveImmediately) {
38 SUPER(XonoticInputBox).setText(me, val);
41 void XonoticInputBox_loadCvars(entity me)
46 SUPER(XonoticInputBox).setText(me, cvar_string(me.cvarName));
48 void XonoticInputBox_saveCvars(entity me)
53 cvar_set(me.cvarName, me.text);
54 CheckSendCvars(me, me.cvarName);
56 float XonoticInputBox_keyDown(entity me, float key, float ascii, float shift)
60 if (key == K_ENTER || key == K_KP_ENTER) {
66 me.onEnter(me, me.onEnterEntity);
69 if (SUPER(XonoticInputBox).keyDown(me, key, ascii, shift)) {