mirror of
https://github.com/Auties00/Reboot-Launcher.git
synced 2026-01-14 03:32:23 +01:00
Minor fixes
This commit is contained in:
@@ -80,7 +80,7 @@ class _RebootApplicationState extends State<RebootApplication> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) => FluentApp(
|
Widget build(BuildContext context) => FluentApp(
|
||||||
title: "Reboot Launcher",
|
title: "Reboot Launcher",
|
||||||
themeMode: ThemeMode.system,
|
themeMode: ThemeMode.light,
|
||||||
debugShowCheckedModeBanner: false,
|
debugShowCheckedModeBanner: false,
|
||||||
color: SystemTheme.accentColor.accent.toAccentColor(),
|
color: SystemTheme.accentColor.accent.toAccentColor(),
|
||||||
darkTheme: _createTheme(Brightness.dark),
|
darkTheme: _createTheme(Brightness.dark),
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import 'package:flutter/material.dart' show Icons;
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:reboot_launcher/src/ui/controller/game_controller.dart';
|
import 'package:reboot_launcher/src/ui/controller/game_controller.dart';
|
||||||
import 'package:reboot_launcher/src/ui/controller/settings_controller.dart';
|
import 'package:reboot_launcher/src/ui/controller/settings_controller.dart';
|
||||||
|
import 'package:reboot_launcher/src/ui/dialog/snackbar.dart';
|
||||||
import 'package:reboot_launcher/src/ui/page/browse_page.dart';
|
import 'package:reboot_launcher/src/ui/page/browse_page.dart';
|
||||||
import 'package:reboot_launcher/src/ui/widget/home/launch_button.dart';
|
import 'package:reboot_launcher/src/ui/widget/home/launch_button.dart';
|
||||||
import 'package:reboot_launcher/src/ui/widget/home/version_selector.dart';
|
import 'package:reboot_launcher/src/ui/widget/home/version_selector.dart';
|
||||||
@@ -73,6 +74,7 @@ class _GamePageState extends State<_GamePage> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
|
_gameController.password.addListener(() => _matchmakingStream.add(null));
|
||||||
_settingsController.matchmakingIp.addListener(() => _matchmakingStream.add(null));
|
_settingsController.matchmakingIp.addListener(() => _matchmakingStream.add(null));
|
||||||
super.initState();
|
super.initState();
|
||||||
}
|
}
|
||||||
@@ -140,16 +142,18 @@ class _GamePageState extends State<_GamePage> {
|
|||||||
validator: checkMatchmaking,
|
validator: checkMatchmaking,
|
||||||
autovalidateMode: AutovalidateMode.always
|
autovalidateMode: AutovalidateMode.always
|
||||||
),
|
),
|
||||||
expandedContentSpacing: isLocalHost(_settingsController.matchmakingIp.text) ? SettingTile.kDefaultSpacing : 0,
|
|
||||||
expandedContent: [
|
expandedContent: [
|
||||||
!isLocalHost(_settingsController.matchmakingIp.text) ? const SizedBox() : SettingTile(
|
SettingTile(
|
||||||
title: "Automatically start game server",
|
title: "Automatically start game server",
|
||||||
subtitle: "This option is available when the matchmaker is set to localhost",
|
subtitle: "This option is available when the matchmaker is set to localhost",
|
||||||
contentWidth: null,
|
contentWidth: null,
|
||||||
content: Obx(() => ToggleSwitch(
|
content: Obx(() => !isLocalHost(_settingsController.matchmakingIp.text) || _gameController.password.text.isNotEmpty ? Container(
|
||||||
checked: _gameController.autoStartGameServer(),
|
foregroundDecoration: const BoxDecoration(
|
||||||
onChanged: (value) => _gameController.autoStartGameServer.value = value
|
color: Colors.grey,
|
||||||
)),
|
backgroundBlendMode: BlendMode.saturation,
|
||||||
|
),
|
||||||
|
child: _autoGameServerSwitch,
|
||||||
|
) : _autoGameServerSwitch),
|
||||||
isChild: true
|
isChild: true
|
||||||
),
|
),
|
||||||
SettingTile(
|
SettingTile(
|
||||||
@@ -206,4 +210,21 @@ class _GamePageState extends State<_GamePage> {
|
|||||||
)
|
)
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
ToggleSwitch get _autoGameServerSwitch => ToggleSwitch(
|
||||||
|
checked: isLocalHost(_settingsController.matchmakingIp.text) && _gameController.password.text.isEmpty && _gameController.autoStartGameServer(),
|
||||||
|
onChanged: (value) {
|
||||||
|
if(!isLocalHost(_settingsController.matchmakingIp.text)){
|
||||||
|
showMessage("This option isn't available when the matchmaker isn't set to 127.0.0.1");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(_gameController.password.text.isNotEmpty){
|
||||||
|
showMessage("This option isn't available when the password isn't empty(LawinV2)");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_gameController.autoStartGameServer.value = value;
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user