From 87f9adf4d990f5bbcd2ae2e4d73ac194cd044e2e Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 13 Jun 2026 23:46:18 +0100 Subject: [PATCH] Use typed hull classes in sector summaries --- .voidbot/state/aetheria.cc | Bin 53618 -> 53809 bytes Assets/Scripts/UI/Menu/SectorRenderer.cs | 26 ++++++++++++++++++++--- docs/aetheria-perfect-machine-map.md | 4 +++- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index 5482f7a46bd0767a135c50bd9522f8eb72c97324..5eef8e44fff9eb400e6a157837f22b9099701e66 100644 GIT binary patch delta 1054 zcmZ8g&r4K69M4?|R}dmFl|a4`WruY&72UcCQZ7k`X$OmF_PyDClkd$uX6Ehky6ho3 zM3>+pT{@)|bhnequetmyE%eOc4+b?p3smY5| zFFNs`W=pRzk7OR{W>+Ykl;$;QmGkLz(o@b z;c*R06U_uKg7&1Ox(I}upe*J>)%K_>8P^K5C52bFKnI_<`&*W0+hEv4DOO`f{9Hkm z)`X;B`KCmK*TJTBV)!tRm*bXRgKtol^AQ0L3fcEz5o;h4nu{gBqC>m6iroxs;7ZzXmJ6y;PvS1CeA^ANJu&a zjfrh_iMC2@5)Z35uATbSd2`7_qbbhj%pvYr;>1`QjSq&0b}LJGwh3#Ly5NXL#KC0B zwTX`usfn{%8bj0~rG^<0ThwEUaek62DjO6k=t*S$Ur%CTiaDMg=Z3Laq`^?Ewn$V4 zhS73LO%+?IEaKAAYr+jn$R%1+-;WI5-;lJH>nsF!7S9AfuMLDBHuic0>s;UJ?OAD9 z7=w{0Bre))2#K@Oy#Fa68lTvjanJHrF~k2V7CgMQ7+&34%LQFGPxmEtUZUKjk_PSh zq5cQ+L`6kgj%tMBh25Yk*gHEg7}qQ7VrA~2%E6D7Q;?N5DnMj%Tmp18>umV8JyJNH z?%sHLbyJf%T5vMle}AKE_*J56)MH`X;lmpdUjEou$aZqP9DL0WWvA(6XV-T=Wys9= fbc>G${;oJcrx1P8lm0&wKK}Bp(3_sh6RUp!>`ID8 delta 962 zcmZ8gKX21O6sJv9no1o2p;89)7GOyO3NbBgl?qh_Z2<*_h=Gg!Vjr>Zth;kUx@2Gj zF@OgarnZ2@04<&nLP$tZMn)Gm=VcSRaCETDK{}TB5IuPxZNsI|<<|y*XNETF0%?^lD?uab6B+85>6>calN|v;s%Dcb zZDvEJGxY&|?(zorX={0>KWRA#eNIlKxW8PDOhjEKbr48iJ0fGWCnMhhd=N@a25@S? zbA&#W5otE0K||1$iXir=t}tL+r1Cjjhd%2P7W7F3E)LkA!6rGcv@?4t4M_Bihaw#! zshUw4#NmMK&{Q%Q=AitB3HyjA)h%r5Ux%h2Zc_gCuE+P*PRD<4Oec>ve^178>g4L` z3JYnzEfrzv=dn+_?`j@eASEff9uG4EhNKp2YtT^KaS=LFwc;mtuO;xVHJa4lpD7;A zAJ9dszGaw8IA)S(AMcDLzvZ|H*rH#k)yE5;w Xs#d(c`+OqrsU~aRe-;NFR;B(Qt)X0! diff --git a/Assets/Scripts/UI/Menu/SectorRenderer.cs b/Assets/Scripts/UI/Menu/SectorRenderer.cs index b0f89e1ab..eee41cf9f 100644 --- a/Assets/Scripts/UI/Menu/SectorRenderer.cs +++ b/Assets/Scripts/UI/Menu/SectorRenderer.cs @@ -1,6 +1,8 @@ +using System; using System.Collections; using System.Collections.Generic; using System.Linq; +using GameCult.Aetheria.State.Unity; using UniRx; using UnityEngine; using UnityEngine.EventSystems; @@ -90,17 +92,17 @@ public class SectorRenderer : MonoBehaviour, IBeginDragHandler, IDragHandler, IS Properties.AddProperty("Stars", () => starCount); var stationCount = zone.RuntimeBlueprint.Entities - .Count(entity => (GameManager.ItemManager.GetData(entity.Hull) as HullData).HullType == HullType.Station) + .Count(entity => HasHullType(entity, HullType.Station)) .ToString(); Properties.AddProperty("Stations", () => stationCount); var turretCount = zone.RuntimeBlueprint.Entities - .Count(entity => (GameManager.ItemManager.GetData(entity.Hull) as HullData).HullType == HullType.Turret) + .Count(entity => HasHullType(entity, HullType.Turret)) .ToString(); Properties.AddProperty("Turrets", () => turretCount); var shipCount = zone.RuntimeBlueprint.Entities - .Count(entity => (GameManager.ItemManager.GetData(entity.Hull) as HullData).HullType == HullType.Ship) + .Count(entity => HasHullType(entity, HullType.Ship)) .ToString(); Properties.AddProperty("Ships", () => shipCount); } @@ -112,6 +114,24 @@ public class SectorRenderer : MonoBehaviour, IBeginDragHandler, IDragHandler, IS // }); } + private bool HasHullType(RuntimeEntityBlueprint entity, HullType hullType) + { + var typedItem = FindTypedHull(entity); + if (typedItem != null) + return string.Equals(typedItem.HullType, hullType.ToString(), StringComparison.Ordinal); + + return GameManager.ItemManager.GetData(entity.Hull) is HullData hullData && + hullData.HullType == hullType; + } + + private static AetheriaRuntimeCatalogItem FindTypedHull(RuntimeEntityBlueprint entity) + { + var itemId = entity?.Hull?.Data?.ItemId ?? Guid.Empty; + return itemId == Guid.Empty + ? null + : ActionGameManager.RuntimeCatalog?.FindItemByLegacyId(itemId.ToString("D")); + } + // private IEnumerator AnimatePath() // { // var pathZones = ActionGameManager.CurrentSector.ExitPath; diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index 08e780ee0..5ddd65721 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -130,7 +130,9 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. now comes from typed state, not `AetherDB.msgpack`. The surviving trade menu applies typed row prefilters for size, hardpoint type, and behavior kind before hydrating `ItemData` projections for legacy commodity filters, columns, and - buy actions. + buy actions. The sector properties UI also resolves station/turret/ship + counts through typed hull classifications from the runtime catalog before + falling back to legacy `HullData` projection for missing rows. - `Galaxy` generation no longer accepts a runtime item catalog reader or `ItemManager`. Sector and tutorial generation receive the package-owned typed runtime catalog. `Galaxy` projects typed corporation v2 records into temporary legacy