Skip to content

Commit

Permalink
feat(radar): major cleanup refactor
Browse files Browse the repository at this point in the history
This commit is a major refactor of the radar module code.

The scanner and radar were each turned into a class (table) to make the
main draw function more generic.
TODO: there's probably a good way to refactor this further to have
both instruments derive from a base class in order to ensure the same
base functionality.

Additionally:

* The 'onChangeMFD' event was removed

* The scanner (3D) and radar (2D azimuth) now each have their own zoom
  level. This prevents the radar from ending up with an auto-zoom zoom
  level when switching from the scanner since it only ever has manual
  zoom.

* The autopilot controls were also moved to the right a little bit to make
  more room for the zoom-level display.

* The scanner was made marginally taller.
  • Loading branch information
mwerle committed Nov 10, 2024
1 parent e065966 commit 7e2b067
Show file tree
Hide file tree
Showing 2 changed files with 165 additions and 137 deletions.
3 changes: 2 additions & 1 deletion data/pigui/modules/autopilot-window.lua
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,8 @@ local function displayAutoPilotWindow()
local current_view = Game.CurrentView()
local window_h = mainButtonSize.y + smallButtonSize.y + ui.getWindowPadding().y * 2
local shift = smallButtonSize.y
local window_posx = ui.screenWidth/2 + ui.reticuleCircleRadius / 4 * 3
-- X starting position is the edge of the scanner display.
local window_posx = ui.screenWidth/2 + ui.reticuleCircleRadius
local window_posy = ui.screenHeight - window_h
ui.setNextWindowPos(Vector2(window_posx, window_posy) , "Always")
ui.window("AutoPilot", {"NoTitleBar", "NoResize", "NoFocusOnAppearing", "NoBringToFrontOnFocus", "NoSavedSettings", "AlwaysAutoResize"},
Expand Down
Loading

0 comments on commit 7e2b067

Please sign in to comment.