From 2234602a50b8cef884ee0c57c966c82277734a18 Mon Sep 17 00:00:00 2001 From: astog Date: Sat, 23 May 2020 10:57:42 -0500 Subject: [PATCH] Update ModalLensPanel.lua Fix from last commit that broke some modal panels. --- Base/Assets/UI/Panels/ModalLensPanel.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Base/Assets/UI/Panels/ModalLensPanel.lua b/Base/Assets/UI/Panels/ModalLensPanel.lua index 5c523d9..f69e899 100644 --- a/Base/Assets/UI/Panels/ModalLensPanel.lua +++ b/Base/Assets/UI/Panels/ModalLensPanel.lua @@ -192,7 +192,7 @@ function ShowModLensKey(lensName:string) -- print("Showing " .. lensName .. " modal panel") if g_ModLensModalPanel[lensName] ~= nil then - g_KeyStackIM:ResetInstances(); + ResetKeyStackIM(); local info = g_ModLensModalPanel[lensName].Legend local lensTextKey = g_ModLensModalPanel[lensName].LensTextKey for _, hexColorAndKey in ipairs(info) do @@ -336,6 +336,11 @@ function OnInit(isReload:boolean) LateInitialize(); end +-- =========================================================================== +function AddLensEntry(lensKey:string, lensEntry:table) + g_ModLensModalPanel[lensKey] = lensEntry +end + -- =========================================================================== function LateInitialize() if (Game.GetLocalPlayer() == -1) then @@ -347,6 +352,9 @@ function LateInitialize() Events.InterfaceModeChanged.Add( OnInterfaceModeChanged ); Events.LensLayerOn.Add( OnLensLayerOn ); + -- Mod Lens Support + LuaEvents.ModalLensPanel_AddLensEntry.Add( AddLensEntry ) + LuaEvents.MinimapPanel_AddContinentColorPair.Add(OnAddContinentColorPair); end