Use typed thermal bounds in schematic HUD

This commit is contained in:
Meta Vens 2026-06-14 03:05:37 +01:00
commit 0d286e095a
159 changed files with 317 additions and 267 deletions

Binary file not shown.

View file

@ -391,6 +391,8 @@ internal static class LegacyCatalogReader
Stackable = false,
Duration = 0,
Durability = unionKey is 2 or 3 or 29 or 30 or 31 ? GetDouble(payload, 12) : 0,
MinimumTemperature = unionKey is 2 or 3 or 29 or 30 or 31 ? GetDouble(payload, 13) : 0,
MaximumTemperature = unionKey is 2 or 3 or 29 or 30 or 31 ? GetDouble(payload, 14) : 0,
WeaponRange = unionKey == 31 ? GetEnumName(payload, 24, WeaponRanges) : "",
WeaponCaliber = unionKey == 31 ? GetEnumName(payload, 25, WeaponCalibers) : "",
WeaponType = unionKey == 31 ? GetEnumName(payload, 26, WeaponTypes) : "",

View file

@ -43,7 +43,9 @@ internal static class AetheriaRuntimeCatalogSnapshotMapper
item.WeaponCaliber,
item.WeaponType,
item.WeaponFireTypes,
item.WeaponModifiers);
item.WeaponModifiers,
item.MinimumTemperature,
item.MaximumTemperature);
}
private static AetheriaRuntimeShapeCell FromState(AetheriaShapeCell cell)

View file

@ -70,6 +70,7 @@ var maxDurabilityItems = items
.Where(item => !string.IsNullOrWhiteSpace(item.HullType) || !string.IsNullOrWhiteSpace(item.WeaponType))
.ToArray();
var durableMaxDurabilityItems = maxDurabilityItems.Count(item => item.Durability > 0);
var importedThermalRangeItems = items.Count(item => item.MaximumTemperature > item.MinimumTemperature);
var describedCorporations = corporations.Count(corporation => !string.IsNullOrWhiteSpace(corporation.Description));
var corporationNameLinks = corporations.Count(corporation => !string.IsNullOrWhiteSpace(corporation.GeonameFileLegacyId));
var corporationAllegianceEdges = corporations.Sum(corporation => corporation.Allegiances.Length);
@ -144,6 +145,11 @@ if (missingMaxDurability.Length > 0)
$"Typed hull/weapon max durability missing for: {string.Join(", ", missingMaxDurability)}.");
}
if (importedThermalRangeItems == 0)
{
throw new InvalidOperationException("Typed item definitions did not import any thermal ranges.");
}
foreach (var item in items.Where(item => item.Hardpoints.Length > 0))
{
foreach (var hardpoint in item.Hardpoints)
@ -314,6 +320,7 @@ Console.WriteLine($"Interior masks/hardpoint hosts/hardpoints: {interiorShapeIte
Console.WriteLine($"Behavior payload items/payloads/fields/legacy refs: {behaviorPayloadItems}/{behaviorPayloadCount}/{behaviorFieldCount}/{behaviorLegacyRefCount}");
Console.WriteLine($"Behavior/hardpoint/hull/weapon items: {behaviorItems}/{hardpointItems}/{hullItems}/{weaponItems}");
Console.WriteLine($"Durable hull/weapon items: {durableMaxDurabilityItems}/{maxDurabilityItems.Length}");
Console.WriteLine($"Thermal-range items: {importedThermalRangeItems}");
Console.WriteLine($"Typed catalog trade items: {tradeItems.Length}");
Console.WriteLine($"Eve catalog surface: {surface.Surface.Id} ({surface.Surface.Root.Children.Length} root children)");
Console.WriteLine($"Corporations: {corporations.Length}");

View file

@ -108,6 +108,12 @@ public sealed class AetheriaItemDefinition
[Key(31)]
public AetheriaBehaviorPayload[] BehaviorPayloads { get; set; } = [];
[Key(32)]
public double MinimumTemperature { get; set; }
[Key(33)]
public double MaximumTemperature { get; set; }
}
[MessagePackObject]

View file

@ -230,8 +230,8 @@ public class SchematicDisplay : MonoBehaviour
{
if (!_enemy)
{
var itemData = _entity.ItemManager.GetData(x.Item.EquippableItem);
x.ListElement.HeatFill.anchorMax = new Vector2(unlerp(itemData.MinimumTemperature, itemData.MaximumTemperature, x.Item.Temperature), 0);
var thermalRange = GetThermalRange(x.Item.EquippableItem, x.Item.Temperature);
x.ListElement.HeatFill.anchorMax = new Vector2(unlerp(thermalRange.minimum, thermalRange.maximum, x.Item.Temperature), 0);
if (x.Cooldown != null)
x.ListElement.CooldownFill.anchorMax = new Vector2(x.Cooldown.Progress, 1);
x.ListElement.DurabilityLabel.text = $"{(int)(x.Item.EquippableItem.Durability / GetMaxDurability(x.Item.EquippableItem) * 100)}%";
@ -253,6 +253,14 @@ public class SchematicDisplay : MonoBehaviour
}
}
private static (float minimum, float maximum) GetThermalRange(ItemInstance item, float currentTemperature)
{
var typedItem = FindTypedItem(item);
if (typedItem != null && typedItem.MaximumTemperature > typedItem.MinimumTemperature)
return ((float)typedItem.MinimumTemperature, (float)typedItem.MaximumTemperature);
return (currentTemperature, currentTemperature + 1f);
}
private float GetMaxDurability(ItemInstance item)
{
var typedItem = FindTypedItem(item);

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show more