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)
10 ATTRIB(NexuizInputBox, onEnter, void(entity, entity), SUB_Null)
11 ATTRIB(NexuizInputBox, onEnterEntity, entity, NULL)
12 ATTRIB(NexuizInputBox, marginLeft, float, SKINMARGIN_INPUTBOX_CHARS)
13 ATTRIB(NexuizInputBox, marginRight, float, SKINMARGIN_INPUTBOX_CHARS)
14 ATTRIB(NexuizInputBox, color, vector, SKINCOLOR_INPUTBOX_N)
15 ATTRIB(NexuizInputBox, colorF, vector, SKINCOLOR_INPUTBOX_F)
17 ATTRIB(NexuizInputBox, alpha, float, SKINALPHA_TEXT)
19 ATTRIB(NexuizInputBox, cvarName, string, string_null)
20 METHOD(NexuizInputBox, loadCvars, void(entity))
21 METHOD(NexuizInputBox, saveCvars, void(entity))
22 METHOD(NexuizInputBox, keyDown, float(entity, float, float, float))
23 ENDCLASS(NexuizInputBox)
24 entity makeNexuizInputBox(float, string);
28 entity makeNexuizInputBox(float doEditColorCodes, string theCvar)
31 me = spawnNexuizInputBox();
32 me.configureNexuizInputBox(me, doEditColorCodes, theCvar);
35 void configureNexuizInputBoxNexuizInputBox(entity me, float doEditColorCodes, string theCvar)
37 me.configureInputBox(me, "", 0, me.fontSize, me.image);
38 me.editColorCodes = doEditColorCodes;
41 me.cvarName = theCvar;
42 if(cvar_description(theCvar) != "custom cvar")
43 me.tooltip = strzone(cvar_description(theCvar));
46 me.cursorPos = strlen(me.text);
48 void focusLeaveNexuizInputBox(entity me)
52 void setTextNexuizInputBox(entity me, string new)
56 setTextInputBox(me, new);
57 me.onChange(me, me.onChangeEntity);
60 setTextInputBox(me, new);
62 void loadCvarsNexuizInputBox(entity me)
66 setTextInputBox(me, cvar_string(me.cvarName));
68 void saveCvarsNexuizInputBox(entity me)
72 cvar_set(me.cvarName, me.text);
74 float keyDownNexuizInputBox(entity me, float key, float ascii, float shift)
85 me.onEnter(me, me.onEnterEntity);
87 if(keyDownInputBox(me, key, ascii, shift))