diff --git a/Assets/Fungus/Dialog/Editor/ChooseEditor.cs b/Assets/Fungus/Dialog/Editor/ChooseEditor.cs index 18c85035..32339b86 100644 --- a/Assets/Fungus/Dialog/Editor/ChooseEditor.cs +++ b/Assets/Fungus/Dialog/Editor/ChooseEditor.cs @@ -11,13 +11,28 @@ namespace Fungus.Script [CustomEditor (typeof(Choose))] public class ChooseEditor : FungusCommandEditor { + static public bool showTagHelp; + public override void DrawCommandGUI() { Choose t = target as Choose; EditorGUI.BeginChangeCheck(); + EditorGUILayout.BeginHorizontal(); EditorGUILayout.PrefixLabel(new GUIContent("Choose Text", "Text to display in dialog")); + GUILayout.FlexibleSpace(); + if (GUILayout.Button(new GUIContent("Tag Help", "Show help info for tags"), new GUIStyle(EditorStyles.miniButton))) + { + showTagHelp = !showTagHelp; + } + EditorGUILayout.EndHorizontal(); + + if (showTagHelp) + { + SayEditor.DrawTagHelpLabel(); + } + GUIStyle sayStyle = new GUIStyle(EditorStyles.textArea); sayStyle.wordWrap = true; string chooseText = EditorGUILayout.TextArea(t.chooseText, sayStyle, GUILayout.MinHeight(30)); diff --git a/Assets/Fungus/Dialog/Editor/SayEditor.cs b/Assets/Fungus/Dialog/Editor/SayEditor.cs index 738487de..b1212882 100644 --- a/Assets/Fungus/Dialog/Editor/SayEditor.cs +++ b/Assets/Fungus/Dialog/Editor/SayEditor.cs @@ -13,6 +13,23 @@ namespace Fungus.Script { static public bool showTagHelp; + static public void DrawTagHelpLabel() + { + string tagsText = "\t{b} Bold Text {/b}\n" + + "\t{i} Italic Text {/i}\n" + + "\t{color=red} Color Text {/color}\n" + + "\t{w}, {w=0.5} Wait \n" + + "\t{wi} Wait for input\n" + + "\t{wc} Wait for input and clear\n" + + "\t{wp}, {wp=0.5} Wait on punctuation\n" + + "\t{c} Clear\n" + + "\t{s}, {s=60} Writing speed (chars per sec)\n" + + "\t{x} Exit"; + + float pixelHeight = EditorStyles.miniLabel.CalcHeight(new GUIContent(tagsText), EditorGUIUtility.currentViewWidth); + EditorGUILayout.SelectableLabel(tagsText, EditorStyles.miniLabel, GUILayout.MinHeight(pixelHeight)); + } + public override void DrawCommandGUI() { Say t = target as Say; @@ -30,19 +47,7 @@ namespace Fungus.Script if (showTagHelp) { - string tagsText = "\t{b} Bold Text {/b}\n" + - "\t{i} Italic Text {/i}\n" + - "\t{color=red} Color Text {/color}\n" + - "\t{w}, {w=0.5} Wait \n" + - "\t{wi} Wait for input\n" + - "\t{wc} Wait for input and clear\n" + - "\t{wp}, {wp=0.5} Wait on punctuation\n" + - "\t{c} Clear\n" + - "\t{s}, {s=60} Writing speed (chars per sec)\n" + - "\t{x} Exit"; - - float pixelHeight = EditorStyles.miniLabel.CalcHeight(new GUIContent(tagsText), EditorGUIUtility.currentViewWidth); - EditorGUILayout.SelectableLabel(tagsText, EditorStyles.miniLabel, GUILayout.MinHeight(pixelHeight)); + DrawTagHelpLabel(); } GUIStyle sayStyle = new GUIStyle(EditorStyles.textArea); diff --git a/Assets/Shuttle/ShuttleGame.unity b/Assets/Shuttle/ShuttleGame.unity index 98580b17..b178fc0e 100644 Binary files a/Assets/Shuttle/ShuttleGame.unity and b/Assets/Shuttle/ShuttleGame.unity differ