Skip to content

Commit

Permalink
Merge pull request #275 from kcalbxof/language_cli_arg
Browse files Browse the repository at this point in the history
Language cli arg
  • Loading branch information
bgkillas authored Dec 10, 2024
2 parents d9547ac + 8ec44d4 commit 8aa4ec9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions noita-proxy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1545,6 +1545,15 @@ impl eframe::App for App {
});
}
AppState::LangPick => {
//had to move arg check here because in new() i cannot access app_saved_state
if let Some(lang) = &self.args.language
{
let li: LanguageIdentifier = lang.parse().unwrap();
self.app_saved_state.lang_id = Some(li.clone());
set_current_locale(li);
self.state = AppState::ModManager;
return
}
egui::CentralPanel::default().show(ctx, draw_bg);
Window::new(tr("lang_picker"))
.auto_sized()
Expand Down
3 changes: 3 additions & 0 deletions noita-proxy/src/util/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,7 @@ pub struct Args {
/// noita.exe path
#[argh(option)]
pub exe_path: Option<PathBuf>,
/// language for gui
#[argh(option)]
pub language: Option<String>,
}

0 comments on commit 8aa4ec9

Please sign in to comment.