Beispiel #1
0
        private void enterIPPressed()
        {
            string last_entered_ip = "";

            try
            {
                StartupPreferences startupPreferences = new StartupPreferences();
                startupPreferences.loadPreferences(async: false, applyLanguage: false);
                last_entered_ip = startupPreferences.lastEnteredIP;
            }
            catch (Exception)
            {
            }
            string title = Game1.content.LoadString("Strings\\UI:CoopMenu_EnterIP");

            setMenu(new TitleTextInputMenu(title, delegate(string address)
            {
                try
                {
                    StartupPreferences startupPreferences2 = new StartupPreferences();
                    startupPreferences2.loadPreferences(async: false, applyLanguage: false);
                    startupPreferences2.lastEnteredIP = address;
                    startupPreferences2.savePreferences(async: false);
                }
                catch (Exception)
                {
                }
                if (address == "")
                {
                    address = "localhost";
                }
                setMenu(new FarmhandMenu(Game1.multiplayer.InitClient(new LidgrenClient(address))));
            }, last_entered_ip, "join_menu"));
        }
Beispiel #2
0
        /// <summary>Raised after the game finishes writing data to the save file (except the initial save creation).</summary>
        internal static void OnSaved(object sender, SavedEventArgs e)
        {
            // clear custom data after a normal save (to avoid restoring old state)
            if (!Config.DisableSaveAnyTime && !IsCustomSaving)
            {
                SaveManager.ClearData();
            }
            else
            {
                IsCustomSaving = false;
            }

            if (!IsCustomSaving || !Config.DisableBackupSaveAnyTime)
            {
                if (!Config.DisableBackupOnSave)
                {
                    BackupSaves();
                }

                if (Config.ShareOptions)
                {
                    StartupPreferences options = new StartupPreferences();
                    options.loadPreferences(false, false);
                    options.clientOptions = Game1.options;
                    options.savePreferences(false);
                }
            }
        }
        public static void saveClientOptions()
        {
            StartupPreferences startupPreferences = new StartupPreferences();

            startupPreferences.loadPreferences(false, true);
            startupPreferences.clientOptions = Game1.options;
            startupPreferences.savePreferences(false);
        }
Beispiel #4
0
        private static void saveClientOptions()
        {
            StartupPreferences startupPreferences = new StartupPreferences();

            startupPreferences.loadPreferences(async: false, applyLanguage: false);
            startupPreferences.clientOptions = Game1.options;
            startupPreferences.savePreferences(async: false);
        }
        private static void saveClientOptions()
        {
            StartupPreferences startupPreferences = new StartupPreferences();
            int num1 = 0;
            int num2 = 1;

            startupPreferences.loadPreferences(num1 != 0, num2 != 0);
            Options options = Game1.options;

            startupPreferences.clientOptions = options;
            int num3 = 0;

            startupPreferences.savePreferences(num3 != 0);
        }