From 0c46a96761d4705154510c582353b07f492e17ab Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Mon, 1 Sep 2014 17:48:17 +0100 Subject: [PATCH] Help info for text tags --- Assets/Fungus/Dialog/Editor/SayEditor.cs | 26 +++++++++++++++++++++++ Assets/Shuttle/ShuttleGame.unity | Bin 116844 -> 116860 bytes 2 files changed, 26 insertions(+) diff --git a/Assets/Fungus/Dialog/Editor/SayEditor.cs b/Assets/Fungus/Dialog/Editor/SayEditor.cs index 44a50e9c..738487de 100644 --- a/Assets/Fungus/Dialog/Editor/SayEditor.cs +++ b/Assets/Fungus/Dialog/Editor/SayEditor.cs @@ -11,13 +11,39 @@ namespace Fungus.Script [CustomEditor (typeof(Say))] public class SayEditor : FungusCommandEditor { + static public bool showTagHelp; + public override void DrawCommandGUI() { Say t = target as Say; EditorGUI.BeginChangeCheck(); + EditorGUILayout.BeginHorizontal(); EditorGUILayout.PrefixLabel(new GUIContent("Say 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) + { + 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)); + } GUIStyle sayStyle = new GUIStyle(EditorStyles.textArea); sayStyle.wordWrap = true; diff --git a/Assets/Shuttle/ShuttleGame.unity b/Assets/Shuttle/ShuttleGame.unity index 31249adb0beeccda828477ae656d1658ce0de38f..98580b17e16b3d5ec6d05d8f9c044094681f5c63 100644 GIT binary patch delta 586 zcmZ9HKS%;`6vy9-!0UgYL4!j}&=N%SM~EPs8oe+HYLFIdD-o^Ku(JO}F7dMnyr7_= zpn|v-p_<&9f~F9nCL>!y$guCh&(My0clSQucb|KgiJ9^-lS1656Q@Fp%C*ALp4LMm z`YIF(Ufk6}%zLp&G=pcBH4N4!E_>MAA73I00jFg-5j8IpStAA7+0f3xYMS5=~<+FIfmIB2+`6A(|_($30`dmNg<9*qa>R z2O9-56t9vUfThHdp-|R|oQNuAd0d@-H`oaJ;?k2~H(*%q?}zu!y8Q#<(@?}W$`#v> z34az$Em7=%4Q-as)we$RHDR~0St+jazd?L66}OyOIN@~Y zMD$%Mm4bMyB|Vsl6HVjHa>l^g#Ho|51KI*n3^*spgUGT-WXJtUPNZE8b%HJ7UQx_| zoe1uOLP-$05&g(7&LYylLg@ZVHU~z_L;>`QlEuIRLM