Got more things functional
This commit is contained in:
parent
a1141cd2b8
commit
fc0c1c7e7a
23 changed files with 1080 additions and 876 deletions
|
@ -1,8 +1,8 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:file_selector/file_selector.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:servermanager/packets/ClientPackets.dart';
|
||||
import 'package:servermanager/pages/Constants.dart';
|
||||
import 'package:servermanager/structs/settings.dart';
|
||||
|
||||
|
@ -57,12 +57,7 @@ class HomePageState extends State<HomePage> {
|
|||
ListTile(
|
||||
title: Text("Proton"),
|
||||
leading: Icon(CupertinoIcons.gear),
|
||||
subtitle: Text("Linux Proton"),
|
||||
onTap: () {
|
||||
if (settings.steamcmd_path.isNotEmpty) {
|
||||
Navigator.pushNamed(context, "/proton");
|
||||
}
|
||||
},
|
||||
subtitle: Text("Linux Proton: ${settings.proton_path}"),
|
||||
), // Not yet implemented
|
||||
ListTile(
|
||||
title: Text("SteamCMD"),
|
||||
|
@ -82,20 +77,38 @@ class HomePageState extends State<HomePage> {
|
|||
subtitle: settings.game_path.isEmpty
|
||||
? Text("Not Set")
|
||||
: Text(settings.game_path),
|
||||
onTap: () async {
|
||||
var path = await getDirectoryPath();
|
||||
),
|
||||
SwitchListTile(
|
||||
value: settings.FTS,
|
||||
onChanged: (B) {
|
||||
setState(() {
|
||||
if (path != null && path.isNotEmpty) {
|
||||
settings.game_path = path;
|
||||
settings.steamcmd_path =
|
||||
"$path${Platform.pathSeparator}scmd";
|
||||
|
||||
Directory.current = Directory(settings.game_path);
|
||||
}
|
||||
settings.FTS = B;
|
||||
});
|
||||
},
|
||||
title: Text("First Time Setup Mode"),
|
||||
subtitle: Text(
|
||||
"Enabling this will disable server startup, leaving only the wrapper interface to interact with."),
|
||||
),
|
||||
ListTile(
|
||||
title: Text("Manager Credentials"),
|
||||
subtitle: Text("Edit ServerManager credentials"),
|
||||
leading: Icon(Icons.key),
|
||||
onTap: () {
|
||||
Navigator.pushNamed(context, "/creds",
|
||||
arguments: settings.serverLoginCreds);
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
title: Text("Save Changes"),
|
||||
subtitle: Text(
|
||||
"This will upload the settings to the server and trigger a restart"),
|
||||
onTap: () async {
|
||||
Settings settings = Settings();
|
||||
|
||||
await settings.Open();
|
||||
settings.Read();
|
||||
C2SUploadSettingsPacket upload = C2SUploadSettingsPacket();
|
||||
upload.srvSettings = settings.serialize();
|
||||
|
||||
settings.client!.send(upload);
|
||||
},
|
||||
)
|
||||
],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue