mirror of
https://github.com/an-anime-team/an-anime-game-launcher.git
synced 2025-02-18 00:02:06 +03:00
feat: added rules approving dialog to the first run window
This commit is contained in:
parent
b7fe2ffb87
commit
aa5215533a
3 changed files with 37 additions and 5 deletions
|
@ -23,6 +23,12 @@ tos-violation-warning-message =
|
||||||
|
|
||||||
If you understand the risk of trying to play the game in an unofficial capacity, press OK and let's go researching the world of Teyvat!
|
If you understand the risk of trying to play the game in an unofficial capacity, press OK and let's go researching the world of Teyvat!
|
||||||
|
|
||||||
|
tos-dialog-title = Are you sure you understand what we want to say?
|
||||||
|
tos-dialog-message =
|
||||||
|
1. Don't publish any information about this project
|
||||||
|
2. Don't abuse it by using some modded clients and so
|
||||||
|
3. Ask questions exceptionally in our discord or matrix server
|
||||||
|
|
||||||
|
|
||||||
dependencies = Dependencies
|
dependencies = Dependencies
|
||||||
missing-dependencies-title = You're missing some dependencies!
|
missing-dependencies-title = You're missing some dependencies!
|
||||||
|
|
|
@ -22,6 +22,7 @@ continue = Continue
|
||||||
exit = Exit
|
exit = Exit
|
||||||
check = Check
|
check = Check
|
||||||
restart = Restart
|
restart = Restart
|
||||||
|
agree = Agree
|
||||||
|
|
||||||
|
|
||||||
loading-data = Loading data
|
loading-data = Loading data
|
||||||
|
|
|
@ -8,6 +8,8 @@ use anime_launcher_sdk::is_available;
|
||||||
use crate::i18n::*;
|
use crate::i18n::*;
|
||||||
use super::main::FirstRunAppMsg;
|
use super::main::FirstRunAppMsg;
|
||||||
|
|
||||||
|
use super::main::MAIN_WINDOW;
|
||||||
|
|
||||||
pub struct TosWarningApp;
|
pub struct TosWarningApp;
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
|
@ -86,6 +88,22 @@ impl SimpleAsyncComponent for TosWarningApp {
|
||||||
match msg {
|
match msg {
|
||||||
#[allow(unused_must_use)]
|
#[allow(unused_must_use)]
|
||||||
TosWarningAppMsg::Continue => {
|
TosWarningAppMsg::Continue => {
|
||||||
|
let dialog = adw::MessageDialog::new(
|
||||||
|
unsafe { MAIN_WINDOW.as_ref() },
|
||||||
|
Some(&tr("tos-dialog-title")),
|
||||||
|
Some(&tr("tos-dialog-message"))
|
||||||
|
);
|
||||||
|
|
||||||
|
dialog.add_responses(&[
|
||||||
|
("exit", &tr("exit")),
|
||||||
|
("continue", &tr("agree"))
|
||||||
|
]);
|
||||||
|
|
||||||
|
dialog.connect_response(None, move |_, response| {
|
||||||
|
match response {
|
||||||
|
"exit" => relm4::main_application().quit(),
|
||||||
|
|
||||||
|
"continue" => {
|
||||||
if is_available("git") && is_available("xdelta3") {
|
if is_available("git") && is_available("xdelta3") {
|
||||||
sender.output(Self::Output::ScrollToDefaultPaths);
|
sender.output(Self::Output::ScrollToDefaultPaths);
|
||||||
} else {
|
} else {
|
||||||
|
@ -93,6 +111,13 @@ impl SimpleAsyncComponent for TosWarningApp {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_ => unreachable!()
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
dialog.show();
|
||||||
|
}
|
||||||
|
|
||||||
TosWarningAppMsg::Exit => relm4::main_application().quit()
|
TosWarningAppMsg::Exit => relm4::main_application().quit()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue