Got more stuff connected up and working
This commit is contained in:
parent
7cddfd2de6
commit
a1141cd2b8
7 changed files with 111 additions and 97 deletions
|
@ -1,9 +1,6 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:file_selector/file_selector.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../game.dart';
|
||||
import '../statemachine.dart';
|
||||
import '../structs/autorestarts.dart';
|
||||
import '../structs/serversettings.dart';
|
||||
|
@ -46,43 +43,6 @@ class GameServerPageState extends State<GameServerPage> {
|
|||
padding: EdgeInsets.all(16),
|
||||
child: Column(
|
||||
children: [
|
||||
ListTile(
|
||||
title: settings.serverInstalled()
|
||||
? Text("Update / Validate Server Install")
|
||||
: Text("Initial Server Download"),
|
||||
subtitle: settings.serverInstalled()
|
||||
? Text(
|
||||
"Validates game files or performs an update. This is done when starting the server as well.")
|
||||
: Text(
|
||||
"Download the game server. This is step 1, after having downloaded steamcmd."),
|
||||
leading: Icon(Icons.numbers),
|
||||
onTap: () async {
|
||||
if (downloading) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
|
||||
content: Text("Wait until the download completes")));
|
||||
|
||||
return;
|
||||
}
|
||||
if (!settings.isValid()) return;
|
||||
Directory(settings.getServerPath()).createSync();
|
||||
|
||||
setState(() {
|
||||
downloading = true;
|
||||
});
|
||||
|
||||
// Start server download into folder
|
||||
await settings.RunUpdate();
|
||||
|
||||
setState(() {
|
||||
downloading = false;
|
||||
});
|
||||
},
|
||||
),
|
||||
if (downloading)
|
||||
ListTile(
|
||||
title: Text("Downloading..."),
|
||||
leading: Icon(Icons.downloading),
|
||||
),
|
||||
ListTile(
|
||||
title: Text("Mods"),
|
||||
leading: Icon(Icons.build),
|
||||
|
@ -97,34 +57,6 @@ class GameServerPageState extends State<GameServerPage> {
|
|||
Navigator.pushNamed(context, "/server/mods");
|
||||
},
|
||||
),
|
||||
if (settings.inst!.downloadMods)
|
||||
ListTile(
|
||||
title: Text("Download Mods"),
|
||||
subtitle: Text("Downloads the mods"),
|
||||
leading: Icon(Icons.download_sharp),
|
||||
onTap: () async {
|
||||
setState(() {
|
||||
downloading = true;
|
||||
});
|
||||
await doDownloadMods(settings.getModPath());
|
||||
|
||||
setState(() {
|
||||
downloading = false;
|
||||
});
|
||||
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text("Scanning mods...")));
|
||||
|
||||
var mods = await doScanMods(settings.getModPath());
|
||||
setState(() {
|
||||
settings.inst!.mods = mods;
|
||||
|
||||
settings.Write();
|
||||
});
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text("Mod scanning complete")));
|
||||
},
|
||||
),
|
||||
if (!settings.inst!.downloadMods)
|
||||
ListTile(
|
||||
title: Text("Conan Exiles Install Path"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue