mirror of
https://ghfast.top/https://github.com/StarCitizenToolBox/app.git
synced 2025-06-28 18:24:45 +08:00
update Cpu Affinity
This commit is contained in:
@ -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