Exemplo n.º 1
0
 private void lbPresetPaths_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     if (KRP.ReadKRP((lbPresetPaths.SelectedItem as FileInfo).OpenRead()))
     {
         MessageBox.Show(Properties.Resources.MsgPresetLoaded);
     }
 }
Exemplo n.º 2
0
        private void LogCurrentSettings()
        {
            string path = Path.Combine(Environment.CurrentDirectory, "current.krp");

            if (File.Exists(path))
            {
                File.Delete(path);
            }
            KRP.WriteKRP(File.OpenWrite(path));
        }
Exemplo n.º 3
0
 private void bload_Click(object sender, EventArgs e)
 {
     if (ofdPresets.ShowDialog() == DialogResult.OK)
     {
         if (!Properties.Settings.Default.PresetPaths.Contains(ofdPresets.FileName))
         {
             Properties.Settings.Default.PresetPaths.Add(ofdPresets.FileName);
         }
         update_listBox();
         if (KRP.ReadKRP(ofdPresets.OpenFile()))
         {
             MessageBox.Show(Properties.Resources.MsgPresetLoaded);
         }
     }
 }
Exemplo n.º 4
0
        public PresetForm(string fn = "")
        {
            InitializeComponent();

            foreach (string s in Properties.Settings.Default.PresetPaths)
            {
                if (!File.Exists(s))
                {
                    Properties.Settings.Default.PresetPaths.Remove(s);
                    continue;
                }
                PresetPaths.Add(new FileInfo(s));
            }
            lbPresetPaths.DataSource    = PresetPaths;
            lbPresetPaths.DisplayMember = "Name";

            if (fn != "" && File.Exists(fn))
            {
                if (!Properties.Settings.Default.PresetPaths.Contains(fn))
                {
                    Properties.Settings.Default.PresetPaths.Add(fn);
                }
                update_listBox();
                if (KRP.ReadKRP(File.OpenRead(fn)))
                {
                    MessageBox.Show(Properties.Resources.MsgPresetLoaded);
                }
            }

            cbIncModu.Checked    = Properties.Settings.Default.DoRandomization_Module;
            cbIncItem.Checked    = Properties.Settings.Default.DoRandomization_Item;
            cbIncSound.Checked   = Properties.Settings.Default.DoRandomization_Sound;
            cbIncModel.Checked   = Properties.Settings.Default.DoRandomization_Model;
            cbIncTexture.Checked = Properties.Settings.Default.DoRandomization_Texture;
            cbInc2da.Checked     = Properties.Settings.Default.DoRandomization_TwoDA;
            cbIncText.Checked    = Properties.Settings.Default.DoRandomization_Text;
            cbIncOther.Checked   = Properties.Settings.Default.DoRandomization_Other;
        }
Exemplo n.º 5
0
        private void bsave_Click(object sender, EventArgs e)
        {
            // Category Booleans
            Properties.Settings.Default.DoRandomization_Module  = cbIncModu.Checked;
            Properties.Settings.Default.DoRandomization_Item    = cbIncItem.Checked;
            Properties.Settings.Default.DoRandomization_Sound   = cbIncSound.Checked;
            Properties.Settings.Default.DoRandomization_Model   = cbIncModel.Checked;
            Properties.Settings.Default.DoRandomization_Texture = cbIncTexture.Checked;
            Properties.Settings.Default.DoRandomization_TwoDA   = cbInc2da.Checked;
            Properties.Settings.Default.DoRandomization_Text    = cbIncText.Checked;
            Properties.Settings.Default.DoRandomization_Other   = cbIncOther.Checked;

            if (sfdPresets.ShowDialog() == DialogResult.OK)
            {
                KRP.WriteKRP(sfdPresets.OpenFile());

                if (!Properties.Settings.Default.PresetPaths.Contains(sfdPresets.FileName))
                {
                    Properties.Settings.Default.PresetPaths.Add(sfdPresets.FileName);
                }
                update_listBox();
            }
        }