//lz-2016.07.28 因为吴怡秋把草的距离等级判定改为三个了,所以这里加入草的距离等级和选项下标互相转换的方法 int ConvertGrassLodToIndex(RedGrass.ELodType loadType) { switch (loadType) { case RedGrass.ELodType.LOD_1_TYPE_1: return(0); case RedGrass.ELodType.LOD_2_TYPE_2: return(1); case RedGrass.ELodType.LOD_3_TYPE_1: return(2); default: return(2); } }
void SetSystemData(XmlDocument xmlDoc) { //Video // XmlNodeList nodelist = xmlDoc.DocumentElement.ChildNodes; XmlElement findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("QualityLevel"); if (null != findNode) { mQualityLevel = Convert.ToInt32(findNode.GetAttribute("Index")); } findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("LightCount"); if (null != findNode) { mLightCount = Convert.ToInt32(findNode.GetAttribute("Index")); } findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("AnisotropicFiltering"); if (null != findNode) { mAnisotropicFiltering = Convert.ToInt32(findNode.GetAttribute("Index")); } findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("AntiAliasing"); if (null != findNode) { mAntiAliasing = Convert.ToInt32(findNode.GetAttribute("Index")); } findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("ShadowProjection"); if (null != findNode) { mShadowProjection = Convert.ToInt32(findNode.GetAttribute("Index")); } findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("ShadowDistance"); if (null != findNode) { mShadowDistance = Convert.ToInt32(findNode.GetAttribute("Index")); } findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("ShadowCascades"); if (null != findNode) { mShadowCascades = Convert.ToInt32(findNode.GetAttribute("Index")); } findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("mWaterReflection"); if (null != findNode) { mWaterReflection = Convert.ToInt32(findNode.GetAttribute("Index")); } findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("WaterRefraction"); if (null != findNode) { WaterRefraction = Convert.ToBoolean(findNode.GetAttribute("Index")); } findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("WaterDepth"); if (null != findNode) { WaterDepth = Convert.ToBoolean(findNode.GetAttribute("Index")); } findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("GrassDensity"); if (null != findNode) { GrassDensity = Convert.ToSingle(findNode.GetAttribute("Index")); } findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("GrassLod"); if (null != findNode) { mGrassLod = (RedGrass.ELodType)Convert.ToInt32(findNode.GetAttribute("Index")); } findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("Terrain"); if (null != findNode) { TerrainLevel = Convert.ToByte(findNode.GetAttribute("Index")); } findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("RandomTerrain"); if (null != findNode) { RandomTerrainLevel = Convert.ToByte(findNode.GetAttribute("Index")); } findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("Tree"); if (null != findNode) { mTreeLevel = Convert.ToInt32(findNode.GetAttribute("Index")); } findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("HDREffect"); if (null != findNode) { HDREffect = Convert.ToBoolean(findNode.GetAttribute("Index")); } findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("FastLightingMode"); if (null != findNode) { mFastLightingMode = Convert.ToBoolean(findNode.GetAttribute("Index")); } findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("Sound"); if (null != findNode) { SoundVolume = Convert.ToSingle(findNode.GetAttribute("Volume")); } findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("Music"); if (null != findNode) { MusicVolume = Convert.ToSingle(findNode.GetAttribute("Volume")); } findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("Dialog"); if (null != findNode) { DialogVolume = Convert.ToSingle(findNode.GetAttribute("Volume")); } findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("Effect"); if (null != findNode) { EffectVolume = Convert.ToSingle(findNode.GetAttribute("Volume")); } if (xmlDoc.DocumentElement.HasAttribute("Version") && xmlDoc.DocumentElement.GetAttribute("Version") == mVersion) { findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("mMMOControlType"); if (null != findNode) { mMMOControlType = Convert.ToBoolean(findNode.GetAttribute("value")); } } else { mMMOControlType = false; } findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("UseController"); if (null != findNode) { UseController = Convert.ToBoolean(findNode.GetAttribute("value")); } findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("FirstPersonCtrl"); if (null != findNode) { FirstPersonCtrl = Convert.ToBoolean(findNode.GetAttribute("value")); } findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("CameraSensitivity"); if (null != findNode) { cameraSensitivity = Convert.ToSingle(findNode.GetAttribute("value")); } findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("HoldGunCameraSensitivity"); if (null != findNode) { holdGunCameraSensitivity = Convert.ToSingle(findNode.GetAttribute("value")); } findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("CameraFov"); if (null != findNode) { CameraFov = Convert.ToSingle(findNode.GetAttribute("value")); } findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("CameraHorizontalInverse"); if (null != findNode) { CameraHorizontalInverse = Convert.ToBoolean(findNode.GetAttribute("value")); } findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("CameraVerticalInverse"); if (null != findNode) { CameraVerticalInverse = Convert.ToBoolean(findNode.GetAttribute("value")); } findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("HideHeadgear"); if (null != findNode) { HideHeadgear = Convert.ToBoolean(findNode.GetAttribute("value")); } findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("HPNumbers"); if (null != findNode) { HPNumbers = Convert.ToBoolean(findNode.GetAttribute("value")); } findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("ClipCursor"); if (null != findNode) { ClipCursor = Convert.ToBoolean(findNode.GetAttribute("value")); } findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("ApplyMonsterIK"); if (null != findNode) { ApplyMonsterIK = Convert.ToBoolean(findNode.GetAttribute("value")); } findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("SyncCount"); if (null != findNode) { SyncCount = Convert.ToBoolean(findNode.GetAttribute("value")); } findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("VoxelCache"); if (null != findNode) { VoxelCacheEnabled = Convert.ToBoolean(findNode.GetAttribute("value")); } findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("DepthBlur"); if (null != findNode) { mDepthBlur = Convert.ToBoolean(findNode.GetAttribute("value")); } findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("CamInertia"); if (null != findNode) { CamInertia = Convert.ToSingle(findNode.GetAttribute("value")); } findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("DriveCamInertia"); if (null != findNode) { DriveCamInertia = Convert.ToSingle(findNode.GetAttribute("value")); } findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("SSAO"); if (null != findNode) { mSSAO = Convert.ToBoolean(findNode.GetAttribute("value")); } findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("AttackWhithMouseDir"); if (null != findNode) { AttackWhithMouseDir = Convert.ToBoolean(findNode.GetAttribute("value")); } findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("Tutorialed"); if (null != findNode) { Tutorialed = Convert.ToBoolean(findNode.GetAttribute("value")); } findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("GLSetting"); if (null != findNode) { GLSetting = findNode.GetAttribute("value"); } findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("FixBlurryFont"); if (null != findNode) { FixBlurryFont = Convert.ToBoolean(findNode.GetAttribute("value")); } findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("AndyGuidance"); if (null != findNode) { AndyGuidance = Convert.ToBoolean(findNode.GetAttribute("value")); } findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("MouseStateTip"); if (null != findNode) { MouseStateTip = Convert.ToBoolean(findNode.GetAttribute("value")); } findNode = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("HidePlayerOverHeadInfo"); if (null != findNode) { HidePlayerOverHeadInfo = Convert.ToBoolean(findNode.GetAttribute("value")); } PeInput.LoadInputConfig(mFilepath); ApplySettings(); }