Launcher : carte Rapports de bug (rejouer, zip, ouvrir, corbeille)

- Liste les rapports écrits par le jeu (%APPDATA%\DoubleTroubleRecomp\rapports),
  les plus récents d'abord : type, date, lieu (vignette), commentaire.
- Rejouer : copie SAVEGM.99 du rapport dans saves\ puis lance --charger 99 ;
  l'emplacement 99 est caché de la liste des sauvegardes (et de la renumérotation).
- Zip prêt à joindre, Ouvrir, Supprimer (corbeille, après confirmation).
- Case « Rapport automatique si le jeu plante » : clé [debug] crash_report.
- GUIDE FR/EN : signaler un bug ; SETTINGS.en.md : [debug] et « Bug reports ».

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
linkatplugandClaude Opus 5.5 committed 2026-12-05 13:46:34 +01:00
1 parent 96499dc89f
commit 77138937b4
7 files changed
+395 -4

No files matched your search

+14 -2
View File
@@ -418,8 +418,20 @@ Roadmap: [ROADMAP.en.md](ROADMAP.en.md).
| **Picture too small / too big** | Window resolution in the launcher or F12, or full screen (F11). |
| **Odd settings** | Delete `%APPDATA%\DoubleTroubleRecomp\settings.ini`: the game starts again from the defaults. |
To report a problem: open an issue on the repository with your Windows version, graphics card and
the log text.
To report a problem: in game, **F12 → Signaler un bug** (Report a bug). Pick the kind of bug, add a
comment if you like, then **Écrire le rapport** (Write the report). The game creates a folder with a
screenshot, the game state at that moment and your settings (nothing is sent). If it crashes, it
writes a report by itself (**Rapport automatique si le jeu plante** box).
In the launcher, the **Bug reports** card (under Saved games) lists the latest reports:
- **Replay** starts the game again on the report's save, at the moment of the bug;
- **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.
The folder's contents are detailed in [SETTINGS.en.md](SETTINGS.en.md#bug-reports).
## 14. Update, uninstall
+14 -2
View File
@@ -430,8 +430,20 @@ Feuille de route : [ROADMAP.md](ROADMAP.md).
| **Image trop petite / trop grande** | Résolution de la fenêtre dans le launcher ou F12, ou plein écran (F11). |
| **Réglages bizarres** | Supprimez `%APPDATA%\DoubleTroubleRecomp\settings.ini` : le jeu repart des valeurs par défaut. |
Pour signaler un problème : ouvrez un ticket sur le dépôt avec votre version de Windows, votre
carte graphique et le texte du journal.
Pour signaler un problème : en jeu, **F12 → Signaler un bug**. Choisissez le type de bug, ajoutez un
commentaire si vous voulez, puis **Écrire le rapport**. Le jeu crée un dossier avec une capture, la
partie à cet instant et vos réglages (rien n'est envoyé). S'il plante, il écrit un rapport tout seul
(case **Rapport automatique si le jeu plante**).
Dans le launcher, la carte **Rapports de bug** (sous Sauvegardes) liste les derniers rapports :
- **Rejouer** relance le jeu sur la partie du rapport, au moment du bug ;
- **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.
Le détail du contenu est dans [SETTINGS.md](SETTINGS.md#rapports-de-bug).
## 14. Mettre à jour, désinstaller
+47
View File
@@ -58,6 +58,9 @@ sfx_volume=90
enabled=1
dir=
disabled=
[debug]
crash_report=1
```
## Keys
@@ -114,6 +117,50 @@ Mods are read at startup: a change to `[mods]` takes effect on the next launch.
`hd_sprites` and `hd_panel`, however, apply immediately from the F12 menu; the F10 key toggles `hd_pack` during play, with a
fade. The mod format is described in [MODS.en.md](MODS.en.md).
### `[debug]`
| Key | Values | Default | Effect |
|---|---|---|---|
| `crash_report` | `0` / `1` | `1` | Bug report written by itself if the game crashes (see "Bug reports" below). F12 menu: « Signaler un bug », then « Rapport automatique si le jeu plante ». In the launcher: **Bug reports** card |
## Bug reports
The F12 menu's **Signaler un bug** (Report a bug) button opens a page to pick the kind of bug:
- original graphics;
- HD graphics;
- sound;
- text;
- area or click;
- game stuck;
- crash;
- other.
A comment can be added. **Écrire le rapport** (Write the report) creates a folder
`rapports\YYYY-MM-DD_HHMMSS` next to `settings.ini` (on Windows: `%APPDATA%\DoubleTroubleRecomp\rapports`).
**Ouvrir le dossier** then shows it. Nothing is sent: to report the bug, attach the folder, or a zip of it,
to your message. The launcher's **Bug reports** card lists the latest reports and can zip them, open them,
move them to the recycle bin, or **Replay** a report's save.
Folder contents:
| File | Contents |
|---|---|
| `rapport.txt` | Kind, comment, date and version, then:<br>- the place: location, scrolling, Bud's position, mouse, the location's clickable areas;<br>- the display settings;<br>- the active mods |
| `jeu.bmp` | Game picture, 320 × 200, as it was before the menu opened |
| `ecran.bmp` | Screenshot of the window, HD backgrounds and sprites included. Halved beyond 2560 pixels wide |
| `SAVEGM.99` | The game at that moment, in the game's save format. To get back to the bug: copy it into the saves folder, then start with `--charger 99` (the launcher's **Replay** button does both) |
| `settings.ini` | Settings at the time of the report |
| `memoire.bin` | Game variables (128 KB), for analysis |
| `plantage.dmp` | Crash only: Windows minidump |
With `crash_report=1`, a "crash or freeze" report is written in two cases:
- an unhandled exception: the report gives the code, address and module;
- a stop of the recompiled game.
A crash inside the graphics driver escapes Windows and leaves no report. It remains visible in the Event Viewer.
## Command line
Display options apply **to the current session only**. They are not written to the file, unless the
+178
View File
@@ -13,6 +13,7 @@ mod art;
mod mods;
mod music;
mod preview;
mod reports;
mod saves;
mod settings;
@@ -837,6 +838,10 @@ struct App {
player: music::Player,
music_resume: bool,
progress: Option<Progress>,
/// rapports de bug du jeu, le plus récent d'abord ; suppression à confirmer ; message du dernier geste
reports: Vec<reports::Report>,
report_confirm: Option<PathBuf>,
report_msg: Option<(bool, String)>,
/// taille de la fenêtre (points egui) au moment où le zoom automatique a été changé : tant qu'elle n'a
/// pas bougé, on ne recalcule pas (egui la remet à jour une image plus tard, sinon le zoom oscille)
zoom_wait: Option<(i32, i32)>,
@@ -1014,6 +1019,9 @@ impl App {
player,
music_resume: false,
progress: None,
reports: reports::list(),
report_confirm: None,
report_msg: None,
zoom_wait: None,
pos_fix: None,
tx,
@@ -1885,6 +1893,173 @@ impl App {
}
}
/// rapports de bug : les plus récents, avec de quoi les ouvrir, les zipper, rejouer leur partie ou les jeter
fn reports_card(&mut self, ui: &mut egui::Ui) {
let en = self.cfg.lang == Lang::En;
let tr = |fr: &'static str, e: &'static str| if en { e } else { fr };
const SHOWN: usize = 5;
let rows: Vec<(PathBuf, String, String, String, Option<u32>, bool)> = self
.reports
.iter()
.take(SHOWN)
.map(|r| (r.path.clone(), r.date.clone(), r.kind.clone(), r.comment.clone(), r.location, r.save.is_some()))
.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();
let can_play = self.checks.can_load && self.checks.built && self.checks.game_dir.is_some() && self.busy == Busy::No && !self.game_running;
let confirm = self.report_confirm.clone();
let msg = self.report_msg.clone();
enum Act {
Replay(PathBuf),
Zip(PathBuf),
Open(PathBuf),
Ask(PathBuf),
Cancel,
Trash(PathBuf),
OpenAll,
Refresh,
}
let mut act: Option<Act> = None;
card(ui, |ui| {
title(ui, tr("Rapports de bug", "Bug reports"));
ui.label(RichText::new(tr(
"En jeu : F12 → Signaler un bug. Rien n'est envoyé : joignez le dossier (ou son zip) à votre message.",
"In game: F12 → Report a bug. Nothing is sent: attach the folder (or its zip) to your message.",
)).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(
"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).",
));
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) {
ui.horizontal(|ui| {
let (r, _) = ui.allocate_exact_size(egui::vec2(96.0, 50.0), egui::Sense::hover());
match tex {
Some(t) => paint_cover(ui.painter(), r, t, 1.0, 0.0),
None => {
ui.painter().rect_filled(r, CornerRadius::ZERO, CARD_DARK);
}
}
ui.painter().rect_stroke(r, CornerRadius::ZERO, Stroke::new(1.5, Color32::BLACK), egui::StrokeKind::Inside);
ui.vertical(|ui| {
ui.label(RichText::new(kind).strong());
let place = loc.map(|l| format!(" · {} {l}", tr("lieu", "location"))).unwrap_or_default();
ui.label(RichText::new(format!("{date}{place}")).weak());
if !comment.is_empty() {
let c: String = comment.chars().take(60).collect();
ui.label(RichText::new(if comment.chars().count() > 60 { format!("« {c}… »") } else { format!("« {c} »") }).small());
}
});
ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| {
if confirm.as_ref() == Some(path) {
if ui.button(tr("Annuler", "Cancel")).clicked() {
act = Some(Act::Cancel);
}
if ui
.button(RichText::new(tr("Mettre à la corbeille", "Move to the bin")).color(BAD))
.clicked()
{
act = Some(Act::Trash(path.clone()));
}
} else {
if ui.small_button(tr("Supprimer", "Delete")).clicked() {
act = Some(Act::Ask(path.clone()));
}
if ui.small_button(tr("Ouvrir", "Open")).clicked() {
act = Some(Act::Open(path.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."))
.clicked()
{
act = Some(Act::Zip(path.clone()));
}
if *has_save
&& can_play
&& ui
.add(egui::Button::new(RichText::new(tr("Rejouer", "Replay")).strong().color(Color32::BLACK)).fill(ACCENT))
.on_hover_text(tr(
"Lance le jeu sur la partie enregistrée par le rapport, au moment du bug.",
"Starts the game on the save stored by the report, at the moment of the bug.",
))
.clicked()
{
act = Some(Act::Replay(path.clone()));
}
}
});
});
}
ui.add_space(4.0);
ui.horizontal_wrapped(|ui| {
if more > 0 {
ui.label(RichText::new(format!("+ {more} {}", tr("autres", "more"))).weak());
}
if ui.button(tr("Ouvrir le dossier des rapports", "Open the reports folder")).clicked() {
act = Some(Act::OpenAll);
}
if ui.button(tr("Actualiser", "Refresh")).clicked() {
act = Some(Act::Refresh);
}
});
if let Some((ok, m)) = &msg {
ui.label(RichText::new(m).color(if *ok { OK } else { BAD }));
}
});
let Some(a) = act else { return };
match a {
Act::Replay(path) => {
// la partie du rapport va dans l'emplacement 99 des sauvegardes (caché de la liste), puis --charger 99
let Some(dir) = self.saves_dir() else { return };
let _ = std::fs::create_dir_all(&dir);
let dst = dir.join(format!("SAVEGM.{}", reports::REPLAY_SLOT));
match std::fs::copy(path.join("SAVEGM.99"), &dst) {
Ok(_) => {
self.report_msg = None;
self.play_slot(Some(reports::REPLAY_SLOT));
}
Err(e) => self.report_msg = Some((false, format!("SAVEGM.99 : {e}"))),
}
}
Act::Zip(path) => {
self.report_msg = Some((true, tr("Création du zip…", "Making the zip…").to_string()));
let ui = self.ui_handle();
thread::spawn(move || match reports::zip(&path) {
Ok(z) => {
reports::reveal(&z);
ui.log(format!("zip : {}", z.display()));
}
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,
Act::Trash(path) => {
self.report_confirm = None;
self.report_msg = if reports::trash(&path) {
Some((true, tr("Rapport mis à la corbeille.", "Report moved to the bin.").to_string()))
} else {
Some((false, tr("Impossible de supprimer ce rapport.", "Couldn't delete this report.").to_string()))
};
self.reports = reports::list();
}
Act::OpenAll => {
if let Some(d) = reports::dir() {
saves::open_folder(&d);
}
}
Act::Refresh => {
self.report_msg = None;
self.reports = reports::list();
}
}
}
fn recheck(&mut self) {
let Some(root) = self.root.clone() else { return };
if self.busy != Busy::No {
@@ -2099,6 +2274,7 @@ impl App {
}
self.reload_saves();
self.reload_mods();
self.reports = reports::list();
// le joueur a pu changer ses réglages avec F12 : on relit le fichier
self.gs = settings::GameSettings::load();
self.gs_saved = self.gs.clone();
@@ -2461,6 +2637,8 @@ impl App {
self.preview_card(ui);
ui.add_space(10.0);
self.saves_card(ui);
ui.add_space(10.0);
self.reports_card(ui);
return;
}
+133
View File
@@ -0,0 +1,133 @@
//! Rapports de bug écrits par le jeu (F12 → Signaler un bug, ou tout seul si le jeu plante) :
//! un dossier par rapport dans %APPDATA%\DoubleTroubleRecomp\rapports\AAAA-MM-JJ_HHMMSS, avec
//! rapport.txt (type, commentaire, lieu…), jeu.bmp, ecran.bmp, SAVEGM.99, settings.ini, memoire.bin.
//! Voir docs/SETTINGS.md, « Rapports de bug ».
use std::path::{Path, PathBuf};
pub struct Report {
pub path: PathBuf,
/// date lisible, tirée du nom du dossier (AAAA-MM-JJ_HHMMSS)
pub date: String,
pub kind: String,
pub comment: String,
pub location: Option<u32>,
/// la partie à cet instant (SAVEGM.99) : de quoi retomber sur le bug
pub save: Option<PathBuf>,
}
/// emplacement d'une sauvegarde de rapport dans le dossier des sauvegardes ; à part des parties du joueur
pub const REPLAY_SLOT: u32 = 99;
pub fn dir() -> Option<PathBuf> {
crate::settings::path().and_then(|p| p.parent().map(|d| d.join("rapports")))
}
fn field<'a>(text: &'a str, name: &str) -> Option<&'a str> {
text.lines().find_map(|l| {
let (k, v) = l.split_once(':')?;
(k.trim() == name).then(|| v.trim())
})
}
fn pretty_date(name: &str) -> String {
// 2026-12-05_134501 -> 2026-12-05 13:45
match name.split_once('_') {
Some((d, t)) if t.len() >= 4 => format!("{d} {}:{}", &t[0..2], &t[2..4]),
_ => name.to_string(),
}
}
/// rapports, le plus récent d'abord
pub fn list() -> Vec<Report> {
let Some(d) = dir() else { return Vec::new() };
list_in(&d)
}
pub fn list_in(d: &Path) -> Vec<Report> {
let mut v: Vec<Report> = std::fs::read_dir(d)
.map(|rd| {
rd.flatten()
.filter(|e| e.path().is_dir())
.filter_map(|e| {
let path = e.path();
let text = std::fs::read_to_string(path.join("rapport.txt")).ok()?;
let name = e.file_name().to_string_lossy().to_string();
let save = path.join("SAVEGM.99");
Some(Report {
date: pretty_date(&name),
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()),
save: save.is_file().then_some(save),
path,
})
})
.collect()
})
.unwrap_or_default();
v.sort_by(|a, b| b.path.file_name().cmp(&a.path.file_name()));
v
}
/// zip du rapport à côté de son dossier (rapports\<nom>.zip), pour le joindre à un message
pub fn zip(report: &Path) -> Result<PathBuf, String> {
let name = report.file_name().ok_or("dossier invalide")?.to_string_lossy().to_string();
let out = report.with_file_name(format!("{name}.zip"));
let q = |p: &Path| format!("'{}'", p.display().to_string().replace('\'', "''"));
let script = format!("Compress-Archive -Path {} -DestinationPath {} -Force", q(&report.join("*")), q(&out));
let ok = std::process::Command::new("powershell")
.args(["-NoProfile", "-NonInteractive", "-Command", &script])
.stdin(std::process::Stdio::null())
.stdout(std::process::Stdio::null())
.stderr(std::process::Stdio::null())
.status()
.is_ok_and(|s| s.success());
if ok && out.is_file() { Ok(out) } else { Err("Compress-Archive a échoué".into()) }
}
/// envoie le dossier du rapport à la corbeille (récupérable)
pub fn trash(report: &Path) -> bool {
let p = report.display().to_string().replace('\'', "''");
let script = format!(
"Add-Type -AssemblyName Microsoft.VisualBasic; \
[Microsoft.VisualBasic.FileIO.FileSystem]::DeleteDirectory('{p}', 'OnlyErrorDialogs', 'SendToRecycleBin')"
);
std::process::Command::new("powershell")
.args(["-NoProfile", "-NonInteractive", "-Command", &script])
.stdin(std::process::Stdio::null())
.status()
.is_ok_and(|s| s.success())
&& !report.exists()
}
/// montre un fichier sélectionné dans l'Explorateur
pub fn reveal(file: &Path) {
let _ = std::process::Command::new("explorer").arg(format!("/select,{}", file.display())).spawn();
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn reads_report() {
let base = std::env::temp_dir().join(format!("dtr_reports_{}", std::process::id()));
let r = base.join("2026-12-05_134501");
std::fs::create_dir_all(&r).unwrap();
std::fs::write(
r.join("rapport.txt"),
"Rapport de bug - DoubleTroubleRecomp\n\nType : Graphismes HD\nCommentaire : (aucun)\n\nOù\nLieu : 32\n",
)
.unwrap();
std::fs::write(r.join("SAVEGM.99"), [0u8; 2000]).unwrap();
let l = list_in(&base);
assert_eq!(l.len(), 1);
assert_eq!(l[0].date, "2026-12-05 13:45");
assert_eq!(l[0].kind, "Graphismes HD");
assert_eq!(l[0].comment, "");
assert_eq!(l[0].location, Some(32));
assert!(l[0].save.is_some());
let _ = std::fs::remove_dir_all(&base);
}
}
+4
View File
@@ -41,6 +41,10 @@ pub fn list(dir: &Path) -> Listing {
for e in rd.flatten() {
let name = e.file_name().to_string_lossy().to_string();
let Some(slot) = slot_of(&name) else { continue };
// 99 : sauvegarde d'un rapport de bug, rejouée par le launcher ; pas une partie du joueur
if slot >= 99 {
continue;
}
let data = std::fs::read(e.path()).unwrap_or_default();
let location = data
.get(0x730..0x734)
+5
View File
@@ -27,6 +27,8 @@ pub struct GameSettings {
pub wide_fill: bool,
/// maintenir Espace montre les zones cliquables
pub hotspots: bool,
/// [debug] rapport de bug écrit tout seul si le jeu plante
pub crash_report: bool,
pub vol: [u32; 4],
pub mods_enabled: bool,
/// dossier des mods ; vide = détection automatique par le jeu
@@ -52,6 +54,7 @@ impl Default for GameSettings {
hd_panel: true,
wide_fill: true,
hotspots: true,
crash_report: true,
vol: [100; 4],
mods_enabled: true,
mods_dir: String::new(),
@@ -128,6 +131,7 @@ impl GameSettings {
("display", "hd_panel") => s.hd_panel = parse_bool(v).unwrap_or(s.hd_panel),
("display", "wide_fill") => s.wide_fill = parse_bool(v).unwrap_or(s.wide_fill),
("display", "hotspots") => s.hotspots = parse_bool(v).unwrap_or(s.hotspots),
("debug", "crash_report") => s.crash_report = parse_bool(v).unwrap_or(s.crash_report),
("mods", "enabled") => s.mods_enabled = parse_bool(v).unwrap_or(s.mods_enabled),
("mods", "dir") => s.mods_dir = v.to_string(),
("mods", "disabled") => {
@@ -164,6 +168,7 @@ impl GameSettings {
for (i, k) in VOLUMES.iter().enumerate() {
e.push(("audio", k, self.vol[i].to_string()));
}
e.push(("debug", "crash_report", b(self.crash_report)));
e.push(("mods", "enabled", b(self.mods_enabled)));
e.push(("mods", "dir", self.mods_dir.clone()));
e.push(("mods", "disabled", self.mods_disabled.join(",")));