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

@ -38,7 +38,10 @@ public class SectorMap : MonoBehaviour
public float LinkWidth;
public float CriticalLinkWidth;
public AnimationCurve IconScaleAnimation;
public Color PlayerLocationLabelColor;
public float PlayerLocationIconSize = 1.25f;
private SectorZone _currentPlayerLocation;
private HashSet<SectorZone> _revealedZones = new HashSet<SectorZone>();
private HashSet<(SectorZone, SectorZone)> _revealedLinks = new HashSet<(SectorZone, SectorZone)>();
@ -48,6 +51,29 @@ public class SectorMap : MonoBehaviour
private Dictionary<SectorZone, SectorZoneUI> _zoneInstances = new Dictionary<SectorZone, SectorZoneUI>();
private Queue<IEnumerable<SectorZone>> _queuedZoneReveals = new Queue<IEnumerable<SectorZone>>();
public void MarkPlayerLocation(SectorZone zone)
{
if (_currentPlayerLocation != null)
{
_zoneInstances[_currentPlayerLocation].Label.color = Color.white;
_zoneInstances[_currentPlayerLocation].Label.fontStyle = FontStyles.Normal;
_zoneInstances[_currentPlayerLocation].IconContainer.localScale = Vector3.one;
}
_currentPlayerLocation = zone;
if(_zoneInstances.ContainsKey(_currentPlayerLocation))
{
MarkPlayerLocation(_zoneInstances[_currentPlayerLocation]);
}
}
private void MarkPlayerLocation(SectorZoneUI zoneUI)
{
zoneUI.Label.color = PlayerLocationLabelColor;
zoneUI.Label.fontStyle = FontStyles.Bold;
zoneUI.IconContainer.localScale = new Vector3(PlayerLocationIconSize, PlayerLocationIconSize, 1);
}
public void QueueZoneReveal(IEnumerable<SectorZone> zones)
{
_queuedZoneReveals.Enqueue(zones);
@ -72,6 +98,8 @@ public class SectorMap : MonoBehaviour
if (!_revealedZones.Contains(zone))
{
var zoneInstance = ZonePrototype.Instantiate<SectorZoneUI>();
if(zone == _currentPlayerLocation)
MarkPlayerLocation(zoneInstance);
_zoneInstances[zone] = zoneInstance;
var zoneInstanceTransform = zoneInstance.transform;
zoneTransforms.Add(zoneInstanceTransform);