Browse Source

Added tag help to Choose dialog

master
chrisgregan 11 years ago
parent
commit
6bba4fe1a0
  1. 15
      Assets/Fungus/Dialog/Editor/ChooseEditor.cs
  2. 31
      Assets/Fungus/Dialog/Editor/SayEditor.cs
  3. BIN
      Assets/Shuttle/ShuttleGame.unity

15
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));

31
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);

BIN
Assets/Shuttle/ShuttleGame.unity

Binary file not shown.
Loading…
Cancel
Save