Add reusable content sets publication previews and focused input handling

This commit is contained in:
dingo
2026-09-08 13:02:20 -04:00
parent 34ab668531
commit 0c8b695483
20 changed files with 1030 additions and 149 deletions
+1 -2
View File
@@ -52,7 +52,6 @@ func (b Balance) validateProgression() error {
return fmt.Errorf("too many title definitions")
}
seen := map[string]bool{}
metrics := map[string]bool{"level": true, "kills": true, "worldKills": true, "bossKills": true, "worldsSurvived": true, "gathering": true, "crafting": true, "combat": true, "deaths": true}
for _, title := range b.Titles {
if !titleID.MatchString(title.ID) || seen[title.ID] || len(title.Name) < 1 || len(title.Name) > 80 || len(title.Description) > 500 {
return fmt.Errorf("invalid or duplicate title %q", title.ID)
@@ -65,7 +64,7 @@ func (b Balance) validateProgression() error {
return fmt.Errorf("title %q needs bounded requirements", title.ID)
}
for _, r := range title.Requirements {
if (!metrics[r.Metric] && !KnownStat(r.Metric)) || r.AtLeast < 1 || r.AtLeast > 1000000000 {
if !ValidRequirement(r) {
return fmt.Errorf("invalid title requirement for %q", title.ID)
}
}