mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-19 15:51:48 +00:00
git is confusing
This commit is contained in:
26 files changed
+1083
-32
No files matched your search
@@ -1,6 +1,7 @@
|
||||
using MiraAPI.GameOptions;
|
||||
using MiraAPI.GameOptions.Attributes;
|
||||
using MiraAPI.Utilities;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MiraAPI.Example.Options;
|
||||
@@ -16,11 +17,19 @@ public class ExampleOptions : AbstractOptionGroup
|
||||
[ModdedToggleOption("options.exampleOptions1.toggleOpt1")]
|
||||
public bool ToggleOpt2 { get; set; } = true;
|
||||
|
||||
[ModdedToggleOption("Toggle Opt 3")]
|
||||
[ModdedOptionVisibility(nameof(ToggleOpt2))] // ToggleOpt3 will be visible only when ToggleOpt2 is true
|
||||
public bool ToggleOpt3 { get; set; } = true;
|
||||
|
||||
[ModdedNumberOption("options.exampleOptions1.numberOpt", min: 0, max: 10, increment: .25f, formatString: "0.00", suffixType: MiraNumberSuffixes.Percent)]
|
||||
public float NumberOpt { get; set; } = 4f;
|
||||
|
||||
[ModdedEnumOption("options.exampleOptions1.bestApi", typeof(BestApi), ["Mira API", "Mitochondria", "Reactor"])]
|
||||
public BestApi Opt { get; set; } = BestApi.MiraAPI;
|
||||
|
||||
[ModdedEnumOptionList<ValueState>("Value State {0}", ["None", "Primary", "Secondary"])]
|
||||
public List<ValueState> ValueStates { get; } =
|
||||
[ValueState.Primary, ValueState.Secondary, ValueState.None, ValueState.None, ValueState.None];
|
||||
}
|
||||
|
||||
public enum BestApi
|
||||
@@ -29,3 +38,10 @@ public enum BestApi
|
||||
Mitochondria,
|
||||
Reactor,
|
||||
}
|
||||
|
||||
public enum ValueState
|
||||
{
|
||||
None,
|
||||
Primary,
|
||||
Secondary,
|
||||
}
|
||||
@@ -16,6 +16,9 @@ public class ExampleOptions2 : AbstractOptionGroup
|
||||
public ModdedPlayerOption PlayerOption { get; } = new("options.exampleOptions2.ehWhatever");
|
||||
public ModdedToggleOption ToggleOpt1 { get; } = new("options.exampleOptions2.toggleOption1", false);
|
||||
|
||||
public ModdedOptionList<ModdedNumberOption> PlayerNums { get; } = new(5, i =>
|
||||
new($"PlayerNum{i}", 2, 0, 5, 1, Utilities.MiraNumberSuffixes.None));
|
||||
|
||||
public ModdedToggleOption ToggleOpt2 { get; } = new("options.exampleOptions2.toggleOption2", false)
|
||||
{
|
||||
Visible = () => OptionGroupSingleton<ExampleOptions2>.Instance.ToggleOpt1, // implicit cast from ModdedToggleOption to bool
|
||||
|
||||
Reference in new issue
Block a user