public override void draw(bool ignoreCulling) { if (!this.isHidden) { if (SleekRender.drawImageButton(base.frame, this.texture, base.backgroundColor)) { if (this.onClickedImage != null) { this.onClickedImage(this); } if (!this.isHeld) { this.isHeld = true; if (this.onClickImageStarted != null) { this.onClickImageStarted(this); } } } else if (this.isHeld) { this.isHeld = false; if (this.onClickImageStopped != null) { this.onClickImageStopped(this); } } } base.drawChildren(ignoreCulling); }
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); }
// Token: 0x06003312 RID: 13074 RVA: 0x0014BBA4 File Offset: 0x00149FA4 public static void drawLabel(Rect area, FontStyle fontStyle, TextAnchor fontAlignment, int fontSize, bool isRich, Color color, string text) { GUI.skin.label.fontStyle = fontStyle; GUI.skin.label.alignment = fontAlignment; GUI.skin.label.fontSize = SleekRender.getScaledFontSize(fontSize); if (isRich) { bool richText = GUI.skin.label.richText; GUI.skin.label.richText = isRich; GUI.Label(area, text); GUI.skin.label.richText = richText; } else { Color outline = SleekRender.OUTLINE; outline.a *= color.a; GUI.contentColor = outline; area.x -= 1f; GUI.Label(area, text); area.x += 2f; GUI.Label(area, text); area.x -= 1f; area.y -= 1f; GUI.Label(area, text); area.y += 2f; GUI.Label(area, text); area.y -= 1f; GUI.contentColor = color; GUI.Label(area, text); } }
public override void draw(bool ignoreCulling) { if (!this.isHidden) { if (SleekRender.drawRepeat(base.frame, base.backgroundColor)) { if (!this.isHeld) { this.isHeld = true; if (this.onStartedButton != null) { this.onStartedButton(this); } } } else if (Event.current.type == 7 && this.isHeld) { this.isHeld = false; if (this.onStoppedButton != null) { this.onStoppedButton(this); } } SleekRender.drawLabel(base.frame, this.fontStyle, this.fontAlignment, this.fontSize, this.content2, base.foregroundColor, this.content); } base.drawChildren(ignoreCulling); }
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); }
// Token: 0x06003280 RID: 12928 RVA: 0x00147FF9 File Offset: 0x001463F9 public override void draw(bool ignoreCulling) { if (SleekRender.drawGrid(base.frame, this.texture, base.backgroundColor) && this.onClickedGrid != null) { this.onClickedGrid(this); } base.drawChildren(ignoreCulling); }
// Token: 0x06003291 RID: 12945 RVA: 0x001481DF File Offset: 0x001465DF public override void draw(bool ignoreCulling) { if (!this.isHidden) { SleekRender.drawImageMaterial(base.frame, this.texture, this.material); } base.drawChildren(ignoreCulling); }
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) { bool flag = SleekRender.drawToggle(base.frame, base.backgroundColor, this.state); if (flag != this.state && this.onToggled != null) { this.onToggled(this, flag); } this.state = flag; base.drawChildren(ignoreCulling); }
public override void draw(bool ignoreCulling) { if (!this.isHidden) { if (this.isAngled) { SleekRender.drawAngledImageTexture(base.frame, this.texture, this.angle, base.backgroundColor); } else { SleekRender.drawImageTexture(base.frame, this.texture, base.backgroundColor); } } 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, 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: 0x06003311 RID: 13073 RVA: 0x0014B990 File Offset: 0x00149D90 public static void drawLabel(Rect area, FontStyle fontStyle, TextAnchor fontAlignment, int fontSize, GUIContent content2, Color color, GUIContent content) { if (content.tooltip != null && content.tooltip.Length > 0 && area.Contains(Event.current.mousePosition)) { SleekRender.tooltip = color; } GUI.skin.label.fontStyle = fontStyle; GUI.skin.label.alignment = fontAlignment; GUI.skin.label.fontSize = SleekRender.getScaledFontSize(fontSize); bool richText = GUI.skin.label.richText; GUI.skin.label.richText = (content2 != null); Color outline = SleekRender.OUTLINE; outline.a *= color.a; GUI.contentColor = outline; if (content2 == null) { area.x -= 1f; GUI.Label(area, content); area.x += 2f; GUI.Label(area, content); area.x -= 1f; area.y -= 1f; GUI.Label(area, content); area.y += 2f; GUI.Label(area, content); area.y -= 1f; } else { area.x -= 1f; GUI.Label(area, content2); area.x += 2f; GUI.Label(area, content2); area.x -= 1f; area.y -= 1f; GUI.Label(area, content2); area.y += 2f; GUI.Label(area, content2); area.y -= 1f; } GUI.contentColor = color; GUI.Label(area, content); GUI.skin.label.richText = richText; }
// 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); }
public override void draw(bool ignoreCulling) { float num = SleekRender.drawSlider(base.frame, this.orientation, this.scroll, this.size, base.backgroundColor); if (num != this.scroll) { this._state = num / (1f - this.size); if (this.state < 0f) { this.state = 0f; } else if (this.state > 1f) { this.state = 1f; } if (this.onDragged != null) { this.onDragged(this, this.state); } } this.scroll = num; base.drawChildren(ignoreCulling); }
// Token: 0x0600338E RID: 13198 RVA: 0x0014E0D8 File Offset: 0x0014C4D8 public override void draw(bool ignoreCulling) { if (Screen.width != this.cachedScreenWidth || Screen.height != this.cachedScreenHeight) { this.cachedScreenWidth = Screen.width; this.cachedScreenHeight = Screen.height; base.build(); } Cursor.visible = false; bool proUI = OptionsSettings.proUI; if (!proUI) { if (!proUI) { GUI.skin = SleekWindow.freeStyle; } } else { GUI.skin = SleekWindow.proStyle; } if (this.isEnabled) { if (Input.mousePosition.x != this._mouse_x || Input.mousePosition.y != this._mouse_y) { this._mouse_x = Input.mousePosition.x - base.frame.x; this._mouse_y = Input.mousePosition.y - base.frame.y; if (this.onMovedMouse != null) { this.onMovedMouse(this.mouse_x, this.mouse_y); } } base.update(); base.drawChildren(ignoreCulling); if (OptionsSettings.debug) { Color color = Color.green; this.debugBuilder.Length = 0; if (Provider.isConnected) { if (!Provider.isServer && Time.realtimeSinceStartup - Provider.lastNet > 3f) { color = Color.red; this.debugBuilder.Append("Server not responded in: "); this.debugBuilder.Append((int)(Time.realtimeSinceStartup - Provider.lastNet)); this.debugBuilder.Append("s Automatically disconnecting in: "); this.debugBuilder.Append(Provider.CLIENT_TIMEOUT - (int)(Time.realtimeSinceStartup - Provider.lastNet)); this.debugBuilder.Append("s"); } else { this.debugBuilder.Append(this.fps); this.debugBuilder.Append("/s "); this.debugBuilder.Append((int)(Provider.ping * 1000f)); this.debugBuilder.Append("ms "); this.debugBuilder.Append(Provider.APP_VERSION); if (Player.player != null && Player.player.channel.owner.isAdmin) { this.debugBuilder.Append(" "); this.debugBuilder.Append((!Player.player.look.isOrbiting) ? "F1" : "Orbiting"); this.debugBuilder.Append(" "); this.debugBuilder.Append((!Player.player.look.isTracking) ? "F2" : "Tracking"); this.debugBuilder.Append(" "); this.debugBuilder.Append((!Player.player.look.isLocking) ? "F3" : "Locking"); this.debugBuilder.Append(" "); this.debugBuilder.Append((!Player.player.look.isFocusing) ? "F4" : "Focusing"); this.debugBuilder.Append(" "); this.debugBuilder.Append((!Player.player.look.isSmoothing) ? "F5" : "Smoothing"); this.debugBuilder.Append(" "); this.debugBuilder.Append((!Player.player.workzone.isBuilding) ? "F6" : "Building"); } if (Assets.isLoading) { this.debugBuilder.Append(" Assets"); } if (Provider.isLoadingInventory) { this.debugBuilder.Append(" Economy"); } if (Provider.isLoadingUGC) { this.debugBuilder.Append(" Workshop"); } if (Level.isLoadingContent) { this.debugBuilder.Append(" Content"); } if (Level.isLoadingLighting) { this.debugBuilder.Append(" Lighting"); } if (Level.isLoadingVehicles) { this.debugBuilder.Append(" Vehicles"); } if (Level.isLoadingBarricades) { this.debugBuilder.Append(" Barricades"); } if (Level.isLoadingStructures) { this.debugBuilder.Append(" Structures"); } if (Level.isLoadingArea) { this.debugBuilder.Append(" Area"); } if (Player.isLoadingInventory) { this.debugBuilder.Append(" Inventory"); } if (Player.isLoadingLife) { this.debugBuilder.Append(" Life"); } if (Player.isLoadingClothing) { this.debugBuilder.Append(" Clothing"); } } } else { this.debugBuilder.Append(this.fps); this.debugBuilder.Append("/s"); } SleekRender.drawLabel(this.debugRect, FontStyle.Normal, TextAnchor.UpperLeft, 12, false, color, this.debugBuilder.ToString()); } } if (this.isEnabled || this.drawCursorWhileDisabled) { if (this.showCursor) { this.cursorRect.x = Input.mousePosition.x; this.cursorRect.y = (float)Screen.height - Input.mousePosition.y; GUI.color = OptionsSettings.cursorColor; if (Sleek2Pointer.cursor != null) { this.cursorRect.position = this.cursorRect.position - Sleek2Pointer.hotspot; GUI.DrawTexture(this.cursorRect, Sleek2Pointer.cursor); } else if (this.cursor != null) { GUI.DrawTexture(this.cursorRect, this.cursor); } GUI.color = Color.white; if (Event.current.type == EventType.Repaint) { if (GUI.tooltip != this.lastTooltip) { this.lastTooltip = GUI.tooltip; this.startedTooltip = Time.realtimeSinceStartup; } if (GUI.tooltip != string.Empty && (double)(Time.realtimeSinceStartup - this.startedTooltip) > 0.5) { this.tooltipRect.y = (float)Screen.height - Input.mousePosition.y - 30f; if (Input.mousePosition.x > (float)Screen.width - this.tooltipRect.width - 30f) { this.tooltipRect.x = Input.mousePosition.x - 30f - this.tooltipRect.width; SleekRender.drawLabel(this.tooltipRect, FontStyle.Bold, TextAnchor.MiddleRight, 12, false, SleekRender.tooltip, GUI.tooltip); } else { this.tooltipRect.x = Input.mousePosition.x + 30f; SleekRender.drawLabel(this.tooltipRect, FontStyle.Bold, TextAnchor.MiddleLeft, 12, false, SleekRender.tooltip, GUI.tooltip); } } } if (Cursor.lockState != CursorLockMode.None) { Cursor.lockState = CursorLockMode.None; } } else if (Cursor.lockState != CursorLockMode.Locked) { Cursor.lockState = CursorLockMode.Locked; } } if (Event.current.type == EventType.MouseDown) { if (this.onClickedMouse != null) { this.onClickedMouse(); } if (this.onClickedMouseStarted != null) { this.onClickedMouseStarted(); } } else if (Event.current.type == EventType.MouseUp && this.onClickedMouseStopped != null) { this.onClickedMouseStopped(); } }
public override void draw(bool ignoreCulling) { SleekRender.drawTile(base.frame, this.texture, base.backgroundColor); base.drawChildren(ignoreCulling); }
public override void draw(bool ignoreCulling) { SleekRender.drawLabel(base.frame, this.fontStyle, this.fontAlignment, this.fontSize, this.content2, base.foregroundColor, this.content); base.drawChildren(ignoreCulling); }
public static string drawField(Rect area, FontStyle fontStyle, TextAnchor fontAlignment, int fontSize, Color color_0, Color color_1, string text, int maxLength, bool multiline) { return(SleekRender.drawField(area, fontStyle, fontAlignment, fontSize, color_0, color_1, text, maxLength, string.Empty, multiline)); }