mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-20 01:46:15 +00:00
small corrections
This commit is contained in:
6 files changed
+9
-14
No files matched your search
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using MiraAPI.GameOptions.OptionTypes;
|
||||
@@ -158,7 +159,7 @@ public sealed class ModdedOptionVisibilityAttribute(Type? holderType = null, str
|
||||
return null;
|
||||
}
|
||||
|
||||
#pragma warning disable S3011 // Reflection should not be used to increase accessibility of classes, methods, or fields
|
||||
[SuppressMessage("Major Code Smell", "S3011:Reflection should not be used to increase accessibility of classes, methods, or fields", Justification = "It is safe.")]
|
||||
private MemberInfo? GetVisibilityMember(AbstractOptionGroup group, PropertyInfo property, out Type type, out Func<object>? instanceGet)
|
||||
{
|
||||
Type groupType = group.GetType();
|
||||
@@ -197,5 +198,4 @@ public sealed class ModdedOptionVisibilityAttribute(Type? holderType = null, str
|
||||
|
||||
return member;
|
||||
}
|
||||
#pragma warning restore S3011 // Reflection should not be used to increase accessibility of classes, methods, or fields
|
||||
}
|
||||
@@ -376,10 +376,9 @@ public static class ModdedOptionsManager
|
||||
/// <param name="__instance">The list's instance.</param>
|
||||
/// <param name="index">The index to find in the list.</param>
|
||||
/// <param name="value">The new object value.</param>
|
||||
#pragma warning disable CA1707
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming", Justification = "Harmony naming convention")]
|
||||
[SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores", Justification = "Read above.")]
|
||||
public static void PropertyListSetterPatch(object __instance, int index, object value)
|
||||
#pragma warning restore CA1707
|
||||
{
|
||||
var attribute = (ModdedOptionListAttribute)OptionAttributes.First(
|
||||
pair => pair.Value is ModdedOptionListAttribute list && ReferenceEquals(list.Value, __instance)).Value;
|
||||
@@ -393,10 +392,9 @@ public static class ModdedOptionsManager
|
||||
/// <param name="index">The index to find in the list.</param>
|
||||
/// <param name="__result">The result of the property getter.</param>
|
||||
/// <returns>False so the original getter gets skipped.</returns>
|
||||
#pragma warning disable CA1707
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming", Justification = "Harmony naming convention")]
|
||||
[SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores", Justification = "Read above.")]
|
||||
public static bool PropertyListGetterPatch(object __instance, int index, ref object __result)
|
||||
#pragma warning restore CA1707
|
||||
{
|
||||
var attribute = (ModdedOptionListAttribute)OptionAttributes.First(
|
||||
pair => pair.Value is ModdedOptionListAttribute list && ReferenceEquals(list.Value, __instance)).Value;
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace MiraAPI;
|
||||
[BepInProcess("Among Us.exe")]
|
||||
[BepInDependency(ReactorPlugin.Id)]
|
||||
[ReactorModFlags(ModFlags.RequireOnAllClients)]
|
||||
#pragma warning disable SA1515 // Single-line comment should be preceded by blank line (Justification: ReSharper suppression,)
|
||||
#pragma warning disable SA1515 // Single-line comment should be preceded by blank line (Justification: ReSharper suppression.)
|
||||
// ReSharper disable once ClassNeverInstantiated.Global (Justification: Instantiated by BepInEx.)
|
||||
public partial class MiraApiPlugin : BasePlugin, IMiraPlugin
|
||||
#pragma warning restore SA1515 // Single-line comment should be preceded by blank line
|
||||
|
||||
@@ -238,9 +238,9 @@ public static class RoleGuidePatches
|
||||
continue;
|
||||
#pragma warning restore S1751 // Loops with at most one iteration should be refactored
|
||||
|
||||
void LoadNameplate(NamePlateViewData viewdata)
|
||||
void LoadNameplate(NamePlateViewData viewData)
|
||||
{
|
||||
component.buttonSprite.sprite = viewdata.Image;
|
||||
component.buttonSprite.sprite = viewData.Image;
|
||||
component.buttonSprite.transform.localScale = new Vector3(0.7f, 1.075f, 1);
|
||||
component.buttonSprite.transform.localPosition = new Vector3(-0.395f, 0, 0.1f);
|
||||
}
|
||||
|
||||
@@ -11,9 +11,8 @@ using UnityEngine.UI;
|
||||
|
||||
namespace MiraAPI.Presets;
|
||||
|
||||
// TODO: Give proper reasoning
|
||||
[RegisterInIl2Cpp]
|
||||
[SuppressMessage("Style", "IDE0051:Remove unused private members", Justification = "Unity Convention.")]
|
||||
[SuppressMessage("Style", "IDE0051:Remove unused private members", Justification = "Unity convention.")]
|
||||
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member (Justification: Unity fields; ignore.)
|
||||
public class SavePresetPopup(nint cppPtr) : Minigame(cppPtr)
|
||||
{
|
||||
|
||||
@@ -389,9 +389,8 @@ public static class Helpers
|
||||
Constants.ShipAndObjectsMask))
|
||||
select playerControl);
|
||||
|
||||
#pragma warning disable SA1008 // Opening parenthesis should be spaced correctly (Justification: Formatting.)
|
||||
outputList.Sort(
|
||||
delegate (PlayerControl a, PlayerControl b)
|
||||
(a, b) =>
|
||||
{
|
||||
var magnitude2 = (a.GetTruePosition() - source).magnitude;
|
||||
var magnitude3 = (b.GetTruePosition() - source).magnitude;
|
||||
@@ -401,7 +400,6 @@ public static class Helpers
|
||||
? -1
|
||||
: 0;
|
||||
});
|
||||
#pragma warning restore SA1008 // Opening parenthesis should be spaced correctly
|
||||
return outputList;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user