Changed parent attribute method signatures

This commit is contained in:
David Higueros committed 2026-06-21 21:43:26 -06:00
1 parent 3fd3c68aaf
commit c3384ef850
2 files changed
+8 -8

No files matched your search

@@ -35,16 +35,16 @@ public abstract class ModdedOptionListAttribute(Func<int, string> titler) : Prop
for (int i = 0; i < list!.Count; i++)
{
SetValue(HolderOptionList![i], list[i]!);
SetValue(i, list[i]!);
}
}
/// <summary>
/// Sets the value of the specific option.
/// </summary>
/// <param name="modOpt">The option to set.</param>
/// <param name="idx">The option to set.</param>
/// <param name="value">The new value as an object.</param>
public abstract void SetValue(IModdedOption modOpt, object value);
public abstract void SetValue(int idx, object value);
/// <summary>
/// Gets the value of all the options.
@@ -58,9 +58,9 @@ public abstract class ModdedOptionListAttribute(Func<int, string> titler) : Prop
/// <summary>
/// Gets the value of the specific option.
/// </summary>
/// <param name="modOpt">The option to set.</param>
/// <param name="idx">The option to set.</param>
/// <returns>The value of the option as an object.</returns>
public abstract object GetValue(IModdedOption modOpt);
public abstract object GetValue(int idx);
internal abstract IModdedOptionList? CreateOptionList(object? value, PropertyInfo property);
internal abstract IModdedOptionList? CreateOptionList(IList value, PropertyInfo property);
}
+2 -2
View File
@@ -305,7 +305,7 @@ public static class ModdedOptionsManager
{
var attribute = (ModdedOptionListAttribute)OptionAttributes.First(
pair => pair.Value is ModdedOptionListAttribute list && ReferenceEquals(list.Value, __instance)).Value;
attribute.SetValue(attribute.HolderOptionList![index], value);
attribute.SetValue(index, value);
}
/// <summary>
@@ -322,7 +322,7 @@ public static class ModdedOptionsManager
{
var attribute = (ModdedOptionListAttribute)OptionAttributes.First(
pair => pair.Value is ModdedOptionListAttribute list && ReferenceEquals(list.Value, __instance)).Value;
__result = attribute.GetValue(attribute.HolderOptionList![index]);
__result = attribute.GetValue(index);
return false;
}
}