mirror of
https://github.com/ALEZ-DEV/Babylonia-terminal.git
synced 2025-12-16 17:38:51 +00:00
removing the flutter code
This commit is contained in:
parent
908d4b8aec
commit
9a643b4866
57
babylonia_terminal_launcher/.gitignore
vendored
57
babylonia_terminal_launcher/.gitignore
vendored
@ -1,57 +0,0 @@
|
|||||||
# Miscellaneous
|
|
||||||
*.class
|
|
||||||
*.log
|
|
||||||
*.pyc
|
|
||||||
*.swp
|
|
||||||
.DS_Store
|
|
||||||
.atom/
|
|
||||||
.buildlog/
|
|
||||||
.history
|
|
||||||
.svn/
|
|
||||||
migrate_working_dir/
|
|
||||||
|
|
||||||
# IntelliJ related
|
|
||||||
*.iml
|
|
||||||
*.ipr
|
|
||||||
*.iws
|
|
||||||
.idea/
|
|
||||||
|
|
||||||
# The .vscode folder contains launch configuration and tasks you configure in
|
|
||||||
# VS Code which you may wish to be included in version control, so this line
|
|
||||||
# is commented out by default.
|
|
||||||
#.vscode/
|
|
||||||
|
|
||||||
# Flutter/Dart/Pub related
|
|
||||||
**/doc/api/
|
|
||||||
**/ios/Flutter/.last_build_id
|
|
||||||
.dart_tool/
|
|
||||||
.flutter-plugins
|
|
||||||
.flutter-plugins-dependencies
|
|
||||||
.pub-cache/
|
|
||||||
.pub/
|
|
||||||
/build/
|
|
||||||
|
|
||||||
# Symbolication related
|
|
||||||
app.*.symbols
|
|
||||||
|
|
||||||
# Obfuscation related
|
|
||||||
app.*.map.json
|
|
||||||
|
|
||||||
# Android Studio will place build artifacts here
|
|
||||||
/android/app/debug
|
|
||||||
/android/app/profile
|
|
||||||
/android/app/release
|
|
||||||
|
|
||||||
# Ignore platforms
|
|
||||||
/linux/*
|
|
||||||
!/linux/my_application.cc
|
|
||||||
|
|
||||||
# Misc
|
|
||||||
/test
|
|
||||||
|
|
||||||
# Rust related
|
|
||||||
.cargo/
|
|
||||||
target/
|
|
||||||
|
|
||||||
# Generated messages
|
|
||||||
*/**/messages/
|
|
||||||
@ -1,30 +0,0 @@
|
|||||||
# This file tracks properties of this Flutter project.
|
|
||||||
# Used by Flutter tool to assess capabilities and perform upgrades etc.
|
|
||||||
#
|
|
||||||
# This file should be version controlled and should not be manually edited.
|
|
||||||
|
|
||||||
version:
|
|
||||||
revision: "54e66469a933b60ddf175f858f82eaeb97e48c8d"
|
|
||||||
channel: "stable"
|
|
||||||
|
|
||||||
project_type: app
|
|
||||||
|
|
||||||
# Tracks metadata for the flutter migrate command
|
|
||||||
migration:
|
|
||||||
platforms:
|
|
||||||
- platform: root
|
|
||||||
create_revision: 54e66469a933b60ddf175f858f82eaeb97e48c8d
|
|
||||||
base_revision: 54e66469a933b60ddf175f858f82eaeb97e48c8d
|
|
||||||
- platform: linux
|
|
||||||
create_revision: 54e66469a933b60ddf175f858f82eaeb97e48c8d
|
|
||||||
base_revision: 54e66469a933b60ddf175f858f82eaeb97e48c8d
|
|
||||||
|
|
||||||
# User provided section
|
|
||||||
|
|
||||||
# List of Local paths (relative to this file) that should be
|
|
||||||
# ignored by the migrate tool.
|
|
||||||
#
|
|
||||||
# Files that are not part of the templates will be ignored by default.
|
|
||||||
unmanaged_files:
|
|
||||||
- 'lib/main.dart'
|
|
||||||
- 'ios/Runner.xcodeproj/project.pbxproj'
|
|
||||||
@ -1,36 +0,0 @@
|
|||||||
# Changelog
|
|
||||||
|
|
||||||
All notable changes to this project will be documented in this file.
|
|
||||||
|
|
||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
||||||
|
|
||||||
## [Unreleased]
|
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- You now see the download speed when downloading the game (in MiB/s)
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- "Gb" (which ordinarily would be Gigabits) to "GiB" in the download progress
|
|
||||||
|
|
||||||
## [0.1.2] - 2024-10-28
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Only install Arial font from now on instead of the whole corefonts library
|
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- Added gamescope path library to the flatpak version of the launcher
|
|
||||||
|
|
||||||
## [0.1.1] - 2024-10-23
|
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- Notice for new release
|
|
||||||
|
|
||||||
[unreleased]: https://github.com/ALEZ-DEV/Babylonia-terminal/compare/0.1.1...HEAD
|
|
||||||
[0.1.2]: https://github.com/ALEZ-DEV/Babylonia-terminal/compare/0.1.2
|
|
||||||
[0.1.1]: https://github.com/ALEZ-DEV/Babylonia-terminal/compare/0.1.1
|
|
||||||
2391
babylonia_terminal_launcher/Cargo.lock
generated
2391
babylonia_terminal_launcher/Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -1,8 +0,0 @@
|
|||||||
# This file is used for telling Rust-related tools
|
|
||||||
# where various Rust crates are.
|
|
||||||
# This also unifies `./target` output folder and
|
|
||||||
# various Rust configurations.
|
|
||||||
|
|
||||||
[workspace]
|
|
||||||
members = ["./native/*"]
|
|
||||||
resolver = "2"
|
|
||||||
@ -1,39 +0,0 @@
|
|||||||
# How to compile the GUI version
|
|
||||||
|
|
||||||
!! **Disclaimer :** this might not work on your steam deck, a Flatpak version is distributed, [see instruction on how to install it!](https://github.com/ALEZ-DEV/Babylonia-terminal/wiki/Installation#installing-via-flatpak)
|
|
||||||
|
|
||||||
## Requirement
|
|
||||||
|
|
||||||
You need the [base](https://github.com/ALEZ-DEV/Babylonia-terminal/wiki/Compilation-requirement) requirement
|
|
||||||
You will need [Flutter](https://flutter.dev/) in order to compile the GUI version
|
|
||||||
Install [Rinf](https://github.com/cunarist/rinf) with **Cargo** :
|
|
||||||
|
|
||||||
```bash
|
|
||||||
cargo install rinf
|
|
||||||
```
|
|
||||||
|
|
||||||
And check if all the requirement are installed successfully :
|
|
||||||
|
|
||||||
```bash
|
|
||||||
rustc --version
|
|
||||||
flutter doctor
|
|
||||||
```
|
|
||||||
|
|
||||||
## Compile
|
|
||||||
|
|
||||||
First generate all the necessary messages :
|
|
||||||
|
|
||||||
```bash
|
|
||||||
rinf message
|
|
||||||
```
|
|
||||||
Generate all the necessary linux file for compilation :
|
|
||||||
|
|
||||||
```bash
|
|
||||||
flutter create --platform=linux .
|
|
||||||
```
|
|
||||||
|
|
||||||
Then compile the project :
|
|
||||||
|
|
||||||
```bash
|
|
||||||
flutter run
|
|
||||||
```
|
|
||||||
@ -1,28 +0,0 @@
|
|||||||
# This file configures the analyzer, which statically analyzes Dart code to
|
|
||||||
# check for errors, warnings, and lints.
|
|
||||||
#
|
|
||||||
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
|
|
||||||
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
|
|
||||||
# invoked from the command line by running `flutter analyze`.
|
|
||||||
|
|
||||||
# The following line activates a set of recommended lints for Flutter apps,
|
|
||||||
# packages, and plugins designed to encourage good coding practices.
|
|
||||||
include: package:flutter_lints/flutter.yaml
|
|
||||||
|
|
||||||
linter:
|
|
||||||
# The lint rules applied to this project can be customized in the
|
|
||||||
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
|
|
||||||
# included above or to enable additional rules. A list of all available lints
|
|
||||||
# and their documentation is published at https://dart.dev/lints.
|
|
||||||
#
|
|
||||||
# Instead of disabling a lint rule for the entire project in the
|
|
||||||
# section below, it can also be suppressed for a single line of code
|
|
||||||
# or a specific dart file by using the `// ignore: name_of_lint` and
|
|
||||||
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
|
|
||||||
# producing the lint.
|
|
||||||
rules:
|
|
||||||
# avoid_print: false # Uncomment to disable the `avoid_print` rule
|
|
||||||
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
|
|
||||||
|
|
||||||
# Additional information about this file can be found at
|
|
||||||
# https://dart.dev/guides/language/analysis-options
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 239 KiB |
@ -1,207 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:package_info_plus/package_info_plus.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
|
||||||
import 'package:yaru/yaru.dart';
|
|
||||||
|
|
||||||
import './screens/screens.dart';
|
|
||||||
import './screens/setup_screen.dart';
|
|
||||||
import './providers/providers.dart';
|
|
||||||
import './models/error_reporter.dart';
|
|
||||||
import './models/game.dart';
|
|
||||||
import './models/release_notice.dart';
|
|
||||||
import './widgets/release_notice_widget.dart';
|
|
||||||
|
|
||||||
class BabyloniaLauncher extends StatelessWidget {
|
|
||||||
BabyloniaLauncher(
|
|
||||||
{super.key,
|
|
||||||
required this.settingsProvider,
|
|
||||||
required this.gameStateProvider});
|
|
||||||
final SettingsProvider settingsProvider;
|
|
||||||
final GameStateProvider gameStateProvider;
|
|
||||||
final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
ErrorReporter.listenAllRustError(navigatorKey);
|
|
||||||
gameStateProvider.updateSetup();
|
|
||||||
return MultiProvider(
|
|
||||||
providers: [
|
|
||||||
ChangeNotifierProvider(
|
|
||||||
create: (context) => settingsProvider,
|
|
||||||
),
|
|
||||||
ChangeNotifierProvider(
|
|
||||||
create: (context) => gameStateProvider,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
child: YaruTheme(
|
|
||||||
builder: (context, yaru, child) => MaterialApp(
|
|
||||||
navigatorKey: navigatorKey,
|
|
||||||
title: "Babylonia Terminal",
|
|
||||||
debugShowCheckedModeBanner: false,
|
|
||||||
theme: yaru.theme,
|
|
||||||
darkTheme: yaru.darkTheme,
|
|
||||||
themeMode: ThemeMode.system,
|
|
||||||
highContrastTheme: yaruHighContrastLight,
|
|
||||||
highContrastDarkTheme: yaruHighContrastDark,
|
|
||||||
home: Provider.of<GameStateProvider>(context).haveToSetup
|
|
||||||
? const SetupScreen()
|
|
||||||
: const Menu(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class Menu extends StatefulWidget {
|
|
||||||
const Menu({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<Menu> createState() => _MenuState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _MenuState extends State<Menu> {
|
|
||||||
int _selectedIndex = 0;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void didChangeDependencies() async {
|
|
||||||
final provider = Provider.of<SettingsProvider>(context, listen: false);
|
|
||||||
final pkgsInfo = await PackageInfo.fromPlatform();
|
|
||||||
final currentVersion = pkgsInfo.version;
|
|
||||||
if (provider.lastVersion != currentVersion) {
|
|
||||||
final releaseInfo = await ReleaseNoticeInfo.getInfo(currentVersion);
|
|
||||||
|
|
||||||
showDialog<void>(
|
|
||||||
context: context,
|
|
||||||
builder: (context) =>
|
|
||||||
ReleaseNotice(currentVersion: currentVersion, info: releaseInfo),
|
|
||||||
);
|
|
||||||
|
|
||||||
provider.lastVersion = currentVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
super.didChangeDependencies();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
List<Widget> items = Screens.drawerItem(
|
|
||||||
selectedIndex: _selectedIndex,
|
|
||||||
onSelected: (index) {
|
|
||||||
setState(() => _selectedIndex = index);
|
|
||||||
Navigator.of(context).pop();
|
|
||||||
},
|
|
||||||
);
|
|
||||||
items.insert(
|
|
||||||
0,
|
|
||||||
Center(
|
|
||||||
child: Container(
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: Theme.of(context).colorScheme.surface,
|
|
||||||
border: Border(
|
|
||||||
bottom: BorderSide(
|
|
||||||
color: Theme.of(context).colorScheme.outline,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: Center(
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.all(8.0),
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(
|
|
||||||
vertical: 8.0,
|
|
||||||
horizontal: 50.0,
|
|
||||||
),
|
|
||||||
child: Image.asset(
|
|
||||||
'assets/images/Lee6.png',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const Text(
|
|
||||||
"Babylonia Terminal",
|
|
||||||
style: TextStyle(fontSize: 24),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
final window = YaruWindow.of(context);
|
|
||||||
|
|
||||||
return ChangeNotifierProvider(
|
|
||||||
create: (context) => Game(),
|
|
||||||
child: Stack(
|
|
||||||
children: [
|
|
||||||
Scaffold(
|
|
||||||
drawer: Drawer(
|
|
||||||
child: ListView(
|
|
||||||
children: items,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
appBar: AppBar(
|
|
||||||
title: const Text("Babylonia Terminal"),
|
|
||||||
centerTitle: true,
|
|
||||||
actions: [
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(right: 14.0),
|
|
||||||
child: YaruWindowControl(
|
|
||||||
type: YaruWindowControlType.minimize,
|
|
||||||
platform: YaruWindowControlPlatform.yaru,
|
|
||||||
onTap: () async {
|
|
||||||
final state = await window.state();
|
|
||||||
if (state.isMinimizable ?? false) window.minimize();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
StreamBuilder<YaruWindowState>(
|
|
||||||
stream: window.states(),
|
|
||||||
builder: (context, snapshot) {
|
|
||||||
final state = snapshot.data;
|
|
||||||
return Padding(
|
|
||||||
padding: const EdgeInsets.only(right: 14.0),
|
|
||||||
child: YaruWindowControl(
|
|
||||||
type: (state?.isMinimizable ?? false)
|
|
||||||
? YaruWindowControlType.maximize
|
|
||||||
: YaruWindowControlType.restore,
|
|
||||||
platform: YaruWindowControlPlatform.yaru,
|
|
||||||
onTap: () async {
|
|
||||||
(state?.isMinimizable ?? false)
|
|
||||||
? window.maximize()
|
|
||||||
: window.restore();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(right: 10.0),
|
|
||||||
child: YaruWindowControl(
|
|
||||||
type: YaruWindowControlType.close,
|
|
||||||
platform: YaruWindowControlPlatform.yaru,
|
|
||||||
onTap: () async {
|
|
||||||
final state = await window.state();
|
|
||||||
if (state.isClosable ?? false) window.close();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
body: Screens.getCurrent(_selectedIndex),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(right: 115.0, left: 60.0),
|
|
||||||
child: GestureDetector(
|
|
||||||
onPanStart: (_) => window.drag(),
|
|
||||||
child: const SizedBox(
|
|
||||||
height: 60,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,27 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter/widgets.dart';
|
|
||||||
import 'package:media_kit/media_kit.dart';
|
|
||||||
import 'package:rinf/rinf.dart';
|
|
||||||
import 'package:yaru_window/yaru_window.dart';
|
|
||||||
|
|
||||||
import './app.dart';
|
|
||||||
import './messages/generated.dart';
|
|
||||||
import './providers/providers.dart';
|
|
||||||
|
|
||||||
void main() async {
|
|
||||||
await initializeRust(assignRustSignal);
|
|
||||||
await YaruWindow.ensureInitialized();
|
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
|
||||||
MediaKit.ensureInitialized();
|
|
||||||
|
|
||||||
final SettingsProvider settings = SettingsProvider();
|
|
||||||
await settings.init();
|
|
||||||
|
|
||||||
final GameStateProvider gameState = GameStateProvider();
|
|
||||||
await gameState.updateGameState();
|
|
||||||
|
|
||||||
runApp(BabyloniaLauncher(
|
|
||||||
settingsProvider: settings,
|
|
||||||
gameStateProvider: gameState,
|
|
||||||
));
|
|
||||||
}
|
|
||||||
@ -1,54 +0,0 @@
|
|||||||
import 'dart:convert';
|
|
||||||
import 'dart:io';
|
|
||||||
|
|
||||||
import 'package:babylonia_terminal_launcher/models/config.dart';
|
|
||||||
import 'package:http/http.dart' as http;
|
|
||||||
|
|
||||||
import './../providers/providers.dart';
|
|
||||||
|
|
||||||
class Background {
|
|
||||||
String path;
|
|
||||||
|
|
||||||
Background._({required this.path});
|
|
||||||
|
|
||||||
static Future<Background> get(SettingsProvider provider) async {
|
|
||||||
final json = await _fetchMainMenu();
|
|
||||||
final info = json['pcTopPicture'];
|
|
||||||
final backgroundId = info['topPictureId'];
|
|
||||||
final videoLink = info['backgroundVideo'];
|
|
||||||
final path = "${Config.instance.path}/background.mp4";
|
|
||||||
|
|
||||||
if (provider.backgroundId == null ||
|
|
||||||
provider.backgroundId != backgroundId) {
|
|
||||||
provider.backgroundId = backgroundId;
|
|
||||||
|
|
||||||
await _updateVideo(videoLink, path);
|
|
||||||
}
|
|
||||||
|
|
||||||
return Background._(path: path);
|
|
||||||
}
|
|
||||||
|
|
||||||
static Future<Map<String, dynamic>> _fetchMainMenu() async {
|
|
||||||
// ignore: prefer_interpolation_to_compose_strings, prefer_adjacent_string_concatenation
|
|
||||||
final response = await http.get(
|
|
||||||
Uri.parse('https://media-cdn-zspms.' +
|
|
||||||
'k' +
|
|
||||||
'u' +
|
|
||||||
'r' +
|
|
||||||
'o' +
|
|
||||||
'game.net/pnswebsite/website2.0/json/G167/MainMenu.json'),
|
|
||||||
);
|
|
||||||
return jsonDecode(response.body);
|
|
||||||
}
|
|
||||||
|
|
||||||
static _updateVideo(String link, String path) async {
|
|
||||||
final response = await http.get(Uri.parse(link));
|
|
||||||
final file = File(path);
|
|
||||||
if (await file.exists()) {
|
|
||||||
// just to be sure to overwrite the file
|
|
||||||
await file.delete();
|
|
||||||
await file.create();
|
|
||||||
}
|
|
||||||
await file.writeAsBytes(response.bodyBytes);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,46 +0,0 @@
|
|||||||
import 'package:babylonia_terminal_launcher/messages/config.pb.dart';
|
|
||||||
|
|
||||||
class Config {
|
|
||||||
String path;
|
|
||||||
|
|
||||||
static late Config instance;
|
|
||||||
Config._({required this.path});
|
|
||||||
|
|
||||||
static bool _isLoadingConfig = false;
|
|
||||||
|
|
||||||
static Future update() async {
|
|
||||||
if (!_isLoadingConfig) {
|
|
||||||
_isLoadingConfig = true;
|
|
||||||
ConfigInput().sendSignalToRust();
|
|
||||||
final stream = ConfigOutput.rustSignalStream;
|
|
||||||
|
|
||||||
await for (final rustSignal in stream) {
|
|
||||||
instance = Config._(
|
|
||||||
path: rustSignal.message.configPath,
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
_isLoadingConfig = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool _isLoadingGetLaunchOptions = false;
|
|
||||||
|
|
||||||
static Future<String?> getLaunchOptions() async {
|
|
||||||
if (!_isLoadingGetLaunchOptions) {
|
|
||||||
_isLoadingGetLaunchOptions = true;
|
|
||||||
GetLaunchOptionsInput().sendSignalToRust();
|
|
||||||
final stream = GetLaunchOptionsOutput.rustSignalStream;
|
|
||||||
|
|
||||||
await for (final rustSignal in stream) {
|
|
||||||
_isLoadingGetLaunchOptions = false;
|
|
||||||
return rustSignal.message.launchOptions;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void setLaunchOptions(String? newLaunchOptions) {
|
|
||||||
SetLaunchOptionsInput(launchOptions: newLaunchOptions).sendSignalToRust();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,23 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
import './../messages/steps/dependencies.pb.dart';
|
|
||||||
import './../providers/providers.dart';
|
|
||||||
|
|
||||||
enum DependenciesInstallationState {
|
|
||||||
idle,
|
|
||||||
installing,
|
|
||||||
}
|
|
||||||
|
|
||||||
class Dependencies with ChangeNotifier {
|
|
||||||
DependenciesInstallationState dependeciesState =
|
|
||||||
DependenciesInstallationState.idle;
|
|
||||||
|
|
||||||
Future startInstallation(GameStateProvider gameState) async {
|
|
||||||
StartDependenciesInstallation().sendSignalToRust();
|
|
||||||
final stream = NotifyDependenciesSuccessfullyInstalled.rustSignalStream;
|
|
||||||
await for (final _ in stream) {
|
|
||||||
gameState.updateGameState();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,53 +0,0 @@
|
|||||||
import 'package:fixnum/fixnum.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
import './../messages/steps/dxvk.pb.dart';
|
|
||||||
import './../providers/providers.dart';
|
|
||||||
|
|
||||||
enum DXVKInstallationState {
|
|
||||||
idle,
|
|
||||||
downloading,
|
|
||||||
decompressing,
|
|
||||||
}
|
|
||||||
|
|
||||||
class DXVK with ChangeNotifier {
|
|
||||||
DXVKInstallationState dxvkState = DXVKInstallationState.idle;
|
|
||||||
|
|
||||||
Int64 currentProgress = Int64(0);
|
|
||||||
Int64 maxProgress = Int64(0);
|
|
||||||
|
|
||||||
Future startInstallation(
|
|
||||||
GameStateProvider gameStateProvider, String protonVersion) async {
|
|
||||||
StartDXVKInstallation(protonVersion: protonVersion).sendSignalToRust();
|
|
||||||
final progressStream = DXVKDownloadProgress.rustSignalStream;
|
|
||||||
await for (final rustSignal in progressStream) {
|
|
||||||
currentProgress = rustSignal.message.current;
|
|
||||||
maxProgress = rustSignal.message.max;
|
|
||||||
|
|
||||||
if (dxvkState == DXVKInstallationState.idle) {
|
|
||||||
dxvkState = DXVKInstallationState.downloading;
|
|
||||||
}
|
|
||||||
|
|
||||||
notifyListeners();
|
|
||||||
|
|
||||||
if (currentProgress >= maxProgress) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
final notificationDecompressingStream =
|
|
||||||
NotifyDXVKStartDecompressing.rustSignalStream;
|
|
||||||
await for (final _ in notificationDecompressingStream) {
|
|
||||||
dxvkState = DXVKInstallationState.decompressing;
|
|
||||||
notifyListeners();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
final notificationInstalledStream =
|
|
||||||
NotifyDXVKSuccessfullyInstalled.rustSignalStream;
|
|
||||||
await for (final _ in notificationInstalledStream) {
|
|
||||||
gameStateProvider.updateGameState();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,56 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter/services.dart';
|
|
||||||
import 'package:flutter_highlight/flutter_highlight.dart';
|
|
||||||
import 'package:flutter_highlight/themes/vs.dart';
|
|
||||||
import 'package:flutter_highlight/themes/vs2015.dart';
|
|
||||||
import 'package:yaru/icons.dart';
|
|
||||||
import 'package:yaru/widgets.dart';
|
|
||||||
|
|
||||||
import './../messages/error.pb.dart';
|
|
||||||
|
|
||||||
class ErrorReporter {
|
|
||||||
static Future listenAllRustError(
|
|
||||||
GlobalKey<NavigatorState> navigatorState) async {
|
|
||||||
final stream = ReportError.rustSignalStream;
|
|
||||||
await for (final rustSignal in stream) {
|
|
||||||
final context = navigatorState.currentState!.overlay!.context;
|
|
||||||
await showDialog<void>(
|
|
||||||
context: context,
|
|
||||||
builder: (context) => AlertDialog(
|
|
||||||
titlePadding: EdgeInsets.zero,
|
|
||||||
title: YaruDialogTitleBar(
|
|
||||||
title: const Text('Error'),
|
|
||||||
isClosable: true,
|
|
||||||
leading: Center(
|
|
||||||
child: YaruIconButton(
|
|
||||||
icon: const Icon(YaruIcons.copy),
|
|
||||||
tooltip: 'Copy',
|
|
||||||
onPressed: () async {
|
|
||||||
Clipboard.setData(
|
|
||||||
ClipboardData(text: rustSignal.message.errorMessage),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
contentPadding: EdgeInsets.zero,
|
|
||||||
content: SizedBox(
|
|
||||||
height: 400,
|
|
||||||
width: 700,
|
|
||||||
child: HighlightView(
|
|
||||||
rustSignal.message.errorMessage,
|
|
||||||
language: '',
|
|
||||||
theme: Theme.of(context).brightness == Brightness.dark
|
|
||||||
? vs2015Theme
|
|
||||||
: vsTheme,
|
|
||||||
padding: const EdgeInsets.all(12),
|
|
||||||
textStyle: const TextStyle(
|
|
||||||
fontSize: 16,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,38 +0,0 @@
|
|||||||
import 'package:fixnum/fixnum.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
import './../messages/steps/fonts.pb.dart';
|
|
||||||
import './../providers/providers.dart';
|
|
||||||
|
|
||||||
enum FontsInstallationState {
|
|
||||||
idle,
|
|
||||||
installing,
|
|
||||||
}
|
|
||||||
|
|
||||||
class Fonts with ChangeNotifier {
|
|
||||||
FontsInstallationState fontsState = FontsInstallationState.idle;
|
|
||||||
|
|
||||||
Int64 currentProgress = Int64(0);
|
|
||||||
Int64 maxProgress = Int64(0);
|
|
||||||
|
|
||||||
Future startInstallation(GameStateProvider gameState) async {
|
|
||||||
StartFontsInstallation().sendSignalToRust();
|
|
||||||
final stream = FontsInstallationProgress.rustSignalStream;
|
|
||||||
await for (final rustSignal in stream) {
|
|
||||||
maxProgress = rustSignal.message.max;
|
|
||||||
currentProgress = rustSignal.message.current;
|
|
||||||
|
|
||||||
if (fontsState == FontsInstallationState.idle) {
|
|
||||||
fontsState = FontsInstallationState.installing;
|
|
||||||
}
|
|
||||||
|
|
||||||
notifyListeners();
|
|
||||||
|
|
||||||
if (currentProgress >= maxProgress) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gameState.updateGameState();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,84 +0,0 @@
|
|||||||
import 'package:babylonia_terminal_launcher/messages/steps/game.pb.dart';
|
|
||||||
import 'package:fixnum/fixnum.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
import './../providers/providers.dart';
|
|
||||||
|
|
||||||
enum GameInstallationState {
|
|
||||||
idle,
|
|
||||||
checkingFile,
|
|
||||||
downloading,
|
|
||||||
patching,
|
|
||||||
}
|
|
||||||
|
|
||||||
enum GameRunState {
|
|
||||||
idle,
|
|
||||||
running,
|
|
||||||
}
|
|
||||||
|
|
||||||
class Game with ChangeNotifier {
|
|
||||||
GameInstallationState gameInstallationState = GameInstallationState.idle;
|
|
||||||
GameRunState gameRunState = GameRunState.idle;
|
|
||||||
|
|
||||||
Int64 currentProgress = Int64(0);
|
|
||||||
Int64 maxProgress = Int64(0);
|
|
||||||
Int64 currentSpeed = Int64(0);
|
|
||||||
|
|
||||||
Future startInstallation(GameStateProvider gameState, bool isUpdating) async {
|
|
||||||
StartGameInstallation(isUpdating: isUpdating).sendSignalToRust();
|
|
||||||
gameInstallationState = GameInstallationState.checkingFile;
|
|
||||||
notifyListeners();
|
|
||||||
|
|
||||||
final downloadProgresStream = GameInstallationProgress.rustSignalStream;
|
|
||||||
DateTime waitUntil = DateTime.now().add(const Duration(seconds: 1));
|
|
||||||
Int64 lastProgress = Int64(0);
|
|
||||||
await for (final rustSignal in downloadProgresStream) {
|
|
||||||
if (gameInstallationState == GameInstallationState.checkingFile) {
|
|
||||||
gameInstallationState = GameInstallationState.downloading;
|
|
||||||
}
|
|
||||||
|
|
||||||
currentProgress = rustSignal.message.current;
|
|
||||||
maxProgress = rustSignal.message.max;
|
|
||||||
|
|
||||||
if (waitUntil.isBefore(DateTime.now())) {
|
|
||||||
if (currentSpeed == 0) {
|
|
||||||
currentSpeed = currentProgress;
|
|
||||||
lastProgress = currentProgress;
|
|
||||||
} else {
|
|
||||||
currentSpeed = currentProgress - lastProgress;
|
|
||||||
lastProgress = currentProgress;
|
|
||||||
}
|
|
||||||
|
|
||||||
waitUntil = DateTime.now().add(const Duration(seconds: 1));
|
|
||||||
}
|
|
||||||
|
|
||||||
notifyListeners();
|
|
||||||
|
|
||||||
if (currentProgress >= maxProgress) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gameInstallationState = GameInstallationState.patching;
|
|
||||||
notifyListeners();
|
|
||||||
|
|
||||||
final successStream = NotifyGameSuccessfullyInstalled.rustSignalStream;
|
|
||||||
await for (final _ in successStream) {
|
|
||||||
gameState.updateGameState();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Future startGame() async {
|
|
||||||
RunGame().sendSignalToRust();
|
|
||||||
gameRunState = GameRunState.running;
|
|
||||||
notifyListeners();
|
|
||||||
|
|
||||||
final stream = GameStopped.rustSignalStream;
|
|
||||||
await for (final _ in stream) {
|
|
||||||
gameRunState = GameRunState.idle;
|
|
||||||
notifyListeners();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,34 +0,0 @@
|
|||||||
import 'package:babylonia_terminal_launcher/messages/github.pb.dart';
|
|
||||||
|
|
||||||
class Github {
|
|
||||||
static bool _isFetchingProtonVersions = false;
|
|
||||||
static bool _isFetchingDXVKVersions = false;
|
|
||||||
|
|
||||||
static Future<List<String>> getProtonVersions() async {
|
|
||||||
if (!_isFetchingProtonVersions) {
|
|
||||||
_isFetchingProtonVersions = true;
|
|
||||||
AskProtonVersions().sendSignalToRust();
|
|
||||||
final stream = ProtonVersions.rustSignalStream;
|
|
||||||
|
|
||||||
await for (final rustSignal in stream) {
|
|
||||||
_isFetchingProtonVersions = false;
|
|
||||||
return rustSignal.message.versions;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
static Future<List<String>> getDXVKVersions() async {
|
|
||||||
if (!_isFetchingDXVKVersions) {
|
|
||||||
_isFetchingDXVKVersions = true;
|
|
||||||
AskDXVKVersions().sendSignalToRust();
|
|
||||||
final stream = DXVKVersions.rustSignalStream;
|
|
||||||
|
|
||||||
await for (final rustSignal in stream) {
|
|
||||||
_isFetchingDXVKVersions = false;
|
|
||||||
return rustSignal.message.versions;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,53 +0,0 @@
|
|||||||
import 'package:fixnum/fixnum.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
import './../messages/steps/proton.pb.dart';
|
|
||||||
import './../providers/providers.dart';
|
|
||||||
|
|
||||||
enum ProtonInstallationState {
|
|
||||||
idle,
|
|
||||||
downloading,
|
|
||||||
decompressing,
|
|
||||||
}
|
|
||||||
|
|
||||||
class Proton with ChangeNotifier {
|
|
||||||
ProtonInstallationState protonState = ProtonInstallationState.idle;
|
|
||||||
|
|
||||||
Int64 currentProgress = Int64(0);
|
|
||||||
Int64 maxProgress = Int64(0);
|
|
||||||
|
|
||||||
Future startInstallation(
|
|
||||||
GameStateProvider gameStateProvider, String protonVersion) async {
|
|
||||||
StartProtonInstallation(protonVersion: protonVersion).sendSignalToRust();
|
|
||||||
final progressStream = ProtonDownloadProgress.rustSignalStream;
|
|
||||||
await for (final rustSignal in progressStream) {
|
|
||||||
currentProgress = rustSignal.message.current;
|
|
||||||
maxProgress = rustSignal.message.max;
|
|
||||||
|
|
||||||
if (protonState == ProtonInstallationState.idle) {
|
|
||||||
protonState = ProtonInstallationState.downloading;
|
|
||||||
}
|
|
||||||
|
|
||||||
notifyListeners();
|
|
||||||
|
|
||||||
if (currentProgress >= maxProgress) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
final notificationDecompressingStream =
|
|
||||||
NotifyProtonStartDecompressing.rustSignalStream;
|
|
||||||
await for (final _ in notificationDecompressingStream) {
|
|
||||||
protonState = ProtonInstallationState.decompressing;
|
|
||||||
notifyListeners();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
final notificationInstalledStream =
|
|
||||||
NotifyProtonSuccessfullyInstalled.rustSignalStream;
|
|
||||||
await for (final _ in notificationInstalledStream) {
|
|
||||||
gameStateProvider.updateGameState();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,23 +0,0 @@
|
|||||||
import 'package:flutter/services.dart';
|
|
||||||
|
|
||||||
class ReleaseNoticeInfo {
|
|
||||||
static Future<String> getInfo(String currentVersion) async {
|
|
||||||
final content = await rootBundle.loadString("CHANGELOG.md");
|
|
||||||
return parseChangelog(content, currentVersion);
|
|
||||||
}
|
|
||||||
|
|
||||||
static String parseChangelog(String content, String currentVersion) {
|
|
||||||
final regex = RegExp(r'(## \[' +
|
|
||||||
currentVersion +
|
|
||||||
'].+)(?<content>(.|\n)*)(?=(\[unreleased\]|(## \[\d\.\d\.\d\])))');
|
|
||||||
final match = regex.firstMatch(content);
|
|
||||||
if (match != null) {
|
|
||||||
final changelogContent = match.namedGroup("content");
|
|
||||||
|
|
||||||
if (changelogContent != null) {
|
|
||||||
return changelogContent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return "### Failed to parse info";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,162 +0,0 @@
|
|||||||
import 'dart:async';
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
|
||||||
|
|
||||||
import './config.dart';
|
|
||||||
|
|
||||||
enum BackgroundType {
|
|
||||||
contain,
|
|
||||||
fill,
|
|
||||||
cover,
|
|
||||||
fitHeight,
|
|
||||||
fitWidth,
|
|
||||||
disable,
|
|
||||||
}
|
|
||||||
|
|
||||||
class Settings {
|
|
||||||
final SharedPreferences prefs;
|
|
||||||
String? _launchOptions;
|
|
||||||
|
|
||||||
Settings({required this.prefs, required String? launchOptions})
|
|
||||||
: _launchOptions = launchOptions;
|
|
||||||
|
|
||||||
static Future<Settings> create() async {
|
|
||||||
final prefs = await SharedPreferences.getInstance();
|
|
||||||
final launchOptions = await Config.getLaunchOptions();
|
|
||||||
return Settings(
|
|
||||||
prefs: prefs,
|
|
||||||
launchOptions: launchOptions,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
final String _firstTimeKey = 'first_time';
|
|
||||||
bool? get firstTime {
|
|
||||||
return prefs.getBool(_firstTimeKey);
|
|
||||||
}
|
|
||||||
|
|
||||||
set firstTime(bool? value) {
|
|
||||||
prefs.setBool(_firstTimeKey, value!);
|
|
||||||
}
|
|
||||||
|
|
||||||
final String _lastVersionKey = 'last_version';
|
|
||||||
String? get lastVersion {
|
|
||||||
return prefs.getString(_lastVersionKey);
|
|
||||||
}
|
|
||||||
|
|
||||||
set lastVersion(String? value) {
|
|
||||||
prefs.setString(_lastVersionKey, value!);
|
|
||||||
}
|
|
||||||
|
|
||||||
String? get launchOptions {
|
|
||||||
return _launchOptions;
|
|
||||||
}
|
|
||||||
|
|
||||||
set launchOptions(String? value) {
|
|
||||||
Config.setLaunchOptions(value);
|
|
||||||
_launchOptions = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
BackgroundType? _backgroundType;
|
|
||||||
final String _backgroundTypeKey = 'background_type';
|
|
||||||
|
|
||||||
BackgroundType get selectedBackgroundType {
|
|
||||||
final bt = prefs.getString(_backgroundTypeKey);
|
|
||||||
if (bt == null) {
|
|
||||||
_backgroundType = BackgroundType.disable;
|
|
||||||
prefs.setString(
|
|
||||||
_backgroundTypeKey,
|
|
||||||
getStringNameOfBackgroundType(_backgroundType!),
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
_backgroundType ??= getBackgroundTypeFromString(bt);
|
|
||||||
}
|
|
||||||
|
|
||||||
return _backgroundType!;
|
|
||||||
}
|
|
||||||
|
|
||||||
set selectedBackgroundType(BackgroundType selectedBackground) {
|
|
||||||
_backgroundType = selectedBackground;
|
|
||||||
prefs.setString(
|
|
||||||
_backgroundTypeKey,
|
|
||||||
getStringNameOfBackgroundType(selectedBackground),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
int? _backgroundId;
|
|
||||||
String backgroundIdKey = 'background_id';
|
|
||||||
|
|
||||||
int? get backgroundId {
|
|
||||||
_backgroundId ??= prefs.getInt(backgroundIdKey);
|
|
||||||
|
|
||||||
return _backgroundId;
|
|
||||||
}
|
|
||||||
|
|
||||||
set backgroundId(int? value) {
|
|
||||||
_backgroundId = value;
|
|
||||||
prefs.setInt(backgroundIdKey, value!);
|
|
||||||
}
|
|
||||||
|
|
||||||
static final List<BackgroundType> backgoundList = [
|
|
||||||
BackgroundType.contain,
|
|
||||||
BackgroundType.fill,
|
|
||||||
BackgroundType.cover,
|
|
||||||
BackgroundType.fitHeight,
|
|
||||||
BackgroundType.fitWidth,
|
|
||||||
BackgroundType.disable,
|
|
||||||
];
|
|
||||||
|
|
||||||
static String getStringNameOfBackgroundType(BackgroundType backgroundType) {
|
|
||||||
switch (backgroundType) {
|
|
||||||
case BackgroundType.contain:
|
|
||||||
return 'contain';
|
|
||||||
case BackgroundType.fill:
|
|
||||||
return 'fill';
|
|
||||||
case BackgroundType.cover:
|
|
||||||
return 'cover';
|
|
||||||
case BackgroundType.fitHeight:
|
|
||||||
return 'fitHeight';
|
|
||||||
case BackgroundType.fitWidth:
|
|
||||||
return 'fitWidth';
|
|
||||||
case BackgroundType.disable:
|
|
||||||
return 'disable';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static BackgroundType getBackgroundTypeFromString(String background) {
|
|
||||||
switch (background) {
|
|
||||||
case 'contain':
|
|
||||||
return BackgroundType.contain;
|
|
||||||
case 'fill':
|
|
||||||
return BackgroundType.fill;
|
|
||||||
case 'cover':
|
|
||||||
return BackgroundType.cover;
|
|
||||||
case 'fitHeight':
|
|
||||||
return BackgroundType.fitHeight;
|
|
||||||
case 'fitWidth':
|
|
||||||
return BackgroundType.fitWidth;
|
|
||||||
case 'disable':
|
|
||||||
return BackgroundType.disable;
|
|
||||||
default:
|
|
||||||
throw FormatException('Can\'t convert String to Enum BackgroundType!');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static BoxFit getBoxFitFromBackgroundType(BackgroundType backgroundType) {
|
|
||||||
switch (backgroundType) {
|
|
||||||
case BackgroundType.contain:
|
|
||||||
return BoxFit.contain;
|
|
||||||
case BackgroundType.fill:
|
|
||||||
return BoxFit.fill;
|
|
||||||
case BackgroundType.cover:
|
|
||||||
return BoxFit.cover;
|
|
||||||
case BackgroundType.fitHeight:
|
|
||||||
return BoxFit.fitHeight;
|
|
||||||
case BackgroundType.fitWidth:
|
|
||||||
return BoxFit.fitWidth;
|
|
||||||
case BackgroundType.disable:
|
|
||||||
throw FormatException(
|
|
||||||
'Can\'t convert BackgroundType to widget BoxFit!');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,43 +0,0 @@
|
|||||||
import 'package:babylonia_terminal_launcher/messages/game_state.pb.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
class GameStateProvider with ChangeNotifier {
|
|
||||||
States? _gameState;
|
|
||||||
bool isUpdating = false;
|
|
||||||
bool haveToSetup = false;
|
|
||||||
|
|
||||||
get gameState {
|
|
||||||
return _gameState;
|
|
||||||
}
|
|
||||||
|
|
||||||
Future updateGameState() async {
|
|
||||||
if (!isUpdating) {
|
|
||||||
isUpdating = true;
|
|
||||||
AskGameState().sendSignalToRust();
|
|
||||||
|
|
||||||
final stream = GameState.rustSignalStream;
|
|
||||||
await for (final rustSignal in stream) {
|
|
||||||
_gameState = rustSignal.message.state;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
isUpdating = false;
|
|
||||||
notifyListeners();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void updateSetup() {
|
|
||||||
haveToSetup = needToSetup();
|
|
||||||
notifyListeners();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool needToSetup() {
|
|
||||||
return _gameState == States.ProtonNotInstalled ||
|
|
||||||
_gameState == States.DXVKNotInstalled ||
|
|
||||||
_gameState == States.FontNotInstalled ||
|
|
||||||
_gameState == States.DependecieNotInstalled;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isGameUpdating() {
|
|
||||||
return _gameState == States.GameNeedUpdate;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,2 +0,0 @@
|
|||||||
export './settings_provider.dart';
|
|
||||||
export './game_state_provider.dart';
|
|
||||||
@ -1,67 +0,0 @@
|
|||||||
import 'package:flutter/foundation.dart';
|
|
||||||
|
|
||||||
import './../models/settings.dart';
|
|
||||||
import './../models/config.dart';
|
|
||||||
|
|
||||||
class SettingsProvider with ChangeNotifier {
|
|
||||||
late final Settings _settings;
|
|
||||||
|
|
||||||
Future init() async {
|
|
||||||
_settings = await Settings.create();
|
|
||||||
if (kDebugMode) {
|
|
||||||
_settings.firstTime = true;
|
|
||||||
_settings.prefs.clear();
|
|
||||||
}
|
|
||||||
await Config.update();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool get firstTime {
|
|
||||||
final result = _settings.firstTime;
|
|
||||||
if (result == null) {
|
|
||||||
_settings.firstTime = true;
|
|
||||||
}
|
|
||||||
return _settings.firstTime!;
|
|
||||||
}
|
|
||||||
|
|
||||||
set firstTime(bool value) {
|
|
||||||
_settings.firstTime = value;
|
|
||||||
notifyListeners();
|
|
||||||
}
|
|
||||||
|
|
||||||
String get lastVersion {
|
|
||||||
final result = _settings.lastVersion;
|
|
||||||
if (result == null) {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
set lastVersion(String value) {
|
|
||||||
_settings.lastVersion = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
set setSelectedBackgroundType(BackgroundType selectedBackground) {
|
|
||||||
_settings.selectedBackgroundType = selectedBackground;
|
|
||||||
notifyListeners();
|
|
||||||
}
|
|
||||||
|
|
||||||
get getSelectedBackgroundType {
|
|
||||||
return _settings.selectedBackgroundType;
|
|
||||||
}
|
|
||||||
|
|
||||||
int? get backgroundId {
|
|
||||||
return _settings.backgroundId;
|
|
||||||
}
|
|
||||||
|
|
||||||
set backgroundId(int? value) {
|
|
||||||
_settings.backgroundId = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
String? get launchOptions {
|
|
||||||
return _settings.launchOptions;
|
|
||||||
}
|
|
||||||
|
|
||||||
set launchOptions(String? value) {
|
|
||||||
_settings.launchOptions = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,79 +0,0 @@
|
|||||||
import 'package:babylonia_terminal_launcher/messages/game_state.pb.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
|
||||||
|
|
||||||
import '../widgets/background_widget.dart';
|
|
||||||
import '../widgets/serious_lee_widget.dart';
|
|
||||||
import '../widgets/play_button.dart';
|
|
||||||
import '../widgets/steps/game_steps_widget.dart';
|
|
||||||
import './../providers/providers.dart';
|
|
||||||
import './../models/settings.dart';
|
|
||||||
import './../models/background.dart';
|
|
||||||
|
|
||||||
class HomeScreen extends StatelessWidget {
|
|
||||||
const HomeScreen({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
final gameStateProvider = Provider.of<GameStateProvider>(context);
|
|
||||||
|
|
||||||
return Stack(
|
|
||||||
children: [
|
|
||||||
const ShowBackground(),
|
|
||||||
gameStateProvider.gameState != States.GameInstalled
|
|
||||||
? const GameSteps()
|
|
||||||
: const PlayButton(),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class ShowBackground extends StatefulWidget {
|
|
||||||
const ShowBackground({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<ShowBackground> createState() => _ShowBackgroundState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _ShowBackgroundState extends State<ShowBackground> {
|
|
||||||
bool isLoading = false;
|
|
||||||
bool hadLoaded = false;
|
|
||||||
late final Background _background;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void didChangeDependencies() async {
|
|
||||||
if (!hadLoaded) {
|
|
||||||
isLoading = true;
|
|
||||||
|
|
||||||
_background =
|
|
||||||
await Background.get(Provider.of<SettingsProvider>(context));
|
|
||||||
|
|
||||||
setState(() {
|
|
||||||
isLoading = false;
|
|
||||||
hadLoaded = true;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
super.didChangeDependencies();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
if (Provider.of<SettingsProvider>(context).getSelectedBackgroundType !=
|
|
||||||
BackgroundType.disable) {
|
|
||||||
if (isLoading) {
|
|
||||||
return const SeriousLeeWidget(
|
|
||||||
title: 'Babylonia Terminal',
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return BackgroundWidget(
|
|
||||||
background: _background,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return const SeriousLeeWidget(
|
|
||||||
title: 'Babylonia Terminal',
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,36 +0,0 @@
|
|||||||
import 'package:babylonia_terminal_launcher/screens/settings_screen.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:yaru/icons.dart';
|
|
||||||
|
|
||||||
import 'package:babylonia_terminal_launcher/screens/home_screen.dart';
|
|
||||||
|
|
||||||
class Screens {
|
|
||||||
static final _screens = <Widget, (Widget, Widget, String)>{
|
|
||||||
const HomeScreen(): (
|
|
||||||
const Icon(YaruIcons.home_filled),
|
|
||||||
const Icon(YaruIcons.home),
|
|
||||||
'Home',
|
|
||||||
),
|
|
||||||
const SettingsScreen(): (
|
|
||||||
const Icon(YaruIcons.settings_filled),
|
|
||||||
const Icon(YaruIcons.settings),
|
|
||||||
'Settings',
|
|
||||||
),
|
|
||||||
};
|
|
||||||
|
|
||||||
static List<Widget> drawerItem(
|
|
||||||
{required Function(int) onSelected, required int selectedIndex}) =>
|
|
||||||
[
|
|
||||||
for (int i = 0; i < Screens._screens.values.length; i++)
|
|
||||||
ListTile(
|
|
||||||
selected: i == selectedIndex,
|
|
||||||
leading: i == selectedIndex
|
|
||||||
? Screens._screens.values.elementAt(i).$1
|
|
||||||
: Screens._screens.values.elementAt(i).$2,
|
|
||||||
title: Text(Screens._screens.values.elementAt(i).$3),
|
|
||||||
onTap: () => onSelected(i),
|
|
||||||
),
|
|
||||||
];
|
|
||||||
|
|
||||||
static Widget getCurrent(int index) => Screens._screens.keys.toList()[index];
|
|
||||||
}
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
class GameSettingsPage extends StatelessWidget {
|
|
||||||
const GameSettingsPage({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return const Center(
|
|
||||||
child: Text('Game settings'),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,69 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
|
||||||
import 'package:yaru/yaru.dart';
|
|
||||||
|
|
||||||
import './../../providers/settings_provider.dart';
|
|
||||||
|
|
||||||
class GeneralSettingsPage extends StatefulWidget {
|
|
||||||
const GeneralSettingsPage({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<GeneralSettingsPage> createState() => _GeneralSettingsPageState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _GeneralSettingsPageState extends State<GeneralSettingsPage> {
|
|
||||||
final textFieldController = TextEditingController();
|
|
||||||
String? _launchOptionsError;
|
|
||||||
|
|
||||||
bool isLaunchOptionsValid(String launchOptions) {
|
|
||||||
return RegExp(r'^.*%command%.*$').hasMatch(launchOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
final provider = Provider.of<SettingsProvider>(context, listen: false);
|
|
||||||
final launchOptions = provider.launchOptions;
|
|
||||||
|
|
||||||
return Center(
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.all(15.0),
|
|
||||||
child: SizedBox(
|
|
||||||
child: YaruSection(
|
|
||||||
headline: const Text('Launch options'),
|
|
||||||
child: TextFormField(
|
|
||||||
initialValue: launchOptions,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
labelText:
|
|
||||||
'Your custom launch options, E.G. : mangohud %command%',
|
|
||||||
errorText: _launchOptionsError,
|
|
||||||
),
|
|
||||||
validator: (value) => _launchOptionsError,
|
|
||||||
onChanged: (String text) {
|
|
||||||
if (text.isEmpty) {
|
|
||||||
setState(() {
|
|
||||||
_launchOptionsError = null;
|
|
||||||
});
|
|
||||||
provider.launchOptions = null;
|
|
||||||
} else if (!isLaunchOptionsValid(text)) {
|
|
||||||
setState(() {
|
|
||||||
_launchOptionsError =
|
|
||||||
'You need to put \'%command%\' in your command';
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
setState(() {
|
|
||||||
_launchOptionsError = null;
|
|
||||||
});
|
|
||||||
provider.launchOptions = text;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,33 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:yaru/yaru.dart';
|
|
||||||
|
|
||||||
import './general_settings_page.dart';
|
|
||||||
import './game_settings_page.dart';
|
|
||||||
import './style_settings_page.dart';
|
|
||||||
|
|
||||||
class SettingsPage {
|
|
||||||
static final _pages = <Widget, (Widget, String)>{
|
|
||||||
const GeneralSettingsPage(): (
|
|
||||||
const Icon(YaruIcons.gears),
|
|
||||||
'General',
|
|
||||||
),
|
|
||||||
const GameSettingsPage(): (
|
|
||||||
const Icon(YaruIcons.game_controller_filled),
|
|
||||||
'Game',
|
|
||||||
),
|
|
||||||
const StyleSettingsPage(): (
|
|
||||||
const Icon(YaruIcons.desktop_appearance_filled),
|
|
||||||
'Style',
|
|
||||||
),
|
|
||||||
};
|
|
||||||
|
|
||||||
static List<Widget> tabItems() => [
|
|
||||||
for (int i = 0; i < SettingsPage._pages.values.length; i++)
|
|
||||||
YaruTab(
|
|
||||||
icon: SettingsPage._pages.values.elementAt(i).$1,
|
|
||||||
label: SettingsPage._pages.values.elementAt(i).$2,
|
|
||||||
),
|
|
||||||
];
|
|
||||||
|
|
||||||
static List<Widget> getPages() => SettingsPage._pages.keys.toList();
|
|
||||||
}
|
|
||||||
@ -1,69 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
|
||||||
import 'package:yaru/yaru.dart';
|
|
||||||
|
|
||||||
import './../../providers/settings_provider.dart';
|
|
||||||
import './../../models/settings.dart';
|
|
||||||
|
|
||||||
class StyleSettingsPage extends StatefulWidget {
|
|
||||||
const StyleSettingsPage({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<StyleSettingsPage> createState() => _StyleSettingsPageState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _StyleSettingsPageState extends State<StyleSettingsPage> {
|
|
||||||
late BackgroundType _radioValue;
|
|
||||||
|
|
||||||
void setBackgroundValue(
|
|
||||||
BuildContext context,
|
|
||||||
SettingsProvider provider,
|
|
||||||
BackgroundType? value,
|
|
||||||
) {
|
|
||||||
if (value != null) {
|
|
||||||
provider.setSelectedBackgroundType = value;
|
|
||||||
setState(() {
|
|
||||||
_radioValue = value;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
final provider = Provider.of<SettingsProvider>(context, listen: false);
|
|
||||||
_radioValue = provider.getSelectedBackgroundType;
|
|
||||||
|
|
||||||
return Center(
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.all(15.0),
|
|
||||||
child: SizedBox(
|
|
||||||
child: YaruSection(
|
|
||||||
headline: const Text('Background video'),
|
|
||||||
child: Column(
|
|
||||||
children: Settings.backgoundList
|
|
||||||
.map(
|
|
||||||
(b) => YaruRadioListTile(
|
|
||||||
value: b,
|
|
||||||
groupValue: _radioValue,
|
|
||||||
onChanged: (v) =>
|
|
||||||
setBackgroundValue(context, provider, v),
|
|
||||||
toggleable: true,
|
|
||||||
title: Text(
|
|
||||||
Settings.getStringNameOfBackgroundType(
|
|
||||||
b,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
.toList(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,52 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:yaru/yaru.dart';
|
|
||||||
|
|
||||||
import './settings/settings_pages.dart';
|
|
||||||
|
|
||||||
class SettingsScreen extends StatefulWidget {
|
|
||||||
const SettingsScreen({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<SettingsScreen> createState() => _SettingsScreenState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _SettingsScreenState extends State<SettingsScreen>
|
|
||||||
with TickerProviderStateMixin {
|
|
||||||
late TabController tabController;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
tabController =
|
|
||||||
TabController(length: SettingsPage.getPages().length, vsync: this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void dispose() {
|
|
||||||
super.dispose();
|
|
||||||
tabController.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Center(
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 15.0),
|
|
||||||
child: YaruTabBar(
|
|
||||||
tabController: tabController,
|
|
||||||
tabs: SettingsPage.tabItems(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: TabBarView(
|
|
||||||
controller: tabController,
|
|
||||||
children: SettingsPage.getPages(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,23 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
|
||||||
|
|
||||||
import './../providers/settings_provider.dart';
|
|
||||||
import './setups/welcome_screen.dart';
|
|
||||||
import 'setups/steps_screen.dart';
|
|
||||||
|
|
||||||
class SetupScreen extends StatelessWidget {
|
|
||||||
const SetupScreen({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
final settingsProvider = Provider.of<SettingsProvider>(context);
|
|
||||||
|
|
||||||
return Scaffold(
|
|
||||||
appBar: AppBar(
|
|
||||||
title: const Text("Babylonia Terminal"),
|
|
||||||
centerTitle: true,
|
|
||||||
),
|
|
||||||
body: settingsProvider.firstTime ? const WelcomeScreen() : StepsScreen(),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,81 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter/widgets.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
|
||||||
import 'package:yaru/yaru.dart';
|
|
||||||
|
|
||||||
import './../../messages/game_state.pb.dart';
|
|
||||||
import './../../providers/providers.dart';
|
|
||||||
import './../../widgets/selectable_yaru_expansion_panel.dart';
|
|
||||||
import './../../widgets/simple_button.dart';
|
|
||||||
import './../../widgets/steps/proton_steps_widget.dart';
|
|
||||||
import './../../widgets/steps/dxvk_steps_widget.dart';
|
|
||||||
import './../../widgets/steps/fonts_steps_widget.dart';
|
|
||||||
import './../../widgets/steps/dependencies_steps_widget.dart';
|
|
||||||
|
|
||||||
class StepsScreen extends StatelessWidget {
|
|
||||||
StepsScreen({super.key});
|
|
||||||
final SectionController controller = SectionController(selectedItem: 0);
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
final gameStateProvider = Provider.of<GameStateProvider>(context);
|
|
||||||
switch (gameStateProvider.gameState) {
|
|
||||||
case States.ProtonNotInstalled:
|
|
||||||
controller.updateSection(0);
|
|
||||||
break;
|
|
||||||
case States.DXVKNotInstalled:
|
|
||||||
controller.updateSection(1);
|
|
||||||
break;
|
|
||||||
case States.FontNotInstalled:
|
|
||||||
controller.updateSection(2);
|
|
||||||
break;
|
|
||||||
case States.DependecieNotInstalled:
|
|
||||||
controller.updateSection(3);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
controller.updateSection(null);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return Center(
|
|
||||||
child: Column(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
ConstrainedBox(
|
|
||||||
constraints: const BoxConstraints(
|
|
||||||
maxHeight: 600,
|
|
||||||
maxWidth: 750,
|
|
||||||
),
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 25.0),
|
|
||||||
child: SelectableYaruExpansionPanel(
|
|
||||||
controller: controller,
|
|
||||||
headers: const [
|
|
||||||
Text("Proton"),
|
|
||||||
Text("DXVK"),
|
|
||||||
Text("Fonts"),
|
|
||||||
Text("Dependencies"),
|
|
||||||
],
|
|
||||||
children: const [
|
|
||||||
ProtonSteps(),
|
|
||||||
DXVKSteps(),
|
|
||||||
FontsSteps(),
|
|
||||||
DependenciesSteps(),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(top: 12.0),
|
|
||||||
child: SimpleButton(
|
|
||||||
onPressed: !gameStateProvider.needToSetup()
|
|
||||||
? () => gameStateProvider.updateSetup()
|
|
||||||
: null,
|
|
||||||
child: const Text('next'),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,40 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
|
||||||
|
|
||||||
import './../../providers/settings_provider.dart';
|
|
||||||
import './../../widgets/serious_lee_widget.dart';
|
|
||||||
import './../../widgets/simple_button.dart';
|
|
||||||
|
|
||||||
class WelcomeScreen extends StatelessWidget {
|
|
||||||
const WelcomeScreen({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Center(
|
|
||||||
child: Column(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
const SeriousLeeWidget(title: 'Welcome to Babylonia Terminal!'),
|
|
||||||
const Text(
|
|
||||||
'We have to setup some things first',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 20,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(top: 15.0),
|
|
||||||
child: SizedBox(
|
|
||||||
width: 200,
|
|
||||||
child: SimpleButton(
|
|
||||||
onPressed: () =>
|
|
||||||
Provider.of<SettingsProvider>(context, listen: false)
|
|
||||||
.firstTime = false,
|
|
||||||
child: const Text('Start'),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,56 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:media_kit/media_kit.dart';
|
|
||||||
import 'package:media_kit_video/media_kit_video.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
|
||||||
|
|
||||||
import './../providers/settings_provider.dart';
|
|
||||||
import './../models/settings.dart';
|
|
||||||
import './../models/background.dart';
|
|
||||||
|
|
||||||
class BackgroundWidget extends StatefulWidget {
|
|
||||||
const BackgroundWidget({super.key, required this.background});
|
|
||||||
|
|
||||||
final Background background;
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<BackgroundWidget> createState() => _BackgroundWidgetState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _BackgroundWidgetState extends State<BackgroundWidget> {
|
|
||||||
late final player = Player(
|
|
||||||
configuration: const PlayerConfiguration(),
|
|
||||||
);
|
|
||||||
late final controller = VideoController(player);
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
player.open(
|
|
||||||
Media(
|
|
||||||
widget.background.path,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
player.setPlaylistMode(PlaylistMode.loop);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void dispose() {
|
|
||||||
player.dispose();
|
|
||||||
super.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
final provider = Provider.of<SettingsProvider>(context);
|
|
||||||
|
|
||||||
player.play();
|
|
||||||
return Video(
|
|
||||||
controller: controller,
|
|
||||||
controls: NoVideoControls,
|
|
||||||
wakelock: false,
|
|
||||||
fit: Settings.getBoxFitFromBackgroundType(
|
|
||||||
provider.getSelectedBackgroundType,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,112 +0,0 @@
|
|||||||
import 'dart:math';
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
class GtkSpinner extends StatefulWidget {
|
|
||||||
const GtkSpinner({
|
|
||||||
super.key,
|
|
||||||
this.size = 15.0,
|
|
||||||
this.strokeSize = 5.0,
|
|
||||||
this.color = Colors.grey,
|
|
||||||
});
|
|
||||||
final double size;
|
|
||||||
final double strokeSize;
|
|
||||||
final Color color;
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<GtkSpinner> createState() => _GtkSpinnerState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _GtkSpinnerState extends State<GtkSpinner>
|
|
||||||
with SingleTickerProviderStateMixin {
|
|
||||||
late AnimationController _controller;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
_controller = AnimationController(
|
|
||||||
vsync: this,
|
|
||||||
duration: const Duration(seconds: 1, milliseconds: 500),
|
|
||||||
)..repeat();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void dispose() {
|
|
||||||
_controller.dispose();
|
|
||||||
super.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Padding(
|
|
||||||
padding: const EdgeInsets.all(8.0),
|
|
||||||
child: AnimatedBuilder(
|
|
||||||
animation: _controller,
|
|
||||||
builder: (context, child) {
|
|
||||||
return CustomPaint(
|
|
||||||
painter: _GtkSpinnerPainter(
|
|
||||||
_controller.value * 2 * pi,
|
|
||||||
widget.strokeSize,
|
|
||||||
widget.color,
|
|
||||||
),
|
|
||||||
size: Size(widget.size, widget.size),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class _GtkSpinnerPainter extends CustomPainter {
|
|
||||||
_GtkSpinnerPainter(this.angle, this.strokeSize, this.color);
|
|
||||||
|
|
||||||
final double angle;
|
|
||||||
final double strokeSize;
|
|
||||||
final Color color;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void paint(Canvas canvas, Size size) {
|
|
||||||
final double radius = size.width / 2;
|
|
||||||
final Rect rect =
|
|
||||||
Rect.fromCircle(center: Offset(radius, radius), radius: radius);
|
|
||||||
|
|
||||||
// Define the gradient for the arc
|
|
||||||
final Paint gradientPaint = Paint()
|
|
||||||
..shader = SweepGradient(
|
|
||||||
startAngle: 0.0,
|
|
||||||
endAngle: 2 * pi,
|
|
||||||
colors: [
|
|
||||||
color,
|
|
||||||
color.withOpacity(0.0),
|
|
||||||
],
|
|
||||||
stops: const [0.0, 0.90],
|
|
||||||
transform: GradientRotation(angle),
|
|
||||||
).createShader(rect)
|
|
||||||
..style = PaintingStyle.stroke
|
|
||||||
..strokeCap = StrokeCap.round
|
|
||||||
..strokeWidth = strokeSize;
|
|
||||||
|
|
||||||
// Draw the gradient arc
|
|
||||||
canvas.drawArc(
|
|
||||||
rect,
|
|
||||||
angle,
|
|
||||||
7 * pi / 4, // Draw an arc of 300 degrees
|
|
||||||
false,
|
|
||||||
gradientPaint,
|
|
||||||
);
|
|
||||||
|
|
||||||
// Add two circles at the start and end to create the rounded caps effect
|
|
||||||
final Paint capPaint = Paint()
|
|
||||||
..color = color
|
|
||||||
..style = PaintingStyle.fill;
|
|
||||||
|
|
||||||
canvas.drawCircle(
|
|
||||||
Offset(radius + radius * cos(angle), radius + radius * sin(angle)),
|
|
||||||
strokeSize / 2,
|
|
||||||
capPaint,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool shouldRepaint(CustomPainter oldDelegate) => true;
|
|
||||||
}
|
|
||||||
@ -1,54 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
|
||||||
|
|
||||||
import './simple_button.dart';
|
|
||||||
import './../models/game.dart';
|
|
||||||
|
|
||||||
class PlayButton extends StatelessWidget {
|
|
||||||
const PlayButton({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
final game = Provider.of<Game>(context);
|
|
||||||
|
|
||||||
return Padding(
|
|
||||||
padding: const EdgeInsets.all(50.0),
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
const Expanded(
|
|
||||||
child: SizedBox(),
|
|
||||||
),
|
|
||||||
const Expanded(
|
|
||||||
child: SizedBox(),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: Column(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
|
||||||
children: [
|
|
||||||
ConstrainedBox(
|
|
||||||
constraints: const BoxConstraints(
|
|
||||||
maxWidth: 600,
|
|
||||||
maxHeight: 50,
|
|
||||||
),
|
|
||||||
child: SimpleButton(
|
|
||||||
onPressed: game.gameRunState == GameRunState.idle
|
|
||||||
? () {
|
|
||||||
Provider.of<Game>(context, listen: false)
|
|
||||||
.startGame();
|
|
||||||
}
|
|
||||||
: null,
|
|
||||||
child: Center(
|
|
||||||
child: game.gameRunState == GameRunState.idle
|
|
||||||
? const Text("Play")
|
|
||||||
: const Text("Running..."),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,59 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter_markdown/flutter_markdown.dart';
|
|
||||||
import 'package:yaru/yaru.dart';
|
|
||||||
|
|
||||||
class ReleaseNotice extends StatelessWidget {
|
|
||||||
const ReleaseNotice(
|
|
||||||
{super.key, required this.currentVersion, required this.info});
|
|
||||||
|
|
||||||
final String currentVersion;
|
|
||||||
final String info;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return AlertDialog(
|
|
||||||
titlePadding: EdgeInsets.zero,
|
|
||||||
title: const YaruDialogTitleBar(
|
|
||||||
title: Text('Release notice'),
|
|
||||||
isClosable: true,
|
|
||||||
),
|
|
||||||
contentPadding: EdgeInsets.zero,
|
|
||||||
content: SizedBox(
|
|
||||||
height: 400,
|
|
||||||
width: 700,
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(top: 8.0),
|
|
||||||
child: Text(
|
|
||||||
"Version $currentVersion just dropped!",
|
|
||||||
style: const TextStyle(
|
|
||||||
fontSize: 32,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const Align(
|
|
||||||
alignment: Alignment.centerLeft,
|
|
||||||
child: Padding(
|
|
||||||
padding: EdgeInsets.only(left: 25.0),
|
|
||||||
child: Text(
|
|
||||||
"What's new :",
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 16,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 30.0),
|
|
||||||
child: SizedBox(
|
|
||||||
height: 300,
|
|
||||||
child: Markdown(data: info),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,237 +0,0 @@
|
|||||||
// This file has been literally copied from https://github.com/ubuntu/yaru.dart/blob/main/lib/src/widgets/yaru_expansion_panel.dart
|
|
||||||
// and https://github.com/ubuntu/yaru.dart/blob/main/lib/src/widgets/yaru_expandable.dart
|
|
||||||
// Just want to make some change to it for specific needs instead of contributing to it, because I'm too lazy for that and I think they don't want these change
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
import 'package:yaru/constants.dart';
|
|
||||||
import 'package:yaru/widgets.dart';
|
|
||||||
|
|
||||||
class SectionController extends ChangeNotifier {
|
|
||||||
int? selectedItem;
|
|
||||||
Function()? onChange;
|
|
||||||
|
|
||||||
SectionController({required this.selectedItem});
|
|
||||||
|
|
||||||
void updateSection(int? newSelectedItem) {
|
|
||||||
selectedItem = newSelectedItem;
|
|
||||||
notifyListeners();
|
|
||||||
if (onChange != null) {
|
|
||||||
onChange!();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class SelectableYaruExpansionPanel extends StatefulWidget {
|
|
||||||
const SelectableYaruExpansionPanel({
|
|
||||||
super.key,
|
|
||||||
required this.controller,
|
|
||||||
required this.children,
|
|
||||||
this.borderRadius =
|
|
||||||
const BorderRadius.all(Radius.circular(kYaruContainerRadius)),
|
|
||||||
this.border,
|
|
||||||
required this.headers,
|
|
||||||
this.width,
|
|
||||||
this.height,
|
|
||||||
this.padding,
|
|
||||||
this.margin,
|
|
||||||
this.expandIconPadding = const EdgeInsets.all(10),
|
|
||||||
this.headerPadding = const EdgeInsets.only(left: 20),
|
|
||||||
this.color,
|
|
||||||
this.placeDividers = true,
|
|
||||||
this.expandIcon,
|
|
||||||
this.shrinkWrap = true,
|
|
||||||
this.scrollPhysics = const ClampingScrollPhysics(),
|
|
||||||
this.collapseOnExpand = true,
|
|
||||||
}) : assert(headers.length == children.length);
|
|
||||||
|
|
||||||
final SectionController controller;
|
|
||||||
final List<Widget> children;
|
|
||||||
final List<Widget> headers;
|
|
||||||
final BorderRadius borderRadius;
|
|
||||||
final BoxBorder? border;
|
|
||||||
final double? width;
|
|
||||||
final double? height;
|
|
||||||
final EdgeInsetsGeometry? padding;
|
|
||||||
final EdgeInsetsGeometry? margin;
|
|
||||||
final EdgeInsetsGeometry expandIconPadding;
|
|
||||||
final EdgeInsetsGeometry headerPadding;
|
|
||||||
final Color? color;
|
|
||||||
final bool placeDividers;
|
|
||||||
final Widget? expandIcon;
|
|
||||||
final bool shrinkWrap;
|
|
||||||
final ScrollPhysics scrollPhysics;
|
|
||||||
final bool collapseOnExpand;
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<SelectableYaruExpansionPanel> createState() =>
|
|
||||||
_SelectableYaruExpansionPanelState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _SelectableYaruExpansionPanelState
|
|
||||||
extends State<SelectableYaruExpansionPanel> {
|
|
||||||
late List<bool> _expandedStore;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
widget.controller.onChange = widget.collapseOnExpand
|
|
||||||
? () {
|
|
||||||
if (widget.controller.selectedItem != null) {
|
|
||||||
_expandedStore[widget.controller.selectedItem!];
|
|
||||||
for (var n = 0; n < _expandedStore.length; n++) {
|
|
||||||
if (_expandedStore[n]) {
|
|
||||||
setState(() => _expandedStore[n] = false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for (var n = 0; n < _expandedStore.length; n++) {
|
|
||||||
setState(() => _expandedStore[n] = false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
: null;
|
|
||||||
_expandedStore =
|
|
||||||
List<bool>.generate(widget.children.length, (index) => false);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
assert(widget.children.length == widget.headers.length);
|
|
||||||
|
|
||||||
if (widget.controller.selectedItem != null) {
|
|
||||||
_expandedStore[widget.controller.selectedItem!] = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return YaruBorderContainer(
|
|
||||||
border: widget.border,
|
|
||||||
borderRadius: widget.borderRadius,
|
|
||||||
color: widget.color,
|
|
||||||
width: widget.width,
|
|
||||||
height: widget.height,
|
|
||||||
padding: widget.padding,
|
|
||||||
margin: widget.margin,
|
|
||||||
child: widget.placeDividers
|
|
||||||
? ListView.separated(
|
|
||||||
shrinkWrap: widget.shrinkWrap,
|
|
||||||
physics: widget.scrollPhysics,
|
|
||||||
itemCount: widget.children.length,
|
|
||||||
itemBuilder: _itemBuilder,
|
|
||||||
separatorBuilder: (context, index) {
|
|
||||||
if (index != widget.children.length - 1) {
|
|
||||||
return const Padding(
|
|
||||||
padding: EdgeInsets.symmetric(vertical: 1),
|
|
||||||
child: Divider(),
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return const SizedBox.shrink();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
)
|
|
||||||
: ListView.builder(
|
|
||||||
shrinkWrap: widget.shrinkWrap,
|
|
||||||
physics: widget.scrollPhysics,
|
|
||||||
itemCount: widget.children.length,
|
|
||||||
itemBuilder: _itemBuilder,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget? _itemBuilder(context, index) {
|
|
||||||
return YaruExpandable(
|
|
||||||
expandIconPadding: widget.expandIconPadding,
|
|
||||||
isExpanded: _expandedStore[index],
|
|
||||||
header: Padding(
|
|
||||||
padding: widget.headerPadding,
|
|
||||||
child: widget.headers[index],
|
|
||||||
),
|
|
||||||
child: widget.children[index],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const _kAnimationDuration = Duration(milliseconds: 250);
|
|
||||||
const _kAnimationCurve = Curves.easeInOutCubic;
|
|
||||||
|
|
||||||
class YaruExpandable extends StatefulWidget {
|
|
||||||
const YaruExpandable({
|
|
||||||
super.key,
|
|
||||||
required this.header,
|
|
||||||
this.expandIconPadding = EdgeInsets.zero,
|
|
||||||
required this.child,
|
|
||||||
this.collapsedChild,
|
|
||||||
this.gapHeight = 4.0,
|
|
||||||
this.isExpanded = false,
|
|
||||||
this.onChange,
|
|
||||||
});
|
|
||||||
|
|
||||||
final Widget header;
|
|
||||||
final EdgeInsetsGeometry expandIconPadding;
|
|
||||||
final Widget child;
|
|
||||||
final Widget? collapsedChild;
|
|
||||||
final double gapHeight;
|
|
||||||
final bool isExpanded;
|
|
||||||
final ValueChanged<bool>? onChange;
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<YaruExpandable> createState() => _YaruExpandableState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _YaruExpandableState extends State<YaruExpandable> {
|
|
||||||
late bool _isExpanded;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
_isExpanded = widget.isExpanded;
|
|
||||||
super.initState();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void didUpdateWidget(YaruExpandable oldWidget) {
|
|
||||||
super.didUpdateWidget(oldWidget);
|
|
||||||
if (oldWidget.isExpanded != widget.isExpanded) {
|
|
||||||
_isExpanded = widget.isExpanded;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Column(
|
|
||||||
children: [
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
widget.header,
|
|
||||||
Padding(
|
|
||||||
padding: widget.expandIconPadding,
|
|
||||||
child: const SizedBox(
|
|
||||||
height: 36,
|
|
||||||
width: 36,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
AnimatedCrossFade(
|
|
||||||
firstChild: _buildChild(widget.child),
|
|
||||||
secondChild: widget.collapsedChild != null
|
|
||||||
? _buildChild(widget.collapsedChild!)
|
|
||||||
: Container(),
|
|
||||||
crossFadeState: _isExpanded
|
|
||||||
? CrossFadeState.showFirst
|
|
||||||
: CrossFadeState.showSecond,
|
|
||||||
sizeCurve: _kAnimationCurve,
|
|
||||||
duration: _kAnimationDuration,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget _buildChild(Widget child) {
|
|
||||||
return Column(
|
|
||||||
children: [
|
|
||||||
SizedBox(height: widget.gapHeight),
|
|
||||||
child,
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,32 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
class SeriousLeeWidget extends StatelessWidget {
|
|
||||||
const SeriousLeeWidget({super.key, required this.title});
|
|
||||||
final String title;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Center(
|
|
||||||
child: Column(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
SizedBox(
|
|
||||||
height: 300,
|
|
||||||
child: Image.asset('assets/images/Lee6.png'),
|
|
||||||
),
|
|
||||||
Center(
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.all(8.0),
|
|
||||||
child: Text(
|
|
||||||
title,
|
|
||||||
style: const TextStyle(
|
|
||||||
fontSize: 34,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,30 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
class SimpleButton extends StatelessWidget {
|
|
||||||
const SimpleButton({super.key, required this.child, required this.onPressed});
|
|
||||||
final Function()? onPressed;
|
|
||||||
final Widget? child;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return ElevatedButton(
|
|
||||||
style: ButtonStyle(
|
|
||||||
backgroundColor: MaterialStateProperty.resolveWith((states) {
|
|
||||||
if (states.contains(MaterialState.disabled)) {
|
|
||||||
return Colors.grey;
|
|
||||||
}
|
|
||||||
return Colors.blue[500];
|
|
||||||
}),
|
|
||||||
side: MaterialStateProperty.all(BorderSide.none),
|
|
||||||
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
|
|
||||||
RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(100.0),
|
|
||||||
side: const BorderSide(color: Colors.red),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
onPressed: onPressed,
|
|
||||||
child: child,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,85 +0,0 @@
|
|||||||
import 'package:babylonia_terminal_launcher/widgets/gtk_spinner_widget.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
|
||||||
|
|
||||||
import './../../models/dependencies.dart';
|
|
||||||
import './../../providers/providers.dart';
|
|
||||||
import './../../widgets/simple_button.dart';
|
|
||||||
|
|
||||||
class DependenciesSteps extends StatelessWidget {
|
|
||||||
const DependenciesSteps({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Padding(
|
|
||||||
padding: const EdgeInsets.all(20.0),
|
|
||||||
child: ChangeNotifierProvider(
|
|
||||||
create: (context) => Dependencies(),
|
|
||||||
child: Builder(
|
|
||||||
builder: (context) {
|
|
||||||
switch (Provider.of<Dependencies>(context).dependeciesState) {
|
|
||||||
case DependenciesInstallationState.idle:
|
|
||||||
return const InstallDependecies();
|
|
||||||
case DependenciesInstallationState.installing:
|
|
||||||
return const DependeciesInstallationProgress();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class InstallDependecies extends StatefulWidget {
|
|
||||||
const InstallDependecies({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<InstallDependecies> createState() => _InstallDependeciesState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _InstallDependeciesState extends State<InstallDependecies> {
|
|
||||||
bool canInstall = true;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Padding(
|
|
||||||
padding: const EdgeInsets.only(left: 8.0),
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
SimpleButton(
|
|
||||||
onPressed: canInstall
|
|
||||||
? () {
|
|
||||||
Provider.of<Dependencies>(context, listen: false)
|
|
||||||
.startInstallation(
|
|
||||||
Provider.of<GameStateProvider>(context, listen: false),
|
|
||||||
);
|
|
||||||
setState(() {
|
|
||||||
canInstall = false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
: null,
|
|
||||||
child: const Text("Install"),
|
|
||||||
),
|
|
||||||
if (!canInstall) const GtkSpinner(),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class DependeciesInstallationProgress extends StatelessWidget {
|
|
||||||
const DependeciesInstallationProgress({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return const Row(
|
|
||||||
children: [
|
|
||||||
GtkSpinner(),
|
|
||||||
Text(
|
|
||||||
'Installing dependecies (this can take a while, so go grab a coffee)',
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,159 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
|
||||||
import 'package:yaru/widgets.dart';
|
|
||||||
|
|
||||||
import './../../models/github.dart';
|
|
||||||
import './../../models/dxvk.dart';
|
|
||||||
import './../../widgets/simple_button.dart';
|
|
||||||
import './../../widgets/gtk_spinner_widget.dart';
|
|
||||||
import './../../providers/providers.dart';
|
|
||||||
|
|
||||||
class DXVKSteps extends StatefulWidget {
|
|
||||||
const DXVKSteps({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<DXVKSteps> createState() => _DXVKStepsState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _DXVKStepsState extends State<DXVKSteps> {
|
|
||||||
final DXVK proton = DXVK();
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Padding(
|
|
||||||
padding: const EdgeInsets.all(20.0),
|
|
||||||
child: ChangeNotifierProvider(
|
|
||||||
create: (_) => proton,
|
|
||||||
child: Builder(
|
|
||||||
builder: (context) {
|
|
||||||
switch (Provider.of<DXVK>(context).dxvkState) {
|
|
||||||
case DXVKInstallationState.idle:
|
|
||||||
return const InstallDXVK();
|
|
||||||
case DXVKInstallationState.downloading:
|
|
||||||
return const DXVKDownloadProgress();
|
|
||||||
case DXVKInstallationState.decompressing:
|
|
||||||
return const Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Padding(
|
|
||||||
padding: EdgeInsets.all(8.0),
|
|
||||||
child: GtkSpinner(),
|
|
||||||
),
|
|
||||||
Text('Installing...'),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class InstallDXVK extends StatefulWidget {
|
|
||||||
const InstallDXVK({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<InstallDXVK> createState() => _InstallDXVKState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _InstallDXVKState extends State<InstallDXVK> {
|
|
||||||
bool hasLoaded = false;
|
|
||||||
bool isLoading = false;
|
|
||||||
late List<String> protonVersions;
|
|
||||||
String? selectedValue;
|
|
||||||
bool canInstall = true;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void didChangeDependencies() async {
|
|
||||||
if (!hasLoaded) {
|
|
||||||
isLoading = true;
|
|
||||||
protonVersions = await Github.getDXVKVersions();
|
|
||||||
setState(() {
|
|
||||||
isLoading = false;
|
|
||||||
hasLoaded = true;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
super.didChangeDependencies();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
if (hasLoaded && selectedValue == null) {
|
|
||||||
selectedValue = protonVersions.first;
|
|
||||||
}
|
|
||||||
|
|
||||||
return isLoading
|
|
||||||
? const Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Padding(
|
|
||||||
padding: EdgeInsets.all(8.0),
|
|
||||||
child: GtkSpinner(),
|
|
||||||
),
|
|
||||||
Text('Fetching versions...'),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
YaruPopupMenuButton(
|
|
||||||
enabled: canInstall,
|
|
||||||
initialValue: selectedValue,
|
|
||||||
itemBuilder: (_) => protonVersions
|
|
||||||
.map(
|
|
||||||
(e) => PopupMenuItem(
|
|
||||||
value: e,
|
|
||||||
child: Text(e),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
.toList(),
|
|
||||||
onSelected: (v) => setState(() {
|
|
||||||
selectedValue = v;
|
|
||||||
}),
|
|
||||||
child: Text(selectedValue!),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(left: 8.0),
|
|
||||||
child: SimpleButton(
|
|
||||||
onPressed: canInstall
|
|
||||||
? () {
|
|
||||||
Provider.of<DXVK>(context, listen: false)
|
|
||||||
.startInstallation(
|
|
||||||
Provider.of<GameStateProvider>(context,
|
|
||||||
listen: false),
|
|
||||||
selectedValue!);
|
|
||||||
setState(() {
|
|
||||||
canInstall = false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
: null,
|
|
||||||
child: const Text("Install"),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
if (!canInstall) const GtkSpinner(),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class DXVKDownloadProgress extends StatelessWidget {
|
|
||||||
const DXVKDownloadProgress({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
final provider = Provider.of<DXVK>(context);
|
|
||||||
final pourcent =
|
|
||||||
(provider.currentProgress.toInt() / provider.maxProgress.toInt()) * 100;
|
|
||||||
|
|
||||||
return Column(
|
|
||||||
children: [
|
|
||||||
Text("Downloaded: ${pourcent.toStringAsFixed(2)}%"),
|
|
||||||
YaruLinearProgressIndicator(
|
|
||||||
value: pourcent / 100,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,100 +0,0 @@
|
|||||||
import 'package:babylonia_terminal_launcher/widgets/gtk_spinner_widget.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
|
||||||
import 'package:yaru/yaru.dart';
|
|
||||||
|
|
||||||
import './../../models/fonts.dart';
|
|
||||||
import './../../providers/providers.dart';
|
|
||||||
import './../../widgets/simple_button.dart';
|
|
||||||
|
|
||||||
class FontsSteps extends StatelessWidget {
|
|
||||||
const FontsSteps({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Padding(
|
|
||||||
padding: const EdgeInsets.all(20.0),
|
|
||||||
child: ChangeNotifierProvider(
|
|
||||||
create: (context) => Fonts(),
|
|
||||||
child: Builder(
|
|
||||||
builder: (context) {
|
|
||||||
switch (Provider.of<Fonts>(context).fontsState) {
|
|
||||||
case FontsInstallationState.idle:
|
|
||||||
return const InstallFonts();
|
|
||||||
case FontsInstallationState.installing:
|
|
||||||
return const FontsInstallationProgress();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class InstallFonts extends StatefulWidget {
|
|
||||||
const InstallFonts({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<InstallFonts> createState() => _InstallFontsState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _InstallFontsState extends State<InstallFonts> {
|
|
||||||
bool canInstall = true;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Padding(
|
|
||||||
padding: const EdgeInsets.only(left: 8.0),
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
SimpleButton(
|
|
||||||
onPressed: canInstall
|
|
||||||
? () {
|
|
||||||
Provider.of<Fonts>(context, listen: false)
|
|
||||||
.startInstallation(
|
|
||||||
Provider.of<GameStateProvider>(context, listen: false),
|
|
||||||
);
|
|
||||||
setState(() {
|
|
||||||
canInstall = false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
: null,
|
|
||||||
child: const Text("Install"),
|
|
||||||
),
|
|
||||||
if (!canInstall) const GtkSpinner(),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class FontsInstallationProgress extends StatelessWidget {
|
|
||||||
const FontsInstallationProgress({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
final provider = Provider.of<Fonts>(context);
|
|
||||||
final pourcent =
|
|
||||||
(provider.currentProgress.toInt() / provider.maxProgress.toInt()) * 100;
|
|
||||||
|
|
||||||
return Column(
|
|
||||||
children: [
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.all(8.0),
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
const GtkSpinner(),
|
|
||||||
Text(
|
|
||||||
"${provider.currentProgress} / ${provider.maxProgress} fonts installed"),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
YaruLinearProgressIndicator(
|
|
||||||
value: pourcent / 100,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,154 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
|
||||||
import 'package:yaru/yaru.dart';
|
|
||||||
|
|
||||||
import './../../models/game.dart';
|
|
||||||
import './../simple_button.dart';
|
|
||||||
import './../gtk_spinner_widget.dart';
|
|
||||||
import './../../providers/providers.dart';
|
|
||||||
|
|
||||||
class GameSteps extends StatelessWidget {
|
|
||||||
const GameSteps({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Padding(
|
|
||||||
padding: const EdgeInsets.all(50.0),
|
|
||||||
child: Builder(builder: (context) {
|
|
||||||
switch (Provider.of<Game>(context).gameInstallationState) {
|
|
||||||
case GameInstallationState.idle:
|
|
||||||
return const _InstallGame();
|
|
||||||
case GameInstallationState.checkingFile:
|
|
||||||
return const _CheckingFileGame();
|
|
||||||
case GameInstallationState.downloading:
|
|
||||||
return const _DownloadingGame();
|
|
||||||
case GameInstallationState.patching:
|
|
||||||
return const _PatchingGame();
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class _InstallGame extends StatelessWidget {
|
|
||||||
const _InstallGame({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
final gameStateProvider = Provider.of<GameStateProvider>(context);
|
|
||||||
|
|
||||||
return Row(
|
|
||||||
children: [
|
|
||||||
const Expanded(
|
|
||||||
child: SizedBox(),
|
|
||||||
),
|
|
||||||
const Expanded(
|
|
||||||
child: SizedBox(),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: Column(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
|
||||||
children: [
|
|
||||||
ConstrainedBox(
|
|
||||||
constraints: const BoxConstraints(
|
|
||||||
maxWidth: 600,
|
|
||||||
maxHeight: 50,
|
|
||||||
),
|
|
||||||
child: SimpleButton(
|
|
||||||
onPressed: () async {
|
|
||||||
Provider.of<Game>(context, listen: false).startInstallation(
|
|
||||||
Provider.of<GameStateProvider>(context, listen: false),
|
|
||||||
gameStateProvider.isGameUpdating(),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
child: gameStateProvider.isGameUpdating()
|
|
||||||
? const Center(
|
|
||||||
child: Text("Update"),
|
|
||||||
)
|
|
||||||
: const Center(
|
|
||||||
child: Text("Download"),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class _CheckingFileGame extends StatelessWidget {
|
|
||||||
const _CheckingFileGame({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return const Padding(
|
|
||||||
padding: EdgeInsets.only(bottom: 40.0),
|
|
||||||
child: Align(
|
|
||||||
alignment: Alignment.bottomCenter,
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
GtkSpinner(),
|
|
||||||
Text("Checking files... (This can take a while)"),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class _DownloadingGame extends StatelessWidget {
|
|
||||||
const _DownloadingGame({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
final provider = Provider.of<Game>(context);
|
|
||||||
final pourcent =
|
|
||||||
(provider.currentProgress.toInt() / provider.maxProgress.toInt()) * 100;
|
|
||||||
//1024^3 = 1073741824
|
|
||||||
final currentGb = provider.currentProgress.toInt() / 1073741824;
|
|
||||||
final maxGb = provider.maxProgress.toInt() / 1073741824;
|
|
||||||
final currentSpeed = provider.currentSpeed.toInt() / 1048576;
|
|
||||||
|
|
||||||
return Padding(
|
|
||||||
padding: const EdgeInsets.only(bottom: 40.0),
|
|
||||||
child: Column(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
|
||||||
children: [
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(bottom: 8.0),
|
|
||||||
child: Text(
|
|
||||||
"${currentGb.toStringAsFixed(2)} / ${maxGb.toStringAsFixed(2)} GiB (${pourcent.toStringAsFixed(2)}%) - ${currentSpeed.toStringAsFixed(2)} MiB/s",
|
|
||||||
),
|
|
||||||
),
|
|
||||||
YaruLinearProgressIndicator(
|
|
||||||
value: pourcent / 100,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class _PatchingGame extends StatelessWidget {
|
|
||||||
const _PatchingGame({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return const Padding(
|
|
||||||
padding: EdgeInsets.only(bottom: 40.0),
|
|
||||||
child: Align(
|
|
||||||
alignment: Alignment.bottomCenter,
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
GtkSpinner(),
|
|
||||||
Text("Patching game"),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,157 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
|
||||||
import 'package:yaru/widgets.dart';
|
|
||||||
|
|
||||||
import './../../models/github.dart';
|
|
||||||
import './../../models/proton.dart';
|
|
||||||
import './../../widgets/simple_button.dart';
|
|
||||||
import './../../widgets/gtk_spinner_widget.dart';
|
|
||||||
import './../../providers/providers.dart';
|
|
||||||
|
|
||||||
class ProtonSteps extends StatefulWidget {
|
|
||||||
const ProtonSteps({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<ProtonSteps> createState() => _ProtonStepsState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _ProtonStepsState extends State<ProtonSteps> {
|
|
||||||
final Proton proton = Proton();
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Padding(
|
|
||||||
padding: const EdgeInsets.all(20.0),
|
|
||||||
child: ChangeNotifierProvider(
|
|
||||||
create: (_) => proton,
|
|
||||||
child: Builder(
|
|
||||||
builder: (context) {
|
|
||||||
switch (Provider.of<Proton>(context).protonState) {
|
|
||||||
case ProtonInstallationState.idle:
|
|
||||||
return const InstallProton();
|
|
||||||
case ProtonInstallationState.downloading:
|
|
||||||
return const ProtonDownloadProgress();
|
|
||||||
case ProtonInstallationState.decompressing:
|
|
||||||
return const Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Padding(
|
|
||||||
padding: EdgeInsets.all(8.0),
|
|
||||||
child: GtkSpinner(),
|
|
||||||
),
|
|
||||||
Text('decompressing...'),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class InstallProton extends StatefulWidget {
|
|
||||||
const InstallProton({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<InstallProton> createState() => _InstallProtonState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _InstallProtonState extends State<InstallProton> {
|
|
||||||
bool hasLoaded = false;
|
|
||||||
bool isLoading = false;
|
|
||||||
late List<String> protonVersions;
|
|
||||||
String? selectedValue;
|
|
||||||
bool canInstall = true;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void didChangeDependencies() async {
|
|
||||||
if (!hasLoaded) {
|
|
||||||
isLoading = true;
|
|
||||||
protonVersions = await Github.getProtonVersions();
|
|
||||||
setState(() {
|
|
||||||
isLoading = false;
|
|
||||||
hasLoaded = true;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
super.didChangeDependencies();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
if (hasLoaded && selectedValue == null) {
|
|
||||||
selectedValue = protonVersions.first;
|
|
||||||
}
|
|
||||||
|
|
||||||
return isLoading
|
|
||||||
? const Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Padding(
|
|
||||||
padding: EdgeInsets.all(8.0),
|
|
||||||
child: GtkSpinner(),
|
|
||||||
),
|
|
||||||
Text('Fetching versions...'),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
YaruPopupMenuButton(
|
|
||||||
initialValue: selectedValue,
|
|
||||||
itemBuilder: (_) => protonVersions
|
|
||||||
.map(
|
|
||||||
(e) => PopupMenuItem(
|
|
||||||
value: e,
|
|
||||||
child: Text(e),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
.toList(),
|
|
||||||
onSelected: (v) => setState(() {
|
|
||||||
selectedValue = v;
|
|
||||||
}),
|
|
||||||
child: Text(selectedValue!),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(left: 8.0),
|
|
||||||
child: SimpleButton(
|
|
||||||
onPressed: canInstall
|
|
||||||
? () {
|
|
||||||
Provider.of<Proton>(context, listen: false)
|
|
||||||
.startInstallation(
|
|
||||||
Provider.of<GameStateProvider>(context,
|
|
||||||
listen: false),
|
|
||||||
selectedValue!);
|
|
||||||
setState(() {
|
|
||||||
canInstall = false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
: null,
|
|
||||||
child: const Text("Install"),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class ProtonDownloadProgress extends StatelessWidget {
|
|
||||||
const ProtonDownloadProgress({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
final provider = Provider.of<Proton>(context);
|
|
||||||
final pourcent =
|
|
||||||
(provider.currentProgress.toInt() / provider.maxProgress.toInt()) * 100;
|
|
||||||
|
|
||||||
return Column(
|
|
||||||
children: [
|
|
||||||
Text("Downloaded: ${pourcent.toStringAsFixed(2)}%"),
|
|
||||||
YaruLinearProgressIndicator(
|
|
||||||
value: pourcent / 100,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,124 +0,0 @@
|
|||||||
#include "my_application.h"
|
|
||||||
|
|
||||||
#include <flutter_linux/flutter_linux.h>
|
|
||||||
#ifdef GDK_WINDOWING_X11
|
|
||||||
#include <gdk/gdkx.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "flutter/generated_plugin_registrant.h"
|
|
||||||
|
|
||||||
struct _MyApplication {
|
|
||||||
GtkApplication parent_instance;
|
|
||||||
char** dart_entrypoint_arguments;
|
|
||||||
};
|
|
||||||
|
|
||||||
G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION)
|
|
||||||
|
|
||||||
// Implements GApplication::activate.
|
|
||||||
static void my_application_activate(GApplication* application) {
|
|
||||||
MyApplication* self = MY_APPLICATION(application);
|
|
||||||
GtkWindow* window =
|
|
||||||
GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application)));
|
|
||||||
|
|
||||||
// Use a header bar when running in GNOME as this is the common style used
|
|
||||||
// by applications and is the setup most users will be using (e.g. Ubuntu
|
|
||||||
// desktop).
|
|
||||||
// If running on X and not using GNOME then just use a traditional title bar
|
|
||||||
// in case the window manager does more exotic layout, e.g. tiling.
|
|
||||||
// If running on Wayland assume the header bar will work (may need changing
|
|
||||||
// if future cases occur).
|
|
||||||
gboolean use_header_bar = FALSE;
|
|
||||||
#ifdef GDK_WINDOWING_X11
|
|
||||||
GdkScreen* screen = gtk_window_get_screen(window);
|
|
||||||
if (GDK_IS_X11_SCREEN(screen)) {
|
|
||||||
const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen);
|
|
||||||
if (g_strcmp0(wm_name, "GNOME Shell") != 0) {
|
|
||||||
use_header_bar = FALSE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if (use_header_bar) {
|
|
||||||
GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new());
|
|
||||||
gtk_widget_show(GTK_WIDGET(header_bar));
|
|
||||||
gtk_header_bar_set_title(header_bar, "babylonia_terminal_launcher");
|
|
||||||
gtk_header_bar_set_show_close_button(header_bar, TRUE);
|
|
||||||
gtk_window_set_titlebar(window, GTK_WIDGET(header_bar));
|
|
||||||
} else {
|
|
||||||
gtk_window_set_title(window, "babylonia_terminal_launcher");
|
|
||||||
}
|
|
||||||
|
|
||||||
gtk_window_set_default_size(window, 1280, 720);
|
|
||||||
gtk_widget_show(GTK_WIDGET(window));
|
|
||||||
|
|
||||||
g_autoptr(FlDartProject) project = fl_dart_project_new();
|
|
||||||
fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments);
|
|
||||||
|
|
||||||
FlView* view = fl_view_new(project);
|
|
||||||
gtk_widget_show(GTK_WIDGET(view));
|
|
||||||
gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view));
|
|
||||||
|
|
||||||
fl_register_plugins(FL_PLUGIN_REGISTRY(view));
|
|
||||||
|
|
||||||
gtk_widget_grab_focus(GTK_WIDGET(view));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Implements GApplication::local_command_line.
|
|
||||||
static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) {
|
|
||||||
MyApplication* self = MY_APPLICATION(application);
|
|
||||||
// Strip out the first argument as it is the binary name.
|
|
||||||
self->dart_entrypoint_arguments = g_strdupv(*arguments + 1);
|
|
||||||
|
|
||||||
g_autoptr(GError) error = nullptr;
|
|
||||||
if (!g_application_register(application, nullptr, &error)) {
|
|
||||||
g_warning("Failed to register: %s", error->message);
|
|
||||||
*exit_status = 1;
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_application_activate(application);
|
|
||||||
*exit_status = 0;
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Implements GApplication::startup.
|
|
||||||
static void my_application_startup(GApplication* application) {
|
|
||||||
//MyApplication* self = MY_APPLICATION(object);
|
|
||||||
|
|
||||||
// Perform any actions required at application startup.
|
|
||||||
|
|
||||||
G_APPLICATION_CLASS(my_application_parent_class)->startup(application);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Implements GApplication::shutdown.
|
|
||||||
static void my_application_shutdown(GApplication* application) {
|
|
||||||
//MyApplication* self = MY_APPLICATION(object);
|
|
||||||
|
|
||||||
// Perform any actions required at application shutdown.
|
|
||||||
|
|
||||||
G_APPLICATION_CLASS(my_application_parent_class)->shutdown(application);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Implements GObject::dispose.
|
|
||||||
static void my_application_dispose(GObject* object) {
|
|
||||||
MyApplication* self = MY_APPLICATION(object);
|
|
||||||
g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev);
|
|
||||||
G_OBJECT_CLASS(my_application_parent_class)->dispose(object);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void my_application_class_init(MyApplicationClass* klass) {
|
|
||||||
G_APPLICATION_CLASS(klass)->activate = my_application_activate;
|
|
||||||
G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line;
|
|
||||||
G_APPLICATION_CLASS(klass)->startup = my_application_startup;
|
|
||||||
G_APPLICATION_CLASS(klass)->shutdown = my_application_shutdown;
|
|
||||||
G_OBJECT_CLASS(klass)->dispose = my_application_dispose;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void my_application_init(MyApplication* self) {}
|
|
||||||
|
|
||||||
MyApplication* my_application_new() {
|
|
||||||
return MY_APPLICATION(g_object_new(my_application_get_type(),
|
|
||||||
"application-id", APPLICATION_ID,
|
|
||||||
"flags", G_APPLICATION_NON_UNIQUE,
|
|
||||||
nullptr));
|
|
||||||
}
|
|
||||||
@ -1,23 +0,0 @@
|
|||||||
syntax = "proto3";
|
|
||||||
package config;
|
|
||||||
|
|
||||||
// [RINF:DART-SIGNAL]
|
|
||||||
message ConfigInput {}
|
|
||||||
|
|
||||||
// [RINF:RUST-SIGNAL]
|
|
||||||
message ConfigOutput {
|
|
||||||
string configPath = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// [RINF:DART-SIGNAL]
|
|
||||||
message GetLaunchOptionsInput {}
|
|
||||||
|
|
||||||
// [RINF:RUST-SIGNAL]
|
|
||||||
message GetLaunchOptionsOutput {
|
|
||||||
optional string launchOptions = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// [RINF:DART-SIGNAL]
|
|
||||||
message SetLaunchOptionsInput {
|
|
||||||
optional string launchOptions = 1;
|
|
||||||
}
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
syntax = "proto3";
|
|
||||||
package error;
|
|
||||||
|
|
||||||
// [RINF:RUST-SIGNAL]
|
|
||||||
message ReportError {
|
|
||||||
string errorMessage = 1;
|
|
||||||
}
|
|
||||||
@ -1,21 +0,0 @@
|
|||||||
syntax = "proto3";
|
|
||||||
package game_state;
|
|
||||||
|
|
||||||
enum States {
|
|
||||||
ProtonNotInstalled = 0;
|
|
||||||
DXVKNotInstalled = 1;
|
|
||||||
FontNotInstalled = 2;
|
|
||||||
DependecieNotInstalled = 3;
|
|
||||||
GameNotInstalled = 4;
|
|
||||||
GameNeedUpdate = 5;
|
|
||||||
GameNotPatched = 6;
|
|
||||||
GameInstalled = 7;
|
|
||||||
}
|
|
||||||
|
|
||||||
// [RINF:RUST-SIGNAL]
|
|
||||||
message GameState {
|
|
||||||
States state = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// [RINF:DART-SIGNAL]
|
|
||||||
message AskGameState {}
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
syntax = "proto3";
|
|
||||||
package github;
|
|
||||||
|
|
||||||
// [RINF:DART-SIGNAL]
|
|
||||||
message AskProtonVersions {}
|
|
||||||
|
|
||||||
// [RINF:RUST-SIGNAL]
|
|
||||||
message ProtonVersions {
|
|
||||||
repeated string versions = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// [RINF:DART-SIGNAL]
|
|
||||||
message AskDXVKVersions {}
|
|
||||||
|
|
||||||
// [RINF:RUST-SIGNAL]
|
|
||||||
message DXVKVersions {
|
|
||||||
repeated string versions = 1;
|
|
||||||
}
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
syntax = "proto3";
|
|
||||||
package dependencies;
|
|
||||||
|
|
||||||
// [RINF:DART-SIGNAL]
|
|
||||||
message StartDependenciesInstallation {}
|
|
||||||
|
|
||||||
// [RINF:RUST-SIGNAL]
|
|
||||||
message NotifyDependenciesSuccessfullyInstalled {}
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
syntax = "proto3";
|
|
||||||
package dxvk;
|
|
||||||
|
|
||||||
// [RINF:RUST-SIGNAL]
|
|
||||||
message DXVKDownloadProgress {
|
|
||||||
uint64 current = 1;
|
|
||||||
uint64 max = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
// [RINF:DART-SIGNAL]
|
|
||||||
message StartDXVKInstallation {
|
|
||||||
string protonVersion = 1;
|
|
||||||
};
|
|
||||||
|
|
||||||
// [RINF:RUST-SIGNAL]
|
|
||||||
message NotifyDXVKStartDecompressing {}
|
|
||||||
|
|
||||||
// [RINF:RUST-SIGNAL]
|
|
||||||
message NotifyDXVKSuccessfullyInstalled {}
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
syntax = "proto3";
|
|
||||||
package fonts;
|
|
||||||
|
|
||||||
// [RINF:RUST-SIGNAL]
|
|
||||||
message FontsInstallationProgress {
|
|
||||||
uint64 current = 1;
|
|
||||||
uint64 max = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
// [RINF:DART-SIGNAL]
|
|
||||||
message StartFontsInstallation {};
|
|
||||||
|
|
||||||
// [RINF:RUST-SIGNAL]
|
|
||||||
message NotifyFontsSuccessfullyInstalled {}
|
|
||||||
@ -1,28 +0,0 @@
|
|||||||
syntax = "proto3";
|
|
||||||
package game;
|
|
||||||
|
|
||||||
// [RINF:RUST-SIGNAL]
|
|
||||||
message GameInstallationProgress {
|
|
||||||
uint64 current = 1;
|
|
||||||
uint64 max = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
// [RINF:DART-SIGNAL]
|
|
||||||
message StartGameInstallation {
|
|
||||||
bool isUpdating = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// [RINF:RUST-SIGNAL]
|
|
||||||
message NotifyGameStartDownloading {}
|
|
||||||
|
|
||||||
// [RINF:RUST-SIGNAL]
|
|
||||||
message NotifyGameStartPatching {}
|
|
||||||
|
|
||||||
// [RINF:RUST-SIGNAL]
|
|
||||||
message NotifyGameSuccessfullyInstalled {}
|
|
||||||
|
|
||||||
// [RINF:DART-SIGNAL]
|
|
||||||
message RunGame {}
|
|
||||||
|
|
||||||
// [RINF:RUST-SIGNAL]
|
|
||||||
message GameStopped {}
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
syntax = "proto3";
|
|
||||||
package proton;
|
|
||||||
|
|
||||||
// [RINF:RUST-SIGNAL]
|
|
||||||
message ProtonDownloadProgress {
|
|
||||||
uint64 current = 1;
|
|
||||||
uint64 max = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
// [RINF:DART-SIGNAL]
|
|
||||||
message StartProtonInstallation {
|
|
||||||
string protonVersion = 1;
|
|
||||||
};
|
|
||||||
|
|
||||||
// [RINF:RUST-SIGNAL]
|
|
||||||
message NotifyProtonStartDecompressing {}
|
|
||||||
|
|
||||||
// [RINF:RUST-SIGNAL]
|
|
||||||
message NotifyProtonSuccessfullyInstalled {}
|
|
||||||
@ -1,28 +0,0 @@
|
|||||||
[package]
|
|
||||||
# Do not change the name of this crate.
|
|
||||||
name = "hub"
|
|
||||||
version = "0.1.0"
|
|
||||||
edition = "2021"
|
|
||||||
|
|
||||||
[lib]
|
|
||||||
# `lib` is required for non-library targets,
|
|
||||||
# such as tests and benchmarks.
|
|
||||||
# `cdylib` is for Linux, Android, Windows, and web.
|
|
||||||
# `staticlib` is for iOS and macOS.
|
|
||||||
crate-type = ["lib", "cdylib", "staticlib"]
|
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
rinf = "6.9.0"
|
|
||||||
prost = "0.12.3"
|
|
||||||
wasm-bindgen = "0.2.91"
|
|
||||||
tokio_with_wasm = "0.4.3"
|
|
||||||
babylonia-terminal-sdk = { path = "./../../../babylonia-terminal-sdk" }
|
|
||||||
downloader = { git = "https://github.com/ALEZ-DEV/downloader" } # version = "0.2.7",
|
|
||||||
once_cell = "1.19.0"
|
|
||||||
wincompatlib = { version = "0.7.4", features = [
|
|
||||||
"dxvk",
|
|
||||||
"wine-bundles",
|
|
||||||
"wine-proton",
|
|
||||||
"wine-fonts",
|
|
||||||
"winetricks",
|
|
||||||
] }
|
|
||||||
@ -1,52 +0,0 @@
|
|||||||
use babylonia_terminal_sdk::game_config::GameConfig;
|
|
||||||
|
|
||||||
use crate::messages::{
|
|
||||||
config::{
|
|
||||||
ConfigInput, ConfigOutput, GetLaunchOptionsInput, GetLaunchOptionsOutput,
|
|
||||||
SetLaunchOptionsInput,
|
|
||||||
},
|
|
||||||
error::ReportError,
|
|
||||||
};
|
|
||||||
|
|
||||||
pub async fn listen_config() {
|
|
||||||
let mut receiver = ConfigInput::get_dart_signal_receiver().unwrap();
|
|
||||||
while let Some(_) = receiver.recv().await {
|
|
||||||
let config = GameConfig::get_config().await;
|
|
||||||
ConfigOutput {
|
|
||||||
config_path: config.config_dir.to_str().unwrap().to_string(),
|
|
||||||
}
|
|
||||||
.send_signal_to_dart();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub async fn listen_get_launch_options() {
|
|
||||||
let mut receiver = GetLaunchOptionsInput::get_dart_signal_receiver().unwrap();
|
|
||||||
while let Some(_) = receiver.recv().await {
|
|
||||||
let launch_options_result = GameConfig::get_launch_options().await;
|
|
||||||
if let Err(err) = launch_options_result {
|
|
||||||
ReportError {
|
|
||||||
error_message: format!("Failed to get launch options :\n{:?}", err),
|
|
||||||
}
|
|
||||||
.send_signal_to_dart();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
GetLaunchOptionsOutput {
|
|
||||||
launch_options: launch_options_result.unwrap(),
|
|
||||||
}
|
|
||||||
.send_signal_to_dart();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub async fn listen_set_launch_options() {
|
|
||||||
let mut receiver = SetLaunchOptionsInput::get_dart_signal_receiver().unwrap();
|
|
||||||
while let Some(dart_signal) = receiver.recv().await {
|
|
||||||
let result = GameConfig::set_launch_options(dart_signal.message.launch_options).await;
|
|
||||||
if let Err(err) = result {
|
|
||||||
ReportError {
|
|
||||||
error_message: format!("Failed to set launch options :\n{:?}", err),
|
|
||||||
}
|
|
||||||
.send_signal_to_dart();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,37 +0,0 @@
|
|||||||
use std::thread;
|
|
||||||
|
|
||||||
use babylonia_terminal_sdk::game_manager::GameManager;
|
|
||||||
use tokio_with_wasm::tokio;
|
|
||||||
|
|
||||||
use crate::{
|
|
||||||
messages::{
|
|
||||||
error::ReportError,
|
|
||||||
steps::dependencies::{
|
|
||||||
NotifyDependenciesSuccessfullyInstalled, StartDependenciesInstallation,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
proton::get_proton,
|
|
||||||
};
|
|
||||||
|
|
||||||
pub async fn listen_dependecies_installation() {
|
|
||||||
let mut receiver = StartDependenciesInstallation::get_dart_signal_receiver().unwrap();
|
|
||||||
while let Some(_) = receiver.recv().await {
|
|
||||||
let proton = get_proton().await;
|
|
||||||
|
|
||||||
thread::spawn(move || {
|
|
||||||
tokio::runtime::Builder::new_current_thread()
|
|
||||||
.enable_all()
|
|
||||||
.build()
|
|
||||||
.unwrap()
|
|
||||||
.block_on(async {
|
|
||||||
match GameManager::install_dependencies(&proton).await {
|
|
||||||
Err(e) => ReportError {
|
|
||||||
error_message: format!("Failed to install dependencies : {}", e),
|
|
||||||
}
|
|
||||||
.send_signal_to_dart(),
|
|
||||||
Ok(_) => NotifyDependenciesSuccessfullyInstalled {}.send_signal_to_dart(),
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,117 +0,0 @@
|
|||||||
use std::thread;
|
|
||||||
|
|
||||||
use babylonia_terminal_sdk::{
|
|
||||||
components::dxvk_component::{DXVK_DEV, DXVK_REPO},
|
|
||||||
game_config::GameConfig,
|
|
||||||
game_manager::GameManager,
|
|
||||||
utils::github_requester::{GithubRelease, GithubRequester},
|
|
||||||
};
|
|
||||||
use tokio_with_wasm::tokio;
|
|
||||||
|
|
||||||
use crate::{
|
|
||||||
github::GithubInfo,
|
|
||||||
messages::{
|
|
||||||
error::ReportError,
|
|
||||||
steps::dxvk::{
|
|
||||||
DxvkDownloadProgress, NotifyDxvkStartDecompressing, NotifyDxvkSuccessfullyInstalled,
|
|
||||||
StartDxvkInstallation,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
proton::get_proton,
|
|
||||||
};
|
|
||||||
|
|
||||||
pub async fn listen_dxvk_installation() {
|
|
||||||
let mut receiver = StartDxvkInstallation::get_dart_signal_receiver().unwrap();
|
|
||||||
while let Some(info) = receiver.recv().await {
|
|
||||||
let releases: Result<Vec<GithubRelease>, _> =
|
|
||||||
GithubInfo::get_github_releases(DXVK_DEV, DXVK_REPO).await;
|
|
||||||
if releases.is_err() {
|
|
||||||
ReportError {
|
|
||||||
error_message: format!("When fetching DXVK versions : {}", releases.unwrap_err()),
|
|
||||||
}
|
|
||||||
.send_signal_to_dart();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
let checked_releases = releases.unwrap();
|
|
||||||
let release_index = checked_releases
|
|
||||||
.iter()
|
|
||||||
.position(|v| v.tag_name == info.message.proton_version);
|
|
||||||
|
|
||||||
if release_index.is_none() {
|
|
||||||
ReportError {
|
|
||||||
error_message: "Failed to find DXVK version".to_string(),
|
|
||||||
}
|
|
||||||
.send_signal_to_dart();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
let proton = get_proton().await;
|
|
||||||
|
|
||||||
thread::spawn(move || {
|
|
||||||
tokio::runtime::Builder::new_current_thread()
|
|
||||||
.enable_all()
|
|
||||||
.build()
|
|
||||||
.unwrap()
|
|
||||||
.block_on(async {
|
|
||||||
match GameManager::install_dxvk(
|
|
||||||
&proton,
|
|
||||||
GameConfig::get_config().await.config_dir,
|
|
||||||
release_index.unwrap(),
|
|
||||||
Some(DownloadReporter::create()),
|
|
||||||
)
|
|
||||||
.await
|
|
||||||
{
|
|
||||||
Err(e) => ReportError {
|
|
||||||
error_message: format!("Failed to install DXVK : {}", e),
|
|
||||||
}
|
|
||||||
.send_signal_to_dart(),
|
|
||||||
Ok(_) => NotifyDxvkSuccessfullyInstalled {}.send_signal_to_dart(),
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
struct DownloadReporterPrivate {
|
|
||||||
max_progress: Option<u64>,
|
|
||||||
}
|
|
||||||
|
|
||||||
struct DownloadReporter {
|
|
||||||
private: std::sync::Mutex<Option<DownloadReporterPrivate>>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl DownloadReporter {
|
|
||||||
pub fn create() -> std::sync::Arc<Self> {
|
|
||||||
std::sync::Arc::new(Self {
|
|
||||||
private: std::sync::Mutex::new(None),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl downloader::progress::Reporter for DownloadReporter {
|
|
||||||
fn setup(&self, max_progress: Option<u64>, _: &str) {
|
|
||||||
let private = DownloadReporterPrivate { max_progress };
|
|
||||||
|
|
||||||
let mut guard = self.private.lock().unwrap();
|
|
||||||
*guard = Some(private);
|
|
||||||
}
|
|
||||||
|
|
||||||
fn progress(&self, current: u64) {
|
|
||||||
if let Some(p) = self.private.lock().unwrap().as_mut() {
|
|
||||||
DxvkDownloadProgress {
|
|
||||||
current,
|
|
||||||
max: p.max_progress.unwrap(),
|
|
||||||
}
|
|
||||||
.send_signal_to_dart();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn set_message(&self, _: &str) {}
|
|
||||||
|
|
||||||
fn done(&self) {
|
|
||||||
NotifyDxvkStartDecompressing {}.send_signal_to_dart();
|
|
||||||
let mut guard = self.private.lock().unwrap();
|
|
||||||
*guard = None;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,81 +0,0 @@
|
|||||||
use std::thread;
|
|
||||||
|
|
||||||
use babylonia_terminal_sdk::game_manager::GameManager;
|
|
||||||
use tokio_with_wasm::tokio;
|
|
||||||
|
|
||||||
use crate::{
|
|
||||||
messages::{
|
|
||||||
error::ReportError,
|
|
||||||
steps::fonts::{
|
|
||||||
FontsInstallationProgress, NotifyFontsSuccessfullyInstalled, StartFontsInstallation,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
proton::get_proton,
|
|
||||||
};
|
|
||||||
|
|
||||||
pub async fn listen_fonts_installation() {
|
|
||||||
let mut receiver = StartFontsInstallation::get_dart_signal_receiver().unwrap();
|
|
||||||
while let Some(_) = receiver.recv().await {
|
|
||||||
let proton = get_proton().await;
|
|
||||||
|
|
||||||
thread::spawn(move || {
|
|
||||||
tokio::runtime::Builder::new_current_thread()
|
|
||||||
.enable_all()
|
|
||||||
.build()
|
|
||||||
.unwrap()
|
|
||||||
.block_on(async {
|
|
||||||
match GameManager::install_font(&proton, Some(InstallationReporter::create()))
|
|
||||||
.await
|
|
||||||
{
|
|
||||||
Err(e) => ReportError {
|
|
||||||
error_message: format!("Failed to install fonts : {}", e),
|
|
||||||
}
|
|
||||||
.send_signal_to_dart(),
|
|
||||||
Ok(_) => NotifyFontsSuccessfullyInstalled {}.send_signal_to_dart(),
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
struct DownloadReporterPrivate {
|
|
||||||
max_progress: Option<u64>,
|
|
||||||
}
|
|
||||||
|
|
||||||
struct InstallationReporter {
|
|
||||||
private: std::sync::Mutex<Option<DownloadReporterPrivate>>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl InstallationReporter {
|
|
||||||
pub fn create() -> std::sync::Arc<Self> {
|
|
||||||
std::sync::Arc::new(Self {
|
|
||||||
private: std::sync::Mutex::new(None),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl downloader::progress::Reporter for InstallationReporter {
|
|
||||||
fn setup(&self, max_progress: Option<u64>, _: &str) {
|
|
||||||
let private = DownloadReporterPrivate { max_progress };
|
|
||||||
|
|
||||||
let mut guard = self.private.lock().unwrap();
|
|
||||||
*guard = Some(private);
|
|
||||||
}
|
|
||||||
|
|
||||||
fn progress(&self, current: u64) {
|
|
||||||
if let Some(p) = self.private.lock().unwrap().as_mut() {
|
|
||||||
FontsInstallationProgress {
|
|
||||||
current,
|
|
||||||
max: p.max_progress.unwrap(),
|
|
||||||
}
|
|
||||||
.send_signal_to_dart();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn set_message(&self, _: &str) {}
|
|
||||||
|
|
||||||
fn done(&self) {
|
|
||||||
let mut guard = self.private.lock().unwrap();
|
|
||||||
*guard = None;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,160 +0,0 @@
|
|||||||
use std::thread;
|
|
||||||
|
|
||||||
use babylonia_terminal_sdk::{game_config::GameConfig, game_manager::GameManager};
|
|
||||||
use rinf::debug_print;
|
|
||||||
use tokio_with_wasm::tokio;
|
|
||||||
|
|
||||||
use crate::{
|
|
||||||
messages::{
|
|
||||||
error::ReportError,
|
|
||||||
steps::game::{
|
|
||||||
GameInstallationProgress, GameStopped, NotifyGameStartPatching,
|
|
||||||
NotifyGameSuccessfullyInstalled, RunGame, StartGameInstallation,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
proton::get_proton,
|
|
||||||
};
|
|
||||||
|
|
||||||
pub async fn listen_game_running() {
|
|
||||||
let mut receiver = RunGame::get_dart_signal_receiver().unwrap();
|
|
||||||
thread::spawn(move || {
|
|
||||||
tokio::runtime::Builder::new_current_thread()
|
|
||||||
.enable_all()
|
|
||||||
.build()
|
|
||||||
.unwrap()
|
|
||||||
.block_on(async {
|
|
||||||
while let Some(_) = receiver.recv().await {
|
|
||||||
let proton = get_proton().await;
|
|
||||||
let game_dir = GameConfig::get_game_dir().await;
|
|
||||||
if game_dir.is_none() {
|
|
||||||
ReportError {
|
|
||||||
error_message: "Failed to start game, the game directory was not found"
|
|
||||||
.to_string(),
|
|
||||||
}
|
|
||||||
.send_signal_to_dart();
|
|
||||||
GameStopped {}.send_signal_to_dart();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
GameManager::start_game(&proton, game_dir.unwrap(), None, false).await;
|
|
||||||
|
|
||||||
GameStopped {}.send_signal_to_dart();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
pub async fn listen_game_installation() {
|
|
||||||
let mut receiver = StartGameInstallation::get_dart_signal_receiver().unwrap();
|
|
||||||
while let Some(info) = receiver.recv().await {
|
|
||||||
thread::spawn(move || {
|
|
||||||
debug_print!("start downloading game...");
|
|
||||||
tokio::runtime::Builder::new_current_thread()
|
|
||||||
.enable_all()
|
|
||||||
.build()
|
|
||||||
.unwrap()
|
|
||||||
.block_on(async {
|
|
||||||
if GameConfig::get_game_dir().await.is_none() {
|
|
||||||
if let Err(e) =
|
|
||||||
GameConfig::set_game_dir(Some(GameConfig::get_config_directory().await))
|
|
||||||
.await
|
|
||||||
{
|
|
||||||
ReportError {
|
|
||||||
error_message: format!("Failed to set new path : {}", e),
|
|
||||||
}
|
|
||||||
.send_signal_to_dart();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if info.message.is_updating {
|
|
||||||
if let Err(e) = GameManager::update_game().await {
|
|
||||||
ReportError {
|
|
||||||
error_message: format!("Failed to start updating the game : {}", e),
|
|
||||||
}
|
|
||||||
.send_signal_to_dart();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let game_dir = GameConfig::get_game_dir().await;
|
|
||||||
if game_dir.is_none() {
|
|
||||||
ReportError {
|
|
||||||
error_message: "Failed to get the game directory".to_string(),
|
|
||||||
}
|
|
||||||
.send_signal_to_dart();
|
|
||||||
}
|
|
||||||
|
|
||||||
match GameManager::install_game(
|
|
||||||
game_dir.clone().unwrap(),
|
|
||||||
InstallationReporter::create(),
|
|
||||||
)
|
|
||||||
.await
|
|
||||||
{
|
|
||||||
Err(e) => ReportError {
|
|
||||||
error_message: format!("Failed to install game : {}", e),
|
|
||||||
}
|
|
||||||
.send_signal_to_dart(),
|
|
||||||
Ok(_) => {
|
|
||||||
NotifyGameStartPatching {}.send_signal_to_dart();
|
|
||||||
debug_print!("start patching game...");
|
|
||||||
match GameManager::patch_game(game_dir.unwrap()).await {
|
|
||||||
Err(e) => ReportError {
|
|
||||||
error_message: format!("Failed to install game : {}", e),
|
|
||||||
}
|
|
||||||
.send_signal_to_dart(),
|
|
||||||
Ok(_) => NotifyGameSuccessfullyInstalled {}.send_signal_to_dart(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
struct DownloadReporterPrivate {
|
|
||||||
max_progress: Option<u64>,
|
|
||||||
}
|
|
||||||
|
|
||||||
struct InstallationReporter {
|
|
||||||
private: std::sync::Mutex<Option<DownloadReporterPrivate>>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl InstallationReporter {
|
|
||||||
pub fn create() -> std::sync::Arc<Self> {
|
|
||||||
std::sync::Arc::new(Self {
|
|
||||||
private: std::sync::Mutex::new(None),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl downloader::progress::Reporter for InstallationReporter {
|
|
||||||
fn setup(&self, max_progress: Option<u64>, _: &str) {
|
|
||||||
let private = DownloadReporterPrivate { max_progress };
|
|
||||||
|
|
||||||
let mut guard = self.private.lock().unwrap();
|
|
||||||
*guard = Some(private);
|
|
||||||
}
|
|
||||||
|
|
||||||
fn progress(&self, current: u64) {
|
|
||||||
if let Some(p) = self.private.lock().unwrap().as_mut() {
|
|
||||||
GameInstallationProgress {
|
|
||||||
current,
|
|
||||||
max: p.max_progress.unwrap(),
|
|
||||||
}
|
|
||||||
.send_signal_to_dart();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn set_message(&self, _: &str) {}
|
|
||||||
|
|
||||||
fn done(&self) {
|
|
||||||
if let Some(p) = self.private.lock().unwrap().as_mut() {
|
|
||||||
GameInstallationProgress {
|
|
||||||
current: p.max_progress.unwrap(),
|
|
||||||
max: p.max_progress.unwrap(),
|
|
||||||
}
|
|
||||||
.send_signal_to_dart();
|
|
||||||
}
|
|
||||||
let mut guard = self.private.lock().unwrap();
|
|
||||||
*guard = None;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,38 +0,0 @@
|
|||||||
use babylonia_terminal_sdk::game_state::GameState;
|
|
||||||
|
|
||||||
use crate::messages::{
|
|
||||||
error::ReportError,
|
|
||||||
game_state::{AskGameState, GameState as GameStateMessage, States},
|
|
||||||
};
|
|
||||||
|
|
||||||
impl GameStateMessage {
|
|
||||||
fn from_sdk_state_to_msg_state(state: GameState) -> Self {
|
|
||||||
let game_state = match state {
|
|
||||||
GameState::ProtonNotInstalled => States::ProtonNotInstalled,
|
|
||||||
GameState::DXVKNotInstalled => States::DxvkNotInstalled,
|
|
||||||
GameState::FontNotInstalled => States::FontNotInstalled,
|
|
||||||
GameState::DependecieNotInstalled => States::DependecieNotInstalled,
|
|
||||||
GameState::GameNotInstalled => States::GameNotInstalled,
|
|
||||||
GameState::GameNeedUpdate => States::GameNeedUpdate,
|
|
||||||
GameState::GameNotPatched => States::GameNotPatched,
|
|
||||||
GameState::GameInstalled => States::GameInstalled,
|
|
||||||
};
|
|
||||||
GameStateMessage {
|
|
||||||
state: game_state.into(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub async fn listen_game_state() {
|
|
||||||
let mut receiver = AskGameState::get_dart_signal_receiver().unwrap();
|
|
||||||
while let Some(_) = receiver.recv().await {
|
|
||||||
let result_state = GameState::get_current_state().await;
|
|
||||||
match result_state {
|
|
||||||
Ok(state) => GameStateMessage::from_sdk_state_to_msg_state(state).send_signal_to_dart(),
|
|
||||||
Err(e) => ReportError {
|
|
||||||
error_message: format!("When updating the game state : {}", e),
|
|
||||||
}
|
|
||||||
.send_signal_to_dart(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,57 +0,0 @@
|
|||||||
use babylonia_terminal_sdk::{
|
|
||||||
components::{
|
|
||||||
dxvk_component::{DXVK_DEV, DXVK_REPO},
|
|
||||||
proton_component::{PROTON_DEV, PROTON_REPO},
|
|
||||||
},
|
|
||||||
utils::github_requester::{GithubRelease, GithubRequester},
|
|
||||||
};
|
|
||||||
|
|
||||||
use crate::messages::{
|
|
||||||
error::ReportError,
|
|
||||||
github::{AskDxvkVersions, AskProtonVersions, DxvkVersions, ProtonVersions},
|
|
||||||
};
|
|
||||||
|
|
||||||
#[warn(dead_code)]
|
|
||||||
pub struct GithubInfo;
|
|
||||||
|
|
||||||
impl GithubRequester for GithubInfo {
|
|
||||||
fn set_github_release_index(&mut self, _: usize) {
|
|
||||||
todo!()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub async fn listen_proton_version() {
|
|
||||||
let mut receiver = AskProtonVersions::get_dart_signal_receiver().unwrap();
|
|
||||||
while let Some(_) = receiver.recv().await {
|
|
||||||
let releases: Result<Vec<GithubRelease>, _> =
|
|
||||||
GithubInfo::get_github_releases(PROTON_DEV, PROTON_REPO).await;
|
|
||||||
match releases {
|
|
||||||
Ok(r) => ProtonVersions {
|
|
||||||
versions: r.iter().map(|v| v.tag_name.to_owned()).collect(),
|
|
||||||
}
|
|
||||||
.send_signal_to_dart(),
|
|
||||||
Err(e) => ReportError {
|
|
||||||
error_message: format!("When fetching proton versions : {}", e),
|
|
||||||
}
|
|
||||||
.send_signal_to_dart(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub async fn listen_dxvk_version() {
|
|
||||||
let mut receiver = AskDxvkVersions::get_dart_signal_receiver().unwrap();
|
|
||||||
while let Some(_) = receiver.recv().await {
|
|
||||||
let releases: Result<Vec<GithubRelease>, _> =
|
|
||||||
GithubInfo::get_github_releases(DXVK_DEV, DXVK_REPO).await;
|
|
||||||
match releases {
|
|
||||||
Ok(r) => DxvkVersions {
|
|
||||||
versions: r.iter().map(|v| v.tag_name.to_owned()).collect(),
|
|
||||||
}
|
|
||||||
.send_signal_to_dart(),
|
|
||||||
Err(e) => ReportError {
|
|
||||||
error_message: format!("When fetching dxvk versions : {}", e),
|
|
||||||
}
|
|
||||||
.send_signal_to_dart(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,35 +0,0 @@
|
|||||||
use tokio_with_wasm::tokio;
|
|
||||||
|
|
||||||
mod config;
|
|
||||||
mod dependencies;
|
|
||||||
mod dxvk;
|
|
||||||
mod fonts;
|
|
||||||
mod game;
|
|
||||||
mod game_state;
|
|
||||||
mod github;
|
|
||||||
mod messages;
|
|
||||||
mod proton;
|
|
||||||
|
|
||||||
rinf::write_interface!();
|
|
||||||
|
|
||||||
async fn main() {
|
|
||||||
//config
|
|
||||||
tokio::spawn(game_state::listen_game_state());
|
|
||||||
tokio::spawn(config::listen_config());
|
|
||||||
tokio::spawn(config::listen_get_launch_options());
|
|
||||||
tokio::spawn(config::listen_set_launch_options());
|
|
||||||
|
|
||||||
//github
|
|
||||||
tokio::spawn(github::listen_proton_version());
|
|
||||||
tokio::spawn(github::listen_dxvk_version());
|
|
||||||
|
|
||||||
//installation
|
|
||||||
tokio::spawn(proton::listen_proton_installation());
|
|
||||||
tokio::spawn(dxvk::listen_dxvk_installation());
|
|
||||||
tokio::spawn(fonts::listen_fonts_installation());
|
|
||||||
tokio::spawn(dependencies::listen_dependecies_installation());
|
|
||||||
tokio::spawn(game::listen_game_installation());
|
|
||||||
|
|
||||||
//game
|
|
||||||
tokio::spawn(game::listen_game_running());
|
|
||||||
}
|
|
||||||
@ -1,133 +0,0 @@
|
|||||||
use std::thread;
|
|
||||||
|
|
||||||
use babylonia_terminal_sdk::{
|
|
||||||
components::proton_component::{ProtonComponent, PROTON_DEV, PROTON_REPO},
|
|
||||||
game_config::GameConfig,
|
|
||||||
game_manager::GameManager,
|
|
||||||
utils::github_requester::{GithubRelease, GithubRequester},
|
|
||||||
};
|
|
||||||
use tokio_with_wasm::tokio::{self, sync::OnceCell};
|
|
||||||
use wincompatlib::wine::bundle::proton::Proton;
|
|
||||||
|
|
||||||
use crate::{
|
|
||||||
github::GithubInfo,
|
|
||||||
messages::{
|
|
||||||
error::ReportError,
|
|
||||||
steps::proton::{
|
|
||||||
NotifyProtonStartDecompressing, NotifyProtonSuccessfullyInstalled,
|
|
||||||
ProtonDownloadProgress, StartProtonInstallation,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
static PROTON: OnceCell<Proton> = OnceCell::const_new();
|
|
||||||
|
|
||||||
pub async fn get_proton() -> Proton {
|
|
||||||
PROTON
|
|
||||||
.get_or_init(|| async {
|
|
||||||
let proton_component = ProtonComponent::new(GameConfig::get_config().await.config_dir);
|
|
||||||
let proton = proton_component.init_proton();
|
|
||||||
if let Err(ref e) = proton {
|
|
||||||
ReportError {
|
|
||||||
error_message: format!("Failed to initialize proton : {}", e),
|
|
||||||
}
|
|
||||||
.send_signal_to_dart();
|
|
||||||
}
|
|
||||||
proton.unwrap()
|
|
||||||
})
|
|
||||||
.await
|
|
||||||
.clone()
|
|
||||||
}
|
|
||||||
|
|
||||||
pub async fn listen_proton_installation() {
|
|
||||||
let mut receiver = StartProtonInstallation::get_dart_signal_receiver().unwrap();
|
|
||||||
while let Some(info) = receiver.recv().await {
|
|
||||||
let releases: Result<Vec<GithubRelease>, _> =
|
|
||||||
GithubInfo::get_github_releases(PROTON_DEV, PROTON_REPO).await;
|
|
||||||
if releases.is_err() {
|
|
||||||
ReportError {
|
|
||||||
error_message: format!("When fetching proton versions : {}", releases.unwrap_err()),
|
|
||||||
}
|
|
||||||
.send_signal_to_dart();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
let checked_releases = releases.unwrap();
|
|
||||||
let release_index = checked_releases
|
|
||||||
.iter()
|
|
||||||
.position(|v| v.tag_name == info.message.proton_version);
|
|
||||||
|
|
||||||
if release_index.is_none() {
|
|
||||||
ReportError {
|
|
||||||
error_message: "Failed to find Proton version".to_string(),
|
|
||||||
}
|
|
||||||
.send_signal_to_dart();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
thread::spawn(move || {
|
|
||||||
tokio::runtime::Builder::new_current_thread()
|
|
||||||
.enable_all()
|
|
||||||
.build()
|
|
||||||
.unwrap()
|
|
||||||
.block_on(async {
|
|
||||||
match GameManager::install_wine(
|
|
||||||
GameConfig::get_config().await.config_dir,
|
|
||||||
release_index.unwrap(),
|
|
||||||
Some(DownloadReporter::create()),
|
|
||||||
)
|
|
||||||
.await
|
|
||||||
{
|
|
||||||
Err(e) => ReportError {
|
|
||||||
error_message: format!("Failed to install Proton : {}", e),
|
|
||||||
}
|
|
||||||
.send_signal_to_dart(),
|
|
||||||
Ok(_) => NotifyProtonSuccessfullyInstalled {}.send_signal_to_dart(),
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
struct DownloadReporterPrivate {
|
|
||||||
max_progress: Option<u64>,
|
|
||||||
}
|
|
||||||
|
|
||||||
struct DownloadReporter {
|
|
||||||
private: std::sync::Mutex<Option<DownloadReporterPrivate>>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl DownloadReporter {
|
|
||||||
pub fn create() -> std::sync::Arc<Self> {
|
|
||||||
std::sync::Arc::new(Self {
|
|
||||||
private: std::sync::Mutex::new(None),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl downloader::progress::Reporter for DownloadReporter {
|
|
||||||
fn setup(&self, max_progress: Option<u64>, _: &str) {
|
|
||||||
let private = DownloadReporterPrivate { max_progress };
|
|
||||||
|
|
||||||
let mut guard = self.private.lock().unwrap();
|
|
||||||
*guard = Some(private);
|
|
||||||
}
|
|
||||||
|
|
||||||
fn progress(&self, current: u64) {
|
|
||||||
if let Some(p) = self.private.lock().unwrap().as_mut() {
|
|
||||||
ProtonDownloadProgress {
|
|
||||||
current,
|
|
||||||
max: p.max_progress.unwrap(),
|
|
||||||
}
|
|
||||||
.send_signal_to_dart();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn set_message(&self, _: &str) {}
|
|
||||||
|
|
||||||
fn done(&self) {
|
|
||||||
NotifyProtonStartDecompressing {}.send_signal_to_dart();
|
|
||||||
let mut guard = self.private.lock().unwrap();
|
|
||||||
*guard = None;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,850 +0,0 @@
|
|||||||
# Generated by pub
|
|
||||||
# See https://dart.dev/tools/pub/glossary#lockfile
|
|
||||||
packages:
|
|
||||||
animated_vector:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: animated_vector
|
|
||||||
sha256: e15c6596549ca6e2e7491c11fbe168a1dead87475a828a4bc81cf104feca0432
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.2.0"
|
|
||||||
animated_vector_annotations:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: animated_vector_annotations
|
|
||||||
sha256: baa6b4ed98407220f2c9634f7da3cfa5eedb46798e090466f441e666e2f7c8c0
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.2.0"
|
|
||||||
archive:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: archive
|
|
||||||
sha256: cb6a278ef2dbb298455e1a713bda08524a175630ec643a242c399c932a0a1f7d
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "3.6.1"
|
|
||||||
args:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: args
|
|
||||||
sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "2.5.0"
|
|
||||||
async:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: async
|
|
||||||
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "2.11.0"
|
|
||||||
boolean_selector:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: boolean_selector
|
|
||||||
sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "2.1.1"
|
|
||||||
characters:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: characters
|
|
||||||
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.3.0"
|
|
||||||
clock:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: clock
|
|
||||||
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.1.1"
|
|
||||||
collection:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: collection
|
|
||||||
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.18.0"
|
|
||||||
crypto:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: crypto
|
|
||||||
sha256: ec30d999af904f33454ba22ed9a86162b35e52b44ac4807d1d93c288041d7d27
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "3.0.5"
|
|
||||||
cupertino_icons:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: cupertino_icons
|
|
||||||
sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.0.8"
|
|
||||||
dbus:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: dbus
|
|
||||||
sha256: "365c771ac3b0e58845f39ec6deebc76e3276aa9922b0cc60840712094d9047ac"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.7.10"
|
|
||||||
fake_async:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: fake_async
|
|
||||||
sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.3.1"
|
|
||||||
ffi:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: ffi
|
|
||||||
sha256: "16ed7b077ef01ad6170a3d0c57caa4a112a38d7a2ed5602e0aca9ca6f3d98da6"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "2.1.3"
|
|
||||||
file:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: file
|
|
||||||
sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "7.0.0"
|
|
||||||
fixnum:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: fixnum
|
|
||||||
sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.1.0"
|
|
||||||
flutter:
|
|
||||||
dependency: "direct main"
|
|
||||||
description: flutter
|
|
||||||
source: sdk
|
|
||||||
version: "0.0.0"
|
|
||||||
flutter_highlight:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: flutter_highlight
|
|
||||||
sha256: "7b96333867aa07e122e245c033b8ad622e4e3a42a1a2372cbb098a2541d8782c"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.7.0"
|
|
||||||
flutter_lints:
|
|
||||||
dependency: "direct dev"
|
|
||||||
description:
|
|
||||||
name: flutter_lints
|
|
||||||
sha256: "9e8c3858111da373efc5aa341de011d9bd23e2c5c5e0c62bccf32438e192d7b1"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "3.0.2"
|
|
||||||
flutter_markdown:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: flutter_markdown
|
|
||||||
sha256: f0e599ba89c9946c8e051780f0ec99aba4ba15895e0380a7ab68f420046fc44e
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.7.4+1"
|
|
||||||
flutter_test:
|
|
||||||
dependency: "direct dev"
|
|
||||||
description: flutter
|
|
||||||
source: sdk
|
|
||||||
version: "0.0.0"
|
|
||||||
flutter_web_plugins:
|
|
||||||
dependency: transitive
|
|
||||||
description: flutter
|
|
||||||
source: sdk
|
|
||||||
version: "0.0.0"
|
|
||||||
gtk:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: gtk
|
|
||||||
sha256: e8ce9ca4b1df106e4d72dad201d345ea1a036cc12c360f1a7d5a758f78ffa42c
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "2.1.0"
|
|
||||||
highlight:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: highlight
|
|
||||||
sha256: "5353a83ffe3e3eca7df0abfb72dcf3fa66cc56b953728e7113ad4ad88497cf21"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.7.0"
|
|
||||||
http:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: http
|
|
||||||
sha256: b9c29a161230ee03d3ccf545097fccd9b87a5264228c5d348202e0f0c28f9010
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.2.2"
|
|
||||||
http_parser:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: http_parser
|
|
||||||
sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "4.0.2"
|
|
||||||
image:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: image
|
|
||||||
sha256: "2237616a36c0d69aef7549ab439b833fb7f9fb9fc861af2cc9ac3eedddd69ca8"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "4.2.0"
|
|
||||||
internet_connection_checker:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: internet_connection_checker
|
|
||||||
sha256: "1c683e63e89c9ac66a40748b1b20889fd9804980da732bf2b58d6d5456c8e876"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.0.0+1"
|
|
||||||
js:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: js
|
|
||||||
sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.6.7"
|
|
||||||
leak_tracker:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: leak_tracker
|
|
||||||
sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "10.0.5"
|
|
||||||
leak_tracker_flutter_testing:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: leak_tracker_flutter_testing
|
|
||||||
sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "3.0.5"
|
|
||||||
leak_tracker_testing:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: leak_tracker_testing
|
|
||||||
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "3.0.1"
|
|
||||||
lints:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: lints
|
|
||||||
sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "3.0.0"
|
|
||||||
markdown:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: markdown
|
|
||||||
sha256: ef2a1298144e3f985cc736b22e0ccdaf188b5b3970648f2d9dc13efd1d9df051
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "7.2.2"
|
|
||||||
matcher:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: matcher
|
|
||||||
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.12.16+1"
|
|
||||||
material_color_utilities:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: material_color_utilities
|
|
||||||
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.11.1"
|
|
||||||
media_kit:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: media_kit
|
|
||||||
sha256: "1f1deee148533d75129a6f38251ff8388e33ee05fc2d20a6a80e57d6051b7b62"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.1.11"
|
|
||||||
media_kit_libs_android_video:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: media_kit_libs_android_video
|
|
||||||
sha256: "9dd8012572e4aff47516e55f2597998f0a378e3d588d0fad0ca1f11a53ae090c"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.3.6"
|
|
||||||
media_kit_libs_ios_video:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: media_kit_libs_ios_video
|
|
||||||
sha256: b5382994eb37a4564c368386c154ad70ba0cc78dacdd3fb0cd9f30db6d837991
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.1.4"
|
|
||||||
media_kit_libs_linux:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: media_kit_libs_linux
|
|
||||||
sha256: e186891c31daa6bedab4d74dcdb4e8adfccc7d786bfed6ad81fe24a3b3010310
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.1.3"
|
|
||||||
media_kit_libs_macos_video:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: media_kit_libs_macos_video
|
|
||||||
sha256: f26aa1452b665df288e360393758f84b911f70ffb3878032e1aabba23aa1032d
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.1.4"
|
|
||||||
media_kit_libs_video:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: media_kit_libs_video
|
|
||||||
sha256: "20bb4aefa8fece282b59580e1cd8528117297083a6640c98c2e98cfc96b93288"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.0.5"
|
|
||||||
media_kit_libs_windows_video:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: media_kit_libs_windows_video
|
|
||||||
sha256: "32654572167825c42c55466f5d08eee23ea11061c84aa91b09d0e0f69bdd0887"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.0.10"
|
|
||||||
media_kit_native_event_loop:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: media_kit_native_event_loop
|
|
||||||
sha256: "7d82e3b3e9ded5c35c3146c5ba1da3118d1dd8ac3435bac7f29f458181471b40"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.0.9"
|
|
||||||
media_kit_video:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: media_kit_video
|
|
||||||
sha256: "2cc3b966679963ba25a4ce5b771e532a521ebde7c6aa20e9802bec95d9916c8f"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.2.5"
|
|
||||||
meta:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: meta
|
|
||||||
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.15.0"
|
|
||||||
nested:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: nested
|
|
||||||
sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.0.0"
|
|
||||||
package_config:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: package_config
|
|
||||||
sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "2.1.0"
|
|
||||||
package_info_plus:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: package_info_plus
|
|
||||||
sha256: df3eb3e0aed5c1107bb0fdb80a8e82e778114958b1c5ac5644fb1ac9cae8a998
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "8.1.0"
|
|
||||||
package_info_plus_platform_interface:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: package_info_plus_platform_interface
|
|
||||||
sha256: ac1f4a4847f1ade8e6a87d1f39f5d7c67490738642e2542f559ec38c37489a66
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "3.0.1"
|
|
||||||
path:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: path
|
|
||||||
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.9.0"
|
|
||||||
path_parsing:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: path_parsing
|
|
||||||
sha256: e3e67b1629e6f7e8100b367d3db6ba6af4b1f0bb80f64db18ef1fbabd2fa9ccf
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.0.1"
|
|
||||||
path_provider_linux:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: path_provider_linux
|
|
||||||
sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "2.2.1"
|
|
||||||
path_provider_platform_interface:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: path_provider_platform_interface
|
|
||||||
sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "2.1.2"
|
|
||||||
path_provider_windows:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: path_provider_windows
|
|
||||||
sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "2.3.0"
|
|
||||||
petitparser:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: petitparser
|
|
||||||
sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "6.0.2"
|
|
||||||
platform:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: platform
|
|
||||||
sha256: "9b71283fc13df574056616011fb138fd3b793ea47cc509c189a6c3fa5f8a1a65"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "3.1.5"
|
|
||||||
plugin_platform_interface:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: plugin_platform_interface
|
|
||||||
sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "2.1.8"
|
|
||||||
protobuf:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: protobuf
|
|
||||||
sha256: "68645b24e0716782e58948f8467fd42a880f255096a821f9e7d0ec625b00c84d"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "3.1.0"
|
|
||||||
provider:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: provider
|
|
||||||
sha256: c8a055ee5ce3fd98d6fc872478b03823ffdb448699c6ebdbbc71d59b596fd48c
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "6.1.2"
|
|
||||||
rinf:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: rinf
|
|
||||||
sha256: "824599d8c4cfc3c5be1cdbd5c53f849eca93ed332bbb30bff60c3778454a26af"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "6.15.0"
|
|
||||||
safe_local_storage:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: safe_local_storage
|
|
||||||
sha256: ede4eb6cb7d88a116b3d3bf1df70790b9e2038bc37cb19112e381217c74d9440
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.0.2"
|
|
||||||
screen_brightness:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: screen_brightness
|
|
||||||
sha256: ed8da4a4511e79422fc1aa88138e920e4008cd312b72cdaa15ccb426c0faaedd
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.2.2+1"
|
|
||||||
screen_brightness_android:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: screen_brightness_android
|
|
||||||
sha256: "3df10961e3a9e968a5e076fe27e7f4741fa8a1d3950bdeb48cf121ed529d0caf"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.1.0+2"
|
|
||||||
screen_brightness_ios:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: screen_brightness_ios
|
|
||||||
sha256: "99adc3ca5490b8294284aad5fcc87f061ad685050e03cf45d3d018fe398fd9a2"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.1.0"
|
|
||||||
screen_brightness_macos:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: screen_brightness_macos
|
|
||||||
sha256: "64b34e7e3f4900d7687c8e8fb514246845a73ecec05ab53483ed025bd4a899fd"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.1.0+1"
|
|
||||||
screen_brightness_platform_interface:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: screen_brightness_platform_interface
|
|
||||||
sha256: b211d07f0c96637a15fb06f6168617e18030d5d74ad03795dd8547a52717c171
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.1.0"
|
|
||||||
screen_brightness_windows:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: screen_brightness_windows
|
|
||||||
sha256: "9261bf33d0fc2707d8cf16339ce25768100a65e70af0fcabaf032fc12408ba86"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.1.3"
|
|
||||||
screen_retriever:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: screen_retriever
|
|
||||||
sha256: "6ee02c8a1158e6dae7ca430da79436e3b1c9563c8cf02f524af997c201ac2b90"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.1.9"
|
|
||||||
shared_preferences:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: shared_preferences
|
|
||||||
sha256: "746e5369a43170c25816cc472ee016d3a66bc13fcf430c0bc41ad7b4b2922051"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "2.3.2"
|
|
||||||
shared_preferences_android:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: shared_preferences_android
|
|
||||||
sha256: "480ba4345773f56acda9abf5f50bd966f581dac5d514e5fc4a18c62976bbba7e"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "2.3.2"
|
|
||||||
shared_preferences_foundation:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: shared_preferences_foundation
|
|
||||||
sha256: c4b35f6cb8f63c147312c054ce7c2254c8066745125264f0c88739c417fc9d9f
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "2.5.2"
|
|
||||||
shared_preferences_linux:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: shared_preferences_linux
|
|
||||||
sha256: "580abfd40f415611503cae30adf626e6656dfb2f0cee8f465ece7b6defb40f2f"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "2.4.1"
|
|
||||||
shared_preferences_platform_interface:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: shared_preferences_platform_interface
|
|
||||||
sha256: "57cbf196c486bc2cf1f02b85784932c6094376284b3ad5779d1b1c6c6a816b80"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "2.4.1"
|
|
||||||
shared_preferences_web:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: shared_preferences_web
|
|
||||||
sha256: d2ca4132d3946fec2184261726b355836a82c33d7d5b67af32692aff18a4684e
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "2.4.2"
|
|
||||||
shared_preferences_windows:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: shared_preferences_windows
|
|
||||||
sha256: "94ef0f72b2d71bc3e700e025db3710911bd51a71cefb65cc609dd0d9a982e3c1"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "2.4.1"
|
|
||||||
sky_engine:
|
|
||||||
dependency: transitive
|
|
||||||
description: flutter
|
|
||||||
source: sdk
|
|
||||||
version: "0.0.99"
|
|
||||||
source_span:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: source_span
|
|
||||||
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.10.0"
|
|
||||||
sprintf:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: sprintf
|
|
||||||
sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "7.0.0"
|
|
||||||
stack_trace:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: stack_trace
|
|
||||||
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.11.1"
|
|
||||||
stream_channel:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: stream_channel
|
|
||||||
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "2.1.2"
|
|
||||||
string_scanner:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: string_scanner
|
|
||||||
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.2.0"
|
|
||||||
synchronized:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: synchronized
|
|
||||||
sha256: "69fe30f3a8b04a0be0c15ae6490fc859a78ef4c43ae2dd5e8a623d45bfcf9225"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "3.3.0+3"
|
|
||||||
term_glyph:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: term_glyph
|
|
||||||
sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.2.1"
|
|
||||||
test_api:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: test_api
|
|
||||||
sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.7.2"
|
|
||||||
typed_data:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: typed_data
|
|
||||||
sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.3.2"
|
|
||||||
universal_platform:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: universal_platform
|
|
||||||
sha256: "64e16458a0ea9b99260ceb5467a214c1f298d647c659af1bff6d3bf82536b1ec"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.1.0"
|
|
||||||
uri_parser:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: uri_parser
|
|
||||||
sha256: "6543c9fd86d2862fac55d800a43e67c0dcd1a41677cb69c2f8edfe73bbcf1835"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "2.0.2"
|
|
||||||
uuid:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: uuid
|
|
||||||
sha256: a5be9ef6618a7ac1e964353ef476418026db906c4facdedaa299b7a2e71690ff
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "4.5.1"
|
|
||||||
vector_math:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: vector_math
|
|
||||||
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "2.1.4"
|
|
||||||
vm_service:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: vm_service
|
|
||||||
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "14.2.5"
|
|
||||||
volume_controller:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: volume_controller
|
|
||||||
sha256: c71d4c62631305df63b72da79089e078af2659649301807fa746088f365cb48e
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "2.0.8"
|
|
||||||
wakelock_plus:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: wakelock_plus
|
|
||||||
sha256: bf4ee6f17a2fa373ed3753ad0e602b7603f8c75af006d5b9bdade263928c0484
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.2.8"
|
|
||||||
wakelock_plus_platform_interface:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: wakelock_plus_platform_interface
|
|
||||||
sha256: "422d1cdbb448079a8a62a5a770b69baa489f8f7ca21aef47800c726d404f9d16"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.2.1"
|
|
||||||
watcher:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: watcher
|
|
||||||
sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.1.0"
|
|
||||||
web:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: web
|
|
||||||
sha256: d43c1d6b787bf0afad444700ae7f4db8827f701bc61c255ac8d328c6f4d52062
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.0.0"
|
|
||||||
win32:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: win32
|
|
||||||
sha256: "68d1e89a91ed61ad9c370f9f8b6effed9ae5e0ede22a270bdfa6daf79fc2290a"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "5.5.4"
|
|
||||||
window_manager:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: window_manager
|
|
||||||
sha256: "8699323b30da4cdbe2aa2e7c9de567a6abd8a97d9a5c850a3c86dcd0b34bbfbf"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.3.9"
|
|
||||||
xdg_directories:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: xdg_directories
|
|
||||||
sha256: faea9dee56b520b55a566385b84f2e8de55e7496104adada9962e0bd11bcff1d
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.0.4"
|
|
||||||
xml:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: xml
|
|
||||||
sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "6.5.0"
|
|
||||||
yaml:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: yaml
|
|
||||||
sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "3.1.2"
|
|
||||||
yaru:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: yaru
|
|
||||||
sha256: e868965bcfbca568f54916e3f59a636a8a6ee39f2e102df8844061cd78a8d20e
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "4.1.0"
|
|
||||||
yaru_window:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: yaru_window
|
|
||||||
sha256: c9d16f78962652ad71aa160ab0a1e2e5924359439303394f980fd00eefc905eb
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.2.1"
|
|
||||||
yaru_window_linux:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: yaru_window_linux
|
|
||||||
sha256: "3676355492eba0461f03acf1b7420f7885982d1bffe113fccdca9415fbe39f5d"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.2.0"
|
|
||||||
yaru_window_manager:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: yaru_window_manager
|
|
||||||
sha256: "2d358263d19ae6598df21d6d8c0d25e75c79a82f459b63b0013a13e395c48b23"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.1.2"
|
|
||||||
yaru_window_platform_interface:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: yaru_window_platform_interface
|
|
||||||
sha256: e9f8cd34e207d7f7b771ae70dee347ed974cee06b981819c4181b3e474e52254
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.1.2"
|
|
||||||
yaru_window_web:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: yaru_window_web
|
|
||||||
sha256: "3ff30758a330d7626d54643df0cca6c179782f401aba7752da9cc0d60c9a6f74"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.0.3"
|
|
||||||
sdks:
|
|
||||||
dart: ">=3.5.0 <4.0.0"
|
|
||||||
flutter: ">=3.22.0"
|
|
||||||
@ -1,42 +0,0 @@
|
|||||||
name: babylonia_terminal_launcher
|
|
||||||
description: "A launcher to play a certain anime game on linux"
|
|
||||||
publish_to: 'none'
|
|
||||||
|
|
||||||
version: 0.1.2
|
|
||||||
|
|
||||||
environment:
|
|
||||||
sdk: '>=3.3.4 <4.0.0'
|
|
||||||
|
|
||||||
dependencies:
|
|
||||||
flutter:
|
|
||||||
sdk: flutter
|
|
||||||
|
|
||||||
cupertino_icons: ^1.0.6
|
|
||||||
yaru: ^4.1.0
|
|
||||||
provider: ^6.1.2
|
|
||||||
rinf: ^6.9.0
|
|
||||||
protobuf: ^3.1.0
|
|
||||||
shared_preferences: ^2.2.3
|
|
||||||
http: ^1.2.1
|
|
||||||
flutter_highlight: ^0.7.0
|
|
||||||
fixnum: ^1.1.0
|
|
||||||
media_kit: ^1.1.11
|
|
||||||
media_kit_video: ^1.2.5
|
|
||||||
media_kit_libs_video: ^1.0.5
|
|
||||||
yaru_window: ^0.2.1
|
|
||||||
package_info_plus: ^8.1.0
|
|
||||||
flutter_markdown: ^0.7.4+1
|
|
||||||
|
|
||||||
dev_dependencies:
|
|
||||||
flutter_test:
|
|
||||||
sdk: flutter
|
|
||||||
|
|
||||||
flutter_lints: ^3.0.0
|
|
||||||
|
|
||||||
flutter:
|
|
||||||
|
|
||||||
uses-material-design: true
|
|
||||||
|
|
||||||
assets:
|
|
||||||
- assets/images/Lee6.png
|
|
||||||
- CHANGELOG.md
|
|
||||||
Loading…
Reference in New Issue
Block a user