Beispiel #1
0
        private void loadClientOptions()
        {
            Action action = delegate
            {
                StartupPreferences startupPreferences = new StartupPreferences();
                startupPreferences.loadPreferences(async: false, applyLanguage: false);
                if (Game1.game1.IsMainInstance)
                {
                    Game1.options = startupPreferences.clientOptions;
                }
                else
                {
                    Game1.options = new Options();
                }
                Game1.initializeVolumeLevels();
            };

            if (LocalMultiplayer.IsLocalMultiplayer())
            {
                action();
            }
            else
            {
                new Task(action).Start();
            }
        }
Beispiel #2
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 #3
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 #5
0
        private static void saveClientOptions()
        {
            StartupPreferences startupPreferences = new StartupPreferences();

            startupPreferences.loadPreferences(async: false, applyLanguage: false);
            startupPreferences.clientOptions = Game1.options;
            startupPreferences.savePreferences(async: false);
        }
Beispiel #6
0
 private void loadClientOptions()
 {
     new Task(delegate
     {
         StartupPreferences startupPreferences = new StartupPreferences();
         startupPreferences.loadPreferences(async: false, updateLanguage: false);
         Game1.options = startupPreferences.clientOptions;
         Game1.initializeVolumeLevels();
     }).Start();
 }
        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);
        }
Beispiel #8
0
        /// <summary>Raised after the player loads a save slot and the world is initialised.</summary>
        private static void OnSaveLoaded(object sender, SaveLoadedEventArgs e)
        {
            // reset state
            IsCustomSaving       = false;
            ShouldResetSchedules = false;

            // load positions
            SaveManager.LoadData();

            SkipIntro.SetLastFile(Constants.SaveFolderName);

            if (Config.ShareOptions)
            {
                StartupPreferences options = new StartupPreferences();
                options.loadPreferences(false, false);
                Game1.options = options.clientOptions;
            }
        }