Launcher : mises à jour depuis main, signalement de bug sur GitHub
- Carte Mises à jour : compare avec origin/main et dit ce qui a changé (launcher, moteur du jeu, ou rien à recompiler). Mettre à jour (git pull --ff-only), Recompiler le launcher puis Redémarrer, Recompiler le jeu. Le launcher connaît son commit (build.rs), le jeu compilé le sien (build[_xx]\commit.txt). Vérification au démarrage (désactivable). - Rapports de bug : bouton Signaler, qui ouvre le formulaire d'issue GitHub pré-rempli (.github/ISSUE_TEMPLATE/bug.yml) et montre le zip à y glisser. Rien n'est envoyé tout seul : il faut un compte GitHub. - Guides (5 langues) : sections 13 et 14. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4f6e526073
commit
a8dde8e13e
12 files changed
+678
-20
No files matched your search
@@ -0,0 +1,52 @@
|
||||
name: Bug / Rapport de bug
|
||||
description: Un problème dans le jeu ou le launcher. A problem in the game or the launcher.
|
||||
labels: ["bug"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
**FR** — Le plus simple : en jeu **F12 → Signaler un bug**, puis dans le launcher, carte *Rapports de bug*, bouton **Signaler** : ce formulaire s'ouvre déjà rempli et le zip du rapport s'affiche dans l'Explorateur. **Glissez le zip** dans le champ « Fichiers » plus bas (il contient l'image, la partie et les réglages au moment du bug).
|
||||
**EN** — Easiest: in game **F12 → Report a bug**, then in the launcher, *Bug reports* card, **Report** button: this form opens already filled in and the report's zip shows up in Explorer. **Drop the zip** into the "Files" field below (it holds the picture, the save and the settings at the moment of the bug).
|
||||
- type: input
|
||||
id: type
|
||||
attributes:
|
||||
label: Type
|
||||
description: Graphismes, son, blocage, plantage… / Graphics, sound, stuck, crash…
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: comment
|
||||
attributes:
|
||||
label: Que s'est-il passé ? / What happened?
|
||||
description: Ce que vous faisiez, ce que vous attendiez, ce qui s'est passé. / What you were doing, what you expected, what happened.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: files
|
||||
attributes:
|
||||
label: Fichiers / Files
|
||||
description: Glissez ici le zip du rapport (dossier %APPDATA%\DoubleTroubleRecomp\rapports). / Drop the report's zip here.
|
||||
- type: input
|
||||
id: location
|
||||
attributes:
|
||||
label: Lieu / Location
|
||||
description: Numéro du lieu (dans le rapport). / Location number (in the report).
|
||||
- type: input
|
||||
id: version
|
||||
attributes:
|
||||
label: Version du jeu compilé / Built game version
|
||||
description: Ligne « Version » du rapport (commit). / The report's "Version" line (commit).
|
||||
- type: input
|
||||
id: game
|
||||
attributes:
|
||||
label: Version du jeu (CD) / Game version (CD)
|
||||
description: Français, English, Deutsch, Español, Polski.
|
||||
- type: input
|
||||
id: date
|
||||
attributes:
|
||||
label: Date du rapport / Report date
|
||||
- type: input
|
||||
id: system
|
||||
attributes:
|
||||
label: Système / System
|
||||
description: Windows, carte graphique… / Windows, graphics card…
|
||||
@@ -0,0 +1 @@
|
||||
blank_issues_enabled: true
|
||||
+20
-3
@@ -497,16 +497,33 @@ Im Launcher listet die Karte **Fehlerberichte** (unter Spielstände) die letzten
|
||||
<p align="center"><img src="images/launcher-de-carte-rapports.jpg" alt="Karte Fehlerberichte" width="720"></p>
|
||||
|
||||
- **Nachspielen** startet das Spiel mit dem Spielstand des Berichts, im Moment des Fehlers;
|
||||
- **Melden** öffnet das Fehlerformular des Projekts auf GitHub, bereits mit dem Bericht ausgefüllt
|
||||
(Typ, Kommentar, Ort, Version), und zeigt sein Zip im Explorer: Ziehen Sie das Zip in das Formular,
|
||||
prüfen Sie es, ergänzen Sie Windows-Version und Grafikkarte und veröffentlichen Sie es;
|
||||
- **Zip** erstellt ein Zip zum Anhängen an Ihre Nachricht;
|
||||
- **Öffnen** zeigt den Ordner;
|
||||
- **Löschen** verschiebt den Bericht in den Papierkorb.
|
||||
|
||||
Eröffnen Sie dann ein Issue im Repository, mit dem Zip, Ihrer Windows-Version und Ihrer
|
||||
Grafikkarte. Der Inhalt des Ordners ist in [SETTINGS.en.md](SETTINGS.en.md#bug-reports) beschrieben.
|
||||
Nichts wird von selbst gesendet: Zum Veröffentlichen braucht man ein (kostenloses) GitHub-Konto, das
|
||||
hält Spam fern. Ohne Launcher öffnen Sie
|
||||
[ein neues Issue](https://github.com/Linkatplug/DoubleTroubleRecomp/issues/new?template=bug.yml),
|
||||
füllen das Formular aus und ziehen das Zip des Berichts hinein (Rechtsklick auf seinen Ordner →
|
||||
*Komprimieren*). Der Inhalt des Ordners ist in [SETTINGS.en.md](SETTINGS.en.md#bug-reports) beschrieben.
|
||||
|
||||
## 14. Aktualisieren, deinstallieren
|
||||
|
||||
**Aktualisieren**:
|
||||
**Aktualisieren**: Beim Start prüft der Launcher, ob es auf dem Zweig `main` des Repositorys
|
||||
Neuerungen gibt (Karte **Aktualisierungen**, Kästchen **Beim Start prüfen**). Er sagt, was sich
|
||||
geändert hat, der Launcher, die Spiel-Engine oder nur die Dokumentation: Das eine kann sich ohne das
|
||||
andere ändern.
|
||||
|
||||
1. **Aktualisieren** holt die Neuerungen (`git pull`);
|
||||
2. wenn sich der Launcher geändert hat: **Launcher neu kompilieren** (ein bis zwei Minuten), dann
|
||||
**Launcher neu starten**;
|
||||
3. wenn sich die Spiel-Engine geändert hat: **Spiel neu kompilieren**.
|
||||
|
||||
Dazu muss das Projekt mit `git clone` geholt worden sein (Abschnitt 3), ohne von Hand geänderte
|
||||
Dateien. Sonst von Hand:
|
||||
|
||||
```powershell
|
||||
git pull
|
||||
|
||||
+18
-2
@@ -463,16 +463,32 @@ In the launcher, the **Bug reports** card (under Saved games) lists the latest r
|
||||
<p align="center"><img src="images/launcher-en-carte-rapports.jpg" alt="Bug reports card" width="720"></p>
|
||||
|
||||
- **Replay** starts the game again on the report's save, at the moment of the bug;
|
||||
- **Report** opens the project's bug form on GitHub, already filled in with the report (type,
|
||||
comment, location, version), and shows its zip in Explorer: drop the zip into the form, review it,
|
||||
add your Windows version and graphics card, then post it;
|
||||
- **Zip** makes a zip to attach to your message;
|
||||
- **Open** shows the folder;
|
||||
- **Delete** moves the report to the recycle bin.
|
||||
|
||||
Then open an issue on the repository with the zip, your Windows version and your graphics card.
|
||||
Nothing is sent by itself: posting the issue needs a (free) GitHub account, which keeps spam away.
|
||||
Without the launcher, open
|
||||
[a new issue](https://github.com/Linkatplug/DoubleTroubleRecomp/issues/new?template=bug.yml), fill in
|
||||
the form and drop the report's zip into it (right-click its folder → *Compress*).
|
||||
The folder's contents are detailed in [SETTINGS.en.md](SETTINGS.en.md#bug-reports).
|
||||
|
||||
## 14. Update, uninstall
|
||||
|
||||
**Update**:
|
||||
**Update**: at startup the launcher checks whether the repository's `main` branch has something new
|
||||
(**Updates** card, **Check at startup** box). It says what changed, the launcher, the game engine, or
|
||||
only the documentation: one can change without the other.
|
||||
|
||||
1. **Update** fetches the changes (`git pull`);
|
||||
2. if the launcher changed: **Rebuild the launcher** (one or two minutes), then **Restart the
|
||||
launcher**;
|
||||
3. if the game engine changed: **Rebuild the game**.
|
||||
|
||||
The project must have been fetched with `git clone` (section 3), with no file changed by hand.
|
||||
Otherwise, by hand:
|
||||
|
||||
```powershell
|
||||
git pull
|
||||
|
||||
+19
-3
@@ -485,16 +485,32 @@ informes:
|
||||
<p align="center"><img src="images/launcher-es-carte-rapports.jpg" alt="Tarjeta Informes de errores" width="720"></p>
|
||||
|
||||
- **Volver a jugar** relanza el juego en la partida del informe, en el momento del error;
|
||||
- **Informar** abre el formulario de errores del proyecto en GitHub, ya rellenado con el informe
|
||||
(tipo, comentario, lugar, versión), y muestra su zip en el Explorador: arrastra el zip al
|
||||
formulario, revísalo, añade tu versión de Windows y tu tarjeta gráfica y publícalo;
|
||||
- **Zip** crea un zip para adjuntar a tu mensaje;
|
||||
- **Abrir** muestra la carpeta;
|
||||
- **Eliminar** mueve el informe a la papelera.
|
||||
|
||||
Después abre una incidencia (issue) en el repositorio con el zip, tu versión de Windows y tu tarjeta
|
||||
gráfica. El contenido de la carpeta se detalla en [SETTINGS.en.md](SETTINGS.en.md#bug-reports).
|
||||
No se envía nada solo: publicar la incidencia requiere una cuenta de GitHub (gratuita), lo que evita
|
||||
el spam. Sin el launcher, abre
|
||||
[una nueva incidencia](https://github.com/Linkatplug/DoubleTroubleRecomp/issues/new?template=bug.yml),
|
||||
rellena el formulario y arrastra dentro el zip del informe (clic derecho en su carpeta →
|
||||
*Comprimir*). El contenido de la carpeta se detalla en [SETTINGS.en.md](SETTINGS.en.md#bug-reports).
|
||||
|
||||
## 14. Actualizar, desinstalar
|
||||
|
||||
**Actualizar**:
|
||||
**Actualizar**: al arrancar, el launcher mira si hay novedades en la rama `main` del repositorio
|
||||
(tarjeta **Actualizaciones**, casilla **Comprobar al iniciar**). Dice qué ha cambiado, el launcher,
|
||||
el motor del juego o solo la documentación: uno puede cambiar sin el otro.
|
||||
|
||||
1. **Actualizar** descarga las novedades (`git pull`);
|
||||
2. si el launcher ha cambiado: **Recompilar el launcher** (uno o dos minutos) y luego **Reiniciar el
|
||||
launcher**;
|
||||
3. si el motor del juego ha cambiado: **Recompilar el juego**.
|
||||
|
||||
El proyecto tiene que haberse obtenido con `git clone` (sección 3), sin archivos modificados a mano.
|
||||
Si no, a mano:
|
||||
|
||||
```powershell
|
||||
git pull
|
||||
|
||||
+18
-2
@@ -477,16 +477,32 @@ Dans le launcher, la carte **Rapports de bug** (sous Sauvegardes) liste les dern
|
||||
<p align="center"><img src="images/launcher-fr-carte-rapports.jpg" alt="Carte Rapports de bug" width="720"></p>
|
||||
|
||||
- **Rejouer** relance le jeu sur la partie du rapport, au moment du bug ;
|
||||
- **Signaler** ouvre le formulaire de bug du projet sur GitHub, déjà rempli avec le rapport (type,
|
||||
commentaire, lieu, version), et montre son zip dans l'Explorateur : glissez le zip dans le
|
||||
formulaire, relisez, ajoutez votre version de Windows et votre carte graphique, puis publiez ;
|
||||
- **Zip** prépare un zip à joindre à votre message ;
|
||||
- **Ouvrir** montre le dossier ;
|
||||
- **Supprimer** met le rapport à la corbeille.
|
||||
|
||||
Ouvrez ensuite un ticket sur le dépôt avec le zip, votre version de Windows et votre carte graphique.
|
||||
Rien n'est envoyé tout seul : publier le ticket demande un compte GitHub (gratuit), ce qui évite les
|
||||
envois en masse. Sans le launcher, ouvrez
|
||||
[un nouveau ticket](https://github.com/Linkatplug/DoubleTroubleRecomp/issues/new?template=bug.yml),
|
||||
remplissez le formulaire et glissez-y le zip du rapport (clic droit sur son dossier → *Compresser*).
|
||||
Le détail du contenu est dans [SETTINGS.md](SETTINGS.md#rapports-de-bug).
|
||||
|
||||
## 14. Mettre à jour, désinstaller
|
||||
|
||||
**Mettre à jour** :
|
||||
**Mettre à jour** : le launcher regarde au démarrage s'il y a du nouveau sur la branche `main` du
|
||||
dépôt (carte **Mises à jour**, case **Vérifier au démarrage**). Il dit ce qui a changé, le launcher,
|
||||
le moteur du jeu, ou seulement la documentation : l'un peut changer sans l'autre.
|
||||
|
||||
1. **Mettre à jour** récupère les nouveautés (`git pull`) ;
|
||||
2. si le launcher a changé : **Recompiler le launcher** (une à deux minutes), puis **Redémarrer le
|
||||
launcher** ;
|
||||
3. si le moteur du jeu a changé : **Recompiler le jeu**.
|
||||
|
||||
Il faut que le projet ait été récupéré avec `git clone` (section 3) et qu'aucun fichier n'ait été
|
||||
modifié à la main. Sinon, à la main :
|
||||
|
||||
```powershell
|
||||
git pull
|
||||
|
||||
+18
-2
@@ -479,16 +479,32 @@ W launcherze karta **Raporty błędów** (pod Zapisy gry) pokazuje ostatnie rapo
|
||||
<p align="center"><img src="images/launcher-pl-carte-rapports.jpg" alt="Karta Raporty błędów" width="720"></p>
|
||||
|
||||
- **Zagraj ponownie** uruchamia grę od zapisu z raportu, w chwili wystąpienia błędu;
|
||||
- **Zgłoś** otwiera formularz błędów projektu na GitHubie, już wypełniony raportem (typ, komentarz,
|
||||
miejsce, wersja), i pokazuje jego zip w Eksploratorze: przeciągnij zip do formularza, sprawdź,
|
||||
dopisz wersję Windows i kartę graficzną, potem opublikuj;
|
||||
- **Zip** tworzy plik zip do dołączenia do wiadomości;
|
||||
- **Otwórz** pokazuje folder;
|
||||
- **Usuń** przenosi raport do kosza.
|
||||
|
||||
Następnie otwórz zgłoszenie (issue) w repozytorium z plikiem zip, wersją Windows i kartą graficzną.
|
||||
Nic nie jest wysyłane samo: opublikowanie zgłoszenia wymaga (darmowego) konta GitHub, co chroni
|
||||
przed spamem. Bez launchera otwórz
|
||||
[nowe zgłoszenie](https://github.com/Linkatplug/DoubleTroubleRecomp/issues/new?template=bug.yml),
|
||||
wypełnij formularz i przeciągnij do niego zip raportu (prawy klik na jego folderze → *Kompresuj*).
|
||||
Zawartość folderu jest opisana w [SETTINGS.en.md](SETTINGS.en.md#bug-reports).
|
||||
|
||||
## 14. Aktualizacja, odinstalowanie
|
||||
|
||||
**Aktualizacja**:
|
||||
**Aktualizacja**: przy starcie launcher sprawdza, czy na gałęzi `main` repozytorium jest coś nowego
|
||||
(karta **Aktualizacje**, pole **Sprawdzaj przy starcie**). Mówi, co się zmieniło: launcher, silnik
|
||||
gry czy tylko dokumentacja; jedno może się zmienić bez drugiego.
|
||||
|
||||
1. **Aktualizuj** pobiera zmiany (`git pull`);
|
||||
2. jeśli zmienił się launcher: **Skompiluj launcher ponownie** (minuta lub dwie), potem **Uruchom
|
||||
launcher ponownie**;
|
||||
3. jeśli zmienił się silnik gry: **Skompiluj grę ponownie**.
|
||||
|
||||
Projekt musi być pobrany przez `git clone` (rozdział 3), bez plików zmienionych ręcznie. W przeciwnym
|
||||
razie ręcznie:
|
||||
|
||||
```powershell
|
||||
git pull
|
||||
|
||||
@@ -95,7 +95,6 @@ Remplacer mes sauvegardes Replace my saves Meine Spielstände ersetzen Reemplaza
|
||||
Restaurer Restore Wiederherstellen Restaurar Przywróć
|
||||
Fermez le jeu pour gérer les sauvegardes. Close the game to manage saves. Schließen Sie das Spiel, um die Spielstände zu verwalten. Cierra el juego para gestionar las partidas. Zamknij grę, aby zarządzać zapisami.
|
||||
Rapports de bug Bug reports Fehlerberichte Informes de errores Raporty błędów
|
||||
En jeu : F12, puis « Signaler un bug ». Rien n'est envoyé : joignez le dossier (ou son zip) à votre message. In game: F12, then “Report a bug”. Nothing is sent: attach the folder (or its zip) to your message. Im Spiel: F12, dann „Signaler un bug“. Es wird nichts gesendet: Hängen Sie den Ordner (oder sein Zip) an Ihre Nachricht an. En el juego: F12 y luego «Signaler un bug». No se envía nada: adjunta la carpeta (o su zip) a tu mensaje. W grze: F12, potem „Signaler un bug”. Nic nie jest wysyłane: dołącz folder (lub jego zip) do swojej wiadomości.
|
||||
Rapport automatique si le jeu plante Automatic report if the game crashes Automatischer Bericht bei Absturz Informe automático si el juego se cuelga Automatyczny raport, gdy gra się zawiesi
|
||||
Le jeu écrit un rapport tout seul s'il plante (pas si c'est le pilote de la carte graphique qui plante). The game writes a report by itself if it crashes (not if the graphics driver crashes). Das Spiel schreibt bei einem Absturz selbst einen Bericht (nicht, wenn der Grafiktreiber abstürzt). El juego escribe un informe solo si se cuelga (no si es el controlador de la tarjeta gráfica el que falla). Gra sama zapisuje raport, gdy się zawiesi (nie wtedy, gdy zawiesi się sterownik karty graficznej).
|
||||
Aucun rapport. No report. Kein Bericht. Ningún informe. Brak raportów.
|
||||
@@ -227,3 +226,33 @@ Chaque version du jeu a ses propres sauvegardes, pour ne pas écraser celles d'u
|
||||
Lance le jeu sur cette sauvegarde sans la copier dans vos parties. Starts the game on this save without copying it to your saves. Startet das Spiel mit diesem Spielstand, ohne ihn zu Ihren Spielständen zu kopieren. Inicia el juego en esta partida sin copiarla a tus partidas. Uruchamia grę od tego zapisu bez kopiowania go do twoich zapisów.
|
||||
Copier ici Copy here Hierher kopieren Copiar aquí Kopiuj tutaj
|
||||
Ajoute une copie à vos parties de cette version, sous un nouveau numéro : rien n'est écrasé. Adds a copy to this version's saves, under a new number: nothing is overwritten. Fügt den Spielständen dieser Version eine Kopie unter einer neuen Nummer hinzu: Nichts wird überschrieben. Añade una copia a las partidas de esta versión, con un número nuevo: no se sobrescribe nada. Dodaje kopię do zapisów tej wersji pod nowym numerem: nic nie zostaje nadpisane.
|
||||
Impossible de remplacer le launcher : Can't replace the launcher: Der Launcher kann nicht ersetzt werden: No se puede sustituir el launcher: Nie można zastąpić launchera:
|
||||
Mises à jour Updates Aktualisierungen Actualizaciones Aktualizacje
|
||||
Interroge le dépôt du projet (branche main). Asks the project's repository (main branch). Fragt das Repository des Projekts ab (Zweig main). Consulta el repositorio del proyecto (rama main). Sprawdza repozytorium projektu (gałąź main).
|
||||
Projet installé sans Git (archive ZIP) : pas de mise à jour automatique. Téléchargez la nouvelle version, ou installez le projet avec git clone (guide, section 3). Project installed without Git (ZIP archive): no automatic update. Download the new version, or install the project with git clone (guide, section 3). Projekt ohne Git installiert (ZIP-Archiv): keine automatische Aktualisierung. Laden Sie die neue Version herunter oder installieren Sie das Projekt mit git clone (Anleitung, Abschnitt 3). Proyecto instalado sin Git (archivo ZIP): sin actualización automática. Descarga la nueva versión o instala el proyecto con git clone (guía, sección 3). Projekt zainstalowany bez Gita (archiwum ZIP): brak automatycznej aktualizacji. Pobierz nową wersję albo zainstaluj projekt przez git clone (poradnik, rozdział 3).
|
||||
Branche Branch Zweig Rama Gałąź
|
||||
Dépôt injoignable : Repository unreachable: Repository nicht erreichbar: Repositorio inaccesible: Repozytorium niedostępne:
|
||||
Mise à jour disponible : {n} changement(s) sur main. Update available: {n} change(s) on main. Aktualisierung verfügbar: {n} Änderung(en) auf main. Actualización disponible: {n} cambio(s) en main. Dostępna aktualizacja: {n} zmian(a) na main.
|
||||
le launcher (à recompiler ensuite, en un clic) the launcher (to rebuild afterwards, in one click) der Launcher (danach mit einem Klick neu zu kompilieren) el launcher (a recompilar después, con un clic) launcher (do ponownej kompilacji potem, jednym kliknięciem)
|
||||
le moteur du jeu (à recompiler ensuite) the game engine (to rebuild afterwards) die Spiel-Engine (danach neu zu kompilieren) el motor del juego (a recompilar después) silnik gry (do ponownej kompilacji potem)
|
||||
documentation et outils : rien à recompiler documentation and tools: nothing to rebuild Dokumentation und Werkzeuge: nichts neu zu kompilieren documentación y herramientas: nada que recompilar dokumentacja i narzędzia: nic do kompilacji
|
||||
Des fichiers du projet ont été modifiés à la main : mise à jour automatique impossible (voir git status). Some project files were changed by hand: automatic update impossible (see git status). Einige Projektdateien wurden von Hand geändert: automatische Aktualisierung nicht möglich (siehe git status). Algunos archivos del proyecto se modificaron a mano: actualización automática imposible (ver git status). Niektóre pliki projektu zmieniono ręcznie: automatyczna aktualizacja niemożliwa (zob. git status).
|
||||
Mettre à jour Update Aktualisieren Actualizar Aktualizuj
|
||||
Branche de travail : main a des nouveautés, à fusionner avec Git. Work branch: main has new changes, to merge with Git. Arbeitszweig: main hat Neuerungen, mit Git zusammenzuführen. Rama de trabajo: main tiene novedades, a fusionar con Git. Gałąź robocza: main ma nowe zmiany, do scalenia przez Git.
|
||||
Nouveau launcher compilé. New launcher built. Neuer Launcher kompiliert. Nuevo launcher compilado. Nowy launcher skompilowany.
|
||||
Redémarrer le launcher Restart the launcher Launcher neu starten Reiniciar el launcher Uruchom launcher ponownie
|
||||
Le launcher a été mis à jour : recompilez-le. The launcher was updated: rebuild it. Der Launcher wurde aktualisiert: Kompilieren Sie ihn neu. El launcher se ha actualizado: recompílalo. Launcher został zaktualizowany: skompiluj go ponownie.
|
||||
Recompiler le launcher Rebuild the launcher Launcher neu kompilieren Recompilar el launcher Skompiluj launcher ponownie
|
||||
Une à deux minutes, puis le launcher redémarre. One or two minutes, then the launcher restarts. Ein bis zwei Minuten, dann startet der Launcher neu. Uno o dos minutos y el launcher se reinicia. Minuta lub dwie, potem launcher uruchomi się ponownie.
|
||||
Dans le dossier launcher : cargo build --release In the launcher folder: cargo build --release Im Ordner launcher: cargo build --release En la carpeta launcher: cargo build --release W folderze launcher: cargo build --release
|
||||
Le moteur du jeu a changé depuis la dernière compilation. The game engine changed since the last build. Die Spiel-Engine hat sich seit der letzten Kompilierung geändert. El motor del juego ha cambiado desde la última compilación. Silnik gry zmienił się od ostatniej kompilacji.
|
||||
Recompiler le jeu Rebuild the game Spiel neu kompilieren Recompilar el juego Skompiluj grę ponownie
|
||||
Tout est à jour. Everything is up to date. Alles ist aktuell. Todo está al día. Wszystko jest aktualne.
|
||||
Vérifier au démarrage Check at startup Beim Start prüfen Comprobar al iniciar Sprawdzaj przy starcie
|
||||
Mise à jour… Updating… Aktualisierung… Actualizando… Aktualizacja…
|
||||
Compilation du launcher… Building the launcher… Launcher wird kompiliert… Compilando el launcher… Kompilacja launchera…
|
||||
Mise à jour disponible Update available Aktualisierung verfügbar Actualización disponible Dostępna aktualizacja
|
||||
En jeu : F12, puis « Signaler un bug ». Rien n'est envoyé tout seul : « Signaler » ouvre le formulaire de bug du projet sur GitHub, déjà rempli, et prépare le zip à y glisser. Vous relisez et publiez avec votre compte GitHub. In game: F12, then “Report a bug”. Nothing is sent by itself: “Report” opens the project's bug form on GitHub, already filled in, and prepares the zip to drop into it. You review it and post it with your GitHub account. Im Spiel: F12, dann „Fehler melden“. Nichts wird von selbst gesendet: „Melden“ öffnet das Fehlerformular des Projekts auf GitHub, bereits ausgefüllt, und bereitet das Zip vor, das Sie hineinziehen. Sie prüfen es und veröffentlichen es mit Ihrem GitHub-Konto. En el juego: F12 y luego «Informar de un error». No se envía nada solo: «Informar» abre el formulario de errores del proyecto en GitHub, ya rellenado, y prepara el zip para arrastrarlo dentro. Lo revisas y lo publicas con tu cuenta de GitHub. W grze: F12, potem „Zgłoś błąd”. Nic nie jest wysyłane samo: „Zgłoś” otwiera formularz błędów projektu na GitHubie, już wypełniony, i przygotowuje zip do przeciągnięcia. Sprawdzasz i publikujesz go swoim kontem GitHub.
|
||||
Signaler Report Melden Informar Zgłoś
|
||||
Ouvre le formulaire de bug du projet sur GitHub, pré-rempli avec ce rapport, et montre son zip : glissez-le dans le formulaire, relisez, publiez. Il faut un compte GitHub (gratuit). Opens the project's bug form on GitHub, prefilled with this report, and shows its zip: drop it into the form, review, post. A (free) GitHub account is needed. Öffnet das Fehlerformular des Projekts auf GitHub, mit diesem Bericht vorausgefüllt, und zeigt sein Zip: in das Formular ziehen, prüfen, veröffentlichen. Ein (kostenloses) GitHub-Konto ist nötig. Abre el formulario de errores del proyecto en GitHub, rellenado con este informe, y muestra su zip: arrástralo al formulario, revisa, publica. Hace falta una cuenta de GitHub (gratuita). Otwiera formularz błędów projektu na GitHubie, wypełniony tym raportem, i pokazuje jego zip: przeciągnij go do formularza, sprawdź, opublikuj. Potrzebne jest (darmowe) konto GitHub.
|
||||
Formulaire ouvert dans le navigateur. Glissez-y le zip qui s'affiche dans l'Explorateur. Form opened in the browser. Drop into it the zip shown in Explorer. Formular im Browser geöffnet. Ziehen Sie das im Explorer angezeigte Zip hinein. Formulario abierto en el navegador. Arrastra dentro el zip que aparece en el Explorador. Formularz otwarty w przeglądarce. Przeciągnij do niego zip pokazany w Eksploratorze.
|
||||
|
@@ -27,7 +27,27 @@ fn find_rc() -> Option<PathBuf> {
|
||||
None
|
||||
}
|
||||
|
||||
/// commit des sources, pour la vérification des mises à jour (src/updates.rs) ; vide hors d'un clone Git
|
||||
fn commit() {
|
||||
let root = Path::new(env!("CARGO_MANIFEST_DIR")).join("..");
|
||||
let c = Command::new("git")
|
||||
.args(["rev-parse", "HEAD"])
|
||||
.current_dir(&root)
|
||||
.output()
|
||||
.ok()
|
||||
.filter(|o| o.status.success())
|
||||
.map(|o| String::from_utf8_lossy(&o.stdout).trim().to_string())
|
||||
.unwrap_or_default();
|
||||
println!("cargo:rustc-env=DTR_LAUNCHER_COMMIT={c}");
|
||||
// recalculé à chaque commit, pull ou changement de branche
|
||||
let log = root.join(".git").join("logs").join("HEAD");
|
||||
if log.is_file() {
|
||||
println!("cargo:rerun-if-changed={}", log.display());
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
commit();
|
||||
let icon_dir = Path::new(env!("CARGO_MANIFEST_DIR")).join("..").join("assets").join("icon");
|
||||
println!("cargo:rerun-if-changed={}", icon_dir.join("dtr.rc").display());
|
||||
println!("cargo:rerun-if-changed={}", icon_dir.join("dtr.ico").display());
|
||||
|
||||
+285
-7
@@ -18,6 +18,7 @@ mod preview;
|
||||
mod reports;
|
||||
mod saves;
|
||||
mod settings;
|
||||
mod updates;
|
||||
mod version;
|
||||
|
||||
use eframe::egui::{self, Color32, CornerRadius, Rect, RichText, Stroke};
|
||||
@@ -100,6 +101,8 @@ struct Config {
|
||||
music_volume: u32,
|
||||
/// taille de l'interface en % ; 0 = automatique (suit la taille de la fenêtre)
|
||||
ui_scale: u32,
|
||||
/// chercher les mises à jour (branche main du dépôt) au démarrage
|
||||
check_updates: bool,
|
||||
}
|
||||
|
||||
impl Default for Config {
|
||||
@@ -123,6 +126,7 @@ impl Default for Config {
|
||||
music_mute: false,
|
||||
music_volume: 50,
|
||||
ui_scale: 0,
|
||||
check_updates: true,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -156,6 +160,7 @@ impl Config {
|
||||
"preview_zoom" => c.preview_zoom = b,
|
||||
"preview_compare" => c.preview_compare = b,
|
||||
"music_mute" => c.music_mute = b,
|
||||
"check_updates" => c.check_updates = b,
|
||||
"ui_scale" => c.ui_scale = v.parse::<u32>().unwrap_or(0).min(300),
|
||||
"music_volume" => c.music_volume = v.parse::<u32>().unwrap_or(50).min(100),
|
||||
_ => {}
|
||||
@@ -172,7 +177,7 @@ impl Config {
|
||||
let b = |x: bool| if x { "1" } else { "0" };
|
||||
let text = format!(
|
||||
"lang={}\ngame_path={}\ninstall_dir={}\nsound={}\nskip_intro={}\nresume={}\nresume_slot={}\nverbose={}\n\
|
||||
window_width={}\nwindow_height={}\nmaximized={}\nwindow_x={}\nwindow_y={}\npreview_zoom={}\npreview_compare={}\nmusic_mute={}\nmusic_volume={}\nui_scale={}\n",
|
||||
window_width={}\nwindow_height={}\nmaximized={}\nwindow_x={}\nwindow_y={}\npreview_zoom={}\npreview_compare={}\nmusic_mute={}\nmusic_volume={}\nui_scale={}\ncheck_updates={}\n",
|
||||
self.lang.code(),
|
||||
self.game_path,
|
||||
self.install_dir,
|
||||
@@ -190,7 +195,8 @@ impl Config {
|
||||
b(self.preview_compare),
|
||||
b(self.music_mute),
|
||||
self.music_volume,
|
||||
self.ui_scale
|
||||
self.ui_scale,
|
||||
b(self.check_updates)
|
||||
);
|
||||
let _ = std::fs::write(f, text);
|
||||
}
|
||||
@@ -381,6 +387,7 @@ enum Msg {
|
||||
Picked(Pick, String),
|
||||
TaskDone { ok: bool },
|
||||
GameExited(i32),
|
||||
Updates(updates::Info),
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
@@ -418,6 +425,8 @@ fn run_streamed(ui: &Ui, cwd: &Path, line: &str) -> bool {
|
||||
.env("VSLANG", "1033")
|
||||
.env("PYTHONUTF8", "1")
|
||||
.env("PYTHONIOENCODING", "utf-8")
|
||||
// git ne doit jamais attendre un identifiant (fenêtre cachée)
|
||||
.env("GIT_TERMINAL_PROMPT", "0")
|
||||
.stdin(Stdio::null())
|
||||
.stdout(Stdio::piped())
|
||||
.stderr(Stdio::null())
|
||||
@@ -871,6 +880,15 @@ struct App {
|
||||
saves: saves::Listing,
|
||||
/// sauvegardes des autres versions du jeu (saves_xx), pour les voir, les jouer ou les copier
|
||||
other_saves: Vec<(Lang, saves::Listing)>,
|
||||
/// mises à jour : dernier état connu, vérification en cours, lancée au démarrage
|
||||
updates: Option<updates::Info>,
|
||||
updates_busy: bool,
|
||||
updates_started: bool,
|
||||
/// launcher en cours de recompilation : l'ancien exécutable, renommé (rendu si la compilation échoue)
|
||||
launcher_old: Option<PathBuf>,
|
||||
/// nouveau launcher compilé : bouton Redémarrer
|
||||
restart_ready: bool,
|
||||
update_msg: Option<(bool, String)>,
|
||||
save_confirm: Option<u32>,
|
||||
restore_confirm: Option<PathBuf>,
|
||||
save_msg: Option<(bool, String)>,
|
||||
@@ -1056,6 +1074,10 @@ fn to_image(img: &art::Rgba) -> egui::ColorImage {
|
||||
impl App {
|
||||
fn new(cc: &eframe::CreationContext<'_>) -> Self {
|
||||
setup_theme(&cc.egui_ctx);
|
||||
// ancien exécutable laissé par une mise à jour du launcher
|
||||
if let Ok(exe) = std::env::current_exe() {
|
||||
let _ = std::fs::remove_file(exe.with_file_name("DoubleTroubleLauncher.old.exe"));
|
||||
}
|
||||
let (tx, rx) = channel();
|
||||
let cfg = Config::load();
|
||||
// la version suit la langue du launcher : VF en français, VUS en anglais
|
||||
@@ -1081,6 +1103,12 @@ impl App {
|
||||
config_open: None,
|
||||
saves: saves::Listing { saves: Vec::new(), auto: None, last_used: 0, backups: Vec::new() },
|
||||
other_saves: Vec::new(),
|
||||
updates: None,
|
||||
updates_busy: false,
|
||||
updates_started: false,
|
||||
launcher_old: None,
|
||||
restart_ready: false,
|
||||
update_msg: None,
|
||||
save_confirm: None,
|
||||
restore_confirm: None,
|
||||
save_msg: None,
|
||||
@@ -2270,11 +2298,12 @@ impl App {
|
||||
let lang = self.cfg.lang;
|
||||
let tr = |fr: &'static str, e: &'static str| i18n::tr(lang, fr, e);
|
||||
const SHOWN: usize = 5;
|
||||
let rows: Vec<(PathBuf, String, String, String, Option<u32>, Option<PathBuf>)> = self
|
||||
let game = self.checks.game_version().map(|v| v.name()).unwrap_or("?");
|
||||
let rows: Vec<(PathBuf, String, String, String, Option<u32>, Option<PathBuf>, String)> = self
|
||||
.reports
|
||||
.iter()
|
||||
.take(SHOWN)
|
||||
.map(|r| (r.path.clone(), r.date.clone(), r.kind.clone(), r.comment.clone(), r.location, r.save.clone()))
|
||||
.map(|r| (r.path.clone(), r.date.clone(), r.kind.clone(), r.comment.clone(), r.location, r.save.clone(), reports::issue_url(r, game)))
|
||||
.collect();
|
||||
let more = self.reports.len().saturating_sub(SHOWN);
|
||||
let thumbs: Vec<Option<egui::TextureHandle>> = rows.iter().map(|r| r.4.and_then(|l| self.thumb(l))).collect();
|
||||
@@ -2284,6 +2313,8 @@ impl App {
|
||||
enum Act {
|
||||
Replay(PathBuf),
|
||||
Zip(PathBuf),
|
||||
/// zip montré dans l'Explorateur + formulaire d'issue GitHub pré-rempli, dans le navigateur
|
||||
Issue(PathBuf, String),
|
||||
Open(PathBuf),
|
||||
Ask(PathBuf),
|
||||
Cancel,
|
||||
@@ -2295,8 +2326,8 @@ impl App {
|
||||
card(ui, |ui| {
|
||||
title(ui, tr("Rapports de bug", "Bug reports"));
|
||||
ui.label(RichText::new(tr(
|
||||
"En jeu : F12, puis « Signaler un bug ». Rien n'est envoyé : joignez le dossier (ou son zip) à votre message.",
|
||||
"In game: F12, then “Report a bug”. Nothing is sent: attach the folder (or its zip) to your message.",
|
||||
"En jeu : F12, puis « Signaler un bug ». Rien n'est envoyé tout seul : « Signaler » ouvre le formulaire de bug du projet sur GitHub, déjà rempli, et prépare le zip à y glisser. Vous relisez et publiez avec votre compte GitHub.",
|
||||
"In game: F12, then “Report a bug”. Nothing is sent by itself: “Report” opens the project's bug form on GitHub, already filled in, and prepares the zip to drop into it. You review it and post it with your GitHub account.",
|
||||
)).weak());
|
||||
ui.checkbox(&mut self.gs.crash_report, tr("Rapport automatique si le jeu plante", "Automatic report if the game crashes"))
|
||||
.on_hover_text(tr(
|
||||
@@ -2306,7 +2337,7 @@ impl App {
|
||||
if rows.is_empty() {
|
||||
ui.label(RichText::new(tr("Aucun rapport.", "No report.")).weak());
|
||||
}
|
||||
for ((path, date, kind, comment, loc, has_save), tex) in rows.iter().zip(&thumbs) {
|
||||
for ((path, date, kind, comment, loc, has_save, issue), tex) in rows.iter().zip(&thumbs) {
|
||||
ui.horizontal(|ui| {
|
||||
let (r, _) = ui.allocate_exact_size(egui::vec2(96.0, 50.0), egui::Sense::hover());
|
||||
match tex {
|
||||
@@ -2343,6 +2374,16 @@ impl App {
|
||||
if ui.small_button(tr("Ouvrir", "Open")).clicked() {
|
||||
act = Some(Act::Open(path.clone()));
|
||||
}
|
||||
if ui
|
||||
.small_button(tr("Signaler", "Report"))
|
||||
.on_hover_text(tr(
|
||||
"Ouvre le formulaire de bug du projet sur GitHub, pré-rempli avec ce rapport, et montre son zip : glissez-le dans le formulaire, relisez, publiez. Il faut un compte GitHub (gratuit).",
|
||||
"Opens the project's bug form on GitHub, prefilled with this report, and shows its zip: drop it into the form, review, post. A (free) GitHub account is needed.",
|
||||
))
|
||||
.clicked()
|
||||
{
|
||||
act = Some(Act::Issue(path.clone(), issue.clone()));
|
||||
}
|
||||
if ui
|
||||
.small_button("Zip")
|
||||
.on_hover_text(tr("Crée un zip du rapport, prêt à joindre à un message.", "Makes a zip of the report, ready to attach to a message."))
|
||||
@@ -2409,6 +2450,22 @@ impl App {
|
||||
Err(e) => ui.log(format!("!! zip : {e}")),
|
||||
});
|
||||
}
|
||||
Act::Issue(path, url) => {
|
||||
ui.ctx().open_url(egui::OpenUrl::new_tab(url));
|
||||
self.report_msg = Some((
|
||||
true,
|
||||
tr(
|
||||
"Formulaire ouvert dans le navigateur. Glissez-y le zip qui s'affiche dans l'Explorateur.",
|
||||
"Form opened in the browser. Drop into it the zip shown in Explorer.",
|
||||
)
|
||||
.to_string(),
|
||||
));
|
||||
let ui = self.ui_handle();
|
||||
thread::spawn(move || match reports::zip(&path) {
|
||||
Ok(z) => reports::reveal(&z),
|
||||
Err(e) => ui.log(format!("!! zip : {e}")),
|
||||
});
|
||||
}
|
||||
Act::Open(path) => saves::open_folder(&path),
|
||||
Act::Ask(path) => self.report_confirm = Some(path),
|
||||
Act::Cancel => self.report_confirm = None,
|
||||
@@ -2495,6 +2552,8 @@ impl App {
|
||||
match name {
|
||||
"hd" => self.t("Création du pack HD…", "Creating the HD pack…"),
|
||||
"hd-export" => self.t("Export des images…", "Exporting pictures…"),
|
||||
"update" => self.t("Mise à jour…", "Updating…"),
|
||||
"launcher" => self.t("Compilation du launcher…", "Building the launcher…"),
|
||||
_ => self.t("Compilation en cours…", "Working…"),
|
||||
}
|
||||
}
|
||||
@@ -2643,6 +2702,11 @@ impl App {
|
||||
self.checks = c;
|
||||
self.reload_saves();
|
||||
self.art.hd_key.clear();
|
||||
// au démarrage : interroger le dépôt (si l'option est cochée), sinon l'état local seul
|
||||
if !self.updates_started {
|
||||
self.updates_started = true;
|
||||
self.check_updates(self.cfg.check_updates);
|
||||
}
|
||||
if self.busy == Busy::Checking {
|
||||
self.busy = Busy::No;
|
||||
}
|
||||
@@ -2659,15 +2723,24 @@ impl App {
|
||||
self.recheck();
|
||||
}
|
||||
Msg::TaskDone { ok } => {
|
||||
let task = match self.busy {
|
||||
Busy::Task(t) => t,
|
||||
_ => "",
|
||||
};
|
||||
self.progress = None;
|
||||
self.last_ok = Some(ok);
|
||||
self.busy = Busy::No;
|
||||
self.task_finished(task, ok);
|
||||
if let Some(d) = self.open_after.take().filter(|_| ok) {
|
||||
saves::open_folder(&d);
|
||||
}
|
||||
self.reload_mods();
|
||||
self.recheck();
|
||||
}
|
||||
Msg::Updates(info) => {
|
||||
self.updates = Some(info);
|
||||
self.updates_busy = false;
|
||||
}
|
||||
Msg::GameExited(code) => {
|
||||
self.game_running = false;
|
||||
if std::mem::take(&mut self.music_resume) {
|
||||
@@ -2842,6 +2915,10 @@ impl App {
|
||||
ui.label(RichText::new("•").weak());
|
||||
dot(ui, c.built);
|
||||
ui.label(if c.built { self.t("Build prêt", "Build ready") } else { self.t("Pas encore compilé", "Not built yet") });
|
||||
if self.update_pending() {
|
||||
ui.label(RichText::new("•").weak());
|
||||
ui.label(RichText::new(self.t("Mise à jour disponible", "Update available")).color(ACCENT).strong());
|
||||
}
|
||||
if let Busy::Task(name) = self.busy {
|
||||
ui.label(RichText::new("•").weak());
|
||||
ui.spinner();
|
||||
@@ -3023,6 +3100,12 @@ impl App {
|
||||
self.config_open = Some(true);
|
||||
}
|
||||
});
|
||||
// une mise à jour à faire : la carte monte sous Installation, sinon elle reste en bas
|
||||
let pending = self.update_pending();
|
||||
if pending {
|
||||
ui.add_space(10.0);
|
||||
self.updates_card(ui);
|
||||
}
|
||||
ui.add_space(10.0);
|
||||
self.preview_card(ui);
|
||||
ui.add_space(10.0);
|
||||
@@ -3031,6 +3114,10 @@ impl App {
|
||||
self.parties_card(ui);
|
||||
ui.add_space(10.0);
|
||||
self.reports_card(ui);
|
||||
if !pending {
|
||||
ui.add_space(10.0);
|
||||
self.updates_card(ui);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3146,6 +3233,197 @@ impl App {
|
||||
});
|
||||
ui.horizontal(|ui| status(ui, c.built, self.t("Jeu compilé", "Game built"), &c.exe_label()));
|
||||
});
|
||||
ui.add_space(10.0);
|
||||
self.updates_card(ui);
|
||||
}
|
||||
|
||||
/// une mise à jour à récupérer, un launcher ou un jeu à recompiler
|
||||
fn update_pending(&self) -> bool {
|
||||
self.restart_ready
|
||||
|| self.updates.as_ref().is_some_and(|u| (u.behind > 0 && u.branch == "main") || u.launcher_stale || u.engine_stale)
|
||||
}
|
||||
|
||||
/// vérifie les mises à jour en arrière-plan ; `fetch` : interroger le dépôt (réseau)
|
||||
fn check_updates(&mut self, fetch: bool) {
|
||||
let Some(root) = self.root.clone() else { return };
|
||||
if self.updates_busy {
|
||||
return;
|
||||
}
|
||||
self.updates_busy = true;
|
||||
let build_dir = self.checks.build_dir.clone();
|
||||
let ui = self.ui_handle();
|
||||
thread::spawn(move || ui.send(Msg::Updates(updates::check(&root, &build_dir, fetch))));
|
||||
}
|
||||
|
||||
/// après une tâche : commit du jeu compilé, launcher recompilé, état des mises à jour
|
||||
fn task_finished(&mut self, task: &str, ok: bool) {
|
||||
let Some(root) = self.root.clone() else { return };
|
||||
match task {
|
||||
"build" | "build-nogen" if ok => updates::stamp_build(&root, &self.checks.build_dir),
|
||||
"launcher" => {
|
||||
if ok {
|
||||
self.restart_ready = true;
|
||||
} else if let Some(old) = self.launcher_old.take() {
|
||||
// compilation ratée : on remet l'ancien exécutable s'il n'a pas été remplacé
|
||||
if let Ok(exe) = std::env::current_exe() {
|
||||
if !exe.is_file() {
|
||||
let _ = std::fs::rename(&old, &exe);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
if matches!(task, "build" | "build-nogen" | "update" | "launcher") {
|
||||
self.update_msg = None;
|
||||
self.check_updates(false);
|
||||
}
|
||||
}
|
||||
|
||||
/// le launcher qui tourne est celui que cargo compile dans le projet (sinon pas de mise à jour par lui-même)
|
||||
fn self_exe(&self) -> Option<PathBuf> {
|
||||
let root = self.root.as_ref()?;
|
||||
let built = root.join("launcher").join("target").join("release").join("DoubleTroubleLauncher.exe");
|
||||
let exe = std::env::current_exe().ok()?;
|
||||
let same = match (std::fs::canonicalize(&exe), std::fs::canonicalize(&built)) {
|
||||
(Ok(a), Ok(b)) => a == b,
|
||||
_ => false,
|
||||
};
|
||||
same.then_some(exe)
|
||||
}
|
||||
|
||||
/// récupère les nouveautés de main (git pull, seulement en avance rapide)
|
||||
fn pull_updates(&mut self) {
|
||||
self.start_task("update", vec!["git pull --ff-only -q origin main".into()]);
|
||||
}
|
||||
|
||||
/// recompile le launcher : l'exécutable qui tourne est renommé (Windows le permet), cargo écrit le nouveau
|
||||
fn rebuild_launcher(&mut self) {
|
||||
let lang = self.cfg.lang;
|
||||
let Some(exe) = self.self_exe() else { return };
|
||||
let old = exe.with_file_name("DoubleTroubleLauncher.old.exe");
|
||||
let _ = std::fs::remove_file(&old);
|
||||
if let Err(e) = std::fs::rename(&exe, &old) {
|
||||
self.update_msg = Some((false, format!("{} {e}", i18n::tr(lang, "Impossible de remplacer le launcher :", "Can't replace the launcher:"))));
|
||||
return;
|
||||
}
|
||||
self.launcher_old = Some(old);
|
||||
self.start_task("launcher", vec!["cd launcher && cargo build --release".into()]);
|
||||
}
|
||||
|
||||
/// lance le nouveau launcher et ferme celui-ci
|
||||
fn restart_launcher(&mut self) {
|
||||
let Some(root) = self.root.clone() else { return };
|
||||
let exe = root.join("launcher").join("target").join("release").join("DoubleTroubleLauncher.exe");
|
||||
self.cfg.save();
|
||||
if Command::new(&exe).current_dir(root.join("launcher")).spawn().is_ok() {
|
||||
std::process::exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
/// carte Mises à jour : nouveautés de main, launcher et jeu à recompiler
|
||||
fn updates_card(&mut self, ui: &mut egui::Ui) {
|
||||
let lang = self.cfg.lang;
|
||||
let tr = |fr: &'static str, e: &'static str| i18n::tr(lang, fr, e);
|
||||
let busy = self.busy != Busy::No || self.game_running;
|
||||
let u = self.updates.clone();
|
||||
let can_self = self.self_exe().is_some();
|
||||
let mut act = 0;
|
||||
card(ui, |ui| {
|
||||
ui.horizontal(|ui| {
|
||||
title(ui, tr("Mises à jour", "Updates"));
|
||||
if self.updates_busy {
|
||||
ui.spinner();
|
||||
} else if ui
|
||||
.add_enabled(u.as_ref().is_some_and(|u| u.git), egui::Button::new(tr("Vérifier", "Check")))
|
||||
.on_hover_text(tr("Interroge le dépôt du projet (branche main).", "Asks the project's repository (main branch)."))
|
||||
.clicked()
|
||||
{
|
||||
act = 1;
|
||||
}
|
||||
});
|
||||
let Some(u) = u else {
|
||||
ui.label(RichText::new("…").weak());
|
||||
return;
|
||||
};
|
||||
if !u.git {
|
||||
ui.label(RichText::new(tr(
|
||||
"Projet installé sans Git (archive ZIP) : pas de mise à jour automatique. Téléchargez la nouvelle version, ou installez le projet avec git clone (guide, section 3).",
|
||||
"Project installed without Git (ZIP archive): no automatic update. Download the new version, or install the project with git clone (guide, section 3).",
|
||||
)).weak());
|
||||
return;
|
||||
}
|
||||
ui.label(RichText::new(format!("{} {} · {}", tr("Branche", "Branch"), u.branch, u.head)).weak().small());
|
||||
if let Some(e) = &u.error {
|
||||
ui.label(RichText::new(format!("{} {e}", tr("Dépôt injoignable :", "Repository unreachable:"))).color(BAD).small());
|
||||
}
|
||||
let on_main = u.branch == "main";
|
||||
if u.behind > 0 && on_main {
|
||||
ui.label(RichText::new(tr("Mise à jour disponible : {n} changement(s) sur main.", "Update available: {n} change(s) on main.").replace("{n}", &u.behind.to_string())).color(ACCENT).strong());
|
||||
if u.launcher_up {
|
||||
ui.label(format!("• {}", tr("le launcher (à recompiler ensuite, en un clic)", "the launcher (to rebuild afterwards, in one click)")));
|
||||
}
|
||||
if u.engine_up {
|
||||
ui.label(format!("• {}", tr("le moteur du jeu (à recompiler ensuite)", "the game engine (to rebuild afterwards)")));
|
||||
}
|
||||
if !u.launcher_up && !u.engine_up {
|
||||
ui.label(format!("• {}", tr("documentation et outils : rien à recompiler", "documentation and tools: nothing to rebuild")));
|
||||
}
|
||||
if u.dirty {
|
||||
ui.label(RichText::new(tr(
|
||||
"Des fichiers du projet ont été modifiés à la main : mise à jour automatique impossible (voir git status).",
|
||||
"Some project files were changed by hand: automatic update impossible (see git status).",
|
||||
)).color(BAD));
|
||||
} else if ui.add_enabled(!busy, egui::Button::new(RichText::new(tr("Mettre à jour", "Update")).strong())).clicked() {
|
||||
act = 2;
|
||||
}
|
||||
} else if u.behind > 0 {
|
||||
ui.label(RichText::new(tr(
|
||||
"Branche de travail : main a des nouveautés, à fusionner avec Git.",
|
||||
"Work branch: main has new changes, to merge with Git.",
|
||||
)).weak());
|
||||
}
|
||||
if self.restart_ready {
|
||||
ui.label(RichText::new(tr("Nouveau launcher compilé.", "New launcher built.")).color(OK));
|
||||
if ui.button(RichText::new(tr("Redémarrer le launcher", "Restart the launcher")).strong()).clicked() {
|
||||
act = 4;
|
||||
}
|
||||
} else if u.launcher_stale {
|
||||
ui.label(RichText::new(tr("Le launcher a été mis à jour : recompilez-le.", "The launcher was updated: rebuild it.")).color(ACCENT));
|
||||
if can_self {
|
||||
if ui
|
||||
.add_enabled(!busy, egui::Button::new(tr("Recompiler le launcher", "Rebuild the launcher")))
|
||||
.on_hover_text(tr("Une à deux minutes, puis le launcher redémarre.", "One or two minutes, then the launcher restarts."))
|
||||
.clicked()
|
||||
{
|
||||
act = 3;
|
||||
}
|
||||
} else {
|
||||
ui.label(RichText::new(tr("Dans le dossier launcher : cargo build --release", "In the launcher folder: cargo build --release")).monospace().small());
|
||||
}
|
||||
}
|
||||
if u.engine_stale {
|
||||
ui.label(RichText::new(tr("Le moteur du jeu a changé depuis la dernière compilation.", "The game engine changed since the last build.")).color(ACCENT));
|
||||
if ui.add_enabled(!busy && self.checks.can_build(), egui::Button::new(tr("Recompiler le jeu", "Rebuild the game"))).clicked() {
|
||||
act = 5;
|
||||
}
|
||||
}
|
||||
if !self.update_pending() && u.error.is_none() {
|
||||
ui.label(RichText::new(tr("Tout est à jour.", "Everything is up to date.")).color(OK));
|
||||
}
|
||||
if let Some((ok, m)) = &self.update_msg {
|
||||
ui.label(RichText::new(m).color(if *ok { OK } else { BAD }));
|
||||
}
|
||||
ui.checkbox(&mut self.cfg.check_updates, tr("Vérifier au démarrage", "Check at startup"));
|
||||
});
|
||||
match act {
|
||||
1 => self.check_updates(true),
|
||||
2 => self.pull_updates(),
|
||||
3 => self.rebuild_launcher(),
|
||||
4 => self.restart_launcher(),
|
||||
5 => self.build(true),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
/// carte Compilation : version du jeu choisi, reconnue d'après TUCKER.EXE et INTRO.EXE
|
||||
|
||||
@@ -12,6 +12,8 @@ pub struct Report {
|
||||
pub kind: String,
|
||||
pub comment: String,
|
||||
pub location: Option<u32>,
|
||||
/// ligne Version du rapport : commit du jeu et date de compilation
|
||||
pub version: String,
|
||||
/// la partie à cet instant (SAVEGM.98 ; SAVEGM.99 dans les premiers rapports) : de quoi retomber sur le bug
|
||||
pub save: Option<PathBuf>,
|
||||
}
|
||||
@@ -56,6 +58,7 @@ pub fn list_in(d: &Path) -> Vec<Report> {
|
||||
kind: field(&text, "Type").unwrap_or("?").to_string(),
|
||||
comment: field(&text, "Commentaire").filter(|c| *c != "(aucun)").unwrap_or("").to_string(),
|
||||
location: field(&text, "Lieu").and_then(|l| l.parse().ok()),
|
||||
version: field(&text, "Version").unwrap_or("").to_string(),
|
||||
save,
|
||||
path,
|
||||
})
|
||||
@@ -83,6 +86,38 @@ pub fn zip(report: &Path) -> Result<PathBuf, String> {
|
||||
if ok && out.is_file() { Ok(out) } else { Err("Compress-Archive a échoué".into()) }
|
||||
}
|
||||
|
||||
/// dépôt du projet, où les bugs se signalent (issues)
|
||||
pub const ISSUES: &str = "https://github.com/Linkatplug/DoubleTroubleRecomp/issues";
|
||||
|
||||
/// encodage d'une valeur de paramètre d'URL
|
||||
fn encode(s: &str) -> String {
|
||||
s.bytes()
|
||||
.map(|b| match b {
|
||||
b'A'..=b'Z' | b'a'..=b'z' | b'0'..=b'9' | b'-' | b'_' | b'.' | b'~' => (b as char).to_string(),
|
||||
_ => format!("%{b:02X}"),
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
/// page « nouvelle issue » de GitHub, formulaire de bug (.github/ISSUE_TEMPLATE/bug.yml) pré-rempli avec le
|
||||
/// rapport. Rien n'est envoyé tout seul : la personne relit, joint le zip et publie avec son compte GitHub.
|
||||
pub fn issue_url(r: &Report, game: &str) -> String {
|
||||
let comment: String = r.comment.chars().take(1500).collect();
|
||||
let short: String = r.comment.chars().take(60).collect();
|
||||
let title = if short.is_empty() { r.kind.clone() } else { format!("{} : {short}", r.kind) };
|
||||
let fields = [
|
||||
("title", title),
|
||||
("type", r.kind.clone()),
|
||||
("comment", comment),
|
||||
("location", r.location.map(|l| l.to_string()).unwrap_or_default()),
|
||||
("version", r.version.clone()),
|
||||
("game", game.to_string()),
|
||||
("date", r.date.clone()),
|
||||
];
|
||||
let q: Vec<String> = fields.iter().filter(|(_, v)| !v.is_empty()).map(|(k, v)| format!("{k}={}", encode(v))).collect();
|
||||
format!("{ISSUES}/new?template=bug.yml&labels=bug&{}", q.join("&"))
|
||||
}
|
||||
|
||||
/// envoie le dossier du rapport à la corbeille (récupérable)
|
||||
pub fn trash(report: &Path) -> bool {
|
||||
let p = report.display().to_string().replace('\'', "''");
|
||||
@@ -125,6 +160,9 @@ mod tests {
|
||||
assert_eq!(l[0].comment, "");
|
||||
assert_eq!(l[0].location, Some(32));
|
||||
assert!(l[0].save.is_some());
|
||||
let u = issue_url(&l[0], "fr");
|
||||
assert!(u.contains("template=bug.yml") && u.contains("type=Graphismes%20HD") && u.contains("location=32"));
|
||||
assert!(!u.contains("comment="));
|
||||
let _ = std::fs::remove_dir_all(&base);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
//! Mises à jour du projet (clone Git) : compare avec la branche main du dépôt d'origine et dit ce qui a
|
||||
//! changé, le launcher (launcher/) et/ou le moteur du jeu (runtime/, traducteur, build.bat). Les deux
|
||||
//! se mettent à jour séparément : récupérer (git pull), puis recompiler le launcher et/ou le jeu.
|
||||
//! - le launcher connaît le commit dont il est compilé (build.rs, DTR_LAUNCHER_COMMIT) ;
|
||||
//! - le jeu compilé par le launcher a son commit dans build[_xx]\commit.txt.
|
||||
|
||||
use std::os::windows::process::CommandExt;
|
||||
use std::path::Path;
|
||||
use std::process::{Command, Stdio};
|
||||
|
||||
const NO_WINDOW: u32 = 0x0800_0000;
|
||||
|
||||
/// commit des sources du launcher qui tourne (vide si compilé hors d'un clone Git)
|
||||
pub const LAUNCHER_COMMIT: &str = env!("DTR_LAUNCHER_COMMIT");
|
||||
|
||||
/// fichiers dont dépend le jeu compilé : un changement demande de le recompiler
|
||||
pub const ENGINE: [&str; 6] = ["runtime", "tools/recomp.py", "tools/le.py", "tools/version.py", "build.bat", "assets/icon"];
|
||||
pub const LAUNCHER: [&str; 1] = ["launcher"];
|
||||
|
||||
/// fichier du dossier de compilation qui retient le commit compilé
|
||||
pub const STAMP: &str = "commit.txt";
|
||||
|
||||
#[derive(Clone, Default, Debug)]
|
||||
pub struct Info {
|
||||
/// le projet est un clone Git (sinon : installé depuis un ZIP, pas de mise à jour automatique)
|
||||
pub git: bool,
|
||||
pub branch: String,
|
||||
/// commit actuel, court
|
||||
pub head: String,
|
||||
/// le dépôt n'a pas pu être joint (hors ligne…)
|
||||
pub error: Option<String>,
|
||||
/// commits de main pas encore récupérés
|
||||
pub behind: u32,
|
||||
/// ces commits touchent le launcher / le moteur du jeu
|
||||
pub launcher_up: bool,
|
||||
pub engine_up: bool,
|
||||
/// fichiers suivis modifiés à la main : pas de mise à jour automatique
|
||||
pub dirty: bool,
|
||||
/// sources du launcher plus récentes que le launcher qui tourne : à recompiler
|
||||
pub launcher_stale: bool,
|
||||
/// moteur changé depuis la compilation du jeu : à recompiler
|
||||
pub engine_stale: bool,
|
||||
}
|
||||
|
||||
fn git(root: &Path, args: &[&str]) -> Result<String, String> {
|
||||
let out = Command::new("git")
|
||||
.args(args)
|
||||
.current_dir(root)
|
||||
.env("GIT_TERMINAL_PROMPT", "0")
|
||||
.env("GCM_INTERACTIVE", "never")
|
||||
.creation_flags(NO_WINDOW)
|
||||
.stdin(Stdio::null())
|
||||
.output()
|
||||
.map_err(|e| e.to_string())?;
|
||||
if out.status.success() {
|
||||
Ok(String::from_utf8_lossy(&out.stdout).trim().to_string())
|
||||
} else {
|
||||
Err(String::from_utf8_lossy(&out.stderr).lines().last().unwrap_or("git").trim().to_string())
|
||||
}
|
||||
}
|
||||
|
||||
/// une des lignes (chemins de git diff --name-only) est dans un des dossiers ou fichiers donnés
|
||||
pub fn touches(files: &str, paths: &[&str]) -> bool {
|
||||
files.lines().map(str::trim).any(|f| paths.iter().any(|p| f == *p || f.starts_with(&format!("{p}/"))))
|
||||
}
|
||||
|
||||
/// fichiers changés entre deux commits, limités à `paths` (Err si un commit est inconnu)
|
||||
fn changed(root: &Path, from: &str, to: &str, paths: &[&str]) -> Result<bool, String> {
|
||||
let mut args = vec!["diff", "--name-only", from, to, "--"];
|
||||
args.extend_from_slice(paths);
|
||||
git(root, &args).map(|s| !s.is_empty())
|
||||
}
|
||||
|
||||
/// état des mises à jour ; `fetch` : interroger le dépôt (réseau), sinon seulement l'état local
|
||||
pub fn check(root: &Path, build_dir: &Path, fetch: bool) -> Info {
|
||||
let mut i = Info { git: root.join(".git").exists(), ..Default::default() };
|
||||
if !i.git {
|
||||
return i;
|
||||
}
|
||||
i.branch = git(root, &["rev-parse", "--abbrev-ref", "HEAD"]).unwrap_or_default();
|
||||
i.head = git(root, &["rev-parse", "--short", "HEAD"]).unwrap_or_default();
|
||||
if fetch {
|
||||
if let Err(e) = git(root, &["fetch", "-q", "origin", "main"]) {
|
||||
i.error = Some(e);
|
||||
}
|
||||
}
|
||||
if git(root, &["rev-parse", "--verify", "-q", "origin/main"]).is_ok() {
|
||||
i.behind = git(root, &["rev-list", "--count", "HEAD..origin/main"]).ok().and_then(|n| n.parse().ok()).unwrap_or(0);
|
||||
if i.behind > 0 {
|
||||
let files = git(root, &["diff", "--name-only", "HEAD...origin/main"]).unwrap_or_default();
|
||||
i.launcher_up = touches(&files, &LAUNCHER);
|
||||
i.engine_up = touches(&files, &ENGINE);
|
||||
}
|
||||
}
|
||||
i.dirty = git(root, &["status", "--porcelain", "--untracked-files=no"]).is_ok_and(|s| !s.is_empty());
|
||||
if !LAUNCHER_COMMIT.is_empty() {
|
||||
i.launcher_stale = changed(root, LAUNCHER_COMMIT, "HEAD", &LAUNCHER).unwrap_or(false);
|
||||
}
|
||||
if let (true, Ok(stamp)) = (build_dir.join("tucker.exe").is_file(), std::fs::read_to_string(build_dir.join(STAMP))) {
|
||||
i.engine_stale = changed(root, stamp.trim(), "HEAD", &ENGINE).unwrap_or(false);
|
||||
}
|
||||
i
|
||||
}
|
||||
|
||||
/// retient le commit compilé dans le dossier de compilation du jeu
|
||||
pub fn stamp_build(root: &Path, build_dir: &Path) {
|
||||
if let Ok(h) = git(root, &["rev-parse", "HEAD"]) {
|
||||
let _ = std::fs::write(build_dir.join(STAMP), h + "\n");
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn classifies_paths() {
|
||||
let f = "docs/GUIDE.md\nlauncher/src/main.rs\n";
|
||||
assert!(touches(f, &LAUNCHER));
|
||||
assert!(!touches(f, &ENGINE));
|
||||
assert!(touches("runtime/hd.c\n", &ENGINE));
|
||||
assert!(touches("build.bat\n", &ENGINE));
|
||||
assert!(!touches("tools/hd_export.py\nlauncher.txt\n", &ENGINE));
|
||||
assert!(!touches("launcher.txt\n", &LAUNCHER));
|
||||
}
|
||||
|
||||
/// un dépôt « origine » avance sur main : le clone voit le retard et ce qui a changé
|
||||
#[test]
|
||||
fn sees_updates_on_main() {
|
||||
let base = std::env::temp_dir().join(format!("dtr_updates_{}", std::process::id()));
|
||||
let _ = std::fs::remove_dir_all(&base);
|
||||
let (orig, clone) = (base.join("orig"), base.join("clone"));
|
||||
std::fs::create_dir_all(orig.join("runtime")).unwrap();
|
||||
let g = |d: &Path, a: &[&str]| git(d, a).unwrap();
|
||||
g(&orig, &["init", "-q", "-b", "main"]);
|
||||
g(&orig, &["config", "user.email", "t@t"]);
|
||||
g(&orig, &["config", "user.name", "t"]);
|
||||
std::fs::write(orig.join("runtime").join("a.c"), "1").unwrap();
|
||||
g(&orig, &["add", "."]);
|
||||
g(&orig, &["commit", "-q", "-m", "1"]);
|
||||
g(&base, &["clone", "-q", "orig", "clone"]);
|
||||
let i = check(&clone, &clone.join("build"), true);
|
||||
assert!(i.git && i.branch == "main" && i.behind == 0 && i.error.is_none());
|
||||
// le moteur change sur main
|
||||
std::fs::write(orig.join("runtime").join("a.c"), "2").unwrap();
|
||||
g(&orig, &["commit", "-q", "-am", "2"]);
|
||||
let i = check(&clone, &clone.join("build"), true);
|
||||
assert_eq!(i.behind, 1);
|
||||
assert!(i.engine_up && !i.launcher_up && !i.dirty);
|
||||
// un jeu compilé avant la mise à jour est à recompiler une fois celle-ci récupérée
|
||||
std::fs::create_dir_all(clone.join("build")).unwrap();
|
||||
std::fs::write(clone.join("build").join("tucker.exe"), "").unwrap();
|
||||
stamp_build(&clone, &clone.join("build"));
|
||||
g(&clone, &["pull", "-q", "--ff-only", "origin", "main"]);
|
||||
let i = check(&clone, &clone.join("build"), false);
|
||||
assert!(i.behind == 0 && i.engine_stale);
|
||||
let _ = std::fs::remove_dir_all(&base);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user