Commit graph Aetheria/Assets/Scripts/UI/Menu/InventoryPanel.cs
Author SHA1 Message Date
Meta Vens
89667ca4e7 Offer Save Loadout only for a displayed ship (Cut 10 fix)
The option was added for any displayed entity, stations included, and a null
displayed entity threw when chosen. It is now added only when the displayed
entity is a Ship, the same conditional shape as the Restore Loadout guard.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 22:29:58 +02:00
Meta Vens
5e5c304e37 Make loadout availability a port and move the charge into Materialize (Cut 10 fix)
Materialize takes isAvailable as a Predicate<FactionProductData>; the restore
menu passes LoadoutGenerator.IsAvailable for the docked station, so generation
and loadouts still share one availability rule. Candidate products are ordered
by record key, so "first available product" no longer depends on dictionary
order. Materialize charges Price through ref credits only when it returns a
ship; RestoreLoadout no longer subtracts on its own.

Tests: a slot that resolves but does not fit builds nothing, charges nothing and
is listed; Price is the sum of design prices and is charged on success; the
first available product in key order builds a slot, a later one is used when
the first is unavailable, and none available fails the slot.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 22:27:03 +02:00
Meta Vens
00f62acc34 Make loadouts player-store design documents built all-or-nothing (Cut 10)
Loadout.cs owns loadouts: the document, capture, save and materialization.

- Loadout ("aetheria.loadout", player store) holds a hull design ref, and
  per slot a hull cell, a rotation and an EquippableItemData design ref,
  plus weapon groups as slot indices. It names no product, manufacturer,
  unit roll, cargo, faction, position or behaviour state.
- Loadouts.Capture records the hull design and one slot per equipped item
  (gear, cargo bays, docking bays). Entity.Equipment also holds the hull's
  own unit (MapEntity adds EquippedHull); that is Loadout.Hull, not a slot.
- Loadouts.Save is the only writer: one Commit to the player store, reusing
  the existing key for the name.
- Loadouts.Materialize is the only builder of a ship from a loadout. For
  the hull and each slot in order it resolves the design and takes the
  first product in catalog order that LoadoutGenerator.IsAvailable (now
  public) accepts, with no any-manufacturer fallback. Every failing slot is
  listed; units are built only after everything resolved, and any resolve
  or fit failure returns null with no ship, no charge and no write.
- Loadouts.Price is the hull design's price plus each slot design's price.
- InventoryPanel: Save Loadout asks for a name (default: the ship's name)
  and saves the capture. Restore Loadout, shown when docked with saved
  loadouts, lists each with its price, debits credits only after
  Materialize succeeds, then docks the ship as before; a failure opens
  "Loadout cannot be built here" with one line per failing slot.

Tests: new LoadoutTests (3): LoadoutRoundTripsThroughAFreshCache,
LoadoutHoldsNoRunOrGalaxyRefs, MissingDesignReports. Each fails with its
rule mutated out. The fixture hull is 3x3, not the spec's 2x2:
HullData.InteriorCells is Shape.Shrink(), so a 2x2 hull has no interior
cell a cargo bay can occupy.

Builds: headless, 14 tests pass, Unity batchmode compile reports no error CS.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 22:06:06 +02:00
Meta Vens
5c5c3d5e19 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>
2026-09-14 21:51:10 +02:00
Meta Vens
9bdf6ef23f Replace the Database Tools with the Studio and cut Unity over
Cut 8b. The Unity project compiles with 0 errors in 6000.3.24f1 batchmode.

Packages: manifest.json pins org.gamecult.cultlib at cultlib-unity-v1.0.57
and org.gamecult.caching.unity at caching-unity-v1.2.0, next to the 8a
CultMath tag. Aetheria.Shared.Unity references GameCult.CultLib and keeps
noEngineReferences.

The Database Tools (Assets/Scripts/CultCache/Editor) are deleted in this
commit, alongside their five ported drawers in
Assets/Scripts/Editor/CultCacheDrawers.cs, each an
[CultInspectorDrawer] ICultInspectorDrawer:
- InspectableType: popup of the attribute type's [Union] member names,
  writing the string.
- InspectableColor: float3 and float4 through ColorField.
- InspectableAnimationCurve: float4[] and BezierCurve through CurveField.
- InspectableTemperature: Kelvin, Celsius and Fahrenheit fields over one
  value.
- InspectableSchematicShape: size and cell toggles. The old drawer also
  drew the item's schematic texture and tinted hull hardpoints, which need
  the parent document. The tagged Studio hands a drawer only the value, so
  those wait on the Studio exposing the open record.

Unity call sites:
- ActionGameManager opens the catalog through AetheriaStores; Cut 10 adds
  the run and player stores.
- Refs resolve through ItemManager.GetData or Get(ref); orbit, planet and
  belt maps key by CultRecordKey; identity is compared by reference or key.
- The PlayerSettings.msgpack reader and writer, which Cut 10 deletes, pass
  CultDocumentMessagePackSerialization.OptionsFor, since the embedded run
  reaches CultMath values and refs. Keyboard layouts need no resolver and
  keep MessagePack's defaults until Cut 10.
- The input map uses the nested action to binding shape.
- PropertiesPanel reads CultInspectorRangeAttribute.
- NameTools loses its legacy name-file writer.
- Slime compares serialized settings instead of the deleted SHA1 helper.
- FieldDriver drops InspectorHeader.
- .gitignore covers the test project's build output.

Builds: Aetheria.Shared, AetherDb, Aetheria.Shared.Tests (6/6), Unity
batchmode (0 errors).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 19:15:20 +02:00
Meta Vens
6140a06a0a Swap Unity.Mathematics usings for CultMath
Every Unity.Mathematics using, alias and qualified name under Assets\Scripts
and tools now names CultMath. The nine `using static ...noise;` lines are
gone: snoise lives on CultMath's math. UnityExtensions loses float4.ToColor
and Color.ToFloat4, which duplicate the bridge's ToColor and ToCultMath; the
float3 colour pair stays because the bridge has none.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 17:39:12 +02:00
Meta Vens
7006a6b0dd Restore the stable legacy Unity project 2026-08-10 14:57:50 +01:00
Meta Vens
b88bafd9e1 Use managed Verse target copy 2026-07-06 01:29:53 +01:00
Meta Vens
4d7bb65868 Integrate CultMesh UI and URP cleanup 2026-06-30 19:14:49 +01:00
Meta Vens
4981e9d1fa Fix typed Unity state compile errors 2026-06-29 13:07:24 +01:00
Meta Vens
7285a82cb1 Expose native Unity indexed document access 2026-06-29 12:27:34 +01:00
Meta Vens
8b718d0da9 Map inventory docking from typed state 2026-06-29 11:41:32 +01:00
Meta Vens
6497636bb2 Sample inventory panel through current typed access 2026-06-29 10:36:52 +01:00
Meta Vens
ade95ae5b6 Sample docking state through current typed access 2026-06-29 09:54:19 +01:00
Meta Vens
29111f74f4 Normalize menu shared document snapshots 2026-06-29 09:25:56 +01:00
Meta Vens
e08819dbbb Normalize inventory typed state reads 2026-06-29 09:21:29 +01:00
Meta Vens
aa45a6bb07 Add named parameterized document access 2026-06-29 07:51:45 +01:00
Meta Vens
6f666fd6cf Add named daemon render document access 2026-06-29 07:36:45 +01:00
Meta Vens
a3d6df3bfd Add named catalog and settings document access 2026-06-29 07:30:21 +01:00
Meta Vens
baac952fe3 Add named entity and refit document access 2026-06-29 07:21:01 +01:00
Meta Vens
ae3c1f9ff2 Use provider UI handle for Unity commands 2026-06-29 06:46:38 +01:00
Meta Vens
d27e8ccee1 Use provider-native observed docking access 2026-06-29 06:35:20 +01:00
Meta Vens
d10da01a69 Expose native Unity runtime state access 2026-06-29 06:10:30 +01:00
Meta Vens
80cda5245b Build inventory dropdown model directly 2026-06-29 05:44:24 +01:00
Meta Vens
759caaaf17 Describe inventory access as typed documents 2026-06-29 05:11:56 +01:00
Meta Vens
a21f7be296 Use typed indexed Aetheria state access 2026-06-29 05:01:45 +01:00
Meta Vens
6439809c7e Scope managed client document selectors 2026-06-29 04:37:22 +01:00
Meta Vens
296a0b6de8 Add native reactive client state access 2026-06-29 04:18:22 +01:00
Meta Vens
7a7000f202 Move loadout template access onto run checkpoints 2026-06-29 04:02:45 +01:00
Meta Vens
0830588cbb Flatten Aetheria CultMesh reactive access 2026-06-29 02:42:08 +01:00
Meta Vens
3048b52058 Use generic current state documents 2026-06-29 00:08:58 +01:00
Meta Vens
033acd17e6 Use generic parameterized viewport documents 2026-06-29 00:01:21 +01:00
Meta Vens
e9c5281e3f Use generic reactive fixed documents 2026-06-28 23:50:28 +01:00
Meta Vens
0e694abe9a Use generic reactive daemon documents 2026-06-28 23:41:03 +01:00
Meta Vens
b3faf12fd6 Use reactive documents in inventory UI 2026-06-28 23:00:02 +01:00
Meta Vens
bf9c3fa501 Use reactive shared documents in inventory panel 2026-06-28 22:28:54 +01:00
Meta Vens
7ca551c684 Rename inventory dropdown surface model 2026-06-28 15:31:19 +01:00
Meta Vens
d25b9c959c Split inventory docking state access 2026-06-28 15:12:19 +01:00
Meta Vens
d6bee723ec Centralize inventory state sessions 2026-06-28 14:25:08 +01:00
Meta Vens
a035a55fc3 Remove Aetheria client state alias 2026-06-28 13:13:07 +01:00
Meta Vens
5d405b312a Read inventory loadout saves from typed daemon frame 2026-06-28 12:45:49 +01:00
Meta Vens
0bb0c3c62a Route inventory docking reads through observed index 2026-06-28 12:27:31 +01:00
Meta Vens
0cf4591b8f Centralize catalog item object lookup 2026-06-28 12:21:38 +01:00
Meta Vens
b32a412df2 Move catalog enum parsing onto typed items 2026-06-28 12:16:19 +01:00
Meta Vens
ca92227ec2 Promote composed reactive state accessors 2026-06-28 11:01:19 +01:00
Meta Vens
0f5befb056 Use reactive loadout snapshot projector 2026-06-28 10:23:14 +01:00
Meta Vens
759afb0044 Use reactive docking state snapshots 2026-06-28 10:07:05 +01:00
Meta Vens
86fabfd2ec Use reactive inventory validation documents 2026-06-28 09:48:19 +01:00
Meta Vens
570365f296 Use reactive shared state in inventory panel 2026-06-28 09:04:28 +01:00
Meta Vens
68fc0b0aa1 Use named managed shared state accessors 2026-06-28 08:02:16 +01:00