From 7a45f9287317666cd47f4b681b9030fa8d413328 Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Tue, 2 Sep 2014 16:16:06 +0100 Subject: [PATCH] Moved command properties to inspector. Fixed dialog bugs. --- Assets/Fungus/Dialog/Editor/SayEditor.cs | 5 +- Assets/Fungus/Dialog/Scripts/ChooseDialog.cs | 13 +- Assets/Fungus/Dialog/Scripts/Dialog.cs | 4 +- .../Editor/FungusCommandEditor.cs | 123 ++++++++++-------- .../FungusScript/Editor/FungusScriptEditor.cs | 8 +- .../FungusScript/Editor/FungusScriptWindow.cs | 8 +- .../Editor/FungusVariableListAdaptor.cs | 5 +- .../FungusScript/Scripts/FungusCommand.cs | 3 - .../FungusScript/Scripts/FungusScript.cs | 2 + .../Fungus/FungusScript/Scripts/Sequence.cs | 1 + Assets/Shuttle/ShuttleGame.unity | Bin 117020 -> 116700 bytes 11 files changed, 100 insertions(+), 72 deletions(-) diff --git a/Assets/Fungus/Dialog/Editor/SayEditor.cs b/Assets/Fungus/Dialog/Editor/SayEditor.cs index 5a908049..a0b37824 100644 --- a/Assets/Fungus/Dialog/Editor/SayEditor.cs +++ b/Assets/Fungus/Dialog/Editor/SayEditor.cs @@ -55,8 +55,7 @@ namespace Fungus.Script EditorGUILayout.BeginHorizontal(); - float minHeight = sayStyle.CalcHeight(new GUIContent(t.storyText), EditorGUIUtility.currentViewWidth); - string text = EditorGUILayout.TextArea(t.storyText, sayStyle, GUILayout.MinHeight(minHeight + 10), GUILayout.ExpandHeight(true)); + string text = EditorGUILayout.TextArea(t.storyText, sayStyle, GUILayout.MinHeight(60)); if (t.character != null && t.character.characterImage != null && @@ -65,7 +64,7 @@ namespace Fungus.Script Texture2D characterTexture = t.character.characterImage.texture; float aspect = (float)characterTexture.width / (float)characterTexture.height; - Rect previewRect = GUILayoutUtility.GetAspectRect(aspect, GUILayout.Width(40), GUILayout.ExpandWidth(false)); + Rect previewRect = GUILayoutUtility.GetAspectRect(aspect, GUILayout.Width(50), GUILayout.ExpandWidth(false)); CharacterEditor characterEditor = Editor.CreateEditor(t.character) as CharacterEditor; if (characterEditor != null) { diff --git a/Assets/Fungus/Dialog/Scripts/ChooseDialog.cs b/Assets/Fungus/Dialog/Scripts/ChooseDialog.cs index 6fb14605..57bd93eb 100644 --- a/Assets/Fungus/Dialog/Scripts/ChooseDialog.cs +++ b/Assets/Fungus/Dialog/Scripts/ChooseDialog.cs @@ -11,7 +11,7 @@ namespace Fungus.Script [ExecuteInEditMode] public class ChooseDialog : Dialog { - public Slider slider; + public Slider timeoutSlider; public class Option { @@ -36,6 +36,12 @@ namespace Fungus.Script activeDialogs.Remove(this); } + public override void ShowDialog (bool visible) + { + base.ShowDialog (visible); + timeoutSlider.gameObject.SetActive(false); + } + public void Choose(string text, List