// Start is called before the first frame update void Start() { userSettings = UserSettingsMgr.Load(kSettingsFileBaseName); //userSettings = BeamUserSettings.CreateDefault(); userSettings.localPlayerCtrlType = BikeFactory.LocalPlayerCtrl; // Kinda hackly mainObj = BeamMain.GetInstance(); _feModeHelper = new BeamFeModeHelper(mainObj); feBikes = new Dictionary <string, GameObject>(); logger = UniLogger.GetLogger("Frontend"); }
public void LoadAndShow() { BeamMain mainObj = BeamMain.GetInstance(); BeamUserSettings settings = mainObj.frontend.GetUserSettings(); screenNameField.GetComponent <TMP_InputField>().text = settings.screenName; p2pConnectionField.GetComponent <TMP_InputField>().text = settings.p2pConnectionString; ethNodeField.GetComponent <TMP_InputField>().text = settings.ethNodeUrl; ethAcctField.GetComponent <TMP_InputField>().text = settings.ethAcct; gameIdField.GetComponent <TMP_InputField>().text = settings.tempSettings.ContainsKey("gameId") ? settings.tempSettings["gameId"] : ""; UserSettingsMgr.Save(settings); moveOnScreen(); }
protected static BeamUserSettings GetSettings(string[] args) { BeamUserSettings settings = UserSettingsMgr.Load(); Parser.Default.ParseArguments <CliOptions>(args) .WithParsed <CliOptions>(o => { if (o.Settings != null) { settings = UserSettingsMgr.Load(o.Settings); } if (o.ForceDefaultSettings) { settings = BeamUserSettings.CreateDefault(); } if (o.ThrowOnError) { UniLogger.DefaultThrowOnError = true; } if (o.DefLogLvl != null) { settings.defaultLogLevel = o.DefLogLvl; } if (o.GameId != null) { settings.tempSettings["gameId"] = o.GameId; } if (o.StartMode != -1) { settings.startMode = o.StartMode; } // TODO: would rather have the frontend implmentation determine this somehow if (o.BikeCtrl != null) { settings.localPlayerCtrlType = o.BikeCtrl; } }); UserSettingsMgr.Save(settings); return(settings); }
public void SaveAndHide() { BeamMain mainObj = BeamMain.GetInstance(); BeamUserSettings settings = mainObj.frontend.GetUserSettings(); settings.screenName = screenNameField.GetComponent <TMP_InputField>().text; settings.p2pConnectionString = p2pConnectionField.GetComponent <TMP_InputField>().text; settings.ethNodeUrl = ethNodeField.GetComponent <TMP_InputField>().text; settings.ethAcct = ethAcctField.GetComponent <TMP_InputField>().text; string gameId = gameIdField.GetComponent <TMP_InputField>().text; if (gameId != "") { settings.tempSettings["gameId"] = gameId; } UserSettingsMgr.Save(settings); moveOffScreen(); }
public static AceUserSettings GetSettings(string[] args) { AceUserSettings settings = UserSettingsMgr.Load(); Parser.Default.ParseArguments <CliOptions>(args) .WithParsed <CliOptions>(o => { if (o.Settings != null) { settings = UserSettingsMgr.Load(o.Settings); } if (o.ForceDefaultSettings) { settings = AceUserSettings.CreateDefault(); } if (o.ThrowOnError) { UniLogger.DefaultThrowOnError = true; } if (o.DefLogLvl != null) { settings.defaultLogLevel = o.DefLogLvl; } if (o.NetName != null) { settings.apianNetworkName = o.NetName; } if (o.Validator) { settings.tempSettings["validator"] = "true"; } if (o.GameName != null) { settings.tempSettings["gameName"] = o.GameName; } if (o.GroupType != null) { settings.tempSettings["groupType"] = o.GroupType; } if (o.StartMode != -1) { settings.startMode = o.StartMode; } }).WithNotParsed(o => { // --help, --version, or any error results in this getting called settings = null; }); if (settings != null) { UserSettingsMgr.Save(settings); } return(settings); }
protected static BeamUserSettings GetSettings(string[] args) { BeamUserSettings settings = UserSettingsMgr.Load(); Parser.Default.ParseArguments <CliOptions>(args) .WithParsed <CliOptions>(o => { if (o.Settings != null) { settings = UserSettingsMgr.Load(o.Settings); } if (o.ForceDefaultSettings) { settings = BeamUserSettings.CreateDefault(); } if (o.ThrowOnError) { UniLogger.DefaultThrowOnError = true; } if (o.DefLogLvl != null) { settings.defaultLogLevel = o.DefLogLvl; } if (o.NetName != null) { settings.apianNetworkName = o.NetName; } if (o.GameName != null) { settings.tempSettings["gameName"] = o.GameName; } if (o.GroupType != null) { settings.tempSettings["groupType"] = o.GroupType; } if (o.StartMode != -1) { settings.startMode = o.StartMode; } // TODO: would rather have the frontend implmentation determine this somehow if (o.BikeCtrl != null) { settings.localPlayerCtrlType = o.BikeCtrl; } }).WithNotParsed(o => { // --help, --version, or any error results in this getting called settings = null; }); if (settings != null) { UserSettingsMgr.Save(settings); } return(settings); }