Skip to content

Commit

Permalink
feat(radar): enable clicking on zoom mode indicator
Browse files Browse the repository at this point in the history
Use the zoom mode indicator to also toggle between automatic and manual
zoom modes for the 3D radar.
  • Loading branch information
mwerle committed Nov 25, 2024
1 parent cbeb0d4 commit 3d8d2a8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion data/pigui/modules/radar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,15 @@ local function displayRadar()
ui.sameLine()
ui.addCursorPos(Vector2(0, toggle_button_size - button_size))
icon = instrument:isAutoZoom() and icons.radar_automatic or icons.radar_manual
ui.mainMenuButton(icon, tt, ui.theme.buttonColors.disabled, Vector2(button_size))
local theme = instrument:isAutoZoom() and ui.theme.buttonColors.disabled or ui.theme.buttonColors.default
local clicked = ui.mainMenuButton(icon, tt, theme, Vector2(button_size))
if clicked then
if instrument:isAutoZoom() then
instrument:zoomIn()
else
instrument:resetZoom()
end
end
end

-- Draw radar range
Expand Down

0 comments on commit 3d8d2a8

Please sign in to comment.