mirror of
https://ghfast.top/https://github.com/StarCitizenToolBox/app.git
synced 2025-06-28 11:24:46 +08:00
update Cpu Affinity
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:starcitizen_doctor/base/ui.dart';
|
||||
import 'package:starcitizen_doctor/common/conf.dart';
|
||||
import 'package:starcitizen_doctor/ui/settings/settings_ui_model.dart';
|
||||
@ -11,12 +12,18 @@ class SettingUI extends BaseUI<SettingUIModel> {
|
||||
margin: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
children: [
|
||||
if (AppConf.isMSE)
|
||||
if (AppConf.isMSE) ...[
|
||||
makeSettingsItem(const Icon(FluentIcons.reset_device), "重置自动密码填充",
|
||||
subTitle:
|
||||
"启用:${model.isEnableAutoLogin ? "已启用" : "已禁用"} 设备支持:${model.isDeviceSupportWinHello ? "支持" : "不支持"} 邮箱:${model.autoLoginEmail} 密码:${model.isEnableAutoLoginPwd ? "已加密保存" : "未保存"}",
|
||||
onTap: model.onResetAutoLogin)
|
||||
else
|
||||
onTap: model.onResetAutoLogin),
|
||||
const SizedBox(height: 12),
|
||||
makeSettingsItem(const Icon(FontAwesomeIcons.microchip),
|
||||
"启动游戏时忽略能效核心( 适用于Intel 12 ~ 14th处理器 )",
|
||||
subTitle:
|
||||
"已设置的核心数量:${model.inputGameLaunchECore} ( 设置需要忽略的处理器的能效心数量,盒子将在使用启动游戏功能时为您修改游戏所运行的CPU参数,当为 0 时不启用此功能 )",
|
||||
onTap: model.setGameLaunchECore),
|
||||
] else
|
||||
const Text("暂无设置项"),
|
||||
],
|
||||
),
|
||||
|
@ -1,3 +1,4 @@
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:local_auth/local_auth.dart';
|
||||
import 'package:starcitizen_doctor/base/ui_model.dart';
|
||||
@ -10,6 +11,7 @@ class SettingUIModel extends BaseUIModel {
|
||||
String autoLoginEmail = "-";
|
||||
bool isEnableAutoLogin = false;
|
||||
bool isEnableAutoLoginPwd = false;
|
||||
String inputGameLaunchECore = "0";
|
||||
|
||||
@override
|
||||
loadData() async {
|
||||
@ -18,6 +20,7 @@ class SettingUIModel extends BaseUIModel {
|
||||
notifyListeners();
|
||||
if (AppConf.isMSE) {
|
||||
_updateAutoLoginAccount();
|
||||
_updateGameLaunchECore();
|
||||
}
|
||||
}
|
||||
|
||||
@ -41,4 +44,25 @@ class SettingUIModel extends BaseUIModel {
|
||||
userBox.get("account_pwd_encrypted", defaultValue: "") != "";
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
Future<void> setGameLaunchECore() async {
|
||||
final userBox = await Hive.openBox("app_conf");
|
||||
final defaultInput =
|
||||
userBox.get("gameLaunch_eCore_count", defaultValue: "0");
|
||||
final input = await showInputDialogs(context!,
|
||||
title: "请输入要忽略的 CPU 核心数",
|
||||
content: "",
|
||||
initialValue: defaultInput,
|
||||
inputFormatters: [FilteringTextInputFormatter.digitsOnly]);
|
||||
if (input == null) return;
|
||||
userBox.put("gameLaunch_eCore_count", input);
|
||||
reloadData();
|
||||
}
|
||||
|
||||
Future _updateGameLaunchECore() async {
|
||||
final userBox = await Hive.openBox("app_conf");
|
||||
inputGameLaunchECore =
|
||||
userBox.get("gameLaunch_eCore_count", defaultValue: "0");
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user