fix(noita): better display name

This commit is contained in:
Loïc Gremaud 2026-05-15 21:11:23 +02:00
parent 89faa7cd40
commit bf21a5eae6
Signed by: Legrems
GPG Key ID: D4620E6DF3E0121D

View File

@ -1,6 +1,7 @@
from django.core.management.base import BaseCommand
from noita.models import ObjectivPoint
from noita.services.decode import POINTS
from noita.services.spells import ALL_PERKS, ALL_SPELLS
class Command(BaseCommand):
@ -55,6 +56,20 @@ class Command(BaseCommand):
)
)
for op in ObjectivPoint.objects.filter(objectiv_id__in=ALL_SPELLS):
op.display_string = f"Spell: {op.display_string}"
op.save()
for op in ObjectivPoint.objects.filter(objectiv_id__in=ALL_PERKS):
op.display_string = f"Perk: {op.display_string}"
op.save()
for op in ObjectivPoint.objects.filter(objectiv_id__startswith="BOSS_KILL_"):
b, k, c = op.display_string.split(" ")
op.display_string = f"Perk: {op.display_string}"
op.display_string = f"{b} {k} (with {c} orbs)"
op.save()
self.stdout.write(self.style.SUCCESS(f"\nCreated: {created_count}"))
self.stdout.write(self.style.SUCCESS(f"Updated: {updated_count}"))
self.stdout.write(