public static void load() { FilterSettings.load(); PlaySettings.load(); GraphicsSettings.load(); ControlsSettings.load(); OptionsSettings.load(); MenuSettings.hasLoaded = true; }
public static void save() { if (!MenuSettings.hasLoaded) { return; } FilterSettings.save(); PlaySettings.save(); GraphicsSettings.save(); ControlsSettings.save(); OptionsSettings.save(); }
private void Start() { if (!Dedicator.isDedicated) { this.title = base.transform.parent.FindChild("Title"); this.play = base.transform.parent.FindChild("Play"); this.survivors = base.transform.parent.FindChild("Survivors"); this.configuration = base.transform.parent.FindChild("Configuration"); this.workshop = base.transform.parent.FindChild("Workshop"); MenuUI.window = new SleekWindow(); MenuUI.container = new Sleek(); MenuUI.container.sizeScale_X = 1f; MenuUI.container.sizeScale_Y = 1f; MenuUI.window.add(MenuUI.container); MenuUI.alertBox = new SleekBox(); MenuUI.alertBox.positionOffset_X = 10; MenuUI.alertBox.positionOffset_Y = -25; MenuUI.alertBox.positionScale_X = 1f; MenuUI.alertBox.positionScale_Y = 0.5f; MenuUI.alertBox.sizeScale_X = 1f; MenuUI.alertBox.sizeOffset_X = -20; MenuUI.alertBox.sizeOffset_Y = 50; MenuUI.alertBox.fontSize = 14; MenuUI.window.add(MenuUI.alertBox); MenuUI.originLabel = new SleekLabel(); MenuUI.originLabel.sizeOffset_Y = 50; MenuUI.originLabel.sizeScale_X = 1f; MenuUI.originLabel.fontSize = 18; MenuUI.alertBox.add(MenuUI.originLabel); MenuUI.originLabel.isVisible = false; MenuUI.packageButton = new SleekInventory(); MenuUI.packageButton.positionOffset_X = -100; MenuUI.packageButton.positionOffset_Y = 75; MenuUI.packageButton.positionScale_X = 0.5f; MenuUI.packageButton.sizeOffset_X = 200; MenuUI.packageButton.sizeOffset_Y = 200; MenuUI.alertBox.add(MenuUI.packageButton); MenuUI.packageButton.isVisible = false; OptionsSettings.apply(); GraphicsSettings.apply(); new MenuDashboardUI(); if (MenuUI.hasPanned && this.title != null) { base.transform.position = this.title.position; base.transform.rotation = this.title.rotation; } MenuUI.hasPanned = true; } }
private void Start() { EditorUI.window = new SleekWindow(); base.GetComponent <Camera>().depthTextureMode |= 1; OptionsSettings.apply(); GraphicsSettings.apply(); new EditorDashboardUI(); EditorUI.messageBox = new SleekBox(); EditorUI.messageBox.positionOffset_X = -150; EditorUI.messageBox.positionOffset_Y = -60; EditorUI.messageBox.positionScale_X = 0.5f; EditorUI.messageBox.positionScale_Y = 1f; EditorUI.messageBox.sizeOffset_X = 300; EditorUI.messageBox.sizeOffset_Y = 50; EditorUI.messageBox.fontSize = 14; EditorUI.window.add(EditorUI.messageBox); EditorUI.messageBox.isVisible = false; }
public static void load() { OptionsSettings.restoreDefaults(); if (ReadWrite.fileExists("/Options.dat", true)) { Block block = ReadWrite.readBlock("/Options.dat", true, 0); if (block != null) { byte b = block.readByte(); if (b > 2) { OptionsSettings.music = block.readBoolean(); if (b < 20) { OptionsSettings.timer = false; } else { OptionsSettings.timer = block.readBoolean(); } if (b < 10) { block.readBoolean(); } if (b > 7) { OptionsSettings.fov = block.readSingle(); } else { OptionsSettings.fov = block.readSingle() * 0.5f; } if (b < 24) { OptionsSettings.fov *= 1.5f; OptionsSettings.fov = Mathf.Clamp01(OptionsSettings.fov); } if (b > 4) { OptionsSettings.volume = block.readSingle(); } else { OptionsSettings.volume = 1f; } if (b > 22) { OptionsSettings.voice = block.readSingle(); } else { OptionsSettings.voice = 1f; } OptionsSettings.debug = block.readBoolean(); OptionsSettings.gore = block.readBoolean(); OptionsSettings.filter = block.readBoolean(); OptionsSettings.chatText = block.readBoolean(); if (b > 8) { OptionsSettings.chatVoiceIn = block.readBoolean(); } else { OptionsSettings.chatVoiceIn = true; } OptionsSettings.chatVoiceOut = block.readBoolean(); OptionsSettings.metric = block.readBoolean(); if (b > 24) { OptionsSettings.talk = block.readBoolean(); } else { OptionsSettings.talk = false; } if (b > 3) { OptionsSettings.hints = block.readBoolean(); } else { OptionsSettings.hints = true; } if (b > 13) { OptionsSettings.ambience = block.readBoolean(); } else { OptionsSettings.ambience = true; } if (b > 12) { OptionsSettings.proUI = block.readBoolean(); } else { OptionsSettings.proUI = true; } if (b > 20) { OptionsSettings.hitmarker = block.readBoolean(); } else { OptionsSettings.hitmarker = false; } if (b > 21) { OptionsSettings.streamer = block.readBoolean(); } else { OptionsSettings.streamer = false; } if (b > 25) { OptionsSettings.featuredWorkshop = block.readBoolean(); } else { OptionsSettings.featuredWorkshop = true; } if (b > 28) { OptionsSettings.matchmakingShowAllMaps = block.readBoolean(); } else { OptionsSettings.matchmakingShowAllMaps = false; } if (b > 27) { OptionsSettings.minMatchmakingPlayers = block.readInt32(); } else { OptionsSettings.minMatchmakingPlayers = 12; } if (b > 26) { OptionsSettings.maxMatchmakingPing = block.readInt32(); } else { OptionsSettings.maxMatchmakingPing = 300; } if (b > 6) { OptionsSettings.crosshairColor = block.readColor(); OptionsSettings.hitmarkerColor = block.readColor(); OptionsSettings.criticalHitmarkerColor = block.readColor(); OptionsSettings.cursorColor = block.readColor(); } else { OptionsSettings.crosshairColor = Color.white; OptionsSettings.hitmarkerColor = Color.white; OptionsSettings.criticalHitmarkerColor = Color.red; OptionsSettings.cursorColor = Color.white; } if (b > 18) { OptionsSettings.backgroundColor = block.readColor(); OptionsSettings.foregroundColor = block.readColor(); OptionsSettings.fontColor = block.readColor(); } else { OptionsSettings.backgroundColor = new Color(0.9f, 0.9f, 0.9f); OptionsSettings.foregroundColor = new Color(0.9f, 0.9f, 0.9f); OptionsSettings.fontColor = new Color(0.9f, 0.9f, 0.9f); } return; } } } }