goodify without renaming config keys to stay backwards compat

This commit is contained in:
JohnCorby 2022-11-19 13:54:42 -08:00
parent cf9d5a5529
commit 1fc364d1ef
3 changed files with 11 additions and 8 deletions

View File

@ -241,9 +241,9 @@ public class QSBCore : ModBehaviour
public override void Configure(IModConfig config)
{
DefaultServerIP = config.GetSettingsValue<string>("Default Server IP");
IncompatibleModsAllowed = config.GetSettingsValue<bool>("Incompatible Mods Allowed");
ShipDamage = config.GetSettingsValue<bool>("Ship Damage");
DefaultServerIP = config.GetSettingsValue<string>("defaultServerIP");
IncompatibleModsAllowed = config.GetSettingsValue<bool>("incompatibleModsAllowed");
ShipDamage = config.GetSettingsValue<bool>("shipDamage");
}
private void Update()

View File

@ -270,7 +270,7 @@ public class QSBNetworkManager : NetworkManager, IAddComponentOnStart
{
QSBCore.DefaultServerIP = networkAddress;
var config = QSBCore.Helper.Config;
config.SetSettingsValue("Default Server IP", networkAddress);
config.SetSettingsValue("defaultServerIP", networkAddress);
QSBCore.Helper.Storage.Save(config, Constants.ModConfigFileName);
}

View File

@ -1,17 +1,20 @@
{
"enabled": true,
"settings": {
"Default Server IP": {
"defaultServerIP": {
"title": "Last Entered IP/ID",
"type": "text",
"value": "localhost",
"tooltip": "The last entered IP/ID. Used if you leave the connect prompt blank."
"tooltip": "Used if you leave the connect prompt blank."
},
"Incompatible Mods Allowed": {
"incompatibleModsAllowed": {
"title": "Incompatible Mods Allowed",
"type": "toggle",
"value": false,
"tooltip": "Kicks players if they have certain mods."
},
"Ship Damage": {
"shipDamage": {
"title": "Ship Damage",
"type": "toggle",
"value": true,
"tooltip": "Take impact damage when inside the ship."