From 82d35bf5dea9887302af4bc813eab44593c8e1b5 Mon Sep 17 00:00:00 2001 From: lealeelu Date: Sun, 7 Aug 2016 14:30:23 -0400 Subject: [PATCH] Sync active say dialog when Lua sets the say dialog --- .../Fungus/Thirdparty/FungusLua/Resources/Lua/fungus.txt | 1 + Assets/Fungus/Thirdparty/FungusLua/Scripts/LuaUtils.cs | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/Assets/Fungus/Thirdparty/FungusLua/Resources/Lua/fungus.txt b/Assets/Fungus/Thirdparty/FungusLua/Resources/Lua/fungus.txt index fca6b34f..5eaf0aad 100644 --- a/Assets/Fungus/Thirdparty/FungusLua/Resources/Lua/fungus.txt +++ b/Assets/Fungus/Thirdparty/FungusLua/Resources/Lua/fungus.txt @@ -146,6 +146,7 @@ M.sayoptions.stopvoiceover = true -- Set the active saydialog to use with the say function function M.setsaydialog(saydialog) M.sayoptions.saydialog = saydialog + luautils.SyncSayDialog(saydialog) end -- Gets the active say dialog, or creates one if none exists yet diff --git a/Assets/Fungus/Thirdparty/FungusLua/Scripts/LuaUtils.cs b/Assets/Fungus/Thirdparty/FungusLua/Scripts/LuaUtils.cs index d4171031..266dd46d 100644 --- a/Assets/Fungus/Thirdparty/FungusLua/Scripts/LuaUtils.cs +++ b/Assets/Fungus/Thirdparty/FungusLua/Scripts/LuaUtils.cs @@ -480,6 +480,15 @@ namespace Fungus { return conversationManager.DoConversation(conv); } + + /// + /// Sync the active say dialog with what Lua thinks the SayDialog should be + /// + /// + public void SyncSayDialog(SayDialog sayDialog) + { + SayDialog.activeSayDialog = sayDialog; + } } } \ No newline at end of file