Skip to content

Commit

Permalink
Update ModalLensPanel.lua
Browse files Browse the repository at this point in the history
Fix from last commit that broke some modal panels.
  • Loading branch information
astog committed May 23, 2020
1 parent 2e866e0 commit 2234602
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Base/Assets/UI/Panels/ModalLensPanel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand Down

0 comments on commit 2234602

Please sign in to comment.