コード例 #1
0
ファイル: DistantLandForm.cs プロジェクト: mdmallardi/MGE-XE
 /* Configuration methods */
 
 // loading all settings
 private void LoadSettings() {
     INIFile iniFile = new INIFile(Statics.iniFileName, iniDLWizardVars, true);
     configure = !iniFile.hasSection(iniDLWizardSets);
     if (configure) {
         iniFile.initialize();
         iniFile.save();
     }
     pluginDirs = new List<string>(iniFile.getSectList(iniDLWizardPlugDirs));
     pluginDirs.Sort();
     string dir2 = "";
     foreach (string s in pluginDirs) {
         string dir1 = s.ToLower(Statics.Culture);
         if (dir1 == dir2) pluginDirs.Remove(s);
         dir2 = dir1;
     }
     pluginList = new MWPlugins(Statics.fn_datafiles, pluginDirs);
     switch ((int)iniFile.getKeyValue("PlugSort")) {
         case 0: rbPlugsName.Checked = true; break;
         case 1: rbPlugsType.Checked = true; break;
         case 2: rbPlugsLoad.Checked = true; break;
     }
     pluginsSort(null, null);
     preselectedPlugins = iniFile.getSectList(iniDLWizardPlugs);
     SelectPlugins(preselectedPlugins);
     cmbTexWorldResolution.SelectedIndex = (int)iniFile.getKeyValue("TexRes");
     cmbTexWorldNormalRes.SelectedIndex = (int)iniFile.getKeyValue("NormRes");
     cbTexTwoStep.Checked = (iniFile.getKeyValue("Tex2Step") == 1);
     cmbMeshWorldDetail.SelectedIndex = (int)iniFile.getKeyValue("WorldMesh");
     udStatMinSize.Value = (int)iniFile.getKeyValue("MinStat");
     udStatGrassDensity.Value = (int)iniFile.getKeyValue("GrassDens");
     cmbStatSimplifyMeshes.SelectedIndex = (int)iniFile.getKeyValue("StatMesh");
     cmbStatSkipMipLevels.SelectedIndex = (int)iniFile.getKeyValue("SkipMip");
     cbStatActivators.Checked = (iniFile.getKeyValue("Activators") == 1);
     cbStatIncludeMisc.Checked = (iniFile.getKeyValue("MiscObj") == 1);
     cbStatOverrideList.Checked = (iniFile.getKeyValue("UseStatOvr") == 1);
     cbStatIntExt.Checked = (iniFile.getKeyValue("StatIntExt") == 1);
     cbStatIntWater.Checked = (iniFile.getKeyValue("StatIntWater") == 1);
     lbStatOverrideList.Items.Clear();
     lbStatOverrideList.Items.AddRange(iniFile.getSectList(iniDLWizardStatOvr));
     lStatOverrideList.Enabled = (lbStatOverrideList.Items.Count == 0);
 }
コード例 #2
0
 /* Configuration methods */
 // loading all settings
 private void LoadSettings()
 {
     INIFile iniFile = new INIFile(Statics.iniFileName, iniDLWizardVars, true);
     configure = !iniFile.hasSection(iniDLWizardSets);
     if (configure) {
         iniFile.initialize();
         iniFile.save();
     }
     pluginDirs = new List<string>(iniFile.getSectList(iniDLWizardPlugDirs));
     pluginDirs.Sort();
     string lastdir = Statics.fn_datafiles;
     for (int i = 0; i < pluginDirs.Count; i++ ) {
         if (String.Compare(Path.GetFullPath(pluginDirs[i]), Path.GetFullPath(lastdir), true, Statics.Culture) == 0 ||
             String.Compare(Path.GetFullPath(pluginDirs[i]), Path.GetFullPath(Statics.fn_statics), true, Statics.Culture) == 0 ||
             String.Compare(Path.GetFullPath(pluginDirs[i]), Path.GetFullPath(Statics.fn_datafiles), true, Statics.Culture) == 0)
             pluginDirs.RemoveAt(i--);
         else lastdir = pluginDirs[i];
     }
     pluginDirs.Insert(0, Statics.fn_statics);
     preselectedPlugins = iniFile.getSectList(iniDLWizardPlugs);
     pluginList = new MWPlugins(Statics.fn_datafiles, pluginDirs, preselectedPlugins);
     switch ((int)iniFile.getKeyValue("PlugSort")) {
         case 0: rbPlugsName.Checked = true; break;
         case 1: rbPlugsType.Checked = true; break;
         case 2: rbPlugsLoad.Checked = true; break;
     }
     pluginsSort(null, null);
     cmbTexWorldResolution.SelectedIndex = (int)iniFile.getKeyValue("TexRes");
     cmbTexWorldNormalRes.SelectedIndex = (int)iniFile.getKeyValue("NormRes");
     cbTexTwoStep.Checked = (iniFile.getKeyValue("Tex2Step") == 1);
     cmbMeshWorldDetail.SelectedIndex = (int)iniFile.getKeyValue("WorldMesh");
     udStatMinSize.Value = (int)iniFile.getKeyValue("MinStat");
     udStatGrassDensity.Value = (int)iniFile.getKeyValue("GrassDens");
     cmbStatSimplifyMeshes.SelectedIndex = (int)iniFile.getKeyValue("StatMesh");
     cmbStatSkipMipLevels.SelectedIndex = (int)iniFile.getKeyValue("SkipMip");
     cbStatLowQualTextures.Checked = (iniFile.getKeyValue("LowQualTex") == 1);
     cbStatActivators.Checked = (iniFile.getKeyValue("Activators") == 1);
     cbStatIncludeMisc.Checked = (iniFile.getKeyValue("MiscObj") == 1);
     cbStatOldSimplification.Checked = (iniFile.getKeyValue("OldSimply") == 1);
     cbStatOverrideList.Checked = (iniFile.getKeyValue("UseStatOvr") == 1);
     cbStatIntExt.Checked = (iniFile.getKeyValue("StatIntExt") == 1);
     cbStatIntWater.Checked = (iniFile.getKeyValue("StatIntWater") == 1);
     lbStatOverrideList.Items.Clear();
     lbStatOverrideList.Items.AddRange(iniFile.getSectList(iniDLWizardStatOvr));
     lStatOverrideList.Enabled = (lbStatOverrideList.Items.Count == 0);
 }