internal static void ReadGameValues() { toggleButtons[0].Pressed = GameModeUtils.IsOptionActive(GameModeOption.NoSurvival); toggleButtons[1].Pressed = GameModeUtils.IsOptionActive(GameModeOption.NoBlueprints); toggleButtons[2].Pressed = GameModeUtils.RequiresSurvival(); toggleButtons[3].Pressed = GameModeUtils.IsPermadeath(); toggleButtons[4].Pressed = NoCostConsoleCommand.main.fastBuildCheat; toggleButtons[5].Pressed = NoCostConsoleCommand.main.fastScanCheat; toggleButtons[6].Pressed = NoCostConsoleCommand.main.fastGrowCheat; toggleButtons[7].Pressed = NoCostConsoleCommand.main.fastHatchCheat; //toggleButtons[8].Pressed = filterfast cheat toggleButtons[9].Pressed = GameModeUtils.IsOptionActive(GameModeOption.NoCost); toggleButtons[10].Pressed = GameModeUtils.IsCheatActive(GameModeOption.NoEnergy); toggleButtons[11].Pressed = GameModeUtils.IsOptionActive(GameModeOption.NoSurvival); toggleButtons[12].Pressed = GameModeUtils.IsOptionActive(GameModeOption.NoOxygen); toggleButtons[13].Pressed = GameModeUtils.IsOptionActive(GameModeOption.NoRadiation); toggleButtons[14].Pressed = GameModeUtils.IsInvisible(); //toggleButtons[15].Pressed = shotgun cheat toggleButtons[16].Pressed = NoDamageConsoleCommand.main.GetNoDamageCheat(); //toggleButtons[17].Pressed = alwaysDay cheat //toggleButtons[18].Pressed = noInfect cheat toggleButtons[19].Enabled = GameModeUtils.RequiresSurvival(); vehicleSettings[0].Pressed = seamothCanFly; }
internal void UpdateButtonsState() { toggleCommands[(int)ToggleCommands.freedom].State = SNGUI.ConvertBoolToState(GameModeUtils.IsOptionActive(GameModeOption.NoSurvival)); toggleCommands[(int)ToggleCommands.creative].State = SNGUI.ConvertBoolToState(GameModeUtils.IsOptionActive(GameModeOption.NoBlueprints)); toggleCommands[(int)ToggleCommands.survival].State = SNGUI.ConvertBoolToState(GameModeUtils.RequiresSurvival()); toggleCommands[(int)ToggleCommands.hardcore].State = SNGUI.ConvertBoolToState(GameModeUtils.IsPermadeath()); toggleCommands[(int)ToggleCommands.fastbuild].State = SNGUI.ConvertBoolToState(NoCostConsoleCommand.main.fastBuildCheat); toggleCommands[(int)ToggleCommands.fastscan].State = SNGUI.ConvertBoolToState(NoCostConsoleCommand.main.fastScanCheat); toggleCommands[(int)ToggleCommands.fastgrow].State = SNGUI.ConvertBoolToState(NoCostConsoleCommand.main.fastGrowCheat); toggleCommands[(int)ToggleCommands.fasthatch].State = SNGUI.ConvertBoolToState(NoCostConsoleCommand.main.fastHatchCheat); toggleCommands[(int)ToggleCommands.filterfast].State = SNGUI.ConvertBoolToState(filterFast); toggleCommands[(int)ToggleCommands.nocost].State = SNGUI.ConvertBoolToState(GameModeUtils.IsOptionActive(GameModeOption.NoCost)); toggleCommands[(int)ToggleCommands.noenergy].State = SNGUI.ConvertBoolToState(GameModeUtils.IsCheatActive(GameModeOption.NoEnergy)); toggleCommands[(int)ToggleCommands.nosurvival].State = SNGUI.ConvertBoolToState(GameModeUtils.IsOptionActive(GameModeOption.NoSurvival)); toggleCommands[(int)ToggleCommands.oxygen].State = SNGUI.ConvertBoolToState(GameModeUtils.IsOptionActive(GameModeOption.NoOxygen)); toggleCommands[(int)ToggleCommands.radiation].State = SNGUI.ConvertBoolToState(GameModeUtils.IsOptionActive(GameModeOption.NoRadiation)); toggleCommands[(int)ToggleCommands.invisible].State = SNGUI.ConvertBoolToState(GameModeUtils.IsInvisible()); //toggleCommands[(int)ToggleCommands.shotgun].State = shotgun cheat toggleCommands[(int)ToggleCommands.nodamage].State = SNGUI.ConvertBoolToState(NoDamageConsoleCommand.main.GetNoDamageCheat()); toggleCommands[(int)ToggleCommands.noinfect].State = SNGUI.ConvertBoolToState(NoInfectConsoleCommand.main.GetNoInfectCheat()); toggleCommands[(int)ToggleCommands.alwaysday].State = SNGUI.ConvertBoolToState(AlwaysDayConsoleCommand.main.GetAlwaysDayCheat()); toggleCommands[(int)ToggleCommands.overpower].Enabled = GameModeUtils.RequiresSurvival(); if (toggleCommands[(int)ToggleCommands.overpower].Enabled) { toggleCommands[(int)ToggleCommands.overpower].State = SNGUI.ConvertBoolToState(OverPowerConsoleCommand.main.GetOverPowerCheat()); } vehicleSettings[0].State = SNGUI.ConvertBoolToState(isSeamothCanFly.value); vehicleSettings[1].State = SNGUI.ConvertBoolToState(isSeaglideFast.value); }
public static void Postfix() { if (Main.config.NoAggression && !GameModeUtils.IsCheatActive(GameModeOption.NoAggression)) { GameModeUtils.ActivateCheat(GameModeOption.NoAggression); } if (Main.config.NoBlueprints && !GameModeUtils.IsCheatActive(GameModeOption.NoBlueprints)) { GameModeUtils.ActivateCheat(GameModeOption.NoBlueprints); } if (Main.config.NoCost && !GameModeUtils.IsCheatActive(GameModeOption.NoCost)) { GameModeUtils.ActivateCheat(GameModeOption.NoCost); } if (Main.config.NoEnergy && !GameModeUtils.IsCheatActive(GameModeOption.NoEnergy)) { GameModeUtils.ActivateCheat(GameModeOption.NoEnergy); } if (Main.config.NoOxygen && !GameModeUtils.IsCheatActive(GameModeOption.NoOxygen)) { GameModeUtils.ActivateCheat(GameModeOption.NoOxygen); } if (Main.config.NoPressure && !GameModeUtils.IsCheatActive(GameModeOption.NoPressure)) { GameModeUtils.ActivateCheat(GameModeOption.NoPressure); } if (Main.config.NoRadiation && !GameModeUtils.IsCheatActive(GameModeOption.NoRadiation)) { GameModeUtils.ActivateCheat(GameModeOption.NoRadiation); } #if BZ if (Main.config.NoCold && !GameModeUtils.IsCheatActive(GameModeOption.NoCold)) { GameModeUtils.ActivateCheat(GameModeOption.NoCold); } #endif if (NoCostConsoleCommand.main != null) { if (Main.config.FastBuild) { NoCostConsoleCommand.main.fastBuildCheat = true; } if (Main.config.FastGrow) { NoCostConsoleCommand.main.fastGrowCheat = true; } if (Main.config.FastHatch) { NoCostConsoleCommand.main.fastHatchCheat = true; } if (Main.config.FastScan) { NoCostConsoleCommand.main.fastScanCheat = true; } } }
internal void UpdateButtonsState() { toggleCommands[(int)ToggleCommands.freedom].State = SNGUI.ConvertBoolToState(GameModeUtils.IsOptionActive(GameModeOption.NoSurvival)); toggleCommands[(int)ToggleCommands.creative].State = SNGUI.ConvertBoolToState(GameModeUtils.IsOptionActive(GameModeOption.NoBlueprints)); toggleCommands[(int)ToggleCommands.survival].State = SNGUI.ConvertBoolToState(GameModeUtils.RequiresSurvival()); toggleCommands[(int)ToggleCommands.hardcore].State = SNGUI.ConvertBoolToState(GameModeUtils.IsPermadeath()); toggleCommands[(int)ToggleCommands.fastbuild].State = SNGUI.ConvertBoolToState(NoCostConsoleCommand.main.fastBuildCheat); toggleCommands[(int)ToggleCommands.fastscan].State = SNGUI.ConvertBoolToState(NoCostConsoleCommand.main.fastScanCheat); toggleCommands[(int)ToggleCommands.fastgrow].State = SNGUI.ConvertBoolToState(NoCostConsoleCommand.main.fastGrowCheat); toggleCommands[(int)ToggleCommands.fasthatch].State = SNGUI.ConvertBoolToState(NoCostConsoleCommand.main.fastHatchCheat); toggleCommands[(int)ToggleCommands.filterfast].State = SNGUI.ConvertBoolToState(filterFast); toggleCommands[(int)ToggleCommands.nocost].State = SNGUI.ConvertBoolToState(GameModeUtils.IsOptionActive(GameModeOption.NoCost)); toggleCommands[(int)ToggleCommands.noenergy].State = SNGUI.ConvertBoolToState(GameModeUtils.IsCheatActive(GameModeOption.NoEnergy)); toggleCommands[(int)ToggleCommands.nosurvival].State = SNGUI.ConvertBoolToState(GameModeUtils.IsOptionActive(GameModeOption.NoSurvival)); toggleCommands[(int)ToggleCommands.oxygen].State = SNGUI.ConvertBoolToState(GameModeUtils.IsOptionActive(GameModeOption.NoOxygen)); //toggleCommands[(int)ToggleCommands.radiation].State = SNGUI.ConvertBoolToState(GameModeUtils.IsOptionActive(GameModeOption.NoRadiation)); toggleCommands[(int)ToggleCommands.invisible].State = SNGUI.ConvertBoolToState(GameModeUtils.IsInvisible()); //toggleCommands[(int)ToggleCommands.shotgun].State = shotgun cheat toggleCommands[(int)ToggleCommands.nodamage].State = SNGUI.ConvertBoolToState(NoDamageConsoleCommand.main.GetNoDamageCheat()); //toggleCommands[(int)ToggleCommands.noinfect].State = SNGUI.ConvertBoolToState(NoInfectConsoleCommand.main.GetNoInfectCheat()); toggleCommands[(int)ToggleCommands.alwaysday].State = SNGUI.ConvertBoolToState(AlwaysDayConsoleCommand.main.GetAlwaysDayCheat()); toggleCommands[(int)ToggleCommands.overpower].Enabled = GameModeUtils.RequiresSurvival(); toggleCommands[(int)ToggleCommands.weather].State = isWeatherEnabled ? GuiItemState.NORMAL : GuiItemState.PRESSED; toggleCommands[(int)ToggleCommands.resistcold].State = SNGUI.ConvertBoolToState(ResistColdConsoleCommand.main.GetResistColdCheat()); toggleCommands[(int)ToggleCommands.noiceworm].State = noIceWorm ? GuiItemState.PRESSED : GuiItemState.NORMAL; if (toggleCommands[(int)ToggleCommands.overpower].Enabled) { toggleCommands[(int)ToggleCommands.overpower].State = SNGUI.ConvertBoolToState(OverPowerConsoleCommand.main.GetOverPowerCheat()); } //vehicleSettings[0].State = SNGUI.ConvertBoolToState(isSeamothCanFly.value); vehicleSettings[0].State = SNGUI.ConvertBoolToState(isSeaglideFast.value); /* * weatherTab[(int)Weather.weather].State = isWeatherEnabled ? GuiItemState.NORMAL : GuiItemState.PRESSED; * weatherTab[(int)Weather.lightning].State = VFXWeatherManager.main.lightningsEnabled ? GuiItemState.NORMAL : GuiItemState.PRESSED; * weatherTab[(int)Weather.precipitation].State = VFXWeatherManager.main.precipitationEnabled ? GuiItemState.NORMAL : GuiItemState.PRESSED; * weatherTab[(int)Weather.wind].State = WeatherManager.main.debugWindEnabled ? GuiItemState.NORMAL : GuiItemState.PRESSED; * weatherTab[(int)Weather.cold].State = GameModeUtils.IsOptionActive(GameModeOption.NoCold) ? GuiItemState.PRESSED : GuiItemState.NORMAL; */ }