Vibe filters

This commit is contained in:
2026-09-28 15:50:03 -04:00
parent 0a0aa50970
commit f1817205ad
98 changed files with 860 additions and 513 deletions
@@ -11,7 +11,8 @@ public sealed class StarSystemDoc
{
public string FilePath { get; set; } = string.Empty;
public string Name { get; set; } = string.Empty;
public string Kind { get; set; } = string.Empty;
public string SystemCategory { get; set; } = string.Empty;
public string Owner { get; set; } = string.Empty;
public bool HigherInfluenceYield { get; set; }
public bool HigherCreditYield { get; set; }
public bool HigherEnergyYield { get; set; }
@@ -119,13 +120,18 @@ public static class StarSystemDocStore
{
FilePath = path,
Name = Path.GetFileNameWithoutExtension(path),
SystemCategory = scalars.TryGetValue("systemCategory", out var categoryVal) ? categoryVal : string.Empty,
Owner = scalars.TryGetValue("owner", out var ownerVal) ? ownerVal : "The Eden Accord",
OccupationBuff = scalars.TryGetValue("occupationBuff", out var buff) ? buff : null,
SystemMastery = scalars.TryGetValue("systemMastery", out var mastery) ? mastery : null,
};
if (IsTrue(scalars, "isSideSystem")) doc.Kind = "Side";
if (IsTrue(scalars, "isHomeworldSystem")) doc.Kind = "Homeworld";
if (IsTrue(scalars, "isCoreSystem")) doc.Kind = "Core";
if (string.IsNullOrEmpty(doc.SystemCategory))
{
if (IsTrue(scalars, "isSideSystem")) doc.SystemCategory = "Side System";
if (IsTrue(scalars, "isHomeworldSystem")) doc.SystemCategory = "Homeworld System";
if (IsTrue(scalars, "isCoreSystem")) doc.SystemCategory = "Core System";
}
doc.HigherInfluenceYield = IsTrue(scalars, "higherInfluenceYield");
doc.HigherCreditYield = IsTrue(scalars, "higherCreditYield");
@@ -57,7 +57,7 @@ public sealed class MapDrawable : IDrawable
var center = ToScreen(node.X, node.Y);
var radius = (float)(NodeRadius * Scale);
canvas.FillColor = ColorForKind(node.Doc.Kind);
canvas.FillColor = ColorForOwner(node.Doc.Owner);
canvas.FillCircle(center, radius);
if (node.IsHighlighted)
@@ -85,11 +85,19 @@ public sealed class MapDrawable : IDrawable
}
}
public static Color ColorForKind(string kind) => kind switch
public static Color ColorForOwner(string owner) => owner switch
{
"Homeworld" => Color.FromArgb("#43a047"),
"Core" => Color.FromArgb("#fb8c00"),
"Side" => Color.FromArgb("#4a90d9"),
"The Eden Accord" => Color.FromArgb("#10b981"),
"The Keeper Council" => Color.FromArgb("#38bdf8"),
"The Obsidian Order" => Color.FromArgb("#ef4444"),
_ => Color.FromArgb("#9aa5b1"),
};
public static Color ColorForCategory(string category) => category switch
{
"Homeworld System" or "Homeworld" => Color.FromArgb("#43a047"),
"Core System" or "Core" => Color.FromArgb("#fb8c00"),
"Side System" or "Side" => Color.FromArgb("#4a90d9"),
_ => Color.FromArgb("#9aa5b1"),
};
}
@@ -37,8 +37,11 @@
<Label Text="Name" FontAttributes="Bold" />
<Label x:Name="NameLabel" />
<Label Text="Kind" FontAttributes="Bold" />
<Label x:Name="KindLabel" />
<Label Text="Category" FontAttributes="Bold" />
<Label x:Name="CategoryLabel" />
<Label Text="Owner" FontAttributes="Bold" />
<Label x:Name="OwnerLabel" />
<Label Text="Yields" FontAttributes="Bold" />
<Label x:Name="YieldsLabel" />
@@ -533,7 +533,8 @@ public partial class MapEditorPage : ContentPage
{
var doc = node.Doc;
NameLabel.Text = doc.Name;
KindLabel.Text = string.IsNullOrEmpty(doc.Kind) ? "—" : doc.Kind;
CategoryLabel.Text = string.IsNullOrEmpty(doc.SystemCategory) ? "—" : doc.SystemCategory;
OwnerLabel.Text = string.IsNullOrEmpty(doc.Owner) ? "—" : doc.Owner;
YieldsLabel.Text = YieldText(doc);
BuffLabel.Text = doc.OccupationBuff ?? "—";
MasteryLabel.Text = doc.SystemMastery ?? "—";