Exemplo n.º 1
0
    private void SetUsingPreset(DifficultySettings.PresetType preset_type)
    {
        DifficultySettingsPreset preset = DifficultySettings.GetPreset(preset_type);

        this.GetSelectButton("BaseDifficulty").SetSelectedOptionEnumValue <GameDifficulty>(preset.m_BaseDifficulty);
        this.GetSelectButton("NutrientsDepletion").SetSelectedOptionEnumValue <NutrientsDepletion>(preset.m_NutrientsDepletion);
        this.GetSelectButton("Insects").SetSelectedOptionBoolValue(preset.m_Insects);
        this.GetSelectButton("Leeches").SetSelectedOptionBoolValue(preset.m_Leeches);
        this.GetSelectButton("Aquatic").SetSelectedOptionBoolValue(preset.m_Aquatic);
        this.GetSelectButton("PermaDeath").SetSelectedOptionBoolValue(preset.m_PermaDeath);
        this.GetSelectButton("Predators").SetSelectedOptionBoolValue(preset.m_Predators);
        this.GetSelectButton("Sanity").SetSelectedOptionBoolValue(preset.m_Sanity);
        this.GetSelectButton("Snakes").SetSelectedOptionBoolValue(preset.m_Snakes);
        this.GetSelectButton("Tribes").SetSelectedOptionBoolValue(preset.m_Tribes);
        this.GetSelectButton("Energy").SetSelectedOptionBoolValue(preset.m_Energy);
        this.GetSelectButton("HPLoss").SetSelectedOptionBoolValue(preset.m_HPLoss);
    }
Exemplo n.º 2
0
    public override void OnAccept()
    {
        DifficultySettingsPreset customPreset = DifficultySettings.CustomPreset;

        customPreset.m_BaseDifficulty     = this.GetSelectButton("BaseDifficulty").GetSelectedOptionEnumValue <GameDifficulty>();
        customPreset.m_NutrientsDepletion = this.GetSelectButton("NutrientsDepletion").GetSelectedOptionEnumValue <NutrientsDepletion>();
        customPreset.m_Insects            = this.GetSelectButton("Insects").GetSelectedOptionBoolValue();
        customPreset.m_Leeches            = this.GetSelectButton("Leeches").GetSelectedOptionBoolValue();
        customPreset.m_Aquatic            = this.GetSelectButton("Aquatic").GetSelectedOptionBoolValue();
        customPreset.m_PermaDeath         = this.GetSelectButton("PermaDeath").GetSelectedOptionBoolValue();
        customPreset.m_Predators          = this.GetSelectButton("Predators").GetSelectedOptionBoolValue();
        customPreset.m_Sanity             = this.GetSelectButton("Sanity").GetSelectedOptionBoolValue();
        customPreset.m_Snakes             = this.GetSelectButton("Snakes").GetSelectedOptionBoolValue();
        customPreset.m_Tribes             = this.GetSelectButton("Tribes").GetSelectedOptionBoolValue();
        customPreset.m_Energy             = this.GetSelectButton("Energy").GetSelectedOptionBoolValue();
        customPreset.m_HPLoss             = this.GetSelectButton("HPLoss").GetSelectedOptionBoolValue();
        if (!EnumUtils <DifficultySettings.PresetType> .ForeachValueSelector(new Func <DifficultySettings.PresetType, bool>(this.TrySetPresetIfValid)))
        {
            DifficultySettings.SetActivePresetType(DifficultySettings.PresetType.Custom);
        }
        MainMenuManager.Get().SetActiveScreen(typeof(SaveGameMenu), true);
    }