From 68b5b4c05da9ac1e85be8e37fcfb8e53fd92413d Mon Sep 17 00:00:00 2001 From: Michael Werle Date: Tue, 19 Nov 2024 16:45:24 +0900 Subject: [PATCH] feat(radar): improve 'onViewChanged' event handler Use the new 'onViewChanged' event parameters to only add/remove the radar input frame if the view changes to/from "WorldView". --- data/pigui/modules/radar.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data/pigui/modules/radar.lua b/data/pigui/modules/radar.lua index ca10882d86..8fb7c0ed6d 100644 --- a/data/pigui/modules/radar.lua +++ b/data/pigui/modules/radar.lua @@ -377,10 +377,10 @@ local function displayRadar() end -- function displayRadar() -- view has changed, update input frame -Event.Register("onViewChanged", function() - if Game.CurrentView() == "WorldView" then +Event.Register("onViewChanged", function(newView, previousView) + if newView == "WorldView" then input_frame:AddToStack() - else + elseif previousView == "WorldView" then input_frame:RemoveFromStack() end end)