10 me.cursorPos = theCursorPos;
14 SUPER(
InputBox).resizeNotify(me, relOrigin, relSize, absOrigin, absSize);
15 if (me.enableClearButton)
17 me.cb_width = absSize.y / absSize.x;
18 me.cb_offset =
bound(-1, me.cb_offset, 0) * me.cb_width;
19 me.keepspaceRight = me.keepspaceRight - me.cb_offset + me.cb_width;
33 if (pos.x >= 1 + me.cb_offset - me.cb_width)
34 if (pos.x < 1 + me.cb_offset)
36 if (pos.y < 1)
return 1;
42 if (me.enableClearButton)
59 me.dragScrollPos = pos;
60 p = me.scrollPos + pos.x - me.keepspaceLeft;
62 me.lastChangeTime =
time;
64 else if (me.enableClearButton)
78 if (this.enableClearButton)
84 this.dragScrollTimer =
time;
97 me.applyButton.disabled =
false;
112 for (
int i = 0; i < len; ++i)
114 if (me.maxLength > 0)
116 if (len +
strlen(me.text) > me.maxLength)
return;
118 else if (me.maxLength < 0)
128 me.lastChangeTime =
time;
129 me.dragScrollTimer =
time;
130 if (ascii >= 32 && ascii != 127)
132 me.enterText(me,
chr(ascii));
134 me.applyButton.disabled =
false;
153 me.cursorPos =
strlen(me.text);
156 if (me.cursorPos > 0)
161 me.applyButton.disabled =
false;
174 me.applyButton.disabled =
false;
183 float cursorPosInWidths, totalSizeInWidths;
185 if (me.pressed) me.mouseDrag(me, me.dragScrollPos);
187 if (me.recalcPos) me.recalcPositionWithText(me, me.text);
189 me.focusable = !me.disabled;
190 if (me.disabled)
draw_alpha *= me.disabledAlpha;
198 me.cursorPos =
bound(0, me.cursorPos,
strlen(me.text));
202 if (me.dragScrollTimer <
time)
206 me.scrollPos =
bound(cursorPosInWidths - (0.875 - me.keepspaceLeft - me.keepspaceRight), me.scrollPos, cursorPosInWidths - 0.125);
207 if (me.scrollPos != save) me.dragScrollTimer =
time + 0.2;
209 me.scrollPos =
min(me.scrollPos, totalSizeInWidths - (1 - me.keepspaceRight - me.keepspaceLeft));
210 me.scrollPos =
max(0, me.scrollPos);
213 if (me.editColorCodes)
215 vector p = me.realOrigin -
eX * me.scrollPos;
216 vector theColor =
'1 1 1';
219 for (
int i = 0, n =
strlen(me.text); i < n; ++i)
225 string ch2 =
substring(me.text, i + 1, 1);
227 float fill_alpha = 0.4;
230 if (me.cursorPos > i && me.cursorPos <= i + 2)
232 draw_Fill(p,
eX * w +
eY * me.realFontSize.y,
'1 1 1', fill_alpha);
233 draw_Text(p +
eX * 0.25 * w,
"^", me.realFontSize, theColor, theAlpha, 0);
240 case 0: theColor =
'0 0 0';
break;
241 case 1: theColor =
'1 0 0';
break;
242 case 2: theColor =
'0 1 0';
break;
243 case 3: theColor =
'1 1 0';
break;
244 case 4: theColor =
'0 0 1';
break;
245 case 5: theColor =
'0 1 1';
break;
246 case 6: theColor =
'1 0 1';
break;
247 case 7: theColor =
'1 1 1';
break;
248 case 8: theColor =
'1 1 1'; theAlpha = 0.5;
break;
249 case 9: theColor =
'0.5 0.5 0.5';
break;
251 if (me.cursorPos > i && me.cursorPos <= i + 2)
253 draw_Fill(p,
eX * w +
eY * me.realFontSize.y,
'1 1 1', fill_alpha);
263 theTempColor.x = component / 15;
268 theTempColor.y = component / 15;
273 theTempColor.z = component / 15;
274 theColor = theTempColor;
277 if (me.cursorPos > i && me.cursorPos <= i + 5)
279 draw_Fill(p,
eX * w +
eY * me.realFontSize.y,
'1 1 1', fill_alpha);
311 draw_Fill(p,
eX * w +
eY * me.realFontSize.y,
'1 1 1', fill_alpha);
318 draw_Text(p, ch, me.realFontSize, theColor, theAlpha, 0);
324 draw_Text(me.realOrigin -
eX * me.scrollPos, me.text, me.realFontSize,
'1 1 1', 1, 0);
327 if (!me.focused || (
time - me.lastChangeTime) <
floor(
time - me.lastChangeTime) + 0.5)
328 draw_Text(me.realOrigin +
eX * (cursorPosInWidths - me.scrollPos), CURSOR, me.realFontSize,
'1 1 1', 1, 0);
332 if (me.enableClearButton && me.text !=
"")
334 if (me.focused && me.cb_pressed)
335 draw_Picture(
eX * (1 + me.cb_offset - me.cb_width),
strcat(me.cb_src,
"_c"),
eX * me.cb_width +
eY, me.cb_colorC, 1);
336 else if (me.focused && me.cb_focused)
337 draw_Picture(
eX * (1 + me.cb_offset - me.cb_width),
strcat(me.cb_src,
"_f"),
eX * me.cb_width +
eY, me.cb_colorF, 1);
339 draw_Picture(
eX * (1 + me.cb_offset - me.cb_width),
strcat(me.cb_src,
"_n"),
eX * me.cb_width +
eY, me.cb_color, 1);
348 me.focusable = !me.disabled;
ERASEABLE int u8_strsize(string s)
#define HEXDIGIT_TO_DEC(d)
#define METHOD(cname, name, prototype)
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
vector(float skel, float bonenum) _skel_get_boneabs_hidden