예제 #1
0
        //For verifying settings in the settings tab
        private void UpdateSettingsTab()
        {
            txtGamePath.Text = Setup.GamePath;

            lblStatusGamePath.Text = "Game path: " + (Setup.CheckGameDir() ? "OK." : "MISSING!");
            lblStatusBackup.Text   = "Game backups: " + (Setup.CheckBackups() ? "OK." : "MISSING!");

            chkModsReplaceSkins.Checked   = Settings.Check("ModsReplaceDefaultSkins", "True");
            chkModConfigAutosave.Checked  = Settings.Check("ModConfigAutosave", "True");
            chkSkinConfigAutosave.Checked = Settings.Check("SkinConfigAutosave", "True");
        }
예제 #2
0
        //Extracts the original skins from the backups
        private void ExtractDefaultSkins()
        {
            Setup setup = Program.mainForm.Setup;

            if (setup.CheckBackups() == false)
            {
                Msg.Log("Failed to extract default skins.");
                string message = "Patchlunky is missing Spelunky backups!" +
                                 Environment.NewLine + Environment.NewLine +
                                 "Patchlunky character skins will not work without backups.";
                Msg.MsgBox(message, "Patchlunky");
                return; //Backups are missing, can't extract.
            }

            Archive alltex = new Archive(setup.BackupPath + "Textures/alltex.wad");

            alltex.Load();

            var group = alltex.Groups.Find(o => o.Name.Equals("PLAYERS"));

            if (group.Equals(default(SpelunkyWad.Group)))
            {
                return; //Group not found
            }
            string dirpath = setup.BackupPath + "Characters/";

            Directory.CreateDirectory(dirpath);

            foreach (var entry in group.Entries)
            {
                string filepath = Path.Combine(dirpath, entry.Name);
                File.WriteAllBytes(filepath, entry.Data);
            }
        }
예제 #3
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            Msg.Log(this.Text + " started.");

            Settings = new Settings();
            Setup = new Setup();
            ModMan = new ModManager();
            SkinMan = new SkinManager();

            //Check if Patchlunky Setup should run
            if ( (Setup.CheckBackups() == false) || 
                 (Setup.CheckGameDir() == false) )
                Setup.DoSetup();

            //DebugPrintSettings();

            ModMan.LoadAllMods();
            SkinMan.LoadAllSkins();

            ModMan.LoadConfigList();            
            SkinMan.LoadConfigList();
            //ModMan.LoadConfig("Default");
            //SkinMan.LoadConfig("Default");

            UpdateModList();            
            UpdateModConfigList();

            UpdateCharacterList();
            UpdateSkinList();
            UpdateSkinConfigList();

            UpdateSettingsTab();
        }
예제 #4
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            Msg.Log(this.Text + " started.");

            Settings = new Settings();
            Setup    = new Setup();
            ModMan   = new ModManager();
            SkinMan  = new SkinManager();

            //Check if Patchlunky Setup should run
            if ((Setup.CheckBackups() == false) ||
                (Setup.CheckGameDir() == false))
            {
                Setup.DoSetup();
            }

            //DebugPrintSettings();

            ModMan.LoadAllMods();
            SkinMan.LoadAllSkins();

            ModMan.LoadConfigList();
            SkinMan.LoadConfigList();
            //ModMan.LoadConfig("Default");
            //SkinMan.LoadConfig("Default");

            UpdateModList();
            UpdateModConfigList();

            UpdateCharacterList();
            UpdateSkinList();
            UpdateSkinConfigList();

            UpdateSettingsTab();
        }