mirror of
https://github.com/Auties00/Reboot-Launcher.git
synced 2026-01-13 11:12:23 +01:00
Minor fixes
This commit is contained in:
@@ -147,13 +147,7 @@ class _GamePageState extends State<_GamePage> {
|
|||||||
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(() => !isLocalHost(_settingsController.matchmakingIp.text) || _gameController.password.text.isNotEmpty ? Container(
|
content: !isLocalHost(_settingsController.matchmakingIp.text) || _gameController.password.text.isNotEmpty ? _disabledAutoGameServerSwitch : _autoGameServerSwitch,
|
||||||
foregroundDecoration: const BoxDecoration(
|
|
||||||
color: Colors.grey,
|
|
||||||
backgroundBlendMode: BlendMode.saturation,
|
|
||||||
),
|
|
||||||
child: _autoGameServerSwitch,
|
|
||||||
) : _autoGameServerSwitch),
|
|
||||||
isChild: true
|
isChild: true
|
||||||
),
|
),
|
||||||
SettingTile(
|
SettingTile(
|
||||||
@@ -211,8 +205,16 @@ class _GamePageState extends State<_GamePage> {
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
ToggleSwitch get _autoGameServerSwitch => ToggleSwitch(
|
Widget get _disabledAutoGameServerSwitch => Container(
|
||||||
checked: isLocalHost(_settingsController.matchmakingIp.text) && _gameController.password.text.isEmpty && _gameController.autoStartGameServer(),
|
foregroundDecoration: const BoxDecoration(
|
||||||
|
color: Colors.grey,
|
||||||
|
backgroundBlendMode: BlendMode.saturation,
|
||||||
|
),
|
||||||
|
child: _autoGameServerSwitch,
|
||||||
|
);
|
||||||
|
|
||||||
|
Widget get _autoGameServerSwitch => Obx(() => ToggleSwitch(
|
||||||
|
checked: _gameController.autoStartGameServer() && isLocalHost(_settingsController.matchmakingIp.text) && _gameController.password.text.isEmpty,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
if(!isLocalHost(_settingsController.matchmakingIp.text)){
|
if(!isLocalHost(_settingsController.matchmakingIp.text)){
|
||||||
showMessage("This option isn't available when the matchmaker isn't set to 127.0.0.1");
|
showMessage("This option isn't available when the matchmaker isn't set to 127.0.0.1");
|
||||||
@@ -226,5 +228,5 @@ class _GamePageState extends State<_GamePage> {
|
|||||||
|
|
||||||
_gameController.autoStartGameServer.value = value;
|
_gameController.autoStartGameServer.value = value;
|
||||||
}
|
}
|
||||||
);
|
));
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user