Exemple #1
0
    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();
    }
Exemple #2
0
        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);
        }
Exemple #3
0
    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();
    }
Exemple #4
0
        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);
        }
Exemple #5
0
        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);
        }