Skip to content

Commit

Permalink
feat: added support for --just-run-game
Browse files Browse the repository at this point in the history
  • Loading branch information
krypt0nn committed Jun 17, 2023
1 parent bd63fe5 commit 3cfb7ee
Showing 1 changed file with 22 additions and 9 deletions.
31 changes: 22 additions & 9 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,26 +43,26 @@ lazy_static::lazy_static! {

pub static ref GAME: Game = Game::new(&CONFIG.game.path, ());

/// Path to launcher folder. Standard is `$HOME/.local/share/anime-game-launcher`
/// Path to launcher folder. Standard is `$HOME/.local/share/honkers-launcher`
pub static ref LAUNCHER_FOLDER: PathBuf = launcher_dir().expect("Failed to get launcher folder");

/// Path to launcher's cache folder. Standard is `$HOME/.cache/anime-game-launcher`
/// Path to launcher's cache folder. Standard is `$HOME/.cache/honkers-launcher`
pub static ref CACHE_FOLDER: PathBuf = cache_dir().expect("Failed to get launcher's cache folder");

/// Path to `debug.log` file. Standard is `$HOME/.local/share/anime-game-launcher/debug.log`
/// Path to `debug.log` file. Standard is `$HOME/.local/share/honkers-launcher/debug.log`
pub static ref DEBUG_FILE: PathBuf = LAUNCHER_FOLDER.join("debug.log");

/// Path to `background` file. Standard is `$HOME/.cache/anime-game-launcher/background`
/// Path to `background` file. Standard is `$HOME/.cache/honkers-launcher/background`
pub static ref BACKGROUND_FILE: PathBuf = CACHE_FOLDER.join("background");

/// Path to `.keep-background` file. Used to mark launcher that it shouldn't update background picture
///
/// Standard is `$HOME/.local/share/anime-game-launcher/.keep-background`
/// Standard is `$HOME/.local/share/honkers-launcher/.keep-background`
pub static ref KEEP_BACKGROUND_FILE: PathBuf = LAUNCHER_FOLDER.join(".keep-background");

/// Path to `.first-run` file. Used to mark launcher that it should run FirstRun window
///
/// Standard is `$HOME/.local/share/anime-game-launcher/.first-run`
/// Standard is `$HOME/.local/share/honkers-launcher/.first-run`
pub static ref FIRST_RUN_FILE: PathBuf = LAUNCHER_FOLDER.join(".first-run");
}

Expand Down Expand Up @@ -190,10 +190,23 @@ fn main() {
let state = LauncherState::get_from_config(|_| {})
.expect("Failed to get launcher state");

if let LauncherState::Launch = state {
anime_launcher_sdk::honkai::game::run().expect("Failed to run the game");
match state {
LauncherState::Launch => {
anime_launcher_sdk::honkai::game::run().expect("Failed to run the game");

return;
return;
}

LauncherState::PatchNotVerified |
LauncherState::PatchUpdateAvailable => {
if just_run_game {
anime_launcher_sdk::honkai::game::run().expect("Failed to run the game");

return;
}
}

_ => ()
}
}

Expand Down

0 comments on commit 3cfb7ee

Please sign in to comment.