From 424e7a1195bd2de1f556700119ebe461650b0e10 Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Thu, 28 Aug 2014 14:38:20 +0100 Subject: [PATCH] Hide selected options --- Assets/Fungus/Dialog/Commands/AddOption.cs | 9 +++++++++ Assets/Fungus/Dialog/Commands/Say.cs | 4 ++-- .../Fungus/Dialog/Editor/AddOptionEditor.cs | 5 ++++- Assets/Fungus/Dialog/Editor/SayEditor.cs | 4 ++-- Assets/Shuttle/ShuttleGame.unity | Bin 106324 -> 110476 bytes 5 files changed, 17 insertions(+), 5 deletions(-) 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 8d587f64b80e92bc63952b7d41e73afc502e26bc..e8fd990d37affa0a78a063b2941ef2274b8db6ef 100644 GIT binary patch delta 11486 zcmbuFe{fVqw#RRi9}MINBMdNLkU;_j62kC97jvTA71g@~x>J>%lhjI(<%CzL^$@X=VXDI)^bLUPH zz!l$d=Y-eYx#8?8m0I5mZ;JH26rR}H5Y<22R~(ht`qYv4!+hSbzO6UP-(s!#g9kF7 zeQ;!K>4u`>>`hCG%Zk@m78m)F4iED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