From 57a688f320f4424ae08f9db853c7708492c3ed98 Mon Sep 17 00:00:00 2001 From: desktop-maesty/steve Date: Sun, 3 Jun 2018 10:37:18 +1000 Subject: [PATCH 1/3] ElseIfs now confirm that the previous condition was at the same indent as themselves. -Corrects elifs from pairing incorrectly with nested ifs prior to themselves -Thanks to Wolfrug on the forum http://fungusgames.com/forum#!/support-questions:if-else-bug --- Assets/Fungus/Scripts/Commands/Condition.cs | 5 ++++- Assets/Fungus/Scripts/Components/Block.cs | 11 +++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Assets/Fungus/Scripts/Commands/Condition.cs b/Assets/Fungus/Scripts/Commands/Condition.cs index a8dacb34..26e14bc8 100644 --- a/Assets/Fungus/Scripts/Commands/Condition.cs +++ b/Assets/Fungus/Scripts/Commands/Condition.cs @@ -59,8 +59,11 @@ namespace Fungus else { System.Type previousCommandType = ParentBlock.GetPreviousActiveCommandType(); + var prevCmdIndent = ParentBlock.GetPreviousActiveCommandIndent(); - if (previousCommandType.IsSubclassOf(typeof(Condition))) + //handle our matching if or else if in the chain failing and moving to us, + // need to make sure it is the same indent level + if (prevCmdIndent == IndentLevel && previousCommandType.IsSubclassOf(typeof(Condition))) { // Else If behaves the same as an If command EvaluateAndContinue(); diff --git a/Assets/Fungus/Scripts/Components/Block.cs b/Assets/Fungus/Scripts/Components/Block.cs index 8fba6b91..c2d76d30 100644 --- a/Assets/Fungus/Scripts/Components/Block.cs +++ b/Assets/Fungus/Scripts/Components/Block.cs @@ -355,6 +355,17 @@ namespace Fungus return null; } + public virtual int GetPreviousActiveCommandIndent() + { + if (previousActiveCommandIndex >= 0 && + previousActiveCommandIndex < commandList.Count) + { + return commandList[previousActiveCommandIndex].IndentLevel; + } + + return -1; + } + /// /// Recalculate the indent levels for all commands in the list. /// From 98689e547fc9d70ff5f01dd61a19fe47961f433a Mon Sep 17 00:00:00 2001 From: desktop-maesty/steve Date: Sun, 24 Jun 2018 08:26:27 +1000 Subject: [PATCH 2/3] Conversation Manager Regex now allows - and _ within say params group. -Allows conversation to use portraits like calling-neutral --- Assets/Fungus/Scripts/Utils/ConversationManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/Fungus/Scripts/Utils/ConversationManager.cs b/Assets/Fungus/Scripts/Utils/ConversationManager.cs index 7dcf8efd..431b7bad 100644 --- a/Assets/Fungus/Scripts/Utils/ConversationManager.cs +++ b/Assets/Fungus/Scripts/Utils/ConversationManager.cs @@ -116,7 +116,7 @@ namespace Fungus { //find SimpleScript say strings with portrait options //You can test regex matches here: http://regexstorm.net/tester - var sayRegex = new Regex(@"((?[\w ""><.']*):)?(?.*)\r*(\n|$)"); + var sayRegex = new Regex(@"((?[\w ""><.'-_]*):)?(?.*)\r*(\n|$)"); MatchCollection sayMatches = sayRegex.Matches(conv); var items = new List(sayMatches.Count); From 3f9948d6c52d4aab3fcca712410e22684739e5df Mon Sep 17 00:00:00 2001 From: Chris Gregan Date: Mon, 25 Jun 2018 22:58:02 +0100 Subject: [PATCH 3/3] Updated CHANGELOG and command reference docs --- Assets/Fungus/Docs/CHANGELOG.txt | 74 +++++++++++++++++++-------- Docs/Doxyfile | 2 +- Docs/command_ref/flow_commands.md | 42 +++++++++++++++ Docs/command_ref/variable_commands.md | 11 ++++ Docs/fungus_docs/change_log.md | 74 +++++++++++++++++++-------- 5 files changed, 162 insertions(+), 41 deletions(-) diff --git a/Assets/Fungus/Docs/CHANGELOG.txt b/Assets/Fungus/Docs/CHANGELOG.txt index d21f6b8a..e96f5ccf 100644 --- a/Assets/Fungus/Docs/CHANGELOG.txt +++ b/Assets/Fungus/Docs/CHANGELOG.txt @@ -2,6 +2,40 @@ Changelog {#changelog} ========= [TOC] +v3.9.0 {#v3_9_0} +====== + +## Added +- Conversation command supports setting default clear, wait for input and fade options #673 +- Added Fungus Priority Signals #671 #670 + - allows fungus to notify the outside world that it is doing something of priority so the outside world can pause +- Added GetKey fungus command. #683 + - Supports positive and negative keybindings output to a bool, float or int variable + - Supports checking for pressed, release and current state + - Uses keycode with optional fallback to key name +- Disabled Flowcharts and EventHandlers. #682 +- Added Dialog history on Save Menu UI #675 +- Added BlockReference, a simple data type with a property drawer that makes it easier to select a target fungus block from external c# scripts. #669 +- Added comparison (equals and not equals) as well as assign functionality to most variable types. #668 + +## Changed +- Updated to Unity 2018.1 #681 +- Conversation Manager Regex now allows - and _ within say params group. #692 +- Conversation example scene makes some basic use of new Conversation features +- Update LeanTween to 2.46 #689 +- PortraitController forces alpha and color tweens to be non recursive. +- Updated playground demos + - Football uses GetKey instead of GetAxis (get axis was failing in some packages as inputmanager axis were not imported) + - Defender had a bug due to a change in how unity syncs 'up' between transform and rb2d + +## Fixed +- ElseIfs now confirm that the previous condition was at the same indent as themselves. #693 +- NarrativeLog is tolerant of null Name or Story fields #690 +- Force the hierarchy icon list to refresh when a script a is loaded/changed #672 +- Eventhandlers no longer fire when the flowchart is disabled #682 +- StopFlowchart can continue now #685 +- Fixed stray \\ that were not being stripped on Mac OS, when importing editor resources. #686 + v3.8.0 {#v3_8_0} ====== @@ -324,16 +358,16 @@ Awesome github contributors: ## Added - FungusLua: Lua scripting support for Fungus via wrapper components for using MoonSharp in Unity. #281, #317, #334, #237, #235, #232, #224 - - LuaEnvironment component: Execution environment for running Lua scripts. - - LuaUtils component: Extends LuaEnvironment with lots of useful features. - - LuaBindings: Maps Unity objects & components to Lua variables for use in Lua scripts. - - LuaScript: Runs Lua code from a text file or from a string property. - - LuaStore: Stores variables in a global table which persists across scene loads. - - FungusModule: A set of utility functions for scripting Unity and Fungus from Lua. - - FungusPrefs: An improved version of PlayerPrefs that can be easily used from Lua. - - ExecuteHandler: Listens for any standard Unity event and calls a method on a component in the gameobject. #247 - - ExecuteLua command: Run some Lua script in a Fungus command. Return values can be stored in Fungus variables. - - PODTypeFactory: Utility factory class for instantiating Plain-Old-Data (POD) types like Color, Vector3, etc. + - LuaEnvironment component: Execution environment for running Lua scripts. + - LuaUtils component: Extends LuaEnvironment with lots of useful features. + - LuaBindings: Maps Unity objects & components to Lua variables for use in Lua scripts. + - LuaScript: Runs Lua code from a text file or from a string property. + - LuaStore: Stores variables in a global table which persists across scene loads. + - FungusModule: A set of utility functions for scripting Unity and Fungus from Lua. + - FungusPrefs: An improved version of PlayerPrefs that can be easily used from Lua. + - ExecuteHandler: Listens for any standard Unity event and calls a method on a component in the gameobject. #247 + - ExecuteLua command: Run some Lua script in a Fungus command. Return values can be stored in Fungus variables. + - PODTypeFactory: Utility factory class for instantiating Plain-Old-Data (POD) types like Color, Vector3, etc. - Lots of FungusLua example scenes - Fungus documentation now has an extensive section on LuaScripting. - StringDataMulti: Like StringData, but uses a multi-line textbox in the inspector. @@ -405,16 +439,16 @@ v2.4.0 {#v2_4_0} ## Added - FungusLua: Lua scripting support for Fungus via wrapper components for using MoonSharp in Unity. #281, #317, #334, #237, #235, #232, #224 - - LuaEnvironment component: Execution environment for running Lua scripts. - - LuaUtils component: Extends LuaEnvironment with lots of useful features. - - LuaBindings: Maps Unity objects & components to Lua variables for use in Lua scripts. - - LuaScript: Runs Lua code from a text file or from a string property. - - LuaStore: Stores variables in a global table which persists across scene loads. - - FungusModule: A set of utility functions for scripting Unity and Fungus from Lua. - - FungusPrefs: An improved version of PlayerPrefs that can be easily used from Lua. - - ExecuteHandler: Listens for any standard Unity event and calls a method on a component in the gameobject. #247 - - ExecuteLua command: Run some Lua script in a Fungus command. Return values can be stored in Fungus variables. - - PODTypeFactory: Utility factory class for instantiating Plain-Old-Data (POD) types like Color, Vector3, etc. + - LuaEnvironment component: Execution environment for running Lua scripts. + - LuaUtils component: Extends LuaEnvironment with lots of useful features. + - LuaBindings: Maps Unity objects & components to Lua variables for use in Lua scripts. + - LuaScript: Runs Lua code from a text file or from a string property. + - LuaStore: Stores variables in a global table which persists across scene loads. + - FungusModule: A set of utility functions for scripting Unity and Fungus from Lua. + - FungusPrefs: An improved version of PlayerPrefs that can be easily used from Lua. + - ExecuteHandler: Listens for any standard Unity event and calls a method on a component in the gameobject. #247 + - ExecuteLua command: Run some Lua script in a Fungus command. Return values can be stored in Fungus variables. + - PODTypeFactory: Utility factory class for instantiating Plain-Old-Data (POD) types like Color, Vector3, etc. - Lots of FungusLua example scenes - Fungus documentation now has an extensive section on LuaScripting. - StringDataMulti: Like StringData, but uses a multi-line textbox in the inspector. diff --git a/Docs/Doxyfile b/Docs/Doxyfile index b86a4084..b1d304b4 100644 --- a/Docs/Doxyfile +++ b/Docs/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = Fungus # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = v3.6.1 +PROJECT_NUMBER = v3.9.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/Docs/command_ref/flow_commands.md b/Docs/command_ref/flow_commands.md index 16ec8f07..06ca8f1d 100644 --- a/Docs/command_ref/flow_commands.md +++ b/Docs/command_ref/flow_commands.md @@ -35,7 +35,18 @@ Boolean Data | Fungus.BooleanData | Boolean value to compare against Integer Data | Fungus.IntegerData | Integer value to compare against Float Data | Fungus.FloatData | Float value to compare against String Data | Fungus.StringDataMulti | String value to compare against +Animator Data | Fungus.AnimatorData | Animator value to compare against +Audio Source Data | Fungus.AudioSourceData | AudioSource value to compare against +Color Data | Fungus.ColorData | Color value to compare against Game Object Data | Fungus.GameObjectData | GameObject value to compare against +Material Data | Fungus.MaterialData | Material value to compare against +Object Data | Fungus.ObjectData | Object value to compare against +Rigidbody2 D Data | Fungus.Rigidbody2DData | Rigidbody2D value to compare against +Sprite Data | Fungus.SpriteData | Sprite value to compare against +Texture Data | Fungus.TextureData | Texture value to compare against +Transform Data | Fungus.TransformData | Transform value to compare against +Vector2 Data | Fungus.Vector2Data | Vector2 value to compare against +Vector3 Data | Fungus.Vector3Data | Vector3 value to compare against # End # {#End} Marks the end of a conditional block. @@ -54,7 +65,18 @@ Boolean Data | Fungus.BooleanData | Boolean value to compare against Integer Data | Fungus.IntegerData | Integer value to compare against Float Data | Fungus.FloatData | Float value to compare against String Data | Fungus.StringDataMulti | String value to compare against +Animator Data | Fungus.AnimatorData | Animator value to compare against +Audio Source Data | Fungus.AudioSourceData | AudioSource value to compare against +Color Data | Fungus.ColorData | Color value to compare against Game Object Data | Fungus.GameObjectData | GameObject value to compare against +Material Data | Fungus.MaterialData | Material value to compare against +Object Data | Fungus.ObjectData | Object value to compare against +Rigidbody2 D Data | Fungus.Rigidbody2DData | Rigidbody2D value to compare against +Sprite Data | Fungus.SpriteData | Sprite value to compare against +Texture Data | Fungus.TextureData | Texture value to compare against +Transform Data | Fungus.TransformData | Transform value to compare against +Vector2 Data | Fungus.Vector2Data | Vector2 value to compare against +Vector3 Data | Fungus.Vector3Data | Vector3 value to compare against # Jump # {#Jump} Move execution to a specific Label command in the same block @@ -176,6 +198,15 @@ Property | Type | Description --- | --- | --- Frame Count | Fungus.IntegerData | Number of frames to wait for +# WaitInput # {#WaitInput} +Waits for a period of time or for player input before executing the next command in the block. + +Defined in WaitInput + +Property | Type | Description + --- | --- | --- +Duration | System.Single | Duration to wait for. If negative will wait until player input occurs. + # While # {#While} Continuously loop through a block of commands while the condition is true. Use the Break command to force the loop to terminate immediately. @@ -189,5 +220,16 @@ Boolean Data | Fungus.BooleanData | Boolean value to compare against Integer Data | Fungus.IntegerData | Integer value to compare against Float Data | Fungus.FloatData | Float value to compare against String Data | Fungus.StringDataMulti | String value to compare against +Animator Data | Fungus.AnimatorData | Animator value to compare against +Audio Source Data | Fungus.AudioSourceData | AudioSource value to compare against +Color Data | Fungus.ColorData | Color value to compare against Game Object Data | Fungus.GameObjectData | GameObject value to compare against +Material Data | Fungus.MaterialData | Material value to compare against +Object Data | Fungus.ObjectData | Object value to compare against +Rigidbody2 D Data | Fungus.Rigidbody2DData | Rigidbody2D value to compare against +Sprite Data | Fungus.SpriteData | Sprite value to compare against +Texture Data | Fungus.TextureData | Texture value to compare against +Transform Data | Fungus.TransformData | Transform value to compare against +Vector2 Data | Fungus.Vector2Data | Vector2 value to compare against +Vector3 Data | Fungus.Vector3Data | Vector3 value to compare against diff --git a/Docs/command_ref/variable_commands.md b/Docs/command_ref/variable_commands.md index 64d3f160..898f6618 100644 --- a/Docs/command_ref/variable_commands.md +++ b/Docs/command_ref/variable_commands.md @@ -94,5 +94,16 @@ Boolean Data | Fungus.BooleanData | Boolean value to set with Integer Data | Fungus.IntegerData | Integer value to set with Float Data | Fungus.FloatData | Float value to set with String Data | Fungus.StringDataMulti | String value to set with +Animator Data | Fungus.AnimatorData | Animator value to set with +Audio Source Data | Fungus.AudioSourceData | AudioSource value to set with +Color Data | Fungus.ColorData | Color value to set with Game Object Data | Fungus.GameObjectData | GameObject value to set with +Material Data | Fungus.MaterialData | Material value to set with +Object Data | Fungus.ObjectData | Object value to set with +Rigidbody2 D Data | Fungus.Rigidbody2DData | Rigidbody2D value to set with +Sprite Data | Fungus.SpriteData | Sprite value to set with +Texture Data | Fungus.TextureData | Texture value to set with +Transform Data | Fungus.TransformData | Transform value to set with +Vector2 Data | Fungus.Vector2Data | Vector2 value to set with +Vector3 Data | Fungus.Vector3Data | Vector3 value to set with diff --git a/Docs/fungus_docs/change_log.md b/Docs/fungus_docs/change_log.md index d21f6b8a..e96f5ccf 100644 --- a/Docs/fungus_docs/change_log.md +++ b/Docs/fungus_docs/change_log.md @@ -2,6 +2,40 @@ Changelog {#changelog} ========= [TOC] +v3.9.0 {#v3_9_0} +====== + +## Added +- Conversation command supports setting default clear, wait for input and fade options #673 +- Added Fungus Priority Signals #671 #670 + - allows fungus to notify the outside world that it is doing something of priority so the outside world can pause +- Added GetKey fungus command. #683 + - Supports positive and negative keybindings output to a bool, float or int variable + - Supports checking for pressed, release and current state + - Uses keycode with optional fallback to key name +- Disabled Flowcharts and EventHandlers. #682 +- Added Dialog history on Save Menu UI #675 +- Added BlockReference, a simple data type with a property drawer that makes it easier to select a target fungus block from external c# scripts. #669 +- Added comparison (equals and not equals) as well as assign functionality to most variable types. #668 + +## Changed +- Updated to Unity 2018.1 #681 +- Conversation Manager Regex now allows - and _ within say params group. #692 +- Conversation example scene makes some basic use of new Conversation features +- Update LeanTween to 2.46 #689 +- PortraitController forces alpha and color tweens to be non recursive. +- Updated playground demos + - Football uses GetKey instead of GetAxis (get axis was failing in some packages as inputmanager axis were not imported) + - Defender had a bug due to a change in how unity syncs 'up' between transform and rb2d + +## Fixed +- ElseIfs now confirm that the previous condition was at the same indent as themselves. #693 +- NarrativeLog is tolerant of null Name or Story fields #690 +- Force the hierarchy icon list to refresh when a script a is loaded/changed #672 +- Eventhandlers no longer fire when the flowchart is disabled #682 +- StopFlowchart can continue now #685 +- Fixed stray \\ that were not being stripped on Mac OS, when importing editor resources. #686 + v3.8.0 {#v3_8_0} ====== @@ -324,16 +358,16 @@ Awesome github contributors: ## Added - FungusLua: Lua scripting support for Fungus via wrapper components for using MoonSharp in Unity. #281, #317, #334, #237, #235, #232, #224 - - LuaEnvironment component: Execution environment for running Lua scripts. - - LuaUtils component: Extends LuaEnvironment with lots of useful features. - - LuaBindings: Maps Unity objects & components to Lua variables for use in Lua scripts. - - LuaScript: Runs Lua code from a text file or from a string property. - - LuaStore: Stores variables in a global table which persists across scene loads. - - FungusModule: A set of utility functions for scripting Unity and Fungus from Lua. - - FungusPrefs: An improved version of PlayerPrefs that can be easily used from Lua. - - ExecuteHandler: Listens for any standard Unity event and calls a method on a component in the gameobject. #247 - - ExecuteLua command: Run some Lua script in a Fungus command. Return values can be stored in Fungus variables. - - PODTypeFactory: Utility factory class for instantiating Plain-Old-Data (POD) types like Color, Vector3, etc. + - LuaEnvironment component: Execution environment for running Lua scripts. + - LuaUtils component: Extends LuaEnvironment with lots of useful features. + - LuaBindings: Maps Unity objects & components to Lua variables for use in Lua scripts. + - LuaScript: Runs Lua code from a text file or from a string property. + - LuaStore: Stores variables in a global table which persists across scene loads. + - FungusModule: A set of utility functions for scripting Unity and Fungus from Lua. + - FungusPrefs: An improved version of PlayerPrefs that can be easily used from Lua. + - ExecuteHandler: Listens for any standard Unity event and calls a method on a component in the gameobject. #247 + - ExecuteLua command: Run some Lua script in a Fungus command. Return values can be stored in Fungus variables. + - PODTypeFactory: Utility factory class for instantiating Plain-Old-Data (POD) types like Color, Vector3, etc. - Lots of FungusLua example scenes - Fungus documentation now has an extensive section on LuaScripting. - StringDataMulti: Like StringData, but uses a multi-line textbox in the inspector. @@ -405,16 +439,16 @@ v2.4.0 {#v2_4_0} ## Added - FungusLua: Lua scripting support for Fungus via wrapper components for using MoonSharp in Unity. #281, #317, #334, #237, #235, #232, #224 - - LuaEnvironment component: Execution environment for running Lua scripts. - - LuaUtils component: Extends LuaEnvironment with lots of useful features. - - LuaBindings: Maps Unity objects & components to Lua variables for use in Lua scripts. - - LuaScript: Runs Lua code from a text file or from a string property. - - LuaStore: Stores variables in a global table which persists across scene loads. - - FungusModule: A set of utility functions for scripting Unity and Fungus from Lua. - - FungusPrefs: An improved version of PlayerPrefs that can be easily used from Lua. - - ExecuteHandler: Listens for any standard Unity event and calls a method on a component in the gameobject. #247 - - ExecuteLua command: Run some Lua script in a Fungus command. Return values can be stored in Fungus variables. - - PODTypeFactory: Utility factory class for instantiating Plain-Old-Data (POD) types like Color, Vector3, etc. + - LuaEnvironment component: Execution environment for running Lua scripts. + - LuaUtils component: Extends LuaEnvironment with lots of useful features. + - LuaBindings: Maps Unity objects & components to Lua variables for use in Lua scripts. + - LuaScript: Runs Lua code from a text file or from a string property. + - LuaStore: Stores variables in a global table which persists across scene loads. + - FungusModule: A set of utility functions for scripting Unity and Fungus from Lua. + - FungusPrefs: An improved version of PlayerPrefs that can be easily used from Lua. + - ExecuteHandler: Listens for any standard Unity event and calls a method on a component in the gameobject. #247 + - ExecuteLua command: Run some Lua script in a Fungus command. Return values can be stored in Fungus variables. + - PODTypeFactory: Utility factory class for instantiating Plain-Old-Data (POD) types like Color, Vector3, etc. - Lots of FungusLua example scenes - Fungus documentation now has an extensive section on LuaScripting. - StringDataMulti: Like StringData, but uses a multi-line textbox in the inspector.