Merge branch 'next' of https://github.com/an-anime-team/an-anime-game-launcher
This commit is contained in:
commit
341cf04e38
10 changed files with 180 additions and 57 deletions
8
Cargo.lock
generated
8
Cargo.lock
generated
|
@ -40,8 +40,8 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "anime-game-core"
|
name = "anime-game-core"
|
||||||
version = "1.7.1"
|
version = "1.7.2"
|
||||||
source = "git+https://github.com/an-anime-team/anime-game-core?tag=1.7.1#8978728ce5d94aec5c6aecfe470e45fc43d5b522"
|
source = "git+https://github.com/an-anime-team/anime-game-core?tag=1.7.2#b367ea1303c9687217024902e37dbb4e24b05f37"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"bzip2",
|
"bzip2",
|
||||||
|
@ -65,8 +65,8 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "anime-launcher-sdk"
|
name = "anime-launcher-sdk"
|
||||||
version = "1.0.6"
|
version = "1.0.10"
|
||||||
source = "git+https://github.com/an-anime-team/anime-launcher-sdk?tag=1.0.6#2a8272c1afdd006925c150ac480a82be645f4b52"
|
source = "git+https://github.com/an-anime-team/anime-launcher-sdk?tag=1.0.10#204369158e57056dfc64fbff62fbe6a571034913"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anime-game-core",
|
"anime-game-core",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
|
|
|
@ -17,7 +17,7 @@ glib-build-tools = "0.17"
|
||||||
|
|
||||||
[dependencies.anime-launcher-sdk]
|
[dependencies.anime-launcher-sdk]
|
||||||
git = "https://github.com/an-anime-team/anime-launcher-sdk"
|
git = "https://github.com/an-anime-team/anime-launcher-sdk"
|
||||||
tag = "1.0.6"
|
tag = "1.0.10"
|
||||||
features = ["all", "genshin"]
|
features = ["all", "genshin"]
|
||||||
|
|
||||||
# path = "../anime-launcher-sdk" # ! for dev purposes only
|
# path = "../anime-launcher-sdk" # ! for dev purposes only
|
||||||
|
|
38
README.md
38
README.md
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
# Please don't link to this repository
|
# ⚠️ Please don't link to this repository
|
||||||
|
|
||||||
We understand you want to help people run An Anime Game on Linux. The issue is, the more people know
|
We understand you want to help people run An Anime Game on Linux. The issue is, the more people know
|
||||||
of the tools involved in it, the higher the chances The Anime Game Company will notice them, and then
|
of the tools involved in it, the higher the chances The Anime Game Company will notice them, and then
|
||||||
|
@ -32,26 +32,38 @@ Or share them and ruin it for the dozens of Linux players. It's up to you.
|
||||||
Do what you must, but we would respectfully request that you try to label the game as "An Anime Game"
|
Do what you must, but we would respectfully request that you try to label the game as "An Anime Game"
|
||||||
instead of the actual name of the game, to avoid search engine parsing.
|
instead of the actual name of the game, to avoid search engine parsing.
|
||||||
|
|
||||||
# Documentation
|
<br>
|
||||||
|
|
||||||
Documentation for the launcher can be found in the [repository wiki](https://github.com/an-anime-team/the-honkers-railway-launcher/wiki).
|
# ♥️ Useful links and thanks
|
||||||
|
|
||||||
# Download
|
* Original patch project without which this project wouldn't be possible. Link is omitted for "privacy" purposes
|
||||||
|
* [macOS launcher](https://github.com/3Shain/yet-another-anime-game-launcher) which contains some additional compatibility components
|
||||||
|
* [Wiki](https://github.com/an-anime-team/an-anime-game-launcher/wiki) contains some basic FAQ, installation instructions and more
|
||||||
|
* [Releases page](https://github.com/an-anime-team/an-anime-game-launcher/releases) where you can find latest available version
|
||||||
|
* [Changelog](CHANGELOG.md) with chronology of the project
|
||||||
|
|
||||||
Currently there are 5 options available:
|
<br>
|
||||||
1. Flatpak
|
|
||||||
2. AUR
|
|
||||||
3. RPM
|
|
||||||
4. Gentoo/ebuild
|
|
||||||
5. NixOS
|
|
||||||
|
|
||||||
To see the installation guides, [Please visit the wiki page here](https://github.com/an-anime-team/the-honkers-railway-launcher/wiki/Installation)
|
# ⬇️ Download
|
||||||
|
|
||||||
|
| Distribution | Format | Wiki | Source |
|
||||||
|
| - | - | - | - |
|
||||||
|
| Fedora | Flatpak | [link](https://github.com/an-anime-team/an-anime-game-launcher/wiki/Installation#-any-distribution-flatpak) | - |
|
||||||
|
| Arch Linux, Manjaro | AUR | [link](https://github.com/an-anime-team/an-anime-game-launcher/wiki/Installation#-arch-linux-aur) | [an-anime-game-launcher-bin](https://aur.archlinux.org/packages/an-anime-game-launcher-bin) |
|
||||||
|
| Fedora, OpenSUSE | RPM | [link](https://github.com/an-anime-team/an-anime-game-launcher/wiki/Installation#-fedora-rpm) | [AAGL](https://build.opensuse.org/repositories/home:Maroxy:AAT-Apps/AAGL) |
|
||||||
|
| Ubuntu | pacstall | - | [an-anime-game-launcher-bin](https://pacstall.dev/packages/an-anime-game-launcher-bin) |
|
||||||
|
| Gentoo | ebuild | [link](https://github.com/an-anime-team/an-anime-game-launcher/wiki/Installation#-gentoo-linux-ebuild) | [aagl-ebuilds](https://github.com/an-anime-team/aagl-ebuilds) |
|
||||||
|
| NixOS | nixpkg | [link](https://github.com/an-anime-team/an-anime-game-launcher/wiki/Installation#-nixos-nixpkg) | [aagl-gtk-on-nix](https://github.com/ezKEa/aagl-gtk-on-nix) |
|
||||||
|
|
||||||
|
To see the installation guides, please visit the wiki page [here](https://github.com/an-anime-team/an-anime-game-launcher/wiki/Installation)
|
||||||
|
|
||||||
## Chinese version support
|
## Chinese version support
|
||||||
|
|
||||||
This should be automatically enabled if you're using zh_cn (Chinese) as your system language. If you're not using it - you'll need to set `China` as your `launcher.edition` in the `config.json` file
|
This should be automatically enabled if you're using zh_cn (Chinese) as your system language. If you're not using it - you can change the game edition in the launcher settings
|
||||||
|
|
||||||
# Development
|
<br>
|
||||||
|
|
||||||
|
# 💻 Development
|
||||||
|
|
||||||
| Folder | Description |
|
| Folder | Description |
|
||||||
| - | - |
|
| - | - |
|
||||||
|
|
|
@ -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,7 +8,7 @@ hide-home-directory = Esconder el directorio home
|
||||||
hide-home-directory-description = Aisla las carpetas /home, /var/home/$USER, y $HOME del juego
|
hide-home-directory-description = Aisla las carpetas /home, /var/home/$USER, y $HOME del juego
|
||||||
|
|
||||||
hostname = Nombre del host
|
hostname = Nombre del host
|
||||||
additional-arguments = Additional arguments
|
additional-arguments = Argumentos adicionales
|
||||||
|
|
||||||
private-directories = Directorios privados
|
private-directories = Directorios privados
|
||||||
private-directories-description = Estas carpetas serán reemplazadas por un sistema de archivos virtual (tmpfs) vacío, y su contenido real no será accesible al juego aislado
|
private-directories-description = Estas carpetas serán reemplazadas por un sistema de archivos virtual (tmpfs) vacío, y su contenido real no será accesible al juego aislado
|
||||||
|
@ -24,5 +24,5 @@ new-path = Nueva ruta
|
||||||
read-only = Sólo lectura
|
read-only = Sólo lectura
|
||||||
read-only-description = Le prohibe al juego escribir datos en este directorio
|
read-only-description = Le prohibe al juego escribir datos en este directorio
|
||||||
|
|
||||||
symlinks = Symlinks
|
symlinks = Enlaces simbólicos
|
||||||
symlinks-description = Symlink original path to the new one inside of your sandbox
|
symlinks-description = Enlaza la ruta original a la nueva dentro de tu entorno aislado
|
||||||
|
|
|
@ -8,7 +8,7 @@ hide-home-directory = 隐藏家目录
|
||||||
hide-home-directory-description = 将 /home、 /var/home/$USER 和 $HOME 目录与游戏隔离
|
hide-home-directory-description = 将 /home、 /var/home/$USER 和 $HOME 目录与游戏隔离
|
||||||
|
|
||||||
hostname = 主机名
|
hostname = 主机名
|
||||||
additional-arguments = Additional arguments
|
additional-arguments = 额外参数
|
||||||
|
|
||||||
private-directories = 隐私目录
|
private-directories = 隐私目录
|
||||||
private-directories-description = 这些目录将会被空的虚拟文件系统(tmpfs)替代,其中的原始内容不可被沙盒中的游戏访问
|
private-directories-description = 这些目录将会被空的虚拟文件系统(tmpfs)替代,其中的原始内容不可被沙盒中的游戏访问
|
||||||
|
@ -24,5 +24,5 @@ new-path = 新路径
|
||||||
read-only = 只读
|
read-only = 只读
|
||||||
read-only-description = 禁止游戏向此目录写入任何数据
|
read-only-description = 禁止游戏向此目录写入任何数据
|
||||||
|
|
||||||
symlinks = Symlinks
|
symlinks = 软链接
|
||||||
symlinks-description = Symlink original path to the new one inside of your sandbox
|
symlinks-description = 软链接原始路径到沙盒里的新路径
|
||||||
|
|
114
fluentscan.py
Normal file → Executable file
114
fluentscan.py
Normal file → Executable file
|
@ -5,12 +5,45 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
import glob
|
||||||
|
import re
|
||||||
|
|
||||||
path = "assets/locales/" + sys.argv[1] + "/"
|
valid_commands = ["diff", "unused", "missing"]
|
||||||
|
|
||||||
for filename in os.listdir("assets/locales/en"):
|
if len(sys.argv) < 3:
|
||||||
with open(os.path.join("assets/locales/en", filename), 'r') as locale_file:
|
print(f"Command format: ./fluentscan.py [command] [locale]\nAvailable commands: {valid_commands}")
|
||||||
created_locale = open(path + filename)
|
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
|
if sys.argv[1] not in valid_commands:
|
||||||
|
print(f"Invalid command \"{sys.argv[1]}\". Available commands: {valid_commands}")
|
||||||
|
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
|
path = "assets/locales/" + sys.argv[2] + "/"
|
||||||
|
|
||||||
|
try:
|
||||||
|
open(path + "/main.ftl", "r").close()
|
||||||
|
|
||||||
|
except:
|
||||||
|
print(f"{path} does not exist")
|
||||||
|
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
|
all_entries = {}
|
||||||
|
|
||||||
|
def dict_compare(d1, d2):
|
||||||
|
d1_keys = set(d1.keys())
|
||||||
|
d2_keys = set(d2.keys())
|
||||||
|
|
||||||
|
shared_keys = d1_keys.intersection(d2_keys)
|
||||||
|
|
||||||
|
added = d1_keys - d2_keys
|
||||||
|
removed = d2_keys - d1_keys
|
||||||
|
|
||||||
|
same = set(o for o in shared_keys if d1[o] == d2[o])
|
||||||
|
|
||||||
|
return added, removed, same
|
||||||
|
|
||||||
def to_dict(text):
|
def to_dict(text):
|
||||||
result={}
|
result={}
|
||||||
|
@ -28,28 +61,62 @@ for filename in os.listdir("assets/locales/en"):
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def dict_compare(d1, d2):
|
def get_line_num(text,pattern):
|
||||||
d1_keys = set(d1.keys())
|
line = 1
|
||||||
d2_keys = set(d2.keys())
|
|
||||||
|
|
||||||
shared_keys = d1_keys.intersection(d2_keys)
|
for i in text.split("\n"):
|
||||||
|
if pattern in i:
|
||||||
|
return line
|
||||||
|
|
||||||
added = d1_keys - d2_keys
|
line += 1
|
||||||
removed = d2_keys - d1_keys
|
|
||||||
|
|
||||||
modified = {o : (d1[o], d2[o]) for o in shared_keys if d1[o] != d2[o]}
|
for filename in os.listdir("assets/locales/en"):
|
||||||
|
with open(os.path.join("assets/locales/en", filename), 'r') as locale_file:
|
||||||
same = set(o for o in shared_keys if d1[o] == d2[o])
|
created_locale = open(path + filename)
|
||||||
|
|
||||||
return added, removed, modified, same
|
|
||||||
|
|
||||||
expected = to_dict(locale_file)
|
expected = to_dict(locale_file)
|
||||||
expected2 = to_dict(created_locale)
|
expected2 = to_dict(created_locale)
|
||||||
|
|
||||||
# TODO: why modified is not used?
|
all_entries.update(expected)
|
||||||
added, removed, modified, same = dict_compare(expected, expected2)
|
|
||||||
|
|
||||||
if added or removed or same:
|
added, removed, same = dict_compare(expected, expected2)
|
||||||
|
|
||||||
|
if sys.argv[1] == "unused" or sys.argv[1] == "missing":
|
||||||
|
files = glob.glob("src/**/*.rs", recursive=True)
|
||||||
|
|
||||||
|
used = []
|
||||||
|
vars = {}
|
||||||
|
|
||||||
|
for i in files:
|
||||||
|
with open(i, "r") as script:
|
||||||
|
text = script.read()
|
||||||
|
|
||||||
|
if sys.argv[1] == "unused":
|
||||||
|
for j in expected:
|
||||||
|
if f"\"{j}\"" in text:
|
||||||
|
used.append(j)
|
||||||
|
|
||||||
|
elif sys.argv[1] == "missing":
|
||||||
|
for j in text.split():
|
||||||
|
# TODO: ignore comments
|
||||||
|
if 'tr("' in j:
|
||||||
|
index = j.find('tr("')
|
||||||
|
|
||||||
|
var_name = re.sub('[^\\w-]+', '', j[index:].replace('tr("', '').replace("Some", ""))
|
||||||
|
|
||||||
|
# TODO: index multiple matches
|
||||||
|
vars[var_name] = [script.name, get_line_num(text,var_name)]
|
||||||
|
|
||||||
|
if sys.argv[1] == "unused":
|
||||||
|
for i in expected:
|
||||||
|
if i not in used:
|
||||||
|
print(f"[{locale_file.name}]\n"
|
||||||
|
" [Unused]\n"
|
||||||
|
f" {i}")
|
||||||
|
|
||||||
|
continue
|
||||||
|
|
||||||
|
if (added or removed or same) and sys.argv[1] == "diff":
|
||||||
print(f"[{created_locale.name[15:]}]")
|
print(f"[{created_locale.name[15:]}]")
|
||||||
|
|
||||||
if added:
|
if added:
|
||||||
|
@ -72,3 +139,14 @@ for filename in os.listdir("assets/locales/en"):
|
||||||
print(f" {i} = {expected[i]}")
|
print(f" {i} = {expected[i]}")
|
||||||
|
|
||||||
print("")
|
print("")
|
||||||
|
|
||||||
|
if sys.argv[1] == "missing":
|
||||||
|
added, removed, same = dict_compare(vars, all_entries)
|
||||||
|
|
||||||
|
if not added:
|
||||||
|
print("Nothing is missing")
|
||||||
|
|
||||||
|
for i in added:
|
||||||
|
print(f"[{vars[i][0]}, line {vars[i][1]}]\n"
|
||||||
|
" [Missing]\n"
|
||||||
|
f" {i}")
|
||||||
|
|
|
@ -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()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1035,7 +1035,8 @@ impl SimpleAsyncComponent for GeneralApp {
|
||||||
let config = Config::get().unwrap_or_else(|_| CONFIG.clone());
|
let config = Config::get().unwrap_or_else(|_| CONFIG.clone());
|
||||||
|
|
||||||
if let Ok(Some(wine)) = config.get_selected_wine() {
|
if let Ok(Some(wine)) = config.get_selected_wine() {
|
||||||
let result = wine.to_wine(config.components.path, Some(config.game.wine.builds.join(&wine.name)))
|
let result = wine
|
||||||
|
.to_wine(config.components.path, Some(config.game.wine.builds.join(&wine.name)))
|
||||||
.with_prefix(config.game.wine.prefix)
|
.with_prefix(config.game.wine.prefix)
|
||||||
.with_loader(WineLoader::Current)
|
.with_loader(WineLoader::Current)
|
||||||
.with_arch(WineArch::Win64)
|
.with_arch(WineArch::Win64)
|
||||||
|
|
Loading…
Reference in a new issue