Refactor hut tier definitions to use images and scales instead of scene paths; add moddable visual component

This commit is contained in:
2025-08-23 15:41:57 +02:00
parent 8efbc9cc6e
commit 608bcc552d
15 changed files with 204 additions and 15 deletions

View File

@@ -27,11 +27,18 @@ public static class TierLoader
foreach (var dto in tierListDto.Tiers)
{
var image = Image.LoadFromFile(dto.ImagePath);
if (image == null)
{
GD.PushError($"Failed to load image at path: {dto.ImagePath}");
continue;
}
var tierDef = new TierDefinition
{
Threshold = dto.Threshold,
TierEnum = dto.TierEnum,
Scene = GD.Load<PackedScene>(dto.ScenePath)
Texture = ImageTexture.CreateFromImage(image),
Scale = new Vector2(dto.Scale.X, dto.Scale.Y)
};
loadedTiers.Add(tierDef);
}