mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-11-19 13:17:10 +00:00
remove useless setting of option names
This commit is contained in:
5 files changed
+4
-14
No files matched your search
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using AmongUs.GameOptions;
|
||||
using UnityEngine;
|
||||
using Object = UnityEngine.Object;
|
||||
|
||||
@@ -47,7 +46,6 @@ public abstract class ModdedBaseStringOption<T>(string groupPrefix, string title
|
||||
data.Type = global::OptionTypes.String;
|
||||
data.Values = StringNameValues;
|
||||
data.Index = defaultIndex;
|
||||
data.OptionName = Int32OptionNames.Invalid;
|
||||
|
||||
Data = data;
|
||||
}
|
||||
@@ -79,7 +77,6 @@ public abstract class ModdedBaseStringOption<T>(string groupPrefix, string title
|
||||
stringOption.Title = StringName;
|
||||
stringOption.Value = GetIndex(Value);
|
||||
stringOption.Values = StringNameValues;
|
||||
stringOption.stringOptionName = Int32OptionNames.Invalid;
|
||||
stringOption.OnValueChanged = (Action<OptionBehaviour>)ValueChanged;
|
||||
|
||||
// Changing the button text to make them more distinct from number options
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Text.RegularExpressions;
|
||||
using AmongUs.GameOptions;
|
||||
using BepInEx.Configuration;
|
||||
using MiraAPI.Networking;
|
||||
using MiraAPI.Utilities;
|
||||
@@ -123,7 +122,6 @@ public class ModdedNumberOption : ModdedOption<float>
|
||||
data.FormatString = FormatString;
|
||||
data.ZeroIsInfinity = ZeroInfinity;
|
||||
data.SuffixType = (NumberSuffixes)SuffixType;
|
||||
data.OptionName = Int32OptionNames.Invalid;
|
||||
|
||||
Data = data;
|
||||
}
|
||||
@@ -138,7 +136,6 @@ public class ModdedNumberOption : ModdedOption<float>
|
||||
data.FormatString = FormatString;
|
||||
data.ZeroIsInfinity = ZeroInfinity;
|
||||
data.SuffixType = (NumberSuffixes)SuffixType;
|
||||
data.OptionName = FloatOptionNames.Invalid;
|
||||
|
||||
Data = data;
|
||||
}
|
||||
@@ -241,6 +238,7 @@ public class ModdedNumberOption : ModdedOption<float>
|
||||
|
||||
numberOption.SetUpFromData(Data, 20);
|
||||
|
||||
// SetUpFromData method doesn't work correctly so we must set the values manually
|
||||
numberOption.Title = StringName;
|
||||
numberOption.Value = Value;
|
||||
numberOption.Increment = Increment;
|
||||
@@ -248,8 +246,6 @@ public class ModdedNumberOption : ModdedOption<float>
|
||||
numberOption.FormatString = FormatString;
|
||||
numberOption.ZeroIsInfinity = ZeroInfinity;
|
||||
numberOption.SuffixType = (NumberSuffixes)SuffixType;
|
||||
numberOption.intOptionName = Int32OptionNames.Invalid;
|
||||
numberOption.floatOptionName = FloatOptionNames.Invalid;
|
||||
numberOption.OnValueChanged = (Action<OptionBehaviour>)ValueChanged;
|
||||
|
||||
var optionComponent = numberOption.gameObject.AddComponent<MiraNumberOptionComponent>();
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using AmongUs.GameOptions;
|
||||
using MiraAPI.Networking;
|
||||
using MiraAPI.Utilities;
|
||||
using UnityEngine;
|
||||
@@ -46,7 +45,6 @@ public class ModdedPlayerOption : ModdedOption<int>
|
||||
var data = ScriptableObject.CreateInstance<PlayerSelectionGameSetting>();
|
||||
data.Title = StringName;
|
||||
data.Type = global::OptionTypes.Player;
|
||||
data.OptionName = Int32OptionNames.Invalid;
|
||||
|
||||
Data = data;
|
||||
}
|
||||
@@ -76,11 +74,11 @@ public class ModdedPlayerOption : ModdedOption<int>
|
||||
|
||||
playerOption.SetUpFromData(Data, 20);
|
||||
|
||||
// SetUpFromData method doesn't work correctly so we must set the values manually
|
||||
playerOption.Title = StringName;
|
||||
playerOption.Values = Values.ToIl2CppList();
|
||||
playerOption.Value = Value;
|
||||
playerOption.playerIndex = Values.FindIndex(p => p.PlayerId == Value);
|
||||
playerOption.optionName = Int32OptionNames.Invalid;
|
||||
playerOption.OnValueChanged = (Action<OptionBehaviour>)ValueChanged;
|
||||
|
||||
playerOption.SetValueText();
|
||||
|
||||
@@ -51,6 +51,7 @@ public class ModdedStringOption : ModdedBaseStringOption<string>
|
||||
/// </summary>
|
||||
/// <param name="value">The option's string value.</param>
|
||||
/// <param name="index">The additional value's index on the list.</param>
|
||||
[Obsolete("Use the Setter feature of modded options to simulate conditional values. This wil be removed in a future version.")]
|
||||
public void RegisterExtraValue(string value, int index = -1)
|
||||
{
|
||||
if (!Values.Contains(value))
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using AmongUs.GameOptions;
|
||||
using MiraAPI.Networking;
|
||||
using MiraAPI.Translation;
|
||||
using UnityEngine;
|
||||
@@ -40,7 +39,6 @@ public class ModdedToggleOption : ModdedOption<bool>
|
||||
var data = ScriptableObject.CreateInstance<CheckboxGameSetting>();
|
||||
data.Title = StringName;
|
||||
data.Type = global::OptionTypes.Checkbox;
|
||||
data.OptionName = BoolOptionNames.Invalid;
|
||||
|
||||
Data = data;
|
||||
}
|
||||
@@ -89,9 +87,9 @@ public class ModdedToggleOption : ModdedOption<bool>
|
||||
|
||||
toggleOption.SetUpFromData(Data, 20);
|
||||
|
||||
// SetUpFromData method doesn't work correctly so we must set the values manually
|
||||
toggleOption.Title = StringName;
|
||||
toggleOption.CheckMark.enabled = Value;
|
||||
toggleOption.boolOptionName = BoolOptionNames.Invalid;
|
||||
toggleOption.OnValueChanged = (Action<OptionBehaviour>)ValueChanged;
|
||||
|
||||
OptionBehaviour = toggleOption;
|
||||
|
||||
Reference in new issue
Block a user