diff --git a/Assets/Fungus/Dialog/Commands/AddOption.cs b/Assets/Fungus/Dialog/Commands/AddOption.cs index 0cf0d168..1feeaf5e 100644 --- a/Assets/Fungus/Dialog/Commands/AddOption.cs +++ b/Assets/Fungus/Dialog/Commands/AddOption.cs @@ -13,8 +13,17 @@ namespace Fungus.Script public string optionText; public Sequence targetSequence; + public bool hideOnSelected; + public override void OnEnter() { + if (hideOnSelected && + targetSequence.GetExecutionCount() > 0) + { + Continue(); + return; + } + Choose.Option option = new Choose.Option(); option.optionText = optionText; option.targetSequence = targetSequence; diff --git a/Assets/Fungus/Dialog/Commands/Say.cs b/Assets/Fungus/Dialog/Commands/Say.cs index 8c5791dc..385d8464 100644 --- a/Assets/Fungus/Dialog/Commands/Say.cs +++ b/Assets/Fungus/Dialog/Commands/Say.cs @@ -15,12 +15,12 @@ namespace Fungus.Script public Character character; public string storyText; - public bool displayOnce; + public bool showOnce; int executionCount; public override void OnEnter() { - if (displayOnce && executionCount > 0) + if (showOnce && executionCount > 0) { Continue(); return; diff --git a/Assets/Fungus/Dialog/Editor/AddOptionEditor.cs b/Assets/Fungus/Dialog/Editor/AddOptionEditor.cs index dd8f3b8e..8a17821a 100644 --- a/Assets/Fungus/Dialog/Editor/AddOptionEditor.cs +++ b/Assets/Fungus/Dialog/Editor/AddOptionEditor.cs @@ -17,7 +17,7 @@ namespace Fungus.Script EditorGUI.BeginChangeCheck(); - string optionText = EditorGUILayout.TextField(new GUIContent("Option Text", "Text display on the option button."), + string optionText = EditorGUILayout.TextField(new GUIContent("Option Text", "Text to display on the option button."), t.optionText); Sequence targetSequence = SequenceEditor.SequenceField(new GUIContent("Target Sequence", "Sequence to execute when this option is selected by the player."), @@ -25,11 +25,14 @@ namespace Fungus.Script t.GetFungusScript(), t.targetSequence); + bool hideOnSelected = EditorGUILayout.Toggle(new GUIContent("Hide On Selected", "Hide this option forever once the player has selected it."), t.hideOnSelected); + if (EditorGUI.EndChangeCheck()) { Undo.RecordObject(t, "Set Add Option"); t.optionText = optionText; t.targetSequence = targetSequence; + t.hideOnSelected = hideOnSelected; } } } diff --git a/Assets/Fungus/Dialog/Editor/SayEditor.cs b/Assets/Fungus/Dialog/Editor/SayEditor.cs index 06e87a81..8dd51519 100644 --- a/Assets/Fungus/Dialog/Editor/SayEditor.cs +++ b/Assets/Fungus/Dialog/Editor/SayEditor.cs @@ -31,7 +31,7 @@ namespace Fungus.Script new GUIContent(""), t.dialog); - bool displayOnce = EditorGUILayout.Toggle(new GUIContent("Display Once", "Display this text once and never show it again."), t.displayOnce); + bool showOnce = EditorGUILayout.Toggle(new GUIContent("Show Once", "Show this text once and never show it again."), t.showOnce); if (EditorGUI.EndChangeCheck()) { @@ -39,7 +39,7 @@ namespace Fungus.Script t.storyText = text; t.character = character; t.dialog = dialog; - t.displayOnce = displayOnce; + t.showOnce = showOnce; } } } diff --git a/Assets/Shuttle/ShuttleGame.unity b/Assets/Shuttle/ShuttleGame.unity index 8d587f64..e8fd990d 100644 Binary files a/Assets/Shuttle/ShuttleGame.unity and b/Assets/Shuttle/ShuttleGame.unity differ