Properties Panel Overhaul

Marking player location on galaxy map
Fixed non-input field focus disabling global key map
Player start ship is now always the same
Loadout generator now demands exact match for item dimensions
Thermal damage now triggers ItemDamaged event = player can die from cockpit wear!
Properties panel now has a much more attractive UI
Implemented curve control for properties UI
Centralized number formatting in player settings
Moved significant digits to player settings
Added temperature unit option in player settings
This commit is contained in:
Reinier Vens 2021-04-13 01:50:42 +01:00
commit 54f7e3a66f
152 changed files with 8691 additions and 179 deletions

View file

@ -1,4 +1,5 @@
using System;
using System.Linq;
using MessagePack;
using Newtonsoft.Json;
using Unity.Mathematics;
@ -11,6 +12,33 @@ public class BezierCurve
[IgnoreMember] private int2 _cachedIndices;
[IgnoreMember] private const int STEPS = 64;
[IgnoreMember] private float? _maximum;
[IgnoreMember]
public float Maximum
{
get
{
if (_maximum != null) return _maximum ?? 0;
var samples = Enumerable.Range(0, STEPS).Select(i => (float) i / STEPS).ToArray();
float max = 0;
_maximum = 0;
foreach (var f in samples)
{
var p = Evaluate(f);
if (p > max)
{
max = p;
_maximum = f;
}
}
return _maximum??0;
}
}
// Integrate area under curve between start and end time
public float IntegrateCurve(float startTime, float endTime, int steps)
{