public static void ResetGraphics() { if (IsEnabled) { Current = new CFG(); GFX.LODMode = LODMode.Automatic; GFX.LOD1Distance = 200; GFX.LOD2Distance = 400; GFX.EnableFrustumCulling = false; GFX.EnableTextures = true; GFX.Wireframe = false; //GFX.EnableLighting = true; //GFX.TestLightSpin = false; //GFX.EnableHeadlight = true; DBG.ShowModelNames = true; DBG.ShowModelBoundingBoxes = false; DBG.ShowModelSubmeshBoundingBoxes = false; DBG.ShowPrimitiveNametags = true; DBG.PrimitiveNametagSize = 0.1f; DBG.ShowGrid = true; //DBG.SimpleTextLabelSize = true; GFX.World.FieldOfView = 43; GFX.World.NearClipDistance = 0.1f; GFX.World.FarClipDistance = 10000f; Save(); Load(); } }
public static void Load() { if (IsEnabled) { lock (_lock_SaveLoadCFG) { Current = Newtonsoft.Json.JsonConvert.DeserializeObject <CFG>( File.ReadAllText(GetConfigFilePath())); //InterrootLoader.Interroot = Current.InterrootLoader_Interroot; //InterrootLoader.Type = Current.InterrootLoader_Type; GFX.LODMode = Current.GFX_LODMode; GFX.LOD1Distance = Current.GFX_LOD1Distance; GFX.LOD2Distance = Current.GFX_LOD2Distance; GFX.EnableFrustumCulling = Current.GFX_EnableFrustumCulling; GFX.EnableTextures = Current.GFX_EnableTextures; GFX.Wireframe = Current.GFX_Wireframe; //GFX.EnableLighting = Current.GFX_EnableLighting; //GFX.TestLightSpin = Current.GFX_TestLightSpin; //GFX.EnableHeadlight = Current.GFX_EnableHeadlight; DBG.ShowModelNames = Current.DBG_ShowModelNames; DBG.ShowModelBoundingBoxes = Current.DBG_ShowModelBoundingBoxes; DBG.ShowModelSubmeshBoundingBoxes = Current.DBG_ShowModelSubmeshBoundingBoxes; DBG.ShowPrimitiveNametags = Current.DBG_ShowPrimitiveNametags; //DBG.PrimitiveNametagSize = Current.DBG_PrimitiveNametagSize; DBG.ShowGrid = Current.DBG_ShowGrid; //DBG.SimpleTextLabelSize = Current.DBG_SimpleTextLabelSize; GFX.World.CameraMoveSpeed = Current.GFX_World_CameraMoveSpeed; GFX.World.CameraTurnSpeedGamepad = Current.GFX_World_CameraTurnSpeedGamepad; GFX.World.CameraTurnSpeedMouse = Current.GFX_World_CameraTurnSpeedMouse; GFX.World.FieldOfView = Current.GFX_World_FieldOfView; GFX.World.NearClipDistance = Current.GFX_World_NearClipDistance; GFX.World.FarClipDistance = Current.GFX_World_FarClipDistance; GFX.Display.Width = Current.GFX_Display_Width; GFX.Display.Height = Current.GFX_Display_Height; GFX.Display.Format = Current.GFX_Display_Format; GFX.Display.Vsync = Current.GFX_Display_Vsync; GFX.Display.Fullscreen = Current.GFX_Display_Fullscreen; GFX.Display.SimpleMSAA = Current.GFX_Display_SimpleMSAA; GFX.Display.Apply(); } } }
public static void AttemptLoadOrDefault() { if (IsEnabled) { if (File.Exists(GetConfigFilePath())) { Load(); } else { Current = new CFG(); ResetControls(); ResetGraphics(); ResetDisplay(); Save(); } } }