1
0
Fork 0
mirror of https://github.com/jugeeya/UltimateTrainingModpack.git synced 2024-12-26 18:29:16 +00:00

Improve debug informations by displaying SSBU and Atmosphère version (#710)

* add version reports to crashlogs

* group error message with location

* adjust versio report position
This commit is contained in:
Muhammad Kassar 2024-11-27 05:17:34 +01:00 committed by GitHub
parent cb6ca02f3a
commit a175e83edf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 3 deletions

View file

@ -80,7 +80,7 @@ static USER_ID: LazyLock<String> = LazyLock::new(|| unsafe {
.collect::<Vec<String>>()
.join("")
});
static SMASH_VERSION: LazyLock<String> = LazyLock::new(|| {
pub static SMASH_VERSION: LazyLock<String> = LazyLock::new(|| {
let mut smash_version = oe::DisplayVersion { name: [0; 16] };
unsafe {
oe::GetDisplayVersion(&mut smash_version);

View file

@ -19,6 +19,7 @@
use std::fs;
use std::path::PathBuf;
use skyline::nn::oe;
use skyline::nro::{self, NroInfo};
use training_mod_consts::{OnOff, LEGACY_TRAINING_MODPACK_ROOT};
use training_mod_sync::*;
@ -27,6 +28,7 @@ use crate::common::button_config::DEFAULT_OPEN_MENU_CONFIG;
use crate::common::events::events_loop;
use crate::common::*;
use crate::consts::TRAINING_MODPACK_ROOT;
use crate::events;
use crate::events::{Event, EVENT_QUEUE};
use crate::logging::*;
use crate::training::ui::notifications::notification;
@ -65,11 +67,17 @@ pub fn main() {
},
};
let err_msg = format!("SSBU Training Modpack has panicked at '{msg}', {location}");
let game_version = events::SMASH_VERSION.to_string();
let atmosphere_version = oe::get_display_version().to_owned();
let version_report =
format!("Smash version: {game_version}.\nAtmosphere version: {atmosphere_version}");
let complete_error_message = format!("{msg}\n{location}\n{version_report}");
skyline::error::show_error(
69,
"SSBU Training Modpack has panicked! Please open the details and send a screenshot to the developer, then close the game.\n",
&err_msg,
&complete_error_message,
);
}));
init_logger().unwrap();