Browse Source

Remove hidevariablesInInspector from FungusEditorPrefs as per feedback

Shorten ShowVariablesInInspector as per feedback
master
desktop-maesty/steve 8 years ago
parent
commit
4375852e4b
  1. 2
      Assets/Fungus/Scripts/Components/Flowchart.cs
  2. 10
      Assets/Fungus/Scripts/Editor/FlowchartEditor.cs
  3. 6
      Assets/Fungus/Scripts/Editor/FungusEditorPreferences.cs

2
Assets/Fungus/Scripts/Components/Flowchart.cs

@ -81,7 +81,7 @@ namespace Fungus
[SerializeField] protected string luaBindingName = "flowchart"; [SerializeField] protected string luaBindingName = "flowchart";
[Tooltip("Draw the variable gui in the inspector.")] [Tooltip("Draw the variable gui in the inspector.")]
[SerializeField] protected bool showVariablesInInspector = true; [SerializeField] protected bool showVariables = true;
protected static List<Flowchart> cachedFlowcharts = new List<Flowchart>(); protected static List<Flowchart> cachedFlowcharts = new List<Flowchart>();

10
Assets/Fungus/Scripts/Editor/FlowchartEditor.cs

@ -50,7 +50,7 @@ namespace Fungus.EditorUtils
hideCommandsProp = serializedObject.FindProperty("hideCommands"); hideCommandsProp = serializedObject.FindProperty("hideCommands");
luaEnvironmentProp = serializedObject.FindProperty("luaEnvironment"); luaEnvironmentProp = serializedObject.FindProperty("luaEnvironment");
luaBindingNameProp = serializedObject.FindProperty("luaBindingName"); luaBindingNameProp = serializedObject.FindProperty("luaBindingName");
varInspectorProp = serializedObject.FindProperty("showVariablesInInspector"); varInspectorProp = serializedObject.FindProperty("showVariables");
addTexture = FungusEditorResources.AddSmall; addTexture = FungusEditorResources.AddSmall;
} }
@ -72,11 +72,7 @@ namespace Fungus.EditorUtils
EditorGUILayout.PropertyField(showLineNumbersProp); EditorGUILayout.PropertyField(showLineNumbersProp);
EditorGUILayout.PropertyField(luaEnvironmentProp); EditorGUILayout.PropertyField(luaEnvironmentProp);
EditorGUILayout.PropertyField(luaBindingNameProp); EditorGUILayout.PropertyField(luaBindingNameProp);
EditorGUILayout.PropertyField(varInspectorProp);
if (!FungusEditorPreferences.hideVariableInFlowchartInspector)
{
EditorGUILayout.PropertyField(varInspectorProp);
}
// Show list of commands to hide in Add Command menu // Show list of commands to hide in Add Command menu
ReorderableListGUI.Title(new GUIContent(hideCommandsProp.displayName, hideCommandsProp.tooltip)); ReorderableListGUI.Title(new GUIContent(hideCommandsProp.displayName, hideCommandsProp.tooltip));
@ -95,7 +91,7 @@ namespace Fungus.EditorUtils
serializedObject.ApplyModifiedProperties(); serializedObject.ApplyModifiedProperties();
if (varInspectorProp.boolValue && !FungusEditorPreferences.hideVariableInFlowchartInspector) if (varInspectorProp.boolValue)
{ {
GUILayout.Space(20); GUILayout.Space(20);

6
Assets/Fungus/Scripts/Editor/FungusEditorPreferences.cs

@ -17,8 +17,7 @@ namespace Fungus
// Have we loaded the prefs yet // Have we loaded the prefs yet
private static bool prefsLoaded = false; private static bool prefsLoaded = false;
public static bool hideMushroomInHierarchy, public static bool hideMushroomInHierarchy;
hideVariableInFlowchartInspector ;
static FungusEditorPreferences() static FungusEditorPreferences()
{ {
@ -37,20 +36,17 @@ namespace Fungus
// Preferences GUI // Preferences GUI
hideMushroomInHierarchy = EditorGUILayout.Toggle("Hide Mushroom Flowchart Icon", hideMushroomInHierarchy); hideMushroomInHierarchy = EditorGUILayout.Toggle("Hide Mushroom Flowchart Icon", hideMushroomInHierarchy);
hideVariableInFlowchartInspector = EditorGUILayout.Toggle("Hide Variables in Flowchart Inspector", hideVariableInFlowchartInspector);
// Save the preferences // Save the preferences
if (GUI.changed) if (GUI.changed)
{ {
EditorPrefs.SetBool("hideMushroomInHierarchy", hideMushroomInHierarchy); EditorPrefs.SetBool("hideMushroomInHierarchy", hideMushroomInHierarchy);
EditorPrefs.SetBool("hideVariableInFlowchartInspector", hideVariableInFlowchartInspector);
} }
} }
public static void LoadOnScriptLoad() public static void LoadOnScriptLoad()
{ {
hideMushroomInHierarchy = EditorPrefs.GetBool("hideMushroomInHierarchy", false); hideMushroomInHierarchy = EditorPrefs.GetBool("hideMushroomInHierarchy", false);
hideVariableInFlowchartInspector = EditorPrefs.GetBool("hideVariableInFlowchartInspector", true);
prefsLoaded = true; prefsLoaded = true;
} }
} }

Loading…
Cancel
Save