Merge origin/main: macOS-Release 0.3.0 doppelt gepflegt

# Conflicts:
#	docs/updates.md
#	web/i18n.php
This commit is contained in:
torsten 2026-11-13 16:10:52 +01:00
commit d6c0b52807
60 changed files with 3383 additions and 1568 deletions

View file

@ -369,10 +369,10 @@ außer „Kür öffnen und hoffen".
**Nutzen:** Das ist der eigentliche Grund, warum sich die Mehrsaison-Struktur
für den Anwender auszahlt – nicht das Archiv, sondern der Vergleich.
**Stand:** umgesetzt (`SeasonUpgradeCheck`). Der Validator ist eine reine
**Stand:** umgesetzt (`SeasonUpgradeCheck`) inklusive PDF-Ausgabe
(`RoutinePdfExporter.build_season_comparison`). Der Validator ist eine reine
Funktion über (Kür, Regelpaket); der Bericht ist die Differenz zweier Pakete
für diese eine Kür. Bis auf den PDF-Export (siehe offene Punkte) entspricht
die Umsetzung dieser Planung.
für diese eine Kür.
### Bedienung
@ -531,8 +531,12 @@ Schritte 1 und 3 sind der Hebel; alles andere baut darauf auf.
- Ob die Anwender-Doku (`docs/isu-rules.md`) vollständig generiert wird oder
nur die Tabellen und Zahlen.
- Ob der Upgrade-Bericht als PDF ausgegeben wird (für die Weitergabe an
Trainer und Eltern) – naheliegend, aber eigenes Feature.
- **PDF-/SVG-Sprache:** Die Exporte sind derzeit durchgehend deutsch.
`RoutinePdfExporter._text()` berechnet `I18n.t(text)`, schreibt aber den
Originaltext; viele Aufrufstellen interpolieren außerdem vorher. Eine
konsequente Übersetzung müsste die Vorlagen vor dem Einsetzen übersetzen.
Bewusst zurückgestellt, weil gemischtsprachige Blätter schlechter sind als
einheitlich deutsche.
- Ob `2025/26` auch im Inspector vollständig bedienbar bleibt (Elemente
anlegen) oder nur lesend geprüft wird. Die Entscheidung „alte Küren bleiben
gültig" verlangt Prüfbarkeit, nicht zwingend Bearbeitbarkeit.

View file

@ -310,6 +310,10 @@ Export-Presets mit ausgeliefert.
## Nächste Ausbaustufen
- Max. zwei Features pro Fuß und Feature-Positionsregeln
- GOE-Tabellen und `V`-/Unterrotations-Varianten
- `V`-/Unterrotations-Varianten als Was-wäre-wenn (der Basiswert-Effekt ist
deterministisch, die Eingabe bleibt eine Annahme)
- Vorschlagsliste im Inspector direkt aus `suggest()`
**Bewusst nicht:** GOE-Tabellen. GOE ist Richterermessen über die Ausführung
(−5 bis +5) und aus dem Plan nicht ableitbar; die Punktschätzung nennt die
Lücke statt sie zu füllen.

View file

@ -253,6 +253,9 @@ Sport-TV-Bauchbinde bündig am oberen Rand der Eisfläche und gleitet nach
zusätzlich ihre Teilstrecken-Anzahl. Reine Laufwege ohne Element stehen nur
im Rink. Lange Abschnitte werden auf weiteren Seiten fortgesetzt.
Bei „Aktiver Abschnitt“ entsteht nur die Seite dieses Abschnitts.
Die untere Blatthälfte bleibt bewusst frei: Dort schreibt man mit der Hand
mit — Korrekturen, Ansagen, Zeiten. Bitte nicht mit Inhalt füllen, nur um
Platz zu nutzen.
Nach dem Export erscheint der **absolute Dateipfad** mit den Buttons
**Öffnen**, **Ordner anzeigen** und **Pfad kopieren**. Die Option
@ -318,6 +321,11 @@ Der Vergleich **ändert nichts**. Erst „Auf Saison umstellen" übernimmt die
Saison; die Elemente bleiben unangetastet, auch wenn einzelne davon in der
neuen Saison nicht mehr existieren.
**„Als PDF"** schreibt denselben Bericht in den Exportordner
(`<Kür>_saisonvergleich_<Saison>.pdf`) — zum Weitergeben an Trainer, Eltern
oder die Läuferin. Danach erscheint wie bei den anderen Exporten der Dialog
mit „Öffnen", „Ordner zeigen" und „Pfad kopieren".
## Sprungkombinationen
Sprungkombinationen und -folgen sind strukturiert:

View file

@ -0,0 +1,293 @@
# WhiteboardController zerlegen
Stand: 2026-11-13
Ziel: Der Controller war mit **9.092 Zeilen und 465 Funktionen** der größte
Baustein im Projekt; die Roadmap nennt < 1.500 Zeilen pro Datei. Nach den
Nach Etappe 15 sind es 8.082 Zeilen. Diese Notiz
hält die Reihenfolge fest, damit der Umbau in Etappen mit grüner Suite
passiert und nicht als Big Bang.
## Grundregeln
1. **Erst reine Logik, dann UI.** Textaufbau, Formatierung und Prüf-Logik
lassen sich ohne Szene testen und sind risikofrei zu verschieben. Dialoge
und Signale kommen zuletzt.
2. **Eine Etappe = ein Commit mit grüner Suite.** Keine Etappe ändert
Verhalten; die Tests bleiben unverändert, nur Aufrufstellen wandern.
3. **Kein Big Bang.** Der Controller bleibt Node und Scene-Einstiegspunkt.
Ausgelagert werden Aufgaben, nicht die Klasse.
4. **Zustand bleibt beim Controller.** `_routine`, `_current_path`, Auswahl
und Historie gehören weiter dorthin; ausgelagerte Bausteine bekommen die
Daten übergeben, statt sie zu besitzen.
## Zielbausteine
| Baustein | Inhalt | Zeilen (grob) | Kopplung | Etappe |
| :--- | :--- | ---: | :--- | :--- |
| `HelpContent` | Hilfetext für den ?-Dialog | 137 | keine | 1 ✅ |
| `SeasonComparisonText` | Zeilen für den Saisonvergleichs-Dialog | 175 | nur Daten | 2 ✅ |
| `ValidationReportView` | Zeilen für den Prüfdialog | 300 | nur Daten | 3 ✅ |
| `ExportService` | SVG/PDF schreiben, Pfade und Dateinamen | 90 | Dateisystem | 4 ✅ |
| `ExportPanel` | Export- und Abschlussdialog (Node mit Signalen) | 130 | Szene | 9 ✅ |
| `RulesContext` | Regelsatz: Bibliothek, Paket, drei Dokumente | 80 | keine | 5 ✅ |
| `SeasonPanelModel` | Inhalt der drei Dropdowns | 120 | keine | 6 ✅ |
| `SyncSummaryText` | Text der Sync-Zusammenfassung | 60 | keine | 7 ✅ |
| Sync-Orchestrierung | Threads, OAuth, Konflikte, Küren verwalten | ~700 | Dialoge, Threads | offen |
| `HubPanel` | Kür-Hub (Login, Upload, Downloads) | ~650 | Dialoge, Threads | 8 |
| `PlaybackPose` | Position und Blickrichtung zur Zeit | 130 | keine | 8 ✅ |
| `PlaybackPanel` | Transportleiste: Play/Pause, Reset, Slider, Tempo | 110 | Szene | 10 ✅ |
| `TimelineLabelModel` | Labels der Zeitachse einsammeln | 55 | keine | 11 ✅ |
| `SyncSettingsModel` | Anbieterliste der Sync-Einstellungen | 40 | keine | 13 ✅ |
| `RoutineManagerModel` | Küren listen, Varianten finden | 55 | Dateisystem | 14 ✅ |
| `RoutineManagerPanel` | Dialog "Küren verwalten" (eigene Szene) | 95 | Szene | 15 ✅ |
| Playback-Rest | Musik, Label-Dialog, 3D-Anbindung | ~300 | Canvas, Audio | offen |
| `ElementInspector` | Element-Dialog, Features, Level, Kombinationen | ~800 | Dialog, Regeln | 10 |
Danach bleibt ein Controller von grob 2.000–2.500 Zeilen: Verdrahtung,
Auswahl, Werkzeuge, Abschnitte, Undo/Redo, Statuszeile.
## Etappen
### 1. `HelpContent` ✅
Der Hilfetext ist ein reiner String. Verschoben nach
`src/whiteboard/view/help_content.gd` (`HelpContent.build()`), der Controller
setzt ihn nur noch in den Dialog. Kein Verhalten geändert.
### 2. `SeasonComparisonText` ✅
Der Text des Saisonvergleichs (Kopf, Gruppen, Summe, Befunde) liegt jetzt in
`src/whiteboard/view/season_comparison_text.gd`. `build(routine, report)`
gibt die BBCode-Zeilen zurück; der Controller setzt sie nur noch in das
Label. Kein Verhalten geändert.
### 3. `ValidationReportView` ✅
Der komplette Text des Prüfdialogs (Kopf, Saisonhinweis, Kategorie,
Basiswert, Punktschätzung, Wertung, Prüfliste, Befunde) liegt in
`src/whiteboard/view/validation_report_view.gd`. Signatur:
`build(routine, report, category, context)` mit einem kleinen Kontext für die
Anzeige-Optionen (Saison-Label, Saisonhinweis, Vergleich-Link, aufgeklappte
Details). Der Controller baut nur noch den Report und setzt das Label.
Fertig: Dialog unverändert, Whiteboard-Test grün, eigener Test für den Text.
### 4. `ExportService` ✅
`src/whiteboard/io/export_service.gd` schreibt SVG und PDF, legt den
Exportordner an, bildet Pfade und bereinigt Dateinamen. Der Controller
delegiert nur noch; `export_svg_to_path`/`export_pdf_to_path` bleiben als
schmale Einstiegspunkte, weil Tests sie direkt aufrufen.
Bewusst im Controller geblieben: der Export-Dialog und der
Abschluss-Dialog (Szene), der PNG-Export (braucht ein SubViewport) und das
Öffnen im Dateimanager.
### 5. `RulesContext` ✅
Der Regelsatz selbst ist jetzt ein eigenes Objekt
(`src/core/rules/rules_context.gd`): Es lädt die Bibliothek, merkt sich die
Voreinstellung, wendet eine Saison an und hält die drei Dokumente
(`catalog`, `levels`, `adult`). Der Controller besitzt genau eine Instanz
(`_ruleset`) und greift nur noch über sie zu; `_load_default_rules` und
`_apply_rules_for_season` sind auf je ein paar Zeilen geschrumpft.
Damit ist die Regelauflösung testbar, ohne eine Szene zu bauen.
Was noch offen bleibt: die drei Statusleisten-Widgets (Saison, Programm,
Kategorie) und ihre Sync-Funktionen. Sie sind reine UI und kommen als
eigener Node-Schnitt.
### 6. `SeasonPanelModel` ✅
Der Inhalt der drei Dropdowns (Saison, Programm, Kategorie) liegt in
`src/whiteboard/view/season_panel_model.gd`: reine Funktionen, die
Beschriftungen und Werte bauen und die passende Auswahl zurückgeben
(`{"items": […], "selected": int}`). Der Controller füllt seine
OptionButtons nur noch über `_fill_option()` und behält die
Signalverdrahtung.
Damit sind Fälle testbar, die vorher nur über die Szene prüfbar waren:
„nicht festgelegt", unbekannte Saison, unbekannte Kategorie (bleibt als
„nicht verfügbar" sichtbar), Programmtyp.
Noch offen: die Widgets selbst als Node mit Signalen. Das ist reiner
Verdrahtungsumbau ohne Verhaltensänderung und lohnt erst, wenn Panels auch
Layout-Verantwortung übernehmen (Roadmap: „UI in logische Bereiche
gliedern").
### 7. `SyncSummaryText` ✅ (Textteil)
Der Text der Sync-Zusammenfassung liegt in
`src/whiteboard/view/sync_summary_text.gd`; der Controller setzt nur noch das
Label. Die Zusammenfassung ist damit ohne Szene prüfbar (der Sync-Test nutzt
sie direkt).
**Bewusst offen:** die Orchestrierung selbst — Thread starten und pollen,
OAuth, Konflikte aufräumen, Küren verwalten (zusammen ~700 Zeilen). Sie
braucht einen Node mit Signalen, weil Fortschritt, Dialoge und Threads
zusammenhängen, und sie ändert die Aufrufstellen in `run_sync_tests`. Das ist
ein eigener Durchgang, kein Nachtrag.
### 8. `PlaybackPose` ✅
Die Wiedergabe-Geometrie liegt in `src/whiteboard/view/playback_pose.gd`:
`compute(entries, time, previous_heading, delta, force_heading)` liefert
Segment, Position, Blickrichtung und Markergröße. Die Markenlogik (Pirouette
dreht mit der Standzeit, Sprung dreht pro Umdrehung und wandert entlang des
Sprungvektors, Laufwege folgen der Kurve) steckt vollständig dort.
Der Controller wendet das Ergebnis nur noch auf Canvas, 3D-Vorschau und
Oberfläche an. Abgesichert durch die bestehenden Wiedergabetests (121
Assertions).
**Offen:** Steuerung (Start/Pause/Reset, Geschwindigkeit), Musik und
Timeline-Labels sowie die 3D-Anbindung.
### 10. `ElementInspector`
Zuletzt: Element-Dialog, Feature-Auswahl, Fußzuordnung, Levelableitung. Der
größte UI-Block und der, an dem am meisten hängt.
## Erster Node-Schnitt (2026-11-13)
`ExportPanel` (`src/whiteboard/view/export_panel.gd`) besitzt jetzt die
beiden Exportdialoge und meldet nur die Auswahl:
```
Panel ──export_requested(pfad, format, abschnitt, danach öffnen)──▶ Controller
```
Der Controller prüft, ob die Datei existiert (`_confirm_overwrite` bleibt die
einzige Stelle dafür), schreibt über `ExportService` und ruft
`panel.show_done()`. Das Panel fasst kein Dateisystem an.
Was beim Umhängen der Szene zu beachten war:
- `parent=` in `.tscn` ist **absolut** ab Wurzel, nicht relativ zum vorigen
Knoten. Nach dem Umhängen müssen auch alle Kindknoten ihren Pfad ändern
(`ExportDialog/…` → `ExportPanel/ExportDialog/…`), sonst verschwinden sie
beim Instanziieren mit „Parent path … has vanished".
- Der neue Knoten braucht `script = ExtResource(...)` **und** eine
`ext_resource`-Zeile; ohne Skript bleibt eine typisierte `@onready`-Zuweisung
still null.
- `load_steps` in der Kopfzeile muss mitwachsen.
### 10. `PlaybackPanel` ✅
Die Transportleiste (Play/Pause, Reset, Zeitschieber, Zeitanzeige, Tempo) ist
ein Node mit Signalen: `toggle_requested`, `reset_requested`,
`seek_requested(seconds)`, `speed_requested(speed)`. Der Controller besitzt
weiter Uhr, Tempo und Audio und ruft `set_state(time, duration, playing)`.
Anders als beim Export brauchte es **kein Umhängen**: Die Widgets bleiben in
der Layout-Leiste, das Panel findet sie über `unique_name_in_owner`. Ein Node
ohne Control-Basis kann in einem HBox nicht sinnvoll Kindknoten aufnehmen.
`_update_playback_ui` und `_update_play_button` sind zu `_sync_playback_ui()`
verschmolzen; die Zeitachse (`timeline_label_lane`) bleibt beim Controller,
weil sie zu den Timeline-Labels gehört.
### 11. `TimelineLabelModel` ✅
Das Einsammeln der Timeline-Labels liegt in
`src/whiteboard/view/timeline_label_model.gd`. Es ist subtiler, als es aussieht:
Es läuft über die Abschnitte (nicht über die Wiedergabe-Einträge), damit
Marken ohne Standzeit sichtbar bleiben, und ein Segment ohne eigenes Label
erbt die Beschriftung seiner Elementgruppe — so wird eine Sequenz einmal
benannt. Abgesichert durch die Wiedergabetests, die die Labels der Zeitachse
prüfen.
**Offen:** der Label-Dialog (Anlegen/Bearbeiten/Löschen) und die Musik
(Laden, Konvertierung, Synchronisation).
### 12. `ExportPanel` als eigene Szene ✅
`scenes/export/export_panel.tscn` enthält die beiden Dialoge und das Skript;
die Whiteboard-Szene instanziiert sie nur noch. Dazu gibt es
`tests/run_export_panel_tests.gd`: Es lädt **nur** diese Szene, hängt sie an
den Root und prüft die Signale — kein WhiteboardController, keine Kür-Szene.
Das ist die Messung, um die es ging: 15 Assertions laufen ohne die 8.154
Zeilen Controller. Der Baustein ist damit nicht nur im Code getrennt.
Zwei Stolpersteine beim Auslagern einer Szene:
- Kindknoten eines Szenen-Roots nutzen `parent="."`, nicht den Root-Namen.
- Ein eigener Test braucht `root.size` vor `popup_centered`, sonst platziert
Godot die Fenster bei headless-Läufen auf negative Koordinaten.
### 13. `SyncSettingsModel` ✅
Die Anbieterliste der Sync-Einstellungen liegt in
`src/whiteboard/view/sync_settings_model.gd`: Das Build-Konfigurationsobjekt
geht rein, die auswählbaren Anbieter kommen raus. Google Drive erscheint nur
mit OAuth-Zugangsdaten; Dropbox bleibt auch ohne sichtbar, damit ein
Entwickler-Build die fehlende Konfiguration zeigt statt einer leeren Liste.
**Warum hier kein eigener Dialog-Schnitt folgt:** Der Sync-Dialog enthält
Sync *und* Hub (rund 30 Widgets) und hängt an Threads und OAuth-Zustand. Eine
eigene Szene ohne verschobenes Verhalten ergäbe einen Test, der nur prüft,
dass Widgets existieren — das ist keine Aussage über Modularität.
### 14. `RoutineManagerModel` ✅
Die Kürenverwaltung bekommt ihren Verhaltenskern: `list_routines(dir)` liefert
eine Zeile pro Kür (JSON vor Legacy, nach Namen sortiert, Fremddateien
ignoriert), `variants(dir, name)` alle vorhandenen Dateien einer Kür.
Damit ist die Grundlage für den späteren Panel-Schnitt gelegt — und der
Dateizugriff ist ohne Szene prüfbar (Test mit einem temporären Ordner:
Dubletten, Sortierung, Fremddateien, fehlende Kür).
**Noch offen:** der Dialog selbst. Seine Zeilenknöpfe sind an
Controller-Handler gebunden (`open`, `rename`, `delete`, Konflikte), und die
Abläufe brauchen Sync und den aktuellen Dateipfad. Der nächste Schritt wäre,
diese Abläufe als `RoutineManagerActions` zu bündeln, dann das Panel.
### 15. `RoutineManagerPanel` ✅
Der Dialog „Küren verwalten" liegt in `scenes/routine/routine_manager_panel.tscn`
mit eigenem Skript. Das Panel baut die Zeilen (Öffnen / Umbenennen / Löschen)
und meldet die Auswahl; die Abläufe — Datei öffnen, umbenennen, löschen,
Konflikte suchen — bleiben beim Controller, weil sie Dateien, den aktuellen
Pfad und den Sync brauchen.
`tests/run_routine_manager_panel_tests.gd` prüft das Panel allein: Zeilen,
Signalnutzlast, Neuaufbau, Leerzustand, Öffnen/Schließen (13 Assertions).
Merke: `%Name` gilt nur innerhalb der Szene, die den Knoten besitzt. Der
Controller musste deshalb auf `manager_tabs` verzichten — die Tabs liegen
jetzt im Panel.
## Nächster Durchgang: weitere Node-Schnitte
Die vier verbleibenden Blöcke (Sync-Orchestrierung, Hub, Playback-Rest,
Element-Inspector) lassen sich nicht mehr als reine Funktionen herausziehen;
sie brauchen eigene Nodes mit Signalen. Geprüft am 2026-11-13:
- **Die Dialoge hängen direkt an der Wurzel** der Szene (31 Knoten mit
`parent="."`). Ein Panel braucht sie als Kinder, also `parent="ExportPanel"`
statt `parent="."`.
- **Das ist harmlos:** Alle Dialoge nutzen `unique_name_in_owner`, `%Name`
löst szenenweit auf. Ein Umhängen bricht weder den Controller noch die
Skripte, nur den Zugriff über Pfade (den gibt es hier nicht).
- **Der Aufwand liegt bei den Tests:** `run_sync_tests` greift direkt auf Controller-Felder zu
(`controller.export_dialog`, `controller.export_done_label`,
`controller.routine_manager_dialog`, `controller.cleanup_conflicts_dialog`).
Diese Zugriffe wandern auf `controller.<panel>.<feld>`.
- **Eine geteilte Abhängigkeit:** Der Export nutzt `_confirm_overwrite()`,
das auch „Speichern unter" verwendet. Entweder bekommt das Panel einen
eigenen Bestätigungsdialog oder der Controller reicht einen Callback durch.
Diese Entscheidung sollte vor dem Umbau fallen.
Reihenfolge: erst Export (kleinster Block, ~150 Zeilen), dann Playback-Rest,
dann Sync, zuletzt Hub und Element-Inspector.
## Was bewusst bleibt
- `_ready()` und die Signalverdrahtung der Szene.
- Undo/Redo und die Historie (arbeiten auf dem gesamten Kürzustand).
- Die Statuszeile als Zusammenfassung (`_update_status`), solange Panels sie
nicht selbst besitzen.

View file

@ -87,7 +87,6 @@ Voraussetzung für Phase 1.
- [x] Windows-EXE mit Icon und Versionsinformationen (rcedit über portables
Wine, `tools/setup_windows_export.sh`)
- [ ] Release-Keystore für ein verteilbares APK
- [ ] Hochformat-, Multi-Window- und DeX-Layout (obere Leiste umbruchfähig)
### Erledigt: Touch-/Tablet-Härtung
@ -120,6 +119,16 @@ Webseite). Das Google-Drive-Backend ist im Code vorhanden, aber die
OAuth-App ist nicht veröffentlicht. Google Drive und OneDrive stehen unter
„Später: Weitere Cloud-Anbieter“.
**Rückmeldung der Fachtester (2026-11-13):** Sync wurde nicht genutzt – die
Tester arbeiten zuhause am PC und drucken die Abläufe aus. Sync bleibt als
Funktion (für andere Käufer und mehrere Geräte), wird aber nicht ausgebaut.
Der Ausdruck ist damit der Weg, den die PDF-Ausgabe tragen muss.
**Kür-Hub:** ebenfalls noch ungenutzt, aber mit anderem Potential: Die
Tester wohnen weit auseinander, und der Hub ist der einzige Weg, sich
gegenseitig Küren zu zeigen. Abzuwarten, ob dieser Effekt greift, bevor hier
investiert wird.
### Erledigt: Element-Marker
- [x] Sprungpunkte, Pirouettenzentren und Sequenzbereiche platzieren
@ -193,8 +202,8 @@ OAuth-App ist nicht veröffentlicht. Google Drive und OneDrive stehen unter
- [x] PCS und Sturzabzüge in der Punktschätzung (mit Annahmen)
- [x] In-App-Hilfe „Hilfe & Annahmen“ und `docs/manual.md`
- [ ] Optional: Suchfeld/Autovervollständigung aus `suggest()`
- [ ] Optional: GOE-Tabellen sowie `V`-/Unterrotationsvarianten
(2026-11-01 vorerst zurückgestellt)
- [ ] Optional: `V`-/Unterrotationsvarianten als Was-wäre-wenn
(Basiswert-Effekt ist deterministisch; Eingabe bleibt eine Annahme)
### Danach: Weitere fachliche Erweiterungen
@ -212,20 +221,19 @@ fachlichen Validierung angefasst.
- [ ] Manuelles Zusammenführen mit der archivierten Fassung
- [x] Löschweitergabe für einzelne Küren mit Bestätigung (Küren verwalten)
- [ ] Optional: Sync-Ordner pro Anbieter getrennt konfigurieren
- [ ] Hochformat-, Multi-Window- und DeX-Layout (obere Leiste umbruchfähig)
- [ ] Visuelles UI-Refactoring (z. B. Buttons statt Comboboxen) inklusive
Übernahme des Feedbacks der Tester
Die Reihenfolge ist bewusst: native Builds, Datenaustausch und Element-Marker
sind erledigt. Im PoC läuft jetzt das ISU-Regelwerk – Katalog 2026/27,
sind erledigt. Im PoC läuft das ISU-Regelwerk – Katalog 2026/27,
Level-Features, Elementvalidierung, Adult-Kategorien, Dauer und
Wiederholungs-/Kombinationsgrenzen stehen; als Nächstes folgt die
Mehrsaison-Struktur (Regelpaket pro Saison, alte Küren bleiben gegen ihre
eigene Saison prüfbar) samt Saison-Upgrade-Prüfung, danach Feature-Grenzen pro
Fuß. GOE und Varianten sind vorerst zurückgestellt. Sync-Komfort und
UI-Refactoring sind zurückgestellt, weil der bestehende Stand für Tests
genügt und die endgültige Sync-Architektur (PHP-Webserver) sowie das
UI-Feedback der Tester ohnehin noch ausstehen.
Wiederholungs-/Kombinationsgrenzen stehen, ebenso die Mehrsaison-Struktur
(Regelpaket pro Saison, alte Küren bleiben gegen ihre eigene Saison prüfbar)
mit Saison-Upgrade-Prüfung und die Feature-Grenzen pro Fuß. GOE ist bewusst
ausgeschlossen (Richterermessen), die `V`-Varianten sind zurückgestellt.
Sync-Komfort und UI-Refactoring sind zurückgestellt, weil der bestehende
Stand für Tests genügt und die endgültige Sync-Architektur (PHP-Webserver)
sowie das UI-Feedback der Tester ohnehin noch ausstehen.
### Später: Weitere Cloud-Anbieter
@ -269,13 +277,20 @@ Schritte.
- [ ] `WhiteboardController` in Services/Panels zerlegen: Datei-I/O, Sync,
Playback, Validierung, Element-Inspector, Section-Liste. Ziel: < 1.500
Zeilen pro Datei, keine 100 `%`-Lookups in einem Skript.
Zeilen pro Datei, keine 100 `%`-Lookups in einem Skript. In Etappen nach
`docs/refactor-whiteboard-controller.md`; Stand 2026-11-13: 8.154 Zeilen; `HelpContent`, `SeasonComparisonText`,
`ValidationReportView`, `ExportService`, `RulesContext`,
`SeasonPanelModel`, `SyncSummaryText`, `PlaybackPose`, `ExportPanel`,
`PlaybackPanel`, `TimelineLabelModel`, `SyncSettingsModel`,
`RoutineManagerModel`, `RoutineManagerPanel` und zwei eigenständigen
Panel-Tests ausgelagert.
- [ ] Gemeinsamer Test-Harness (oder gdUnit4), Timeout pro Testlauf,
Coverage; CI auf dem Gitea-/Forgejo-Remote mit `tools/test.sh` und
`tools/check_export.sh`.
- [ ] Saison datengetrieben: Saison-Auswahl/Default aus `data/`, 2025/26
auswählbar machen oder entfernen; Regelstand im UI anzeigen.
- [x] Saison datengetrieben: Saison-Auswahl aus `data/`, Voreinstellung nach
`valid_from`, Regelstand in Statusleiste und Prüfdialog.
- [ ] Android-Export teilen: Share-Intent/SAF statt nur `user://exports/`.
Zurückgestellt am 2026-11-13: kein Testgerät verfügbar.
- [ ] `Ctrl+S`/`Ctrl+O`/`Ctrl+N` und sichtbarer Speicherstatus (auch ohne
Fenstertitel auf Android).
@ -290,7 +305,7 @@ Schritte.
Schriftgrößen; kompakte Labels nicht mehr im Controller.
- [ ] Canvas: Culling/Dirty-Regions, Kurven-Cache auch für Pan/Zoom;
Perf-Test mit realistischem Budget (< 16 ms bei 480 Segmenten).
- [ ] Doku konsolidieren: 18 `findings-*.md` nach `docs/notes/` oder ins
- [ ] Doku konsolidieren: 25 `findings-*.md` nach `docs/notes/` oder ins
Archiv; Architektur/Manual als aktuelle Quellen; Docstrings und
Assertion-Zahlen pflegen.
- [ ] Altlasten entfernen: `Flieger.obj` (nur Prototyp), alte
@ -336,6 +351,12 @@ Schritte.
## Bewusst nicht jetzt
- **Hochformat und DeX-Layout.** Die Eisfläche ist Querformat, und das Tablet
wird intuitiv so gehalten. Eine Hochformat-Fassung würde die Leisten
umbrechen oder Werkzeuge verstecken, ohne dem Planen zu helfen. Entschieden
am 2026-11-13; die Querformat-Leisten müssen nur auf schmalen
Querformat-Breiten passen (erledigt für 1400 logische Punkte).
- Native PDF-Ausgabe mit Bildern/Screenshots (die aktuelle PDF-Ausgabe ist
vektorbasiert und enthält keine Fotos)
- Vollständiges ISU-Regelwerk vor dem stabilen Planungs-Workflow
@ -343,6 +364,12 @@ Schritte.
- Google Drive und OneDrive (aktuell reicht Dropbox; siehe
„Später: Weitere Cloud-Anbieter“)
- 3D-Produktionsreife
- **GOE-Tabellen.** GOE vergibt der Richter nach der Ausführung (−5 bis +5,
Kriterien wie Höhe, Fluss, Landung). Es ist aus einem Plan nicht ableitbar;
die App würde eine Zahl vortäuschen, die sie nicht kennt. Die
Punktschätzung bleibt deshalb bei Basiswert + PCS-Annahme − Sturzabzug und
benennt die Lücke (`docs/manual.md`). Auch die Maximalwerte je Elementtyp
als Bandbreite wären faktisch korrekt, aber für die Planung nutzlos.
### Weitere Disziplinen

View file

@ -203,11 +203,11 @@ kein Netzwerkzugriff statt.
## Aktueller Stand und Übergang
- **0.3.0** ist seit 2026-11-13 für macOS und Windows veröffentlicht: Mehrere
Saisons (Regelwerk als Saisonordner mit Invariantenprüfung), Saison an der
Kür, Saison-Vergleich, Artistic als eigener Programmtyp (ohne
Punktschätzung) und die Feature-Grenzen aus ISU 2788. Das DMG wurde am
13.11. nachgezogen; `downloads.macos` steht seitdem im Endpunkt.
- **0.3.0** ist seit 2026-11-13 für macOS und Windows veröffentlicht:
Mehrere Saisons (Regelwerk als Saisonordner mit Invariantenprüfung), Saison
an der Kür, Saison-Vergleich inklusive PDF-Bericht, Artistic als eigener
Programmtyp (ohne Punktschätzung) und die Feature-Grenzen aus ISU 2788.
Windows-Installer 30,3 MB, macOS-DMG 68,1 MB.
- **0.2.3** ist seit 2026-11-12 für macOS und Windows veröffentlicht: Beim
Schließen werden laufende Hintergrund-Verbindungen (Update-Check, Sync)
eingesammelt; ein früher Ausstieg führt nicht mehr zu einem Absturz. Das
@ -221,11 +221,10 @@ kein Netzwerkzugriff statt.
- **0.2.1** (2026-11-12): neuer Skater im Kürkleid, kontrastreichere
3D-Bande und ein schlankerer Build (frühere Modellvarianten entfernt,
Installer 29 statt 32 MB).
- **macOS** ist seit dem 0.2.2-Release im Endpunkt (DMG, 65 MB); mit 0.2.3 und
0.3.0 wurde das DMG jeweils nachgezogen. `publish_version.sh` übernimmt
Einträge anderer Plattformen nur, wenn die Live-Version zur neuen passt – ein
fehlendes DMG führt also nicht zu einem Hinweis auf eine Version ohne
Installer.
- **macOS** ist seit dem 0.2.2-Release im Endpunkt (DMG, 65 MB); mit 0.2.3
wurde das DMG nachgezogen. `publish_version.sh` übernimmt Einträge anderer
Plattformen nur, wenn die Live-Version zur neuen passt – ein fehlendes DMG
führt also nicht zu einem Hinweis auf eine Version ohne Installer.
- **Windows** ist seit 2026-11-11 im Endpunkt; die Installer enthalten die
Update-Prüfung.
- **Übergang von 0.1.0:** Die Version 0.1.0 enthält die Update-Prüfung noch

View file

@ -798,3 +798,17 @@
"Fuß nicht angegeben für „%s“; max. zwei Features pro Fuß sind nicht prüfbar.","Fuß nicht angegeben für „%s“; max. zwei Features pro Fuß sind nicht prüfbar.","Foot missing for “%s”; the limit of two features per foot cannot be checked."
"„%s“: %d Features auf einem Fuß, es zählen höchstens %d.","„%s“: %d Features auf einem Fuß, es zählen höchstens %d.","“%s”: %d features on one foot, at most %d count."
"Bei „%s“ zählen höchstens %d Features der Gruppe „%s“.","Bei „%s“ zählen höchstens %d Features der Gruppe „%s“.","In “%s” at most %d features of the group “%s” count."
"Als PDF","Als PDF","As PDF"
"Kategorie: %s","Kategorie: %s","Category: %s"
"%d Abschnitte","%d Abschnitte","%d sections"
"Musik: %s","Musik: %s","Music: %s"
"+ %d weitere","+ %d weitere","+ %d more"
"Abschnitt","Abschnitt","Section"
"Abschnitte","Abschnitte","Sections"
"#","#","#"
"Fehler","Fehler","Error"
"Warnung","Warnung","Warning"
"Hinweis","Hinweis","Note"
"%s — nicht im Katalog","%s — nicht im Katalog","%s — not in the catalog"
"%s — Feature „%s“ in der Ziel-Saison unbekannt","%s — Feature „%s“ in der Ziel-Saison unbekannt","%s — feature “%s” unknown in the target season"
"• %s — in der Ziel-Saison nicht vorhanden","• %s — in der Ziel-Saison nicht vorhanden","• %s — not available in the target season"

1 keys de en
798 Fuß nicht angegeben für „%s“; max. zwei Features pro Fuß sind nicht prüfbar. Fuß nicht angegeben für „%s“; max. zwei Features pro Fuß sind nicht prüfbar. Foot missing for “%s”; the limit of two features per foot cannot be checked.
799 „%s“: %d Features auf einem Fuß, es zählen höchstens %d. „%s“: %d Features auf einem Fuß, es zählen höchstens %d. “%s”: %d features on one foot, at most %d count.
800 Bei „%s“ zählen höchstens %d Features der Gruppe „%s“. Bei „%s“ zählen höchstens %d Features der Gruppe „%s“. In “%s” at most %d features of the group “%s” count.
801 Als PDF Als PDF As PDF
802 Kategorie: %s Kategorie: %s Category: %s
803 %d Abschnitte %d Abschnitte %d sections
804 Musik: %s Musik: %s Music: %s
805 + %d weitere + %d weitere + %d more
806 Abschnitt Abschnitt Section
807 Abschnitte Abschnitte Sections
808 # # #
809 Fehler Fehler Error
810 Warnung Warnung Warning
811 Hinweis Hinweis Note
812 %s — nicht im Katalog %s — nicht im Katalog %s — not in the catalog
813 %s — Feature „%s“ in der Ziel-Saison unbekannt %s — Feature „%s“ in der Ziel-Saison unbekannt %s — feature “%s” unknown in the target season
814 • %s — in der Ziel-Saison nicht vorhanden • %s — in der Ziel-Saison nicht vorhanden • %s — not available in the target season

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View file

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://f72ldr1lvtq3"
path="res://.godot/imported/boot_splash.png-c2760ae15293ca9a9d17190592935c1e.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/icons/boot_splash.png"
dest_files=["res://.godot/imported/boot_splash.png-c2760ae15293ca9a9d17190592935c1e.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View file

@ -66,8 +66,8 @@ application/modify_resources=true
application/icon="res://assets/icons/app_icon.png"
application/console_wrapper_icon=""
application/icon_interpolation=4
application/file_version="0.3.0.0"
application/product_version="0.3.0.0"
application/file_version="0.4.0.0"
application/product_version="0.4.0.0"
application/company_name=""
application/product_name="Rinkplanner"
application/file_description="2D-Whiteboard für Eiskunstlauf"
@ -118,8 +118,8 @@ application/icon_interpolation=4
application/bundle_identifier="de.rinkplanner.app"
application/signature=""
application/app_category="Education"
application/short_version="0.3.0"
application/version="0.3.0"
application/short_version="0.4.0"
application/version="0.4.0"
application/copyright=""
application/copyright_localized={}
application/min_macos_version_x86_64="11.00"
@ -243,8 +243,8 @@ keystore/debug_password=""
keystore/release=""
keystore/release_user=""
keystore/release_password=""
version/code=5
version/name="0.3.0"
version/code=6
version/name="0.4.0"
package/unique_name="de.rinkplanner.app"
package/name="Rinkplanner"
package/signed=true

View file

@ -15,10 +15,15 @@ compatibility/default_parent_skeleton_in_mesh_instance_3d=true
[application]
config/name="Rinkplanner"
config/version="0.3.0"
config/version="0.4.0"
run/main_scene="res://scenes/whiteboard/whiteboard.tscn"
config/features=PackedStringArray("4.7", "Forward Plus")
config/icon="res://assets/icons/app_icon.png"
boot_splash/image="res://assets/icons/boot_splash.png"
boot_splash/bg_color=Color(0.043137, 0.070588, 0.12549, 1)
boot_splash/show_image=true
boot_splash/fullsize=false
boot_splash/minimum_display_time=0
[autoload]
@ -26,6 +31,9 @@ GodotAIBridgeRuntime="*res://addons/godot_ai_bridge/runtime_bridge.gd"
[display]
; Querformat ist gesetzt: Die Eisfläche ist breiter als hoch, und das Tablet
; wird so gehalten. Eine Hochformat-Fassung ist bewusst nicht geplant.
window/handheld/orientation=0
window/size/viewport_width=1440
window/size/viewport_height=900
window/stretch/aspect="expand"

View file

@ -0,0 +1,134 @@
[gd_scene load_steps=2 format=3]
[ext_resource type="Script" path="res://src/whiteboard/view/export_panel.gd" id="1_export_panel"]
[node name="ExportPanel" type="Node"]
unique_name_in_owner = true
script = ExtResource("1_export_panel")
[node name="ExportDialog" type="ConfirmationDialog" parent="."]
unique_name_in_owner = true
title = "Kür exportieren"
size = Vector2i(480, 520)
wrap_controls = false
ok_button_text = "Exportieren"
cancel_button_text = "Abbrechen"
[node name="ExportScroll" type="ScrollContainer" parent="ExportDialog"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 8.0
offset_top = 8.0
offset_right = -8.0
offset_bottom = -64.0
grow_horizontal = 2
grow_vertical = 2
horizontal_scroll_mode = 0
follow_focus = true
[node name="ExportBox" type="VBoxContainer" parent="ExportDialog/ExportScroll"]
layout_mode = 2
size_flags_horizontal = 3
theme_override_constants/separation = 4
[node name="ExportNameLabel" type="Label" parent="ExportDialog/ExportScroll/ExportBox"]
layout_mode = 2
text = "Dateiname"
[node name="ExportNameEdit" type="LineEdit" parent="ExportDialog/ExportScroll/ExportBox"]
unique_name_in_owner = true
custom_minimum_size = Vector2(0, 48)
layout_mode = 2
[node name="ExportFormatLabel" type="Label" parent="ExportDialog/ExportScroll/ExportBox"]
layout_mode = 2
text = "Format"
[node name="ExportFormatOption" type="OptionButton" parent="ExportDialog/ExportScroll/ExportBox"]
unique_name_in_owner = true
custom_minimum_size = Vector2(0, 48)
layout_mode = 2
[node name="ExportScopeLabel" type="Label" parent="ExportDialog/ExportScroll/ExportBox"]
layout_mode = 2
text = "Umfang"
[node name="ExportScopeOption" type="OptionButton" parent="ExportDialog/ExportScroll/ExportBox"]
unique_name_in_owner = true
custom_minimum_size = Vector2(0, 48)
layout_mode = 2
[node name="ExportHint" type="Label" parent="ExportDialog/ExportScroll/ExportBox"]
custom_minimum_size = Vector2(0, 34)
layout_mode = 2
theme_override_colors/font_color = Color(0.580392, 0.639216, 0.721569, 1)
theme_override_font_sizes/font_size = 12
text = "Ziel: export-Ordner im App-Datenverzeichnis · der absolute Pfad erscheint nach dem Export"
autowrap_mode = 3
[node name="ExportOpenAfterCheck" type="CheckBox" parent="ExportDialog/ExportScroll/ExportBox"]
unique_name_in_owner = true
custom_minimum_size = Vector2(0, 44)
layout_mode = 2
button_pressed = true
text = "Nach dem Export öffnen"
tooltip_text = "Ergebnis nach dem Export mit dem Standardprogramm öffnen"
[node name="ExportDoneDialog" type="AcceptDialog" parent="."]
unique_name_in_owner = true
title = "Export abgeschlossen"
size = Vector2i(660, 320)
wrap_controls = false
exclusive = false
ok_button_text = "Schließen"
[node name="ExportDoneBox" type="VBoxContainer" parent="ExportDoneDialog"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 12.0
offset_top = 12.0
offset_right = -12.0
offset_bottom = -64.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/separation = 4
[node name="ExportDoneLabel" type="RichTextLabel" parent="ExportDoneDialog/ExportDoneBox"]
unique_name_in_owner = true
custom_minimum_size = Vector2(0, 96)
layout_mode = 2
size_flags_vertical = 3
bbcode_enabled = false
scroll_active = false
selection_enabled = true
autowrap_mode = 3
[node name="ExportDoneButtons" type="HFlowContainer" parent="ExportDoneDialog/ExportDoneBox"]
layout_mode = 2
theme_override_constants/h_separation = 6
theme_override_constants/v_separation = 8
[node name="ExportOpenButton" type="Button" parent="ExportDoneDialog/ExportDoneBox/ExportDoneButtons"]
unique_name_in_owner = true
custom_minimum_size = Vector2(140, 48)
layout_mode = 2
text = "Öffnen"
tooltip_text = "Datei mit dem Standardprogramm öffnen"
[node name="ExportFolderButton" type="Button" parent="ExportDoneDialog/ExportDoneBox/ExportDoneButtons"]
unique_name_in_owner = true
custom_minimum_size = Vector2(180, 48)
layout_mode = 2
text = "Ordner anzeigen"
tooltip_text = "Exportordner im Dateimanager öffnen"
[node name="ExportCopyPathButton" type="Button" parent="ExportDoneDialog/ExportDoneBox/ExportDoneButtons"]
unique_name_in_owner = true
custom_minimum_size = Vector2(170, 48)
layout_mode = 2
text = "Pfad kopieren"
tooltip_text = "Absoluten Dateipfad in die Zwischenablage kopieren"

View file

@ -0,0 +1,77 @@
[gd_scene load_steps=2 format=3]
[ext_resource type="Script" path="res://src/whiteboard/view/routine_manager_panel.gd" id="1_manager_panel"]
[node name="RoutineManagerPanel" type="Node"]
unique_name_in_owner = true
script = ExtResource("1_manager_panel")
[node name="RoutineManagerDialog" type="AcceptDialog" parent="."]
unique_name_in_owner = true
title = "Küren verwalten"
size = Vector2i(800, 600)
exclusive = false
ok_button_text = "Schließen"
[node name="ManagerBox" type="VBoxContainer" parent="RoutineManagerDialog"]
offset_left = 12.0
offset_top = 12.0
offset_right = 788.0
offset_bottom = 530.0
theme_override_constants/separation = 4
[node name="ManagerHint" type="Label" parent="RoutineManagerDialog/ManagerBox"]
layout_mode = 2
theme_override_colors/font_color = Color(0.580392, 0.639216, 0.721569, 1)
theme_override_font_sizes/font_size = 14
text = "Lokale Küren löschen oder alte Konfliktkopien aufräumen. Echte Sync-Konflikte löst die App automatisch nach dem neuesten Speicherstand auf."
autowrap_mode = 2
[node name="ManagerTabs" type="TabContainer" parent="RoutineManagerDialog/ManagerBox"]
unique_name_in_owner = true
layout_mode = 2
size_flags_vertical = 3
[node name="RoutinesTab" type="VBoxContainer" parent="RoutineManagerDialog/ManagerBox/ManagerTabs"]
layout_mode = 2
theme_override_constants/separation = 4
[node name="RoutineManagerScroll" type="ScrollContainer" parent="RoutineManagerDialog/ManagerBox/ManagerTabs/RoutinesTab"]
layout_mode = 2
size_flags_vertical = 3
horizontal_scroll_mode = 0
[node name="RoutineManagerList" type="VBoxContainer" parent="RoutineManagerDialog/ManagerBox/ManagerTabs/RoutinesTab/RoutineManagerScroll"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
theme_override_constants/separation = 4
[node name="ConflictsTab" type="VBoxContainer" parent="RoutineManagerDialog/ManagerBox/ManagerTabs"]
layout_mode = 2
theme_override_constants/separation = 4
[node name="ConflictManagerHint" type="Label" parent="RoutineManagerDialog/ManagerBox/ManagerTabs/ConflictsTab"]
layout_mode = 2
theme_override_colors/font_color = Color(0.580392, 0.639216, 0.721569, 1)
theme_override_font_sizes/font_size = 14
text = "Alte sichtbare Kopien wie „Kür (Server …).json“ werden gesucht und nach Bestätigung ins Konfliktarchiv verschoben. Kopien ohne Hauptdatei bleiben als mögliche letzte Fassung erhalten."
autowrap_mode = 2
[node name="ManagerConflictActions" type="HBoxContainer" parent="RoutineManagerDialog/ManagerBox/ManagerTabs/ConflictsTab"]
layout_mode = 2
theme_override_constants/separation = 4
[node name="ManagerScanConflictsButton" type="Button" parent="RoutineManagerDialog/ManagerBox/ManagerTabs/ConflictsTab/ManagerConflictActions"]
unique_name_in_owner = true
custom_minimum_size = Vector2(0, 48)
layout_mode = 2
size_flags_horizontal = 3
text = "Konfliktkopien suchen…"
[node name="ManagerOpenArchiveButton" type="Button" parent="RoutineManagerDialog/ManagerBox/ManagerTabs/ConflictsTab/ManagerConflictActions"]
unique_name_in_owner = true
custom_minimum_size = Vector2(0, 48)
layout_mode = 2
size_flags_horizontal = 3
text = "Konfliktarchiv öffnen"

View file

@ -1,8 +1,12 @@
[gd_scene load_steps=22 format=3]
[gd_scene load_steps=26 format=3]
[ext_resource type="Script" path="res://src/whiteboard/ctrl/whiteboard_controller.gd" id="1_controller"]
[ext_resource type="Script" path="res://src/whiteboard/view/rink_canvas.gd" id="2_canvas"]
[ext_resource type="Script" path="res://src/whiteboard/view/timeline_label_lane.gd" id="3_label_lane"]
[ext_resource type="Script" path="res://src/whiteboard/view/export_panel.gd" id="3_export_panel"]
[ext_resource type="Script" path="res://src/whiteboard/view/playback_panel.gd" id="3_playback_panel"]
[ext_resource type="PackedScene" path="res://scenes/export/export_panel.tscn" id="14_export_panel_scene"]
[ext_resource type="PackedScene" path="res://scenes/routine/routine_manager_panel.tscn" id="15_manager_panel_scene"]
[ext_resource type="Texture2D" path="res://assets/icons/tools/select.svg" id="4_tool_select"]
[ext_resource type="Texture2D" path="res://assets/icons/tools/line.svg" id="5_tool_line"]
[ext_resource type="Texture2D" path="res://assets/icons/tools/arc_left.svg" id="6_tool_arc_left"]
@ -116,12 +120,18 @@ tooltip_text = "Datei"
[node name="TitleSeparator" type="VSeparator" parent="Layout/TopBar/Tools"]
layout_mode = 2
[node name="ToolButtons" type="HBoxContainer" parent="Layout/TopBar/Tools"]
[node name="ToolFlow" type="HFlowContainer" parent="Layout/TopBar/Tools"]
layout_mode = 2
size_flags_horizontal = 3
theme_override_constants/h_separation = 6
theme_override_constants/v_separation = 6
[node name="ToolButtons" type="HBoxContainer" parent="Layout/TopBar/Tools/ToolFlow"]
unique_name_in_owner = true
layout_mode = 2
theme_override_constants/separation = 4
[node name="SelectToolButton" type="Button" parent="Layout/TopBar/Tools/ToolButtons"]
[node name="SelectToolButton" type="Button" parent="Layout/TopBar/Tools/ToolFlow/ToolButtons"]
unique_name_in_owner = true
custom_minimum_size = Vector2(44, 48)
icon_alignment = 1
@ -140,7 +150,7 @@ theme_override_styles/pressed = SubResource("StyleBoxFlat_tool_active")
theme_override_styles/hover_pressed = SubResource("StyleBoxFlat_tool_active")
icon = ExtResource("4_tool_select")
[node name="LineToolButton" type="Button" parent="Layout/TopBar/Tools/ToolButtons"]
[node name="LineToolButton" type="Button" parent="Layout/TopBar/Tools/ToolFlow/ToolButtons"]
unique_name_in_owner = true
custom_minimum_size = Vector2(44, 48)
icon_alignment = 1
@ -158,7 +168,7 @@ theme_override_styles/pressed = SubResource("StyleBoxFlat_tool_active")
theme_override_styles/hover_pressed = SubResource("StyleBoxFlat_tool_active")
icon = ExtResource("5_tool_line")
[node name="ArcLeftToolButton" type="Button" parent="Layout/TopBar/Tools/ToolButtons"]
[node name="ArcLeftToolButton" type="Button" parent="Layout/TopBar/Tools/ToolFlow/ToolButtons"]
unique_name_in_owner = true
custom_minimum_size = Vector2(44, 48)
icon_alignment = 1
@ -176,7 +186,7 @@ theme_override_styles/pressed = SubResource("StyleBoxFlat_tool_active")
theme_override_styles/hover_pressed = SubResource("StyleBoxFlat_tool_active")
icon = ExtResource("6_tool_arc_left")
[node name="ArcRightToolButton" type="Button" parent="Layout/TopBar/Tools/ToolButtons"]
[node name="ArcRightToolButton" type="Button" parent="Layout/TopBar/Tools/ToolFlow/ToolButtons"]
unique_name_in_owner = true
custom_minimum_size = Vector2(44, 48)
icon_alignment = 1
@ -194,7 +204,7 @@ theme_override_styles/pressed = SubResource("StyleBoxFlat_tool_active")
theme_override_styles/hover_pressed = SubResource("StyleBoxFlat_tool_active")
icon = ExtResource("7_tool_arc_right")
[node name="FreeLineToolButton" type="Button" parent="Layout/TopBar/Tools/ToolButtons"]
[node name="FreeLineToolButton" type="Button" parent="Layout/TopBar/Tools/ToolFlow/ToolButtons"]
unique_name_in_owner = true
custom_minimum_size = Vector2(44, 48)
icon_alignment = 1
@ -212,7 +222,7 @@ theme_override_styles/pressed = SubResource("StyleBoxFlat_tool_active")
theme_override_styles/hover_pressed = SubResource("StyleBoxFlat_tool_active")
icon = ExtResource("11_tool_freeline")
[node name="JumpToolButton" type="Button" parent="Layout/TopBar/Tools/ToolButtons"]
[node name="JumpToolButton" type="Button" parent="Layout/TopBar/Tools/ToolFlow/ToolButtons"]
unique_name_in_owner = true
custom_minimum_size = Vector2(44, 48)
icon_alignment = 1
@ -230,7 +240,7 @@ theme_override_styles/pressed = SubResource("StyleBoxFlat_tool_active")
theme_override_styles/hover_pressed = SubResource("StyleBoxFlat_tool_active")
icon = ExtResource("8_tool_jump")
[node name="SpinToolButton" type="Button" parent="Layout/TopBar/Tools/ToolButtons"]
[node name="SpinToolButton" type="Button" parent="Layout/TopBar/Tools/ToolFlow/ToolButtons"]
unique_name_in_owner = true
custom_minimum_size = Vector2(44, 48)
icon_alignment = 1
@ -248,7 +258,7 @@ theme_override_styles/pressed = SubResource("StyleBoxFlat_tool_active")
theme_override_styles/hover_pressed = SubResource("StyleBoxFlat_tool_active")
icon = ExtResource("9_tool_spin")
[node name="GroupSequenceButton" type="Button" parent="Layout/TopBar/Tools/ToolButtons"]
[node name="GroupSequenceButton" type="Button" parent="Layout/TopBar/Tools/ToolFlow/ToolButtons"]
unique_name_in_owner = true
custom_minimum_size = Vector2(44, 48)
icon_alignment = 1
@ -263,10 +273,10 @@ theme_override_colors/icon_disabled_color = Color(0.337255, 0.380392, 0.443137,
theme_override_constants/icon_max_width = 28
icon = ExtResource("10_tool_group_sequence")
[node name="ToolSeparator" type="VSeparator" parent="Layout/TopBar/Tools"]
[node name="ToolSeparator" type="VSeparator" parent="Layout/TopBar/Tools/ToolFlow"]
layout_mode = 2
[node name="ForwardButton" type="Button" parent="Layout/TopBar/Tools"]
[node name="ForwardButton" type="Button" parent="Layout/TopBar/Tools/ToolFlow"]
unique_name_in_owner = true
custom_minimum_size = Vector2(88, 48)
layout_mode = 2
@ -277,7 +287,7 @@ button_group = SubResource("ButtonGroup_direction")
text = "Vorwärts"
tooltip_text = "Vorwärts"
[node name="BackwardButton" type="Button" parent="Layout/TopBar/Tools"]
[node name="BackwardButton" type="Button" parent="Layout/TopBar/Tools/ToolFlow"]
unique_name_in_owner = true
custom_minimum_size = Vector2(92, 48)
layout_mode = 2
@ -287,10 +297,10 @@ button_group = SubResource("ButtonGroup_direction")
text = "Rückwärts"
tooltip_text = "Rückwärts"
[node name="EdgeSeparator" type="VSeparator" parent="Layout/TopBar/Tools"]
[node name="EdgeSeparator" type="VSeparator" parent="Layout/TopBar/Tools/ToolFlow"]
layout_mode = 2
[node name="InsideButton" type="Button" parent="Layout/TopBar/Tools"]
[node name="InsideButton" type="Button" parent="Layout/TopBar/Tools/ToolFlow"]
unique_name_in_owner = true
custom_minimum_size = Vector2(64, 48)
layout_mode = 2
@ -299,7 +309,7 @@ toggle_mode = true
button_group = SubResource("ButtonGroup_edge")
text = "Innen"
[node name="OutsideButton" type="Button" parent="Layout/TopBar/Tools"]
[node name="OutsideButton" type="Button" parent="Layout/TopBar/Tools/ToolFlow"]
unique_name_in_owner = true
custom_minimum_size = Vector2(64, 48)
layout_mode = 2
@ -309,10 +319,6 @@ button_pressed = true
button_group = SubResource("ButtonGroup_edge")
text = "Außen"
[node name="Spacer" type="Control" parent="Layout/TopBar/Tools"]
layout_mode = 2
size_flags_horizontal = 3
[node name="UndoButton" type="Button" parent="Layout/TopBar/Tools"]
unique_name_in_owner = true
custom_minimum_size = Vector2(96, 48)
@ -765,6 +771,7 @@ theme_override_constants/separation = 6
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
clip_text = true
theme_override_colors/font_color = Color(0.580392, 0.639216, 0.721569, 1)
theme_override_font_sizes/font_size = 15
text = "Abschnitt 1 · 0 Segmente"
@ -780,25 +787,25 @@ tooltip_text = "Hilfe und Annahmen"
[node name="SeasonOption" type="OptionButton" parent="Layout/StatusBar/StatusBarContent"]
unique_name_in_owner = true
custom_minimum_size = Vector2(190, 48)
custom_minimum_size = Vector2(158, 48)
layout_mode = 2
theme_override_font_sizes/font_size = 15
[node name="ProgramOption" type="OptionButton" parent="Layout/StatusBar/StatusBarContent"]
unique_name_in_owner = true
custom_minimum_size = Vector2(120, 48)
custom_minimum_size = Vector2(104, 48)
layout_mode = 2
theme_override_font_sizes/font_size = 15
[node name="AdultCategoryOption" type="OptionButton" parent="Layout/StatusBar/StatusBarContent"]
unique_name_in_owner = true
custom_minimum_size = Vector2(170, 48)
custom_minimum_size = Vector2(146, 48)
layout_mode = 2
theme_override_font_sizes/font_size = 15
[node name="ValidationButton" type="Button" parent="Layout/StatusBar/StatusBarContent"]
unique_name_in_owner = true
custom_minimum_size = Vector2(120, 48)
custom_minimum_size = Vector2(104, 48)
layout_mode = 2
theme_override_font_sizes/font_size = 15
text = "Prüfen"
@ -1293,75 +1300,8 @@ layout_mode = 2
size_flags_horizontal = 3
theme_override_constants/separation = 4
[node name="RoutineManagerDialog" type="AcceptDialog" parent="."]
[node name="RoutineManagerPanel" parent="." instance=ExtResource("15_manager_panel_scene")]
unique_name_in_owner = true
title = "Küren verwalten"
size = Vector2i(800, 600)
exclusive = false
ok_button_text = "Schließen"
[node name="ManagerBox" type="VBoxContainer" parent="RoutineManagerDialog"]
offset_left = 12.0
offset_top = 12.0
offset_right = 788.0
offset_bottom = 530.0
theme_override_constants/separation = 4
[node name="ManagerHint" type="Label" parent="RoutineManagerDialog/ManagerBox"]
layout_mode = 2
theme_override_colors/font_color = Color(0.580392, 0.639216, 0.721569, 1)
theme_override_font_sizes/font_size = 14
text = "Lokale Küren löschen oder alte Konfliktkopien aufräumen. Echte Sync-Konflikte löst die App automatisch nach dem neuesten Speicherstand auf."
autowrap_mode = 2
[node name="ManagerTabs" type="TabContainer" parent="RoutineManagerDialog/ManagerBox"]
unique_name_in_owner = true
layout_mode = 2
size_flags_vertical = 3
[node name="RoutinesTab" type="VBoxContainer" parent="RoutineManagerDialog/ManagerBox/ManagerTabs"]
layout_mode = 2
theme_override_constants/separation = 4
[node name="RoutineManagerScroll" type="ScrollContainer" parent="RoutineManagerDialog/ManagerBox/ManagerTabs/RoutinesTab"]
layout_mode = 2
size_flags_vertical = 3
horizontal_scroll_mode = 0
[node name="RoutineManagerList" type="VBoxContainer" parent="RoutineManagerDialog/ManagerBox/ManagerTabs/RoutinesTab/RoutineManagerScroll"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
theme_override_constants/separation = 4
[node name="ConflictsTab" type="VBoxContainer" parent="RoutineManagerDialog/ManagerBox/ManagerTabs"]
layout_mode = 2
theme_override_constants/separation = 4
[node name="ConflictManagerHint" type="Label" parent="RoutineManagerDialog/ManagerBox/ManagerTabs/ConflictsTab"]
layout_mode = 2
theme_override_colors/font_color = Color(0.580392, 0.639216, 0.721569, 1)
theme_override_font_sizes/font_size = 14
text = "Alte sichtbare Kopien wie „Kür (Server …).json“ werden gesucht und nach Bestätigung ins Konfliktarchiv verschoben. Kopien ohne Hauptdatei bleiben als mögliche letzte Fassung erhalten."
autowrap_mode = 2
[node name="ManagerConflictActions" type="HBoxContainer" parent="RoutineManagerDialog/ManagerBox/ManagerTabs/ConflictsTab"]
layout_mode = 2
theme_override_constants/separation = 4
[node name="ManagerScanConflictsButton" type="Button" parent="RoutineManagerDialog/ManagerBox/ManagerTabs/ConflictsTab/ManagerConflictActions"]
unique_name_in_owner = true
custom_minimum_size = Vector2(0, 48)
layout_mode = 2
size_flags_horizontal = 3
text = "Konfliktkopien suchen…"
[node name="ManagerOpenArchiveButton" type="Button" parent="RoutineManagerDialog/ManagerBox/ManagerTabs/ConflictsTab/ManagerConflictActions"]
unique_name_in_owner = true
custom_minimum_size = Vector2(0, 48)
layout_mode = 2
size_flags_horizontal = 3
text = "Konfliktarchiv öffnen"
[node name="DeleteRoutineDialog" type="ConfirmationDialog" parent="."]
unique_name_in_owner = true
@ -1648,131 +1588,12 @@ theme_override_colors/font_color = Color(0.580392, 0.639216, 0.721569, 1)
theme_override_font_sizes/font_size = 12
text = "Geschwindigkeit = Strecke / Zeit"
[node name="ExportDialog" type="ConfirmationDialog" parent="."]
[node name="PlaybackPanel" type="Node" parent="."]
unique_name_in_owner = true
title = "Kür exportieren"
size = Vector2i(480, 520)
wrap_controls = false
ok_button_text = "Exportieren"
cancel_button_text = "Abbrechen"
script = ExtResource("3_playback_panel")
[node name="ExportScroll" type="ScrollContainer" parent="ExportDialog"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 8.0
offset_top = 8.0
offset_right = -8.0
offset_bottom = -64.0
grow_horizontal = 2
grow_vertical = 2
horizontal_scroll_mode = 0
follow_focus = true
[node name="ExportBox" type="VBoxContainer" parent="ExportDialog/ExportScroll"]
layout_mode = 2
size_flags_horizontal = 3
theme_override_constants/separation = 4
[node name="ExportNameLabel" type="Label" parent="ExportDialog/ExportScroll/ExportBox"]
layout_mode = 2
text = "Dateiname"
[node name="ExportNameEdit" type="LineEdit" parent="ExportDialog/ExportScroll/ExportBox"]
[node name="ExportPanel" parent="." instance=ExtResource("14_export_panel_scene")]
unique_name_in_owner = true
custom_minimum_size = Vector2(0, 48)
layout_mode = 2
[node name="ExportFormatLabel" type="Label" parent="ExportDialog/ExportScroll/ExportBox"]
layout_mode = 2
text = "Format"
[node name="ExportFormatOption" type="OptionButton" parent="ExportDialog/ExportScroll/ExportBox"]
unique_name_in_owner = true
custom_minimum_size = Vector2(0, 48)
layout_mode = 2
[node name="ExportScopeLabel" type="Label" parent="ExportDialog/ExportScroll/ExportBox"]
layout_mode = 2
text = "Umfang"
[node name="ExportScopeOption" type="OptionButton" parent="ExportDialog/ExportScroll/ExportBox"]
unique_name_in_owner = true
custom_minimum_size = Vector2(0, 48)
layout_mode = 2
[node name="ExportHint" type="Label" parent="ExportDialog/ExportScroll/ExportBox"]
custom_minimum_size = Vector2(0, 34)
layout_mode = 2
theme_override_colors/font_color = Color(0.580392, 0.639216, 0.721569, 1)
theme_override_font_sizes/font_size = 12
text = "Ziel: export-Ordner im App-Datenverzeichnis · der absolute Pfad erscheint nach dem Export"
autowrap_mode = 3
[node name="ExportOpenAfterCheck" type="CheckBox" parent="ExportDialog/ExportScroll/ExportBox"]
unique_name_in_owner = true
custom_minimum_size = Vector2(0, 44)
layout_mode = 2
button_pressed = true
text = "Nach dem Export öffnen"
tooltip_text = "Ergebnis nach dem Export mit dem Standardprogramm öffnen"
[node name="ExportDoneDialog" type="AcceptDialog" parent="."]
unique_name_in_owner = true
title = "Export abgeschlossen"
size = Vector2i(660, 320)
wrap_controls = false
ok_button_text = "Schließen"
[node name="ExportDoneBox" type="VBoxContainer" parent="ExportDoneDialog"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 12.0
offset_top = 12.0
offset_right = -12.0
offset_bottom = -64.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/separation = 4
[node name="ExportDoneLabel" type="RichTextLabel" parent="ExportDoneDialog/ExportDoneBox"]
unique_name_in_owner = true
custom_minimum_size = Vector2(0, 96)
layout_mode = 2
size_flags_vertical = 3
bbcode_enabled = false
scroll_active = false
selection_enabled = true
autowrap_mode = 3
[node name="ExportDoneButtons" type="HFlowContainer" parent="ExportDoneDialog/ExportDoneBox"]
layout_mode = 2
theme_override_constants/h_separation = 6
theme_override_constants/v_separation = 8
[node name="ExportOpenButton" type="Button" parent="ExportDoneDialog/ExportDoneBox/ExportDoneButtons"]
unique_name_in_owner = true
custom_minimum_size = Vector2(140, 48)
layout_mode = 2
text = "Öffnen"
tooltip_text = "Datei mit dem Standardprogramm öffnen"
[node name="ExportFolderButton" type="Button" parent="ExportDoneDialog/ExportDoneBox/ExportDoneButtons"]
unique_name_in_owner = true
custom_minimum_size = Vector2(180, 48)
layout_mode = 2
text = "Ordner anzeigen"
tooltip_text = "Exportordner im Dateimanager öffnen"
[node name="ExportCopyPathButton" type="Button" parent="ExportDoneDialog/ExportDoneBox/ExportDoneButtons"]
unique_name_in_owner = true
custom_minimum_size = Vector2(170, 48)
layout_mode = 2
text = "Pfad kopieren"
tooltip_text = "Absoluten Dateipfad in die Zwischenablage kopieren"
[node name="ElementFeatureMenu" type="PopupMenu" parent="."]
unique_name_in_owner = true
@ -1912,6 +1733,14 @@ theme_override_font_sizes/font_size = 15
disabled = true
text = "Auf Saison umstellen"
[node name="UpgradePdfButton" type="Button" parent="UpgradeDialog/UpgradeBox/UpgradeActions"]
unique_name_in_owner = true
custom_minimum_size = Vector2(120, 48)
layout_mode = 2
theme_override_font_sizes/font_size = 15
disabled = true
text = "Als PDF"
[node name="UpgradeHint" type="Label" parent="UpgradeDialog/UpgradeBox/UpgradeActions"]
unique_name_in_owner = true
layout_mode = 2

View file

@ -0,0 +1,71 @@
class_name RulesContext
extends RefCounted
## Owns the season rulebooks of the whiteboard.
##
## The context discovers the season packages, keeps the one that is currently
## applied and exposes its three documents (`catalog`, `levels`, `adult`). The
## controller holds one instance and asks it to switch seasons; nothing else
## needs to know about [RulesLibrary] or [RulesPackage].
var library: RulesLibrary
var package: RulesPackage
## Season new routines start with (newest complete season by `valid_from`).
var default_season: String = ""
var catalog: ElementCatalog
var levels: ElementLevelRules
var adult: AdultCategoryRules
## Scans the season folders and applies the default season. Returns the
## package, or null when no usable season was found.
func load_default() -> RulesPackage:
library = RulesLibrary.scan()
default_season = library.get_default_season() if library != null else ""
return apply(default_season)
## Applies one season. An empty or unknown season clears the documents on
## purpose: the app then says that it cannot check instead of silently using
## the wrong rulebook. Returns the applied package or null.
func apply(season: String) -> RulesPackage:
package = null
catalog = null
levels = null
adult = null
if library == null:
return null
var cleaned := season.strip_edges()
if cleaned.is_empty():
return null
package = library.get_package(cleaned)
if package == null:
return null
catalog = package.catalog
levels = package.levels
adult = package.adult
return package
func has_season() -> bool:
return package != null
func is_complete() -> bool:
return package != null and package.is_complete()
func season_label() -> String:
if package != null and not package.season.is_empty():
return package.season
return ""
func get_errors() -> PackedStringArray:
var errors := PackedStringArray()
if library != null:
errors.append_array(library.get_errors())
if package != null:
errors.append_array(package.get_errors())
return errors

View file

@ -0,0 +1 @@
uid://vppy828isg22

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,71 @@
class_name ExportService
extends RefCounted
## Writes exported documents and builds their paths.
##
## The dialogs ("Export", "Export abgeschlossen") stay in the controller; this
## service only knows the export folder, the file naming and how to serialise
## SVG and PDF. PNG needs a viewport and therefore stays in the controller.
const EXPORTS_DIR := "user://exports"
static func ensure_dir() -> void:
if not DirAccess.dir_exists_absolute(EXPORTS_DIR):
DirAccess.make_dir_recursive_absolute(EXPORTS_DIR)
## Lower-case, space-free file stem. Falls back to "kuer" for empty titles.
static func normalize_stem(name: String) -> String:
var stem := name.strip_edges().to_lower()
for character: String in ["/", "\\", ":", "*", "?", "\"", "<", ">", "|"]:
stem = stem.replace(character, "")
stem = stem.replace(" ", "_")
if stem.is_empty():
stem = "kuer"
return stem
## Full path inside the export folder, e.g. "user://exports/kuer_gold.pdf".
static func build_path(stem: String, suffix: String, extension: String) -> String:
return EXPORTS_DIR.path_join(stem + suffix + "." + extension)
static func write_bytes(path: String, bytes: PackedByteArray) -> bool:
if bytes.is_empty():
return false
var file := FileAccess.open(path, FileAccess.WRITE)
if file == null:
return false
file.store_buffer(bytes)
file.close()
return true
static func write_svg(
routine: Routine,
path: String,
section_id: String = ""
) -> bool:
if routine == null:
return false
var svg := RoutineSvgExporter.build(routine, section_id)
if svg.is_empty():
return false
var file := FileAccess.open(path, FileAccess.WRITE)
if file == null:
return false
file.store_string(svg)
file.close()
return true
static func write_pdf(
routine: Routine,
path: String,
section_id: String = ""
) -> bool:
if routine == null:
return false
var pdf := RoutinePdfExporter.build(routine, section_id)
return write_bytes(path, pdf)

View file

@ -0,0 +1 @@
uid://cl02cld4fbckd

View file

@ -15,6 +15,11 @@ const MARGIN := 36.0
const CONTENT_TOP := 104.0
const FOOTER_RULE_Y := 566.0
## Das Rink ist 2:1 und nimmt die volle Seitenbreite neben der Tabelle ein.
## Der Freiraum unter dem Diagramm ist Absicht: Auf dem ausgedruckten Blatt
## schreibt der Trainer mit der Hand mit. Nicht "optimieren", indem das Rink
## größer oder die Tabelle darunter gezogen wird — das wurde 2026-11-13
## geprüft und verworfen.
const OVERVIEW_DIAGRAM_WIDTH := 500.0
const OVERVIEW_DIAGRAM_HEIGHT := 268.0
const SECTION_DIAGRAM_WIDTH := 470.0
@ -27,6 +32,10 @@ const ROW_HEIGHT := 18.0
const TABLE_HEADER_HEIGHT := 18.0
const SECTION_ROWS_PER_PAGE := 23
const OVERVIEW_ROWS_PER_PAGE := 24
## Text-only pages of the season comparison: line height and the last usable
## baseline above the footer rule.
const REPORT_LINE := 13.0
const REPORT_BOTTOM := 546.0
const ICE_COLOR := Color(0.933, 0.965, 0.984)
const BOARDS_COLOR := Color(0.118, 0.161, 0.220)
@ -73,6 +82,236 @@ static func build(routine: Routine, section_id: String = "") -> PackedByteArray:
return _assemble_pdf(pages)
## --- Season comparison ----------------------------------------------------
## Builds a one- or two-page report for the season comparison: what changes
## between two seasons for this routine. The layout is text only, so it can be
## handed to a coach or a parent without further explanation.
static func build_season_comparison(
routine: Routine,
report: SeasonUpgradeCheck.Report
) -> PackedByteArray:
if routine == null or report == null:
return PackedByteArray()
var title := "Saison-Vergleich"
var subtitle := "%s · %s → %s" % [
_routine_title(routine),
report.source_season,
report.target_season,
]
var blocks := _report_blocks(routine, report)
var pages: Array[String] = []
var lines := _begin_page(title, subtitle)
var y := CONTENT_TOP
for block: Dictionary in blocks:
var size := float(block.get("size", 10.0))
var indent := float(block.get("indent", 0.0))
var bold := bool(block.get("bold", false))
var color: Color = block.get("color", TEXT_COLOR)
var wrapped := _report_lines(
str(block.get("text", "")),
size,
PAGE_WIDTH - 2.0 * MARGIN - indent
)
for part: String in wrapped:
if y + REPORT_LINE > REPORT_BOTTOM:
pages.append("\n".join(lines))
lines = _begin_page(title, subtitle)
y = CONTENT_TOP
_text(lines, part, MARGIN + indent, y, size, bold, color)
y += REPORT_LINE
y += float(block.get("gap", 0.0))
pages.append("\n".join(lines))
for index: int in range(pages.size()):
pages[index] += "\n" + _build_footer(index + 1, pages.size(), title)
return _assemble_pdf(pages)
static func _report_blocks(
routine: Routine,
report: SeasonUpgradeCheck.Report
) -> Array[Dictionary]:
var blocks: Array[Dictionary] = []
if not report.has_changes():
blocks.append(_report_block("Keine Unterschiede: Die Kür passt in beide Saisons."))
blocks.append(_report_block(""))
_add_report_group(
blocks,
routine,
"Elemente",
report.changes_of(SeasonUpgradeCheck.KIND_MISSING_CODE)
)
_add_report_group(
blocks,
routine,
"Base Values",
report.changes_of(SeasonUpgradeCheck.KIND_VALUE_CHANGE)
)
_add_report_group(
blocks,
routine,
"Elementtyp",
report.changes_of(SeasonUpgradeCheck.KIND_TYPE_CHANGE)
)
_add_report_group(
blocks,
routine,
"Features",
report.changes_of(SeasonUpgradeCheck.KIND_UNKNOWN_FEATURE)
)
_add_report_group(
blocks,
routine,
"Level",
report.changes_of(SeasonUpgradeCheck.KIND_LEVEL_CHANGE)
)
_add_report_group(
blocks,
routine,
"Kategorie",
report.changes_of(SeasonUpgradeCheck.KIND_CATEGORY_CHANGE)
)
var missing_category := report.changes_of(
SeasonUpgradeCheck.KIND_CATEGORY_MISSING
)
if not missing_category.is_empty():
blocks.append(_report_block("Kategorie", 12.0, true, TEXT_COLOR, 0.0, 6.0))
for change: SeasonUpgradeCheck.Change in missing_category:
blocks.append(
_report_block(
I18n.t("• %s — in der Ziel-Saison nicht vorhanden") % change.label,
10.0,
false,
TEXT_COLOR,
8.0
)
)
blocks.append(_report_block("Summe", 12.0, true, TEXT_COLOR, 0.0, 6.0))
if report.base_value_before > 0.0 or report.base_value_after > 0.0:
var sign := "+" if report.value_delta() >= 0.0 else "−"
blocks.append(
_report_block(
I18n.t("Basiswert %s → %s (%s%s)")
% [
_number(report.base_value_before),
_number(report.base_value_after),
sign,
_number(absf(report.value_delta())),
],
10.0,
false,
TEXT_COLOR,
8.0
)
)
else:
blocks.append(_report_block("Keine Elemente mit Base Value.", 10.0, false, TEXT_COLOR, 8.0))
if not report.issues.is_empty():
blocks.append(
_report_block(
I18n.t("Befunde bei Prüfung gegen %s") % report.target_season,
12.0,
true,
TEXT_COLOR,
0.0,
8.0
)
)
for issue: ValidationIssue in report.issues:
blocks.append(
_report_block(
"• %s: %s" % [I18n.t(issue.severity_label()), issue.message],
9.5,
false,
MUTED_COLOR,
4.0
)
)
return blocks
static func _add_report_group(
blocks: Array[Dictionary],
routine: Routine,
title: String,
changes: Array
) -> void:
if changes.is_empty():
return
blocks.append(_report_block(title, 12.0, true, TEXT_COLOR, 0.0, 6.0))
for change: SeasonUpgradeCheck.Change in changes:
var text := _report_change_text(change)
var location := _report_location(routine, change.section_id)
if not location.is_empty():
text += " (%s)" % location
blocks.append(_report_block("• " + text, 10.0, false, TEXT_COLOR, 8.0))
static func _report_change_text(change: SeasonUpgradeCheck.Change) -> String:
match change.kind:
SeasonUpgradeCheck.KIND_MISSING_CODE:
return I18n.t("%s — nicht im Katalog") % change.label
SeasonUpgradeCheck.KIND_UNKNOWN_FEATURE:
return I18n.t("%s — Feature „%s“ in der Ziel-Saison unbekannt") % [
change.label,
change.before,
]
SeasonUpgradeCheck.KIND_CATEGORY_CHANGE:
return "%s: %s → %s" % [change.label, change.before, change.after]
if change.after.is_empty():
return "%s: %s" % [change.label, change.before]
return "%s: %s → %s" % [change.label, change.before, change.after]
static func _report_location(routine: Routine, section_id: String) -> String:
if section_id.is_empty() or routine.sections.size() < 2:
return ""
var section := routine.get_section_by_id(section_id)
if section == null:
return ""
return I18n.section_title(section.title)
static func _report_block(
text: String,
size: float = 10.0,
bold: bool = false,
color: Color = TEXT_COLOR,
indent: float = 0.0,
gap: float = 0.0
) -> Dictionary:
return {
"text": text,
"size": size,
"bold": bold,
"color": color,
"indent": indent,
"gap": gap,
}
## Breaks a sentence into lines that fit the page. Uses the same rough width
## estimate as the rest of this exporter.
static func _report_lines(
text: String,
size: float,
max_width: float
) -> PackedStringArray:
return _wrap_text(text, size, max_width, 200)
static func _number(value: float) -> String:
return String.num(value, 2).replace(".", ",")
## --- Page structure -------------------------------------------------------
@ -340,14 +579,14 @@ static func _routine_subtitle(routine: Routine, section_count: int) -> String:
parts.append(I18n.t("Artistic"))
var category := routine.adult_category.strip_edges()
if not category.is_empty():
parts.append("Kategorie: %s" % category.capitalize())
parts.append(I18n.t("Kategorie: %s") % category.capitalize())
var season := routine.season.strip_edges()
if not season.is_empty():
parts.append(I18n.t("Saison %s") % season)
parts.append("%d Abschnitte" % section_count)
parts.append(I18n.t("%d Abschnitte") % section_count)
parts.append(I18n.t("Gesamt %s") % _fmt_clock(routine.get_duration_seconds()))
if routine.has_music():
parts.append("Musik: %s" % routine.music_file)
parts.append(I18n.t("Musik: %s") % routine.music_file)
return " · ".join(parts)
@ -462,7 +701,7 @@ static func _text(
_n(color.b),
_n(x),
_n(_y(top)),
_pdf_literal(text),
_pdf_literal(caption),
]
)
@ -1320,7 +1559,7 @@ static func _draw_timeline_notes(
if entries.size() > visible:
_text(
lines,
"+ %d weitere" % (entries.size() - visible),
I18n.t("+ %d weitere") % (entries.size() - visible),
x,
top + 16.0 + float(visible) * 13.0,
8.5,
@ -1422,7 +1661,7 @@ static func _draw_note(
text: String
) -> void:
_rect(lines, x, top, width, 36.0, ROW_COLOR, RULE_COLOR, 0.5)
var wrapped := _wrap_text(text, 8.0, width - 16.0, 2)
var wrapped := _wrap_text(I18n.t(text), 8.0, width - 16.0, 2)
for index: int in range(wrapped.size()):
_text(
lines,

View file

@ -0,0 +1,120 @@
class_name ExportPanel
extends Node
## The export dialogs: file name, format and scope, plus the "done" dialog.
##
## The panel only collects choices and reports them — it never touches the
## file system. The controller decides about existing files, writes the
## document and opens it, so the overwrite confirmation stays in one place.
signal export_requested(
path: String,
format: int,
section_id: String,
open_after: bool
)
signal open_requested
signal folder_requested
signal copy_requested
signal message_requested(text: String)
const FORMAT_EXTENSIONS := ["svg", "png", "pdf"]
@onready var dialog: ConfirmationDialog = %ExportDialog
@onready var name_edit: LineEdit = %ExportNameEdit
@onready var format_option: OptionButton = %ExportFormatOption
@onready var scope_option: OptionButton = %ExportScopeOption
@onready var open_after_check: CheckBox = %ExportOpenAfterCheck
@onready var done_dialog: AcceptDialog = %ExportDoneDialog
@onready var done_label: RichTextLabel = %ExportDoneLabel
@onready var open_button: Button = %ExportOpenButton
@onready var folder_button: Button = %ExportFolderButton
@onready var copy_button: Button = %ExportCopyPathButton
var _active_section: RoutineSection
func _ready() -> void:
format_option.clear()
format_option.add_item("SVG (Vektor)", 0)
format_option.add_item("PNG (hochauflösend)", 1)
format_option.add_item("PDF (Laufwege mit Zeit)", 2)
scope_option.clear()
scope_option.add_item("Gesamte Kür", 0)
scope_option.add_item("Aktiver Abschnitt", 1)
format_option.select(0)
scope_option.select(0)
dialog.confirmed.connect(_on_confirmed)
open_button.pressed.connect(func() -> void: open_requested.emit())
folder_button.pressed.connect(func() -> void: folder_requested.emit())
copy_button.pressed.connect(func() -> void: copy_requested.emit())
## Fills and shows the export dialog. [param size] is the pre-fitted dialog
## size the controller computed for the current viewport.
func open_for(
routine: Routine,
active_section: RoutineSection,
size: Vector2i
) -> void:
if routine == null:
return
_active_section = active_section
name_edit.text = routine.title
if name_edit.text.strip_edges().is_empty():
name_edit.text = "kuer"
format_option.select(0)
scope_option.select(0)
dialog.popup_centered(size)
# AcceptDialog shrinks to its content minimum on popup; restore the target
# size so the scroll area has room.
dialog.size = size
name_edit.grab_focus()
name_edit.select_all()
func _on_confirmed() -> void:
var name := name_edit.text.strip_edges()
if name.is_empty():
message_requested.emit("Bitte einen Dateinamen eingeben.")
return
var suffix := ""
var section_id := ""
if scope_option.selected == 1:
if _active_section == null:
message_requested.emit("Kein aktiver Abschnitt vorhanden.")
return
section_id = _active_section.section_id
suffix = "_" + ExportService.normalize_stem(_active_section.title)
var format := format_option.get_item_id(format_option.selected)
var extension: String = FORMAT_EXTENSIONS[clampi(format, 0, 2)]
export_requested.emit(
ExportService.build_path(
ExportService.normalize_stem(name),
suffix,
extension
),
format,
section_id,
open_after_check.button_pressed
)
## Shows the "export done" dialog for [param path].
func show_done(path: String, size: Vector2i) -> void:
done_label.text = (
"Exportiert nach:\n%s\n\n"
+ "Du kannst die Datei direkt öffnen oder den Ordner anzeigen."
) % path
open_button.disabled = path.is_empty() or not FileAccess.file_exists(path)
folder_button.disabled = path.is_empty()
copy_button.text = "Pfad kopieren"
done_dialog.popup_centered(size)
done_dialog.size = size
func set_copy_label(text: String) -> void:
copy_button.text = text

View file

@ -0,0 +1 @@
uid://hld4jpokdv6s

View file

@ -0,0 +1,145 @@
class_name HelpContent
extends RefCounted
## Text of the in-app help dialog ("Hilfe & Annahmen").
##
## Kept out of the controller so the scene wiring stays readable. The strings
## are German keys of the i18n catalog; `I18n.join_lines()` translates them.
static func build() -> String:
var lines := PackedStringArray()
lines.append("[b][font_size=22]Hilfe & Annahmen[/font_size][/b]")
lines.append(
"Diese Hilfe erklärt die Annahmen und Prüfungen der App. Sie ist "
+ "keine offizielle ISU-Auslegung."
)
lines.append("")
lines.append("[b][font_size=18]1. Kürzel und Base Value[/font_size][/b]")
lines.append(
"- Das Kürzel bezeichnet die Elementfamilie, z. B. 3Lz, CCoSp oder StSq."
)
lines.append(
"- Der Level ist die Schwierigkeitsstufe. Bei Pirouetten und "
+ "Schrittsequenzen folgt er aus den Features."
)
lines.append(
"- Der Base Value wird aus Kürzel und Level im Saisonkatalog 2026/27 "
+ "nachgeschlagen (ISU Communication 2786)."
)
lines.append(
"- Sprünge haben keinen Level; ihr Base Value hängt von Rotation und "
+ "Sprungtyp ab."
)
lines.append(
"- Sprungkombinationen werden strukturiert gewählt: erster Sprung plus "
+ "bis zu zwei weitere, als Kombination oder Folge. Die Base Values "
+ "werden summiert."
)
lines.append(
"- Eine Folge braucht einen Axel (1A/2A/3A) als 2. oder 3. Sprung."
)
lines.append(
"- Alte Freitext-Kombinationen werden beim Laden oder Übernehmen "
+ "automatisch in die strukturierte Form überführt."
)
lines.append(
"- ChSq (Choreo-Sequenz) und ChSp (Choreographic Spin) sind fest "
+ "Level 1."
)
lines.append(
"- Unbekannte Freitext-Codes haben keinen Katalogwert und werden in "
+ "der Schätzung nicht gewertet."
)
lines.append("")
lines.append("[b][font_size=18]2. Level aus Features[/font_size][/b]")
lines.append(
"- Pirouetten haben 15 Features, Schrittsequenzen 5 "
+ "(ISU Communication 2788)."
)
lines.append(
"- 0 Features = Base, 1 = Level 1, 2 = Level 2, 3 = Level 3, "
+ "4 oder mehr = Level 4."
)
lines.append(
"- Level 4 bei Pirouetten verlangt zusätzlich eines von: schwieriger "
+ "Ausgang, Kantenänderung, beide Richtungen, Temposteigerung, "
+ "schwieriger Flug-Eingang oder Windmills."
)
lines.append(
"- Bei Schrittsequenzen ist Feature 1 (Vielfalt) Pflicht."
)
lines.append(
"- Features beschreiben die Ausführung. Die App kann sie nicht aus "
+ "der gezeichneten Linie ableiten; sie werden im Element-Dialog "
+ "ausgewählt."
)
lines.append("")
lines.append("[b][font_size=18]3. Adult-Kategorie[/font_size][/b]")
lines.append(
"- Die Kategorie wird in der Statusleiste gewählt und mit der Kür "
+ "gespeichert."
)
lines.append(
"- Gold: max. 5 Sprünge, keine 2F/2Lz/2A/Triple, 3 Pirouetten inkl. "
+ "ChSp, 1 Schrittsequenz, 2:50 ±10 s, Spins bis Level 3, Sequenz bis "
+ "Level 2."
)
lines.append(
"- Silver: max. 4 Einfachsprünge inkl. 1A, 2 Pirouetten, 1 ChSq, "
+ "2:00 ±10 s, Level bis 2."
)
lines.append(
"- Bronze: max. 4 Einfachsprünge ohne Axel, 1 Sprungkombination, "
+ "2 Pirouetten, 1 ChSq, 1:40 ±10 s, Level bis 1."
)
lines.append(
"- PCS-Faktor und Sturzabzug stehen in den Kategorie-Daten "
+ "(Gold 2,67 und 1,0; Silver/Bronze 2,00 und 0,5)."
)
lines.append("")
lines.append("[b][font_size=18]4. Punktschätzung[/font_size][/b]")
lines.append(
"- Basiswert: Summe der Base Values aller Elemente mit gültigem "
+ "Katalogwert."
)
lines.append(
"- PCS-Annahme: Durchschnitt pro Komponente × 3 Komponenten × "
+ "Kategorie-Faktor."
)
lines.append(
"- Der PCS-Durchschnitt ist eine Planungsannahme, kein Judge-Wert. "
+ "Startwert 5,00; er kann über „Annahmen ändern“ angepasst werden."
)
lines.append(
"- Sturzabzug: Anzahl Stürze × Kategorie-Abzug."
)
lines.append(
"- Nicht enthalten: GOE, 1,1-Faktor, nicht katalogisierte "
+ "Kombinationen und die offizielle Wettkampfwertung."
)
lines.append(
"- Beispiel Gold: 5,00 × 3 × 2,67 = 40,05 PCS; Basiswert 9,50; "
+ "geschätzte Summe 49,55."
)
lines.append("")
lines.append("[b][font_size=18]5. Prüfung[/font_size][/b]")
lines.append(
"- Der Button „Prüfen“ zeigt Kürzel-, Level-, Feature- und "
+ "Kategorie-Prüfungen sowie die Punktschätzung."
)
lines.append(
"- Warnungen blockieren Speichern und Export nicht. Sie sind "
+ "Planungshinweise."
)
lines.append(
"- Wiederholungen: max. 2-mal pro gelistetem Sprung; "
+ "Kombinationsbestandteile zählen mit."
)
lines.append("")
lines.append("[b]Tipp:[/b] Für eine realistische PCS-Annahme helfen "
+ "Protokolle früherer Wettkämpfe. Der Durchschnitt sollte zu deinem "
+ "aktuellen Leistungsstand passen, nicht zum Wunschziel.")
lines.append("")
lines.append("[b]Quellen:[/b] ISU Communication 2786 (SoV 2026/27), "
+ "2788 (Levels/GOE 2026/27), IAFSC Technical Announcement 2026/27.")
return I18n.join_lines(lines)

View file

@ -0,0 +1 @@
uid://bpmg0ef1gpgbu

View file

@ -0,0 +1,99 @@
class_name PlaybackPanel
extends Node
## Transport controls of the playback bar: play/pause, reset, the timeline
## slider, the time label and the speed choice.
##
## The panel only shows state and reports intents. The controller owns the
## routine clock, the speed value and the audio, and calls [method set_state]
## whenever time or duration change.
signal toggle_requested
signal reset_requested
signal seek_requested(seconds: float)
signal speed_requested(speed: float)
const PLAY_ICON := preload("res://assets/icons/playback/play.svg")
const PAUSE_ICON := preload("res://assets/icons/playback/pause.svg")
const SPEEDS := [25, 50, 100, 150, 200]
@onready var play_button: Button = %PlayButton
@onready var reset_button: Button = %ResetPlaybackButton
@onready var time_label: Label = %PlaybackTimeLabel
@onready var timeline: HSlider = %PlaybackTimeline
@onready var speed_option: OptionButton = %SpeedOption
var _updating_timeline := false
func setup() -> void:
speed_option.clear()
for percent: int in SPEEDS:
speed_option.add_item(_speed_label(percent), percent)
speed_option.select(speed_option.get_item_index(100))
timeline.min_value = 0.0
timeline.max_value = 0.0
timeline.step = 0.01
timeline.editable = false
play_button.disabled = true
reset_button.disabled = true
play_button.pressed.connect(func() -> void: toggle_requested.emit())
reset_button.pressed.connect(func() -> void: reset_requested.emit())
timeline.value_changed.connect(_on_timeline_changed)
speed_option.item_selected.connect(_on_speed_selected)
## Updates slider, time label and button states for [param time] seconds of a
## [param duration] seconds long routine.
func set_state(time: float, duration: float, playing: bool) -> void:
_updating_timeline = true
timeline.max_value = maxf(duration, 0.0)
timeline.value = clampf(time, 0.0, maxf(duration, 0.0))
_updating_timeline = false
time_label.text = "%s / %s s" % [_seconds(time), _seconds(duration)]
var has_playback := duration > 0.0
play_button.disabled = not has_playback
reset_button.disabled = not has_playback
timeline.editable = has_playback
play_button.text = ""
play_button.icon = PAUSE_ICON if playing else PLAY_ICON
play_button.tooltip_text = "Pause" if playing else "Abspielen"
func set_speed(speed: float) -> void:
var percent := int(roundf(speed * 100.0))
var index := speed_option.get_item_index(percent)
if index >= 0:
speed_option.select(index)
func _on_timeline_changed(value: float) -> void:
if _updating_timeline:
return
seek_requested.emit(value)
func _on_speed_selected(index: int) -> void:
speed_requested.emit(float(speed_option.get_item_id(index)) / 100.0)
static func _speed_label(percent: int) -> String:
match percent:
25:
return "0,25×"
50:
return "0,5×"
150:
return "1,5×"
200:
return "2×"
return "1×" if percent == 100 else "%d×" % (percent / 100)
static func _seconds(value: float) -> String:
return ("%.1f" % value).replace(".", ",")

View file

@ -0,0 +1 @@
uid://s8khec6xpwjv

View file

@ -0,0 +1,160 @@
class_name PlaybackPose
extends RefCounted
## Where the skater is and which way it faces at a given playback time.
##
## Pure: the timed entries and the previous heading go in, position, heading
## and marker scale come out. The controller applies the result to the canvas,
## the 3D preview and the UI, so the timing and geometry logic can be reasoned
## about without a scene.
## Fallback rotation rate for legacy files without a planned revolution count.
const SPIN_REVOLUTIONS_PER_SECOND := 2.5
class Result extends RefCounted:
var found: bool = false
var segment: PathSegment
var position: Vector2 = Vector2.ZERO
var heading: Vector2 = Vector2.RIGHT
var marker_scale: float = 1.0
var section_id: String = ""
var segment_id: String = ""
static func compute(
entries: Array,
time: float,
previous_heading: Vector2,
delta: float,
force_heading: bool = false
) -> Result:
var result := Result.new()
if entries.is_empty():
return result
var entry: Dictionary = entries[entries.size() - 1]
var entry_index := entries.size() - 1
for index: int in range(entries.size()):
var candidate: Dictionary = entries[index]
var candidate_start: float = candidate["start"]
var candidate_duration: float = candidate["duration"]
if time < candidate_start + candidate_duration - 0.0001:
entry = candidate
entry_index = index
break
var segment: PathSegment = entry["segment"]
if segment == null:
return result
var start: float = entry["start"]
var duration: float = entry["duration"]
var local_time := clampf(time - start, 0.0, duration)
var fraction := 0.0 if duration <= 0.0 else local_time / duration
var curve := segment.curve
var length := segment.get_length_m()
var position := Vector2.ZERO
var tangent := Vector2.RIGHT
if curve != null and length > 0.0:
var offset := clampf(fraction, 0.0, 1.0) * length
position = curve.sample_baked(offset)
var epsilon := maxf(0.01, length * 0.01)
var before := curve.sample_baked(maxf(0.0, offset - epsilon))
var after := curve.sample_baked(minf(length, offset + epsilon))
var direction_vector := after - before
if direction_vector.length_squared() > 0.0:
tangent = direction_vector.normalized()
elif curve != null and curve.point_count > 0:
position = curve.get_point_position(0)
var facing := tangent
if segment.direction == PathSegment.Direction.BACKWARD:
facing = -facing
var heading := previous_heading
var marker_scale := 1.0
if segment.is_element_marker():
# Markers have no tangent: keep facing the way the skater arrived. Spins
# and jumps rotate in place, so the heading follows the elapsed stand
# time.
facing = _arrival_heading(entries, entry_index)
var progress := 0.0
if duration > 0.0:
progress = clampf(local_time / duration, 0.0, 1.0)
if segment.element_type == PathSegment.ElementType.SPIN:
var spin_rate := segment.get_spin_revolutions_per_second()
if spin_rate <= 0.0:
# Legacy files without a planned revolution count.
spin_rate = SPIN_REVOLUTIONS_PER_SECOND
heading = facing.rotated(
segment.get_rotation_sign()
* TAU
* spin_rate
* local_time
)
elif segment.element_type == PathSegment.ElementType.JUMP:
# Jumps turn once per revolution in the air; the count is taken from
# the jump code (3Lz = 3, 2A = 2.5). The marker grows towards the
# middle of the air time and travels along the jump vector to the
# landing point.
var jump_vector := segment.element_jump_vector
if jump_vector.length_squared() <= 0.000001:
jump_vector = facing * segment.get_jump_distance_m()
var travel_heading := facing
if jump_vector.length_squared() > 0.000001:
travel_heading = jump_vector.normalized()
heading = travel_heading.rotated(
segment.get_rotation_sign()
* TAU
* segment.get_jump_revolutions()
* progress
)
position += jump_vector * progress
marker_scale = 1.0 + 0.85 * sin(PI * progress)
elif force_heading or heading.length_squared() <= 0.0:
heading = facing
elif force_heading or delta <= 0.0 or heading.length_squared() <= 0.0:
heading = facing
else:
var turn := clampf(delta * 12.0, 0.0, 1.0)
heading = Vector2.from_angle(
lerp_angle(heading.angle(), facing.angle(), turn)
)
result.found = true
result.segment = segment
result.position = position
result.heading = heading
result.marker_scale = marker_scale
result.section_id = str(entry["section_id"])
result.segment_id = segment.segment_id
return result
## Heading with which the skater arrives at the timed entry [param entry_index].
## Walks back to the last entry with a real path so a marker keeps facing the
## direction of travel.
static func _arrival_heading(entries: Array, entry_index: int) -> Vector2:
var index := entry_index - 1
while index >= 0:
var previous: Dictionary = entries[index]
var previous_segment: PathSegment = previous["segment"]
if previous_segment != null:
var length := previous_segment.get_length_m()
if length > 0.0 and previous_segment.curve != null:
var epsilon := maxf(0.01, length * 0.01)
var before := previous_segment.curve.sample_baked(
maxf(0.0, length - epsilon)
)
var end := previous_segment.curve.sample_baked(length)
var direction := end - before
if direction.length_squared() > 0.0:
direction = direction.normalized()
if previous_segment.direction == PathSegment.Direction.BACKWARD:
direction = -direction
return direction
index -= 1
return Vector2.RIGHT

View file

@ -0,0 +1 @@
uid://chf1qjwr1ajff

View file

@ -0,0 +1,45 @@
class_name RoutineManagerModel
extends RefCounted
## What the routine manager lists and deletes.
##
## Pure over a directory: no scene, no sync. A routine may exist as JSON and as
## the legacy `.tres`; the manager shows it once and works on all its variants.
## Routine files of [param dir], one entry per routine, sorted by name.
## JSON wins over the legacy format for the same stem.
static func list_routines(dir: String) -> Array[String]:
var by_stem: Dictionary[String, String] = {}
for file: String in DirAccess.get_files_at(dir):
if not RoutineFile.is_routine_path(file):
continue
var stem := file.get_basename()
var is_json := file.to_lower().ends_with(RoutineFile.JSON_EXTENSION)
if not by_stem.has(stem) or is_json:
by_stem[stem] = file
var entries: Array[String] = []
for file: String in by_stem.values():
entries.append(file)
entries.sort_custom(
func(a: String, b: String) -> bool:
return a.get_basename().naturalnocasecmp_to(b.get_basename()) < 0
)
return entries
## All existing file names of one routine: JSON and/or the legacy `.tres`.
## Falls back to [param file_name] when no variant is on disk.
static func variants(dir: String, file_name: String) -> PackedStringArray:
var stem := file_name.get_basename()
var result := PackedStringArray()
for extension: String in [
RoutineFile.JSON_EXTENSION,
RoutineFile.LEGACY_EXTENSION,
]:
var candidate := stem + extension
if FileAccess.file_exists(dir.path_join(candidate)):
result.append(candidate)
if result.is_empty():
result.append(file_name)
return result

View file

@ -0,0 +1 @@
uid://5q62oxkubssd

View file

@ -0,0 +1,82 @@
class_name RoutineManagerPanel
extends Node
## The "Küren verwalten" dialog: one row per routine plus the conflict tools.
##
## The panel renders rows and reports what the user picked. Opening, renaming,
## deleting and the conflict scan stay with the controller, because they touch
## files, the current routine and the sync state.
signal open_requested(file_name: String)
signal rename_requested(file_name: String)
signal delete_requested(file_name: String)
signal scan_conflicts_requested
signal open_archive_requested
@onready var dialog: AcceptDialog = %RoutineManagerDialog
@onready var list: VBoxContainer = %RoutineManagerList
@onready var scan_button: Button = %ManagerScanConflictsButton
@onready var archive_button: Button = %ManagerOpenArchiveButton
func _ready() -> void:
scan_button.pressed.connect(func() -> void: scan_conflicts_requested.emit())
archive_button.pressed.connect(func() -> void: open_archive_requested.emit())
## Shows the dialog for [param entries] (file names, one per routine).
func open_for(entries: Array[String], size: Vector2i) -> void:
refresh(entries)
dialog.popup_centered(size)
dialog.size = size
## Rebuilds the row list. Safe to call while the dialog is open.
func refresh(entries: Array[String]) -> void:
for child: Node in list.get_children():
list.remove_child(child)
child.free()
for file: String in entries:
list.add_child(_build_row(file))
if entries.is_empty():
var label := Label.new()
label.text = "Keine gespeicherten Kürläufe"
list.add_child(label)
func is_open() -> bool:
return dialog.visible
func close() -> void:
dialog.hide()
func _build_row(file: String) -> HBoxContainer:
var row := HBoxContainer.new()
row.add_theme_constant_override("separation", 8)
var open_button := Button.new()
open_button.text = file.get_basename()
open_button.custom_minimum_size = Vector2(0.0, 48.0)
open_button.size_flags_horizontal = Control.SIZE_EXPAND_FILL
open_button.alignment = HORIZONTAL_ALIGNMENT_LEFT
open_button.clip_text = true
open_button.pressed.connect(func() -> void: open_requested.emit(file))
row.add_child(open_button)
var rename_button := Button.new()
rename_button.text = "Umbenennen"
rename_button.custom_minimum_size = Vector2(132.0, 48.0)
rename_button.pressed.connect(func() -> void: rename_requested.emit(file))
row.add_child(rename_button)
var delete_button := Button.new()
delete_button.text = "Löschen"
delete_button.custom_minimum_size = Vector2(110.0, 48.0)
delete_button.pressed.connect(func() -> void: delete_requested.emit(file))
row.add_child(delete_button)
return row

View file

@ -0,0 +1 @@
uid://bu40o821wuiet

View file

@ -0,0 +1,174 @@
class_name SeasonComparisonText
extends RefCounted
## Text of the season comparison dialog.
##
## Pure formatting: the routine and the comparison report go in, the BBCode
## lines for the RichTextLabel come out. Kept out of the controller so the
## dialog wiring stays readable and the text is testable on its own.
static func build(routine: Routine, report: SeasonUpgradeCheck.Report) -> PackedStringArray:
var lines := PackedStringArray()
var title := routine.title.strip_edges()
if title.is_empty():
title = I18n.t("Unbenannte Kür")
lines.append(
"[b]%s — %s → %s[/b]"
% [
_escape(title),
report.source_season,
report.target_season,
]
)
if not report.has_changes():
lines.append("")
lines.append(
I18n.t("Keine Unterschiede: Die Kür passt in beide Saisons.")
)
_append_group(
routine,
lines,
I18n.t("Elemente"),
report.changes_of(SeasonUpgradeCheck.KIND_MISSING_CODE),
I18n.t("nicht im Katalog")
)
_append_group(
routine,
lines,
I18n.t("Base Values"),
report.changes_of(SeasonUpgradeCheck.KIND_VALUE_CHANGE)
)
_append_group(
routine,
lines,
I18n.t("Elementtyp"),
report.changes_of(SeasonUpgradeCheck.KIND_TYPE_CHANGE)
)
_append_group(
routine,
lines,
I18n.t("Features"),
report.changes_of(SeasonUpgradeCheck.KIND_UNKNOWN_FEATURE),
I18n.t("in der Ziel-Saison unbekannt")
)
_append_group(
routine,
lines,
I18n.t("Level"),
report.changes_of(SeasonUpgradeCheck.KIND_LEVEL_CHANGE)
)
_append_group(
routine,
lines,
I18n.t("Kategorie"),
report.changes_of(SeasonUpgradeCheck.KIND_CATEGORY_CHANGE)
)
var missing_category := report.changes_of(
SeasonUpgradeCheck.KIND_CATEGORY_MISSING
)
if not missing_category.is_empty():
lines.append("")
lines.append("[b]%s[/b]" % I18n.t("Kategorie"))
lines.append(
"● %s: %s"
% [
_escape(missing_category[0].label),
I18n.t("in der Ziel-Saison nicht vorhanden"),
]
)
lines.append("")
lines.append("[b]%s[/b]" % I18n.t("Summe"))
if report.base_value_before > 0.0 or report.base_value_after > 0.0:
lines.append(
I18n.t("Basiswert %s → %s (%s%s)")
% [
_base_value(report.base_value_before),
_base_value(report.base_value_after),
"+" if report.value_delta() >= 0.0 else "−",
_base_value(absf(report.value_delta())),
]
)
else:
lines.append(I18n.t("Keine Elemente mit Base Value."))
if not report.issues.is_empty():
lines.append("")
lines.append(
"[b]%s[/b]" % I18n.t("Befunde bei Prüfung gegen %s") % report.target_season
)
for issue: ValidationIssue in report.issues:
var color := (
"#ef4444"
if issue.severity == ValidationIssue.Severity.ERROR
else "#f59e0b"
)
lines.append(
"[color=%s]●[/color] %s%s"
% [
color,
_escape(issue.message),
_location(routine, issue.section_id),
]
)
return lines
static func _append_group(
routine: Routine,
lines: PackedStringArray,
title: String,
changes: Array,
suffix: String = ""
) -> void:
if changes.is_empty():
return
lines.append("")
lines.append("[b]%s[/b]" % title)
for change: SeasonUpgradeCheck.Change in changes:
var text := _escape(change.label)
if change.kind == SeasonUpgradeCheck.KIND_MISSING_CODE:
text += ": " + I18n.t("nicht im Katalog")
elif change.kind == SeasonUpgradeCheck.KIND_UNKNOWN_FEATURE:
text += ": %s — %s" % [
I18n.t("Feature"),
_escape(change.before),
]
if not suffix.is_empty():
text += " " + suffix
elif change.kind == SeasonUpgradeCheck.KIND_CATEGORY_CHANGE:
text = "%s: %s → %s" % [
_escape(change.label),
_escape(change.before),
_escape(change.after),
]
elif change.after.is_empty():
text += ": " + _escape(change.before)
else:
text += ": %s → %s" % [
_escape(change.before),
_escape(change.after),
]
text += _location(routine, change.section_id)
lines.append("● %s" % text)
static func _location(routine: Routine, section_id: String) -> String:
if section_id.is_empty() or routine == null:
return ""
if routine.sections.size() < 2:
return ""
var section := routine.get_section_by_id(section_id)
if section == null:
return ""
return " (%s)" % I18n.section_title(section.title)
static func _escape(text: String) -> String:
return text.replace("[", "[lb]")
static func _base_value(value: float) -> String:
return ("%.2f" % value).replace(".", ",")

View file

@ -0,0 +1 @@
uid://boq3jg287aydi

View file

@ -0,0 +1,93 @@
class_name SeasonPanelModel
extends RefCounted
## Content of the three status bar dropdowns: season, programme type and adult
## category.
##
## Pure functions: they build labels and metadata, but never touch a node. The
## controller fills its OptionButtons from the result and keeps the signal
## wiring. Returns `{"items": [{"label": String, "value": String}], "selected": int}`.
const NO_CATEGORY := "Ohne Kategorie"
static func season_items(current: String, library: RulesLibrary) -> Dictionary:
var items: Array[Dictionary] = []
var selected := -1
var cleaned := current.strip_edges()
if cleaned.is_empty():
items.append({"label": I18n.t("Saison nicht festgelegt"), "value": ""})
selected = 0
if library != null:
for season: String in library.get_seasons():
var label := I18n.t("Saison %s") % season
var status := str(
library.get_manifest(season).get("status", "complete")
).strip_edges()
if status != "complete":
label += " " + I18n.t("(unvollständig)")
items.append({"label": label, "value": season})
if season == cleaned:
selected = items.size() - 1
if not cleaned.is_empty() and selected < 0:
items.append(
{
"label": I18n.t("Saison %s (unbekannt)") % cleaned,
"value": cleaned,
}
)
selected = items.size() - 1
return {"items": items, "selected": selected}
static func program_items(current: String) -> Dictionary:
var items: Array[Dictionary] = [
{"label": I18n.t("Kür"), "value": AdultCategoryRules.PROGRAM_FREE},
{"label": I18n.t("Artistic"), "value": AdultCategoryRules.PROGRAM_ARTISTIC},
]
var selected := 0
for index: int in range(items.size()):
if str(items[index]["value"]) == current:
selected = index
return {"items": items, "selected": selected}
## Categories of one programme type plus "no category". A stored code that the
## season does not know stays visible as "nicht verfügbar" instead of silently
## selecting "no category".
static func category_items(
current: String,
categories: Array
) -> Dictionary:
var items: Array[Dictionary] = [{"label": NO_CATEGORY, "value": ""}]
var cleaned := current.strip_edges()
for category: AdultCategoryRules.Category in categories:
items.append({"label": category.name, "value": category.code})
for index: int in range(items.size()):
if str(items[index]["value"]) == cleaned:
return {"items": items, "selected": index}
if not cleaned.is_empty():
items.append(
{
"label": I18n.t("Kategorie „%s“ nicht verfügbar") % cleaned.capitalize(),
"value": cleaned,
}
)
return {"items": items, "selected": items.size() - 1}
return {"items": items, "selected": 0}
static func season_tooltip(current: String, inferred: String) -> String:
if not current.strip_edges().is_empty():
return I18n.t("Regelwerk, gegen das diese Kür geprüft wird")
var base := I18n.t("Ohne Saison kann die Kür nicht geprüft werden")
if inferred.is_empty():
return base
return base + " " + I18n.t("Vermutlich Saison %s (Dateidatum).") % inferred

View file

@ -0,0 +1 @@
uid://cpd3460lrabou

View file

@ -0,0 +1,33 @@
class_name SyncSettingsModel
extends RefCounted
## Content of the sync provider dropdown.
##
## Pure: the app configuration goes in, the list of selectable providers comes
## out. Google Drive only appears when the build carries OAuth credentials;
## Dropbox always appears, even without credentials, so a developer build shows
## the missing configuration instead of an empty dropdown.
const PROVIDERS := [
{"id": "dropbox", "label": "Dropbox", "always": true},
{"id": "google_drive", "label": "Google Drive", "always": false},
]
## Returns `[{"label": String, "value": String}]`.
static func provider_items(app: Dictionary) -> Array[Dictionary]:
var items: Array[Dictionary] = []
for provider: Dictionary in PROVIDERS:
var id := str(provider["id"])
if not bool(provider["always"]) and not SyncAppConfig.is_configured(id, app):
continue
items.append({"label": str(provider["label"]), "value": id})
return items
## Index of [param provider] in a list built by [method provider_items], or -1.
static func index_of(items: Array, provider: String) -> int:
for index: int in range(items.size()):
if str((items[index] as Dictionary).get("value", "")) == provider:
return index
return -1

View file

@ -0,0 +1 @@
uid://dycuog2mepmfp

View file

@ -0,0 +1,58 @@
class_name SyncSummaryText
extends RefCounted
## Text of the sync result dialog ("Synchronisierung").
##
## Pure: the result dictionary of a sync job goes in, the lines come out. The
## controller only sets the label, which keeps this formatting testable without
## a scene.
static func format(result: Dictionary) -> String:
var uploaded: Array = result.get("uploaded", [])
var downloaded: Array = result.get("downloaded", [])
var resolved: Array = result.get("resolved", [])
var skipped: Array = result.get("skipped", [])
var errors: Array = result.get("errors", [])
var lines := PackedStringArray()
lines.append("Hochgeladen: %d" % uploaded.size())
if not uploaded.is_empty():
lines.append(" " + ", ".join(uploaded))
lines.append("Heruntergeladen: %d" % downloaded.size())
if not downloaded.is_empty():
lines.append(" " + ", ".join(downloaded))
lines.append(I18n.t("Automatisch aufgelöste Konflikte: %d") % resolved.size())
for entry: Dictionary in resolved:
lines.append(" " + _resolved_line(entry))
if not resolved.is_empty():
lines.append(
" Ältere Fassungen liegen im Konfliktarchiv "
+ "(Datei → Konfliktarchiv öffnen)."
)
if not skipped.is_empty():
lines.append(I18n.t("Unverändert: %d") % skipped.size())
if not errors.is_empty():
lines.append("")
lines.append("Fehler:")
for message: String in errors:
lines.append(" " + message)
return "\n".join(lines)
static func _resolved_line(entry: Dictionary) -> String:
var winner := (
"Cloud-Fassung"
if str(entry.get("winner", "")) == "cloud"
else "lokale Fassung"
)
var moment := int(entry.get("timestamp", 0))
var when := (
SyncPlan.timestamp_label(moment)
if moment > 0
else "Zeit unbekannt"
)
return "%s – %s vom %s übernommen" % [
str(entry.get("name", "")),
winner,
when,
]

View file

@ -0,0 +1 @@
uid://b8j6xkdhtcai

View file

@ -0,0 +1,53 @@
class_name TimelineLabelModel
extends RefCounted
## Collects the labels shown on the playback timeline.
##
## Pure: the routine goes in, the two label lists and the total duration come
## out. Walks the authored sections (not the timed playback entries), so
## element markers with zero stand time stay visible. A segment without its own
## label falls back to the caption of its element group, so a sequence group is
## named once.
## Returns `{"elements": Array, "custom": Array, "duration": float}`. Each
## entry is `{"time_seconds": float, "text": String}`.
static func collect(routine: Routine) -> Dictionary:
var element_labels: Array[Dictionary] = []
var total := 0.0
if routine != null:
for section: RoutineSection in routine.sections:
if section == null:
continue
var group_starts: Dictionary[String, ResolvedElement] = {}
for element: ResolvedElement in section.get_elements():
if not element.segments.is_empty():
group_starts[element.segments[0].segment_id] = element
for segment: PathSegment in section.segments:
if segment == null:
continue
var text := segment.label.strip_edges()
if text.is_empty() and group_starts.has(segment.segment_id):
text = group_starts[segment.segment_id].get_caption().strip_edges()
if not text.is_empty():
element_labels.append({
"time_seconds": total,
"text": text,
})
total += maxf(segment.get_effective_duration_seconds(), 0.0)
var custom_labels: Array[Dictionary] = []
if routine != null:
for entry: Dictionary in routine.timeline_labels:
var text := str(entry.get("text", "")).strip_edges()
if text.is_empty():
continue
custom_labels.append({
"time_seconds": float(entry.get("time_seconds", 0.0)),
"text": text,
})
return {
"elements": element_labels,
"custom": custom_labels,
"duration": total,
}

View file

@ -0,0 +1 @@
uid://bi7a47b46qnej

View file

@ -0,0 +1,313 @@
class_name ValidationReportView
extends RefCounted
## Text of the validation dialog ("Kür prüfen").
##
## Pure formatting: routine, report and the resolved category go in, the
## BBCode lines for the RichTextLabel come out. The controller owns the dialog
## and the view options (what is expanded); the text itself lives here so it
## can be reasoned about and tested without a scene.
static func build(
routine: Routine,
report: ValidationReport,
category: AdultCategoryRules.Category,
context: Dictionary
) -> PackedStringArray:
var show_info := bool(context.get("show_info", false))
var show_assumptions := bool(context.get("show_assumptions", false))
var errors := RoutineValidator.count_severity(
report.issues,
ValidationIssue.Severity.ERROR
)
var warnings := RoutineValidator.count_severity(
report.issues,
ValidationIssue.Severity.WARNING
)
var lines := PackedStringArray()
lines.append(
"[b]Geprüft: %s in %s (Saison %s)[/b]"
% [
_element_count_label(report.element_count),
_section_count_label(report.section_count),
str(context.get("season", "")),
]
)
var season_note := str(context.get("season_note", ""))
if not season_note.is_empty():
lines.append("[color=#e0b050]%s[/color]" % season_note)
if bool(context.get("can_compare", false)):
lines.append(
"[url=upgrade][color=#60a5fa]%s[/color][/url]"
% I18n.t("ⓘ Gegen andere Saison prüfen …")
)
var category_name := "Ohne Kategorie"
if category != null:
category_name = "%s · %s · %s ±%d s" % [
category.name,
_program_label(category.program_type),
_clock(category.duration_seconds),
category.duration_tolerance_seconds,
]
lines.append("[b]Kategorie: %s[/b]" % category_name)
lines.append("")
lines.append(
"[b]Basiswert: %s[/b]" % _base_value(report.base_value_total)
)
var scored_text := (
"%d von %d Elementen gewertet"
% [report.scored_elements, report.element_count]
)
if report.unscored_elements > 0:
scored_text += " · %d ohne Base Value" % report.unscored_elements
lines.append(scored_text)
var info_label := (
"ⓘ Details ausblenden" if show_info else "ⓘ Was ist enthalten?"
)
lines.append(
"[color=#94a3b8]Nur Base Values · [/color][url=score_info][color=#60a5fa]%s[/color][/url]"
% info_label
)
if show_info:
lines.append("")
lines.append_array(_score_info_lines())
if category != null and category.scored:
var pcs_total := (
routine.assumed_pcs_average * 3.0 * category.pcs_factor
)
var deduction := float(routine.assumed_falls) * category.fall_deduction
var estimated := report.base_value_total + pcs_total - deduction
lines.append("")
lines.append("[b]Punktschätzung[/b]")
lines.append(
"PCS-Annahme: %s × 3 × %s = %s"
% [
_base_value(routine.assumed_pcs_average),
_base_value(category.pcs_factor),
_base_value(pcs_total),
]
)
lines.append(
"Sturzabzug: %d × %s = -%s"
% [
routine.assumed_falls,
_base_value(category.fall_deduction),
_base_value(deduction),
]
)
lines.append(
I18n.t("[b]Geschätzte Summe: %s[/b]") % _base_value(estimated)
)
var assumptions_label := (
"ⓘ Annahmen ausblenden"
if show_assumptions
else "ⓘ Annahmen ändern"
)
lines.append(
"[url=score_assumptions][color=#60a5fa]%s[/color][/url]"
% assumptions_label
)
elif category != null:
lines.append("")
lines.append("[b]Punktschätzung[/b]")
lines.append(
"[color=#94a3b8]%s[/color]"
% I18n.t(
"Artistic wird nur über die Programmkomponenten bewertet; keine Punktschätzung."
)
)
else:
lines.append(
"[color=#94a3b8]PCS und Abzüge: Kategorie wählen.[/color]"
)
if not report.element_values.is_empty():
lines.append("")
lines.append("[b]Wertung[/b]")
for entry: Dictionary in report.element_values:
var value: float = entry["value"]
var value_text := (
"—" if value < 0.0 else _base_value(value)
)
lines.append(
"%s — %s"
% [_escape(str(entry["label"])), value_text]
)
lines.append("")
lines.append("[b]Prüfungen[/b]")
for check: ValidationCheck in report.checks:
lines.append(_check_line(check))
lines.append("")
lines.append("[b]Befunde[/b]")
if report.issues.is_empty():
if report.element_count == 0:
lines.append("Keine Elemente vorhanden.")
else:
lines.append("Keine Befunde.")
else:
lines.append(
"[b]%d Fehler, %d Warnungen[/b]" % [errors, warnings]
)
for issue: ValidationIssue in report.issues:
var color := (
"#ef4444"
if issue.severity == ValidationIssue.Severity.ERROR
else "#f59e0b"
)
lines.append(
"[color=%s]●[/color] [b]%s[/b]%s: %s"
% [
color,
issue.severity_label(),
_location(routine, issue),
_escape(issue.message),
]
)
return lines
static func _score_info_lines() -> PackedStringArray:
var lines := PackedStringArray()
lines.append("[b]Enthalten[/b]")
lines.append("- Base Value jedes Elements aus Katalog und gewähltem Level")
lines.append("- ChSq und ChSp mit festem Level 1")
lines.append("- strukturierte Sprungkombinationen als Summe ihrer Sprünge")
lines.append("- nur Elemente mit gültigem Katalogwert")
lines.append("")
lines.append("[b]Nicht im Basiswert enthalten[/b]")
lines.append("- GOE / Ausführungsqualität")
lines.append("- 1,1-Faktor für Sprünge in der zweiten Programmhälfte")
lines.append("- Programmkomponenten (PCS)")
lines.append("- Abzüge (Stürze, Zeitüberschreitungen usw.)")
lines.append("- nicht katalogisierte Kombinationen und Freitext-Codes")
lines.append("- Programmtyp und Adult-spezifische Sonderregeln")
lines.append("")
lines.append(
"[b]Punktschätzung[/b]\nPCS und Sturzabzug werden separat in der "
+ "Punktschätzung angesetzt."
)
lines.append("")
lines.append(
"[b]Ergebnis[/b]\nDer Basiswert ist ein technischer Wert, keine "
+ "vorhergesagte Gesamtpunktzahl."
)
return lines
static func _check_line(check: ValidationCheck) -> String:
var color := "#22c55e"
var icon := "✓"
var detail := check.summary()
if check.is_skipped():
color = "#64748b"
icon = "–"
detail = I18n.t("nicht anwendbar (%s)") % _skip_reason(check.code)
elif check.findings > 0:
color = "#ef4444" if check.errors > 0 else "#f59e0b"
icon = "✗"
var findings := PackedStringArray()
if check.errors > 0:
findings.append("%d Fehler" % check.errors)
if check.warnings > 0:
findings.append(
"%d Warnung%s"
% [check.warnings, "" if check.warnings == 1 else "en"]
)
if not findings.is_empty():
detail += " · " + " · ".join(findings)
return "[color=%s]%s[/color] %s — %s" % [
color,
icon,
_escape(check.label),
detail,
]
static func _skip_reason(check_code: String) -> String:
if check_code.begins_with("category"):
return "keine Kategorie oder keine passenden Elemente"
match check_code:
"code":
return "keine Elemente"
"type":
return "kein Kürzel im Katalog"
"level":
return "kein passendes Kürzel"
"fixed_level":
return "kein ChSq"
"features", "required", "level_features":
return "keine Features gesetzt"
"once":
return "keine Einmal-Features gesetzt"
"jump_sequence":
return "keine Sprungfolge"
return "keine passenden Daten"
static func _location(routine: Routine, issue: ValidationIssue) -> String:
var parts := PackedStringArray()
if not issue.section_id.is_empty():
var section := (
routine.get_section_by_id(issue.section_id) if routine != null else null
)
parts.append(
"Abschnitt „%s“"
% (I18n.section_title(section.title) if section != null else issue.section_id)
)
if not issue.segment_id.is_empty():
var segment := _find_segment(routine, issue.segment_id)
if segment != null and segment.is_element():
var label := segment.element_code.strip_edges()
if label.is_empty():
label = PathSegment.element_type_name(segment.element_type)
parts.append("Element „%s“" % label)
else:
parts.append(issue.segment_id)
if parts.is_empty():
return ""
return " (%s)" % " · ".join(parts)
static func _find_segment(routine: Routine, segment_id: String) -> PathSegment:
if routine == null or segment_id.is_empty():
return null
for section: RoutineSection in routine.sections:
if section == null:
continue
var segment := section.get_segment_by_id(segment_id)
if segment != null:
return segment
return null
static func _element_count_label(count: int) -> String:
return "1 Element" if count == 1 else "%d Elemente" % count
static func _section_count_label(count: int) -> String:
return "1 Abschnitt" if count == 1 else "%d Abschnitten" % count
static func _program_label(program_type: String) -> String:
if program_type == AdultCategoryRules.PROGRAM_ARTISTIC:
return I18n.t("Artistic")
return I18n.t("Kür")
static func _clock(seconds: int) -> String:
return "%d:%02d" % [seconds / 60, seconds % 60]
static func _base_value(value: float) -> String:
return ("%.2f" % value).replace(".", ",")
static func _escape(text: String) -> String:
return text.replace("[", "[lb]")

View file

@ -0,0 +1 @@
uid://4shkok0ey0x3

View file

@ -0,0 +1,95 @@
extends SceneTree
## Erzeugt eine Beispieldatei zum Prüfen des Ausdrucks. Nicht Teil der Tests.
const PathSegmentModel := preload("res://src/core/model/path_segment.gd")
func _init() -> void:
_run.call_deferred()
func _run() -> void:
var routine := Routine.new()
routine.routine_id = "print-sample"
routine.title = "Kür Testdruck"
routine.skater_name = "Erika Mustermann"
routine.adult_category = "gold"
routine.season = "2026/27"
routine.rink = RinkDimensions.new()
_add_section(routine, "Start", 0, [
{"from": Vector2(-18.0, -6.0), "to": Vector2(-6.0, 2.0), "kind": "jump", "code": "1A", "label": "Auftakt"},
{"from": Vector2(-6.0, 2.0), "to": Vector2(6.0, 6.0), "kind": "spin", "code": "CCoSp", "label": "Pirouette"},
{"from": Vector2(6.0, 6.0), "to": Vector2(14.0, 0.0), "kind": "plain", "code": "", "label": ""},
], 26.0)
_add_section(routine, "Abschnitt 2", 1, [
{"from": Vector2(14.0, 0.0), "to": Vector2(0.0, -8.0), "kind": "jump", "code": "3Lz", "label": "Kombination"},
{"from": Vector2(0.0, -8.0), "to": Vector2(-12.0, -4.0), "kind": "plain", "code": "", "label": "Übergang"},
], 24.0)
_add_section(routine, "Step Seq Absch.", 2, [
{"from": Vector2(-12.0, -4.0), "to": Vector2(-2.0, 4.0), "kind": "sequence", "code": "StSq", "label": ""},
{"from": Vector2(-2.0, 4.0), "to": Vector2(10.0, 2.0), "kind": "plain", "code": "", "label": ""},
], 22.0)
_add_section(routine, "Abschnitt 4", 3, [
{"from": Vector2(10.0, 2.0), "to": Vector2(2.0, 8.0), "kind": "jump", "code": "2T", "label": "Finale"},
{"from": Vector2(2.0, 8.0), "to": Vector2(-14.0, 2.0), "kind": "plain", "code": "", "label": ""},
], 22.7)
routine.timeline_labels = [
{"time_seconds": 5.0, "text": "Musikstart"},
{"time_seconds": 60.0, "text": "Höhepunkt"},
]
var pdf := RoutinePdfExporter.build(routine)
if pdf.is_empty():
printerr("PDF leer")
quit(1)
return
var path := "user://print-sample.pdf"
var file := FileAccess.open(path, FileAccess.WRITE)
file.store_buffer(pdf)
file.close()
print("PDF: ", ProjectSettings.globalize_path(path))
quit(0)
func _add_section(
routine: Routine,
title: String,
order: int,
entries: Array,
seconds: float
) -> void:
var section := RoutineSection.new()
section.section_id = "section-%03d" % (order + 1)
section.title = title
section.sequence_order = order
var share := seconds / maxf(float(entries.size()), 1.0)
for entry: Dictionary in entries:
var segment := PathSegment.new()
segment.segment_id = "seg-%s-%d" % [section.section_id, section.segments.size()]
var curve := Curve2D.new()
curve.add_point(entry["from"])
curve.add_point((entry["from"] + entry["to"]) * 0.5 + Vector2(0.0, -3.0))
curve.add_point(entry["to"])
segment.curve = curve
segment.direction = PathSegment.Direction.FORWARD
segment.edge = PathSegment.Edge.OUTSIDE
segment.label = entry["label"]
if not str(entry["code"]).is_empty():
match str(entry["kind"]):
"jump":
segment.set_element(PathSegment.ElementType.JUMP, entry["code"], 0)
"spin":
segment.set_element(PathSegment.ElementType.SPIN, entry["code"], 3)
segment.set_element_features(
PackedStringArray(["difficult_variation_sit", "difficult_exit"])
)
"sequence":
segment.set_element(PathSegment.ElementType.SEQUENCE, entry["code"], 2)
segment.apply_geometry_length(segment.get_length_m())
segment.duration_seconds = share
segment.timing_mode = PathSegment.TimingMode.DURATION
section.segments.append(segment)
routine.sections.append(section)

View file

@ -0,0 +1,131 @@
extends SceneTree
## Headless test for `ExportPanel` on its own.
##
## No WhiteboardController, no routine scene: the panel is instantiated from
## `scenes/export/export_panel.tscn` and reports its choices through signals.
## This is the measure of whether the module is really separate.
##
## Run with:
## godot --headless --path rinkplanner --script res://tests/run_export_panel_tests.gd
const PanelScene := preload("res://scenes/export/export_panel.tscn")
var _assertions: int = 0
var _failures: PackedStringArray = PackedStringArray()
func _init() -> void:
_run.call_deferred()
func _run() -> void:
var panel := PanelScene.instantiate() as ExportPanel
_check(panel != null, "the panel scene carries its script")
if panel == null:
_finish()
return
# Without a window size, popup_centered places dialogs at negative offsets
# in headless runs; give the root window a sane size.
root.size = Vector2i(1280, 800)
root.add_child(panel)
await process_frame
_check(
panel.dialog != null and panel.done_dialog != null,
"both dialogs are wired"
)
_check(
panel.format_option.item_count == 3,
"three export formats are offered"
)
var routine := Routine.new()
routine.routine_id = "panel-test"
routine.title = "Kür am See"
routine.rink = RinkDimensions.new()
var section := RoutineSection.new()
section.section_id = "s1"
section.title = "Abschnitt 1"
# Lambdas capture by value: mutate the dictionary instead of rebinding it.
var captured: Dictionary = {}
panel.export_requested.connect(
func(
path: String,
format: int,
section_id: String,
open_after: bool
) -> void:
captured["path"] = path
captured["format"] = format
captured["section_id"] = section_id
captured["open_after"] = open_after
)
panel.open_for(routine, section, Vector2i(480, 520))
_check(panel.dialog.visible, "the dialog opens")
_check(panel.name_edit.text == "Kür am See", "the routine title fills the name")
panel.dialog.confirmed.emit()
_check(
str(captured.get("path", "")).ends_with("kür_am_see.svg"),
"the default format is SVG with a clean file stem (%s)"
% captured.get("path", "")
)
_check(int(captured.get("format", -1)) == 0, "the format id is passed")
_check(
str(captured.get("section_id", "x")).is_empty(),
"the whole routine is the default scope"
)
panel.scope_option.select(1)
panel.format_option.select(2)
captured.clear()
panel.dialog.confirmed.emit()
_check(int(captured.get("format", -1)) == 2, "the PDF format is passed")
_check(
str(captured.get("path", "")).ends_with("_abschnitt_1.pdf"),
"the section suffix is added (%s)" % captured.get("path", "")
)
_check(
str(captured.get("section_id", "")) == "s1",
"the section id is passed"
)
var messages: Array = []
panel.message_requested.connect(
func(text: String) -> void:
messages.append(text)
)
panel.name_edit.text = " "
captured.clear()
panel.dialog.confirmed.emit()
_check(captured.is_empty(), "an empty name does not export")
_check(not messages.is_empty(), "an empty name asks for input")
# The done dialog only enables "open" for an existing file.
panel.show_done("/tmp/does-not-exist.pdf", Vector2i(660, 320))
_check(panel.open_button.disabled, "missing files cannot be opened")
_check(panel.done_dialog.visible, "the done dialog opens")
panel.queue_free()
await process_frame
_finish()
func _check(condition: bool, message: String) -> void:
_assertions += 1
if not condition:
_failures.append(message)
func _finish() -> void:
if _failures.is_empty():
print("PASS: %d assertions" % _assertions)
quit(0)
return
for failure: String in _failures:
printerr("FAIL: %s" % failure)
printerr("%d of %d assertions failed" % [_failures.size(), _assertions])
quit(1)

View file

@ -0,0 +1 @@
uid://b6r15yds80ibm

View file

@ -106,6 +106,23 @@ func _run() -> void:
"the second section excludes the spin of section one"
)
# ExportService: Pfadbildung, Namensbereinigung und Schreiben.
_check(
ExportService.build_path("kuer", "_gold", "pdf").ends_with("kuer_gold.pdf"),
"the export path carries stem, suffix and extension"
)
_check(
ExportService.normalize_stem("Kür 2026/27: Gold?").begins_with("kür_2026"),
"the file stem drops forbidden characters"
)
var service_path := ExportService.build_path("service_test", "", "pdf")
_check(ExportService.write_pdf(routine, service_path), "the service writes a PDF")
_check(
FileAccess.file_exists(service_path),
"the written PDF exists"
)
DirAccess.remove_absolute(service_path)
var pdf := RoutinePdfExporter.build(routine)
var pdf_text := pdf.get_string_from_ascii()
_check(pdf.size() > 1000, "PDF export produces data")
@ -134,6 +151,83 @@ func _run() -> void:
pdf_text.contains("Test & <K\\374r>"),
"PDF export encodes umlauts as WinAnsi escapes"
)
# Saison-Vergleich als PDF: eigener Bericht, gleiche PDF-Bausteine.
var library := RulesLibrary.scan()
var current := library.get_package("2026/27")
var older := library.get_package("2025/26")
if current != null and older != null:
var comparison_routine := Routine.new()
comparison_routine.routine_id = "upgrade-pdf"
comparison_routine.title = "Vergleich"
comparison_routine.rink = RinkDimensions.new()
comparison_routine.season = "2026/27"
comparison_routine.adult_category = "gold"
var comparison_section := RoutineSection.new()
comparison_section.section_id = "section-upgrade"
comparison_section.title = "Abschnitt 1"
comparison_section.sequence_order = 0
var marker := _make_segment(
"seg-upgrade",
Vector2(0.0, 0.0),
Vector2(0.0, 0.0),
PathSegment.Direction.FORWARD,
PathSegment.Edge.INSIDE
)
marker.set_element(PathSegment.ElementType.SPIN, "ChSp", 1)
comparison_section.segments.append(marker)
comparison_routine.sections.append(comparison_section)
var report := SeasonUpgradeCheck.run(
comparison_routine,
current,
older
)
var comparison_pdf := RoutinePdfExporter.build_season_comparison(
comparison_routine,
report
)
var comparison_text := comparison_pdf.get_string_from_ascii()
_check(comparison_pdf.size() > 1000, "the comparison PDF produces data")
_check(
comparison_text.begins_with("%PDF-1.4"),
"the comparison PDF has a PDF header"
)
_check(
comparison_text.contains("Saison-Vergleich"),
"the comparison PDF has its own title"
)
_check(
comparison_text.contains("nicht im Katalog"),
"the comparison PDF names the missing element"
)
_check(
comparison_text.contains("2026/27") and comparison_text.contains("2025/26"),
"the comparison PDF names both seasons"
)
_check(
comparison_text.contains("Basiswert"),
"the comparison PDF sums the base values"
)
# Die PDF-Texte folgen der Sprache der Oberfläche.
AppSettings.apply_locale("en")
var english_pdf := (
RoutinePdfExporter.build(routine).get_string_from_ascii()
)
var english_comparison := (
RoutinePdfExporter.build_season_comparison(comparison_routine, report)
.get_string_from_ascii()
)
AppSettings.apply_locale("de")
_check(
english_pdf.contains("Duration") and english_pdf.contains("Section"),
"PDF table labels follow the interface language"
)
_check(
english_comparison.contains("not in the catalog"),
"the comparison PDF follows the interface language"
)
_check(
pdf_text.contains(" c") or pdf_text.contains(" l"),
"PDF export contains vector path operators"
@ -201,12 +295,12 @@ func _run() -> void:
return
_check(
controller.export_format_option.item_count == 3
and controller.export_format_option.get_item_text(2).contains("PDF"),
controller.export_panel.format_option.item_count == 3
and controller.export_panel.format_option.get_item_text(2).contains("PDF"),
"export dialog offers the PDF format"
)
_check(
controller.export_open_after_check.button_pressed,
controller.export_panel.open_after_check.button_pressed,
"export dialog opens the result by default"
)
@ -216,7 +310,7 @@ func _run() -> void:
await process_frame
controller._open_export_dialog()
await process_frame
var export_dialog := controller.export_dialog
var export_dialog := controller.export_panel.dialog
var scroll := export_dialog.get_node("ExportScroll") as ScrollContainer
var ok_button := export_dialog.get_ok_button()
_check(
@ -279,21 +373,21 @@ func _run() -> void:
controller._last_export_path = ProjectSettings.globalize_path(pdf_path)
controller._show_export_done()
_check(
controller.export_done_dialog.visible,
controller.export_panel.done_dialog.visible,
"export completion dialog opens"
)
_check(
controller.export_done_label.text.contains(
controller.export_panel.done_label.text.contains(
ProjectSettings.globalize_path(pdf_path)
),
"export completion dialog shows the absolute path"
)
_check(
not controller.export_open_button.disabled
and not controller.export_folder_button.disabled,
not controller.export_panel.open_button.disabled
and not controller.export_panel.folder_button.disabled,
"export completion dialog enables open and folder buttons"
)
controller.export_done_dialog.hide()
controller.export_panel.done_dialog.hide()
DirAccess.remove_absolute(pdf_path)
_check(

View file

@ -32,8 +32,8 @@ func _run() -> void:
return
_check_approx(controller.get_playback_duration(), 0.0, "empty routine has no duration")
_check(controller.play_button.disabled, "play is disabled without segments")
_check(controller.playback_timeline.editable == false, "timeline is disabled without segments")
_check(controller.playback_panel.play_button.disabled, "play is disabled without segments")
_check(controller.playback_panel.timeline.editable == false, "timeline is disabled without segments")
var section_one := controller.get_active_section()
var forward := controller.add_segment(
@ -62,10 +62,10 @@ func _run() -> void:
controller._update_status()
_check_approx(controller.get_playback_duration(), 6.0, "duration sums all sections")
_check(not controller.play_button.disabled, "play is enabled with segments")
_check(controller.playback_timeline.editable, "timeline is enabled with segments")
_check(not controller.playback_panel.play_button.disabled, "play is enabled with segments")
_check(controller.playback_panel.timeline.editable, "timeline is enabled with segments")
_check_approx(
controller.playback_timeline.max_value,
controller.playback_panel.timeline.max_value,
6.0,
"timeline covers the whole routine"
)
@ -80,7 +80,7 @@ func _run() -> void:
"selecting a section moves the playback to its start"
)
_check_approx(
controller.playback_timeline.value,
controller.playback_panel.timeline.value,
4.0,
"timeline slider jumps to the section start"
)
@ -101,7 +101,7 @@ func _run() -> void:
"switching back moves the playback to the first section"
)
_check_approx(
controller.playback_timeline.value,
controller.playback_panel.timeline.value,
0.0,
"timeline slider returns to the first section"
)
@ -199,20 +199,20 @@ func _run() -> void:
"faded section banner has no alpha"
)
controller.play_button.pressed.emit()
controller.playback_panel.play_button.pressed.emit()
_check(controller.is_playing(), "play button starts playback")
controller.play_button.pressed.emit()
controller.playback_panel.play_button.pressed.emit()
_check(not controller.is_playing(), "play button pauses playback")
controller.play()
_check(controller.is_playing(), "play starts playback")
_check(controller.play_button.icon == PAUSE_ICON, "play button switches to pause")
_check(controller.playback_panel.play_button.icon == PAUSE_ICON, "play button switches to pause")
controller.advance_playback(0.5)
_check_approx(controller.get_playback_time(), 5.5, "playback advances by delta")
controller.advance_playback(1.0)
_check(not controller.is_playing(), "playback stops at the end")
_check_approx(controller.get_playback_time(), 6.0, "playback ends at the total duration")
_check(controller.play_button.icon == PLAY_ICON, "play button switches back after the end")
_check(controller.playback_panel.play_button.icon == PLAY_ICON, "play button switches back after the end")
controller.play()
_check_approx(
@ -223,21 +223,21 @@ func _run() -> void:
_check(controller.is_playing(), "restarted playback is running")
controller.pause()
_check(not controller.is_playing(), "pause stops playback")
controller.reset_playback_button.pressed.emit()
controller.playback_panel.reset_button.pressed.emit()
_check_approx(controller.get_playback_time(), 0.0, "reset returns to the start")
_check(
controller.rink_canvas.get_playback_section_id().is_empty(),
"reset clears the playback highlight"
)
controller.playback_timeline.value = 2.5
controller.playback_panel.timeline.value = 2.5
_check_approx(
controller.get_playback_time(),
2.5,
"timeline scrubbing seeks the playback"
)
controller.speed_option.item_selected.emit(4)
controller.playback_panel.speed_option.item_selected.emit(4)
_check_approx(controller.get_playback_speed(), 2.0, "speed option selects 2x")
controller.reset_playback()
controller.play()
@ -248,7 +248,7 @@ func _run() -> void:
"2x speed doubles the elapsed routine time"
)
controller.pause()
controller.speed_option.item_selected.emit(2)
controller.playback_panel.speed_option.item_selected.emit(2)
_check_approx(controller.get_playback_speed(), 1.0, "speed option returns to 1x")
# Element markers take their stand time from the element, not the geometry,
@ -656,13 +656,13 @@ func _run() -> void:
3.0,
"scrubbing moves the routine clock"
)
controller.speed_option.item_selected.emit(4)
controller.playback_panel.speed_option.item_selected.emit(4)
_check_approx(
controller.music_player.pitch_scale,
2.0,
"music follows the selected playback speed"
)
controller.speed_option.item_selected.emit(2)
controller.playback_panel.speed_option.item_selected.emit(2)
controller.reset_playback()
_check(not controller.music_player.playing, "reset stops the music")
_check_approx(

View file

@ -303,7 +303,7 @@ func _test_controller() -> void:
_check(not controller.sections_panel.visible, "section panel is hidden in 3D")
_check(not controller.timing_bar.visible, "timing bar is hidden in 3D")
_check(not controller.delete_segment_button.visible, "delete button is hidden in 3D")
_check(controller.play_button.visible, "playback bar stays visible in 3D")
_check(controller.playback_panel.play_button.visible, "playback bar stays visible in 3D")
var presentation := controller.get_presentation_3d()
_check(presentation != null, "controller owns a presentation")

View file

@ -0,0 +1,86 @@
extends SceneTree
## Headless test for `RoutineManagerPanel` on its own: rows and signals, no
## WhiteboardController and no routine files.
##
## Run with:
## godot --headless --path rinkplanner --script res://tests/run_routine_manager_panel_tests.gd
const PanelScene := preload("res://scenes/routine/routine_manager_panel.tscn")
var _assertions: int = 0
var _failures: PackedStringArray = PackedStringArray()
func _init() -> void:
_run.call_deferred()
func _run() -> void:
var panel := PanelScene.instantiate() as RoutineManagerPanel
_check(panel != null, "the panel scene carries its script")
if panel == null:
_finish()
return
root.size = Vector2i(1280, 800)
root.add_child(panel)
await process_frame
_check(not panel.is_open(), "the dialog starts closed")
var opened: Array = []
var renamed: Array = []
var deleted: Array = []
panel.open_requested.connect(func(name: String) -> void: opened.append(name))
panel.rename_requested.connect(func(name: String) -> void: renamed.append(name))
panel.delete_requested.connect(func(name: String) -> void: deleted.append(name))
panel.open_for(["b.json", "a.json"], Vector2i(800, 600))
_check(panel.is_open(), "the dialog opens")
_check(panel.list.get_child_count() == 2, "one row per routine")
var first_row := panel.list.get_child(0) as HBoxContainer
_check(first_row != null and first_row.get_child_count() == 3, "a row has open, rename and delete")
if first_row != null and first_row.get_child_count() == 3:
var open_button := first_row.get_child(0) as Button
_check(open_button.text == "b", "the row shows the name without extension")
open_button.pressed.emit()
(first_row.get_child(1) as Button).pressed.emit()
(first_row.get_child(2) as Button).pressed.emit()
_check(opened == ["b.json"], "the open signal carries the file")
_check(renamed == ["b.json"], "the rename signal carries the file")
_check(deleted == ["b.json"], "the delete signal carries the file")
panel.refresh(["c.json"])
_check(panel.list.get_child_count() == 1, "refreshing replaces the rows")
panel.refresh([])
_check(panel.list.get_child_count() == 1, "an empty list shows one hint")
_check(
(panel.list.get_child(0) as Label).text.contains("Keine"),
"the hint says that no routines are stored"
)
panel.close()
_check(not panel.is_open(), "the dialog closes")
panel.queue_free()
await process_frame
_finish()
func _check(condition: bool, message: String) -> void:
_assertions += 1
if not condition:
_failures.append(message)
func _finish() -> void:
if _failures.is_empty():
print("PASS: %d assertions" % _assertions)
quit(0)
return
for failure: String in _failures:
printerr("FAIL: %s" % failure)
printerr("%d of %d assertions failed" % [_failures.size(), _assertions])
quit(1)

View file

@ -0,0 +1 @@
uid://bkwa2hkn4gob7

View file

@ -19,6 +19,9 @@ func _init() -> void:
_test_broken_fixture_is_reported()
_test_season_pair_difference()
_test_upgrade_check()
_test_season_comparison_text()
_test_rules_context()
_test_season_panel_model()
_cleanup()
_finish()
@ -264,6 +267,103 @@ func _test_upgrade_check() -> void:
)
## Der Text des Saisonvergleichs ist reine Formatierung und damit testbar.
func _test_season_comparison_text() -> void:
var library := RulesLibrary.scan()
var current := library.get_package("2026/27")
var older := library.get_package("2025/26")
if current == null or older == null:
_check(false, "both seasons load for the comparison text")
return
var routine := _make_pair_routine()
routine.adult_category = "gold"
var report := SeasonUpgradeCheck.run(routine, current, older)
var text := "\n".join(SeasonComparisonText.build(routine, report))
_check(
text.contains("2026/27") and text.contains("2025/26"),
"the comparison text names both seasons"
)
_check(text.contains("[b]Elemente[/b]"), "the text has the element group")
_check(text.contains("ChSp"), "the text names the missing element")
_check(text.contains("[b]Summe[/b]"), "the text sums the base values")
_check(
text.contains("Befunde bei Prüfung gegen 2025/26"),
"the text adds the findings of the target season"
)
## Der Regelsatz als eigenes Objekt: Saison laden, wechseln, leeren.
func _test_rules_context() -> void:
var context := RulesContext.new()
var package := context.load_default()
_check(package != null, "the rules context loads the default season")
_check(
context.catalog != null and context.levels != null and context.adult != null,
"the context exposes the three documents"
)
_check(
context.season_label() == context.library.get_default_season(),
"the context reports the default season"
)
var older := context.apply("2025/26")
_check(older != null, "the context switches to an older season")
_check(context.season_label() == "2025/26", "the applied season is reported")
_check(context.adult != null, "2025/26 has adult rules")
_check(context.apply("") == null, "an empty season applies nothing")
_check(context.catalog == null, "an empty season clears the documents")
context.apply("2030/31")
_check(context.package == null, "an unknown season clears the documents")
## Inhalt der Statusleisten-Auswahl: Beschriftung, Zuordnung, Auswahl.
func _test_season_panel_model() -> void:
var library := RulesLibrary.scan()
var empty := SeasonPanelModel.season_items("", library)
_check(int(empty["selected"]) == 0, "without a season the first entry is selected")
_check(str(empty["items"][0]["value"]) == "", "the first entry has no value")
var current := SeasonPanelModel.season_items("2026/27", library)
_check(
str(current["items"][int(current["selected"])]["value"]) == "2026/27",
"the current season is selected"
)
var unknown := SeasonPanelModel.season_items("2030/31", library)
_check(
str(unknown["items"][int(unknown["selected"])]["value"]) == "2030/31",
"an unknown season stays visible"
)
var categories: Array = []
var package := library.get_package("2026/27")
if package != null and package.adult != null:
categories.assign(package.adult.get_categories("free"))
_check(categories.size() == 5, "the free-skating categories are offered")
var known := SeasonPanelModel.category_items("gold", categories)
_check(
str(known["items"][int(known["selected"])]["value"]) == "gold",
"a known category is selected"
)
var missing := SeasonPanelModel.category_items("legacy", categories)
_check(
str(missing["items"][int(missing["selected"])]["value"]) == "legacy",
"an unknown category stays visible"
)
_check(
str(missing["items"][int(missing["selected"])]["label"]).contains(
"nicht verfügbar"
),
"an unknown category is labelled"
)
_check(
SeasonPanelModel.program_items("artistic")["selected"] == 1,
"the artistic programme is selected"
)
func _make_pair_routine() -> Routine:
var routine := Routine.new()
routine.routine_id = "season-pair"

View file

@ -784,7 +784,7 @@ func _test_controller_wiring() -> void:
manager_item = index
_check(manager_item >= 0, "das Dateimenü bietet die Kürenverwaltung an")
_check(
controller.routine_manager_dialog != null
controller.routine_manager_panel.dialog != null
and controller.delete_routine_dialog != null,
"Verwaltungs- und Löschdialog sind in der Szene verdrahtet"
)
@ -792,7 +792,7 @@ func _test_controller_wiring() -> void:
controller.cleanup_conflicts_dialog != null,
"der Aufräumdialog ist in der Szene verdrahtet"
)
var summary := controller._format_sync_summary({
var summary := SyncSummaryText.format({
"uploaded": [],
"downloaded": [],
"skipped": [],
@ -813,6 +813,55 @@ func _test_controller_wiring() -> void:
"die Sync-Zusammenfassung nennt Gewinner und Konfliktarchiv"
)
# SyncSettingsModel: Anbieterliste hängt an der Build-Konfiguration.
var only_dropbox := SyncSettingsModel.provider_items({"dropbox_app_key": "key"})
_check(
only_dropbox.size() == 1
and str(only_dropbox[0]["value"]) == "dropbox",
"without Google credentials only Dropbox is offered"
)
var with_google := SyncSettingsModel.provider_items(
{
"dropbox_app_key": "key",
"google_client_id": "id",
"google_client_secret": "secret",
}
)
_check(with_google.size() == 2, "Google Drive appears when configured")
_check(
SyncSettingsModel.index_of(with_google, "google_drive") == 1,
"the provider list is searchable by id"
)
_check(
SyncSettingsModel.provider_items({}).size() == 1,
"Dropbox stays visible without credentials"
)
# RoutineManagerModel: eine Zeile pro Kür, JSON vor Legacy, sortiert.
var model_dir := "user://routine-manager-model"
DirAccess.make_dir_recursive_absolute(ProjectSettings.globalize_path(model_dir))
for name: String in ["b.tres", "a.json", "c.json", "c.tres", "notes.txt"]:
var file := FileAccess.open(model_dir.path_join(name), FileAccess.WRITE)
if file != null:
file.store_string("{}")
file.close()
var listed := RoutineManagerModel.list_routines(model_dir)
_check(listed.size() == 3, "one row per routine, ignoring other files (%d)" % listed.size())
_check(str(listed[0]) == "a.json", "routines are sorted by name")
_check(listed.has("c.json") and not listed.has("c.tres"), "JSON wins over the legacy format")
var variants := RoutineManagerModel.variants(model_dir, "c.json")
_check(
variants.size() == 2 and variants.has("c.json") and variants.has("c.tres"),
"both variants of a routine are found"
)
_check(
RoutineManagerModel.variants(model_dir, "missing.json") == PackedStringArray(["missing.json"]),
"a missing routine falls back to its name"
)
for name: String in ["b.tres", "a.json", "c.json", "c.tres", "notes.txt"]:
DirAccess.remove_absolute(model_dir.path_join(name))
DirAccess.remove_absolute(model_dir)
# "Küren verwalten": rows expose open/delete, the music stay-check works.
controller.sync_settings_dialog.hide()
DirAccess.make_dir_recursive_absolute(
@ -843,13 +892,13 @@ func _test_controller_wiring() -> void:
)
)
controller._refresh_routine_manager()
controller.routine_manager_dialog.show()
controller.routine_manager_panel.dialog.show()
_check(
controller.routine_manager_dialog.visible,
controller.routine_manager_panel.dialog.visible,
"der Verwaltungsdialog lässt sich öffnen"
)
var manager_row: HBoxContainer = null
for child: Node in controller.routine_manager_list.get_children():
for child: Node in controller.routine_manager_panel.list.get_children():
if child is HBoxContainer:
var open_button := child.get_child(0) as Button
if open_button != null and open_button.text == "sync-test-manager":
@ -946,7 +995,7 @@ func _test_controller_wiring() -> void:
)
)
controller._refresh_routine_manager()
controller.routine_manager_dialog.hide()
controller.routine_manager_panel.dialog.hide()
controller.sync_settings_dialog.hide()
# Ohne Refresh-Token öffnet "Jetzt synchronisieren" die Einstellungen.

View file

@ -43,6 +43,7 @@ func _init() -> void:
_test_jump_sequence()
_test_program_once_features()
_test_missing_rules()
_test_report_view()
_finish()
@ -562,6 +563,42 @@ func _messages(issues: Array[ValidationIssue]) -> String:
return "; ".join(parts)
## Der Dialogtext ist reine Formatierung und damit ohne Szene testbar.
func _test_report_view() -> void:
var routine := _make_routine()
_add_marker(
routine.sections[0],
"spin",
PathSegment.ElementType.SPIN,
"CCoSp",
4,
PackedStringArray(["difficult_variation_sit", "difficult_exit"])
)
var report := _validator.validate_report(routine)
var text := "\n".join(
ValidationReportView.build(
routine,
report,
null,
{
"season": "2026/27",
"season_note": "",
"can_compare": true,
"show_info": false,
"show_assumptions": false,
}
)
)
_check(text.contains("Geprüft:"), "the view has the header line")
_check(text.contains("Saison 2026/27"), "the view names the season")
_check(text.contains("[url=upgrade]"), "the view offers the season comparison")
_check(text.contains("Kategorie: Ohne Kategorie"), "the view reports no category")
_check(text.contains("[b]Basiswert:"), "the view shows the base value")
_check(text.contains("[b]Prüfungen[/b]"), "the view lists the checks")
_check(text.contains("[b]Befunde[/b]"), "the view lists the findings")
func _check(condition: bool, message: String) -> void:
_assertions += 1
if not condition:

View file

@ -1790,6 +1790,20 @@ func _run() -> void:
controller.get_season() == "2026/27",
"checking alone does not change the season"
)
_check(
not controller.upgrade_pdf_button.disabled,
"the comparison can be written as a PDF"
)
controller._on_upgrade_pdf_pressed()
_check(
controller._last_export_path.ends_with(".pdf"),
"the comparison PDF lands in the export folder"
)
_check(
FileAccess.file_exists(controller._last_export_path),
"the comparison PDF was written"
)
controller.export_panel.done_dialog.hide()
controller._on_upgrade_apply_pressed()
_check(
controller.get_season() == "2025/26",

View file

@ -43,7 +43,7 @@ VERSION="$(
sed -n 's/^[[:space:]]*application\/product_version="\([^"]*\)"/\1/p' \
"$PROJECT_DIR/export_presets.cfg" | head -1
)"
VERSION="${VERSION:-0.3.0.0}"
VERSION="${VERSION:-0.4.0.0}"
if [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
VERSION="$VERSION.0"
fi

View file

@ -66,6 +66,12 @@ fi
"$GODOT" --headless --path "$PROJECT_DIR" \
--script res://tests/run_timing_tests.gd
"$GODOT" --headless --path "$PROJECT_DIR" \
--script res://tests/run_export_panel_tests.gd
"$GODOT" --headless --path "$PROJECT_DIR" \
--script res://tests/run_routine_manager_panel_tests.gd
"$GODOT" --headless --path "$PROJECT_DIR" \
--script res://tests/run_export_tests.gd

View file

@ -7,7 +7,7 @@
; -DICON_FILE=/pfad/zu/rinkplanner.ico
!ifndef APP_VERSION
!define APP_VERSION "0.3.0.0"
!define APP_VERSION "0.4.0.0"
!endif
!ifndef SOURCE_EXE
!error "SOURCE_EXE fehlt (Pfad zur rinkplanner.exe)."

View file

@ -43,7 +43,7 @@ return [
'downloads.kicker' => 'Test-Build',
'downloads.title' => 'Rinkplanner herunterladen',
'downloads.lede' => 'Installer für macOS und Windows vom 13.11.2026. Wähle deine Plattform &ndash; die Downloads sind direkt einsatzbereit.',
'downloads.lede' => 'macOS- und Windows-Installer vom 13.11.2026. Wähle deine Plattform &ndash; die Downloads sind direkt einsatzbereit.',
'downloads.mac.title' => 'Für den Mac',
'downloads.mac.body' => 'Universal Binary für Apple Silicon (macOS 13+) und Intel (macOS 11+).',
'downloads.mac.cta' => 'Installer herunterladen',
@ -142,7 +142,7 @@ return [
'downloads.kicker' => 'Test build',
'downloads.title' => 'Download Rinkplanner',
'downloads.lede' => 'Installers for macOS and Windows from 13 Nov 2026. Pick your platform &ndash; the downloads are ready to use.',
'downloads.lede' => 'macOS and Windows installers from 13 Nov 2026. Pick your platform &ndash; the downloads are ready to use.',
'downloads.mac.title' => 'For your Mac',
'downloads.mac.body' => 'Universal binary for Apple Silicon (macOS 13+) and Intel (macOS 11+).',
'downloads.mac.cta' => 'Download installer',