From d257663b27c201cd6ebec08c1dd317ed470814b4 Mon Sep 17 00:00:00 2001 From: xkeyC <3334969096@qq.com> Date: Sat, 31 May 2025 19:53:01 +0800 Subject: [PATCH] fix: launchSubWindow game install path --- lib/common/utils/multi_window_manager.dart | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/common/utils/multi_window_manager.dart b/lib/common/utils/multi_window_manager.dart index 5698357..95e7bf9 100644 --- a/lib/common/utils/multi_window_manager.dart +++ b/lib/common/utils/multi_window_manager.dart @@ -7,6 +7,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:starcitizen_doctor/app.dart'; +import 'package:starcitizen_doctor/common/conf/conf.dart'; import 'package:starcitizen_doctor/common/helper/log_helper.dart'; import 'package:starcitizen_doctor/generated/l10n.dart'; import 'package:starcitizen_doctor/ui/tools/log_analyze_ui/log_analyze_ui.dart'; @@ -33,7 +34,8 @@ abstract class MultiWindowAppState with _$MultiWindowAppState { class MultiWindowManager { static Future launchSubWindow(String type, String title, AppGlobalState appGlobalState) async { - final gameInstallPaths = await SCLoggerHelper.getGameInstallPath(await SCLoggerHelper.getLauncherLogList() ?? []); + final gameInstallPaths = await SCLoggerHelper.getGameInstallPath(await SCLoggerHelper.getLauncherLogList() ?? [], + checkExists: true, withVersion: AppConf.gameChannels); final window = await DesktopMultiWindow.createWindow(jsonEncode({ 'window_type': type, 'app_state': _appStateToWindowState( @@ -102,10 +104,10 @@ class MultiWindowManager { micaBackgroundColor: HexColor(windowAppState.micaColor), buttonTheme: ButtonThemeData( defaultButtonStyle: ButtonStyle( - shape: WidgetStateProperty.all(RoundedRectangleBorder( - borderRadius: BorderRadius.circular(4), - side: BorderSide(color: Colors.white.withValues(alpha: .01)))), - ))), + shape: WidgetStateProperty.all(RoundedRectangleBorder( + borderRadius: BorderRadius.circular(4), + side: BorderSide(color: Colors.white.withValues(alpha: .01)))), + ))), locale: windowAppState.languageCode != null ? Locale(windowAppState.languageCode!, windowAppState.countryCode) : null,