public static string drawField(Rect area, FontStyle fontStyle, TextAnchor fontAlignment, int fontSize, Color color_0, Color color_1, string text, int maxLength, string hint, char replace) { GUI.skin.textField.fontStyle = fontStyle; GUI.skin.textField.alignment = fontAlignment; GUI.skin.textField.fontSize = fontSize; GUI.backgroundColor = color_0; GUI.contentColor = color_1; if (SleekRender.allowInput) { text = GUI.PasswordField(area, text, replace, maxLength); if (text == null) { text = string.Empty; } if (text.Length < 1) { SleekRender.drawLabel(area, fontStyle, fontAlignment, fontSize, false, color_1 * 0.5f, hint); } return(text); } SleekRender.drawBox(area, color_0); string text2 = string.Empty; for (int i = 0; i < text.Length; i++) { text2 += replace; } SleekRender.drawLabel(area, fontStyle, fontAlignment, fontSize, false, color_1, text2); return(text); }
public static string drawField(Rect area, FontStyle fontStyle, TextAnchor fontAlignment, int fontSize, Color color_0, Color color_1, string text, int maxLength, string hint, bool multiline) { GUI.skin.textArea.fontStyle = fontStyle; GUI.skin.textArea.alignment = fontAlignment; GUI.skin.textArea.fontSize = fontSize; GUI.skin.textField.fontStyle = fontStyle; GUI.skin.textField.alignment = fontAlignment; GUI.skin.textField.fontSize = fontSize; GUI.backgroundColor = color_0; GUI.contentColor = color_1; if (SleekRender.allowInput) { if (multiline) { text = GUI.TextArea(area, text, maxLength); } else { text = GUI.TextField(area, text, maxLength); } if (text == null) { text = string.Empty; } if (text.Length < 1) { SleekRender.drawLabel(area, fontStyle, fontAlignment, fontSize, false, color_1 * 0.5f, hint); } return(text); } SleekRender.drawBox(area, color_0); SleekRender.drawLabel(area, fontStyle, fontAlignment, fontSize, false, color_1, text); return(text); }
public override void draw(bool ignoreCulling) { if (!this.isHidden) { SleekRender.drawBox(base.frame, base.backgroundColor); SleekRender.drawLabel(base.frame, this.fontStyle, this.fontAlignment, this.fontSize, this.content2, base.foregroundColor, this.content); } base.drawChildren(ignoreCulling); }
public static bool drawButton(Rect area, Color color) { if (SleekRender.allowInput) { GUI.backgroundColor = color; return(GUI.Button(area, string.Empty)); } SleekRender.drawBox(area, color); return(false); }
public override void draw(bool ignoreCulling) { SleekRender.drawBox(base.frame, base.backgroundColor, this.content); string text = SleekRender.drawField(base.frame, this.fontStyle, this.fontAlignment, this.fontSize, base.backgroundColor, base.foregroundColor, base.text, 64, false); int num; if (text != base.text && int.TryParse(text, out num)) { this._state = num; if (this.onTypedInt != null) { this.onTypedInt(this, num); } } base.text = text; base.drawChildren(ignoreCulling); }
public override void draw(bool ignoreCulling) { SleekRender.drawBox(base.frame, base.backgroundColor, this.content); string text = SleekRender.drawField(base.frame, this.fontStyle, this.fontAlignment, this.fontSize, base.backgroundColor, base.foregroundColor, base.text, 3, false); byte b; if (text != base.text && byte.TryParse(text, out b)) { this._state = b; if (this.onTypedByte != null) { this.onTypedByte(this, b); } } base.text = text; base.drawChildren(ignoreCulling); }
// Token: 0x06003224 RID: 12836 RVA: 0x001455F0 File Offset: 0x001439F0 public override void draw(bool ignoreCulling) { if (!this.isHidden) { if (this.isClickable) { if (SleekRender.drawButton(base.frame, base.backgroundColor) && this.onClickedButton != null) { this.onClickedButton(this); } } else { SleekRender.drawBox(base.frame, base.backgroundColor); } SleekRender.drawLabel(base.frame, this.fontStyle, this.fontAlignment, this.fontSize, this.content2, base.foregroundColor, this.content); } base.drawChildren(ignoreCulling); }
// Token: 0x0600327A RID: 12922 RVA: 0x00147E10 File Offset: 0x00146210 public override void draw(bool ignoreCulling) { SleekRender.drawBox(base.frame, base.backgroundColor, this.content); if (this.control != null && this.control.Length > 0) { GUI.SetNextControlName(this.control); } string text; if (this.replace != ' ') { text = SleekRender.drawField(base.frame, this.fontStyle, this.fontAlignment, this.fontSize, base.backgroundColor, base.foregroundColor, base.text, this.maxLength, this.hint, this.replace); } else { text = SleekRender.drawField(base.frame, this.fontStyle, this.fontAlignment, this.fontSize, base.backgroundColor, base.foregroundColor, base.text, this.maxLength, this.hint, this.multiline); } if (text != base.text && this.onTyped != null) { this.onTyped(this, text); } base.text = text; if (this.control != null && this.control.Length > 0 && GUI.GetNameOfFocusedControl() == this.control && Event.current.isKey && Event.current.type == EventType.KeyUp) { if (Event.current.keyCode == KeyCode.Escape || Event.current.keyCode == ControlsSettings.dashboard) { if (this.onEscaped != null) { this.onEscaped(this); } GUI.FocusControl(string.Empty); } else if (Event.current.keyCode == KeyCode.Return && this.onEntered != null) { this.onEntered(this); } } base.drawChildren(ignoreCulling); }