private void HandleBarDisabling(IconProgressBar bar) { if (bar.Disabled) { bar.Color = new Color(0.73f, 0.73f, 0.73f); } else { bar.Color = BarHelper.GetBarColour(SelectedType, bar.Name, IsProduction); } MoveBars(); }
private void BarToggled(InputEvent @event, IconProgressBar bar) { if (@event is InputEventMouseButton eventMouse && @event.IsPressed()) { if (eventMouse.ButtonIndex != (int)ButtonList.Left) { return; } bar.Disabled = !bar.Disabled; HandleBarDisabling(bar); } }
public override void OnInspectorGUI() { #region Initialise serializedObject.Update(); current = (IconProgressBar)target; #endregion GUILayout.Space(5); EditorGUILayout.PropertyField(backingImage, new GUIContent("Backing Image")); ShowMainImage(); if (current.SetupFinished()) { current.MaxIcons = EditorGUILayout.IntField(new GUIContent("Max Icons"), current.MaxIcons); current.Padding = EditorGUILayout.FloatField(new GUIContent("Padding"), current.Padding); GUILayout.Space(10); current.maxValue = EditorGUILayout.FloatField(new GUIContent("Max Value"), current.maxValue); current.CurrentValue = EditorGUILayout.FloatField(new GUIContent("Current Value"), current.CurrentValue); ShowDelay(); GUILayout.Space(10); if (current.GetType().Equals(typeof(IconProgressBar)))//don't bother asking to show fractions for the split progress bars { current.showFractions = EditorGUILayout.Toggle(new GUIContent("Show Fractions", "If true then you will see the last icon being clipped. Otherwise only shows full icons"), current.showFractions); } if (Application.isEditor) { if (current.HasInactiveImages()) { if (GUILayout.Button("Clear Un-Used Images")) { current.ClearInactive(); } } } } if (GUI.changed) { EditorUtility.SetDirty(target); } serializedObject.ApplyModifiedProperties();// Apply changes to the serializedProperty - always do this in the end of OnInspectorGUI. }
public override void OnInspectorGUI() { #region Initialise serializedObject.Update(); current = (IconProgressBar)target; #endregion DrawUI(false); if (GUI.changed) { EditorUtility.SetDirty(target); } serializedObject.ApplyModifiedProperties();// Apply changes to the serializedProperty - always do this in the end of OnInspectorGUI. }
public override void OnInspectorGUI() { #region Initialise serializedObject.Update(); current = (IconProgressBar)target; #endregion GUILayout.Space(5); EditorGUILayout.PropertyField(backingImage, new GUIContent("Backing Image")); EditorGUILayout.PropertyField(mainImage, new GUIContent("Main Image")); if (mainImage.objectReferenceValue != null && backingImage.objectReferenceValue != null) { current.MaxIcons = EditorGUILayout.IntField(new GUIContent("Max Icons"), current.MaxIcons); current.Padding = EditorGUILayout.FloatField(new GUIContent("Padding"), current.Padding); GUILayout.Space(10); current.maxValue = EditorGUILayout.FloatField(new GUIContent("Max Value"), current.maxValue); current.currentValue = EditorGUILayout.FloatField(new GUIContent("Current Value"), current.currentValue); GUILayout.Space(10); current.showFractions = EditorGUILayout.Toggle(new GUIContent("Show Fractions", "If true then you will see the last icon being clipped. Otherwise only shows full icons"), current.showFractions); if (Application.isEditor) { if (GUILayout.Button("Clear Un-Used Images")) { current.ClearInactive(); } } } if (GUI.changed) { EditorUtility.SetDirty(target); } serializedObject.ApplyModifiedProperties();// Apply changes to the serializedProperty - always do this in the end of OnInspectorGUI. }
private void OnBarMouseExit(IconProgressBar bar) { bar.Highlight = false; EmitSignal(nameof(SubBarMouseExit)); }
private void OnBarMouseOver(IconProgressBar bar) { bar.Highlight = true; EmitSignal(nameof(SubBarMouseEnter)); }