Browse Source

Remove hidevariablesInInspector from FungusEditorPrefs as per feedback

Shorten ShowVariablesInInspector as per feedback
master
desktop-maesty/steve 7 years ago
parent
commit
4375852e4b
  1. 2
      Assets/Fungus/Scripts/Components/Flowchart.cs
  2. 8
      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";
[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>();

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

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

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

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

Loading…
Cancel
Save