/// <summary> /// ToolSettings.cs \\ Save map-unrelated user settings /// </summary> public void saveUserSettings() { if (!Variables.allowSaveLastMap) { return; } StreamWriter streamWriter = new StreamWriter((Stream) new FileStream(Variables.strWorkingDir + "CoD4CompileTools.settings", FileMode.Create)); streamWriter.WriteLine("tree," + Variables.strTreePath); streamWriter.WriteLine("mapname," + Variables.selectedMap_Name); streamWriter.WriteLine("developer," + StringType.FromBoolean((bool)chkDeveloper.IsChecked)); streamWriter.WriteLine("developerscript," + StringType.FromBoolean((bool)chkDeveloperScript.IsChecked)); streamWriter.WriteLine("cheats," + StringType.FromBoolean((bool)chkCheats.IsChecked)); streamWriter.WriteLine("tab," + StringType.FromInteger(compileTab.SelectedIndex)); streamWriter.WriteLine("chkCustomCommandLine," + StringType.FromBoolean((bool)chkCustomCommandLine.IsChecked)); streamWriter.WriteLine("txtCustomCommandLine," + txtCustomCommandLine.Text); streamWriter.WriteLine("moveToUsermaps," + StringType.FromBoolean(Variables.copyToUsermaps)); streamWriter.WriteLine("exeGameMp," + Variables.strGameMpName); streamWriter.WriteLine("exeRadiant," + Variables.strRadiantName); // GLSL->HLSL Syntax Converter streamWriter.WriteLine("sgen_width," + StringType.FromDouble(Variables.SyntaxConverterWidth)); streamWriter.WriteLine("sgen_height," + StringType.FromDouble(Variables.SyntaxConverterHeight)); streamWriter.WriteLine("sgen_font," + StringType.FromDouble(Variables.SyntaxConverterFontSize)); streamWriter.WriteLine("sgen_optimise," + StringType.FromBoolean(Variables.SyntaxConverterOptimise)); streamWriter.Close(); }
public void Save(XmlTextWriter xmlInfo) { ((XmlWriter)xmlInfo).WriteStartElement("Terrain"); xmlInfo.WriteAttributeString("Name", this.m_Name); xmlInfo.WriteAttributeString("ID", StringType.FromInteger(this.m_GroupID)); xmlInfo.WriteAttributeString("TileID", StringType.FromInteger((int)this.m_TileID)); xmlInfo.WriteAttributeString("R", StringType.FromByte(this.m_Color.R)); xmlInfo.WriteAttributeString("G", StringType.FromByte(this.m_Color.G)); xmlInfo.WriteAttributeString("B", StringType.FromByte(this.m_Color.B)); xmlInfo.WriteAttributeString("Base", StringType.FromByte(this.m_BaseAlt)); xmlInfo.WriteAttributeString("Random", StringType.FromBoolean(this.m_RandAlt)); xmlInfo.WriteEndElement(); }
private void SaveNewCompileSettings() { if (this.CheckSavedMap(Variables.selectedMap_Name)) { File.SetAttributes(Variables.strWorkingDir + Variables.selectedMap_Name + ".settings", FileAttributes.Normal); } StreamWriter streamWriter = new StreamWriter((Stream) new FileStream(Variables.strWorkingDir + Variables.selectedMap_Name + ".settings", FileMode.Create)); streamWriter.WriteLine("bsp," + StringType.FromBoolean((bool)chkBSP.IsChecked)); streamWriter.WriteLine("light," + StringType.FromBoolean((bool)chkLight.IsChecked)); streamWriter.WriteLine("paths," + StringType.FromBoolean((bool)chkPaths.IsChecked)); streamWriter.WriteLine("onlyents," + StringType.FromBoolean((bool)chkOnlyEnts.IsChecked)); streamWriter.WriteLine("blocksize," + StringType.FromBoolean((bool)chkBlockSize.IsChecked)); streamWriter.WriteLine("blocksize_value," + txtBlockSize.Text); streamWriter.WriteLine("samplescale," + StringType.FromBoolean((bool)chkSampleScale.IsChecked)); streamWriter.WriteLine("samplescale_value," + txtSampleScale.Text); streamWriter.WriteLine("debugLightmaps," + StringType.FromBoolean((bool)chkDebugLightMaps.IsChecked)); streamWriter.WriteLine("chkCustomCommandLineBSP," + StringType.FromBoolean((bool)chkCustomCommandLineBSP.IsChecked)); streamWriter.WriteLine("bspoptions," + this.txtBSPOptions.Text); streamWriter.WriteLine("fast," + StringType.FromBoolean((bool)chkLightFast.IsChecked)); streamWriter.WriteLine("extra," + StringType.FromBoolean((bool)chkLightExtra.IsChecked)); streamWriter.WriteLine("verbose," + StringType.FromBoolean((bool)chkLightVerbose.IsChecked)); streamWriter.WriteLine("modelshadow," + StringType.FromBoolean((bool)chkModelShadow.IsChecked)); streamWriter.WriteLine("nomodelshadow," + StringType.FromBoolean((bool)chkNoModelShadow.IsChecked)); streamWriter.WriteLine("dumpoptions," + StringType.FromBoolean((bool)chkDumpOptions.IsChecked)); streamWriter.WriteLine("traces," + StringType.FromBoolean((bool)chkTraces.IsChecked)); streamWriter.WriteLine("traces_value," + txtTraces.Text); streamWriter.WriteLine("bouncefraction," + StringType.FromBoolean((bool)chkBounceFraction.IsChecked)); streamWriter.WriteLine("bouncefraction_value," + txtBounceFraction.Text); streamWriter.WriteLine("jitter," + StringType.FromBoolean((bool)chkJitter.IsChecked)); streamWriter.WriteLine("jitter_value," + txtJitter.Text); streamWriter.WriteLine("chkCustomCommandLineLight," + StringType.FromBoolean((bool)chkCustomCommandLineLight.IsChecked)); streamWriter.WriteLine("lightoptions," + txtLightOptions.Text); streamWriter.Close(); }
public void FromBoolean(bool value, string expected) { Assert.Equal(expected, StringType.FromBoolean(value)); }
/// <summary> /// Utility.cs \\ /// </summary> public bool isMPMap(string strMapName) { return(strMapName.Length > 3 && BooleanType.FromString(Strings.LCase(StringType.FromBoolean(strMapName.StartsWith("mp_"))))); }