mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-11-19 13:17:10 +00:00
fix small issues + remove deprecated code
This commit is contained in:
5 files changed
+5
-12
No files matched your search
@@ -39,7 +39,7 @@ public abstract class AbstractOptionGroup
|
||||
public abstract string GroupName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the ID prefix used for options in this group (e.g., "Options.Teleporter").
|
||||
/// Gets the ID prefix used for options in this group (e.g., "Options.Teleporter.").
|
||||
/// </summary>
|
||||
public virtual string GroupPrefix => string.Empty;
|
||||
|
||||
@@ -54,13 +54,6 @@ public abstract class AbstractOptionGroup
|
||||
/// </summary>
|
||||
public virtual Type? OptionableType => null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the group should be shown in the modifiers menu.
|
||||
/// </summary>
|
||||
// Completed: make this not a boolean
|
||||
[Obsolete("Use ParentMenu instead. This will be removed in a future version.", true)]
|
||||
public virtual bool ShowInModifiersMenu => false;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating which menu the group is in.
|
||||
/// </summary>
|
||||
|
||||
@@ -25,7 +25,7 @@ public class ModdedPlayerOptionListAttribute(string? title, bool allowNone = tru
|
||||
|
||||
internal override IBaseModdedOptionList CreateOptionList(IList list, PropertyInfo property, AbstractOptionGroup group)
|
||||
{
|
||||
return new ModdedOptionList<ModdedPlayerOption>(list.Count, idx => new(GetFormattedTitle(idx, property), allowNone));
|
||||
return new ModdedOptionList<ModdedPlayerOption>(list.Count, idx => new(group.GroupPrefix, GetFormattedTitle(idx, property), allowNone));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -101,7 +101,7 @@ public interface IModdedOption
|
||||
OptionBehaviour CreateOption(ToggleOption toggleOpt, NumberOption numberOpt, StringOption stringOpt, PlayerOption playerOpt, Transform container);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the translated display value of the toggle option.
|
||||
/// Gets the translated display value of the option.
|
||||
/// </summary>
|
||||
/// <returns>The display value.</returns>
|
||||
string GetDisplayValue();
|
||||
|
||||
@@ -301,6 +301,6 @@ public class ModdedNumberOption : ModdedOption<float>
|
||||
/// <returns>Integer value.</returns>
|
||||
public static implicit operator int(ModdedNumberOption option)
|
||||
{
|
||||
return (int)MathF.Round(option.Value);
|
||||
return (int)MathF.Round(option.Value, MidpointRounding.AwayFromZero);
|
||||
}
|
||||
}
|
||||
@@ -85,7 +85,7 @@ public class ModdedPlayerOption : ModdedOption<int>
|
||||
playerOption.SetValueText();
|
||||
playerOption.AdjustButtonsActiveState();
|
||||
|
||||
playerOpt.gameObject.AddComponent<MiraPlayerOptionComponent>().PlayerOption = this;
|
||||
playerOption.gameObject.AddComponent<MiraPlayerOptionComponent>().PlayerOption = this;
|
||||
|
||||
OptionBehaviour = playerOption;
|
||||
|
||||
|
||||
Reference in new issue
Block a user