Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(radar): refactor radar code and improve UI layout
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. The layout was also modified significantly with both the left and right button bars moved further away for an overall less cluttered look. This made room for a couple of new buttons, one to switch between the scanner and the radar, and the other to indicate the current scanner zoom mode - automatic or manual. In order to get the new buttons near the radar to actually work, they had to be rendered inside a window as otherwise they are completely unresponsive the mouse. HOWEVER, placing the entire randar into the window does not work as the 3D radar's background is not rendered when it's in the window (possibly due to coordinate issues? Alternatively because it's rendered in C++ instead of LUA?) although its "pips" are. The 2D radar is rendered properly even when inside a window. 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 ship-internals window is moved to the left a bit to avoid it encroaching on the radar area. * The autopilot controls are moved to the right a little bit to make more room for the zoom-level display. * The new buttons for the radar are aligned to the left of the radar area. * The scanner was made marginally taller. * The zoom levels are reset for both the scanner and the radar at game-end. * Add a debugReload() function to the ship-internals window.
- Loading branch information