Delete the old run, settings, layout and loadout authorities (Cut 10)
The deletion line lands before RunSave, as the spec orders. Deleted, not demoted: - PlayerSettings.SavedRun (Key 1 stays unclaimed) and the SavedGame constructor that upserted a fresh SavedZone per zone on every save. - ActionGameManager: the PlayerSettings.msgpack getter, file path and writer; the .loadout format (_loadoutPath, Loadouts, SaveLoadout and its default-options serializer, the commented loader); OnApplicationQuit and SaveState; SaveZone, which had no caller. - MainMenu's SavedRun Continue branch and both `SavedRun = null` writes. - InventoryPanel's Save Loadout and Restore Loadout bodies. - InputDisplayLayout's KeyboardLayouts file reader, ParseJson, AssociateInputKeys, SaveLayout and the usings they alone needed. - AetherDb's Cut 9 importer (Import.cs, legacy-census, import). - The three-gates note on loading writes; Cut 3 made loading non-writing. - .gitignore ignores GameData/run.cc and GameData/player.cc instead of PlayerSettings.msgpack. DOES NOT BUILD in Unity: ActionGameManager, MainMenu and InputDisplayLayout still reference the deleted members until the next commit wires RunSave, the settings getter and the catalog layout read. Headless builds. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
aa05a99617
commit
5c5c3d5e19
11 changed files with 6 additions and 508 deletions
|
|
@ -55,23 +55,6 @@ public class ActionGameManager : MonoBehaviour
|
|||
}
|
||||
}
|
||||
|
||||
private static PlayerSettings _playerSettings;
|
||||
public static PlayerSettings PlayerSettings
|
||||
{
|
||||
get
|
||||
{
|
||||
return _playerSettings ??= File.Exists(_playerSettingsFilePath)
|
||||
? MessagePackSerializer.Deserialize<PlayerSettings>(File.ReadAllBytes(_playerSettingsFilePath), CultDocumentMessagePackSerialization.OptionsFor(typeof(PlayerSettings).Assembly))
|
||||
: GetDefaultPlayerSettings();
|
||||
}
|
||||
}
|
||||
|
||||
private static string _playerSettingsFilePath => Path.Combine(GameDataDirectory.FullName, "PlayerSettings.msgpack");
|
||||
public static void SavePlayerSettings()
|
||||
{
|
||||
File.WriteAllBytes(_playerSettingsFilePath, MessagePackSerializer.Serialize(_playerSettings, CultDocumentMessagePackSerialization.OptionsFor(typeof(PlayerSettings).Assembly)));
|
||||
}
|
||||
|
||||
private static PlayerSettings GetDefaultPlayerSettings()
|
||||
{
|
||||
var settings = new PlayerSettings();
|
||||
|
|
@ -161,7 +144,6 @@ public class ActionGameManager : MonoBehaviour
|
|||
// private CinemachineFramingTransposer _transposer;
|
||||
// private CinemachineComposer _composer;
|
||||
|
||||
private DirectoryInfo _loadoutPath;
|
||||
private bool _paused;
|
||||
private float _time;
|
||||
private int _zoomLevelIndex;
|
||||
|
|
@ -205,7 +187,6 @@ public class ActionGameManager : MonoBehaviour
|
|||
|
||||
public ItemManager ItemManager { get; private set; }
|
||||
public Zone Zone { get; private set; }
|
||||
public List<EntityPack> Loadouts { get; } = new List<EntityPack>();
|
||||
|
||||
private readonly (float2 direction, string name)[] _directions = {
|
||||
(float2(0, 1), "Front"),
|
||||
|
|
@ -224,24 +205,6 @@ public class ActionGameManager : MonoBehaviour
|
|||
get => MessagePackSerializer.Deserialize<EntitySettings>(MessagePackSerializer.Serialize(Settings.GameplaySettings.DefaultEntitySettings));
|
||||
}
|
||||
|
||||
public void SaveLoadout(EntityPack pack)
|
||||
{
|
||||
File.WriteAllBytes(Path.Combine(_loadoutPath.FullName, $"{pack.Name}.loadout"), MessagePackSerializer.Serialize(pack));
|
||||
}
|
||||
|
||||
private void OnApplicationQuit() => SaveState();
|
||||
|
||||
public void SaveState()
|
||||
{
|
||||
PlayerSettings.SavedRun = CurrentGalaxy == null ? null : new SavedGame(CultCache, CurrentGalaxy, Zone, DockedEntity ?? CurrentEntity);
|
||||
if(PlayerSettings.SavedRun != null)
|
||||
{
|
||||
PlayerSettings.SavedRun.IsTutorial = IsTutorial;
|
||||
PlayerSettings.SavedRun.ActionBarBindings = _actionBarSlots.Select(slot => slot.Save()).ToArray();
|
||||
}
|
||||
SavePlayerSettings();
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
Input.Dispose();
|
||||
|
|
@ -264,10 +227,6 @@ public class ActionGameManager : MonoBehaviour
|
|||
|
||||
// TODO: Process Stories
|
||||
|
||||
// _loadoutPath = GameDataDirectory.CreateSubdirectory("Loadouts");
|
||||
// Loadouts.AddRange(_loadoutPath.EnumerateFiles("*.loadout")
|
||||
// .Select(fi => MessagePackSerializer.Deserialize<EntityPack>(File.ReadAllBytes(fi.FullName))));
|
||||
|
||||
#region Input Handling
|
||||
|
||||
Input = new AetheriaInput();
|
||||
|
|
@ -1084,9 +1043,6 @@ public class ActionGameManager : MonoBehaviour
|
|||
});
|
||||
}
|
||||
|
||||
public void SaveZone(string name) => File.WriteAllBytes(
|
||||
Path.Combine(_gameDataDirectory.FullName, $"{name}.zone"), MessagePackSerializer.Serialize(Zone.PackZone()));
|
||||
|
||||
// public void ToggleEditMode()
|
||||
// {
|
||||
// _editMode = !_editMode;
|
||||
|
|
|
|||
Loading…
Reference in a new issue