Change cvar usages to use CVarDef and define them in CCVars (#2250)

* Change cvar usages to use CVarDef and define them in CCVars

* Merge fixes

* Remove duplicate cvar registration
This commit is contained in:
DrSmugleaf
2020-11-07 01:15:56 +01:00
committed by GitHub
parent a7e7f20417
commit bf5b9ad03b
19 changed files with 136 additions and 72 deletions

View File

@@ -8,6 +8,7 @@ using Robust.Client.Interfaces.UserInterface;
using Robust.Client.ResourceManagement;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Shared;
using Robust.Shared.Interfaces.Configuration;
using Robust.Shared.Interfaces.Network;
using Robust.Shared.IoC;
@@ -111,10 +112,10 @@ namespace Content.Client.State
return;
}
var configName = _configurationManager.GetCVar<string>("player.name");
var configName = _configurationManager.GetCVar(CVars.PlayerName);
if (_mainMenuControl.UserNameBox.Text != configName)
{
_configurationManager.SetCVar("player.name", inputName);
_configurationManager.SetCVar(CVars.PlayerName, inputName);
_configurationManager.SaveToFile();
}
@@ -248,7 +249,7 @@ namespace Content.Client.State
vBox.AddChild(userNameHBox);
userNameHBox.AddChild(new Label {Text = "Username:"});
var currentUserName = _configurationManager.GetCVar<string>("player.name");
var currentUserName = _configurationManager.GetCVar(CVars.PlayerName);
UserNameBox = new LineEdit
{
Text = currentUserName, PlaceHolder = "Username",