Commit Graph

18853 Commits (master)

Author SHA1 Message Date
Karl F 6ebf3e2b63 Add number of total docking pads at station to lobby
Possibly we'd also like to add information about how many ships are currently
docked, as this only shows the total capacity.
2020-02-14 09:07:26 +01:00
Pioneer Transifex 685d5c2a22 auto-commit: translation updates 2020-02-14 03:01:40 +01:00
Webster Sheets 6c5a81d68e
Update Changelog.txt 2020-02-13 15:31:49 -05:00
Webster Sheets 4acd8170f2
Merge pull request #4790 from impaktor/police2pigui
Convert Police screen to pigui
2020-02-13 15:30:16 -05:00
Webster Sheets 8f768b4676
Merge pull request #4792 from impaktor/doc_imgui_columns
PiGui docstrings and fix to ui.columns
2020-02-13 15:28:49 -05:00
Karl F 05c492c28e Small fix, function - know thy self! 2020-02-13 18:03:45 +01:00
Karl F 623df6f52a Move Police tab to pigui
Features are 1:1 with old behavior plus notification of which faction
the police belongs to.
2020-02-13 18:03:45 +01:00
Karl F 6f94a8ef2f Add natrual doc string to LuaPiGui 2020-02-13 09:17:20 +01:00
Karl F eef4c838b7 Make second argument to ui.columns optional 2020-02-13 08:52:19 +01:00
Karl F e9540885c0 Add codedoc-buidling to CMake, using naturaldoc (v1.x) 2020-02-13 08:52:19 +01:00
Webster Sheets 46dad22901
Merge pull request #4786 from Web-eWorks/ui-hot-reload
New require() implementation
2020-02-11 11:55:59 -05:00
Webster Sheets 408c03ed12 Incorporate suggested review changes 2020-02-06 00:41:46 -05:00
Webster Sheets 5c08ff0153 Replace broken module names in lua code
Note that this does not refactor the code base to use the require 'module.name' format yet; this simply allows the game to run under the new system.
2020-02-02 21:47:18 -05:00
Webster Sheets 5cb068ff12 Remove old lua_import() code. 2020-02-02 21:45:27 -05:00
Webster Sheets a79848a24a Port pi_lua_import_recursive to new system
Bugfix load_from_core, refactor pi_lua_import and pi_lua_import_recursive..
2020-02-02 21:38:31 -05:00
Webster Sheets 68cc2ea057
Update Changelog.txt 2020-02-02 17:35:12 -05:00
Webster Sheets 5299492517
Merge pull request #4758 from cwyss/contbutton
Make continue button load _quicksave if autosave not active
2020-02-02 17:21:29 -05:00
Webster Sheets daf088f359
Merge pull request #4787 from Gliese852/reject-back-project
Improve System Map rendering and interaction
2020-02-02 17:20:29 -05:00
Webster Sheets 420a445a0f
Merge pull request #4784 from Gliese852/ellipse-again
Small additional improvements to orbit calculation (#4784)
2020-02-02 17:08:28 -05:00
Webster Sheets 8ff5080384
Merge pull request #4779 from vakhoir/bugfix/font_bake_memory_leak
Fix on-demand glyph loading
2020-02-02 17:03:17 -05:00
Gliese852 a086c771f6 indentation & clang satisfaction 2020-02-02 15:16:39 +03:00
Gliese852 393408cd34 Minor improvements to System Map
1. Reject back-projected 2d objects.
Since the function Gui::Screen::Project does not cull points
(and most likely should not), this must be done manually, as was
done in the SectorView.cpp for labels. Checking z < 1 in the Normalized Device
Coordinates discards points that are further than the zfar clipping plane,
and beyond the center of the camera. The points between the center of the
camera and the znear clipping plane remain. They may be needed.

2. Adjust z-far plane for projection to clip space.
With a severe zooming in, the coordinates of objects can become too large and
fly out of the z-far plane. Therefore, it was done so that the z-far plane
moved away proportionally. But with a severe zooming out, it z-far plane can
become smaller than DEFAULT_VIEW_DISTANCE, and this is also taken into account.

3. Change the axis of rotation when dragging the mouse horizontally.
Set horizontal rotation around the axis of the ecliptic. It seems to me that
it’s more convenient to examine the system. For good, it was necessary to
rename the variable from m_rot_z to m_rot_y, but I did not want to
recompile everything.

4. Do not calculate and draw the player’s orbit when it is docked or landed.
2020-02-02 15:16:39 +03:00
Webster Sheets ce887abf96 New require() implementation
We now load files via Lua 5.2 require() semantics instead of raw paths.
This means we've dropped the current directory implicit lookup, and
instead we use module names to semi-uniquely identify a package.

We mimic the behavior of package.path for the data/libs/ directory,
with an eye to allowing client code to extend that behavior later on.

Loaded modules are cached in a two-stage cache; the first stage maps
module names to file paths to avoid duplicate loads, and the second
stage maps file paths to the return value of a module.

package.reimport(name) can be used to purge the cache of a specific
name and force it to be reimported (as the name suggests). It returns
the imported module, similarly to require().

This implementation deprecates import() and translates old-style calls
to that function to the new module names. It complains loudly in the log
when it does so, so we can keep track of what modules need to be updated.
2020-02-02 03:02:18 -05:00
Webster Sheets ecf0ecbf97
Merge pull request #4776 from Web-eWorks/ui-hot-reload
Rewind PiGui stack in case of an error
2020-02-01 22:23:01 -05:00
Webster Sheets 0b3235ffeb Lua: Add package.core, remove import_core() 2020-02-01 21:18:39 -05:00
Webster Sheets 491ab1f37f Restore the ImGui stack after a lua error throw 2020-02-01 21:18:39 -05:00
Gliese852 ed3b134327 Small additional improvements to orbit calculation
Was: orbit with 0.9999 < e < 1.0001 forced to e = 1.0001 (hyperbola)
Now: orbit with 0.9999 < e < 1      forced to e = 0.9999 (ellipse)
     orbit with 1   <=   e < 1.0001 forced to e = 1.0001 (hyperbola)

In an elliptical orbit, when the eccentricity is fixed at 0.9999, and
the speed increases, the semi-major axis shrinks and the apocenter moves
toward the star. Therefore, a condition check has been added that prevents
the ship from shifting in this case.
2020-02-01 19:14:07 +03:00
Pioneer Transifex 105d06e33f auto-commit: translation updates 2020-01-31 03:01:20 +01:00
vakhoir 13f7645433 Rename m_ranges to m_invalid_glyphs
Rename containsGlyph to isValidGlyph
Change the approach to checking if a font can handle a glyph. The original approach was to pass the valid glyph range to the constructor. When it's not found by ImGui we call AddGlyph where we check if it's valid for the font. In the event where ImGui couldn't handle a glyph that was defined as valid in the constructor, that led to constant re-baking of fonts. The new approach is to change m_ranges (which used to contain valid glyph ranges) to m_invalid_glyphs, which contains only invalid glyphs that we tried to add to the font but failed. The next time AddGlyph is called, we skip the font since it's unable to handle the glyph.
2020-01-30 19:37:41 +01:00
Pioneer Transifex 2fdfd89085 auto-commit: translation updates 2020-01-30 03:01:28 +01:00
Andrew Copland 5938ecc39f
Update Changelog.txt 2020-01-29 10:31:45 +00:00
Andrew Copland bdd05617b5
Merge pull request #4777 from Gliese852/orbits
Fix / improve orbit calculations.
2020-01-29 10:31:17 +00:00
Karl F f6ae4c7270 Update Changelog
Cherry-picking 2 commits from semi-unrelated PR #4746, to prevent bitrot
2020-01-29 10:52:17 +01:00
Armin Kretschmer d2d4697a5b Trigger event on missile launch 2020-01-29 10:38:57 +01:00
Armin Kretschmer 6506fa763c Notice missile launch 2020-01-29 10:38:31 +01:00
Webster Sheets 8c7fb4ad17
Update Changelog.txt 2020-01-28 19:16:54 -05:00
Webster Sheets b902837ddb
Merge pull request #4764 from cwyss/onscreen-objects
Improve usabiltiy of in-space body indicators
2020-01-28 18:55:08 -05:00
Webster Sheets 4e7744af9a
Merge pull request #4770 from Gliese852/issue4719
Fix mission screen obscuring buttons
2020-01-28 18:46:38 -05:00
Webster Sheets 0fa7440eec
Merge pull request #4774 from vakhoir/feature/ship_market
Ship market
2020-01-28 18:42:26 -05:00
Webster Sheets fd673ab079
Update Changelog.txt 2020-01-28 18:10:21 -05:00
Webster Sheets f86d6ce467
Merge pull request #4767 from vakhoir/bugfix/savegame_dialog
ModalWindow class that allows nesting
2020-01-28 18:09:18 -05:00
Gliese852 ab04807300 indentation + clang format satisfaction 2020-01-28 09:01:47 +03:00
Gliese852 633e996859 Fix calculation of the orientation matrix and parabolic orbit problem
1. Fix orientation matrix calculation
It was found that the orbit orientation matrix is calculated through
the Euler angles, which are calculated from the velocity and position
vectors, and many divisions are made in which the denominator can
unpredictably approach 0. All this was removed since the matrix is
easily calculated directly from the vectors.

2. Transition without distortion from an elliptical orbit to a hyperbolic
When moving from an elliptical orbit to a hyperbolic one, the eccentricity
passes through 1 (parabola), when the average anomaly is zero everywhere,
except for infinity. Therefore, the ship at this time is attracted to
the point of the pericenter, because there is not enough accuracy to
go from the true anomaly to the middle anomaly and back, and stay in
the same coordinates. Therefore, I suggest jumping from an ellipse
with e = 0.9999 to a hyperbole with e = 1.0001. These orbits are
very similar, almost identical. Moreover, ellipses with
0.9999 < e < 1 are also considered as hyperbolas, so that there are
no distortions at a low speed of the ship.
2020-01-28 09:03:30 +03:00
Gliese852 dc0599397b Fix orbit calculation for ships with low speeds
1. Improve numerical method for Kepler's equation
It turned out that numerical methods are implemented with a fixed number of
iterations (5), and they are not always enough. Moreover, testing showed
that in some cases the solution does not converge and even 10,000
iterations are not enough. Therefore, a more slowly converging
bisection method was added, in case the main method fails in 10 iterations.

2. Stabilize low speed orbits
When the ship has low speed, its orbit is a very elongated ellipse,
and its true anomaly is very very close to pi. Trimming the variable to
1 - 1e-6 before taking the arccos does not allow it to get close to pi
enough, so there is a strong shift from the true position. Therefore,
it was removed.
2020-01-28 09:01:47 +03:00
vakhoir a5d696e7eb Ship market
Explicitly set ModelSpinner pauseTime to 0 in constructor
Launch Request button alignment fix in Lobby View
2020-01-25 18:21:50 +01:00
vakhoir 9d18440690 ModalWindow class that allows nesting
Checking isWindowHovered in market widget, so it ignores mouse events under a modal window
2020-01-25 18:18:57 +01:00
Webster Sheets ec789570ec Split LuaUtils.cpp into topical files 2020-01-21 16:25:38 -05:00
Webster Sheets ec410f31d8 Update includes to point to new lua/ directory 2020-01-20 18:13:45 -05:00
Gliese852 7cd3f5501a indent only 2020-01-20 16:00:56 +03:00
Gliese852 0a53193c2d file corrections, no indent
hide comms button in flight, because it duplicates the button function in the upper right corner of the window
hide the system-overview-window when we are not looking into the world
2020-01-20 15:52:36 +03:00