From 3f2614cec0b08fc65e5d7ea3cc0a3daa8bd1a3d3 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 13 Jun 2026 18:48:53 +0100 Subject: [PATCH] Demote runtime player settings projection --- .voidbot/state/aetheria.cc | Bin 44006 -> 45963 bytes Aetheria.State/README.md | 22 +++++++------ Assets/Scripts/Gameplay/ActionGameManager.cs | 26 +++++++-------- Assets/Scripts/ServerShared/Galaxy.cs | 2 +- .../ServerShared/Narrative/StoryProcessor.cs | 4 +-- ...erSettings.cs => RuntimePlayerSettings.cs} | 14 ++++---- ....cs.meta => RuntimePlayerSettings.cs.meta} | 0 Assets/Scripts/UI/HUD/SchematicDisplay.cs | 26 +++++++-------- .../UI/InputScreen/InputDisplayLayout.cs | 8 ++--- Assets/Scripts/UI/MainMenu.cs | 28 ++++++++-------- Assets/Scripts/UI/Menu/InventoryPanel.cs | 4 +-- Assets/Scripts/UI/Menu/MapRenderer.cs | 6 ++-- Assets/Scripts/UI/Menu/SectorRenderer.cs | 4 +-- Assets/Scripts/UI/Menu/TradeMenu.cs | 6 ++-- .../UI/Properties Panel/PropertiesPanel.cs | 30 +++++++++--------- .../Zone Display/VolumeCloudRenderer.cs | 4 +-- docs/aetheria-perfect-machine-map.md | 14 +++++--- 17 files changed, 104 insertions(+), 94 deletions(-) rename Assets/Scripts/ServerShared/{PlayerSettings.cs => RuntimePlayerSettings.cs} (82%) rename Assets/Scripts/ServerShared/{PlayerSettings.cs.meta => RuntimePlayerSettings.cs.meta} (100%) diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index a40670059e50c8a57a5547b61f1c3d9f9406f162..f39ef4129cf1f299dfa9fc709d582f488debbb8d 100644 GIT binary patch delta 1719 zcmZuyy>A>v6qoG?;s6p7QBX)CUKEiiaJRP47sogf#2AoVfQ(~OSTu9H?`{|G&MfnB z;e^Bq0aa+62{aTK3^?H{0n>qmDEI?Xq3fuiq5#p*@n&}Sf~{*#drxoQ{J!Sx@4t>; z{bT(0=i`&j^9zmnV5ZTuceak$U&gOimDw4p9Jgjd4=Y8_!2>5wY_GigwF+a**kzO| z5q#{XiiOl`D6{Lk&m8DoyZGLX3^O5n%h908P{$|}R+onBB*S{1vL4F1Lah_tQT2#g zHI1n^rWACvMti9bhbN~0xEljOQ@hXN|+3eKG{*N#7MEA}p5NQNy(nVPDqb`+` zK(t&l#7sd8k%OO%5oiIc#o>EjxB!untd$}Zn4rQ0%xI!Sr-3A%30JU){es8d5s+}8 zI_O?b2Q8UYFEP?)%1MKuG}H8(Cme&%!jvW1;GdC5AR$&f?EwQ%l8`7TE#!p&?y=t% z5;EjQ)qox|=Jl&VN3uLlLPfpUMu|K`>R>z~Y`M|UN_a#<14fBf0W52H&7eV5VlJo; z?SN2Z88u#jL_=nj1}<+Stk*GBJ29oF2v2ayC!$D8Btk=e5(@YFV>uQ+ z6$SwEE~bKp2VXEAQW{sWt*+a}H|OoYhaP-oZFG)UNbV~#!i{{%`8=|3$(#KDbmdIP z!Q0yup+VEK!^iI}-?Qmcr%yk=iq5WRUpR-?rI5`2efiw_`m;k;73sZcarvo4@;-T} zBT>56yKdN9XJ`7`8OwK+$ucH;gM}58ZFl2eAXn&)QJiv0LnvfK>86}jtHmGDr7hGh zLlAsLnTgz0ajIS`ct0UK`;rYDI}{p9vI-fmLBn3$e6;`ii^AP(9g;$Utr~B7ez``YQSaZVw)4%9R+kU= zmp-|5zqG!S)y^KSp>m5%=gC9msJZ#|{{W1~i68&~ delta 203 zcmeBv&h+d$(}rbCTn5HgrWSg}W@b?n8AT_rTh2E5G*c^7)WpyNESk?;1rsqc1&eU7 z$jZ)M-MY3oIU_YUF)X#HI5R(wab+EYa-X=i_8)* s6HJVtHtmOtK _runtimeStateFilePath ??= AetheriaRuntimeStateBoundary.GetStateFilePath(GameDataDirectory); - private static PlayerSettings _playerSettings; - public static PlayerSettings PlayerSettings + private static RuntimePlayerSettings _runtimePlayerSettings; + public static RuntimePlayerSettings RuntimePlayerSettings { get { - return _playerSettings ??= GetDefaultPlayerSettings(); + return _runtimePlayerSettings ??= CreateDefaultRuntimePlayerSettings(); } } - public static void SavePlayerSettings() + public static void QueueRuntimePlayerSettingsCommit() { try { var commit = AetheriaRuntimeStateCommitLog.QueuePlayerSettings( RuntimeStateFilePath, - ProjectPlayerSettings(PlayerSettings)); + ProjectRuntimePlayerSettings(RuntimePlayerSettings)); Debug.Log($"Queued Aetheria Verse player settings commit: {commit.Path}"); } catch (Exception ex) @@ -64,9 +64,9 @@ public class ActionGameManager : MonoBehaviour } } - private static PlayerSettings GetDefaultPlayerSettings() + private static RuntimePlayerSettings CreateDefaultRuntimePlayerSettings() { - var settings = new PlayerSettings(); + var settings = new RuntimePlayerSettings(); settings.Name = Environment.UserName; settings.InputSettings.ActionBarInputs.Add("/leftShift"); settings.InputSettings.ActionBarInputs.Add("/leftButton"); @@ -216,7 +216,7 @@ public class ActionGameManager : MonoBehaviour get => Settings.GameplaySettings.DefaultEntitySettings.Copy(); } - private static AetheriaRuntimePlayerSettingsCommit ProjectPlayerSettings(PlayerSettings settings) + private static AetheriaRuntimePlayerSettingsCommit ProjectRuntimePlayerSettings(RuntimePlayerSettings settings) { return new AetheriaRuntimePlayerSettingsCommit { @@ -492,7 +492,7 @@ public class ActionGameManager : MonoBehaviour ZoneRenderer.ItemManager = ItemManager; // If hiding minimap asteroids, turn them off to start with - if (!PlayerSettings.GraphicsSettings.ShowAsteroidsInMinimap) + if (!RuntimePlayerSettings.GraphicsSettings.ShowAsteroidsInMinimap) ZoneRenderer.ShowAsteroidUI = false; // TODO: Process Stories @@ -500,7 +500,7 @@ public class ActionGameManager : MonoBehaviour #region Input Handling Input = new AetheriaInput(); - foreach (var x in PlayerSettings.InputSettings.InputActionMap) Input.asset[x.Key.action].ApplyBindingOverride(x.Key.binding, x.Value); + foreach (var x in RuntimePlayerSettings.InputSettings.InputActionMap) Input.asset[x.Key.action].ApplyBindingOverride(x.Key.binding, x.Value); InputDisplayLayout.Input = Input.asset; Input.Global.Enable(); @@ -684,7 +684,7 @@ public class ActionGameManager : MonoBehaviour return slot; } - var bindings = PlayerSettings.InputSettings.ActionBarInputs.OrderBy(i => i) + var bindings = RuntimePlayerSettings.InputSettings.ActionBarInputs.OrderBy(i => i) .Select(createBinding).ToList(); #endregion @@ -693,7 +693,7 @@ public class ActionGameManager : MonoBehaviour StartGame(); - //if (!PlayerSettings.InputSettings.ActionBarInputs.Any()) + //if (!RuntimePlayerSettings.InputSettings.ActionBarInputs.Any()) { var newbinds = Enumerable.Range(0, 64)//CurrentEntity.WeaponGroups .Zip( @@ -1292,7 +1292,7 @@ public class ActionGameManager : MonoBehaviour MainMenu.gameObject.SetActive(true); Menu.gameObject.SetActive(false); CurrentGalaxy = null; - SavePlayerSettings(); + QueueRuntimePlayerSettingsCommit(); Observable.EveryUpdate() .Where(_ => Time.time - deathTime < DeathPostTransitionTime) .Subscribe(_ => diff --git a/Assets/Scripts/ServerShared/Galaxy.cs b/Assets/Scripts/ServerShared/Galaxy.cs index e065cc0ae..92de808ec 100644 --- a/Assets/Scripts/ServerShared/Galaxy.cs +++ b/Assets/Scripts/ServerShared/Galaxy.cs @@ -105,7 +105,7 @@ public class Galaxy SectorBackgroundSettings background, NameGeneratorSettings nameGeneratorSettings, AetheriaRuntimeCatalogSnapshot runtimeCatalog, - PlayerSettings playerSettings, + RuntimePlayerSettings playerSettings, DirectoryInfo narrativeDirectory, Action log, Action progressCallback = null, diff --git a/Assets/Scripts/ServerShared/Narrative/StoryProcessor.cs b/Assets/Scripts/ServerShared/Narrative/StoryProcessor.cs index 1fa16a037..bd6434ae1 100644 --- a/Assets/Scripts/ServerShared/Narrative/StoryProcessor.cs +++ b/Assets/Scripts/ServerShared/Narrative/StoryProcessor.cs @@ -33,11 +33,11 @@ public class StoryProcessor : IZoneResolver, IFactionResolver public DirectoryInfo NarrativeDirectory { get; } private Random _random; public Galaxy Galaxy { get; } - public PlayerSettings Settings { get; } + public RuntimePlayerSettings Settings { get; } private Action Log { get; } - public StoryProcessor(PlayerSettings settings, DirectoryInfo narrativeDirectory, Galaxy galaxy, ref Random random, Action log) + public StoryProcessor(RuntimePlayerSettings settings, DirectoryInfo narrativeDirectory, Galaxy galaxy, ref Random random, Action log) { NarrativeDirectory = narrativeDirectory; Galaxy = galaxy; diff --git a/Assets/Scripts/ServerShared/PlayerSettings.cs b/Assets/Scripts/ServerShared/RuntimePlayerSettings.cs similarity index 82% rename from Assets/Scripts/ServerShared/PlayerSettings.cs rename to Assets/Scripts/ServerShared/RuntimePlayerSettings.cs index 83223a70b..59a4c4d5a 100644 --- a/Assets/Scripts/ServerShared/PlayerSettings.cs +++ b/Assets/Scripts/ServerShared/RuntimePlayerSettings.cs @@ -2,14 +2,14 @@ using System; using System.Collections.Generic; using System.Globalization; -public class PlayerSettings +public class RuntimePlayerSettings { public string Name = "Anonymous"; public bool TutorialPassed; public Dictionary HashedStoryFiles = new Dictionary(); - public PlayerGameplaySettings GameplaySettings = new PlayerGameplaySettings(); - public PlayerInputSettings InputSettings = new PlayerInputSettings(); - public PlayerGraphicsSettings GraphicsSettings = new PlayerGraphicsSettings(); + public RuntimePlayerGameplaySettings GameplaySettings = new RuntimePlayerGameplaySettings(); + public RuntimePlayerInputSettings InputSettings = new RuntimePlayerInputSettings(); + public RuntimePlayerGraphicsSettings GraphicsSettings = new RuntimePlayerGraphicsSettings(); public string FormatTemperature(float t) { @@ -47,19 +47,19 @@ public class PlayerSettings } } -public class PlayerGameplaySettings +public class RuntimePlayerGameplaySettings { public TemperatureUnit TemperatureUnit = TemperatureUnit.Celsius; public int SignificantDigits = 3; } -public class PlayerGraphicsSettings +public class RuntimePlayerGraphicsSettings { public Quality NebulaQuality = Quality.Normal; public bool ShowAsteroidsInMinimap; } -public class PlayerInputSettings +public class RuntimePlayerInputSettings { public Dictionary<(string action, int binding), string> InputActionMap = new Dictionary<(string action, int binding), string>(); public List ActionBarInputs = new List(); diff --git a/Assets/Scripts/ServerShared/PlayerSettings.cs.meta b/Assets/Scripts/ServerShared/RuntimePlayerSettings.cs.meta similarity index 100% rename from Assets/Scripts/ServerShared/PlayerSettings.cs.meta rename to Assets/Scripts/ServerShared/RuntimePlayerSettings.cs.meta diff --git a/Assets/Scripts/UI/HUD/SchematicDisplay.cs b/Assets/Scripts/UI/HUD/SchematicDisplay.cs index b1c6329fb..2c71be18f 100644 --- a/Assets/Scripts/UI/HUD/SchematicDisplay.cs +++ b/Assets/Scripts/UI/HUD/SchematicDisplay.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Collections.Generic; using System.Linq; @@ -139,30 +139,30 @@ public class SchematicDisplay : MonoBehaviour OverrideIcon.SetActive(_entity.OverrideShutdown && cos(Time.time * OverrideIconBlinkSpeed) > 0); ShieldIcon.SetActive(_entity.Shield!=null && _entity.Shield.Item.Active.Value); if (_radiators.Length == 1) - RadiatorTemperatureLabel.text = $"{((int)(_radiators[0].RadiatorTemperature - 273.15f)).ToString()}°C"; + RadiatorTemperatureLabel.text = $"{((int)(_radiators[0].RadiatorTemperature - 273.15f)).ToString()}°C"; else if (_radiators.Length > 1) RadiatorTemperatureLabel.text = $"{((int)(_radiators.Min(r => r.RadiatorTemperature) - 273.15f)).ToString()}-" + - $"{((int)(_radiators.Max(r => r.RadiatorTemperature) - 273.15f)).ToString()}°C"; + $"{((int)(_radiators.Max(r => r.RadiatorTemperature) - 273.15f)).ToString()}°C"; HeatsinkBackground.color = _entity.HeatsinksEnabled ? HeaderElementEnabledColor : HeaderElementDisabledColor; if (_heatStorages.Length == 1) - HeatStorageTemperatureLabel.text = $"{((int)(_heatStorages[0].Item.Temperature - 273.15f)).ToString()}°C"; + HeatStorageTemperatureLabel.text = $"{((int)(_heatStorages[0].Item.Temperature - 273.15f)).ToString()}°C"; else if (_heatStorages.Length > 1) HeatStorageTemperatureLabel.text = $"{((int)(_heatStorages.Min(r => r.Item.Temperature) - 273.15f)).ToString()}-" + - $"{((int)(_heatStorages.Max(r => r.Item.Temperature) - 273.15f)).ToString()}°C"; + $"{((int)(_heatStorages.Max(r => r.Item.Temperature) - 273.15f)).ToString()}°C"; if (_cargoBays.Length == 1) - CargoTemperatureLabel.text = $"{((int)(_cargoBays[0].Temperature - 273.15f)).ToString()}°C"; + CargoTemperatureLabel.text = $"{((int)(_cargoBays[0].Temperature - 273.15f)).ToString()}°C"; else if (_cargoBays.Length > 1) CargoTemperatureLabel.text = $"{((int)(_cargoBays.Min(r => r.Temperature) - 273.15f)).ToString()}-" + - $"{((int)(_cargoBays.Max(r => r.Temperature) - 273.15f)).ToString()}°C"; + $"{((int)(_cargoBays.Max(r => r.Temperature) - 273.15f)).ToString()}°C"; if(_cockpit != null) { - CockpitTemperatureLabel.text = $"{((int) (_cockpit.Item.Temperature - 273.15f)).ToString()}°C"; + CockpitTemperatureLabel.text = $"{((int) (_cockpit.Item.Temperature - 273.15f)).ToString()}°C"; HeatstrokeMeterFill.anchorMax = new Vector2(_entity.Heatstroke, 1); HypothermiaMeterFill.anchorMax = new Vector2(_entity.Hypothermia, 1); @@ -174,7 +174,7 @@ public class SchematicDisplay : MonoBehaviour if (_capacitors.Length == 0) { EnergyFill.anchorMax = Vector2.up; - EnergyLabel.text = ActionGameManager.PlayerSettings.Format(_reactor.Draw); + EnergyLabel.text = ActionGameManager.RuntimePlayerSettings.Format(_reactor.Draw); } else { @@ -186,13 +186,13 @@ public class SchematicDisplay : MonoBehaviour if (_aetherDrive != null) { - ForwardRPMLabel.text = ActionGameManager.PlayerSettings.Format(_aetherDrive.Rpm.x); + ForwardRPMLabel.text = ActionGameManager.RuntimePlayerSettings.Format(_aetherDrive.Rpm.x); ForwardRPMFill.anchorMax = new Vector2(_aetherDrive.Rpm.x / _aetherDrive.MaximumRpm, 1); - StrafeRPMLabel.text = ActionGameManager.PlayerSettings.Format(_aetherDrive.Rpm.y); + StrafeRPMLabel.text = ActionGameManager.RuntimePlayerSettings.Format(_aetherDrive.Rpm.y); StrafeRPMFill.anchorMax = new Vector2(_aetherDrive.Rpm.y / _aetherDrive.MaximumRpm, 1); - TurnRPMLabel.text = ActionGameManager.PlayerSettings.Format(_aetherDrive.Rpm.z); + TurnRPMLabel.text = ActionGameManager.RuntimePlayerSettings.Format(_aetherDrive.Rpm.z); TurnRPMFill.anchorMax = new Vector2(_aetherDrive.Rpm.z / _aetherDrive.MaximumRpm, 1); } } @@ -210,7 +210,7 @@ public class SchematicDisplay : MonoBehaviour var hullData = _entity.ItemManager.GetData(_hull); var dur = _hull.Durability / hullData.Durability; HullDurabilityFill.anchorMax = new Vector2(dur, 1); - HullDurabilityLabel.text = $"{ActionGameManager.PlayerSettings.Format(dur * 100)}%"; + HullDurabilityLabel.text = $"{ActionGameManager.RuntimePlayerSettings.Format(dur * 100)}%"; } foreach (var x in _schematicItems) diff --git a/Assets/Scripts/UI/InputScreen/InputDisplayLayout.cs b/Assets/Scripts/UI/InputScreen/InputDisplayLayout.cs index 7c197f0a7..cccaceb90 100644 --- a/Assets/Scripts/UI/InputScreen/InputDisplayLayout.cs +++ b/Assets/Scripts/UI/InputScreen/InputDisplayLayout.cs @@ -111,7 +111,7 @@ public class InputDisplayLayout : MonoBehaviour buttonMapping.TestAction.Enable(); } - foreach(var actionBarInput in ActionGameManager.PlayerSettings.InputSettings.ActionBarInputs) + foreach(var actionBarInput in ActionGameManager.RuntimePlayerSettings.InputSettings.ActionBarInputs) { if (!_bindButtons.ContainsKey(actionBarInput)) Debug.LogError($"Unable to find input button for \"{actionBarInput}\""); else @@ -527,7 +527,7 @@ public class InputDisplayLayout : MonoBehaviour { _dragAction.Binding.overridePath = _previewButton.Button.InputSystemPath; _dragAction.Action.ApplyBindingOverride(_dragAction.Binding); - ActionGameManager.PlayerSettings.InputSettings.InputActionMap[(_dragAction.Action.name, + ActionGameManager.RuntimePlayerSettings.InputSettings.InputActionMap[(_dragAction.Action.name, _dragAction.Action.GetBindingIndex(_dragAction.Binding))] = _previewButton.Button.InputSystemPath; // TODO: Assign New Binding } @@ -550,13 +550,13 @@ public class InputDisplayLayout : MonoBehaviour buttonMapping.IsActionBarButton = !buttonMapping.IsActionBarButton; if (buttonMapping.IsActionBarButton) { - ActionGameManager.PlayerSettings.InputSettings.ActionBarInputs.Add(buttonMapping.Button.InputSystemPath); + ActionGameManager.RuntimePlayerSettings.InputSettings.ActionBarInputs.Add(buttonMapping.Button.InputSystemPath); foreach(var overlap in OverlappingLabels(buttonMapping.ButtonRect)) PlaceLabel(overlap); } else { - ActionGameManager.PlayerSettings.InputSettings.ActionBarInputs.Remove(buttonMapping.Button.InputSystemPath); + ActionGameManager.RuntimePlayerSettings.InputSettings.ActionBarInputs.Remove(buttonMapping.Button.InputSystemPath); } AssignColor(buttonMapping); }); diff --git a/Assets/Scripts/UI/MainMenu.cs b/Assets/Scripts/UI/MainMenu.cs index 5527f0cf0..0543cd2f3 100644 --- a/Assets/Scripts/UI/MainMenu.cs +++ b/Assets/Scripts/UI/MainMenu.cs @@ -107,7 +107,7 @@ public class MainMenu : MonoBehaviour Dialog.AddProperty(() => generatorState); Dialog.Show(); - if (ActionGameManager.PlayerSettings.TutorialPassed) + if (ActionGameManager.RuntimePlayerSettings.TutorialPassed) { Settings.SectorBackgroundSettings.NoisePosition = Random.value * 1000; ActionGameManager.IsTutorial = false; @@ -144,7 +144,7 @@ public class MainMenu : MonoBehaviour Settings.TutorialBackgroundSettings, Settings.NameGeneratorSettings, ActionGameManager.RuntimeCatalog, - ActionGameManager.PlayerSettings, + ActionGameManager.RuntimePlayerSettings, ActionGameManager.GameDataDirectory.CreateSubdirectory("Narrative"), Debug.Log, setState); @@ -206,19 +206,19 @@ public class MainMenu : MonoBehaviour _nextMenu.panel.Clear(); _nextMenu.panel.Title.text = TitleSubtitle("gameplay", "settings"); _nextMenu.panel.AddField("Name", - () => ActionGameManager.PlayerSettings.Name, - s => ActionGameManager.PlayerSettings.Name = s); + () => ActionGameManager.RuntimePlayerSettings.Name, + s => ActionGameManager.RuntimePlayerSettings.Name = s); _nextMenu.panel.AddField("Temperature Unit", - () => (int) ActionGameManager.PlayerSettings.GameplaySettings.TemperatureUnit, - i => ActionGameManager.PlayerSettings.GameplaySettings.TemperatureUnit = (TemperatureUnit) i, + () => (int) ActionGameManager.RuntimePlayerSettings.GameplaySettings.TemperatureUnit, + i => ActionGameManager.RuntimePlayerSettings.GameplaySettings.TemperatureUnit = (TemperatureUnit) i, Enum.GetNames(typeof(TemperatureUnit))); _nextMenu.panel.AddField("Significant Digits", - () => ActionGameManager.PlayerSettings.GameplaySettings.SignificantDigits, - i => ActionGameManager.PlayerSettings.GameplaySettings.SignificantDigits = i); + () => ActionGameManager.RuntimePlayerSettings.GameplaySettings.SignificantDigits, + i => ActionGameManager.RuntimePlayerSettings.GameplaySettings.SignificantDigits = i); _nextMenu.panel.AddButton("Back", () => { - ActionGameManager.SavePlayerSettings(); + ActionGameManager.QueueRuntimePlayerSettingsCommit(); ShowSettings(); Fade(false); }); @@ -229,16 +229,16 @@ public class MainMenu : MonoBehaviour _nextMenu.panel.Clear(); _nextMenu.panel.Title.text = TitleSubtitle("graphics", "settings"); _nextMenu.panel.AddField("Nebula Quality", - () => (int)ActionGameManager.PlayerSettings.GraphicsSettings.NebulaQuality, + () => (int)ActionGameManager.RuntimePlayerSettings.GraphicsSettings.NebulaQuality, i => { - ActionGameManager.PlayerSettings.GraphicsSettings.NebulaQuality = (Quality)i; - CloudRenderer.quality = ActionGameManager.PlayerSettings.GraphicsSettings.NebulaQuality; + ActionGameManager.RuntimePlayerSettings.GraphicsSettings.NebulaQuality = (Quality)i; + CloudRenderer.quality = ActionGameManager.RuntimePlayerSettings.GraphicsSettings.NebulaQuality; }, Enum.GetNames(typeof(Quality))); _nextMenu.panel.AddField("Show Asteroids in Minimap", - () => ActionGameManager.PlayerSettings.GraphicsSettings.ShowAsteroidsInMinimap, - b => ActionGameManager.PlayerSettings.GraphicsSettings.ShowAsteroidsInMinimap = b); + () => ActionGameManager.RuntimePlayerSettings.GraphicsSettings.ShowAsteroidsInMinimap, + b => ActionGameManager.RuntimePlayerSettings.GraphicsSettings.ShowAsteroidsInMinimap = b); _nextMenu.panel.AddButton("Back", () => { diff --git a/Assets/Scripts/UI/Menu/InventoryPanel.cs b/Assets/Scripts/UI/Menu/InventoryPanel.cs index a8a797748..e94d2e03b 100644 --- a/Assets/Scripts/UI/Menu/InventoryPanel.cs +++ b/Assets/Scripts/UI/Menu/InventoryPanel.cs @@ -207,8 +207,8 @@ public class InventoryPanel : MonoBehaviour, IPointerClickHandler var opacity = smoothstep(0, MinTempRange, tempRange); if(MinTempLabel) { - MinTempLabel.text = ActionGameManager.PlayerSettings.FormatTemperature(_displayedEntity.MinTemp); - MaxTempLabel.text = ActionGameManager.PlayerSettings.FormatTemperature(_displayedEntity.MaxTemp); + MinTempLabel.text = ActionGameManager.RuntimePlayerSettings.FormatTemperature(_displayedEntity.MinTemp); + MaxTempLabel.text = ActionGameManager.RuntimePlayerSettings.FormatTemperature(_displayedEntity.MaxTemp); } var hullData = GameManager.ItemManager.GetData(_displayedEntity.Hull) as HullData; for(var x = 0; x < _temperatureTexture.width; x++) diff --git a/Assets/Scripts/UI/Menu/MapRenderer.cs b/Assets/Scripts/UI/Menu/MapRenderer.cs index 298140899..2038e8318 100644 --- a/Assets/Scripts/UI/Menu/MapRenderer.cs +++ b/Assets/Scripts/UI/Menu/MapRenderer.cs @@ -1,4 +1,4 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ @@ -52,7 +52,7 @@ public class MapRenderer : MonoBehaviour Title.text = $"Zone: {GameManager.Zone.GalaxyZone.Name}"; // If hiding minimap asteroids, turn them back on for the map screen - if (!ActionGameManager.PlayerSettings.GraphicsSettings.ShowAsteroidsInMinimap) + if (!ActionGameManager.RuntimePlayerSettings.GraphicsSettings.ShowAsteroidsInMinimap) ZoneRenderer.ShowAsteroidUI = true; } @@ -68,7 +68,7 @@ public class MapRenderer : MonoBehaviour InfluenceCamera.gameObject.SetActive(false); // If hiding minimap asteroids, turn them back off when leaving the map screen - if (!ActionGameManager.PlayerSettings.GraphicsSettings.ShowAsteroidsInMinimap) + if (!ActionGameManager.RuntimePlayerSettings.GraphicsSettings.ShowAsteroidsInMinimap) ZoneRenderer.ShowAsteroidUI = false; } diff --git a/Assets/Scripts/UI/Menu/SectorRenderer.cs b/Assets/Scripts/UI/Menu/SectorRenderer.cs index 1090264c2..b0f89e1ab 100644 --- a/Assets/Scripts/UI/Menu/SectorRenderer.cs +++ b/Assets/Scripts/UI/Menu/SectorRenderer.cs @@ -69,8 +69,8 @@ public class SectorRenderer : MonoBehaviour, IBeginDragHandler, IDragHandler, IS var density = saturate(ActionGameManager.CurrentGalaxy.Background.CloudDensity(zone.Position)/2); var radius = GameManager.Settings.ZoneSettings.ZoneRadius.Evaluate(density); var mass = GameManager.Settings.ZoneSettings.ZoneMass.Evaluate(density); - Properties.AddProperty("Mass", () => ActionGameManager.PlayerSettings.Format(mass)); - Properties.AddProperty("Radius", () => ActionGameManager.PlayerSettings.Format(radius)); + Properties.AddProperty("Mass", () => ActionGameManager.RuntimePlayerSettings.Format(mass)); + Properties.AddProperty("Radius", () => ActionGameManager.RuntimePlayerSettings.Format(radius)); if (zone.RuntimeBlueprint == null) { Properties.AddProperty(() => "Has not been visited"); diff --git a/Assets/Scripts/UI/Menu/TradeMenu.cs b/Assets/Scripts/UI/Menu/TradeMenu.cs index 0a8d2e717..1cefdcc62 100644 --- a/Assets/Scripts/UI/Menu/TradeMenu.cs +++ b/Assets/Scripts/UI/Menu/TradeMenu.cs @@ -212,7 +212,7 @@ public class TradeMenu : MonoBehaviour return 0; })); columns.Add(("Mass", 1, - x => () => ActionGameManager.PlayerSettings.Format(x.data.Mass), + x => () => ActionGameManager.RuntimePlayerSettings.Format(x.data.Mass), data => data.Mass)); columns.Add(("Price", 1, x => () => (x.item is CraftedItemInstance craftedItemInstance ? GameManager.ItemManager.GetPrice(craftedItemInstance) : x.data.Price).ToString("N0"), @@ -254,7 +254,7 @@ public class TradeMenu : MonoBehaviour columns.Add((field.Name, 1, x => { var behavior = ((EquippableItemData) x.data).Behaviors.FirstOrDefault(b => type.IsInstanceOfType(b)); - return () => ActionGameManager.PlayerSettings.Format((float) field.GetValue(behavior)); + return () => ActionGameManager.RuntimePlayerSettings.Format((float) field.GetValue(behavior)); }, data => { var behavior = ((EquippableItemData) data).Behaviors.FirstOrDefault(b => type.IsInstanceOfType(b)); @@ -275,7 +275,7 @@ public class TradeMenu : MonoBehaviour columns.Add((field.Name, 1, x => { var behavior = ((EquippableItemData) x.data).Behaviors.FirstOrDefault(b => type.IsInstanceOfType(b)); - return () => ActionGameManager.PlayerSettings.Format(((PerformanceStat) field.GetValue(behavior)).Max); + return () => ActionGameManager.RuntimePlayerSettings.Format(((PerformanceStat) field.GetValue(behavior)).Max); }, data => { var behavior = ((EquippableItemData) data).Behaviors.FirstOrDefault(b => type.IsInstanceOfType(b)); diff --git a/Assets/Scripts/UI/Properties Panel/PropertiesPanel.cs b/Assets/Scripts/UI/Properties Panel/PropertiesPanel.cs index 5dd9be2af..d4237157b 100644 --- a/Assets/Scripts/UI/Properties Panel/PropertiesPanel.cs +++ b/Assets/Scripts/UI/Properties Panel/PropertiesPanel.cs @@ -1,4 +1,4 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ @@ -392,7 +392,7 @@ public class PropertiesPanel : MonoBehaviour var sheet = AddStatSheet(); var manufacturer = ActionGameManager.RuntimeCatalog?.FindCorporationByLegacyId(data.Manufacturer.ToString()); sheet.AddStat("Manufacturer", () => manufacturer?.Name ?? "GameCult"); - sheet.AddStat("Mass", () => ActionGameManager.PlayerSettings.Format(GameManager.ItemManager.GetMass(item))); + sheet.AddStat("Mass", () => ActionGameManager.RuntimePlayerSettings.Format(GameManager.ItemManager.GetMass(item))); //AddProperty("Thermal Mass", () => Context.GetThermalMass(item).SignificantDigits(Context.GameplaySettings.SignificantDigits)); } @@ -411,7 +411,7 @@ public class PropertiesPanel : MonoBehaviour { if (behavior is StatModifierData statMod) { - sheet.AddStat($"{statMod.Stat.Target.SplitCamelCase()}:{statMod.Stat.Stat.SplitCamelCase()}", () => $"{(statMod.Type == StatModifierType.Constant ? "+" : "x")}{ActionGameManager.PlayerSettings.Format(statValueFunction(statMod.Modifier))}"); + sheet.AddStat($"{statMod.Stat.Target.SplitCamelCase()}:{statMod.Stat.Stat.SplitCamelCase()}", () => $"{(statMod.Type == StatModifierType.Constant ? "+" : "x")}{ActionGameManager.RuntimePlayerSettings.Format(statValueFunction(statMod.Modifier))}"); } else { @@ -421,13 +421,13 @@ public class PropertiesPanel : MonoBehaviour { var fieldType = field.FieldType; if (fieldType == typeof(float)) - sheet.AddStat(field.Name.SplitCamelCase(), () => $"{ActionGameManager.PlayerSettings.Format((float) field.GetValue(behavior))}"); + sheet.AddStat(field.Name.SplitCamelCase(), () => $"{ActionGameManager.RuntimePlayerSettings.Format((float) field.GetValue(behavior))}"); else if (fieldType == typeof(int)) sheet.AddStat(field.Name.SplitCamelCase(), () => $"{(int) field.GetValue(behavior)}"); else if (fieldType == typeof(PerformanceStat)) { var stat = (PerformanceStat) field.GetValue(behavior); - sheet.AddStat(field.Name.SplitCamelCase(), () => $"{ActionGameManager.PlayerSettings.Format(statValueFunction(stat))}"); + sheet.AddStat(field.Name.SplitCamelCase(), () => $"{ActionGameManager.RuntimePlayerSettings.Format(statValueFunction(stat))}"); } } } @@ -436,7 +436,7 @@ public class PropertiesPanel : MonoBehaviour if (gearData.Behaviors.FirstOrDefault(b => b is WeaponData) is WeaponData weapon) { var range = AddCurveField(); - range.Show("Damage Range", weapon.DamageCurve, t => ActionGameManager.PlayerSettings.Format(lerp(statValueFunction(weapon.MinRange), statValueFunction(weapon.Range), t))); + range.Show("Damage Range", weapon.DamageCurve, t => ActionGameManager.RuntimePlayerSettings.Format(lerp(statValueFunction(weapon.MinRange), statValueFunction(weapon.Range), t))); } } @@ -490,13 +490,13 @@ public class PropertiesPanel : MonoBehaviour if (item.EquippableItem.Durability < .01f) statusSheet.AddStat("Durability", () => "Item Destroyed!"); else statusSheet.AddStat("Durability", () => $"{(int)(item.EquippableItem.Durability / gearData.Durability * 100)}%"); - statusSheet.AddStat("Temperature", () => ActionGameManager.PlayerSettings.FormatTemperature(item.Temperature)); + statusSheet.AddStat("Temperature", () => ActionGameManager.RuntimePlayerSettings.FormatTemperature(item.Temperature)); var heatCurve = AddCurveField(); heatCurve.Show( "Thermal Performance", gearData.HeatPerformanceCurve, - t => ActionGameManager.PlayerSettings.FormatTemperature(lerp(gearData.MinimumTemperature, gearData.MaximumTemperature, t)), + t => ActionGameManager.RuntimePlayerSettings.FormatTemperature(lerp(gearData.MinimumTemperature, gearData.MaximumTemperature, t)), true); RefreshPropertyValues += () => heatCurve.SetCurrent(unlerp(gearData.MinimumTemperature, gearData.MaximumTemperature, item.Temperature)); AddEquippableItemProperties(item.EquippableItem, item.Evaluate); @@ -536,7 +536,7 @@ public class PropertiesPanel : MonoBehaviour heatCurve.Show( "Thermal Performance", gearData.HeatPerformanceCurve, - t => ActionGameManager.PlayerSettings.FormatTemperature(lerp(gearData.MinimumTemperature, gearData.MaximumTemperature, t)), + t => ActionGameManager.RuntimePlayerSettings.FormatTemperature(lerp(gearData.MinimumTemperature, gearData.MaximumTemperature, t)), true); AddEquippableItemProperties(gear, stat => GameManager.ItemManager.Evaluate(stat, gear)); } @@ -550,16 +550,16 @@ public class PropertiesPanel : MonoBehaviour AddProperty(data.Description).Label.fontStyle = FontStyles.Normal; if (data is EquippableItemData gearData) { - AddProperty("Durability", () => ActionGameManager.PlayerSettings.Format(gearData.Durability)); + AddProperty("Durability", () => ActionGameManager.RuntimePlayerSettings.Format(gearData.Durability)); var sheet = AddStatSheet(); foreach (var behavior in gearData.Behaviors) { if (behavior is StatModifierData statMod) { if(Math.Abs(statMod.Modifier.Min - statMod.Modifier.Max) < .001f) - sheet.AddStat($"{statMod.Stat.Target}:{statMod.Stat.Stat}", () => $"{(statMod.Type == StatModifierType.Constant ? "+" : "x")}{ActionGameManager.PlayerSettings.Format(statMod.Modifier.Min)}"); + sheet.AddStat($"{statMod.Stat.Target}:{statMod.Stat.Stat}", () => $"{(statMod.Type == StatModifierType.Constant ? "+" : "x")}{ActionGameManager.RuntimePlayerSettings.Format(statMod.Modifier.Min)}"); else - sheet.AddStat($"{statMod.Stat.Target}:{statMod.Stat.Stat}", () => $"{(statMod.Type == StatModifierType.Constant ? "+" : "x")}{ActionGameManager.PlayerSettings.Format(statMod.Modifier.Min)}-{ActionGameManager.PlayerSettings.Format(statMod.Modifier.Max)}"); + sheet.AddStat($"{statMod.Stat.Target}:{statMod.Stat.Stat}", () => $"{(statMod.Type == StatModifierType.Constant ? "+" : "x")}{ActionGameManager.RuntimePlayerSettings.Format(statMod.Modifier.Min)}-{ActionGameManager.RuntimePlayerSettings.Format(statMod.Modifier.Max)}"); } var type = behavior.GetType(); if (type.GetCustomAttribute(typeof(RuntimeInspectable)) != null) @@ -568,16 +568,16 @@ public class PropertiesPanel : MonoBehaviour { var fieldType = field.FieldType; if (fieldType == typeof(float)) - sheet.AddStat(field.Name, () => $"{ActionGameManager.PlayerSettings.Format((float) field.GetValue(behavior))}"); + sheet.AddStat(field.Name, () => $"{ActionGameManager.RuntimePlayerSettings.Format((float) field.GetValue(behavior))}"); else if (fieldType == typeof(int)) sheet.AddStat(field.Name, () => $"{(int) field.GetValue(behavior)}"); else if (fieldType == typeof(PerformanceStat)) { var stat = (PerformanceStat) field.GetValue(behavior); if(Math.Abs(stat.Min - stat.Max) < .001f) - sheet.AddStat(field.Name, () => $"{ActionGameManager.PlayerSettings.Format(stat.Min)}"); + sheet.AddStat(field.Name, () => $"{ActionGameManager.RuntimePlayerSettings.Format(stat.Min)}"); else - sheet.AddStat(field.Name, () => $"{ActionGameManager.PlayerSettings.Format(stat.Min)}-{ActionGameManager.PlayerSettings.Format(stat.Max)}"); + sheet.AddStat(field.Name, () => $"{ActionGameManager.RuntimePlayerSettings.Format(stat.Min)}-{ActionGameManager.RuntimePlayerSettings.Format(stat.Max)}"); } } } diff --git a/Assets/Scripts/Zone Display/VolumeCloudRenderer.cs b/Assets/Scripts/Zone Display/VolumeCloudRenderer.cs index bc71da703..7a0979c4e 100644 --- a/Assets/Scripts/Zone Display/VolumeCloudRenderer.cs +++ b/Assets/Scripts/Zone Display/VolumeCloudRenderer.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using System.Collections; using System.Collections.Generic; @@ -78,7 +78,7 @@ public class VolumeCloudRenderer : EffectBase private void Start() { this.EnsureMaterial(true); if (Application.isPlaying) - quality = ActionGameManager.PlayerSettings.GraphicsSettings.NebulaQuality; + quality = ActionGameManager.RuntimePlayerSettings.GraphicsSettings.NebulaQuality; } [ImageEffectOpaque] diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index 34e475242..0cfa20b5d 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -40,8 +40,8 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. `AetheriaStateNode`. Local run saves, loadouts, player settings files, zone files, and generated keyboard layout caches no longer write bespoke durable files. The legacy - `PlayerSettings` runtime object is no longer decorated as a MessagePack - persistence shape. `Economy.Server` now drains `aetheria-world.cc.pending` + `RuntimePlayerSettings` runtime object is no longer named or decorated as a + MessagePack persistence shape. `Economy.Server` now drains `aetheria-world.cc.pending` into canonical typed state and drains `aetheria-world.cc.eve.pending` through the provider-owned Eve command bridge on startup and on a daemon polling loop while hosting the CultMesh state node. `Aetheria.State.ApplyPending` remains a @@ -68,8 +68,8 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. pointer into the typed Verse replacement for `PlayerSettings.msgpack`: player name, tutorial flag, story-file hash cursors, gameplay formatting, graphics preferences, input binding overrides, and action-bar inputs. Unity's menu and - input screens still mutate the old `PlayerSettings` runtime object in memory - until the runtime Verse package is wired. + input screens mutate `RuntimePlayerSettings` in memory and queue typed Verse + commits; the in-memory projection is not portable state authority. - `Aetheria.State` now exposes typed node put/get ports for run state, zone state, and entity snapshots. The state smoke writes a run referencing a zone, a zone referencing an entity snapshot, and an entity snapshot carrying @@ -636,6 +636,10 @@ First Aetheria surfaces to publish: `RuntimeZoneBlueprint`/`RuntimeEntityBlueprint`, and rename loadout collections away from save-payload vocabulary. These are now explicitly runtime construction projections, not portable state authority. + - Done: demote Unity's live `PlayerSettings` runtime object to + `RuntimePlayerSettings`; `AetheriaPlayerSettings` remains the typed Verse + state document owner, while Unity only keeps a session projection and + queues typed player-settings commits. - Remaining: delete or quarantine old cache abstractions that no longer protect an invariant once catalog migration has a typed reader. @@ -682,6 +686,8 @@ First Aetheria surfaces to publish: live Unity source has no `EntityPack`, `ShipPack`, `OrbitalEntityPack`, `ZonePack`, `PackedContents`, `PackZone`, `EntitySerializer.Pack`, or `EntitySerializer.Unpack` hits. +- Unity runtime settings projection is now `RuntimePlayerSettings`; live Unity + source has no standalone `PlayerSettings` class/property/method symbols. - `Aetheria.State.Smoke` proves the provider-owned Eve command bridge drains `gamecult.eve.command.v1` envelopes, accepts advertised refresh commands, rejects unknown commands, persists `AetheriaEveCommandDrainStatus`, and exposes