Browse Source

Wordwrap long summary text

master
chrisgregan 11 years ago
parent
commit
5cc39bf64e
  1. 8
      Assets/Fungus/Editor/FungusScript/FungusCommandEditor.cs
  2. 4
      Assets/Fungus/Editor/FungusScript/FungusScriptEditor.cs
  3. 5
      Assets/Fungus/Editor/FungusScript/SayEditor.cs
  4. BIN
      Assets/Shuttle/ShuttleGame.unity

8
Assets/Fungus/Editor/FungusScript/FungusCommandEditor.cs

@ -45,7 +45,13 @@ namespace Fungus.Script
}
GUIStyle labelStyle = EditorStyles.miniLabel;
GUILayout.Label(t.GetSummary().Replace("\n", "").Replace("\r", ""), labelStyle);
labelStyle.wordWrap = true;
string summary = t.GetSummary().Replace("\n", "").Replace("\r", "");
if (summary.Length > 80)
{
summary = summary.Substring(0, 80) + "...";
}
GUILayout.Label(summary, labelStyle);
GUILayout.FlexibleSpace();

4
Assets/Fungus/Editor/FungusScript/FungusScriptEditor.cs

@ -15,7 +15,7 @@ namespace Fungus.Script
void OnEnable()
{
if (serializedObject != null)
if (this != null && serializedObject != null)
{
variablesProperty = serializedObject.FindProperty("variables");
}
@ -231,7 +231,7 @@ namespace Fungus.Script
{
GUIStyle labelStyle = new GUIStyle(EditorStyles.miniLabel);
labelStyle.wordWrap = true;
GUILayout.Label(helpTextAttr.HelpText, labelStyle);
EditorGUILayout.HelpBox(helpTextAttr.HelpText, MessageType.Info);
break;
}
}

5
Assets/Fungus/Editor/FungusScript/SayEditor.cs

@ -19,8 +19,9 @@ namespace Fungus.Script
string character = EditorGUILayout.TextField(new GUIContent("Character", "Character to display in dialog"), t.character);
EditorGUILayout.PrefixLabel(new GUIContent("Say Text", "Text to display in dialog"));
EditorStyles.textField.wordWrap = true;
string text = EditorGUILayout.TextArea(t.text, GUILayout.MinHeight(50));
GUIStyle sayStyle = new GUIStyle(EditorStyles.textArea);
sayStyle.wordWrap = true;
string text = EditorGUILayout.TextArea(t.text, sayStyle, GUILayout.MinHeight(30));
Say.ShowCondition showCondition = (Say.ShowCondition)EditorGUILayout.EnumPopup(new GUIContent("Show Condition", "Condition when this say text should be visible."), t.showCondition);

BIN
Assets/Shuttle/ShuttleGame.unity

Binary file not shown.
Loading…
Cancel
Save