fix small issues + remove deprecated code

This commit is contained in:
Az committed 2026-11-13 02:43:45 -05:00
1 parent d04c6da283
commit 6b2bdc11f9
5 files changed
+5 -12

No files matched your search

+1 -8
View File
@@ -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 />
+1 -1
View File
@@ -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;