// saving settings after statics creation private void SaveStatSettings() { INIFile iniFile = new INIFile(Statics.iniFileName, iniStatTab, true); iniFile.setKey("MinStat", (double)udStatMinSize.Value); iniFile.setKey("GrassDens", (double)udStatGrassDensity.Value); iniFile.setKey("StatMesh", cmbStatSimplifyMeshes.SelectedIndex); iniFile.setKey("SkipMip", cmbStatSkipMipLevels.SelectedIndex); iniFile.setKey("Activators", cbStatActivators.Checked); iniFile.setKey("MiscObj", cbStatIncludeMisc.Checked); iniFile.setKey("UseStatOvr", cbStatOverrideList.Checked); iniFile.setKey("StatIntExt", cbStatIntExt.Checked); iniFile.setKey("StatIntWater", cbStatIntWater.Checked); List<string> tempList = new List<string>(); foreach (string s in lbStatOverrideList.Items) tempList.Add(s); iniFile.setSectOrderedList(iniDLWizardStatOvr, tempList.ToArray()); iniFile.save(); }
// saving settings after land texture creation private void SaveTexSettings() { INIFile iniFile = new INIFile(Statics.iniFileName, iniTexTab, true); iniFile.setKey("TexRes", cmbTexWorldResolution.SelectedIndex); iniFile.setKey("NormRes", cmbTexWorldNormalRes.SelectedIndex); iniFile.setKey("Tex2Step", cbTexTwoStep.Checked); iniFile.save(); }
// saving settings after land mesh creation private void SaveMeshSettings() { INIFile iniFile = new INIFile(Statics.iniFileName, iniMeshTab, true); iniFile.setKey("WorldMesh", (cmbMeshWorldDetail_auto ? -1 : (double)cmbMeshWorldDetail.SelectedIndex)); iniFile.save(); }
private void SaveMWINI() { INIFile mwini = new INIFile (Statics.fn_mwini, mwSettings, System.Text.Encoding.Default, true); mwini.setKey("FPSLimit", (int)udFPSLimit.Value); mwini.setKey ("SSEnable", cbScreenshots.Checked); mwini.setKey ("NoThread", !cbThreadLoad.Checked); mwini.setKey ("YesToAll", cbYesToAll.Checked); mwini.setKey ("HDShadow", cbHQShadows.Checked); mwini.setKey ("ShowFPS", cbShowFPS.Checked); mwini.setKey ("AudioOff", cbAudio.Checked); mwini.setKey ("Subtitles", cbSubtitles.Checked); mwini.setKey ("HitFader", cbHitFader.Checked); mwini.setKey("UseConstant", true); mwini.setKey("ConstantValue", Decimal.ToSingle(udLightingConst.Value)); mwini.setKey("UseLinear", true); mwini.setKey("LinearValue", Decimal.ToSingle(udLightingLinear.Value)); mwini.setKey("UseQuadratic", true); mwini.setKey("QuadraticValue", Decimal.ToSingle(udLightingQuad.Value)); mwini.save (); }
// saving settings after plugin selection private void SavePlugsSettings() { INIFile iniFile = new INIFile(Statics.iniFileName, iniPlugsTab, true); double temp; if (rbPlugsName.Checked) temp = 0; else if (rbPlugsType.Checked) temp = 1; else if (rbPlugsLoad.Checked) temp = 2; else temp = 1; iniFile.setKey("PlugSort", temp); iniFile.setSectList(iniDLWizardPlugDirs, pluginDirs.ToArray()); List<string> tempList = new List<string>(); foreach (string s in clbPlugsModList.CheckedItems) tempList.Add(s); iniFile.setSectList(iniDLWizardPlugs, tempList.ToArray()); iniFile.save(); }
private void SaveGraphicsSettings() { INIFile iniFile = new INIFile (Statics.iniFileName, iniSettings, true); // Config iniFile.setKey ("Version", Statics.versionString); iniFile.setKey ("IipSpeed", cmbTipReadSpd.SelectedIndex); iniFile.setKey ("Language", cmbUILanguage.Text); iniFile.setKey ("AutoLang", cbUILangAuto.Checked); iniFile.setKey ("DisableMGE", cbDisableMGE.Checked); // Graphics iniFile.setKey ("AntiAlias", cmbAntiAlias.SelectedIndex); iniFile.setKey ("VWait", cmbVWait.SelectedIndex); iniFile.setKey ("Refresh", cmbRefreshRate.Text); iniFile.setKey ("AnisoLvl", cmbAnisoLevel.SelectedIndex); iniFile.setKey ("LODBias", (double)udLOD.Value); iniFile.setKey ("FogMode", cmbFogMode.SelectedIndex); iniFile.setKey ("FOV", (double)udFOV.Value); iniFile.setKey ("FPSCount", cbFPSCounter.Checked); iniFile.setKey ("Messages", cbDisplayMessages.Checked); iniFile.setKey ("MsgTime", (double)udMsgsTime.Value); iniFile.setKey ("HWShader", cbHWShader.Checked); iniFile.setKey ("SSFormat", cmbSShotFormat.SelectedIndex); if (tbSShotDir.TextAlign == HorizontalAlignment.Left) iniFile.setKey ("SSDir", tbSShotDir.Text); else iniFile.setKey ("SSDir", ""); iniFile.setKey ("SSName", tbSShotName.Text); iniFile.setKey ("SSNum", (double)udSShotNum.Value); // In-game iniFile.setKey ("DisableMWSE", cbDisableMWSE.Checked); iniFile.setKey ("HDRTime", (double)udHDR.Value); iniFile.setKey ("Cam3rdCustom", cbCam3rdPrsn.Checked); iniFile.setKey ("Cam3rdX", (double)udCam3rdX.Value); iniFile.setKey ("Cam3rdY", (double)udCam3rdY.Value); iniFile.setKey ("Cam3rdZ", (double)udCam3rdZ.Value); iniFile.setKey ("AutoCrosshair", cbAutoCrosshair.Checked); iniFile.setKey ("MenuCaching", cbMenuCaching.Checked); // Distant Land iniFile.setKey ("DistLand", cbDLDistantLand.Checked); iniFile.setKey ("DistStat", cbDLDistantStatics.Checked); iniFile.setKey ("DrawDist", (double)udDLDrawDist.Value); iniFile.setKey ("AutoDist", cbDLAutoDist.Checked); iniFile.setKey ("AutoDistBy", rbDLAutoByAFogEnd.Checked ? 2 : 1); iniFile.setKey ("EndNear", (double)udDLDistNear.Value); iniFile.setKey ("EndFar", (double)udDLDistFar.Value); iniFile.setKey ("EndVFar", (double)udDLDistVeryFar.Value); iniFile.setKey ("SizeFar", (double)udDLSizeFar.Value); iniFile.setKey ("SizeVFar", (double)udDLSizeVeryFar.Value); iniFile.setKey ("ReflLand", cbDLReflLand.Checked); iniFile.setKey ("ReflNear", cbDLReflNStatics.Checked); iniFile.setKey ("ReflIntr", cbDLReflInterior.Checked); iniFile.setKey ("SkyRefl", cbDLSkyRefl.Checked); iniFile.setKey ("ReflBlur", cbDLReflBlur.Checked); iniFile.setKey ("DynRipples", cbDLDynRipples.Checked); iniFile.setKey ("WaveHght", (double)udDLWtrWave.Value); iniFile.setKey ("Caustics", (double)udDLWtrCaust.Value); iniFile.setKey ("AboveBeg", (double)udDLFogAStart.Value); iniFile.setKey ("AboveEnd", (double)udDLFogAEnd.Value); iniFile.setKey ("BelowBeg", (double)udDLFogBStart.Value); iniFile.setKey ("BelowEnd", (double)udDLFogBEnd.Value); iniFile.setKey ("InterBeg", (double)udDLFogIStart.Value); iniFile.setKey ("InterEnd", (double)udDLFogIEnd.Value); iniFile.setKey ("ExpFog", cbDLFogExp.Checked); iniFile.setKey ("DLExpMul", (double)udDLFogExpMul.Value); iniFile.setKey ("Scatter", cbDLScattering.Checked); iniFile.setKey ("SunShadows", cbDLSunShadows.Checked); iniFile.setKey ("PPLighting", cbPerPixelLighting.Checked); iniFile.save (); try { RegistryKey key = Registry.LocalMachine.OpenSubKey (Statics.reg_mw, true); if (key != null) { key.SetValue ("Pixelshader", new byte [] { Convert.ToByte (cbDisableMGE.Checked) }); key.Close (); } } catch { } }
private void bSave_Click(object sender, EventArgs e) { INIFile iniFile = new INIFile(Statics.iniFileName, iniWeatherSettings, true); iniFile.initialize(); foreach (Control ctl in this.Controls["gbWind"].Controls) { if (ctl.Name.Substring(0, 2) != "ud") continue; NumericUpDown ud = (NumericUpDown)ctl; iniFile.setKey(ud.Name.Substring(2), (double)ud.Value); } foreach (Control ctl in this.Controls["gbFogDay"].Controls) { if (ctl.Name.Substring(0, 2) != "ud") continue; NumericUpDown ud = (NumericUpDown)ctl; iniFile.setKey(ud.Name.Substring(2), (double)ud.Value); } foreach (Control ctl in this.Controls["gbFogOffsDay"].Controls) { if (ctl.Name.Substring(0, 2) != "ud") continue; NumericUpDown ud = (NumericUpDown)ctl; iniFile.setKey(ud.Name.Substring(2), (double)ud.Value); } iniFile.save(); Close(); }
private void SaveMWINI() { INIFile mwini = new INIFile (Statics.fn_mwini, mwSettings, System.Text.Encoding.Default, true); mwini.setKey ("SSEnable", cbScreenshots.Checked); mwini.setKey ("NoThread", !cbThreadLoad.Checked); mwini.setKey ("YesToAll", cbYesToAll.Checked); mwini.setKey ("HDShadow", cbHQShadows.Checked); mwini.setKey ("ShowFPS", cbShowFPS.Checked); mwini.setKey ("AudioOff", cbAudio.Checked); mwini.setKey ("Subtitles", cbSubtitles.Checked); mwini.setKey ("HitFader", cbHitFader.Checked); mwini.setKey ("MultiCS", cbMultipleCS.Checked); mwini.save (); }
private void SaveGraphicsSettings() { INIFile iniFile = new INIFile (Statics.iniFileName, iniSettings, true); //Main iniFile.setKey ("Version", Statics.versionString); iniFile.setKey ("IipSpeed", cmbTipReadSpd.SelectedIndex); iniFile.setKey ("Language", cmbUILanguage.Text); iniFile.setKey ("AutoLang", cbUILangAuto.Checked); //MGE disabled iniFile.setKey ("DisableMGE", cbDisableMGE.Checked); //Global Graphics iniFile.setKey ("AntiAlias", cmbAntiAlias.SelectedIndex); iniFile.setKey ("ZBuffer", cmbZBuffer.SelectedIndex); iniFile.setKey ("VWait", cmbVWait.SelectedIndex); iniFile.setKey ("Refresh", cmbRefreshRate.Text); //Render State iniFile.setKey ("ScaleFilt", cmbScaleFilter.SelectedIndex); iniFile.setKey ("MipFilt", cmbMipFilter.SelectedIndex); iniFile.setKey ("AnisoLvl", cmbAnisoLevel.SelectedIndex); iniFile.setKey ("LODBias", (double)udLOD.Value); iniFile.setKey ("FogMode", cmbFogMode.SelectedIndex); iniFile.setKey ("InitZoom", (double)udZoom.Value); iniFile.setKey ("ScrRot", (double)udRotation.Value); iniFile.setKey ("FOV", (double)udFOV.Value); iniFile.setKey ("UseFog", cbFog.Checked); iniFile.setKey ("FPSCount", cbFPSCounter.Checked); iniFile.setKey ("Messages", cbDisplayMessages.Checked); iniFile.setKey ("MsgTime", (double)udMsgsTime.Value); iniFile.setKey ("HWShader", cbHWShader.Checked); iniFile.setKey("DisableShadersInMenu", cbDisableShadersInMenu.Checked); iniFile.setKey ("AAFix", cbAAFix.Checked); iniFile.setKey ("SSFormat", cmbSShotFormat.SelectedIndex); if (tbSShotDir.TextAlign == HorizontalAlignment.Left) iniFile.setKey ("SSDir", tbSShotDir.Text); else iniFile.setKey ("SSDir", ""); iniFile.setKey ("SSName", tbSShotName.Text); iniFile.setKey ("SSNum", (double)udSShotNum.Value); //Input iniFile.setKey ("LagFix", cbLagFix.Checked); //Misc iniFile.setKey ("DisableMWSE", cbDisableMWSE.Checked); iniFile.setKey ("DisableMWE", cbDisableMWE.CheckState == CheckState.Checked); iniFile.setKey ("DisableIntegration", cbDisableIntegration.Checked); iniFile.setKey ("DisablePatch", cbDisablePatch.Checked); iniFile.setKey ("AffectUI", cbZoomEffectsHUD.Checked); iniFile.setKey ("AspectZoom", cbAspectZoom.Checked); iniFile.setKey ("HookTex", cbHook.Checked); iniFile.setKey ("ShaderVars", cbSetEffectVars.Checked); iniFile.setKey ("ShaderDepth", cbShaderDepth.Checked); iniFile.setKey ("UseHDR", cbHDR.Checked); iniFile.setKey ("HDRTime", (double)udHDR.Value); iniFile.setKey ("KeepFPS", cbFPSConst.Checked); iniFile.setKey ("FPSDesired", (double)udFPSDes.Value); iniFile.setKey ("FPSToler", (double)udFPSTol.Value); iniFile.setKey ("MaxMWView", (double)udMaxView.Value); iniFile.setKey ("MinMWView", (double)udMinView.Value); iniFile.setKey ("AIToMWView", cbBindAI.Checked); iniFile.setKey ("CPUIdle", cbIdle.Checked); iniFile.setKey ("IdleTime", (double)udIdle.Value); iniFile.setKey ("Cam3rdCustom", cbCam3rdPrsn.Checked); iniFile.setKey ("Cam3rdX", (double)udCam3rdX.Value); iniFile.setKey ("Cam3rdY", (double)udCam3rdY.Value); iniFile.setKey ("Cam3rdZ", (double)udCam3rdZ.Value); //Distant Land iniFile.setKey ("DistLand", cbDLDistantLand.Checked); iniFile.setKey ("DistStat", cbDLDistantStatics.Checked); iniFile.setKey ("DLShader", rbDLSM30.Checked ? 3 : 2); foreach (KeyValuePair<string, bool> v in DLOptions) iniFile.setKey (v.Key, v.Value); iniFile.setKey ("DrawDist", (double)udDLDrawDist.Value); iniFile.setKey ("AutoDist", cbDLAutoDist.Checked); int autoDistBy; if (rbDLAutoByAFogEnd.Checked) autoDistBy = 2; else autoDistBy = 1; iniFile.setKey ("AutoDistBy", autoDistBy); //iniFile.setKey ("DistBlur", (double)udDLBlur.Value); //removed iniFile.setKey ("EndNear", (double)udDLDistNear.Value); iniFile.setKey ("EndFar", (double)udDLDistFar.Value); iniFile.setKey ("EndVFar", (double)udDLDistVeryFar.Value); iniFile.setKey ("SizeFar", (double)udDLSizeFar.Value); iniFile.setKey ("SizeVFar", (double)udDLSizeVeryFar.Value); iniFile.setKey ("ReflLand", cbDLReflLand.Checked); iniFile.setKey ("ReflNear", cbDLReflNStatics.Checked); iniFile.setKey ("ReflFar", cbDLReflFStatics.Checked); iniFile.setKey ("SkyRefl", cbDLSkyRefl.Checked); iniFile.setKey ("ReflBlur", cbDLReflBlur.Checked); iniFile.setKey ("DynRipples", cbDLDynRipples.Checked); iniFile.setKey ("WaveHght", (double)udDLWtrWave.Value); iniFile.setKey ("Caustics", (double)udDLWtrCaust.Value); iniFile.setKey ("AboveBeg", (double)udDLFogAStart.Value); iniFile.setKey ("AboveEnd", (double)udDLFogAEnd.Value); iniFile.setKey ("BelowBeg", (double)udDLFogBStart.Value); iniFile.setKey ("BelowEnd", (double)udDLFogBEnd.Value); iniFile.setKey ("InterBeg", (double)udDLFogIStart.Value); iniFile.setKey ("InterEnd", (double)udDLFogIEnd.Value); iniFile.setKey ("ExpFog", cbDLFogExp.Checked); iniFile.setKey ("DLExpMul", (double)udDLFogExpMul.Value); //Tools iniFile.setKey("PTreeWidth", (double)PatchTreeSize.Width); iniFile.setKey("PTreeHeight", (double)PatchTreeSize.Height); iniFile.setKey("PEditorWidth", (double)PatchEditorSize.Width); iniFile.setKey("PEditorHeight", (double)PatchEditorSize.Height); iniFile.setKey("PEditorBarW", (double)PatchEditorBars.Width); iniFile.setKey("PEditorBarH", (double)PatchEditorBars.Height); iniFile.save (); try { RegistryKey key = Statics.reg_key_bethesda.OpenSubKey(Statics.reg_morrowind, true); if (key != null) { key.SetValue ("Pixelshader", new byte [] { Convert.ToByte (!gbDistantLand.Enabled) }); key.Close (); } } catch { } }
// saving settings after plugin selection private void SavePlugsSettings() { INIFile iniFile = new INIFile(Statics.iniFileName, iniPlugsTab, true); iniFile.setKey("PlugSort", rbPlugsName.Checked ? 0d : rbPlugsType.Checked ? 1d : rbPlugsLoad.Checked ? 2d : 2d); List<String> items = new List<String>(pluginDirs); for (int i = 0; i < items.Count; i++) if (String.Compare(Path.GetFullPath(items[i]), Path.GetFullPath(Statics.fn_statics), true, Statics.Culture) == 0) items.RemoveAt(i--); iniFile.setSectList(iniDLWizardPlugDirs, items.ToArray()); List<String> checkeditems = new List<String>(); foreach (String item in clbPlugsModList.CheckedItems) if (pluginList.Plugins[item.ToLower(Statics.Culture)].Checked == CheckState.Checked) checkeditems.Add(item); iniFile.setSectList(iniDLWizardPlugs, checkeditems.ToArray()); iniFile.save(); }