2 CLASS(NexuizInputBox) EXTENDS(InputBox)
3 METHOD(NexuizInputBox, configureNexuizInputBox, void(entity, float, string))
4 METHOD(NexuizInputBox, focusLeave, void(entity))
5 METHOD(NexuizInputBox, setText, void(entity, string))
6 ATTRIB(NexuizInputBox, fontSize, float, SKINFONTSIZE_NORMAL)
7 ATTRIB(NexuizInputBox, image, string, SKINGFX_INPUTBOX)
8 ATTRIB(NexuizInputBox, onChange, void(entity, entity), SUB_Null)
9 ATTRIB(NexuizInputBox, onChangeEntity, entity, NULL)
11 ATTRIB(NexuizInputBox, cvarName, string, string_null)
12 METHOD(NexuizInputBox, loadCvars, void(entity))
13 METHOD(NexuizInputBox, saveCvars, void(entity))
14 ENDCLASS(NexuizInputBox)
15 entity makeNexuizInputBox(float, string);
19 entity makeNexuizInputBox(float doEditColorCodes, string theCvar)
22 me = spawnNexuizInputBox();
23 me.configureNexuizInputBox(me, doEditColorCodes, theCvar);
26 void configureNexuizInputBoxNexuizInputBox(entity me, float doEditColorCodes, string theCvar)
28 me.configureInputBox(me, "", 0, me.fontSize, me.image);
29 me.editColorCodes = doEditColorCodes;
32 me.cvarName = theCvar;
35 me.cursorPos = strlen(me.text);
37 void focusLeaveNexuizInputBox(entity me)
42 void setTextNexuizInputBox(entity me, string new)
46 setTextInputBox(me, new);
47 me.onChange(me, me.onChangeEntity);
50 setTextInputBox(me, new);
52 void loadCvarsNexuizInputBox(entity me)
54 setTextInputBox(me, cvar_string(me.cvarName));
56 void saveCvarsNexuizInputBox(entity me)
58 cvar_set(me.cvarName, me.text);