Skip to content

Commit

Permalink
feat(radar): improve 'onViewChanged' event handler
Browse files Browse the repository at this point in the history
Use the new 'onViewChanged' event parameters to only add/remove the radar
input frame if the view changes to/from "WorldView".
  • Loading branch information
mwerle committed Nov 19, 2024
1 parent a239cab commit 68b5b4c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions data/pigui/modules/radar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 68b5b4c

Please sign in to comment.