mirror of
https://github.com/Auties00/Reboot-Launcher.git
synced 2026-01-14 03:32:23 +01:00
9.1.4
This commit is contained in:
@@ -6,6 +6,7 @@ import 'package:ffi/ffi.dart';
|
||||
import 'package:fluent_ui/fluent_ui.dart';
|
||||
import 'package:flutter/scheduler.dart';
|
||||
import 'package:win32/win32.dart';
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
|
||||
final RegExp _winBuildRegex = RegExp(r'(?<=\(Build )(.*)(?=\))');
|
||||
|
||||
@@ -23,6 +24,22 @@ bool get isWin11 {
|
||||
return intBuild != null && intBuild > 22000;
|
||||
}
|
||||
|
||||
Future<String?> openFolderPicker(String title) async =>
|
||||
await FilePicker.platform.getDirectoryPath(dialogTitle: title);
|
||||
|
||||
Future<String?> openFilePicker(String extension) async {
|
||||
var result = await FilePicker.platform.pickFiles(
|
||||
type: FileType.custom,
|
||||
allowMultiple: false,
|
||||
allowedExtensions: [extension]
|
||||
);
|
||||
if(result == null || result.files.isEmpty){
|
||||
return null;
|
||||
}
|
||||
|
||||
return result.files.first.path;
|
||||
}
|
||||
|
||||
bool get isDarkMode =>
|
||||
SchedulerBinding.instance.platformDispatcher.platformBrightness.isDark;
|
||||
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
|
||||
Future<String?> openFolderPicker(String title) async =>
|
||||
await FilePicker.platform.getDirectoryPath(dialogTitle: title);
|
||||
|
||||
Future<String?> openFilePicker(String extension) async {
|
||||
var result = await FilePicker.platform.pickFiles(
|
||||
type: FileType.custom,
|
||||
allowMultiple: false,
|
||||
allowedExtensions: [extension]
|
||||
);
|
||||
if(result == null || result.files.isEmpty){
|
||||
return null;
|
||||
}
|
||||
|
||||
return result.files.first.path;
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:fluent_ui/fluent_ui.dart';
|
||||
import 'package:flutter_gen/gen_l10n/reboot_localizations.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:reboot_common/common.dart';
|
||||
|
||||
AppLocalizations? _translations;
|
||||
bool _init = false;
|
||||
@@ -19,3 +20,16 @@ void loadTranslations(BuildContext context) {
|
||||
}
|
||||
|
||||
String get currentLocale => Intl.getCurrentLocale().split("_")[0];
|
||||
|
||||
extension GameServerTypeExtension on GameServerType {
|
||||
String get translatedName {
|
||||
switch(this) {
|
||||
case GameServerType.headless:
|
||||
return translations.gameServerTypeHeadless;
|
||||
case GameServerType.virtualWindow:
|
||||
return translations.gameServerTypeVirtualWindow;
|
||||
case GameServerType.window:
|
||||
return translations.gameServerTypeWindow;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user