Compare commits
20 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 747d17f27c | |||
| 8398de5af1 | |||
| a42cb45534 | |||
|
|
968a2a957b | ||
|
|
3757c27939 | ||
|
|
2a940b9312 | ||
|
|
2f17dba2fa | ||
|
|
6e1e50f34e | ||
|
|
bfc0c5d3d7 | ||
|
|
8c6c980bb8 | ||
|
|
6a6360540b | ||
|
|
d905f8c13e | ||
|
|
0d70cb711a | ||
|
|
f283f4db43 | ||
|
|
3ce635075c | ||
|
|
ffd32ec7ff | ||
|
|
ba102bbab8 | ||
|
|
79d56dd267 | ||
|
|
134b4f0983 | ||
|
|
6090d772fe |
71
.github/workflows/windows_test.yaml
vendored
Normal file
71
.github/workflows/windows_test.yaml
vendored
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
name: "Windows Nightly Build"
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: "19 21 * * *" # every day at midnight
|
||||||
|
workflow_dispatch:
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: windows
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up MSbuild
|
||||||
|
uses: microsoft/setup-msbuild@v2
|
||||||
|
|
||||||
|
- name: Set up Flutter
|
||||||
|
uses: subosito/flutter-action@v2
|
||||||
|
with:
|
||||||
|
channel: 'stable'
|
||||||
|
cache: true
|
||||||
|
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:' # optional, change this to force refresh cache
|
||||||
|
cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:' # optional, change this to specify the cache path
|
||||||
|
|
||||||
|
- run: flutter --version
|
||||||
|
|
||||||
|
- name: Set up Rust
|
||||||
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
||||||
|
- name: Rust Version
|
||||||
|
run: |
|
||||||
|
rustup --version
|
||||||
|
cargo --version
|
||||||
|
- name: Rust Cache
|
||||||
|
uses: Swatinem/rust-cache@v2
|
||||||
|
with:
|
||||||
|
workspaces: "rust"
|
||||||
|
cache-all-crates: true
|
||||||
|
|
||||||
|
- name: Set up LLVM
|
||||||
|
uses: KyleMayes/install-llvm-action@v2
|
||||||
|
with:
|
||||||
|
version: "18"
|
||||||
|
|
||||||
|
- name: Flutter pub get
|
||||||
|
run: flutter pub get
|
||||||
|
- name: Flutter build runner
|
||||||
|
run: dart run build_runner build --delete-conflicting-outputs
|
||||||
|
- name: Rust cargo update
|
||||||
|
run: cargo update
|
||||||
|
working-directory: rust
|
||||||
|
|
||||||
|
- name: Set up Flutter rust bridge
|
||||||
|
run: |
|
||||||
|
cargo install cargo-expand
|
||||||
|
cargo install 'flutter_rust_bridge_codegen@^2.0.0-dev.0'
|
||||||
|
|
||||||
|
- name: Flutter Rust bridge generate
|
||||||
|
run: flutter_rust_bridge_codegen generate
|
||||||
|
- name: flutter gen l10n
|
||||||
|
run: |
|
||||||
|
flutter pub global activate intl_utils
|
||||||
|
flutter pub global run intl_utils:generate
|
||||||
|
- name: Flutter build Windows
|
||||||
|
run: flutter build windows
|
||||||
|
|
||||||
|
- name: Archive build
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: windows
|
||||||
|
path: build/windows/x64/runner/Release
|
||||||
|
|
||||||
@ -287,8 +287,7 @@ async function getRSILauncherToken(channelId) {
|
|||||||
let libraryData = (await libraryR.json())["data"]
|
let libraryData = (await libraryR.json())["data"]
|
||||||
|
|
||||||
// get user avatar
|
// get user avatar
|
||||||
let $avatarElement = $(".c-account-sidebar__profile-metas-avatar");
|
let avatarUrl = $(".a-avatarButton__image").attr("src");
|
||||||
let avatarUrl = $avatarElement.css("background-image");
|
|
||||||
|
|
||||||
//post message
|
//post message
|
||||||
window.chrome.webview.postMessage({
|
window.chrome.webview.postMessage({
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
class ConstConf {
|
class ConstConf {
|
||||||
static const String appVersion = "2.12.0";
|
static const String appVersion = "2.12.2";
|
||||||
static const int appVersionCode = 54;
|
static const int appVersionCode = 56;
|
||||||
static const String appVersionDate = "2024-6-28";
|
static const String appVersionDate = "2024-6-28";
|
||||||
static const gameChannels = ["LIVE", "PTU", "EPTU", "TECH-PREVIEW"];
|
static const gameChannels = ["LIVE", "PTU", "EPTU", "TECH-PREVIEW", "HOTFIX"];
|
||||||
static const isMSE =
|
static const isMSE =
|
||||||
String.fromEnvironment("MSE", defaultValue: "false") == "true";
|
String.fromEnvironment("MSE", defaultValue: "false") == "true";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,16 +36,7 @@ class SCLoggerHelper {
|
|||||||
final jsonLogPath = await getLogFilePath();
|
final jsonLogPath = await getLogFilePath();
|
||||||
if (jsonLogPath == null) throw "no file path";
|
if (jsonLogPath == null) throw "no file path";
|
||||||
var jsonString = utf8.decode(await File(jsonLogPath).readAsBytes());
|
var jsonString = utf8.decode(await File(jsonLogPath).readAsBytes());
|
||||||
if (jsonString.endsWith("\n")) {
|
return jsonString.split("\n");
|
||||||
jsonString = jsonString.substring(0, jsonString.length - 3);
|
|
||||||
}
|
|
||||||
if (jsonString.endsWith(" ")) {
|
|
||||||
jsonString = jsonString.substring(0, jsonString.length - 3);
|
|
||||||
}
|
|
||||||
if (jsonString.endsWith(",")) {
|
|
||||||
jsonString = jsonString.substring(0, jsonString.length - 3);
|
|
||||||
}
|
|
||||||
return json.decode("[$jsonString]");
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
dPrint(e);
|
dPrint(e);
|
||||||
return [];
|
return [];
|
||||||
@ -58,6 +49,8 @@ class SCLoggerHelper {
|
|||||||
List<String> scInstallPaths = [];
|
List<String> scInstallPaths = [];
|
||||||
|
|
||||||
checkAndAddPath(String path, bool checkExists) async {
|
checkAndAddPath(String path, bool checkExists) async {
|
||||||
|
// 将所有连续的 \\ 替换为 \
|
||||||
|
path = path.replaceAll(RegExp(r'\\+'), "\\");
|
||||||
if (path.isNotEmpty && !scInstallPaths.contains(path)) {
|
if (path.isNotEmpty && !scInstallPaths.contains(path)) {
|
||||||
if (!checkExists) {
|
if (!checkExists) {
|
||||||
dPrint("find installPath == $path");
|
dPrint("find installPath == $path");
|
||||||
@ -80,30 +73,22 @@ class SCLoggerHelper {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
for (var v in withVersion) {
|
for (var v in withVersion) {
|
||||||
|
String pattern =
|
||||||
|
r'([a-zA-Z]:\\\\[^\\\\]*\\\\[^\\\\]*\\\\StarCitizen\\\\' + v + r')';
|
||||||
|
RegExp regExp = RegExp(pattern, caseSensitive: false);
|
||||||
for (var i = listData.length - 1; i > 0; i--) {
|
for (var i = listData.length - 1; i > 0; i--) {
|
||||||
final m = listData[i];
|
final line = listData[i];
|
||||||
final info = m["[browser][info] "];
|
final matches = regExp.allMatches(line);
|
||||||
if (info is String) {
|
for (var match in matches) {
|
||||||
String installPath = "";
|
await checkAndAddPath(match.group(0)!, checkExists);
|
||||||
if (info.contains("Installing Star Citizen $v")) {
|
|
||||||
installPath = "${info.split(" at ")[1]}\\$v";
|
|
||||||
}
|
}
|
||||||
if (info.contains("Verifying Star Citizen $v")) {
|
|
||||||
installPath = "${info.split(" at ")[1]}\\$v";
|
|
||||||
}
|
|
||||||
if (info.contains("Launching Star Citizen $v from")) {
|
|
||||||
installPath = info
|
|
||||||
.replaceAll("Launching Star Citizen $v from (", "")
|
|
||||||
.replaceAll(")", "");
|
|
||||||
}
|
|
||||||
await checkAndAddPath(installPath, checkExists);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (scInstallPaths.isNotEmpty) {
|
if (scInstallPaths.isNotEmpty) {
|
||||||
// 动态检测更多位置
|
// 动态检测更多位置
|
||||||
for (var v in withVersion) {
|
|
||||||
for (var fileName in List.from(scInstallPaths)) {
|
for (var fileName in List.from(scInstallPaths)) {
|
||||||
|
for (var v in withVersion) {
|
||||||
if (fileName.toString().endsWith(v)) {
|
if (fileName.toString().endsWith(v)) {
|
||||||
for (var nv in withVersion) {
|
for (var nv in withVersion) {
|
||||||
final nextName =
|
final nextName =
|
||||||
@ -114,7 +99,6 @@ class SCLoggerHelper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
dPrint(e);
|
dPrint(e);
|
||||||
if (scInstallPaths.isEmpty) rethrow;
|
if (scInstallPaths.isEmpty) rethrow;
|
||||||
|
|||||||
@ -8,8 +8,8 @@ class SystemHelper {
|
|||||||
|
|
||||||
static initPowershellPath() async {
|
static initPowershellPath() async {
|
||||||
try {
|
try {
|
||||||
var result = await Process.run(powershellPath, ["echo", "ping"]);
|
var result = await Process.run(powershellPath, ["echo", "pong"]);
|
||||||
if (!result.stdout.toString().startsWith("ping") &&
|
if (!result.stdout.toString().startsWith("pong") &&
|
||||||
powershellPath == "powershell.exe") {
|
powershellPath == "powershell.exe") {
|
||||||
throw "powershell check failed";
|
throw "powershell check failed";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
// This file is automatically generated, so please do not edit it.
|
// This file is automatically generated, so please do not edit it.
|
||||||
// Generated by `flutter_rust_bridge`@ 2.3.0.
|
// @generated by `flutter_rust_bridge`@ 2.4.0.
|
||||||
|
|
||||||
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
|
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
// This file is automatically generated, so please do not edit it.
|
// This file is automatically generated, so please do not edit it.
|
||||||
// Generated by `flutter_rust_bridge`@ 2.3.0.
|
// @generated by `flutter_rust_bridge`@ 2.4.0.
|
||||||
|
|
||||||
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
|
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
// This file is automatically generated, so please do not edit it.
|
// This file is automatically generated, so please do not edit it.
|
||||||
// Generated by `flutter_rust_bridge`@ 2.3.0.
|
// @generated by `flutter_rust_bridge`@ 2.4.0.
|
||||||
|
|
||||||
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
|
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
// This file is automatically generated, so please do not edit it.
|
// This file is automatically generated, so please do not edit it.
|
||||||
// Generated by `flutter_rust_bridge`@ 2.3.0.
|
// @generated by `flutter_rust_bridge`@ 2.4.0.
|
||||||
|
|
||||||
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
|
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
// This file is automatically generated, so please do not edit it.
|
// This file is automatically generated, so please do not edit it.
|
||||||
// Generated by `flutter_rust_bridge`@ 2.3.0.
|
// @generated by `flutter_rust_bridge`@ 2.4.0.
|
||||||
|
|
||||||
// ignore_for_file: unused_import, unused_element, unnecessary_import, duplicate_ignore, invalid_use_of_internal_member, annotate_overrides, non_constant_identifier_names, curly_braces_in_flow_control_structures, prefer_const_literals_to_create_immutables, unused_field
|
// ignore_for_file: unused_import, unused_element, unnecessary_import, duplicate_ignore, invalid_use_of_internal_member, annotate_overrides, non_constant_identifier_names, curly_braces_in_flow_control_structures, prefer_const_literals_to_create_immutables, unused_field
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ class RustLib extends BaseEntrypoint<RustLibApi, RustLibApiImpl, RustLibWire> {
|
|||||||
kDefaultExternalLibraryLoaderConfig;
|
kDefaultExternalLibraryLoaderConfig;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get codegenVersion => '2.3.0';
|
String get codegenVersion => '2.4.0';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get rustContentHash => 1832496273;
|
int get rustContentHash => 1832496273;
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
// This file is automatically generated, so please do not edit it.
|
// This file is automatically generated, so please do not edit it.
|
||||||
// Generated by `flutter_rust_bridge`@ 2.3.0.
|
// @generated by `flutter_rust_bridge`@ 2.4.0.
|
||||||
|
|
||||||
// ignore_for_file: unused_import, unused_element, unnecessary_import, duplicate_ignore, invalid_use_of_internal_member, annotate_overrides, non_constant_identifier_names, curly_braces_in_flow_control_structures, prefer_const_literals_to_create_immutables, unused_field
|
// ignore_for_file: unused_import, unused_element, unnecessary_import, duplicate_ignore, invalid_use_of_internal_member, annotate_overrides, non_constant_identifier_names, curly_braces_in_flow_control_structures, prefer_const_literals_to_create_immutables, unused_field
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
// This file is automatically generated, so please do not edit it.
|
// This file is automatically generated, so please do not edit it.
|
||||||
// Generated by `flutter_rust_bridge`@ 2.3.0.
|
// @generated by `flutter_rust_bridge`@ 2.4.0.
|
||||||
|
|
||||||
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
|
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
|
||||||
|
|
||||||
|
|||||||
@ -719,8 +719,8 @@ class MessageLookup extends MessageLookupByLibrary {
|
|||||||
"localization_info_remove_incompatible_translation_params":
|
"localization_info_remove_incompatible_translation_params":
|
||||||
MessageLookupByLibrary.simpleMessage(
|
MessageLookupByLibrary.simpleMessage(
|
||||||
"Whether to remove incompatible Localization parameters"),
|
"Whether to remove incompatible Localization parameters"),
|
||||||
"localization_info_translation_status":
|
"localization_info_translation":
|
||||||
MessageLookupByLibrary.simpleMessage("Localization status"),
|
MessageLookupByLibrary.simpleMessage("Game localization"),
|
||||||
"localization_info_unavailable":
|
"localization_info_unavailable":
|
||||||
MessageLookupByLibrary.simpleMessage("Unavailable"),
|
MessageLookupByLibrary.simpleMessage("Unavailable"),
|
||||||
"localization_info_update_time": m40,
|
"localization_info_update_time": m40,
|
||||||
|
|||||||
@ -646,8 +646,8 @@ class MessageLookup extends MessageLookupByLibrary {
|
|||||||
"localization_info_note": MessageLookupByLibrary.simpleMessage("备注:"),
|
"localization_info_note": MessageLookupByLibrary.simpleMessage("备注:"),
|
||||||
"localization_info_remove_incompatible_translation_params":
|
"localization_info_remove_incompatible_translation_params":
|
||||||
MessageLookupByLibrary.simpleMessage("是否移除不兼容的汉化参数"),
|
MessageLookupByLibrary.simpleMessage("是否移除不兼容的汉化参数"),
|
||||||
"localization_info_translation_status":
|
"localization_info_translation":
|
||||||
MessageLookupByLibrary.simpleMessage("汉化状态"),
|
MessageLookupByLibrary.simpleMessage("游戏汉化"),
|
||||||
"localization_info_unavailable":
|
"localization_info_unavailable":
|
||||||
MessageLookupByLibrary.simpleMessage("不可用"),
|
MessageLookupByLibrary.simpleMessage("不可用"),
|
||||||
"localization_info_update_time": m40,
|
"localization_info_update_time": m40,
|
||||||
|
|||||||
@ -649,8 +649,8 @@ class MessageLookup extends MessageLookupByLibrary {
|
|||||||
"localization_info_note": MessageLookupByLibrary.simpleMessage("備註:"),
|
"localization_info_note": MessageLookupByLibrary.simpleMessage("備註:"),
|
||||||
"localization_info_remove_incompatible_translation_params":
|
"localization_info_remove_incompatible_translation_params":
|
||||||
MessageLookupByLibrary.simpleMessage("是否移除不相容的翻譯參數"),
|
MessageLookupByLibrary.simpleMessage("是否移除不相容的翻譯參數"),
|
||||||
"localization_info_translation_status":
|
"localization_info_translation":
|
||||||
MessageLookupByLibrary.simpleMessage("翻譯狀態"),
|
MessageLookupByLibrary.simpleMessage("遊戲翻譯"),
|
||||||
"localization_info_unavailable":
|
"localization_info_unavailable":
|
||||||
MessageLookupByLibrary.simpleMessage("無法使用"),
|
MessageLookupByLibrary.simpleMessage("無法使用"),
|
||||||
"localization_info_update_time": m40,
|
"localization_info_update_time": m40,
|
||||||
|
|||||||
@ -1661,11 +1661,11 @@ class S {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// `Localization status`
|
/// `Game localization`
|
||||||
String get localization_info_translation_status {
|
String get localization_info_translation {
|
||||||
return Intl.message(
|
return Intl.message(
|
||||||
'Localization status',
|
'Game localization',
|
||||||
name: 'localization_info_translation_status',
|
name: 'localization_info_translation',
|
||||||
desc: '',
|
desc: '',
|
||||||
args: [],
|
args: [],
|
||||||
);
|
);
|
||||||
|
|||||||
@ -323,8 +323,8 @@
|
|||||||
"@home_action_info_warning": {},
|
"@home_action_info_warning": {},
|
||||||
"localization_info_machine_translation_warning": "You are using the game built -in text. The official text is currently a machine translation (as of 3.21.0), and it is recommended that you install community Localization below.",
|
"localization_info_machine_translation_warning": "You are using the game built -in text. The official text is currently a machine translation (as of 3.21.0), and it is recommended that you install community Localization below.",
|
||||||
"@localization_info_machine_translation_warning": {},
|
"@localization_info_machine_translation_warning": {},
|
||||||
"localization_info_translation_status": "Localization status",
|
"localization_info_translation": "Game localization",
|
||||||
"@localization_info_translation_status": {},
|
"@localization_info_translation": {},
|
||||||
"localization_info_enabled": "Enable ({v0}):",
|
"localization_info_enabled": "Enable ({v0}):",
|
||||||
"@localization_info_enabled": {},
|
"@localization_info_enabled": {},
|
||||||
"localization_info_installed_version": "The installed version: {v0}",
|
"localization_info_installed_version": "The installed version: {v0}",
|
||||||
|
|||||||
@ -322,8 +322,8 @@
|
|||||||
"@home_action_info_warning": {},
|
"@home_action_info_warning": {},
|
||||||
"localization_info_machine_translation_warning": "您正在使用游戏内置文本,官方文本目前为机器翻译(截至3.21.0),建议您在下方安装社区汉化。",
|
"localization_info_machine_translation_warning": "您正在使用游戏内置文本,官方文本目前为机器翻译(截至3.21.0),建议您在下方安装社区汉化。",
|
||||||
"@localization_info_machine_translation_warning": {},
|
"@localization_info_machine_translation_warning": {},
|
||||||
"localization_info_translation_status": "汉化状态",
|
"localization_info_translation": "游戏汉化",
|
||||||
"@localization_info_translation_status": {},
|
"@localization_info_translation": {},
|
||||||
"localization_info_enabled": "启用({v0}):",
|
"localization_info_enabled": "启用({v0}):",
|
||||||
"@localization_info_enabled": {},
|
"@localization_info_enabled": {},
|
||||||
"localization_info_installed_version": "已安装版本:{v0}",
|
"localization_info_installed_version": "已安装版本:{v0}",
|
||||||
|
|||||||
@ -322,8 +322,8 @@
|
|||||||
"@home_action_info_warning": {},
|
"@home_action_info_warning": {},
|
||||||
"localization_info_machine_translation_warning": "您目前正在使用遊戲內建翻譯文件,官方內建文件截止至 3.21.0 都是機器翻譯,建議安裝下方提供的社群翻譯或是來自其他來源的社群翻譯文件。",
|
"localization_info_machine_translation_warning": "您目前正在使用遊戲內建翻譯文件,官方內建文件截止至 3.21.0 都是機器翻譯,建議安裝下方提供的社群翻譯或是來自其他來源的社群翻譯文件。",
|
||||||
"@localization_info_machine_translation_warning": {},
|
"@localization_info_machine_translation_warning": {},
|
||||||
"localization_info_translation_status": "翻譯狀態",
|
"localization_info_translation": "遊戲翻譯",
|
||||||
"@localization_info_translation_status": {},
|
"@localization_info_translation": {},
|
||||||
"localization_info_enabled": "啟用({v0}):",
|
"localization_info_enabled": "啟用({v0}):",
|
||||||
"@localization_info_enabled": {},
|
"@localization_info_enabled": {},
|
||||||
"localization_info_installed_version": "已安裝:{v0}",
|
"localization_info_installed_version": "已安裝:{v0}",
|
||||||
|
|||||||
@ -63,10 +63,13 @@ class HomeGameLoginUIModel extends _$HomeGameLoginUIModel {
|
|||||||
final webToken = data["webToken"];
|
final webToken = data["webToken"];
|
||||||
final releaseInfo = data["releaseInfo"];
|
final releaseInfo = data["releaseInfo"];
|
||||||
final libraryData = RsiGameLibraryData.fromJson(data["libraryData"]);
|
final libraryData = RsiGameLibraryData.fromJson(data["libraryData"]);
|
||||||
final avatarUrl = data["avatar"]
|
var avatarUrl = data["avatar"]
|
||||||
?.toString()
|
?.toString()
|
||||||
.replaceAll("url(\"", "")
|
.replaceAll("url(\"", "")
|
||||||
.replaceAll("\")", "");
|
.replaceAll("\")", "");
|
||||||
|
if (avatarUrl?.startsWith("/") ?? false) {
|
||||||
|
avatarUrl = "https://robertsspaceindustries.com$avatarUrl";
|
||||||
|
}
|
||||||
final Map<String, dynamic> payload = Jwt.parseJwt(authToken!);
|
final Map<String, dynamic> payload = Jwt.parseJwt(authToken!);
|
||||||
final nickname = payload["nickname"] ?? "";
|
final nickname = payload["nickname"] ?? "";
|
||||||
|
|
||||||
|
|||||||
@ -7,7 +7,6 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
|||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
import 'package:starcitizen_doctor/api/analytics.dart';
|
import 'package:starcitizen_doctor/api/analytics.dart';
|
||||||
import 'package:starcitizen_doctor/common/helper/system_helper.dart';
|
|
||||||
import 'package:starcitizen_doctor/ui/tools/tools_ui_model.dart';
|
import 'package:starcitizen_doctor/ui/tools/tools_ui_model.dart';
|
||||||
import 'package:starcitizen_doctor/widgets/widgets.dart';
|
import 'package:starcitizen_doctor/widgets/widgets.dart';
|
||||||
import 'package:url_launcher/url_launcher_string.dart';
|
import 'package:url_launcher/url_launcher_string.dart';
|
||||||
@ -168,15 +167,6 @@ class HomeUI extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
const SizedBox(width: 12),
|
const SizedBox(width: 12),
|
||||||
Button(
|
|
||||||
onPressed: () =>
|
|
||||||
SystemHelper.openDir("${homeState.scInstalledPath}"),
|
|
||||||
child: const Padding(
|
|
||||||
padding: EdgeInsets.all(6),
|
|
||||||
child: Icon(FluentIcons.folder_open),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(width: 12),
|
|
||||||
Button(
|
Button(
|
||||||
onPressed: model.reScanPath,
|
onPressed: model.reScanPath,
|
||||||
child: const Padding(
|
child: const Padding(
|
||||||
|
|||||||
@ -77,8 +77,9 @@ class LocalizationDialogUI extends HookConsumerWidget {
|
|||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
makeToolsListContainer(context, model, state),
|
||||||
makeListContainer(
|
makeListContainer(
|
||||||
S.current.localization_info_translation_status,
|
S.current.localization_info_translation,
|
||||||
[
|
[
|
||||||
if (state.patchStatus == null)
|
if (state.patchStatus == null)
|
||||||
makeLoading(context)
|
makeLoading(context)
|
||||||
@ -140,30 +141,41 @@ class LocalizationDialogUI extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
const SizedBox(height: 12),
|
||||||
],
|
Container(
|
||||||
context),
|
color: Colors.white.withOpacity(.1),
|
||||||
makeListContainer(
|
height: 1,
|
||||||
S.current.localization_info_community_translation,
|
),
|
||||||
[
|
const SizedBox(height: 12),
|
||||||
if (state.apiLocalizationData == null)
|
if (state.apiLocalizationData == null)
|
||||||
makeLoading(context)
|
makeLoading(context)
|
||||||
else if (state.apiLocalizationData!.isEmpty)
|
else if (state.apiLocalizationData!.isEmpty)
|
||||||
Center(
|
Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
S.current.localization_info_no_translation_available,
|
S.current
|
||||||
|
.localization_info_no_translation_available,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
color: Colors.white.withOpacity(.8)),
|
color: Colors.white.withOpacity(.8)),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
for (final item in state.apiLocalizationData!.entries)
|
AlignedGridView.count(
|
||||||
makeRemoteList(context, model, item, state),
|
crossAxisCount: 2,
|
||||||
|
crossAxisSpacing: 12,
|
||||||
|
mainAxisSpacing: 12,
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
final item = state.apiLocalizationData!.entries
|
||||||
|
.elementAt(index);
|
||||||
|
return makeRemoteList(context, model, item, state);
|
||||||
|
},
|
||||||
|
shrinkWrap: true,
|
||||||
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
|
itemCount: state.apiLocalizationData?.length ?? 0,
|
||||||
|
)
|
||||||
],
|
],
|
||||||
context,
|
],
|
||||||
gridViewMode: true),
|
context),
|
||||||
makeToolsListContainer(context, model, state),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -297,7 +297,7 @@ class LocalizationUIModel extends _$LocalizationUIModel {
|
|||||||
for (var value
|
for (var value
|
||||||
in (element.rawContent?.readString() ?? "").split("\n")) {
|
in (element.rawContent?.readString() ?? "").split("\n")) {
|
||||||
final tv = value.trim();
|
final tv = value.trim();
|
||||||
if (tv.isNotEmpty) globalIni.writeln(tv);
|
if (tv.isNotEmpty) globalIni.writeln(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -92,8 +92,9 @@ class SettingsUIModel extends _$SettingsUIModel {
|
|||||||
if (r == null || r.files.firstOrNull?.path == null) return;
|
if (r == null || r.files.firstOrNull?.path == null) return;
|
||||||
final fileName = r.files.first.path!;
|
final fileName = r.files.first.path!;
|
||||||
dPrint(fileName);
|
dPrint(fileName);
|
||||||
final fileNameRegExp =
|
final fileNameRegExp = RegExp(
|
||||||
RegExp(r"^(.*\\StarCitizen\\.*\\)Bin64\\StarCitizen\.exe$");
|
r"^(.*\\StarCitizen\\.*\\)Bin64\\StarCitizen\.exe$",
|
||||||
|
caseSensitive: false);
|
||||||
if (fileNameRegExp.hasMatch(fileName)) {
|
if (fileNameRegExp.hasMatch(fileName)) {
|
||||||
RegExp pathRegex = RegExp(r"\\[^\\]+\\Bin64\\StarCitizen\.exe$");
|
RegExp pathRegex = RegExp(r"\\[^\\]+\\Bin64\\StarCitizen\.exe$");
|
||||||
String extractedPath = fileName.replaceFirst(pathRegex, '');
|
String extractedPath = fileName.replaceFirst(pathRegex, '');
|
||||||
|
|||||||
@ -220,7 +220,14 @@ class ToolsUI extends HookConsumerWidget {
|
|||||||
padding: EdgeInsets.all(6),
|
padding: EdgeInsets.all(6),
|
||||||
child: Icon(FluentIcons.folder_open),
|
child: Icon(FluentIcons.folder_open),
|
||||||
),
|
),
|
||||||
onPressed: () => model.openDir(state.scInstalledPath))
|
onPressed: () {
|
||||||
|
if (state.scInstalledPath.trim().isEmpty) {
|
||||||
|
showToast(context,
|
||||||
|
S.current.tools_action_info_star_citizen_not_found);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
model.openDir(state.scInstalledPath);
|
||||||
|
})
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -258,7 +265,16 @@ class ToolsUI extends HookConsumerWidget {
|
|||||||
padding: EdgeInsets.all(6),
|
padding: EdgeInsets.all(6),
|
||||||
child: Icon(FluentIcons.folder_open),
|
child: Icon(FluentIcons.folder_open),
|
||||||
),
|
),
|
||||||
onPressed: () => model.openDir(state.rsiLauncherInstalledPath))
|
onPressed: () {
|
||||||
|
if (state.scInstalledPath.trim().isEmpty) {
|
||||||
|
showToast(
|
||||||
|
context,
|
||||||
|
S.current
|
||||||
|
.tools_rsi_launcher_enhance_msg_error_launcher_notfound);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
model.openDir(state.rsiLauncherInstalledPath);
|
||||||
|
})
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -129,9 +129,6 @@ class ToolsUIModel extends _$ToolsUIModel {
|
|||||||
items.add(await _addPhotographyCard(context));
|
items.add(await _addPhotographyCard(context));
|
||||||
state = state.copyWith(items: items);
|
state = state.copyWith(items: items);
|
||||||
if (!context.mounted) return;
|
if (!context.mounted) return;
|
||||||
items.addAll(await _addLogCard(context));
|
|
||||||
state = state.copyWith(items: items);
|
|
||||||
if (!context.mounted) return;
|
|
||||||
items.addAll(await _addNvmePatchCard(context));
|
items.addAll(await _addNvmePatchCard(context));
|
||||||
state = state.copyWith(items: items, isItemLoading: false);
|
state = state.copyWith(items: items, isItemLoading: false);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@ -140,26 +137,6 @@ class ToolsUIModel extends _$ToolsUIModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<List<ToolsItemData>> _addLogCard(BuildContext context) async {
|
|
||||||
double logPathLen = 0;
|
|
||||||
try {
|
|
||||||
logPathLen =
|
|
||||||
(await File(await SCLoggerHelper.getLogFilePath() ?? "").length()) /
|
|
||||||
1024 /
|
|
||||||
1024;
|
|
||||||
} catch (_) {}
|
|
||||||
return [
|
|
||||||
ToolsItemData(
|
|
||||||
"rsilauncher_log_fix",
|
|
||||||
S.current.tools_action_rsi_launcher_log_fix,
|
|
||||||
S.current.tools_action_info_rsi_launcher_log_issue(
|
|
||||||
logPathLen.toStringAsFixed(4)),
|
|
||||||
const Icon(FontAwesomeIcons.bookBible, size: 24),
|
|
||||||
onTap: () => _rsiLogFix(context),
|
|
||||||
),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<List<ToolsItemData>> _addNvmePatchCard(BuildContext context) async {
|
Future<List<ToolsItemData>> _addNvmePatchCard(BuildContext context) async {
|
||||||
final nvmePatchStatus = await SystemHelper.checkNvmePatchStatus();
|
final nvmePatchStatus = await SystemHelper.checkNvmePatchStatus();
|
||||||
return [
|
return [
|
||||||
@ -353,28 +330,6 @@ class ToolsUIModel extends _$ToolsUIModel {
|
|||||||
SystemHelper.checkAndLaunchRSILauncher(state.rsiLauncherInstalledPath);
|
SystemHelper.checkAndLaunchRSILauncher(state.rsiLauncherInstalledPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _rsiLogFix(BuildContext context) async {
|
|
||||||
state = state.copyWith(working: true);
|
|
||||||
final path = await SCLoggerHelper.getLogFilePath();
|
|
||||||
if (!await File(path!).exists()) {
|
|
||||||
if (!context.mounted) return;
|
|
||||||
showToast(context, S.current.tools_action_info_log_file_not_exist);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
SystemHelper.killRSILauncher();
|
|
||||||
await File(path).delete(recursive: true);
|
|
||||||
if (!context.mounted) return;
|
|
||||||
showToast(context, S.current.tools_action_info_cleanup_complete);
|
|
||||||
SystemHelper.checkAndLaunchRSILauncher(state.rsiLauncherInstalledPath);
|
|
||||||
} catch (_) {
|
|
||||||
if (!context.mounted) return;
|
|
||||||
showToast(context, S.current.tools_action_info_cleanup_failed(path));
|
|
||||||
}
|
|
||||||
|
|
||||||
state = state.copyWith(working: false);
|
|
||||||
}
|
|
||||||
|
|
||||||
openDir(path) async {
|
openDir(path) async {
|
||||||
SystemHelper.openDir(path);
|
SystemHelper.openDir(path);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -193,8 +193,6 @@ class WebViewModel {
|
|||||||
webview.close();
|
webview.close();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Future.delayed(const Duration(seconds: 1))
|
|
||||||
.then((value) => {webview.setWebviewWindowVisibility(false)});
|
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
showToast(context, S.current.app_init_failed_with_reason(e));
|
showToast(context, S.current.app_init_failed_with_reason(e));
|
||||||
|
|||||||
10
pubspec.yaml
10
pubspec.yaml
@ -42,7 +42,7 @@ dependencies:
|
|||||||
flutter_tilt: ^3.0.0
|
flutter_tilt: ^3.0.0
|
||||||
card_swiper: ^3.0.1
|
card_swiper: ^3.0.1
|
||||||
ffi: ^2.1.0
|
ffi: ^2.1.0
|
||||||
flutter_rust_bridge: ^2.1.0
|
flutter_rust_bridge: 2.4.0
|
||||||
freezed_annotation: ^2.4.1
|
freezed_annotation: ^2.4.1
|
||||||
meta: ^1.9.1
|
meta: ^1.9.1
|
||||||
hexcolor: ^3.0.1
|
hexcolor: ^3.0.1
|
||||||
@ -61,7 +61,7 @@ dependencies:
|
|||||||
synchronized: ^3.1.0+1
|
synchronized: ^3.1.0+1
|
||||||
super_sliver_list: ^0.4.1
|
super_sliver_list: ^0.4.1
|
||||||
file: ^7.0.0
|
file: ^7.0.0
|
||||||
re_editor: ^0.3.0
|
re_editor: ^0.4.0
|
||||||
re_highlight: ^0.0.3
|
re_highlight: ^0.0.3
|
||||||
dependency_overrides:
|
dependency_overrides:
|
||||||
http: ^1.1.2
|
http: ^1.1.2
|
||||||
@ -70,7 +70,7 @@ dev_dependencies:
|
|||||||
flutter_test:
|
flutter_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
|
||||||
flutter_lints: ^4.0.0
|
flutter_lints: ^5.0.0
|
||||||
msix: ^3.16.4
|
msix: ^3.16.4
|
||||||
build_runner: ^2.4.8
|
build_runner: ^2.4.8
|
||||||
freezed: ^2.4.5
|
freezed: ^2.4.5
|
||||||
@ -78,7 +78,7 @@ dev_dependencies:
|
|||||||
riverpod_generator: ^2.3.11
|
riverpod_generator: ^2.3.11
|
||||||
custom_lint: ^0.6.2
|
custom_lint: ^0.6.2
|
||||||
riverpod_lint: ^2.3.9
|
riverpod_lint: ^2.3.9
|
||||||
ffigen: ^13.0.0
|
ffigen: ^14.0.0
|
||||||
sct_dev_tools:
|
sct_dev_tools:
|
||||||
path: ./packages/sct_dev_tools
|
path: ./packages/sct_dev_tools
|
||||||
|
|
||||||
@ -100,7 +100,7 @@ msix_config:
|
|||||||
publisher_display_name: xkeyC Studio
|
publisher_display_name: xkeyC Studio
|
||||||
identity_name: 56575xkeyC.MSE
|
identity_name: 56575xkeyC.MSE
|
||||||
publisher: CN=B54C897B-C263-4680-B6AB-4913C603DF87
|
publisher: CN=B54C897B-C263-4680-B6AB-4913C603DF87
|
||||||
msix_version: 2.12.0.0
|
msix_version: 2.12.2.0
|
||||||
logo_path: ./assets/app_logo.png
|
logo_path: ./assets/app_logo.png
|
||||||
capabilities: internetClient,allowElevation
|
capabilities: internetClient,allowElevation
|
||||||
languages: zh-cn
|
languages: zh-cn
|
||||||
|
|||||||
@ -11,7 +11,7 @@ strip = "debuginfo"
|
|||||||
crate-type = ["cdylib", "staticlib"]
|
crate-type = ["cdylib", "staticlib"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
flutter_rust_bridge = "=2.3.0"
|
flutter_rust_bridge = "=2.4.0"
|
||||||
tokio = { version = "1", features = ["rt", "rt-multi-thread", "macros", "process"] }
|
tokio = { version = "1", features = ["rt", "rt-multi-thread", "macros", "process"] }
|
||||||
futures = { version = "0.3", default-features = false, features = ["executor"] }
|
futures = { version = "0.3", default-features = false, features = ["executor"] }
|
||||||
url = "2.5"
|
url = "2.5"
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
// This file is automatically generated, so please do not edit it.
|
// This file is automatically generated, so please do not edit it.
|
||||||
// Generated by `flutter_rust_bridge`@ 2.3.0.
|
// @generated by `flutter_rust_bridge`@ 2.4.0.
|
||||||
|
|
||||||
#![allow(
|
#![allow(
|
||||||
non_camel_case_types,
|
non_camel_case_types,
|
||||||
@ -36,7 +36,7 @@ flutter_rust_bridge::frb_generated_boilerplate!(
|
|||||||
default_rust_opaque = RustOpaqueNom,
|
default_rust_opaque = RustOpaqueNom,
|
||||||
default_rust_auto_opaque = RustAutoOpaqueNom,
|
default_rust_auto_opaque = RustAutoOpaqueNom,
|
||||||
);
|
);
|
||||||
pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_VERSION: &str = "2.3.0";
|
pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_VERSION: &str = "2.4.0";
|
||||||
pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_CONTENT_HASH: i32 = 1832496273;
|
pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_CONTENT_HASH: i32 = 1832496273;
|
||||||
|
|
||||||
// Section: executor
|
// Section: executor
|
||||||
@ -1120,7 +1120,7 @@ impl SseEncode for () {
|
|||||||
#[cfg(not(target_family = "wasm"))]
|
#[cfg(not(target_family = "wasm"))]
|
||||||
mod io {
|
mod io {
|
||||||
// This file is automatically generated, so please do not edit it.
|
// This file is automatically generated, so please do not edit it.
|
||||||
// Generated by `flutter_rust_bridge`@ 2.3.0.
|
// @generated by `flutter_rust_bridge`@ 2.4.0.
|
||||||
|
|
||||||
// Section: imports
|
// Section: imports
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user