- Now only those orbits whose radius is less than 1% of the screen width are not shown.
- Add smooth transition when click object.
- Improve system bodies orbits.
- Fix that ..apsis and lagrange points were displayed in the wrong place.
- After rescanning enums, an error was found in the pigui/Face.h, fixed. fixes#4801
- Some indentations to pass clang
- Added static_cast to Space.cpp, because it caused a warning at compilation.
The main idea of the interaction of lua side and C++ side is the same as
in the worldview - the C++ View Class builds three-dimensional objects,
some projected points are passed to the lua script, the lua script only
works with screen coordinates.
The difference between the system view and the world view is that not
all objects can have a physical body. If we examine a non-current star
system, we see only system bodies that do not have physical bodies.
Therefore, if for a world view you can simply create an array of
physical bodies, this will not work in a system view.
To solve this problem, struct "Projectable" was created, into which you
can write any point object, system body, ship, Lagrange point,
apocenter, pericenter, etc. Now all these objects can be processed in a
single array.
The names of the types of these objects are recorded in an enum, which
is exported to a enum_table.cpp and read by the script as integers at
the start. I thought it was better to avoid passing strings in such a
hot place in the code. (runs for every object in every frame) Therefore,
type names are written and transmitted as integers.
All colors are now imported from lua: color index names are listed in
the enum, which is exported to the enum_table.cpp. At event
"onGameStart" the lua script reads these names and sends color values to
the class. Now you can change colors at runtime.
* Improvements/fixes: *
- Fix zooming speeds.
- Fix ship's orbits in nonroot frame.
- Remove unused old gui objects.
- Landed ship are now spinning with the planet when rewinding time in a
planner.
- Now you can center the view on any object, including the player’s ship.
- Add right-click context menu to center or set object as target.
Therefore, to rotate the view, set the middle button.
- Add indicators for navigation target and combat target.
* Changes in the files explained *
SystemView.cpp, SystemView.h, system-view-ui.lua, lang/core/en.json
The whole thing, lots of changes. Now the system view draws only the
orbits and the grid. In those places where the icons were drawn, instead
of drawing, they are stored in an array, which is then requested from
the lua.
LuaEngine.cpp
Add a general function that returns the value of an any enum by name
from an enum_table.cpp (for calling from a lua)
Space.cpp
Added a notification for the systemview when the ship is removed from
space, because it can be centered at this time, and an segmentation
fault will occur.
LuaSystemBody.cpp
Added attributes to determine the shape of the icon and set the
navigation target.
enum_table.cpp, enum_table.h
Rescanned enums to pass color settings and object types between Lua and
C++.
LuaGame.cpp
The float does not have enough accuracy to display time up to seconds,
change to double.
icons.svg, themes/default.lua
Add rotate view icon
Added IsKeyPressed / Released methods to track per-frame key state
Added GetMouseWheel so users don't have to track mouse wheel events themselves
Input keeps a pointer to a config instance, completely decoupling it from Pi
Make PiGui a namespace for easier method scoping, allows us to be more flexible
PiGui::Instance only has the bare minimum of methods needed to run ImGui
Move PiGui RegisterClass call to pigui/PiGuiLua - we'll further unify LuaPiGui
and PiGuiLua later.
At the moment, the lifecycle is responsible for calling HandleEvents and rendering PiGui.
This can change once legacy code no longer depends on HandleEvents running after View::Draw3D().
Added virtual HandleEvent() call to dispatch to legacy UI code.
This is suboptimal; we need a better way that doesn't involve virtual function calls.
Use std::function or a better, lower-overhead delegate library
- Now LuaPiGui handles it, decoupling the PiGui implementation from lua
- Made all externally-facing symbols in LuaPiGui part of the PiGUI namespace
This will be renamed to PiGui and the class of the same name will become part of the namespace.
- Fixed an initialization bug in Input.h
- Refactored Intro.h to use delta time updates
- Split our static MainLoop() and Start() functions into Lifecycle objects
- Cleaned up initialization, laid the groundwork for async startup loading
- Added Pi::StartGame() to centralize control over game setup
Previously we were setting Pi::game from a lua callback handler, which was no bueno.
A better way of handling initialization and updates
Still need to incorporate pigui handling into GuiApplication so we don't have to duplicate all of the pigui code
Moved mouse capture functionality from the renderer to Input
Temporarily patched ModelViewer, pending a major refactor to make it compatible with the input class.
Opening the options window with Escape while in screenshot mode would
not draw the window, but would steal focus and deadlock the game's input
This is resolved by simply adding a path to draw modals even if
the UI is in "screenshot only" mode, as the escape menu should be
irrespective of that mode.