diff --git a/Directory.Build.props b/Directory.Build.props index e60aaf94..b09c823f 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -8,7 +8,7 @@ true - 0.4.0 + 0.4.1 dev All Of Us, XtraCube, Angxl diff --git a/MiraAPI/Colors/PaletteManager.cs b/MiraAPI/Colors/PaletteManager.cs index c7883531..fe7e7250 100644 --- a/MiraAPI/Colors/PaletteManager.cs +++ b/MiraAPI/Colors/PaletteManager.cs @@ -5,12 +5,12 @@ using HarmonyLib; namespace MiraAPI.Colors; /// -/// Used to register and track custom colors. +/// Used to register and track s. /// public static class PaletteManager { /// - /// Gets all registered custom colors. + /// Gets all registered s. /// public static CustomColor[] RegisteredColors => [.. CustomColors]; diff --git a/MiraAPI/Colors/RegisterCustomColorsAttribute.cs b/MiraAPI/Colors/RegisterCustomColorsAttribute.cs index 0e9ace75..63565829 100644 --- a/MiraAPI/Colors/RegisterCustomColorsAttribute.cs +++ b/MiraAPI/Colors/RegisterCustomColorsAttribute.cs @@ -3,7 +3,7 @@ namespace MiraAPI.Colors; /// -/// Used to mark a class for custom colors registration. +/// Used to mark a class for registration. /// [AttributeUsage(AttributeTargets.Class)] public class RegisterCustomColorsAttribute : Attribute; diff --git a/MiraAPI/Events/Mira/MiraButtonCancelledEvent.cs b/MiraAPI/Events/Mira/MiraButtonCancelledEvent.cs index f4a6ebf7..e6c7c15f 100644 --- a/MiraAPI/Events/Mira/MiraButtonCancelledEvent.cs +++ b/MiraAPI/Events/Mira/MiraButtonCancelledEvent.cs @@ -3,20 +3,20 @@ namespace MiraAPI.Events.Mira; /// -/// Invoked when a Mira Button click is cancelled. Do not use for vanilla buttons. +/// Invoked when a click is cancelled. Do not use for vanilla s. /// -/// The Mira Button type. +/// The type. public sealed class MiraButtonCancelledEvent : MiraEvent where T : CustomActionButton { /// - /// Gets Mira Button whose click was cancelled. + /// Gets the whose click was cancelled. /// public T Button { get; } /// /// Initializes a new instance of the class. /// - /// The Mira Button whose click was cancelled. + /// The whose click was cancelled. public MiraButtonCancelledEvent(T button) { Button = button; @@ -24,19 +24,19 @@ public sealed class MiraButtonCancelledEvent : MiraEvent where T : CustomActi } /// -/// Invoked when a Mira Button click is cancelled. Do not use for vanilla buttons. +/// Invoked when a click is cancelled. Do not use for vanilla s. /// public sealed class MiraButtonCancelledEvent : MiraEvent { /// - /// Gets Mira Button whose click was cancelled. + /// Gets the whose click was cancelled. /// public CustomActionButton Button { get; } /// /// Initializes a new instance of the class. /// - /// The Mira Button whose click was cancelled. + /// The whose click was cancelled. public MiraButtonCancelledEvent(CustomActionButton button) { Button = button; diff --git a/MiraAPI/Events/Mira/MiraButtonClickEvent.cs b/MiraAPI/Events/Mira/MiraButtonClickEvent.cs index c070383c..401cc11e 100644 --- a/MiraAPI/Events/Mira/MiraButtonClickEvent.cs +++ b/MiraAPI/Events/Mira/MiraButtonClickEvent.cs @@ -3,26 +3,26 @@ namespace MiraAPI.Events.Mira; /// -/// Button click event for Mira Buttons only. Do not use for vanilla buttons. +/// Button click event for s only. Do not use for vanilla s. /// -/// The Mira Button type. +/// The type. public sealed class MiraButtonClickEvent : MiraCancelableEvent where T : CustomActionButton { /// - /// Gets Mira Button that was clicked. + /// Gets the that was clicked. /// public T Button { get; } /// - /// Gets the generic click event that is invoked before this button-specific event. + /// Gets the generic that is invoked before this button-specific event. /// public MiraButtonClickEvent GenericClickEvent { get; } /// /// Initializes a new instance of the class. /// - /// The Mira Button that was clicked. - /// The generic click event invoked before button-specific events. + /// The that was clicked. + /// The generic invoked before button-specific events. public MiraButtonClickEvent(T button, MiraButtonClickEvent genericClickEvent) { GenericClickEvent = genericClickEvent; @@ -31,19 +31,19 @@ public sealed class MiraButtonClickEvent : MiraCancelableEvent where T : Cust } /// -/// Button click event for Mira Buttons only. Do not use for vanilla buttons. +/// Button click event for s only. Do not use for vanilla s. /// public sealed class MiraButtonClickEvent : MiraCancelableEvent { /// - /// Gets Mira Button that was clicked. + /// Gets the that was clicked. /// public CustomActionButton Button { get; } /// /// Initializes a new instance of the class. /// - /// The Mira Button that was clicked. + /// The that was clicked. public MiraButtonClickEvent(CustomActionButton button) { Button = button; diff --git a/MiraAPI/Events/MiraEventHandle.cs b/MiraAPI/Events/MiraEventHandle.cs index 70514c44..451e6a2a 100644 --- a/MiraAPI/Events/MiraEventHandle.cs +++ b/MiraAPI/Events/MiraEventHandle.cs @@ -3,7 +3,7 @@ namespace MiraAPI.Events; /// -/// Event handle to use when unregistering an event. +/// Event handle to use when unregistering a . /// public class MiraEventHandle { diff --git a/MiraAPI/Events/MiraEventManager.cs b/MiraAPI/Events/MiraEventManager.cs index bac91c50..005415ba 100644 --- a/MiraAPI/Events/MiraEventManager.cs +++ b/MiraAPI/Events/MiraEventManager.cs @@ -13,11 +13,11 @@ public static class MiraEventManager private static readonly Dictionary> EventWrappers = []; /// - /// Invoke an event. + /// Invoke a . /// - /// The event instance. + /// The instance. /// Type of Event. - /// If there was an event handler invoked for this event, return true. Otherwise, return false. + /// If there was an event handler invoked for this event, return . Otherwise, return . public static bool InvokeEvent(T eventInstance) where T : MiraEvent { EventWrappers.TryGetValue(typeof(T), out var handlers); @@ -42,11 +42,11 @@ public static class MiraEventManager } /// - /// Invoke an event and use a specific type to find the handlers. + /// Invoke a and use a specific type to find the handlers. /// - /// The event instance. + /// The instance. /// The type to use for handler lookup. - /// If there was an event handler invoked for this event, return true. Otherwise, return false. + /// If there was an event handler invoked for this event, return . Otherwise, return . public static bool InvokeEvent(MiraEvent eventInstance, Type type) { EventWrappers.TryGetValue(type, out var handlers); @@ -71,12 +71,12 @@ public static class MiraEventManager } /// - /// Register an event. + /// Register a handler. /// - /// The type of event. - /// The MethodInfo of the event handler. + /// The type of event. + /// The of the event handler. /// The priority of the event handler. Lower values are called first. - /// An event handle to use when unregistering the event. + /// A to use when unregistering the event. public static MiraEventHandle RegisterEventHandler(Type type, MethodInfo methodInfo, int priority = 0) { if (!type.IsSubclassOf(typeof(MiraEvent))) @@ -102,12 +102,12 @@ public static class MiraEventManager } /// - /// Register an event. + /// Register a handler. /// /// The callback method/handler for the event. /// The priority of the event handler. Lower values are called first. - /// Type of event. - /// An event handle to use when unregistering the event. + /// Type of event. + /// A to use when unregistering the event. public static MiraEventHandle RegisterEventHandler(Action handler, int priority = 0) where T : MiraEvent { EventWrappers.TryAdd(typeof(T), []); @@ -127,10 +127,10 @@ public static class MiraEventManager } /// - /// Unregister an event using the event handle. + /// Unregister a handler using the . /// /// A handle to the event. - /// True if the event was unregistered successfully, false otherwise. + /// if the event was unregistered successfully, otherwise. public static bool UnregisterEventHandler(MiraEventHandle eventHandle) { if (!EventWrappers.TryGetValue(eventHandle.EventType, out var handlers)) diff --git a/MiraAPI/Events/MiraEventWrapper.cs b/MiraAPI/Events/MiraEventWrapper.cs index 7e754c3d..3784688e 100644 --- a/MiraAPI/Events/MiraEventWrapper.cs +++ b/MiraAPI/Events/MiraEventWrapper.cs @@ -3,7 +3,7 @@ namespace MiraAPI.Events; /// -/// Wrapper for event handlers. +/// Wrapper for handlers. /// public class MiraEventWrapper { diff --git a/MiraAPI/Events/RegisterEventAttribute.cs b/MiraAPI/Events/RegisterEventAttribute.cs index 169c1251..2fee367f 100644 --- a/MiraAPI/Events/RegisterEventAttribute.cs +++ b/MiraAPI/Events/RegisterEventAttribute.cs @@ -3,7 +3,7 @@ namespace MiraAPI.Events; /// -/// Register an event. +/// Register a handler. /// [AttributeUsage(AttributeTargets.Method)] public class RegisterEventAttribute : Attribute diff --git a/MiraAPI/Events/Vanilla/Gameplay/AfterMurderEvent.cs b/MiraAPI/Events/Vanilla/Gameplay/AfterMurderEvent.cs index 0f0da3be..8b856229 100644 --- a/MiraAPI/Events/Vanilla/Gameplay/AfterMurderEvent.cs +++ b/MiraAPI/Events/Vanilla/Gameplay/AfterMurderEvent.cs @@ -6,17 +6,17 @@ public class AfterMurderEvent : MiraEvent { /// - /// Gets the player that killed the target. + /// Gets the that killed the . /// public PlayerControl Source { get; } /// - /// Gets the player that was killed. + /// Gets the that was killed. /// public PlayerControl Target { get; } /// - /// Gets the player's body, if it exists. + /// Gets the 's , if it exists. /// public DeadBody? DeadBody { get; } @@ -24,8 +24,8 @@ public class AfterMurderEvent : MiraEvent /// Initializes a new instance of the class. /// /// The killer. - /// The killed player. - /// The player's vody, if it exists. + /// The killed . + /// The 's , if it exists. public AfterMurderEvent(PlayerControl source, PlayerControl target, DeadBody? deadBody) { Source = source; diff --git a/MiraAPI/Events/Vanilla/Gameplay/BeforeGameEndEvent.cs b/MiraAPI/Events/Vanilla/Gameplay/BeforeGameEndEvent.cs index 0a70a1db..9703bd5a 100644 --- a/MiraAPI/Events/Vanilla/Gameplay/BeforeGameEndEvent.cs +++ b/MiraAPI/Events/Vanilla/Gameplay/BeforeGameEndEvent.cs @@ -1,7 +1,7 @@ namespace MiraAPI.Events.Vanilla.Gameplay; /// -/// Invoked before RpcEndGame is called, allowing cancellation of the game end entirely. +/// Invoked before is called, allowing cancellation of the game end entirely. /// public class BeforeGameEndEvent : MiraCancelableEvent { diff --git a/MiraAPI/Events/Vanilla/Gameplay/BeforeMurderEvent.cs b/MiraAPI/Events/Vanilla/Gameplay/BeforeMurderEvent.cs index 84cc67ed..cc07e219 100644 --- a/MiraAPI/Events/Vanilla/Gameplay/BeforeMurderEvent.cs +++ b/MiraAPI/Events/Vanilla/Gameplay/BeforeMurderEvent.cs @@ -8,25 +8,25 @@ namespace MiraAPI.Events.Vanilla.Gameplay; public sealed class BeforeMurderEvent : MiraCancelableEvent { /// - /// Gets the player that is killing the target. + /// Gets the that is killing the . /// public PlayerControl Source { get; } /// - /// Gets the player that is being killed. + /// Gets the that is being killed. /// public PlayerControl Target { get; } /// - /// Gets whether the murder was meant to be done in a meeting via an enum. + /// Gets whether the murder was meant to be done in a meeting, via an enum. /// public MeetingCheck InMeeting { get; } /// /// Initializes a new instance of the class. /// - /// The player that is killing the target. - /// The player that is being killed. + /// The that is killing the . + /// The that is being killed. /// Whether the murder is intended to be triggered in a meeting. public BeforeMurderEvent(PlayerControl source, PlayerControl target, MeetingCheck inMeeting) { @@ -38,8 +38,8 @@ public sealed class BeforeMurderEvent : MiraCancelableEvent /// /// Initializes a new instance of the class. /// - /// The player that is killing the target. - /// The player that is being killed. + /// The that is killing the . + /// The that is being killed. public BeforeMurderEvent(PlayerControl source, PlayerControl target) { Source = source; diff --git a/MiraAPI/Events/Vanilla/Gameplay/BeforeRoundStartEvent.cs b/MiraAPI/Events/Vanilla/Gameplay/BeforeRoundStartEvent.cs index f9d41ee9..77422af1 100644 --- a/MiraAPI/Events/Vanilla/Gameplay/BeforeRoundStartEvent.cs +++ b/MiraAPI/Events/Vanilla/Gameplay/BeforeRoundStartEvent.cs @@ -1,12 +1,13 @@ namespace MiraAPI.Events.Vanilla.Gameplay; /// -/// Event invoked on IntroCutscene.OnDestroy and ExileController.WrapUp to determine if it should run the round event or not. +/// Event invoked on and +/// to determine if it should run the event or not. /// public class BeforeRoundStartEvent : MiraCancelableEvent { /// - /// Gets a value indicating whether the event was triggered by the IntroCutscene or ExileController. + /// Gets a value indicating whether the event was triggered by the or . /// public bool TriggeredByIntro { get; } diff --git a/MiraAPI/Events/Vanilla/Gameplay/GameEndEvent.cs b/MiraAPI/Events/Vanilla/Gameplay/GameEndEvent.cs index 1f065338..d44dae5b 100644 --- a/MiraAPI/Events/Vanilla/Gameplay/GameEndEvent.cs +++ b/MiraAPI/Events/Vanilla/Gameplay/GameEndEvent.cs @@ -6,14 +6,14 @@ public class GameEndEvent : MiraEvent { /// - /// Gets the instance of the EndGameManager. + /// Gets the instance. /// public EndGameManager EndGameManager { get; } /// /// Initializes a new instance of the class. /// - /// The instance of the EndGameManager. + /// The instance. public GameEndEvent(EndGameManager manager) { EndGameManager = manager; diff --git a/MiraAPI/Events/Vanilla/Gameplay/IntroBeginEvent.cs b/MiraAPI/Events/Vanilla/Gameplay/IntroBeginEvent.cs index 5d5e8d83..b08ec56d 100644 --- a/MiraAPI/Events/Vanilla/Gameplay/IntroBeginEvent.cs +++ b/MiraAPI/Events/Vanilla/Gameplay/IntroBeginEvent.cs @@ -6,7 +6,7 @@ public class IntroBeginEvent : MiraEvent { /// - /// Gets the instance of the IntroCutscene. + /// Gets the instance. /// public IntroCutscene IntroCutscene { get; } diff --git a/MiraAPI/Events/Vanilla/Gameplay/IntroEndEvent.cs b/MiraAPI/Events/Vanilla/Gameplay/IntroEndEvent.cs index b27bcec5..a23b9609 100644 --- a/MiraAPI/Events/Vanilla/Gameplay/IntroEndEvent.cs +++ b/MiraAPI/Events/Vanilla/Gameplay/IntroEndEvent.cs @@ -6,7 +6,7 @@ public class IntroEndEvent(IntroCutscene introCutscene) : MiraEvent { /// - /// Gets the instance of the IntroCutscene. + /// Gets the instance. /// public IntroCutscene IntroCutscene { get; } = introCutscene; } diff --git a/MiraAPI/Events/Vanilla/Gameplay/IntroRoleRevealEvent.cs b/MiraAPI/Events/Vanilla/Gameplay/IntroRoleRevealEvent.cs index 809ce116..1ffdf677 100644 --- a/MiraAPI/Events/Vanilla/Gameplay/IntroRoleRevealEvent.cs +++ b/MiraAPI/Events/Vanilla/Gameplay/IntroRoleRevealEvent.cs @@ -6,7 +6,7 @@ public class IntroRoleRevealEvent : MiraEvent { /// - /// Gets the instance of the IntroCutscene. + /// Gets the instance. /// public IntroCutscene IntroCutscene { get; } diff --git a/MiraAPI/Events/Vanilla/Gameplay/RoundStartEvent.cs b/MiraAPI/Events/Vanilla/Gameplay/RoundStartEvent.cs index 470f85a1..93a7bfd7 100644 --- a/MiraAPI/Events/Vanilla/Gameplay/RoundStartEvent.cs +++ b/MiraAPI/Events/Vanilla/Gameplay/RoundStartEvent.cs @@ -1,12 +1,13 @@ namespace MiraAPI.Events.Vanilla.Gameplay; /// -/// Start Round event, invoked on IntroCutscene.OnDestroy and ExileController.WrapUp if the event isn't cancelled. +/// Start Round event, invoked on and +/// if the isn't cancelled. /// public class RoundStartEvent : MiraEvent { /// - /// Gets a value indicating whether the event was triggered by the IntroCutscene or ExileController. + /// Gets a value indicating whether the event was triggered by the or . /// public bool TriggeredByIntro { get; } diff --git a/MiraAPI/Events/Vanilla/Gameplay/SetRoleEvent.cs b/MiraAPI/Events/Vanilla/Gameplay/SetRoleEvent.cs index 4c00cf2d..1ebfd787 100644 --- a/MiraAPI/Events/Vanilla/Gameplay/SetRoleEvent.cs +++ b/MiraAPI/Events/Vanilla/Gameplay/SetRoleEvent.cs @@ -8,7 +8,7 @@ namespace MiraAPI.Events.Vanilla.Gameplay; public class SetRoleEvent : MiraEvent { /// - /// Gets the player whos role was changed. + /// Gets the whose role was changed. /// public PlayerControl Player { get; } diff --git a/MiraAPI/Events/Vanilla/Gameplay/VanillaButtonCancelledEvent.cs b/MiraAPI/Events/Vanilla/Gameplay/VanillaButtonCancelledEvent.cs index 4265a3ac..9e334b8d 100644 --- a/MiraAPI/Events/Vanilla/Gameplay/VanillaButtonCancelledEvent.cs +++ b/MiraAPI/Events/Vanilla/Gameplay/VanillaButtonCancelledEvent.cs @@ -3,20 +3,20 @@ namespace MiraAPI.Events.Vanilla.Gameplay; /// -/// Invoked when a Vanilla Button click is cancelled. Do not use for custom buttons. +/// Invoked when a Vanilla click is cancelled. Do not use for . /// -/// The Vanilla Button type. +/// The vanilla type. public sealed class VanillaButtonCancelledEvent : MiraEvent where T : AbilityButton { /// - /// Gets Vanilla Button whose click was cancelled. + /// Gets the Vanilla whose click was cancelled. /// public T Button { get; } /// /// Initializes a new instance of the class. /// - /// The Mira Button whose click was cancelled. + /// The vanilla whose click was cancelled. public VanillaButtonCancelledEvent(T button) { Button = button; @@ -24,19 +24,19 @@ public sealed class VanillaButtonCancelledEvent : MiraEvent where T : Ability } /// -/// Invoked when a Vanilla Button click is cancelled. Do not use for custom buttons. +/// Invoked when a Vanilla click is cancelled. Do not use for s. /// public sealed class VanillaButtonCancelledEvent : MiraEvent { /// - /// Gets Vanilla Button whose click was cancelled. + /// Gets the Vanilla whose click was cancelled. /// public AbilityButton Button { get; } /// /// Initializes a new instance of the class. /// - /// The Vanilla Button whose click was cancelled. + /// The vanilla whose click was cancelled. public VanillaButtonCancelledEvent(AbilityButton button) { Button = button; diff --git a/MiraAPI/Events/Vanilla/Gameplay/VanillaButtonClickEvent.cs b/MiraAPI/Events/Vanilla/Gameplay/VanillaButtonClickEvent.cs index 3da499b0..563cf669 100644 --- a/MiraAPI/Events/Vanilla/Gameplay/VanillaButtonClickEvent.cs +++ b/MiraAPI/Events/Vanilla/Gameplay/VanillaButtonClickEvent.cs @@ -3,26 +3,26 @@ namespace MiraAPI.Events.Vanilla.Gameplay; /// -/// Button click event for Vanilla Buttons only. Do not use for custom buttons. +/// Button click event for Vanilla s only. Do not use for s. /// -/// The Vanilla Button type. +/// The vanilla type. public sealed class VanillaButtonClickEvent : MiraCancelableEvent where T : AbilityButton { /// - /// Gets Vanilla Button that was clicked. + /// Gets the vanilla that was clicked. /// public T Button { get; } /// - /// Gets the generic click event that is invoked before this button-specific event. + /// Gets the generic that is invoked before this button-specific event. /// public VanillaButtonClickEvent GenericClickEvent { get; } /// /// Initializes a new instance of the class. /// - /// The Mira Button that was clicked. - /// The generic click event invoked before button-specific events. + /// The vanilla that was clicked. + /// The generic invoked before button-specific events. public VanillaButtonClickEvent(T button, VanillaButtonClickEvent genericClickEvent) { GenericClickEvent = genericClickEvent; @@ -31,31 +31,31 @@ public sealed class VanillaButtonClickEvent : MiraCancelableEvent where T : A } /// -/// Button click event for Vanilla Buttons only. Do not use for custom buttons. +/// Button click event for Vanilla only. Do not use for s. /// public sealed class VanillaButtonClickEvent : MiraCancelableEvent { /// - /// Gets Vanilla Button that was clicked. + /// Gets the Vanilla that was clicked. /// public AbilityButton Button { get; } /// - /// Gets the target player, if any, of the Vanilla Button that was clicked. + /// Gets the target , if any, of the Vanilla that was clicked. /// public PlayerControl? PlayerTarget { get; } /// - /// Gets the target vent, if any, of the Vanilla Button that was clicked. + /// Gets the target , if any, of the Vanilla that was clicked. /// public Vent? VentTarget { get; } /// /// Initializes a new instance of the class. /// - /// The Vanilla Button that was clicked. - /// The Player target, if any. - /// The Vent target, if any. + /// The Vanilla that was clicked. + /// The target, if any. + /// The target, if any. public VanillaButtonClickEvent(AbilityButton button, PlayerControl? playerTarget = null, Vent? ventTarget = null) { Button = button; diff --git a/MiraAPI/Events/Vanilla/Map/PlayerOpenSabotageEvent.cs b/MiraAPI/Events/Vanilla/Map/PlayerOpenSabotageEvent.cs index 8b2b6cb5..6415d70a 100644 --- a/MiraAPI/Events/Vanilla/Map/PlayerOpenSabotageEvent.cs +++ b/MiraAPI/Events/Vanilla/Map/PlayerOpenSabotageEvent.cs @@ -6,14 +6,14 @@ public class PlayerOpenSabotageEvent : MiraCancelableEvent { /// - /// Gets the MapBehaviour. + /// Gets the . /// public MapBehaviour MapBehaviour { get; } /// /// Initializes a new instance of the class. /// - /// The MapBehaviour. + /// The . public PlayerOpenSabotageEvent(MapBehaviour mapBehaviour) { MapBehaviour = mapBehaviour; diff --git a/MiraAPI/Events/Vanilla/Map/UpdateSystemEvent.cs b/MiraAPI/Events/Vanilla/Map/UpdateSystemEvent.cs index 5b70090e..5e2219c2 100644 --- a/MiraAPI/Events/Vanilla/Map/UpdateSystemEvent.cs +++ b/MiraAPI/Events/Vanilla/Map/UpdateSystemEvent.cs @@ -1,7 +1,7 @@ namespace MiraAPI.Events.Vanilla.Map; /// -/// Cancelable event that is invoked before a system is updated. Usually used for sabotage events. +/// that is invoked before a system is updated. Usually used for sabotage events. /// public class UpdateSystemEvent : MiraCancelableEvent { @@ -11,7 +11,7 @@ public class UpdateSystemEvent : MiraCancelableEvent public SystemTypes SystemType { get; } /// - /// Gets the player that is updating the system. + /// Gets the that is updating the system. /// public PlayerControl Player { get; } @@ -21,10 +21,10 @@ public class UpdateSystemEvent : MiraCancelableEvent public byte Amount { get; } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - /// The SystemType being updated. - /// The player that is updating the system. + /// The being updated. + /// The that is updating the system. /// Amount to update System to. public UpdateSystemEvent(SystemTypes systemType, PlayerControl player, byte amount) { diff --git a/MiraAPI/Events/Vanilla/Meeting/EjectionEvent.cs b/MiraAPI/Events/Vanilla/Meeting/EjectionEvent.cs index 1d250989..054335c7 100644 --- a/MiraAPI/Events/Vanilla/Meeting/EjectionEvent.cs +++ b/MiraAPI/Events/Vanilla/Meeting/EjectionEvent.cs @@ -6,14 +6,14 @@ public class EjectionEvent : MiraEvent { /// - /// Gets the instance of the ExileController. + /// Gets the instance. /// public ExileController ExileController { get; } /// /// Initializes a new instance of the class. /// - /// The exile controller. + /// The instance. public EjectionEvent(ExileController controller) { ExileController = controller; diff --git a/MiraAPI/Events/Vanilla/Meeting/EndMeetingEvent.cs b/MiraAPI/Events/Vanilla/Meeting/EndMeetingEvent.cs index 55cdae93..98ccaa17 100644 --- a/MiraAPI/Events/Vanilla/Meeting/EndMeetingEvent.cs +++ b/MiraAPI/Events/Vanilla/Meeting/EndMeetingEvent.cs @@ -6,7 +6,7 @@ public class EndMeetingEvent(MeetingHud meetingHud) : MiraEvent { /// - /// Gets the MeetingHud instance. + /// Gets the instance. /// public MeetingHud MeetingHud { get; } = meetingHud; } diff --git a/MiraAPI/Events/Vanilla/Meeting/ReportBodyEvent.cs b/MiraAPI/Events/Vanilla/Meeting/ReportBodyEvent.cs index 5c51576d..fb085b62 100644 --- a/MiraAPI/Events/Vanilla/Meeting/ReportBodyEvent.cs +++ b/MiraAPI/Events/Vanilla/Meeting/ReportBodyEvent.cs @@ -2,7 +2,7 @@ /// /// The event that is invoked when a body is reported. -/// This is invoked in CmdReportBody. +/// This is invoked in . /// public class ReportBodyEvent : MiraCancelableEvent { @@ -12,12 +12,12 @@ public class ReportBodyEvent : MiraCancelableEvent public PlayerControl Reporter { get; } /// - /// Gets the player that is being reported. Will be null for emergency meeting. + /// Gets the player that is being reported. Will be for emergency meeting. /// public NetworkedPlayerInfo? Target { get; } /// - /// Gets the body that is being reported. Will be null for emergency meeting. + /// Gets the that is being reported. Will be for emergency meeting. /// public DeadBody? Body { get; } @@ -26,7 +26,7 @@ public class ReportBodyEvent : MiraCancelableEvent /// /// The player who reported the body. /// The player being reported. - /// The body being reported. + /// The being reported. public ReportBodyEvent(PlayerControl reporter, NetworkedPlayerInfo? target, DeadBody? body) { Reporter = reporter; diff --git a/MiraAPI/Events/Vanilla/Meeting/StartMeetingEvent.cs b/MiraAPI/Events/Vanilla/Meeting/StartMeetingEvent.cs index 78e58f30..0a15d999 100644 --- a/MiraAPI/Events/Vanilla/Meeting/StartMeetingEvent.cs +++ b/MiraAPI/Events/Vanilla/Meeting/StartMeetingEvent.cs @@ -7,14 +7,14 @@ public class StartMeetingEvent : MiraEvent { /// - /// Gets the MeetingHud instance. + /// Gets the instance. /// public MeetingHud MeetingHud { get; } /// /// Initializes a new instance of the class. /// - /// The MeetingHud instance. + /// The instance. public StartMeetingEvent(MeetingHud meetingHud) { MeetingHud = meetingHud; diff --git a/MiraAPI/Events/Vanilla/Meeting/Voting/AfterVoteEvent.cs b/MiraAPI/Events/Vanilla/Meeting/Voting/AfterVoteEvent.cs index 714d3b84..95583f31 100644 --- a/MiraAPI/Events/Vanilla/Meeting/Voting/AfterVoteEvent.cs +++ b/MiraAPI/Events/Vanilla/Meeting/Voting/AfterVoteEvent.cs @@ -8,7 +8,7 @@ namespace MiraAPI.Events.Vanilla.Meeting.Voting; public class AfterVoteEvent : MiraEvent { /// - /// Gets the instance of the voter's vote data. + /// Gets the instance of the voter's . /// public PlayerVoteArea VoteArea { get; } @@ -20,7 +20,7 @@ public class AfterVoteEvent : MiraEvent /// /// Initializes a new instance of the class. /// - /// The player vote area that was voted on. + /// The that was voted on. /// The player who voted. public AfterVoteEvent(PlayerVoteArea playerVoteArea, PlayerControl voter) { diff --git a/MiraAPI/Events/Vanilla/Meeting/Voting/BeforeVoteEvent.cs b/MiraAPI/Events/Vanilla/Meeting/Voting/BeforeVoteEvent.cs index 1d8d9077..74fde386 100644 --- a/MiraAPI/Events/Vanilla/Meeting/Voting/BeforeVoteEvent.cs +++ b/MiraAPI/Events/Vanilla/Meeting/Voting/BeforeVoteEvent.cs @@ -8,7 +8,7 @@ namespace MiraAPI.Events.Vanilla.Meeting.Voting; public class BeforeVoteEvent : MiraCancelableEvent { /// - /// Gets the instance of the voter's vote data. + /// Gets the instance of the voter's . /// public PlayerVoteArea VoteArea { get; } @@ -20,7 +20,7 @@ public class BeforeVoteEvent : MiraCancelableEvent /// /// Initializes a new instance of the class. /// - /// The player vote area that was voted on. + /// The that was voted on. /// The player who voted. public BeforeVoteEvent(PlayerVoteArea playerVoteArea, PlayerControl voter) { diff --git a/MiraAPI/Events/Vanilla/Meeting/Voting/CheckForEndVotingEvent.cs b/MiraAPI/Events/Vanilla/Meeting/Voting/CheckForEndVotingEvent.cs index b0bdae5f..988cdc47 100644 --- a/MiraAPI/Events/Vanilla/Meeting/Voting/CheckForEndVotingEvent.cs +++ b/MiraAPI/Events/Vanilla/Meeting/Voting/CheckForEndVotingEvent.cs @@ -18,7 +18,7 @@ public class CheckForEndVotingEvent : MiraCancelableEvent /// /// Initializes a new instance of the class. /// - /// >True if voting is complete, false otherwise. + /// if voting is complete, otherwise. public CheckForEndVotingEvent(bool isVotingComplete) { IsVotingComplete = isVotingComplete; diff --git a/MiraAPI/Events/Vanilla/Meeting/Voting/DummyVoteEvent.cs b/MiraAPI/Events/Vanilla/Meeting/Voting/DummyVoteEvent.cs index 2f5cba09..ea3aa691 100644 --- a/MiraAPI/Events/Vanilla/Meeting/Voting/DummyVoteEvent.cs +++ b/MiraAPI/Events/Vanilla/Meeting/Voting/DummyVoteEvent.cs @@ -15,7 +15,7 @@ public class DummyVoteEvent : MiraCancelableEvent public DummyBehaviour Dummy { get; } /// - /// Gets the instance of the dummy's vote data. + /// Gets the instance of the dummy's . /// public PlayerVoteData VoteData { get; } diff --git a/MiraAPI/Events/Vanilla/Meeting/Voting/HandleVoteEvent.cs b/MiraAPI/Events/Vanilla/Meeting/Voting/HandleVoteEvent.cs index 48ec40fd..c4457785 100644 --- a/MiraAPI/Events/Vanilla/Meeting/Voting/HandleVoteEvent.cs +++ b/MiraAPI/Events/Vanilla/Meeting/Voting/HandleVoteEvent.cs @@ -5,12 +5,12 @@ namespace MiraAPI.Events.Vanilla.Meeting.Voting; /// /// The event that is invoked when Mira handles a vote. This is invoked before Mira's behaviour, so be cautious. /// If you intend on adding custom vote behaviour, cancel the event and do so. -/// If you are NOT canceling the event, keep in mind that Mira automatically removes a vote and adds the suspect to the VotedPlayers list after this event is invoked. +/// If you are NOT canceling the event, keep in mind that Mira automatically removes a vote and adds the suspect to the list after this event is invoked. /// public class HandleVoteEvent : MiraCancelableEvent { /// - /// Gets the instance of the voter's vote data. + /// Gets the instance of the voter's . /// public PlayerVoteData VoteData { get; } @@ -30,14 +30,14 @@ public class HandleVoteEvent : MiraCancelableEvent public bool PreventVote { get; } /// - /// Gets the player info of the target. + /// Gets the of the target. /// public NetworkedPlayerInfo TargetPlayerInfo { get; } /// /// Initializes a new instance of the class. /// - /// The voter's data. + /// The voter's . /// The target's playerId. public HandleVoteEvent(PlayerVoteData playerVoteData, byte targetId) { diff --git a/MiraAPI/Events/Vanilla/Meeting/Voting/MeetingSelectEvent.cs b/MiraAPI/Events/Vanilla/Meeting/Voting/MeetingSelectEvent.cs index 6ea8eff1..0c3f6d53 100644 --- a/MiraAPI/Events/Vanilla/Meeting/Voting/MeetingSelectEvent.cs +++ b/MiraAPI/Events/Vanilla/Meeting/Voting/MeetingSelectEvent.cs @@ -8,7 +8,7 @@ namespace MiraAPI.Events.Vanilla.Meeting.Voting; public class MeetingSelectEvent : MiraEvent { /// - /// Gets the instance of the voter's vote data. + /// Gets the instance of the voter's . /// public PlayerVoteData VoteData { get; } @@ -18,7 +18,7 @@ public class MeetingSelectEvent : MiraEvent public int TargetId { get; } /// - /// Gets the player info of the target. + /// Gets the of the target. /// public NetworkedPlayerInfo TargetPlayerInfo { get; } @@ -30,9 +30,9 @@ public class MeetingSelectEvent : MiraEvent /// /// Initializes a new instance of the class. /// - /// The voter's data. + /// The voter's . /// The target's playerId. - /// >Whether the player is allowed to select the target. + /// Whether the player is allowed to select the target. public MeetingSelectEvent(PlayerVoteData playerVoteData, int targetId, bool allowSelect) { VoteData = playerVoteData; diff --git a/MiraAPI/Events/Vanilla/Meeting/Voting/PopulateResultsEvent.cs b/MiraAPI/Events/Vanilla/Meeting/Voting/PopulateResultsEvent.cs index 131b6d58..f5e40014 100644 --- a/MiraAPI/Events/Vanilla/Meeting/Voting/PopulateResultsEvent.cs +++ b/MiraAPI/Events/Vanilla/Meeting/Voting/PopulateResultsEvent.cs @@ -4,20 +4,20 @@ using MiraAPI.Voting; namespace MiraAPI.Events.Vanilla.Meeting.Voting; /// -/// Called in VotingUtils.HandlePopulateResults. +/// Called in . /// Cancelling is NOT advised but if you do plan on cancelling, please ensure you account for displaying ALL player's votes. /// public class PopulateResultsEvent : MiraCancelableEvent { /// - /// Gets a list of networked votes. + /// Gets a list of networked s. /// public List Votes { get; } /// /// Initializes a new instance of the class. /// - /// The list of votes. + /// The list of s. public PopulateResultsEvent(List votes) { Votes = votes; diff --git a/MiraAPI/Events/Vanilla/Meeting/Voting/ProcessVotesEvent.cs b/MiraAPI/Events/Vanilla/Meeting/Voting/ProcessVotesEvent.cs index 9ecaab0b..a61cc513 100644 --- a/MiraAPI/Events/Vanilla/Meeting/Voting/ProcessVotesEvent.cs +++ b/MiraAPI/Events/Vanilla/Meeting/Voting/ProcessVotesEvent.cs @@ -10,8 +10,8 @@ namespace MiraAPI.Events.Vanilla.Meeting.Voting; /// /// Initializes a new instance of the class. /// -/// >The list of votes that are being processed. -/// The player to be exiled. Will be null if no player is to be exiled. +/// The list of s that are being processed. +/// The player to be exiled. Will be if no player is to be exiled. public class ProcessVotesEvent(List votes, NetworkedPlayerInfo? exiledPlayer = null) : MiraEvent { private readonly List _originalVotes = [.. votes]; @@ -29,12 +29,12 @@ public class ProcessVotesEvent(List votes, NetworkedPlayerInfo? exil public bool VotesModified => !Votes.SequenceEqual(_originalVotes); /// - /// Gets the list of votes that are being processed. + /// Gets the list of s that are being processed. /// public List Votes { get; } = votes; /// - /// Gets or sets the player to be exiled. Will be null if no player is to be exiled. + /// Gets or sets the player to be exiled. Will be if no player is to be exiled. /// public NetworkedPlayerInfo? ExiledPlayer { diff --git a/MiraAPI/Events/Vanilla/Meeting/Voting/VotingCompleteEvent.cs b/MiraAPI/Events/Vanilla/Meeting/Voting/VotingCompleteEvent.cs index 5f782bfc..52d4c369 100644 --- a/MiraAPI/Events/Vanilla/Meeting/Voting/VotingCompleteEvent.cs +++ b/MiraAPI/Events/Vanilla/Meeting/Voting/VotingCompleteEvent.cs @@ -3,11 +3,11 @@ /// /// The event that is invoked when the voting phase of a meeting is complete. /// -/// The MeetingHud instance. +/// The instance. public class VotingCompleteEvent(MeetingHud meetingHud) : MiraEvent { /// - /// Gets the MeetingHud instance. + /// Gets the instance. /// public MeetingHud MeetingHud { get; } = meetingHud; } diff --git a/MiraAPI/Events/Vanilla/Player/CompleteHnsTaskEvent.cs b/MiraAPI/Events/Vanilla/Player/CompleteHnsTaskEvent.cs index 7d8f71dd..5ac71900 100644 --- a/MiraAPI/Events/Vanilla/Player/CompleteHnsTaskEvent.cs +++ b/MiraAPI/Events/Vanilla/Player/CompleteHnsTaskEvent.cs @@ -16,14 +16,14 @@ public class CompleteHnsTaskEvent : MiraEvent public PlayerTask Task { get; } /// - /// Gets the instance of the attached to the game. + /// Gets the instance of the attached to the game. /// public HideAndSeekManager HnsManager { get; } /// /// Initializes a new instance of the class. /// - /// The Hide and Seek Manager currently active. + /// The currently active. /// The player who completed the task. /// The task that the player completed. public CompleteHnsTaskEvent(HideAndSeekManager hnsManager, PlayerControl player, PlayerTask task) diff --git a/MiraAPI/Events/Vanilla/Player/PlayerDeathEvent.cs b/MiraAPI/Events/Vanilla/Player/PlayerDeathEvent.cs index 9b1ae49f..3821af48 100644 --- a/MiraAPI/Events/Vanilla/Player/PlayerDeathEvent.cs +++ b/MiraAPI/Events/Vanilla/Player/PlayerDeathEvent.cs @@ -16,7 +16,7 @@ public class PlayerDeathEvent : MiraEvent public DeathReason DeathReason { get; } /// - /// Gets the dead body associated with the player, if any. + /// Gets the associated with the player, if any. /// public DeadBody? DeadBody { get; } @@ -25,7 +25,7 @@ public class PlayerDeathEvent : MiraEvent /// /// The player who died. /// The reason the player died. - /// The player's body, if it exists. + /// The player's , if it exists. public PlayerDeathEvent(PlayerControl player, DeathReason reason, DeadBody? deadBody) { Player = player; diff --git a/MiraAPI/Events/Vanilla/Usables/EnterVentEvent.cs b/MiraAPI/Events/Vanilla/Usables/EnterVentEvent.cs index ce3b3ca5..233e6ee7 100644 --- a/MiraAPI/Events/Vanilla/Usables/EnterVentEvent.cs +++ b/MiraAPI/Events/Vanilla/Usables/EnterVentEvent.cs @@ -6,20 +6,20 @@ public class EnterVentEvent : MiraCancelableEvent { /// - /// Gets the player that is entering the vent. + /// Gets the that is entering the . /// public PlayerControl Player { get; } /// - /// Gets the vent that the player is entering. + /// Gets the that the is entering. /// public Vent? Vent { get; } /// /// Initializes a new instance of the class. /// - /// The player that is entering the vent. - /// The vent being entered. + /// The that is entering the . + /// The being entered. public EnterVentEvent(PlayerControl player, Vent? vent) { Player = player; diff --git a/MiraAPI/Events/Vanilla/Usables/ExitVentEvent.cs b/MiraAPI/Events/Vanilla/Usables/ExitVentEvent.cs index 351411fd..61949055 100644 --- a/MiraAPI/Events/Vanilla/Usables/ExitVentEvent.cs +++ b/MiraAPI/Events/Vanilla/Usables/ExitVentEvent.cs @@ -6,20 +6,20 @@ public class ExitVentEvent : MiraCancelableEvent { /// - /// Gets the player that is exiting the vent. + /// Gets the that is exiting the . /// public PlayerControl Player { get; } /// - /// Gets the vent that the player is exiting. + /// Gets the that the is exiting. /// public Vent? Vent { get; } /// /// Initializes a new instance of the class. /// - /// The player who is exiting the vent. - /// The vent being exited from. + /// The who is exiting the . + /// The being exited from. public ExitVentEvent(PlayerControl player, Vent? vent) { Player = player; diff --git a/MiraAPI/Events/Vanilla/Usables/PlayerCanUseEvent.cs b/MiraAPI/Events/Vanilla/Usables/PlayerCanUseEvent.cs index f9ba115c..9dced791 100644 --- a/MiraAPI/Events/Vanilla/Usables/PlayerCanUseEvent.cs +++ b/MiraAPI/Events/Vanilla/Usables/PlayerCanUseEvent.cs @@ -8,7 +8,7 @@ public class PlayerCanUseEvent : PlayerUseEvent /// /// Initializes a new instance of the class. /// - /// The IUsable. + /// The . public PlayerCanUseEvent(IUsable usable) : base(usable) { } diff --git a/MiraAPI/Events/Vanilla/Usables/PlayerUseEvent.cs b/MiraAPI/Events/Vanilla/Usables/PlayerUseEvent.cs index 5f056762..7fc5cd54 100644 --- a/MiraAPI/Events/Vanilla/Usables/PlayerUseEvent.cs +++ b/MiraAPI/Events/Vanilla/Usables/PlayerUseEvent.cs @@ -11,19 +11,19 @@ public class PlayerUseEvent : MiraCancelableEvent public IUsable Usable { get; } /// - /// Gets a value indicating whether the IUsable is a , , or . + /// Gets a value indicating whether the is a , , or . /// public bool IsPrimaryConsole { get; } /// - /// Gets a value indicating whether the IUsable is a . + /// Gets a value indicating whether the is a . /// public bool IsVent { get; } /// /// Initializes a new instance of the class. /// - /// The IUsable. + /// The . public PlayerUseEvent(IUsable usable) { Usable = usable; diff --git a/MiraAPI/GameEnd/CustomGameOver.cs b/MiraAPI/GameEnd/CustomGameOver.cs index 70d7b273..bb9e23bd 100644 --- a/MiraAPI/GameEnd/CustomGameOver.cs +++ b/MiraAPI/GameEnd/CustomGameOver.cs @@ -10,44 +10,44 @@ namespace MiraAPI.GameEnd; public abstract class CustomGameOver { /// - /// Gets the current CustomGameOver. + /// Gets the current . /// public static CustomGameOver? Instance { get; internal set; } /// - /// Verifies if the condition for this CustomGameOver is met. + /// Verifies if the condition for this is met. /// - /// The PlayerControl that requested the Game Over. + /// The that requested the Game Over. /// The collection of winners. - /// True if the condition is met, otherwise false. + /// if the condition is met, otherwise . public virtual bool VerifyCondition(PlayerControl playerControl, NetworkedPlayerInfo[] winners) { return true; } /// - /// Runs before the base game calls EndGameManager.SetEverythingUp. + /// Runs before the base game calls . /// - /// The EndGameManager instance. - /// Return True to use the run the original method, return False to skip it. + /// The instance. + /// Return to use the run the original method, return to skip it. public virtual bool BeforeEndGameSetup(EndGameManager endGameManager) { return true; } /// - /// Runs after the base game calls EndGameManager.SetEverythingUp. + /// Runs after the base game calls . /// - /// The EndGameManager instance. + /// The instance. public virtual void AfterEndGameSetup(EndGameManager endGameManager) { } /// - /// Get the GameOverReason associated with this CustomGameOver. + /// Get the associated with this . /// /// Type of the custom game over. - /// The GameOverReason associated with the custom game over. + /// The associated with the custom game over. public static GameOverReason GameOverReason() where T : CustomGameOver { return (GameOverReason)GameOverManager.GetGameOverId(); @@ -67,10 +67,10 @@ public abstract class CustomGameOver } /// - /// Implicitly convert a CustomGameOver to a GameOverReason. + /// Implicitly convert a to a . /// - /// The CustomGameOver instance. - /// The GameOverReason associated with the CustomGameOver. + /// The instance. + /// The associated with the CustomGameOver. public static implicit operator GameOverReason(CustomGameOver gameOver) { return (GameOverReason)GameOverManager.GetGameOverId(gameOver.GetType()); diff --git a/MiraAPI/GameEnd/GameOverManager.cs b/MiraAPI/GameEnd/GameOverManager.cs index 8bc6f1ed..eb398358 100644 --- a/MiraAPI/GameEnd/GameOverManager.cs +++ b/MiraAPI/GameEnd/GameOverManager.cs @@ -6,7 +6,7 @@ using Reactor.Utilities; namespace MiraAPI.GameEnd; /// -/// Manage custom game overs. +/// Manage s. /// public static class GameOverManager { @@ -16,11 +16,11 @@ public static class GameOverManager private static int _nextId = Enum.GetNames().Length; /// - /// Register a custom game over. + /// Register a . /// - /// Type of the custom game over. - /// Thrown when the type is not a subclass of CustomGameOver, is abstract, or does not have a parameterless constructor. - /// >True if the game over was registered successfully, false otherwise. + /// Type of the . + /// Thrown when the type is not a subclass of , is abstract, or does not have a parameterless constructor. + /// if the game over was registered successfully, otherwise. public static bool RegisterGameOver(Type gameOverType) { if (!typeof(CustomGameOver).IsAssignableFrom(gameOverType)) @@ -47,11 +47,11 @@ public static class GameOverManager } /// - /// Create an instance of a custom game over. + /// Create an instance of a . /// - /// ID of the custom game over. - /// The created instance of the custom game over. - /// An instance of the custom game over. + /// ID of the . + /// The created instance of the . + /// An instance of the . public static bool TryGetGameOver(int id, [NotNullWhen(true)] out CustomGameOver? customGameOver) { if (GameOverTypes.TryGetValue(id, out var gameOverType)) @@ -65,20 +65,20 @@ public static class GameOverManager } /// - /// Get the ID of a custom game over. + /// Get the ID of a . /// - /// Type of the custom game over. - /// The ID of the custom game over. + /// Type of the . + /// The ID of the . public static int GetGameOverId() where T : CustomGameOver { return GetGameOverId(typeof(T)); } /// - /// Get the ID of a custom game over. + /// Get the ID of a . /// - /// Type of the custom game over. - /// The ID of the custom game over. + /// Type of the . + /// The ID of the . /// Thrown when the type is not registered. public static int GetGameOverId(Type gameOverType) { diff --git a/MiraAPI/GameModes/CustomGameMode.cs b/MiraAPI/GameModes/CustomGameMode.cs index c7cf6397..f4dc43dd 100644 --- a/MiraAPI/GameModes/CustomGameMode.cs +++ b/MiraAPI/GameModes/CustomGameMode.cs @@ -23,24 +23,24 @@ public abstract class CustomGameMode public abstract int Id { get; } /// - /// Called when Intro Cutscene is destroyed. + /// Called when is destroyed. /// public virtual void Initialize() { } /// - /// Called on HudManager.Start(). + /// Called on . /// - /// Instance of HudManager. + /// Instance of . public virtual void HudStart(HudManager instance) { } /// - /// Called every frame on HudManager.Update(). + /// Called every frame on . /// - /// Instance of HudManager. + /// Instance of . public virtual void HudUpdate(HudManager instance) { } @@ -48,7 +48,7 @@ public abstract class CustomGameMode /// /// Called when a player is killed. /// - /// PlayerControl that was killed. + /// that was killed. public virtual void OnDeath(PlayerControl player) { } @@ -57,7 +57,7 @@ public abstract class CustomGameMode /// Calculate Game End logic. /// /// Should original game end logic be used. - /// Instance of LogicGameFlowNormal. + /// Instance of . public virtual void CheckGameEnd(out bool runOriginal, LogicGameFlowNormal instance) { runOriginal = true; @@ -67,7 +67,7 @@ public abstract class CustomGameMode /// Custom role assignment. /// /// Should original role assignment be used. - /// Instance of LogicRoleSelection. + /// Instance of . public virtual void AssignRoles(out bool runOriginal, LogicRoleSelectionNormal instance) { runOriginal = true; @@ -78,7 +78,7 @@ public abstract class CustomGameMode /// /// Should the original murder logic be used. /// Result of custom murder logic. - /// Target player for murder. + /// Target for murder. public virtual void CanKill(out bool runOriginal, out bool result, PlayerControl target) { result = false; @@ -88,60 +88,60 @@ public abstract class CustomGameMode /// /// Should Roles Settings be available when this gamemode is selected. /// - /// True if Role Settings are enabled in this game mode. + /// if Role Settings are enabled in this game mode. public virtual bool AreRoleSettingsEnabled() => true; /// /// Should Game Settings be available when this gamemode is selected. /// - /// True if Game Settings are enabled in this mode. + /// if Game Settings are enabled in this mode. public virtual bool AreGameSettingsEnabled() => true; /// /// Custom winner selection. /// - /// List of winners or null. + /// List of winners or . public virtual List? CalculateWinners() => null; /// - /// Show gamemode in Intro Cutscene. + /// Show gamemode in . /// - /// True if the game mode should be shown in the intro cutscene. + /// if the game mode should be shown in the intro cutscene. public virtual bool ShowGameModeIntroCutscene() => false; /// /// Can Admin be used in this gamemode. /// /// Admin Console. - /// True if Admin console is enabled. + /// if Admin console is enabled. public virtual bool CanUseMapConsole(MapConsole console) => true; /// - /// Can a body be reported in this gamemode. + /// Can a be reported in this gamemode. /// - /// Target body for reporting. - /// True if dead bodies can be reported. + /// Target for reporting. + /// if s can be reported. public virtual bool CanReport(DeadBody body) => true; /// - /// Can system consoles be used in this gamemode. + /// Can s be used in this gamemode. /// /// System Console. - /// True if system consoles are enabled in this mode. + /// if s are enabled in this mode. public virtual bool CanUseSystemConsole(SystemConsole console) => true; /// /// Can tasks be interacted with in this gamemode. /// /// Task console. - /// True if tasks are enabled in this mode. + /// if tasks are enabled in this mode. public virtual bool CanUseTasks(Console console) => true; /// /// Should the sabotage map be used when attempting to open sabotage overlay. /// - /// MapBehaviour object. - /// True if the sabotage map should be shown. + /// object. + /// if the sabotage map should be shown. public virtual bool ShouldShowSabotageMap(MapBehaviour map) => true; /// @@ -149,6 +149,6 @@ public abstract class CustomGameMode /// /// Target vent. /// Player attempting to vent. - /// True if venting is enabled in this mode. + /// if venting is enabled in this mode. public virtual bool CanVent(Vent vent, NetworkedPlayerInfo playerInfo) => true; } diff --git a/MiraAPI/GameModes/CustomGameModeManager.cs b/MiraAPI/GameModes/CustomGameModeManager.cs index 0e5d2d7e..7e274c48 100644 --- a/MiraAPI/GameModes/CustomGameModeManager.cs +++ b/MiraAPI/GameModes/CustomGameModeManager.cs @@ -6,12 +6,12 @@ using Reactor.Utilities; namespace MiraAPI.GameModes; /// -/// Manages custom gamemodes. +/// Manages s. /// public static class CustomGameModeManager { /// - /// List of registered gamemodes. + /// List of registered . /// internal static readonly Dictionary GameModes = []; @@ -21,14 +21,14 @@ public static class CustomGameModeManager } /// - /// Gets the current gamemode. + /// Gets the current . /// public static CustomGameMode? ActiveMode { get; internal set; } = new DefaultMode(); /// - /// Set current gamemode. + /// Set current . /// - /// gamemode ID. + /// ID. public static void SetGameMode(int id) { if (GameModes.TryGetValue(id, out var gameMode)) @@ -41,9 +41,9 @@ public static class CustomGameModeManager } /// - /// Register gamemode from type. + /// Register from type. /// - /// Type of gamemode class, should inherit from . + /// Type of , should inherit from . internal static void RegisterGameMode(Type gameModeType) { if (!typeof(CustomGameMode).IsAssignableFrom(gameModeType)) diff --git a/MiraAPI/GameOptions/AbstractOptionGroup.cs b/MiraAPI/GameOptions/AbstractOptionGroup.cs index 51e18bd5..f21a3cb7 100644 --- a/MiraAPI/GameOptions/AbstractOptionGroup.cs +++ b/MiraAPI/GameOptions/AbstractOptionGroup.cs @@ -29,9 +29,12 @@ public abstract class AbstractOptionGroup public virtual Type? OptionableType => null; /// - /// Gets a value indicating whether the group should be shown in the modifiers menu. This is deprecated, please use ParentMenu! + /// Gets a value indicating whether the group should be shown in the modifiers menu. /// // TODO: make this not a boolean +#pragma warning disable S1133 + [Obsolete("Use ParentMenu instead.")] +#pragma warning restore S1133 public virtual bool ShowInModifiersMenu => false; /// @@ -45,13 +48,13 @@ public abstract class AbstractOptionGroup public virtual Func GroupVisible => () => true; /// - /// Gets the group color. This is used to color the group in the options menu. + /// Gets the group . This is used to color the group in the options menu. /// public virtual Color GroupColor => MiraApiPlugin.DefaultHeaderColor; /// /// Gets the group priority. This is used to determine the order in which groups are displayed in the options menu. - /// Zero is the highest priority, and the default value is the max uint value. + /// Zero is the highest priority, and the default value is the max value. /// public virtual uint GroupPriority => uint.MaxValue; @@ -90,11 +93,33 @@ public abstract class AbstractOptionGroup : AbstractOptionGroup where T : IOp } } +/// +/// Menu categories for option groups. +/// public enum MenuCategory { + /// + /// Determines the option group is in the game settings tab. + /// Game, + + /// + /// Determines the option group is in the role settings tab. + /// Roles, + + /// + /// Determines the option group is in the modifier settings tab. + /// Modifiers, + + /// + /// Determines the option group is in the first custom settings tab. + /// CustomOne, - CustomTwo + + /// + /// Determines the option group is in the second custom settings tab. + /// + CustomTwo, } diff --git a/MiraAPI/GameOptions/Attributes/ModdedEnumOptionAttribute.cs b/MiraAPI/GameOptions/Attributes/ModdedEnumOptionAttribute.cs index 54680f2c..5c937b63 100644 --- a/MiraAPI/GameOptions/Attributes/ModdedEnumOptionAttribute.cs +++ b/MiraAPI/GameOptions/Attributes/ModdedEnumOptionAttribute.cs @@ -5,7 +5,7 @@ using MiraAPI.GameOptions.OptionTypes; namespace MiraAPI.GameOptions.Attributes; /// -/// Attribute for creating an enum option. +/// Attribute for creating a . /// [AttributeUsage(AttributeTargets.Property)] public class ModdedEnumOptionAttribute(string title, Type enumType, string[]? values = null) diff --git a/MiraAPI/GameOptions/Attributes/ModdedNumberOptionAttribute.cs b/MiraAPI/GameOptions/Attributes/ModdedNumberOptionAttribute.cs index 63dc82fe..6ff98dca 100644 --- a/MiraAPI/GameOptions/Attributes/ModdedNumberOptionAttribute.cs +++ b/MiraAPI/GameOptions/Attributes/ModdedNumberOptionAttribute.cs @@ -6,7 +6,7 @@ using MiraAPI.Utilities; namespace MiraAPI.GameOptions.Attributes; /// -/// A number option attribute for the modded options system. +/// Attribute for a . /// [AttributeUsage(AttributeTargets.Property)] public class ModdedNumberOptionAttribute( diff --git a/MiraAPI/GameOptions/Attributes/ModdedOptionAttribute.cs b/MiraAPI/GameOptions/Attributes/ModdedOptionAttribute.cs index 702d75e3..02daa255 100644 --- a/MiraAPI/GameOptions/Attributes/ModdedOptionAttribute.cs +++ b/MiraAPI/GameOptions/Attributes/ModdedOptionAttribute.cs @@ -4,7 +4,7 @@ using System.Reflection; namespace MiraAPI.GameOptions.Attributes; /// -/// Represents an attribute that is used to define a modded option. +/// Represents an attribute that is used to define an . /// /// The option title. /// Optional parameter to specify a role Type. @@ -26,13 +26,13 @@ public abstract class ModdedOptionAttribute(string title, Type? roleType = null) /// /// Sets the value of the option. /// - /// The new value as an object. + /// The new value as an . public abstract void SetValue(object value); /// /// Gets the value of the option. /// - /// The value of the option as an object. + /// The value of the option as an . public abstract object GetValue(); internal abstract IModdedOption? CreateOption(object? value, PropertyInfo property); diff --git a/MiraAPI/GameOptions/Attributes/ModdedToggleOptionAttribute.cs b/MiraAPI/GameOptions/Attributes/ModdedToggleOptionAttribute.cs index 0ad64da0..2fccf1f1 100644 --- a/MiraAPI/GameOptions/Attributes/ModdedToggleOptionAttribute.cs +++ b/MiraAPI/GameOptions/Attributes/ModdedToggleOptionAttribute.cs @@ -5,7 +5,7 @@ using MiraAPI.GameOptions.OptionTypes; namespace MiraAPI.GameOptions.Attributes; /// -/// Attribute for a toggle option. +/// Attribute for a . /// /// The option title. [AttributeUsage(AttributeTargets.Property)] diff --git a/MiraAPI/GameOptions/IModdedOption.cs b/MiraAPI/GameOptions/IModdedOption.cs index 5a3c3f8f..907ab7de 100644 --- a/MiraAPI/GameOptions/IModdedOption.cs +++ b/MiraAPI/GameOptions/IModdedOption.cs @@ -22,22 +22,22 @@ public interface IModdedOption string Title { get; set; } /// - /// Gets the StringName for the option, used for localization. + /// Gets the for the option, used for localization. /// StringNames StringName { get; } /// - /// Gets or sets the MiraPlugin that created this option. + /// Gets or sets the that created this option. /// IMiraPlugin? ParentMod { get; set; } /// - /// Gets the game setting data for the option. + /// Gets the for the option. /// BaseGameSetting Data { get; } /// - /// Gets the OptionBehaviour object of the option. + /// Gets the object of the option. /// OptionBehaviour? OptionBehaviour { get; } @@ -52,55 +52,55 @@ public interface IModdedOption bool IncludeInPreset { get; set; } /// - /// Gets or sets the ConfigDefinition for the option, used for BepInEx configuration. + /// Gets or sets the for the option, used for BepInEx configuration. /// ConfigDefinition? ConfigDefinition { get; set; } /// /// Creates the option behaviour for the modded option. /// - /// The ToggleOption template. - /// The NumberOption template. - /// The StringOption template. - /// The PlayerOption template. - /// >The Transform container for the option. - /// >The created OptionBehaviour object. + /// The template. + /// The template. + /// The template. + /// The template. + /// The container for the option. + /// The created object. OptionBehaviour CreateOption(ToggleOption toggleOpt, NumberOption numberOpt, StringOption stringOpt, PlayerOption playerOpt, Transform container); /// - /// Gets the value as a float. + /// Gets the value as a . /// - /// >The value of the option as a float. + /// The value of the option as a . float GetFloatData(); /// - /// Gets the NetData for the option, used for network synchronization. + /// Gets the for the option, used for network synchronization. /// - /// >Returns the NetData object for the option. + /// Returns the object for the option. NetData GetNetData(); /// /// Handles incoming network data for the option. /// - /// >The byte array representing the network data. + /// The byte array representing the network data. void HandleNetData(byte[] data); /// /// Saves the option to a preset configuration file. /// - /// The ConfigFile representing the preset configuration. + /// The representing the preset configuration. /// Indicates whether to save the default value instead of the current value. void SaveToPreset(ConfigFile presetConfig, bool saveDefault = false); /// /// Binds the option to a configuration file. /// - /// The ConfigFile to bind the option to. + /// The to bind the option to. void Bind(ConfigFile config); /// /// Loads the option from a preset configuration file, applying the values to the option's configuration. /// - /// The ConfigFile representing the preset configuration. + /// The representing the preset configuration. void LoadFromPreset(ConfigFile presetConfig); } diff --git a/MiraAPI/GameOptions/MiraNumberOptionComponent.cs b/MiraAPI/GameOptions/MiraNumberOptionComponent.cs index dce033d9..8cfa4562 100644 --- a/MiraAPI/GameOptions/MiraNumberOptionComponent.cs +++ b/MiraAPI/GameOptions/MiraNumberOptionComponent.cs @@ -13,7 +13,7 @@ namespace MiraAPI.GameOptions; public class MiraNumberOptionComponent(IntPtr cppPtr) : MonoBehaviour(cppPtr) { /// - /// Gets or sets the modded option associated with the object. + /// Gets or sets the associated with the object. /// [HideFromIl2Cpp] public ModdedNumberOption NumberOption { get; set; } diff --git a/MiraAPI/GameOptions/ModdedOptionsManager.cs b/MiraAPI/GameOptions/ModdedOptionsManager.cs index 3b85a73c..3e6e04ea 100644 --- a/MiraAPI/GameOptions/ModdedOptionsManager.cs +++ b/MiraAPI/GameOptions/ModdedOptionsManager.cs @@ -16,7 +16,7 @@ using Reactor.Utilities; namespace MiraAPI.GameOptions; /// -/// Handles modded options. +/// Handles s. /// public static class ModdedOptionsManager { @@ -192,7 +192,7 @@ public static class ModdedOptionsManager /// /// The original getter method. /// The result of the property getter. - /// False so the original getter gets skipped. + /// so the original getter gets skipped. #pragma warning disable CA1707 [SuppressMessage("ReSharper", "InconsistentNaming", Justification = "Harmony naming convention")] public static bool PropertyGetterPatch(MethodBase __originalMethod, ref object __result) diff --git a/MiraAPI/GameOptions/OptionGroupSingleton.cs b/MiraAPI/GameOptions/OptionGroupSingleton.cs index 53b20297..a521d7d2 100644 --- a/MiraAPI/GameOptions/OptionGroupSingleton.cs +++ b/MiraAPI/GameOptions/OptionGroupSingleton.cs @@ -3,7 +3,7 @@ namespace MiraAPI.GameOptions; /// -/// Singleton for option groups. +/// Singleton for s. /// /// The option group type. public static class OptionGroupSingleton where T : AbstractOptionGroup @@ -11,7 +11,7 @@ public static class OptionGroupSingleton where T : AbstractOptionGroup private static T? _instance; /// - /// Gets the instance of the option group. + /// Gets the instance of the group. /// #pragma warning disable CA1000 public static T Instance => _instance ??= ModdedOptionsManager.Groups.OfType().Single(); diff --git a/MiraAPI/GameOptions/OptionTypes/ModdedEnumOption.cs b/MiraAPI/GameOptions/OptionTypes/ModdedEnumOption.cs index 48f74513..1f92418c 100644 --- a/MiraAPI/GameOptions/OptionTypes/ModdedEnumOption.cs +++ b/MiraAPI/GameOptions/OptionTypes/ModdedEnumOption.cs @@ -11,7 +11,7 @@ using Object = UnityEngine.Object; namespace MiraAPI.GameOptions.OptionTypes; /// -/// An option for selecting an enum value. +/// An option for selecting an value. /// public class ModdedEnumOption : ModdedOption { @@ -25,8 +25,8 @@ public class ModdedEnumOption : ModdedOption /// /// The title of the option. /// The default value as an int. - /// The Enum type. - /// An option list of string values to use in place of the enum name. + /// The type. + /// An option list of string values to use in place of the name. /// Whether to include this option in the preset or not. public ModdedEnumOption(string title, int defaultValue, Type enumType, string[]? values = null, bool includeInPreset=true) : base(title, defaultValue, includeInPreset) { @@ -104,13 +104,13 @@ public class ModdedEnumOption : ModdedOption } /// -/// An option for selecting an enum value. +/// An option for selecting an value. /// -/// The enum type. +/// The type. public class ModdedEnumOption : ModdedOption where T : Enum { /// - /// Gets the string values of the enum. + /// Gets the string values of the . /// public string[] Values { get; } @@ -118,8 +118,8 @@ public class ModdedEnumOption : ModdedOption where T : Enum /// Initializes a new instance of the class. /// /// The title of the option. - /// The default value as an int. - /// An option list of string values to use in place of the enum name. + /// The default value as an . + /// An option list of string values to use in place of the name. /// Whether to include this option in the preset or not. public ModdedEnumOption(string title, T defaultValue, string[]? values = null, bool includeInPreset=true) : base(title, defaultValue, includeInPreset) { diff --git a/MiraAPI/GameOptions/OptionTypes/ModdedNumberOption.cs b/MiraAPI/GameOptions/OptionTypes/ModdedNumberOption.cs index b9a1f597..1a5ef337 100644 --- a/MiraAPI/GameOptions/OptionTypes/ModdedNumberOption.cs +++ b/MiraAPI/GameOptions/OptionTypes/ModdedNumberOption.cs @@ -237,7 +237,7 @@ public class ModdedNumberOption : ModdedOption } /// - /// Implicitly converts the option to an int. + /// Implicitly converts the option to an . /// /// The option. /// Integer value. diff --git a/MiraAPI/GameOptions/OptionTypes/ModdedPlayerOption.cs b/MiraAPI/GameOptions/OptionTypes/ModdedPlayerOption.cs index dd2f7720..f6516cd4 100644 --- a/MiraAPI/GameOptions/OptionTypes/ModdedPlayerOption.cs +++ b/MiraAPI/GameOptions/OptionTypes/ModdedPlayerOption.cs @@ -9,7 +9,7 @@ using Object = UnityEngine.Object; namespace MiraAPI.GameOptions.OptionTypes; /// -/// An option for selecting an ingame player. It returns an index of the values list, NOT A PLAYER ID. To get a player out of this, index the Values list. +/// An option for selecting an ingame player. It returns an index of the values list, NOT A PLAYER ID. To get a player out of this, index the list. /// public class ModdedPlayerOption : ModdedOption { @@ -91,9 +91,9 @@ public class ModdedPlayerOption : ModdedOption } /// - /// Returns a player from the value. If AllowNone is enabled and none is enabled this will return null. + /// Returns a player from the value. If is enabled and none is enabled this will return . /// - /// A player or null if chosen none. + /// A player or if chosen none. public NetworkedPlayerInfo? GetPlayerValue() { return Value < 0 ? null : Values[Value]; diff --git a/MiraAPI/Hud/ButtonLocation.cs b/MiraAPI/Hud/ButtonLocation.cs index da117373..a8045d78 100644 --- a/MiraAPI/Hud/ButtonLocation.cs +++ b/MiraAPI/Hud/ButtonLocation.cs @@ -1,7 +1,7 @@ namespace MiraAPI.Hud; /// -/// The location of the custom button on the screen. +/// The location of the on the screen. /// public enum ButtonLocation { diff --git a/MiraAPI/Hud/ButtonUsesMode.cs b/MiraAPI/Hud/ButtonUsesMode.cs index 2c43300f..82558d75 100644 --- a/MiraAPI/Hud/ButtonUsesMode.cs +++ b/MiraAPI/Hud/ButtonUsesMode.cs @@ -1,7 +1,7 @@ namespace MiraAPI.Hud; /// -/// The uses mode for custom buttons. +/// The uses mode for s. /// public enum ButtonUsesMode { diff --git a/MiraAPI/Hud/CustomActionButton.cs b/MiraAPI/Hud/CustomActionButton.cs index e54c10c3..f5cf5215 100644 --- a/MiraAPI/Hud/CustomActionButton.cs +++ b/MiraAPI/Hud/CustomActionButton.cs @@ -18,7 +18,7 @@ using Object = UnityEngine.Object; namespace MiraAPI.Hud; /// -/// Class for making custom action buttons. More customizable than the default Action/Ability buttons in the base game. +/// Class for making custom action buttons. More customizable than the default /s in the base game. /// public abstract class CustomActionButton { @@ -54,7 +54,7 @@ public abstract class CustomActionButton public virtual string CooldownTimerFormatString => "0"; /// - /// Gets a value indicating whether the button has an effect ability. By default true if is greater than 0. + /// Gets a value indicating whether the button has an effect ability. By default if is greater than 0. /// public virtual bool HasEffect => EffectDuration > 0; @@ -79,17 +79,17 @@ public abstract class CustomActionButton public virtual ButtonUsesMode UsesMode => ButtonUsesMode.PerGame; /// - /// Gets the keybind for this button. If null, no keybind will be added. + /// Gets the keybind for this button. If , no keybind will be added. /// public virtual BaseKeybind? Keybind => null; /// - /// Gets the button's text outline color. + /// Gets the button's text outline . /// public virtual Color TextOutlineColor => Color.clear; /// - /// Gets or sets the location of the button on the screen. + /// Gets or sets the on the screen. /// public virtual ButtonLocation Location { get; set; } = ButtonLocation.BottomLeft; @@ -119,12 +119,12 @@ public abstract class CustomActionButton public float Timer { get; set; } /// - /// Gets or sets the button object in game. This is created by Mira API automatically. + /// Gets or sets the object in game. This is created by Mira API automatically. /// public ActionButton? Button { get; set; } /// - /// Gets the gameObject used for the keybind icon. + /// Gets the used for the keybind icon. /// public GameObject? KeybindIcon { get; private set; } @@ -316,18 +316,18 @@ public abstract class CustomActionButton } /// - /// A utility function to change the outline color of the button's text. + /// A utility function to change the outline of the button's text. /// - /// The new color. + /// The new . public virtual void SetTextOutline(Color color) { Button?.buttonLabelText.SetOutlineColor(color); } /// - /// A utility function to override the sprite of the button. + /// A utility function to override the of the button. /// - /// The new sprite to override with. + /// The new to override with. public virtual void OverrideSprite(Sprite sprite) { if (Button != null) @@ -415,7 +415,7 @@ public abstract class CustomActionButton } /// - /// A utility function that runs with the local PlayerControl's FixedUpdate if the button is enabled. + /// A utility function that runs with the local player's if the button is enabled. /// /// the local PlayerControl. protected virtual void FixedUpdate(PlayerControl playerControl) @@ -429,10 +429,10 @@ public abstract class CustomActionButton /// /// This method determines if the button should be active or not. - /// True means the button is active, false means the button is disabled. + /// means the button is active, means the button is disabled. /// - /// The role of the local player. - /// True if the button is enabled, false otherwise. + /// The of the local player. + /// if the button is enabled, otherwise. public abstract bool Enabled(RoleBehaviour? role); /// @@ -445,7 +445,7 @@ public abstract class CustomActionButton /// /// Returns a value indicating whether the effect can be ended early by the player. - /// Always false by default. + /// Always by default. /// /// Can the effect be canceled. public virtual bool IsEffectCancellable() => false; @@ -473,12 +473,12 @@ public abstract class CustomActionButton } /// - /// This method is called on the HudManager.SetHudActive method. It determines whether the button should be visible or not. - /// The default behavior is to show the button if the parameter and the method return true. + /// This method is called on the method. It determines whether the button should be visible or not. + /// The default behavior is to show the button if the parameter and the method return . /// It can be overridden for custom behavior. /// - /// Passed in from HudManager.SetHudActive, should hud be active. - /// Passed in from HudManager.SetHudActive, the current role of the player. + /// Passed in from , should hud be active. + /// Passed in from , the current role of the player. public virtual void SetActive(bool visible, RoleBehaviour role) { Button?.ToggleVisible(visible && Enabled(role)); @@ -522,7 +522,7 @@ public abstract class CustomActionButton } /// - /// This method is called on the PlayerControl.FixedUpdate method. It is a wrapper for the method. + /// This method is called on the method. It is a wrapper for the method. /// By default, it handles the cooldown and effect timers, and sets the button to enabled or disabled. /// It can be overridden for custom behavior. /// @@ -580,39 +580,39 @@ public abstract class CustomActionButton } /// -/// Custom action button that has a target object. +/// Custom action button that has a target . /// /// The type of the target object. public abstract class CustomActionButton : CustomActionButton where T : MonoBehaviour { /// - /// Gets or sets the target object of the button. + /// Gets or sets the target of the button. /// public T? Target { get; set; } /// - /// Gets the distance the player must be from the target object to use the button. + /// Gets the distance the player must be from the target to use the button. /// public virtual float Distance => PlayerControl.LocalPlayer.Data.Role.GetAbilityDistance(); /// - /// Determines if the target object is valid. + /// Determines if the target is valid. /// - /// The target object being checked. - /// True if the target object is valid, false otherwise. + /// The target being checked. + /// if the target is valid, otherwise. public virtual bool IsTargetValid(T? target) { return target != null; } /// - /// The method used to get the target object. + /// The method used to get the target . /// - /// The target object or null if it isn't found. + /// The target or if it isn't found. public abstract T? GetTarget(); /// - /// Sets the outline of the target object. + /// Sets the outline of the target . /// /// Should the outline be active. public abstract void SetOutline(bool active); diff --git a/MiraAPI/Hud/CustomButtonManager.cs b/MiraAPI/Hud/CustomButtonManager.cs index 8e57c400..5a1ba3b3 100644 --- a/MiraAPI/Hud/CustomButtonManager.cs +++ b/MiraAPI/Hud/CustomButtonManager.cs @@ -9,12 +9,12 @@ using UnityEngine; namespace MiraAPI.Hud; /// -/// Custom button manager for handling custom buttons. +/// Custom button manager for handling s. /// public static class CustomButtonManager { /// - /// Gets a list of all registered custom buttons. + /// Gets a list of all registered custom s. /// public static ReadOnlyCollection Buttons { get; internal set; } = new([]); diff --git a/MiraAPI/Hud/CustomButtonSingleton.cs b/MiraAPI/Hud/CustomButtonSingleton.cs index daa5467a..957445bb 100644 --- a/MiraAPI/Hud/CustomButtonSingleton.cs +++ b/MiraAPI/Hud/CustomButtonSingleton.cs @@ -4,7 +4,7 @@ using System.Linq; namespace MiraAPI.Hud; /// -/// A utility class to get the instance of a custom action button. +/// A utility class to get the instance of a . /// /// The type of the button you are trying to access. public static class CustomButtonSingleton where T : CustomActionButton @@ -12,7 +12,7 @@ public static class CustomButtonSingleton where T : CustomActionButton private static T? _instance; /// - /// Gets the instance of the button. + /// Gets the instance of the button. /// [SuppressMessage("Design", "CA1000:Do not declare static members on generic types", Justification = "This is a utility class to get the instance of a custom action button.")] public static T Instance => _instance ??= CustomButtonManager.CustomButtons.OfType().Single(); diff --git a/MiraAPI/Hud/CustomPlayerMenu.cs b/MiraAPI/Hud/CustomPlayerMenu.cs index 56d9f0ee..fb27f14a 100644 --- a/MiraAPI/Hud/CustomPlayerMenu.cs +++ b/MiraAPI/Hud/CustomPlayerMenu.cs @@ -15,9 +15,9 @@ using UnityEngine.Events; namespace MiraAPI.Hud; /// -/// Custom Player Menu using the ShapeshifterPanel as a base. +/// Custom Player Menu using the as a base. /// -/// Used by Il2Cpp. Do not use constructor, this is a MonoBehaviour. +/// Used by Il2Cpp. Do not use constructor, this is a . [RegisterInIl2Cpp] [SuppressMessage("Design", "CA1051:Do not declare visible instance fields", Justification = "Unity Convention")] [SuppressMessage("StyleCop.CSharp.NamingRules", "SA1307:Accessible fields should begin with upper-case letter", Justification = "Unity Convention")] @@ -34,9 +34,9 @@ public class CustomPlayerMenu(IntPtr il2CppPtr) : Minigame(il2CppPtr) public List potentialVictims; /// - /// Creates a CustomPlayerMenu. + /// Creates a . /// - /// New CustomPlayerMenu object. + /// New object. public static CustomPlayerMenu Create() { var shapeShifterRole = RoleManager.Instance.GetRole(RoleTypes.Shapeshifter); @@ -84,7 +84,7 @@ public class CustomPlayerMenu(IntPtr il2CppPtr) : Minigame(il2CppPtr) /// Begins/opens the custom player menu. /// /// Function to determine if player should show in the custom menu. - /// Onclick action for player. + /// action for player. [HideFromIl2Cpp] public void Begin(Func playerMatch, Action onClick) { @@ -96,7 +96,7 @@ public class CustomPlayerMenu(IntPtr il2CppPtr) : Minigame(il2CppPtr) onClick(null); })); - DestroyableSingleton.Instance.Analytics.MinigameOpened(PlayerControl.LocalPlayer.Data, TaskType); + DebugAnalytics.Instance.Analytics.MinigameOpened(PlayerControl.LocalPlayer.Data, TaskType); var list = PlayerControl.AllPlayerControls.ToArray().Where(playerMatch).ToList(); potentialVictims = []; var list2 = new Il2CppSystem.Collections.Generic.List(); diff --git a/MiraAPI/Hud/MultiTargetButton.cs b/MiraAPI/Hud/MultiTargetButton.cs index 8c1ae34f..12458d42 100644 --- a/MiraAPI/Hud/MultiTargetButton.cs +++ b/MiraAPI/Hud/MultiTargetButton.cs @@ -6,7 +6,7 @@ using UnityEngine; namespace MiraAPI.Hud; /// -/// Custom action button that has multiple target objects. +/// that has multiple target objects. /// /// The type of the target objects. public abstract class MultiTargetButton : CustomActionButton where T : MonoBehaviour @@ -36,8 +36,11 @@ public abstract class MultiTargetButton : CustomActionButton where T : MonoBe /// The list of target objects. public abstract T[] GetTargets(); - /// - /// The target object to set the oultine. + /// + /// Sets the outline of the target . + /// + /// The target to set the oultine. + /// Should the outline be active. public abstract void SetOutline(T target, bool active); /// diff --git a/MiraAPI/Keybinds/BaseKeybind.cs b/MiraAPI/Keybinds/BaseKeybind.cs index 525ffefe..e9407ed1 100644 --- a/MiraAPI/Keybinds/BaseKeybind.cs +++ b/MiraAPI/Keybinds/BaseKeybind.cs @@ -14,7 +14,7 @@ public class BaseKeybind public InputAction? RewiredInputAction { get; internal set; } /// - /// Gets the unique identifier for this keybind. Used in Rewired. + /// Gets or sets the unique identifier for this keybind. Used in Rewired. /// public string Id { get; protected set; } diff --git a/MiraAPI/Keybinds/KeybindManager.cs b/MiraAPI/Keybinds/KeybindManager.cs index c4e1cd18..207fab59 100644 --- a/MiraAPI/Keybinds/KeybindManager.cs +++ b/MiraAPI/Keybinds/KeybindManager.cs @@ -9,12 +9,12 @@ using Rewired; namespace MiraAPI.Keybinds; /// -/// Lets you register and manage mod keybinds with conflict checks and rebinding support. +/// Lets you register and manage mod s with conflict checks and rebinding support. /// public static class KeybindManager { /// - /// Gets a list of all registered keybinds. + /// Gets a list of all registered s. /// public static List Keybinds { get; } = new(); @@ -49,7 +49,7 @@ public static class KeybindManager } /// - /// Returns all conflicts where keybinds use the same key. + /// Returns all conflicts where s use the same key. /// /// A list of pairs of keybinds that conflict. public static Dictionary> GetConflicts() @@ -77,11 +77,11 @@ public static class KeybindManager } /// - /// Returns all keybinds for a specified keycode. + /// Returns all s for a specified keycode. /// /// The key to look for. /// /// Should only exlusive keybinds be present. - /// The list of keybinds. + /// The list of s. public static MiraKeybind[] GetKeybindsForKey(KeyboardKeyCode keyCode, bool exclusiveCheck = false) { var all = new List(); diff --git a/MiraAPI/Keybinds/KeybindUtils.cs b/MiraAPI/Keybinds/KeybindUtils.cs index f4371b30..7a316be0 100644 --- a/MiraAPI/Keybinds/KeybindUtils.cs +++ b/MiraAPI/Keybinds/KeybindUtils.cs @@ -14,9 +14,9 @@ public static class KeybindUtils public static InputManager_Base? RewiredInputManager { get; internal set; } /// - /// Returns the currently assigned keycode of a keybind. + /// Returns the currently assigned keycode of a . /// - /// The keybind to get the keycode from. + /// The to get the keycode from. /// The currently assigned keycode. public static KeyboardKeyCode GetKeycodeByKeybind(BaseKeybind keybind) { @@ -29,7 +29,7 @@ public static class KeybindUtils } /// - /// Gets the keycode for an action with ReInput. + /// Gets the keycode for an action with . /// /// The action ID. /// The keyboard keycode. @@ -39,7 +39,7 @@ public static class KeybindUtils } /// - /// Gets a by id with ReInput. + /// Gets a by id with . /// /// The action ID. /// The keyboard keycode. @@ -65,7 +65,7 @@ public static class KeybindUtils /// The KeyCode to skip during the search. /// /// The first available KeyCode not currently used by any registered keybind, - /// or KeyCode.None if none are available. + /// or if none are available. /// public static KeyboardKeyCode FindAvailableKey(KeyboardKeyCode exclude) { diff --git a/MiraAPI/Keybinds/MiraGlobalKeybinds.cs b/MiraAPI/Keybinds/MiraGlobalKeybinds.cs index ab41c2cc..f945ca91 100644 --- a/MiraAPI/Keybinds/MiraGlobalKeybinds.cs +++ b/MiraAPI/Keybinds/MiraGlobalKeybinds.cs @@ -3,7 +3,7 @@ namespace MiraAPI.Keybinds; /// -/// Class containing all default keybinds. +/// Class containing all default s. /// Recommended for cross-mod compatibility. /// [RegisterCustomKeybinds] diff --git a/MiraAPI/Keybinds/MiraKeybind.cs b/MiraAPI/Keybinds/MiraKeybind.cs index 0ce47ea5..d2b58475 100644 --- a/MiraAPI/Keybinds/MiraKeybind.cs +++ b/MiraAPI/Keybinds/MiraKeybind.cs @@ -19,8 +19,8 @@ public class MiraKeybind : BaseKeybind public KeyboardKeyCode DefaultKey { get; } /// - /// Gets the modifier keys assigned to this keybind. - /// Due to Rewired limitations, there can only be 3 modifier keys. + /// Gets the s assigned to this keybind. + /// Due to Rewired limitations, there can only be 3 s. /// public ModifierKey[] ModifierKeys { get; } @@ -36,7 +36,7 @@ public class MiraKeybind : BaseKeybind /// /// The name of the keybind. /// The default keycode. - /// Up to 3 optional modifier keys. + /// Up to 3 optional s. /// Is exclusive. public MiraKeybind( string name, diff --git a/MiraAPI/Keybinds/RegisterCustomKeybindsAttribute.cs b/MiraAPI/Keybinds/RegisterCustomKeybindsAttribute.cs index 3af9f4e0..088f1588 100644 --- a/MiraAPI/Keybinds/RegisterCustomKeybindsAttribute.cs +++ b/MiraAPI/Keybinds/RegisterCustomKeybindsAttribute.cs @@ -3,7 +3,7 @@ namespace MiraAPI.Keybinds; /// -/// Used to mark a class for custom keybinds registration. +/// Used to mark a class for s registration. /// [AttributeUsage(AttributeTargets.Class)] public class RegisterCustomKeybindsAttribute : Attribute; diff --git a/MiraAPI/Keybinds/VanillaKeybind.cs b/MiraAPI/Keybinds/VanillaKeybind.cs index 8911b499..594e5831 100644 --- a/MiraAPI/Keybinds/VanillaKeybind.cs +++ b/MiraAPI/Keybinds/VanillaKeybind.cs @@ -1,4 +1,5 @@ -using Rewired; +using System.Globalization; +using Rewired; namespace MiraAPI.Keybinds; @@ -19,6 +20,6 @@ public class VanillaKeybind : BaseKeybind public VanillaKeybind(int id) { RewiredInputAction = KeybindUtils.GetInputActionById(id); - Id = RewiredInputAction != null ? RewiredInputAction.name : id.ToString(); + Id = RewiredInputAction != null ? RewiredInputAction.name : id.ToString(CultureInfo.InvariantCulture); } } diff --git a/MiraAPI/Keybinds/VanillaKeybindSingleton.cs b/MiraAPI/Keybinds/VanillaKeybindSingleton.cs index 980da77e..5876fcb0 100644 --- a/MiraAPI/Keybinds/VanillaKeybindSingleton.cs +++ b/MiraAPI/Keybinds/VanillaKeybindSingleton.cs @@ -1,15 +1,15 @@ namespace MiraAPI.Keybinds; /// -/// Singleton for getting a vanilla keybind by . +/// Singleton for getting a by . /// -/// ActionButton type. +/// type. public static class VanillaKeybinding where T : ActionButton { private static VanillaKeybind? _instance; /// - /// Gets the instance of the option group. + /// Gets the instance of the . /// #pragma warning disable CA1000 public static VanillaKeybind Instance => _instance ??= KeybindManager.VanillaKeybinds[typeof(T)]; diff --git a/MiraAPI/LocalSettings/Attributes/LocalEnumSettingAttribute.cs b/MiraAPI/LocalSettings/Attributes/LocalEnumSettingAttribute.cs index f1148187..c0608ff8 100644 --- a/MiraAPI/LocalSettings/Attributes/LocalEnumSettingAttribute.cs +++ b/MiraAPI/LocalSettings/Attributes/LocalEnumSettingAttribute.cs @@ -5,9 +5,9 @@ using MiraAPI.LocalSettings.SettingTypes; namespace MiraAPI.LocalSettings.Attributes; /// -/// Creates an enum setting for the . +/// Creates a for the . /// -/// Optional custom enum names. +/// Optional custom names. /// [AttributeUsage(AttributeTargets.Property)] public class LocalEnumSettingAttribute( diff --git a/MiraAPI/LocalSettings/Attributes/LocalNumberSettingAttribute.cs b/MiraAPI/LocalSettings/Attributes/LocalNumberSettingAttribute.cs index 79d4cc74..b5d681ca 100644 --- a/MiraAPI/LocalSettings/Attributes/LocalNumberSettingAttribute.cs +++ b/MiraAPI/LocalSettings/Attributes/LocalNumberSettingAttribute.cs @@ -6,7 +6,7 @@ using MiraAPI.Utilities; namespace MiraAPI.LocalSettings.Attributes; /// -/// Creates a number setting for the . +/// Creates a for the . /// /// Minimum range. /// Maximum range. diff --git a/MiraAPI/LocalSettings/Attributes/LocalSettingAttribute.cs b/MiraAPI/LocalSettings/Attributes/LocalSettingAttribute.cs index d966cbba..5aaef818 100644 --- a/MiraAPI/LocalSettings/Attributes/LocalSettingAttribute.cs +++ b/MiraAPI/LocalSettings/Attributes/LocalSettingAttribute.cs @@ -15,10 +15,10 @@ public abstract class LocalSettingAttribute( ) : Attribute { /// - /// Returns the created setting object. + /// Returns the created object. /// /// Gets the tab where the setting is located. /// Gets the config entry the setting is attached to. - /// The created class. + /// The created . public abstract ILocalSetting CreateSetting(Type tab, ConfigEntryBase configEntryBase); } diff --git a/MiraAPI/LocalSettings/Attributes/LocalSliderSettingAttribute.cs b/MiraAPI/LocalSettings/Attributes/LocalSliderSettingAttribute.cs index c8e57129..9e14a8e3 100644 --- a/MiraAPI/LocalSettings/Attributes/LocalSliderSettingAttribute.cs +++ b/MiraAPI/LocalSettings/Attributes/LocalSliderSettingAttribute.cs @@ -6,7 +6,7 @@ using MiraAPI.Utilities; namespace MiraAPI.LocalSettings.Attributes; /// -/// Creates a slider setting for the . +/// Creates a for the . /// /// /// Minimum range. diff --git a/MiraAPI/LocalSettings/Attributes/LocalToggleSettingAttribute.cs b/MiraAPI/LocalSettings/Attributes/LocalToggleSettingAttribute.cs index 2d2aa14c..22ca7aa1 100644 --- a/MiraAPI/LocalSettings/Attributes/LocalToggleSettingAttribute.cs +++ b/MiraAPI/LocalSettings/Attributes/LocalToggleSettingAttribute.cs @@ -5,7 +5,7 @@ using MiraAPI.LocalSettings.SettingTypes; namespace MiraAPI.LocalSettings.Attributes; /// -/// Creates a toggle setting for the . +/// Creates a for the . /// /// [AttributeUsage(AttributeTargets.Property)] diff --git a/MiraAPI/LocalSettings/ILocalSetting.cs b/MiraAPI/LocalSettings/ILocalSetting.cs index a94e1022..b51a13dc 100644 --- a/MiraAPI/LocalSettings/ILocalSetting.cs +++ b/MiraAPI/LocalSettings/ILocalSetting.cs @@ -19,7 +19,7 @@ public interface ILocalSetting string Description { get; } /// - /// Gets the setting's gameobject. + /// Gets the setting's . /// GameObject? Setting { get; } @@ -31,12 +31,12 @@ public interface ILocalSetting /// /// Used to create the setting. /// - /// Toggle template. - /// Slider template. - /// The parent of the setting. + /// template. + /// template. + /// The parent of the setting. /// The offset. /// The order. /// Whether it's the last on the row. - /// The created setting. + /// The created setting's . GameObject? CreateOption(ToggleButtonBehaviour toggle, SlideBar slider, Transform parent, ref float offset, ref int order, bool last); } diff --git a/MiraAPI/LocalSettings/LocalSettingsButton.cs b/MiraAPI/LocalSettings/LocalSettingsButton.cs index fa0c0bfa..6f1fa57a 100644 --- a/MiraAPI/LocalSettings/LocalSettingsButton.cs +++ b/MiraAPI/LocalSettings/LocalSettingsButton.cs @@ -10,7 +10,7 @@ using Object = UnityEngine.Object; namespace MiraAPI.LocalSettings; /// -/// Represents a local settings button. +/// Represents a button. /// public class LocalSettingsButton(string text, Action onClick) { @@ -25,7 +25,7 @@ public class LocalSettingsButton(string text, Action onClick) public Action OnClick { get; set; } = onClick; /// - /// Gets the tab instance this button belongs to. + /// Gets the instance this button belongs to. /// public LocalSettingsTab? Tab { get; internal set; } diff --git a/MiraAPI/LocalSettings/LocalSettingsManager.cs b/MiraAPI/LocalSettings/LocalSettingsManager.cs index 79e15f72..2f6fc164 100644 --- a/MiraAPI/LocalSettings/LocalSettingsManager.cs +++ b/MiraAPI/LocalSettings/LocalSettingsManager.cs @@ -8,7 +8,7 @@ using Reactor.Utilities; namespace MiraAPI.LocalSettings; /// -/// Manages local settings. +/// Manages s. /// public static class LocalSettingsManager { diff --git a/MiraAPI/LocalSettings/LocalSettingsTab.cs b/MiraAPI/LocalSettings/LocalSettingsTab.cs index 8b9ede83..074d7dbe 100644 --- a/MiraAPI/LocalSettings/LocalSettingsTab.cs +++ b/MiraAPI/LocalSettings/LocalSettingsTab.cs @@ -23,7 +23,7 @@ public abstract class LocalSettingsTab(ConfigFile config) public abstract string TabName { get; } /// - /// Gets the tab appearance. + /// Gets the tab's . /// public virtual LocalSettingTabAppearance TabAppearance { get; } = new(); @@ -38,7 +38,7 @@ public abstract class LocalSettingsTab(ConfigFile config) protected virtual bool ShouldCreateLabels => true; /// - /// Gets the mod's config file. Automatically found in the plugin loader. + /// Gets the mod's . Automatically found in the plugin loader. /// public ConfigFile Config { get; } = config ?? throw new ArgumentNullException(nameof(config)); @@ -48,12 +48,12 @@ public abstract class LocalSettingsTab(ConfigFile config) public TabGroup? TabButton { get; internal set; } /// - /// Gets the list of settings. + /// Gets the list of s. /// public List Settings { get; } = []; /// - /// Gets the list of buttons. + /// Gets the list of s. /// public List Buttons { get; } = []; diff --git a/MiraAPI/LocalSettings/LocalSettingsTabAppearance.cs b/MiraAPI/LocalSettings/LocalSettingsTabAppearance.cs index 9692be48..34b3646e 100644 --- a/MiraAPI/LocalSettings/LocalSettingsTabAppearance.cs +++ b/MiraAPI/LocalSettings/LocalSettingsTabAppearance.cs @@ -4,93 +4,93 @@ using UnityEngine; namespace MiraAPI.LocalSettings; /// -/// Struct for modifying tab appearance. +/// Struct for modifying appearance. /// Defines how the settings look. /// public record struct LocalSettingTabAppearance() { /// - /// Gets or sets main color of the tab. + /// Gets or sets the main of the . /// public Color TabColor { get; set; } = Color.white; /// - /// Gets or sets tab button icon. No icon by default. + /// Gets or sets the button icon. No icon by default. /// public LoadableAsset? TabIcon { get; set; } /// - /// Gets or sets color of the tab button. + /// Gets or sets the of the button. /// public Color TabButtonColor { get; set; } = Color.white; /// - /// Gets or sets a value indicating whether the icon should be hidden when tab button is hovered. + /// Gets or sets a value indicating whether the icon should be hidden when the button is hovered. /// public bool HideIconOnHover { get; set; } = true; /// - /// Gets or sets hover color of the tab button. + /// Gets or sets the hover of the button. /// public Color TabButtonHoverColor { get; set; } = Palette.AcceptedGreen; /// - /// Gets or sets active color of the tab button. + /// Gets or sets the active of the button. /// public Color TabButtonActiveColor { get; set; } = Palette.AcceptedGreen; /// - /// Gets or sets hover color of toggles. + /// Gets or sets the hover of s. /// public Color ToggleHoverColor { get; set; } = Palette.AcceptedGreen; /// - /// Gets or sets active color of toggles. + /// Gets or sets the active of s. /// public Color ToggleActiveColor { get; set; } = Palette.AcceptedGreen; /// - /// Gets or sets inactive color of toggles. + /// Gets or sets the inactive of s. /// public Color ToggleInactiveColor { get; set; } = Color.red; /// - /// Gets or sets color of number buttons. + /// Gets or sets the of buttons. /// public Color NumberColor { get; set; } = Color.white; /// - /// Gets or sets hover color of number buttons. + /// Gets or sets the hover of buttons. /// public Color NumberHoverColor { get; set; } = Palette.AcceptedGreen; /// - /// Gets or sets color of sliders. + /// Gets or sets the of s. /// public Color SliderColor { get; set; } = Color.white; /// - /// Gets or sets hover color of sliders. + /// Gets or sets the hover of s. /// public Color SliderHoverColor { get; set; } = Palette.AcceptedGreen; /// - /// Gets or sets color of enum buttons. + /// Gets or sets the of buttons. /// public Color EnumColor { get; set; } = Color.white; /// - /// Gets or sets hover color of enum buttons. + /// Gets or sets the hover of buttons. /// public Color EnumHoverColor { get; set; } = Palette.AcceptedGreen; /// - /// Gets or sets color of buttons. + /// Gets or sets the of buttons. /// public Color ButtonColor { get; set; } = Color.white; /// - /// Gets or sets hover color of buttons. + /// Gets or sets the hover of buttons. /// public Color ButtonHoverColor { get; set; } = Palette.AcceptedGreen; } diff --git a/MiraAPI/LocalSettings/LocalSettingsTabSingleton.cs b/MiraAPI/LocalSettings/LocalSettingsTabSingleton.cs index eec81a2f..a435fa4b 100644 --- a/MiraAPI/LocalSettings/LocalSettingsTabSingleton.cs +++ b/MiraAPI/LocalSettings/LocalSettingsTabSingleton.cs @@ -3,7 +3,7 @@ namespace MiraAPI.LocalSettings; /// -/// Singleton for local settings tabs. +/// Singleton for s. /// /// The settings tab type. public static class LocalSettingsTabSingleton where T : LocalSettingsTab @@ -11,7 +11,7 @@ public static class LocalSettingsTabSingleton where T : LocalSettingsTab private static T? _instance; /// - /// Gets the instance of the setting tab. + /// Gets the instance of the setting tab. /// #pragma warning disable CA1000 public static T Instance => _instance ??= LocalSettingsManager.Tabs.OfType().Single(); diff --git a/MiraAPI/LocalSettings/SettingTypes/LocalEnumSetting.cs b/MiraAPI/LocalSettings/SettingTypes/LocalEnumSetting.cs index 437eed10..78b0278a 100644 --- a/MiraAPI/LocalSettings/SettingTypes/LocalEnumSetting.cs +++ b/MiraAPI/LocalSettings/SettingTypes/LocalEnumSetting.cs @@ -11,17 +11,17 @@ using Object = UnityEngine.Object; namespace MiraAPI.LocalSettings.SettingTypes; /// -/// Local setting class for enums. +/// Local setting class for s. /// public class LocalEnumSetting : LocalSettingBase { /// - /// Gets the enum type of the setting. + /// Gets the type of the setting. /// public Type EnumType { get; } /// - /// Gets the enum values. + /// Gets the values. /// public string[] Values { get; } @@ -29,8 +29,8 @@ public class LocalEnumSetting : LocalSettingBase /// Initializes a new instance of the class. /// /// - /// The enum type. - /// The optional values array to replace the enum names. + /// The type. + /// The optional values array to replace the names. public LocalEnumSetting( Type tab, ConfigEntryBase configEntry, diff --git a/MiraAPI/LocalSettings/SettingTypes/LocalSettingBase.cs b/MiraAPI/LocalSettings/SettingTypes/LocalSettingBase.cs index c25f04e4..52abe601 100644 --- a/MiraAPI/LocalSettings/SettingTypes/LocalSettingBase.cs +++ b/MiraAPI/LocalSettings/SettingTypes/LocalSettingBase.cs @@ -43,6 +43,12 @@ public abstract class LocalSettingBase : ILocalSetting /// /// Creates an instance of the setting. /// + /// Toggle option to create. + /// Slider option to create. + /// The parent options menu. + /// the Y Offset for the option in the menu. + /// The order of the option. + /// Whether the option is the last in a row. /// The created setting. public abstract GameObject CreateOption(ToggleButtonBehaviour toggle, SlideBar slider, Transform parent, ref float offset, ref int order, bool last); @@ -56,9 +62,9 @@ public abstract class LocalSettingBase : ILocalSetting } /// - /// Gets the value of the config entry, cast to the setting type. + /// Gets the value of the config entry, cast to . /// - /// The value. + /// The value. public virtual T GetValue() { return (T)ConfigEntry.BoxedValue; diff --git a/MiraAPI/MiraApiSettings.cs b/MiraAPI/MiraApiSettings.cs index 8e87bde6..fbead710 100644 --- a/MiraAPI/MiraApiSettings.cs +++ b/MiraAPI/MiraApiSettings.cs @@ -9,7 +9,7 @@ using UnityEngine; namespace MiraAPI; /// -/// Mira API Config File Handler. +/// Mira API Handler. /// public class MiraApiSettings(ConfigFile config) : LocalSettingsTab(config) { diff --git a/MiraAPI/ModCompatibility.cs b/MiraAPI/ModCompatibility.cs index 23744ab1..073453b0 100644 --- a/MiraAPI/ModCompatibility.cs +++ b/MiraAPI/ModCompatibility.cs @@ -17,8 +17,8 @@ public static class ModCompatibility /// /// Checks if the Submerged mod is loaded. /// - /// Submerged mod assembly if loaded, null otherwise. - /// True if the Submerged mod is loaded, false otherwise. + /// Submerged mod assembly if loaded, otherwise. + /// if the Submerged mod is loaded, otherwise. public static bool SubmergedLoaded([NotNullWhen(true)] out Assembly? submergedAssembly) { var result = IL2CPPChainloader.Instance.Plugins.TryGetValue(SubmergedId, out var plugin); diff --git a/MiraAPI/Modifiers/AssignmentConfiguration.cs b/MiraAPI/Modifiers/AssignmentConfiguration.cs index fd4f3baf..b594820b 100644 --- a/MiraAPI/Modifiers/AssignmentConfiguration.cs +++ b/MiraAPI/Modifiers/AssignmentConfiguration.cs @@ -1,10 +1,10 @@ namespace MiraAPI.Modifiers; /// -/// Represents the assignment configuration for a game modifier. +/// Represents the assignment configuration for a . /// -/// The default amount of players that can have this modifier in a game. -/// The default chance of the modifier being assigned to a player. -/// Whether Mira should create an amount option for the modifier. -/// Whether Mira should create a chance option for the modifier. +/// The default amount of players that can have this in a game. +/// The default chance of the being assigned to a player. +/// Whether Mira should create an amount option for the . +/// Whether Mira should create a chance option for the . public record struct AssignmentConfiguration(int DefaultAmount, int DefaultChance, bool CreateAmountOption, bool CreateChanceOption); diff --git a/MiraAPI/Modifiers/BaseModifier.cs b/MiraAPI/Modifiers/BaseModifier.cs index 0e31779c..930cc299 100644 --- a/MiraAPI/Modifiers/BaseModifier.cs +++ b/MiraAPI/Modifiers/BaseModifier.cs @@ -12,12 +12,12 @@ namespace MiraAPI.Modifiers; public abstract class BaseModifier : IOptionable { /// - /// Gets the player that the modifier is attached to. + /// Gets the that the modifier is attached to. /// public PlayerControl Player { get; internal set; } = null!; /// - /// Gets the modifier component that the modifier is attached to. + /// Gets the that the modifier is attached to. /// public ModifierComponent? ModifierComponent { get; internal set; } @@ -50,7 +50,7 @@ public abstract class BaseModifier : IOptionable public abstract string ModifierName { get; } /// - /// Gets the modifier icon. Useless if HideOnUi is true. + /// Gets the modifier icon. Useless if is . /// public virtual LoadableAsset? ModifierIcon => null; @@ -65,17 +65,17 @@ public abstract class BaseModifier : IOptionable public virtual bool ShowInFreeplay => false; /// - /// Gets a value indicating the color that should be used for the modifier within freeplay. + /// Gets a value indicating the that should be used for the modifier within freeplay. /// public virtual Color FreeplayFileColor => Color.gray; /// - /// Gets a value indicating whether the modifier is unique. If true, the player can only have one instance of this modifier. + /// Gets a value indicating whether the modifier is unique. If , the player can only have one instance of this modifier. /// public virtual bool Unique => true; /// - /// Gets the HUD description for this modifier. Does nothing if is true. Required to be visible on UI. + /// Gets the HUD description for this modifier. Does nothing if is . Required to be visible on UI. /// /// The description string for the HUD. public virtual string GetDescription() => string.Empty; @@ -95,14 +95,14 @@ public abstract class BaseModifier : IOptionable } /// - /// Called when the modifier is updated. Attached to the ModifierComponent's Update method. + /// Called when the modifier is updated. Attached to 's method. /// public virtual void Update() { } /// - /// Called when the modifier is updated. Attached to the ModifierComponent's FixedUpdate method. + /// Called when the modifier is updated. Attached to 's method. /// public virtual void FixedUpdate() { @@ -126,6 +126,6 @@ public abstract class BaseModifier : IOptionable /// /// Determines whether the player can vent. /// - /// True if the player can vent, false otherwise. Null for no effect. + /// if the player can vent, otherwise. for no effect. public virtual bool? CanVent() => null; } diff --git a/MiraAPI/Modifiers/ModifierComponent.cs b/MiraAPI/Modifiers/ModifierComponent.cs index d64f3662..09e411a2 100644 --- a/MiraAPI/Modifiers/ModifierComponent.cs +++ b/MiraAPI/Modifiers/ModifierComponent.cs @@ -15,13 +15,13 @@ using UnityEngine; namespace MiraAPI.Modifiers; /// -/// The component for handling modifiers. +/// The component for handling s. /// [RegisterInIl2Cpp] public class ModifierComponent(IntPtr cppPtr) : MonoBehaviour(cppPtr) { /// - /// Gets the active modifiers on the player. + /// Gets the active s on the player. /// [HideFromIl2Cpp] public ImmutableList ActiveModifiers { get; private set; } = ImmutableList.Empty; @@ -165,11 +165,11 @@ public class ModifierComponent(IntPtr cppPtr) : MonoBehaviour(cppPtr) } /// - /// Gets a collection of modifiers by type. + /// Gets a collection of . /// - /// The predicate to check the modifier by. - /// The Type of the Modifier. - /// A collection of modifiers. + /// The predicate to check the by. + /// The Type of the e. + /// An of s. [HideFromIl2Cpp] public IEnumerable GetModifiers(Func? predicate=null) where T : BaseModifier { @@ -177,11 +177,11 @@ public class ModifierComponent(IntPtr cppPtr) : MonoBehaviour(cppPtr) } /// - /// Gets a collection of modifiers by type. + /// Gets a collection of s by type. /// /// The modifier type. - /// The predicate to check the modifier by. - /// A collection of modifiers. + /// The predicate to check the by. + /// An of s. [HideFromIl2Cpp] public IEnumerable GetModifiers(Type type, Func? predicate=null) { @@ -189,11 +189,11 @@ public class ModifierComponent(IntPtr cppPtr) : MonoBehaviour(cppPtr) } /// - /// Gets a collection of modifiers by type ID. + /// Gets a collection of s by type ID. /// - /// The modifier's type ID. - /// The predicate to check the modifier by. - /// A collection of modifiers. + /// The 's type ID. + /// The predicate to check the by. + /// An of s. [HideFromIl2Cpp] public IEnumerable GetModifiers(uint id, Func? predicate=null) { @@ -204,12 +204,12 @@ public class ModifierComponent(IntPtr cppPtr) : MonoBehaviour(cppPtr) } /// - /// Tries to get a modifier by its type. + /// Tries to get a . /// - /// The modifier or null. - /// The predicate to check the modifier by. - /// The Type of the Modifier. - /// True if the modifier was found, false otherwise. + /// The or . + /// The predicate to check the by. + /// The Type of the . + /// if the was found, otherwise. [HideFromIl2Cpp] public bool TryGetModifier([NotNullWhen(true)] out T? modifier, Func? predicate = null) where T : BaseModifier { @@ -218,12 +218,12 @@ public class ModifierComponent(IntPtr cppPtr) : MonoBehaviour(cppPtr) } /// - /// Tries to get a modifier by its type. + /// Tries to get a by its type. /// /// The modifier type. - /// The modifier or null. - /// The predicate to check the modifier by. - /// True if the modifier was found, false otherwise. + /// The or . + /// The predicate to check the by. + /// if the was found, otherwise. [HideFromIl2Cpp] public bool TryGetModifier(Type type, [NotNullWhen(true)] out BaseModifier? modifier, Func? predicate = null) { @@ -232,12 +232,12 @@ public class ModifierComponent(IntPtr cppPtr) : MonoBehaviour(cppPtr) } /// - /// Tries to get a modifier by its type ID. + /// Tries to get a by its type ID. /// - /// The modifier type ID. - /// The modifier or null. - /// The predicate to check the modifier by. - /// True if the modifier was found, false otherwise. + /// The 's type ID. + /// The or . + /// The predicate to check the by. + /// if the was found, otherwise. [HideFromIl2Cpp] public bool TryGetModifier(uint id, [NotNullWhen(true)] out BaseModifier? modifier, Func? predicate = null) { @@ -246,11 +246,11 @@ public class ModifierComponent(IntPtr cppPtr) : MonoBehaviour(cppPtr) } /// - /// Tries to get a modifier by its unique ID. + /// Tries to get a by its unique ID. /// - /// The modifier unique ID. - /// The modifier or null. - /// True if the modifier was found, false otherwise. + /// The 's unique ID. + /// The or . + /// if the was found, otherwise. [HideFromIl2Cpp] public bool TryGetModifier(Guid modifierGuid, [NotNullWhen(true)] out BaseModifier? modifier) { @@ -259,11 +259,11 @@ public class ModifierComponent(IntPtr cppPtr) : MonoBehaviour(cppPtr) } /// - /// Gets a modifier by its type. + /// Gets a . /// - /// The predicate to check the modifier by. - /// The Type of the Modifier. - /// The Modifier if it is found, null otherwise. + /// The predicate to check the by. + /// The Type of the . + /// The if it is found, otherwise. [HideFromIl2Cpp] public T? GetModifier(Func? predicate = null) where T : BaseModifier { @@ -271,11 +271,11 @@ public class ModifierComponent(IntPtr cppPtr) : MonoBehaviour(cppPtr) } /// - /// Gets a modifier by its type. + /// Gets a by its type. /// /// The modifier type. - /// The predicate to check the modifier by. - /// The Modifier if it is found, null otherwise. + /// The predicate to check the by. + /// The if it is found, otherwise. [HideFromIl2Cpp] public BaseModifier? GetModifier(Type type, Func? predicate = null) { @@ -283,11 +283,11 @@ public class ModifierComponent(IntPtr cppPtr) : MonoBehaviour(cppPtr) } /// - /// Gets a modifier by its type ID. + /// Gets a by its type ID. /// - /// The modifier ID. - /// The predicate to check the modifier by. - /// The Modifier if it is found, null otherwise. + /// The ID. + /// The predicate to check the by. + /// The if it is found, otherwise. [HideFromIl2Cpp] public BaseModifier? GetModifier(uint id, Func? predicate = null) { @@ -298,10 +298,10 @@ public class ModifierComponent(IntPtr cppPtr) : MonoBehaviour(cppPtr) } /// - /// Gets a modifier by unique ID. + /// Gets a by unique ID. /// - /// The modifier's unique ID. - /// The modifier if it is found, or null. + /// The 's unique ID. + /// The if it is found, or . [HideFromIl2Cpp] public BaseModifier? GetModifier(Guid modifierGuid) { @@ -309,10 +309,10 @@ public class ModifierComponent(IntPtr cppPtr) : MonoBehaviour(cppPtr) } /// - /// Removes a modifier from the player. + /// Removes a from the player. /// - /// The modifier type. - /// The predicate to check the modifier by. + /// The type. + /// The predicate to check the by. [HideFromIl2Cpp] public void RemoveModifier(Func? predicate = null) where T : BaseModifier { @@ -320,10 +320,10 @@ public class ModifierComponent(IntPtr cppPtr) : MonoBehaviour(cppPtr) } /// - /// Removes a modifier from the player. + /// Removes a from the player. /// /// The modifier type. - /// The predicate to check the modifier by. + /// The predicate to check the by. [HideFromIl2Cpp] public void RemoveModifier(Type type, Func? predicate = null) { @@ -344,9 +344,9 @@ public class ModifierComponent(IntPtr cppPtr) : MonoBehaviour(cppPtr) } /// - /// Removes a modifier from the player. + /// Removes a from the player. /// - /// The modifier object. + /// The object. [HideFromIl2Cpp] public void RemoveModifier(BaseModifier modifier) { @@ -360,10 +360,10 @@ public class ModifierComponent(IntPtr cppPtr) : MonoBehaviour(cppPtr) } /// - /// Removes a modifier from the player. + /// Removes a from the player. /// - /// The modifier's type ID. - /// The predicate to check the modifier by. + /// The 's type ID. + /// The predicate to check the by. [HideFromIl2Cpp] public void RemoveModifier(uint typeId, Func? predicate = null) { @@ -373,9 +373,9 @@ public class ModifierComponent(IntPtr cppPtr) : MonoBehaviour(cppPtr) } /// - /// Removes a modifier from the player. + /// Removes a from the player. /// - /// The modifier's unique ID. + /// The 's unique ID. [HideFromIl2Cpp] public void RemoveModifier(Guid uniqueId) { @@ -390,11 +390,11 @@ public class ModifierComponent(IntPtr cppPtr) : MonoBehaviour(cppPtr) } /// - /// Adds a modifier to the player. + /// Adds a to the player. /// - /// The arguments to initialize the modifier constructor with. - /// The Type of the modifier. - /// The new modifier. + /// The arguments to initialize the with. + /// The Type of the . + /// The new . [HideFromIl2Cpp] public T? AddModifier(params object[] args) where T : BaseModifier { @@ -402,10 +402,10 @@ public class ModifierComponent(IntPtr cppPtr) : MonoBehaviour(cppPtr) } /// - /// Adds a modifier to the player. + /// Adds a to the player. /// - /// The modifier to add. - /// The modifier that was added. + /// The to add. + /// The that was added. [HideFromIl2Cpp] public BaseModifier? AddModifier(BaseModifier modifier) { @@ -439,11 +439,11 @@ public class ModifierComponent(IntPtr cppPtr) : MonoBehaviour(cppPtr) } /// - /// Adds a modifier to the player. + /// Adds a to the player. /// /// The modifier type. - /// The arguments to initialize the modifier constructor with. - /// The modifier that was added. + /// The arguments to initialize the with. + /// The that was added. [HideFromIl2Cpp] public BaseModifier? AddModifier(Type type, params object[] args) { @@ -465,11 +465,11 @@ public class ModifierComponent(IntPtr cppPtr) : MonoBehaviour(cppPtr) } /// - /// Adds a modifier to the player. + /// Adds a to the player. /// - /// The ID of the modifier. - /// The arguments to initialize the modifier constructor with. - /// The modifier if it was created, or null if it failed. + /// The ID of the . + /// The arguments to initialize the with. + /// The if it was created, or if it failed. [HideFromIl2Cpp] public BaseModifier? AddModifier(uint id, params object[] args) { @@ -480,11 +480,11 @@ public class ModifierComponent(IntPtr cppPtr) : MonoBehaviour(cppPtr) } /// - /// Checks if a player has an active modifier by its type. + /// Checks if a player has an active . /// - /// The predicate to check the modifier. - /// The Type of the Modifier. - /// True if the Modifier is present, false otherwise. + /// The predicate to check the . + /// The Type of the . + /// if the is present, otherwise. [HideFromIl2Cpp] public bool HasModifier(Func? predicate=null) where T : BaseModifier { @@ -492,11 +492,11 @@ public class ModifierComponent(IntPtr cppPtr) : MonoBehaviour(cppPtr) } /// - /// Checks if a player has an active modifier by its type. + /// Checks if a player has an active by its type. /// /// The modifier type. - /// The predicate to check the modifier. - /// True if the Modifier is present, false otherwise. + /// The predicate to check the . + /// if the is present, otherwise. [HideFromIl2Cpp] public bool HasModifier(Type type, Func? predicate=null) { @@ -504,11 +504,11 @@ public class ModifierComponent(IntPtr cppPtr) : MonoBehaviour(cppPtr) } /// - /// Checks if a player has an active modifier by its type ID. + /// Checks if a player has an active by its type ID. /// - /// The modifier's type ID. - /// The predicate to check the modifier. - /// True if the modifier is present, false otherwise. + /// The 's type ID. + /// The predicate to check the . + /// if the is present, otherwise. [HideFromIl2Cpp] public bool HasModifier(uint id, Func? predicate=null) { @@ -519,10 +519,10 @@ public class ModifierComponent(IntPtr cppPtr) : MonoBehaviour(cppPtr) } /// - /// Checks if a player has an active modifier by its unique ID. + /// Checks if a player has an active by its unique ID. /// - /// The modifier's guid. - /// True if the modifier is present, false otherwise. + /// The 's guid. + /// if the is present, otherwise. [HideFromIl2Cpp] public bool HasModifier(Guid id) { @@ -530,12 +530,12 @@ public class ModifierComponent(IntPtr cppPtr) : MonoBehaviour(cppPtr) } /// - /// Checks if a player has an active modifier by its type. + /// Checks if a player has an active . /// - /// Whether to check inactive modifiers (those pending to be added). - /// The predicate to check the modifier. - /// The Type of the Modifier. - /// True if the Modifier is present, false otherwise. + /// Whether to check inactive s (those pending to be added). + /// The predicate to check the . + /// The Type of the . + /// if the is present, otherwise. [HideFromIl2Cpp] public bool HasModifier(bool checkInactive, Func? predicate=null) where T : BaseModifier { @@ -544,12 +544,12 @@ public class ModifierComponent(IntPtr cppPtr) : MonoBehaviour(cppPtr) } /// - /// Checks if a player has an active modifier by its type. + /// Checks if a player has an active by its type. /// /// The modifier type. - /// Whether to check inactive modifiers (those pending to be added). - /// The predicate to check the modifier. - /// True if the Modifier is present, false otherwise. + /// Whether to check inactive s (those pending to be added). + /// The predicate to check the . + /// if the is present, otherwise. [HideFromIl2Cpp] public bool HasModifier(Type type, bool checkInactive, Func? predicate=null) { @@ -558,12 +558,12 @@ public class ModifierComponent(IntPtr cppPtr) : MonoBehaviour(cppPtr) } /// - /// Checks if a player has an active modifier by its type ID. + /// Checks if a player has an active by its type ID. /// - /// The modifier's type ID. - /// Whether to check inactive modifiers (those pending to be added). - /// The predicate to check the modifier. - /// True if the modifier is present, false otherwise. + /// The 's type ID. + /// Whether to check inactive s (those pending to be added). + /// The predicate to check the . + /// if the is present, otherwise. [HideFromIl2Cpp] public bool HasModifier(uint id, bool checkInactive, Func? predicate=null) { @@ -574,11 +574,11 @@ public class ModifierComponent(IntPtr cppPtr) : MonoBehaviour(cppPtr) } /// - /// Checks if a player has an active modifier by its unique ID. + /// Checks if a player has an active by its unique ID. /// - /// The modifier's guid. - /// Whether to check inactive modifiers (those pending to be added). - /// True if the modifier is present, false otherwise. + /// The 's guid. + /// Whether to check inactive s (those pending to be added). + /// if the is present, otherwise. [HideFromIl2Cpp] public bool HasModifier(Guid id, bool checkInactive) { diff --git a/MiraAPI/Modifiers/ModifierDisplay/ModifierDisplayComponent.cs b/MiraAPI/Modifiers/ModifierDisplay/ModifierDisplayComponent.cs index 2982f675..4a6411ff 100644 --- a/MiraAPI/Modifiers/ModifierDisplay/ModifierDisplayComponent.cs +++ b/MiraAPI/Modifiers/ModifierDisplay/ModifierDisplayComponent.cs @@ -4,6 +4,7 @@ using System.Linq; using HarmonyLib; using Il2CppInterop.Runtime.Attributes; using MiraAPI.LocalSettings; +using MiraAPI.Utilities; using MiraAPI.Utilities.Assets; using Reactor.Utilities.Attributes; using Reactor.Utilities.Extensions; @@ -15,13 +16,13 @@ using UnityEngine.UI; namespace MiraAPI.Modifiers.ModifierDisplay; /// -/// The code used to display Mira modifiers. +/// The code used to display s. /// [RegisterInIl2Cpp] public class ModifierDisplayComponent(nint cppPtr) : MonoBehaviour(cppPtr) { /// - /// Gets the instance of the Modifier Display. + /// Gets the instance of the . /// public static ModifierDisplayComponent? Instance { get; private set; } @@ -41,7 +42,7 @@ public class ModifierDisplayComponent(nint cppPtr) : MonoBehaviour(cppPtr) private readonly Dictionary _modifiers = []; /// - /// Gets a read only dictionary of the created modifier UI components. + /// Gets a of the created s. /// [HideFromIl2Cpp] public ReadOnlyDictionary Modifiers => new(_modifiers); @@ -108,7 +109,7 @@ public class ModifierDisplayComponent(nint cppPtr) : MonoBehaviour(cppPtr) } /// - /// Use this to refresh the modifiers UI. Useful if you hide modifiers uis based on options. + /// Use this to refresh the modifiers UI. Useful if you hide modifiers UIs based on options. /// public void RefreshModifiers() { @@ -137,7 +138,7 @@ public class ModifierDisplayComponent(nint cppPtr) : MonoBehaviour(cppPtr) internal void DestroyComponent(ModifierUiComponent component) { _modifiers.Remove(component.Modifier!); - component.gameObject.DestroyImmediate(); + component.gameObject.DeepDestroy(); RefreshModifiers(); } @@ -207,7 +208,7 @@ public class ModifierDisplayComponent(nint cppPtr) : MonoBehaviour(cppPtr) continue; } - mod.Value.gameObject.Destroy(); + mod.Value.gameObject.DeepDestroy(); _modifiers.Remove(mod.Key); } diff --git a/MiraAPI/Modifiers/ModifierDisplay/ModifierUiComponent.cs b/MiraAPI/Modifiers/ModifierDisplay/ModifierUiComponent.cs index ef8b0bbd..66ded679 100644 --- a/MiraAPI/Modifiers/ModifierDisplay/ModifierUiComponent.cs +++ b/MiraAPI/Modifiers/ModifierDisplay/ModifierUiComponent.cs @@ -6,13 +6,13 @@ using UnityEngine; namespace MiraAPI.Modifiers.ModifierDisplay; /// -/// The code placed on every Modifier HUD object. Used to handle updating. +/// The code placed on every HUD object. Used to handle updating. /// [RegisterInIl2Cpp] public class ModifierUiComponent(nint cppPtr) : MonoBehaviour(cppPtr) { /// - /// Gets the modifier which this component is for. + /// Gets the which this component is for. /// [HideFromIl2Cpp] public BaseModifier? Modifier { get; internal set; } diff --git a/MiraAPI/Modifiers/ModifierExtensions.cs b/MiraAPI/Modifiers/ModifierExtensions.cs index 7a0ef23f..20f08be3 100644 --- a/MiraAPI/Modifiers/ModifierExtensions.cs +++ b/MiraAPI/Modifiers/ModifierExtensions.cs @@ -10,21 +10,21 @@ using Reactor.Utilities; namespace MiraAPI.Modifiers; /// -/// Extensions for modifiers. +/// Extensions for s. /// public static class ModifierExtensions { /// - /// Gets the dictionary to cache ModifierComponents. + /// Gets the to cache s. /// public static Dictionary ModifierComponents { get; } = []; /// - /// Remote Procedure Call to add a modifier to a player. + /// Remote Procedure Call to add a to a . /// - /// The player to add the modifier to. - /// The modifier type ID. - /// The arguments to initialize the modifier constructor with. + /// The to add the to. + /// The type ID. + /// The arguments to initialize the with. public static void RpcAddModifier(this PlayerControl target, uint typeId, params object[] args) { _ = ModifierManager.GetModifierType(typeId) ?? throw new InvalidOperationException( @@ -34,11 +34,11 @@ public static class ModifierExtensions } /// - /// Remote Procedure Call to add a modifier to a player. + /// Remote Procedure Call to add a to a . /// - /// The player to add the modifier to. - /// The type of the modifier. - /// The arguments to initialize the modifier constructor with. + /// The to add the to. + /// The type of the . + /// The arguments to initialize the with. public static void RpcAddModifier(this PlayerControl player, Type type, params object[] args) { var id = ModifierManager.GetModifierTypeId(type) ?? throw new InvalidOperationException( @@ -48,21 +48,21 @@ public static class ModifierExtensions } /// - /// Remote Procedure Call to add a modifier to a player. + /// Remote Procedure Call to add a to a . /// - /// The player to add the modifier to. - /// The arguments to initialize the modifier constructor with. - /// The modifier Type. + /// The to add the to. + /// The arguments to initialize the with. + /// The Type. public static void RpcAddModifier(this PlayerControl player, params object[] args) where T : BaseModifier { player.RpcAddModifier(typeof(T), args); } /// - /// Remote Procedure Call to remove a modifier from a player. + /// Remote Procedure Call to remove a from a . /// - /// The player to remove the modifier from. - /// The unique ID of the modifier. + /// The to remove the from. + /// The unique ID of the . [MethodRpc((uint)MiraRpc.RemoveModifier)] public static void RpcRemoveModifier(this PlayerControl target, Guid uniqueId) { @@ -70,11 +70,11 @@ public static class ModifierExtensions } /// - /// Remote Procedure Call to remove a modifier from a player by type ID. + /// Remote Procedure Call to remove a from a by type ID. /// - /// The player to remove the modifier from. - /// The type ID of the modifier. - /// Optional predicate to filter the modifiers. + /// The to remove the from. + /// The type ID of the . + /// Optional predicate to filter the s. public static void RpcRemoveModifier( this PlayerControl target, uint typeId, @@ -91,11 +91,11 @@ public static class ModifierExtensions } /// - /// Remote Procedure Call to remove a modifier from a player. + /// Remote Procedure Call to remove a from a . /// - /// The player to remove the modifier from. - /// The type of the modifier. - /// Optional predicate to filter the modifiers. + /// The to remove the from. + /// The type of the . + /// Optional predicate to filter the s. public static void RpcRemoveModifier( this PlayerControl player, Type type, @@ -108,11 +108,11 @@ public static class ModifierExtensions } /// - /// Remote Procedure Call to remove a modifier from a player. + /// Remote Procedure Call to remove a from a . /// - /// The player to remove the modifier from. - /// Optional predicate to filter the modifiers. - /// The Type of the Modifier. + /// The to remove the from. + /// Optional predicate to filter the s. + /// The Type of the . public static void RpcRemoveModifier(this PlayerControl player, Func? predicate = null) where T : BaseModifier { @@ -120,10 +120,10 @@ public static class ModifierExtensions } /// - /// Gets the ModifierComponent for a player. + /// Gets the for a . /// - /// The PlayerControl object. - /// A ModifierComponent if there is one, null otherwise. + /// The object. + /// A if there is one, otherwise. public static ModifierComponent GetModifierComponent(this PlayerControl player) { if (ModifierComponents.TryGetValue(player, out var component)) @@ -142,36 +142,36 @@ public static class ModifierExtensions } /// - /// Checks if the player has a specific modifier. + /// Checks if the has a specific . /// - /// The type of the modifier. - /// The PlayerControl instance. - /// Optional predicate to filter the modifiers. - /// True if the player has the modifier, false otherwise. + /// The type of the . + /// The instance. + /// Optional predicate to filter the s. + /// if the has the , otherwise. public static bool HasModifier(this PlayerControl player, Func? predicate = null) where T : BaseModifier { return player.GetModifierComponent().HasModifier(predicate); } /// - /// Checks if the player has a specific modifier by type. + /// Checks if the has a specific by type. /// - /// The PlayerControl instance. + /// The instance. /// The type of the modifier. - /// Optional predicate to filter the modifiers. - /// True if the player has the modifier, false otherwise. + /// Optional predicate to filter the s. + /// if the has the , otherwise. public static bool HasModifier(this PlayerControl player, Type type, Func? predicate = null) { return player.GetModifierComponent().HasModifier(type, predicate); } /// - /// Checks if the player has a specific modifier by type ID. + /// Checks if the has a specific by type ID. /// - /// The PlayerControl instance. - /// The type ID of the modifier. - /// Optional predicate to filter the modifiers. - /// True if the player has the modifier, false otherwise. + /// The instance. + /// The type ID of the . + /// Optional predicate to filter the s. + /// if the has the , otherwise. public static bool HasModifier( this PlayerControl player, uint typeId, @@ -181,20 +181,20 @@ public static class ModifierExtensions } /// - /// Checks if the player has a specific modifier by its GUID. + /// Checks if the has a specific modifier by its GUID. /// - /// The PlayerControl instance. - /// The unique ID of the modifier. - /// True if the player has the modifier, false otherwise. + /// The instance. + /// The unique ID of the . + /// if the has the , otherwise. public static bool HasModifier(this PlayerControl player, Guid uniqueId) { return player.GetModifierComponent().HasModifier(uniqueId); } /// - /// Clears all modifiers from a player. + /// Clears all s from the . /// - /// The player you want to clear modifiers for. + /// The player you want to clear s for. public static void ClearModifiers(this PlayerControl plr) { foreach (var mod in plr.GetModifierComponent().ActiveModifiers) @@ -204,9 +204,9 @@ public static class ModifierExtensions } /// - /// Clears all modifiers from a player. + /// Clears all s from the . /// - /// The player you want to clear modifiers for. + /// The player you want to clear s for. public static void RpcClearModifiers(this PlayerControl plr) { foreach (var mod in plr.GetModifierComponent().ActiveModifiers) @@ -216,75 +216,75 @@ public static class ModifierExtensions } /// - /// Tries to get a modifier by its type. + /// Tries to get a . /// - /// The PlayerControl instance. - /// The modifier or null. - /// The predicate to check the modifier by. - /// The Type of the Modifier. - /// True if the modifier was found, false otherwise. + /// The instance. + /// The or . + /// The predicate to check the by. + /// The Type of the . + /// if the was found, otherwise. public static bool TryGetModifier(this PlayerControl player, [NotNullWhen(true)] out T? modifier, Func? predicate = null) where T : BaseModifier { return player.GetModifierComponent().TryGetModifier(out modifier, predicate); } /// - /// Tries to get a modifier by its type. + /// Tries to get a by its type. /// - /// The PlayerControl instance. + /// The instance. /// The modifier type. - /// The modifier or null. - /// The predicate to check the modifier by. - /// True if the modifier was found, false otherwise. + /// The or . + /// The predicate to check the by. + /// if the was found, otherwise. public static bool TryGetModifier(this PlayerControl player, Type type, [NotNullWhen(true)] out BaseModifier? modifier, Func? predicate = null) { return player.GetModifierComponent().TryGetModifier(type, out modifier, predicate); } /// - /// Tries to get a modifier by its type ID. + /// Tries to get a by its type ID. /// - /// The PlayerControl instance. - /// The modifier type ID. - /// The modifier or null. - /// The predicate to check the modifier by. - /// True if the modifier was found, false otherwise. + /// The instance. + /// The type ID. + /// The or . + /// The predicate to check the by. + /// if the was found, otherwise. public static bool TryGetModifier(this PlayerControl player, uint id, [NotNullWhen(true)] out BaseModifier? modifier, Func? predicate = null) { return player.GetModifierComponent().TryGetModifier(id, out modifier, predicate); } /// - /// Tries to get a modifier by its unique ID. + /// Tries to get a by its unique ID. /// - /// The PlayerControl instance. - /// The modifier unique ID. - /// The modifier or null. - /// True if the modifier was found, false otherwise. + /// The instance. + /// The unique ID. + /// The or . + /// if the was found, otherwise. public static bool TryGetModifier(this PlayerControl player, Guid modifierGuid, [NotNullWhen(true)] out BaseModifier? modifier) { return player.GetModifierComponent().TryGetModifier(modifierGuid, out modifier); } /// - /// Gets a specific modifier from the player. + /// Gets a specific from the . /// - /// The type of the modifier. - /// The PlayerControl instance. - /// Optional predicate to filter the modifiers. - /// The modifier if found, null otherwise. + /// The type of the . + /// The instance. + /// Optional predicate to filter the s. + /// The if found, otherwise. public static T? GetModifier(this PlayerControl player, Func? predicate = null) where T : BaseModifier { return player.GetModifierComponent().GetModifier(predicate); } /// - /// Gets a specific modifier from the player by type. + /// Gets a specific from the by type. /// - /// The PlayerControl instance. + /// The instance. /// The type of the modifier. - /// Optional predicate to filter the modifiers. - /// The modifier if found, null otherwise. + /// Optional predicate to filter the s. + /// The if found, otherwise. public static BaseModifier? GetModifier( this PlayerControl player, Type type, @@ -294,12 +294,12 @@ public static class ModifierExtensions } /// - /// Gets a specific modifier from the player by its type ID. + /// Gets a specific from the by its type ID. /// - /// The PlayerControl instance. - /// The type ID of the modifier. - /// Optional predicate to filter the modifiers. - /// The modifier if found, null otherwise. + /// The instance. + /// The type ID of the . + /// Optional predicate to filter the s. + /// The if found, otherwise. public static BaseModifier? GetModifier( this PlayerControl player, uint typeId, @@ -309,11 +309,11 @@ public static class ModifierExtensions } /// - /// Gets a specific modifier from the player by its GUID. + /// Gets a specific from the by its GUID. /// - /// The PlayerControl instance. - /// The GUID of the modifier. - /// The modifier if found, null otherwise. + /// The instance. + /// The GUID of the . + /// The if found, otherwise. public static BaseModifier? GetModifier( this PlayerControl player, Guid uniqueId) @@ -322,12 +322,12 @@ public static class ModifierExtensions } /// - /// Gets all modifiers of a specific type from the player. + /// Gets all s from the . /// - /// The type of the modifiers. - /// The PlayerControl instance. - /// Optional predicate to filter the modifiers. - /// A collection of modifiers. + /// The type of the s. + /// The instance. + /// Optional predicate to filter the s. + /// An of s. public static IEnumerable GetModifiers(this PlayerControl player, Func? predicate = null) where T : BaseModifier { @@ -335,12 +335,12 @@ public static class ModifierExtensions } /// - /// Gets all modifiers of a specific type from the player. + /// Gets all s of a specific type from the . /// - /// The PlayerControl instance. + /// The instance. /// The type of the modifiers. - /// Optional predicate to filter the modifiers. - /// A collection of modifiers. + /// Optional predicate to filter the s. + /// An of s. public static IEnumerable GetModifiers( this PlayerControl player, Type type, @@ -350,12 +350,12 @@ public static class ModifierExtensions } /// - /// Gets all modifiers of a specific type from the player by type ID. + /// Gets all s of a specific type from the by type ID. /// - /// The PlayerControl instance. - /// The type ID of the modifiers. - /// Optional predicate to filter the modifiers. - /// A collection of modifiers. + /// The instance. + /// The type ID of the s. + /// Optional predicate to filter the s. + /// An of s. public static IEnumerable GetModifiers( this PlayerControl player, uint typeId, @@ -365,21 +365,21 @@ public static class ModifierExtensions } /// - /// Removes a specific modifier from the player. + /// Removes a specific from the . /// - /// The PlayerControl instance. - /// The modifier to remove. + /// The instance. + /// The to remove. public static void RemoveModifier(this PlayerControl player, BaseModifier modifier) { player.GetModifierComponent().RemoveModifier(modifier); } /// - /// Removes a specific modifier from the player. + /// Removes a specific from the . /// - /// The type of the modifier. - /// The PlayerControl instance. - /// Optional predicate to filter the modifiers. + /// The type of the . + /// The instance. + /// Optional predicate to filter the s. public static void RemoveModifier(this PlayerControl player, Func? predicate = null) where T : BaseModifier { @@ -387,22 +387,22 @@ public static class ModifierExtensions } /// - /// Removes a specific modifier from the player by type. + /// Removes a specific from the by type. /// - /// The PlayerControl instance. + /// The instance. /// The type of the modifier. - /// Optional predicate to filter the modifiers. + /// Optional predicate to filter the s. public static void RemoveModifier(this PlayerControl player, Type type, Func? predicate = null) { player.GetModifierComponent().RemoveModifier(type, predicate); } /// - /// Removes a specific modifier from the player by its type ID. + /// Removes a specific from the by its type ID. /// - /// The PlayerControl instance. - /// The type ID of the modifier. - /// Optional predicate to filter the modifiers. + /// The instance. + /// The type ID of the . + /// Optional predicate to filter the s. public static void RemoveModifier( this PlayerControl player, uint typeId, @@ -412,10 +412,10 @@ public static class ModifierExtensions } /// - /// Removes a specific modifier from the player by its GUID. + /// Removes a specific from the by its GUID. /// - /// The PlayerControl instance. - /// The GUID of the modifier. + /// The instance. + /// The GUID of the . public static void RemoveModifier( this PlayerControl player, Guid uniqueId) @@ -424,47 +424,47 @@ public static class ModifierExtensions } /// - /// Adds a specific modifier to the player. + /// Adds a specific to the . /// - /// The type of the modifier. - /// The PlayerControl instance. - /// The arguments to initialize the modifier constructor with. - /// The added modifier. + /// The type of the . + /// The instance. + /// The arguments to initialize the with. + /// The added . public static T? AddModifier(this PlayerControl player, params object[] args) where T : BaseModifier { return player.GetModifierComponent().AddModifier(args); } /// - /// Adds a specific modifier to the player. + /// Adds a specific to the . /// - /// The PlayerControl instance. - /// The modifier to add. - /// The added modifier. + /// The instance. + /// The to add. + /// The added . public static BaseModifier? AddModifier(this PlayerControl player, BaseModifier modifier) { return player.GetModifierComponent().AddModifier(modifier); } /// - /// Adds a specific modifier to the player by type. + /// Adds a specific to the by type. /// - /// The PlayerControl instance. + /// The instance. /// The type of the modifier. - /// The arguments to initialize the modifier constructor with. - /// The added modifier. + /// The arguments to initialize the with. + /// The added . public static BaseModifier? AddModifier(this PlayerControl player, Type type, params object[] args) { return player.GetModifierComponent().AddModifier(type, args); } /// - /// Adds a specific modifier to the player by type ID. + /// Adds a specific to the by type ID. /// - /// The PlayerControl instance. - /// The type ID of the modifier. - /// The arguments to initialize the modifier constructor with. - /// The added modifier. + /// The instance. + /// The type ID of the . + /// The arguments to initialize the with. + /// The added . public static BaseModifier? AddModifier(this PlayerControl player, uint typeId, params object[] args) { return player.GetModifierComponent().AddModifier(typeId, args); diff --git a/MiraAPI/Modifiers/ModifierFactory.cs b/MiraAPI/Modifiers/ModifierFactory.cs index 4f84db00..cd3c9bee 100644 --- a/MiraAPI/Modifiers/ModifierFactory.cs +++ b/MiraAPI/Modifiers/ModifierFactory.cs @@ -8,7 +8,7 @@ using MiraAPI.Utilities; namespace MiraAPI.Modifiers; /// -/// Factory for creating instances of a modifier. More efficient than using reflection. +/// Factory for creating instances of a . More efficient than using reflection. /// public static class ModifierFactory { @@ -39,11 +39,11 @@ public static class ModifierFactory } /// - /// Creates a modifier with the specified type and arguments. + /// Creates a with the specified type and arguments. /// /// Modifier type. /// Arguments. - /// An instance of the modifier. + /// An instance of the . public static BaseModifier CreateInstance(Type type, params object[] args) { var argTypes = args.Select(arg => arg.GetType()).ToArray(); @@ -60,9 +60,9 @@ public static class ModifierFactory } /// -/// Factory for creating instances of a modifier. More efficient than using reflection. +/// Factory for creating instances of . More efficient than using reflection. /// -/// The modifier type. +/// The type. public static class ModifierFactory where T : BaseModifier { private static readonly Func Constructor = CreateConstructor(); @@ -92,10 +92,10 @@ public static class ModifierFactory where T : BaseModifier } /// - /// Creates an instance of the modifier. + /// Creates an instance of . /// /// Parameters for the constructor. - /// An instance of the modifier. + /// An instance of . [SuppressMessage("Design", "CA1000:Do not declare static members on generic types", Justification = "This is a factory class.")] public static T CreateInstance(params object[] args) { diff --git a/MiraAPI/Modifiers/ModifierManager.cs b/MiraAPI/Modifiers/ModifierManager.cs index 2456af0b..877e43b9 100644 --- a/MiraAPI/Modifiers/ModifierManager.cs +++ b/MiraAPI/Modifiers/ModifierManager.cs @@ -13,17 +13,17 @@ using Random = System.Random; namespace MiraAPI.Modifiers; /// -/// The manager for handling modifiers. +/// The manager for handling s. /// public static class ModifierManager { /// - /// Gets or sets a value indicating whether modifiers should be assigned to players. + /// Gets or sets a value indicating whether s should be assigned to players. /// public static bool MiraAssignsModifiers { get; set; } = true; /// - /// Gets the list of all registered modifiers. + /// Gets the list of all registered s. /// public static IReadOnlyList Modifiers { get; internal set; } = []; diff --git a/MiraAPI/Modifiers/ModifierUtils.cs b/MiraAPI/Modifiers/ModifierUtils.cs index b69e7bc3..f536489b 100644 --- a/MiraAPI/Modifiers/ModifierUtils.cs +++ b/MiraAPI/Modifiers/ModifierUtils.cs @@ -5,27 +5,27 @@ using System.Linq; namespace MiraAPI.Modifiers; /// -/// Utilities to make handling modifiers in-game easier. +/// Utilities to make handling s in-game easier. /// public static class ModifierUtils { /// - /// Gets a list of all active in-game modifiers. + /// Gets a list of all active in-game s. /// - /// Select if modifier is valid to be added to list. - /// The modifier type. - /// A list of modifiers. + /// Select if is valid to be added to list. + /// The type. + /// An of s. public static IEnumerable GetActiveModifiers(Func? predicate = null) where T : BaseModifier { return PlayerControl.AllPlayerControls.ToArray().SelectMany(x => x.GetModifiers(predicate)).OfType(); } /// - /// Gets all players with a certain modifier. + /// Gets all s with a certain . /// - /// Select if modifier is valid. - /// The modifier type. - /// A list of players with that modifier. + /// Select if is valid. + /// The type. + /// An of s with that . public static IEnumerable GetPlayersWithModifier(Func? predicate = null) where T : BaseModifier { return PlayerControl.AllPlayerControls.ToArray().Where(x => x.HasModifier(predicate)); diff --git a/MiraAPI/Modifiers/Types/GameModifier.cs b/MiraAPI/Modifiers/Types/GameModifier.cs index 144ff51b..b58f8e04 100644 --- a/MiraAPI/Modifiers/Types/GameModifier.cs +++ b/MiraAPI/Modifiers/Types/GameModifier.cs @@ -11,38 +11,38 @@ public abstract class GameModifier : BaseModifier /// /// Gets the chance of the modifier being assigned to a player. /// - /// An int value between 0 and 100 representing percent. + /// An value between 0 and 100 representing percent. public abstract int GetAssignmentChance(); /// /// Gets the amount of players that can have this modifier in a game. /// - /// An int value greater than or equal to zero. + /// An value greater than or equal to zero. public abstract int GetAmountPerGame(); /// /// Gets the priority at which the modifier will spawn. The higher the value, the higher up on the assignment list. /// - /// An int value greater than or equal to -1. + /// An value greater than or equal to -1. public virtual int Priority() => -1; /// /// Determines whether the modifier is valid on a role. /// /// The role to be checked. - /// True if the modifier is valid on the role, otherwise false. + /// if the modifier is valid on the role, otherwise . public virtual bool IsModifierValidOn(RoleBehaviour role) => true; /// /// Determines whether the player won the game with this modifier. The modifier with the highest priority will override other modifiers. /// /// The reason why the game ended. - /// True if the player won, false if they lost. Return null to use the player's default win condition. + /// if the player won, if they lost. Return to use the player's default win condition. public virtual bool? DidWin(GameOverReason reason) => null; /// /// Determines whether the modifier can spawn in general, accounting for gamemodes and everything else. /// - /// True if the modifier is able to spawn, otherwise false. + /// if the modifier is able to spawn, otherwise . public virtual bool CanSpawnOnCurrentMode() => !GameManager.Instance.IsHideAndSeek(); } diff --git a/MiraAPI/Modifiers/Types/TimedModifier.cs b/MiraAPI/Modifiers/Types/TimedModifier.cs index cd869922..6fe1c1d8 100644 --- a/MiraAPI/Modifiers/Types/TimedModifier.cs +++ b/MiraAPI/Modifiers/Types/TimedModifier.cs @@ -89,7 +89,7 @@ public abstract class TimedModifier : BaseModifier } /// - /// Stops the timer and calls OnTimerComplete(). + /// Stops the timer and calls . /// public void StopTimer() { @@ -109,7 +109,7 @@ public abstract class TimedModifier : BaseModifier } /// - /// Resets the timer. Does not call OnTimerComplete(). + /// Resets the timer. Does not call . /// public void ResetTimer() { diff --git a/MiraAPI/Networking/CustomMurderRpc.cs b/MiraAPI/Networking/CustomMurderRpc.cs index f9c6e871..9a6ff0ba 100644 --- a/MiraAPI/Networking/CustomMurderRpc.cs +++ b/MiraAPI/Networking/CustomMurderRpc.cs @@ -168,7 +168,7 @@ public static class CustomMurderRpc } /// - /// Custom Murder method without networking. If you need a networked version, use . + /// Custom Murder method without networking. If you need a networked version, use . /// /// The killer. /// The player to murder. diff --git a/MiraAPI/Networking/GuidConverter.cs b/MiraAPI/Networking/GuidConverter.cs index c00d759d..f9d9d7a3 100644 --- a/MiraAPI/Networking/GuidConverter.cs +++ b/MiraAPI/Networking/GuidConverter.cs @@ -24,7 +24,7 @@ public class GuidConverter : MessageConverter /// Reads a from the reader. /// /// - /// A GUID object. + /// A object. public override Guid Read(MessageReader reader, Type objectType) { return new Guid(reader.ReadBytesAndSize()); diff --git a/MiraAPI/Networking/Modifiers/AddModifierRpc.cs b/MiraAPI/Networking/Modifiers/AddModifierRpc.cs index 2e7b19ec..d3bcaee0 100644 --- a/MiraAPI/Networking/Modifiers/AddModifierRpc.cs +++ b/MiraAPI/Networking/Modifiers/AddModifierRpc.cs @@ -8,7 +8,7 @@ using Reactor.Networking.Serialization; namespace MiraAPI.Networking.Modifiers; /// -/// Remote procedure call for adding a modifier. +/// Remote procedure call for adding a . /// /// Mira plugin. /// RPC ID. diff --git a/MiraAPI/Patches/ChatControllerPatch.cs b/MiraAPI/Patches/ChatControllerPatch.cs index e65be7f8..c9a6565f 100644 --- a/MiraAPI/Patches/ChatControllerPatch.cs +++ b/MiraAPI/Patches/ChatControllerPatch.cs @@ -6,7 +6,7 @@ namespace MiraAPI.Patches; #pragma warning disable SA1629 /// /// Allows players to paste text into chat. -/// Source: https://github.com/CallOfCreator/NewMod/blob/main/NewMod/Patches/ClipboardPatch.cs +/// Source: /// #pragma warning restore SA1629 [HarmonyPatch(typeof(ChatController), nameof(ChatController.Update))] diff --git a/MiraAPI/Patches/DetectiveNotesMinigamePatch.cs b/MiraAPI/Patches/DetectiveNotesMinigamePatch.cs index b0e37e7b..a11ec7e8 100644 --- a/MiraAPI/Patches/DetectiveNotesMinigamePatch.cs +++ b/MiraAPI/Patches/DetectiveNotesMinigamePatch.cs @@ -26,7 +26,7 @@ public static class DetectiveNotesMinigamePatch return; } __instance.impostorButton = new List(); - var allRoles = DestroyableSingleton.Instance.AllRoles; + var allRoles = RoleManager.Instance.AllRoles; var customRoles = CustomRoleManager.CustomRoleBehaviours; foreach (var role in allRoles) { diff --git a/MiraAPI/Patches/Events/KillAnimationMurderEventPatch.cs b/MiraAPI/Patches/Events/KillAnimationMurderEventPatch.cs index 2618153c..d102664c 100644 --- a/MiraAPI/Patches/Events/KillAnimationMurderEventPatch.cs +++ b/MiraAPI/Patches/Events/KillAnimationMurderEventPatch.cs @@ -8,7 +8,7 @@ using MiraAPI.Utilities; namespace MiraAPI.Patches.Events; /// -/// Patch to invoke AfterMurderEvent after a kill animation is performed. +/// Patch to invoke after a kill animation is performed. /// [HarmonyPatch] public static class KillAnimationMurderEventPatch diff --git a/MiraAPI/Patches/Events/MapBehaviourPatches.cs b/MiraAPI/Patches/Events/MapBehaviourPatches.cs index a4092268..246b6e59 100644 --- a/MiraAPI/Patches/Events/MapBehaviourPatches.cs +++ b/MiraAPI/Patches/Events/MapBehaviourPatches.cs @@ -5,7 +5,7 @@ using MiraAPI.Events.Vanilla.Map; namespace MiraAPI.Patches.Events; /// -/// Patch for map related MiraEvents. +/// Patch for related s. /// [HarmonyPatch] public static class MapBehaviourPatches diff --git a/MiraAPI/Patches/Events/SabotageEventPatches.cs b/MiraAPI/Patches/Events/SabotageEventPatches.cs index 4f04d7ec..8df8750f 100644 --- a/MiraAPI/Patches/Events/SabotageEventPatches.cs +++ b/MiraAPI/Patches/Events/SabotageEventPatches.cs @@ -5,7 +5,7 @@ using MiraAPI.Events.Vanilla.Map; namespace MiraAPI.Patches.Events; /// -/// Used for patching sabotage/system related MiraEvents. +/// Used for patching sabotage/system related s. /// [HarmonyPatch] public static class SabotageEventPatches diff --git a/MiraAPI/Patches/Events/VanillaButtonPatches.cs b/MiraAPI/Patches/Events/VanillaButtonPatches.cs index 278de09e..490e401f 100644 --- a/MiraAPI/Patches/Events/VanillaButtonPatches.cs +++ b/MiraAPI/Patches/Events/VanillaButtonPatches.cs @@ -8,7 +8,7 @@ using MiraAPI.Events.Vanilla.Usables; namespace MiraAPI.Patches.Events; /// -/// Patches to invoke vent related MiraEvents. +/// Patches to invoke related s. /// [HarmonyPatch] public static class VanillaButtonPatches diff --git a/MiraAPI/Patches/Events/VentEventPatches.cs b/MiraAPI/Patches/Events/VentEventPatches.cs index 33e3dbfa..9d4ad9ff 100644 --- a/MiraAPI/Patches/Events/VentEventPatches.cs +++ b/MiraAPI/Patches/Events/VentEventPatches.cs @@ -6,7 +6,7 @@ using MiraAPI.Events.Vanilla.Usables; namespace MiraAPI.Patches.Events; /// -/// Patches to invoke vent related MiraEvents. +/// Patches to invoke related s. /// [HarmonyPatch] public static class VentEventPatches diff --git a/MiraAPI/Patches/Freeplay/TaskAdderPatches.cs b/MiraAPI/Patches/Freeplay/TaskAdderPatches.cs index 5bee1aef..3e4adc9a 100644 --- a/MiraAPI/Patches/Freeplay/TaskAdderPatches.cs +++ b/MiraAPI/Patches/Freeplay/TaskAdderPatches.cs @@ -72,13 +72,13 @@ public static class TaskAdderPatches __instance.TaskParent = inner.transform; var crewmateFolder = __instance.Root.SubFolders.ToArray().FirstOrDefault(x => x.FolderName == CrewmateName)!; var impostorFolder = __instance.Root.SubFolders.ToArray().FirstOrDefault(x => x.FolderName == ImpostorName)!; - //var neutralFolder = __instance.CreateFolder("Neutral", __instance.Root, 2, Color.gray); + // var neutralFolder = __instance.CreateFolder("Neutral", __instance.Root, 2, Color.gray); var modifiersFolder = __instance.CreateFolder(ModifiersName, __instance.Root, 0, Color.blue); folders.Clear(); folders.Add(crewmateFolder.FolderName, crewmateFolder); folders.Add(impostorFolder.FolderName, impostorFolder); - //folders.Add("Neutrals", neutralFolder); + // folders.Add("Neutrals", neutralFolder); folders.Add(ModifiersName, modifiersFolder); int folderIdx = 2; @@ -276,8 +276,9 @@ public static class TaskAdderPatches __instance.transform.FindChild("TitleText_TMP")?.gameObject.DestroyImmediate(); } - __instance.ActiveItems.ToArray().Do(x => x.gameObject.Destroy()); + __instance.ActiveItems.ToArray().Do(x => x.gameObject.DeepDestroy(false)); __instance.ActiveItems.Clear(); + Utilities.Extensions.ClearGarbageCollector(); float num = 0f; float num2 = 0f; diff --git a/MiraAPI/Patches/HudManagerPatches.cs b/MiraAPI/Patches/HudManagerPatches.cs index 40533636..a6cd68b1 100644 --- a/MiraAPI/Patches/HudManagerPatches.cs +++ b/MiraAPI/Patches/HudManagerPatches.cs @@ -15,7 +15,7 @@ using Object = UnityEngine.Object; namespace MiraAPI.Patches; /// -/// General patches for the HudManager class. +/// General patches for the class. /// [HarmonyPatch(typeof(HudManager))] public static class HudManagerPatches @@ -47,7 +47,7 @@ public static class HudManagerPatches { foreach (var aspect in baseButtons.GetComponentsInChildren(true)) { - if (aspect.gameObject == null) + if (!aspect.gameObject) { continue; } @@ -57,7 +57,7 @@ public static class HudManagerPatches continue; } - if (aspect.gameObject.transform.parent.transform.parent.name == "TopRight") + if (aspect.gameObject.name.Contains("TopRight")) { continue; } @@ -70,7 +70,7 @@ public static class HudManagerPatches foreach (var button in HudManager.Instance.GetComponentsInChildren(true)) { - if (button.gameObject == null) + if (!button.gameObject) { continue; } @@ -89,6 +89,11 @@ public static class HudManagerPatches continue; } + if (arrange.gameObject.name.Contains("TopRight")) + { + continue; + } + arrange.gameObject.SetActive(!arrange.isActiveAndEnabled); arrange.CellSize = new Vector2(scaleFactor, scaleFactor); arrange.gameObject.SetActive(!arrange.isActiveAndEnabled); @@ -121,7 +126,7 @@ public static class HudManagerPatches /// /// Create custom buttons and arrange them on the hud. /// - /// The HudManager instance. + /// The instance. [HarmonyPostfix] [HarmonyPatch(nameof(HudManager.Start))] public static void StartPostfix(HudManager __instance) @@ -143,8 +148,9 @@ public static class HudManagerPatches foreach (var t in BottomLeft.GetComponentsInChildren(true)) { - t.gameObject.Destroy(); + t.gameObject.DeepDestroy(false); } + Utilities.Extensions.ClearGarbageCollector(); var gridArrange = BottomLeft.GetComponent(); var aspectPosition = BottomLeft.GetComponent(); @@ -238,9 +244,9 @@ public static class HudManagerPatches /// /// Set the custom buttons active when the hud is active. /// - /// HudManager instance. - /// The local PlayerControl. - /// The player's RoleBehaviour. + /// instance. + /// The local . + /// The player's . /// Whether the Hud should be set active or not. [HarmonyPostfix] [HarmonyPatch(nameof(HudManager.SetHudActive), typeof(PlayerControl), typeof(RoleBehaviour), typeof(bool))] diff --git a/MiraAPI/Patches/IntroCutscenePatches.cs b/MiraAPI/Patches/IntroCutscenePatches.cs index e2cf9870..7d52287e 100644 --- a/MiraAPI/Patches/IntroCutscenePatches.cs +++ b/MiraAPI/Patches/IntroCutscenePatches.cs @@ -123,7 +123,6 @@ public static class IntroCutscenePatches introCutscene = __instance.Cast(); } - Info("IntroCutscene ended"); MiraEventManager.InvokeEvent(new IntroEndEvent(introCutscene)); diff --git a/MiraAPI/Patches/LocalSettings/OptionsMenuPatches.cs b/MiraAPI/Patches/LocalSettings/OptionsMenuPatches.cs index 7434aaee..ab8ed2c3 100644 --- a/MiraAPI/Patches/LocalSettings/OptionsMenuPatches.cs +++ b/MiraAPI/Patches/LocalSettings/OptionsMenuPatches.cs @@ -15,14 +15,14 @@ namespace MiraAPI.Patches.LocalSettings; public static class OptionsMenuPatches { internal static OptionsMenuBehaviour? Instance { get; private set; } - internal static BoxCollider2D MaskCollider; + internal static BoxCollider2D MaskCollider = null!; private static SpriteRenderer? background; private static int currentPage = 1; private static Dictionary> tabButtons = new(); /// - /// Creates the tabs and their content. + /// Creates the s and their content. /// [HarmonyPostfix] [HarmonyPatch(nameof(OptionsMenuBehaviour.Start))] diff --git a/MiraAPI/Patches/LocalSettings/ToggleBehaviourPatch.cs b/MiraAPI/Patches/LocalSettings/ToggleBehaviourPatch.cs index ffbfdea3..696ac9da 100644 --- a/MiraAPI/Patches/LocalSettings/ToggleBehaviourPatch.cs +++ b/MiraAPI/Patches/LocalSettings/ToggleBehaviourPatch.cs @@ -7,7 +7,7 @@ namespace MiraAPI.Patches.LocalSettings; public static class ToggleBehaviourPatch { /// - /// ResetText was inlined ofc. + /// was inlined ofc. /// Skill issue. /// [HarmonyPrefix] @@ -21,8 +21,8 @@ public static class ToggleBehaviourPatch // Used to mask the text __instance.Text.richText = true; __instance.Text.text = $"" + - $"{DestroyableSingleton.Instance.GetString(__instance.BaseText)}: " + - $"{DestroyableSingleton.Instance.GetString(__instance.onState ? StringNames.SettingsOn : StringNames.SettingsOff)}"; + $"{TranslationController.Instance.GetString(__instance.BaseText)}: " + + $"{TranslationController.Instance.GetString(__instance.onState ? StringNames.SettingsOn : StringNames.SettingsOff)}"; __instance.Text.sortingOrder = 151; __instance.Text.renderer.sortingLayerName = "Default"; __instance.Text.renderer.sortingOrder = 151; diff --git a/MiraAPI/Patches/Menu/HatsTabPatches.cs b/MiraAPI/Patches/Menu/HatsTabPatches.cs index 8cd2bfd7..3ad0fa32 100644 --- a/MiraAPI/Patches/Menu/HatsTabPatches.cs +++ b/MiraAPI/Patches/Menu/HatsTabPatches.cs @@ -11,8 +11,6 @@ using Reactor.Utilities; using Reactor.Utilities.Extensions; using TMPro; using UnityEngine; -using UnityEngine.Events; -using UnityEngine.UI; using Object = UnityEngine.Object; namespace MiraAPI.Patches.Menu; @@ -21,6 +19,7 @@ namespace MiraAPI.Patches.Menu; public static class HatsTabPatches { private static SortedList> sortedHats = []; + private static Dictionary storeNames = []; private static int currentPage; private static void PreviousPage(HatsTab hatsTab) @@ -41,17 +40,28 @@ public static class HatsTabPatches [HarmonyPrefix] public static bool OnEnablePrefix(HatsTab __instance) { + if (!AddressablesLoader.AddressableHatsExist) + { + return true; + } __instance.currentHat = HatManager.Instance.GetHatById(DataManager.Player.Customization.Hat); var allHats = HatManager.Instance.GetUnlockedHats().ToImmutableList(); if (sortedHats.Count == 0) { + var num = 0; var comparer = new ControllableComparer(["vanilla"], [], StringComparer.InvariantCulture); sortedHats = new SortedList>(comparer); foreach (var hat in allHats) { if (!sortedHats.ContainsKey(hat.StoreName)) sortedHats[hat.StoreName] = []; sortedHats[hat.StoreName].Add(hat); + + if (!storeNames.ContainsValue(hat.StoreName)) + { + storeNames.Add(num, hat.StoreName); + num++; + } } } @@ -66,6 +76,10 @@ public static class HatsTabPatches [HarmonyPrefix] public static void UpdatePrefix(HatsTab __instance) { + if (!AddressablesLoader.AddressableHatsExist) + { + return; + } if (sortedHats.Count == 0) return; if (Input.GetKeyDown(KeyCode.LeftControl) || Input.GetKeyDown(KeyCode.RightControl) || Input.GetKeyDown(KeyCode.LeftArrow)) @@ -86,29 +100,35 @@ public static class HatsTabPatches if (loadRoutine != null) Coroutines.Stop(loadRoutine); hatIndex = 0; - foreach (var instanceColorChip in __instance.ColorChips) instanceColorChip.gameObject.Destroy(); + foreach (var instanceColorChip in __instance.ColorChips) instanceColorChip.gameObject.DeepDestroy(false); __instance.ColorChips.Clear(); - __instance.scroller.Inner.GetComponentsInChildren().Do(x => x.gameObject.Destroy()); + __instance.scroller.Inner.GetComponentsInChildren().Do(x => x.gameObject.DeepDestroy(false)); + Utilities.Extensions.ClearGarbageCollector(); var groupNameText = __instance.GetComponentInChildren(false); + var group = sortedHats.Where(x => x.Key == storeNames[page]); - var (groupName, hats) = sortedHats.ToArray()[page]; - var text = Object.Instantiate(groupNameText, __instance.scroller.Inner); - text.enabled = true; - text.gameObject.transform.localScale = Vector3.one; - text.GetComponent().Destroy(); - text.EnableStencilMasking(); - text.text = $"{groupName} ({currentPage + 1}/{sortedHats.Count})"; - text.alignment = TextAlignmentOptions.Center; - text.fontSize = 5f; - text.fontSizeMax = 5f; - text.fontSizeMin = 0f; - var xLerp = __instance.XRange.Lerp(0.5f); - var yLerp = __instance.YStart - hatIndex / __instance.NumPerRow * __instance.YOffset; - text.transform.localPosition = new Vector3(xLerp, yLerp, -1f); + foreach ((string groupName, List hats) in group) + { + var text = Object.Instantiate(groupNameText, __instance.scroller.Inner); + text.enabled = true; + text.gameObject.transform.localScale = Vector3.one; + text.GetComponent().Destroy(); + text.EnableStencilMasking(); + text.text = $"{groupName} ({currentPage + 1}/{sortedHats.Count})"; + text.alignment = TextAlignmentOptions.Center; + text.fontSize = 5f; + text.fontSizeMax = 5f; + text.fontSizeMin = 0f; + var xLerp = __instance.XRange.Lerp(0.5f); + var yLerp = __instance.YStart - hatIndex / __instance.NumPerRow * __instance.YOffset; + text.transform.localPosition = new Vector3(xLerp, yLerp, -1f); - hatIndex += 5; - loadRoutine = Coroutines.Start(CoGenerateChips(__instance, hats)); + hatIndex += 5; + loadRoutine = Coroutines.Start(CoGenerateChips(__instance, hats)); + } + __instance.scroller.ContentYBounds.max = -(__instance.YStart - (hatIndex + 1) / __instance.NumPerRow * __instance.YOffset) - 3f; + __instance.currentHatIsEquipped = true; } private static IEnumerator CoGenerateChips(HatsTab __instance, List hats) diff --git a/MiraAPI/Patches/Menu/MainMenuManagerPatches.cs b/MiraAPI/Patches/Menu/MainMenuManagerPatches.cs index b2377fe7..f69e3741 100644 --- a/MiraAPI/Patches/Menu/MainMenuManagerPatches.cs +++ b/MiraAPI/Patches/Menu/MainMenuManagerPatches.cs @@ -1,4 +1,5 @@ -using System.Collections; +using System; +using System.Collections; using HarmonyLib; using MiraAPI.LocalSettings; using MiraAPI.Utilities.Assets; @@ -8,18 +9,23 @@ using UnityEngine; namespace MiraAPI.Patches.Menu; /// -/// General MainMenuManage patches. +/// General patches. /// [HarmonyPatch(typeof(MainMenuManager))] public static class MainMenuManagerPatches { + internal static bool NeedsDeepDestroy { get; private set; } + /// - /// A postifix on Awake to load all the addressables registered. + /// A postifix on to load all the addressables registered. /// [HarmonyPatch(nameof(MainMenuManager.Awake))] [HarmonyPostfix] public static void AwakePostfix() { + var requiredVersion = new Version(2026, 6, 5); + var version = Version.Parse(Application.version); + NeedsDeepDestroy = version >= requiredVersion; AddressablesLoader.LoadAll(); Coroutines.Start(SetFps()); } diff --git a/MiraAPI/Patches/Menu/NameplatesTabPatches.cs b/MiraAPI/Patches/Menu/NameplatesTabPatches.cs index 0b7acfe8..bd9a6ceb 100644 --- a/MiraAPI/Patches/Menu/NameplatesTabPatches.cs +++ b/MiraAPI/Patches/Menu/NameplatesTabPatches.cs @@ -2,6 +2,7 @@ using HarmonyLib; using Innersloth.Assets; using MiraAPI.Utilities; +using MiraAPI.Utilities.Assets; using Reactor.Utilities.Extensions; using System; using System.Collections.Generic; @@ -44,9 +45,13 @@ public static class NameplatesTabPatches [HarmonyPrefix] public static bool OnEnablePrefix(NameplatesTab __instance) { + if (!AddressablesLoader.AddressableNameplatesExist) + { + return true; + } __instance.plateId = HatManager.Instance.GetNamePlateById(DataManager.Player.Customization.namePlate).ProdId; - if (!SortedNameplates.ContainsKey("Vanilla")) AddRange(DestroyableSingleton.Instance.GetUnlockedNamePlates().Select(x => ("Vanilla", x))); + if (!SortedNameplates.ContainsKey("Vanilla")) AddRange(HatManager.Instance.GetUnlockedNamePlates().Select(x => ("Vanilla", x))); InventoryUtility.CreateNextBackButtons(__instance, PreviousPage, NextPage); @@ -60,6 +65,10 @@ public static class NameplatesTabPatches public static void UpdatePrefix(NameplatesTab __instance) { + if (!AddressablesLoader.AddressableNameplatesExist) + { + return; + } if (Input.GetKeyDown(KeyCode.LeftControl) || Input.GetKeyDown(KeyCode.RightControl) || Input.GetKeyDown(KeyCode.LeftArrow)) { PreviousPage(__instance); @@ -72,9 +81,10 @@ public static class NameplatesTabPatches private static void GenerateHats(NameplatesTab __instance, int page) { - foreach (ColorChip instanceColorChip in __instance.ColorChips) instanceColorChip.gameObject.Destroy(); + foreach (var instanceColorChip in __instance.ColorChips) instanceColorChip.gameObject.DeepDestroy(false); __instance.ColorChips.Clear(); - __instance.scroller.Inner.GetComponentsInChildren().Do(x => x.gameObject.Destroy()); + __instance.scroller.Inner.GetComponentsInChildren().Do(x => x.gameObject.DeepDestroy(false)); + Utilities.Extensions.ClearGarbageCollector(); var groupNameText = __instance.GetComponentInChildren(false); diff --git a/MiraAPI/Patches/Menu/SkinsTabPatches.cs b/MiraAPI/Patches/Menu/SkinsTabPatches.cs index b5ea7d79..5395ff60 100644 --- a/MiraAPI/Patches/Menu/SkinsTabPatches.cs +++ b/MiraAPI/Patches/Menu/SkinsTabPatches.cs @@ -1,6 +1,7 @@ using AmongUs.Data; using HarmonyLib; using MiraAPI.Utilities; +using MiraAPI.Utilities.Assets; using Reactor.Utilities.Extensions; using System; using System.Collections.Generic; @@ -36,6 +37,10 @@ public static class SkinsTabPatches [HarmonyPrefix] public static bool OnEnablePrefix(SkinsTab __instance) { + if (!AddressablesLoader.AddressableSkinsExist) + { + return true; + } __instance.skinId = HatManager.Instance.GetSkinById(DataManager.Player.Customization.Skin).ProdId; var allSkins = HatManager.Instance.GetUnlockedSkins().ToImmutableList(); @@ -62,6 +67,10 @@ public static class SkinsTabPatches public static void UpdatePrefix(SkinsTab __instance) { + if (!AddressablesLoader.AddressableSkinsExist) + { + return; + } if (Input.GetKeyDown(KeyCode.LeftControl) || Input.GetKeyDown(KeyCode.RightControl) || Input.GetKeyDown(KeyCode.LeftArrow)) { PreviousPage(__instance); @@ -74,9 +83,10 @@ public static class SkinsTabPatches private static void GenerateHats(SkinsTab __instance, int page) { - foreach (ColorChip instanceColorChip in __instance.ColorChips) instanceColorChip.gameObject.Destroy(); + foreach (var instanceColorChip in __instance.ColorChips) instanceColorChip.gameObject.DeepDestroy(false); __instance.ColorChips.Clear(); - __instance.scroller.Inner.GetComponentsInChildren().Do(x => x.gameObject.Destroy()); + __instance.scroller.Inner.GetComponentsInChildren().Do(x => x.gameObject.DeepDestroy(false)); + Utilities.Extensions.ClearGarbageCollector(); var groupNameText = __instance.GetComponentInChildren(false); diff --git a/MiraAPI/Patches/Menu/VisorsTabPatches.cs b/MiraAPI/Patches/Menu/VisorsTabPatches.cs index e801c1a7..ed5f103d 100644 --- a/MiraAPI/Patches/Menu/VisorsTabPatches.cs +++ b/MiraAPI/Patches/Menu/VisorsTabPatches.cs @@ -1,6 +1,7 @@ using AmongUs.Data; using HarmonyLib; using MiraAPI.Utilities; +using MiraAPI.Utilities.Assets; using Reactor.Utilities.Extensions; using System; using System.Collections.Generic; @@ -39,14 +40,17 @@ public static class VisorsTabPatches GenerateHats(tab, currentPage); } - [HarmonyPatch(nameof(VisorsTab.OnEnable))] [HarmonyPrefix] public static bool OnEnablePrefix(VisorsTab __instance) { + if (!AddressablesLoader.AddressableVisorsExist) + { + return true; + } __instance.visorId = HatManager.Instance.GetVisorById(DataManager.Player.Customization.Visor).ProdId; - if (!SortedVisors.ContainsKey("Vanilla")) AddRange(DestroyableSingleton.Instance.GetUnlockedVisors().Select(x => ("Vanilla", x))); + if (!SortedVisors.ContainsKey("Vanilla")) AddRange(HatManager.Instance.GetUnlockedVisors().Select(x => ("Vanilla", x))); InventoryUtility.CreateNextBackButtons(__instance, PreviousPage, NextPage); @@ -60,6 +64,10 @@ public static class VisorsTabPatches public static void UpdatePrefix(VisorsTab __instance) { + if (!AddressablesLoader.AddressableVisorsExist) + { + return; + } if (Input.GetKeyDown(KeyCode.LeftControl) || Input.GetKeyDown(KeyCode.RightControl) || Input.GetKeyDown(KeyCode.LeftArrow)) { PreviousPage(__instance); @@ -72,9 +80,10 @@ public static class VisorsTabPatches private static void GenerateHats(VisorsTab __instance, int page) { - foreach (ColorChip instanceColorChip in __instance.ColorChips) instanceColorChip.gameObject.Destroy(); + foreach (var instanceColorChip in __instance.ColorChips) instanceColorChip.gameObject.DeepDestroy(false); __instance.ColorChips.Clear(); - __instance.scroller.Inner.GetComponentsInChildren().Do(x => x.gameObject.Destroy()); + __instance.scroller.Inner.GetComponentsInChildren().Do(x => x.gameObject.DeepDestroy(false)); + Utilities.Extensions.ClearGarbageCollector(); var groupNameText = __instance.GetComponentInChildren(false); diff --git a/MiraAPI/Patches/MinigameBeginErrorPatch.cs b/MiraAPI/Patches/MinigameBeginErrorPatch.cs index ce594152..da7de72c 100644 --- a/MiraAPI/Patches/MinigameBeginErrorPatch.cs +++ b/MiraAPI/Patches/MinigameBeginErrorPatch.cs @@ -3,7 +3,7 @@ namespace MiraAPI.Patches; /// -/// Used to fix the Minigame crash errors (credits Submerged/PH Gaming for the fix). +/// Used to fix the crash errors (credits Submerged/PH Gaming for the fix). /// [HarmonyPatch] public static class MinigameBeginErrorPatch diff --git a/MiraAPI/Patches/Options/GameOptionsMenuPatch.cs b/MiraAPI/Patches/Options/GameOptionsMenuPatch.cs index dee3fa3d..7b5e7a82 100644 --- a/MiraAPI/Patches/Options/GameOptionsMenuPatch.cs +++ b/MiraAPI/Patches/Options/GameOptionsMenuPatch.cs @@ -63,7 +63,7 @@ internal static class GameOptionsMenuPatch var filteredGroups = GameSettingMenuPatches.SelectedMod?.InternalOptionGroups .Where(x => x.OptionableType == null && - !x.ShowInModifiersMenu && x.ParentMenu == MenuCategory.Roles) ?? []; + x.ParentMenu == MenuCategory.Roles) ?? []; foreach (var group in filteredGroups) { @@ -171,7 +171,7 @@ internal static class GameOptionsMenuPatch private static void ModifiersUpdate(ref float num) { var groups = GameSettingMenuPatches.SelectedMod?.InternalOptionGroups - .Where(x => x.ShowInModifiersMenu || x.OptionableType?.IsAssignableTo(typeof(BaseModifier)) == true) ?? []; + .Where(x => x.ParentMenu is MenuCategory.Modifiers || x.OptionableType?.IsAssignableTo(typeof(BaseModifier)) == true) ?? []; foreach (var modGroup in groups) { @@ -182,7 +182,7 @@ internal static class GameOptionsMenuPatch private static void ModifiersCreate(GameOptionsMenu menu) { var groups = GameSettingMenuPatches.SelectedMod?.InternalOptionGroups - .Where(x => x.ShowInModifiersMenu || x.OptionableType?.IsAssignableTo(typeof(BaseModifier)) == true) ?? []; + .Where(x => x.ParentMenu is MenuCategory.Modifiers || x.OptionableType?.IsAssignableTo(typeof(BaseModifier)) == true) ?? []; foreach (var group in groups) { CreateGroup(menu, group); @@ -218,7 +218,7 @@ internal static class GameOptionsMenuPatch } var filteredGroups = GameSettingMenuPatches.SelectedMod?.InternalOptionGroups - .Where(x => x.OptionableType == null && !x.ShowInModifiersMenu && x.ParentMenu == MenuCategory.Roles) ?? []; + .Where(x => x.OptionableType == null && x.ParentMenu == MenuCategory.Roles) ?? []; foreach (var group in filteredGroups) { diff --git a/MiraAPI/Patches/Options/GamePresetsTabPatches.cs b/MiraAPI/Patches/Options/GamePresetsTabPatches.cs index 2c6cc683..a4b6cca6 100644 --- a/MiraAPI/Patches/Options/GamePresetsTabPatches.cs +++ b/MiraAPI/Patches/Options/GamePresetsTabPatches.cs @@ -262,7 +262,7 @@ internal static class GamePresetsTabPatches iconSpriteRend.sprite = MiraAssets.RefreshIcon.LoadAsset(); Helpers.DivideSize(refreshButton.gameObject, 2f); - refreshButton.buttonText.gameObject.Destroy(); + refreshButton.buttonText.gameObject.DeepDestroy(); refreshButton.OnClick = new Button.ButtonClickedEvent(); refreshButton.OnClick.AddListener((UnityAction)Refresh); diff --git a/MiraAPI/Patches/Options/GameSettingMenuPatches.cs b/MiraAPI/Patches/Options/GameSettingMenuPatches.cs index 89e6f576..30ed1dde 100644 --- a/MiraAPI/Patches/Options/GameSettingMenuPatches.cs +++ b/MiraAPI/Patches/Options/GameSettingMenuPatches.cs @@ -162,7 +162,7 @@ internal static class GameSettingMenuPatches /// /// Prefix for the method. Sets up the custom options. /// - /// The GameSettingMenu instance. + /// The instance. [HarmonyPrefix] [HarmonyPatch(nameof(GameSettingMenu.Start))] public static void StartPrefix(GameSettingMenu __instance) @@ -429,10 +429,10 @@ internal static class GameSettingMenuPatches var modHasCustomTwo = SelectedMod.InternalOptionGroups.Exists( x => x.ParentMenu == MenuCategory.CustomTwo); var modHasModifiers = SelectedMod.InternalOptionGroups.Exists( - x => x.ShowInModifiersMenu || x.ParentMenu == MenuCategory.Modifiers || x.OptionableType?.IsAssignableTo(typeof(BaseModifier)) == true); + x => x.ParentMenu == MenuCategory.Modifiers || x.OptionableType?.IsAssignableTo(typeof(BaseModifier)) == true); var modHasOptions = - SelectedMod.InternalOptionGroups.Exists(x => x.OptionableType == null && (!x.ShowInModifiersMenu || - (x.ParentMenu != MenuCategory.Modifiers && x.ParentMenu != MenuCategory.Roles))); + SelectedMod.InternalOptionGroups.Exists(x => x.OptionableType == null && + x.ParentMenu != MenuCategory.Modifiers && x.ParentMenu != MenuCategory.Roles); _modifiersButton.gameObject.SetActive(true); _smallRolesButton.gameObject.SetActive(true); diff --git a/MiraAPI/Patches/Options/LobbyViewPanePatches.cs b/MiraAPI/Patches/Options/LobbyViewPanePatches.cs index 4a629f5d..c543447d 100644 --- a/MiraAPI/Patches/Options/LobbyViewPanePatches.cs +++ b/MiraAPI/Patches/Options/LobbyViewPanePatches.cs @@ -132,7 +132,7 @@ public static class LobbyViewPanePatches ModifiersTabButton?.SelectButton(true); var filteredGroups = SelectedMod.InternalOptionGroups - .Where(x => x.GroupVisible() && (x.ShowInModifiersMenu || (x.OptionableType != null && x.OptionableType.IsAssignableTo(typeof(BaseModifier))))); + .Where(x => x.GroupVisible() && (x.ParentMenu is MenuCategory.Modifiers || (x.OptionableType != null && x.OptionableType.IsAssignableTo(typeof(BaseModifier))))); DrawOptions(__instance, filteredGroups); } @@ -152,7 +152,7 @@ public static class LobbyViewPanePatches } var filteredGroups = SelectedMod.InternalOptionGroups - .Where(x => x is { ShowInModifiersMenu: false, OptionableType: null } && x.GroupVisible()); + .Where(x => x is { ParentMenu: not MenuCategory.Modifiers, OptionableType: null } && x.GroupVisible()); DrawOptions(__instance, filteredGroups); return false; diff --git a/MiraAPI/Patches/Options/RoleSettingMenuPatches.cs b/MiraAPI/Patches/Options/RoleSettingMenuPatches.cs index 09530d48..d123161d 100644 --- a/MiraAPI/Patches/Options/RoleSettingMenuPatches.cs +++ b/MiraAPI/Patches/Options/RoleSettingMenuPatches.cs @@ -41,12 +41,6 @@ public static class RoleSettingMenuPatches { HudManager.Instance.PlayerCam.OverrideScreenShakeEnabled = false; } - [HarmonyPostfix] - [HarmonyPatch(nameof(RolesSettingsMenu.OnDisable))] - public static void ClosePatch(RolesSettingsMenu __instance) - { - HudManager.Instance.PlayerCam.OverrideScreenShakeEnabled = true; - } [HarmonyPostfix] [HarmonyPatch(nameof(RolesSettingsMenu.SetQuotaTab))] @@ -59,15 +53,30 @@ public static class RoleSettingMenuPatches [HarmonyPatch(nameof(RolesSettingsMenu.SetQuotaTab))] public static bool SetQuotaTabPatch(RolesSettingsMenu __instance) { - Headers.ForEach(Object.Destroy); - RoleOptionSettings.ForEach(Object.Destroy); + foreach (var obj in Headers) + { + if (!obj) + { + continue; + } + obj.DeepDestroy(false); + } Headers.Clear(); + foreach (var obj in RoleOptionSettings) + { + if (!obj) + { + continue; + } + obj.gameObject.DeepDestroy(false); + } RoleOptionSettings.Clear(); CurrentRole = null; CurrentRoleOptions = null; __instance.roleChances = new Il2CppSystem.Collections.Generic.List(); __instance.advancedSettingChildren = new Il2CppSystem.Collections.Generic.List(); + Utilities.Extensions.ClearGarbageCollector(); var maskBg = __instance.scrollBar.transform.FindChild("MaskBg"); var hitbox = __instance.scrollBar.transform.FindChild("Hitbox"); @@ -169,6 +178,7 @@ public static class RoleSettingMenuPatches .ThenBy(x => x.Key.Name); var quotaThing = __instance.categoryHeaderEditRoleOrigin.transform.FindChild("QuotaHeader"); + var usingNewQuota = false; var template = __instance.transform.parent.parent.GetComponent().GameSettingsTab.categoryHeaderOrigin; foreach (var grouping in sortedRoleGroups) @@ -207,12 +217,17 @@ public static class RoleSettingMenuPatches var countText = quotaInst.transform.FindChild("# Text"); countText.transform.localPosition = new Vector3(1.9f, 0.0993f, 0f); - var blankLabel = quotaInst.transform.FindChild("BlankLabel").gameObject; - var chanceLabel = quotaInst.transform.FindChild("Chance Label").gameObject; - var countLabel = quotaInst.transform.FindChild("# Label").gameObject; - blankLabel.Destroy(); - chanceLabel.Destroy(); - countLabel.Destroy(); + if (!usingNewQuota) + { + var blankLabel = quotaInst.transform.FindChild("BlankLabel").gameObject; + var chanceLabel = quotaInst.transform.FindChild("Chance Label").gameObject; + var countLabel = quotaInst.transform.FindChild("# Label").gameObject; + blankLabel.DeepDestroy(false); + chanceLabel.DeepDestroy(false); + countLabel.DeepDestroy(false); + usingNewQuota = true; + quotaThing = quotaInst; + } categoryHeaderMasked.Background.sprite = MiraAssets.CategoryHeader.LoadAsset(); categoryHeaderMasked.Background.sprite.texture.filterMode = FilterMode.Bilinear; @@ -295,16 +310,25 @@ public static class RoleSettingMenuPatches { RoleGroupHidden[group] = !groupHidden; } - foreach (var header in Headers) + foreach (var obj in Headers) { - header.Destroy(); + if (!obj) + { + continue; + } + obj.DeepDestroy(false); } Headers.Clear(); - foreach (var option in RoleOptionSettings) + foreach (var obj in RoleOptionSettings) { - option.gameObject.Destroy(); + if (!obj) + { + continue; + } + obj.gameObject.DeepDestroy(false); } RoleOptionSettings.Clear(); + Utilities.Extensions.ClearGarbageCollector(); __instance.SetQuotaTab(); })); headerBtn.SetButtonEnableState(true); @@ -428,11 +452,12 @@ public static class RoleSettingMenuPatches { foreach (var optBehaviour in __instance.AdvancedRolesSettings.GetComponentsInChildren()) { - optBehaviour.gameObject.DestroyImmediate(); + optBehaviour.gameObject.DeepDestroy(false); } CurrentRole = role; __instance.advancedSettingChildren.Clear(); + Utilities.Extensions.ClearGarbageCollector(); // TODO: create sub groups under the role settings. var filteredOptions = GameSettingMenuPatches.SelectedMod?.InternalOptionGroups @@ -624,7 +649,7 @@ public static class RoleSettingMenuPatches var newButton = Object.Instantiate(roleOptionSetting.buttons[0], roleOptionSetting.transform); newButton.name = "ConfigButton"; newButton.transform.localPosition = new Vector3(0.4473f, -0.3f, -2f); - newButton.transform.FindChild("Text_TMP").gameObject.DestroyImmediate(); + newButton.transform.FindChild("Text_TMP").gameObject.DeepDestroy(); newButton.activeSprites.Destroy(); var btnRend = newButton.transform.FindChild("ButtonSprite").GetComponent(); diff --git a/MiraAPI/Patches/Options/SettingPatches.cs b/MiraAPI/Patches/Options/SettingPatches.cs index e33633a9..59b956c3 100644 --- a/MiraAPI/Patches/Options/SettingPatches.cs +++ b/MiraAPI/Patches/Options/SettingPatches.cs @@ -17,10 +17,10 @@ public static class SettingPatches /// /// Prefix for the method. Adds support for custom number suffixes. /// - /// The FloatGameSetting instance. - /// The result of the GetValueString method. - /// The float value. - /// False to skip original method. + /// The instance. + /// The result of the method. + /// The value. + /// to skip original method. [HarmonyPrefix] [HarmonyPatch(typeof(FloatGameSetting), nameof(FloatGameSetting.GetValueString))] public static bool ValueStringPatch( diff --git a/MiraAPI/Patches/PlayerControlPatches.cs b/MiraAPI/Patches/PlayerControlPatches.cs index 946b6f26..3c851b0e 100644 --- a/MiraAPI/Patches/PlayerControlPatches.cs +++ b/MiraAPI/Patches/PlayerControlPatches.cs @@ -14,7 +14,7 @@ using Reactor.Utilities.Extensions; namespace MiraAPI.Patches; /// -/// General patches for the PlayerControl class. +/// General patches for the class. /// [HarmonyPatch(typeof(PlayerControl))] internal static class PlayerControlPatches diff --git a/MiraAPI/Patches/Roles/HauntMenuPatch.cs b/MiraAPI/Patches/Roles/HauntMenuPatch.cs index da272a6f..851ddaa9 100644 --- a/MiraAPI/Patches/Roles/HauntMenuPatch.cs +++ b/MiraAPI/Patches/Roles/HauntMenuPatch.cs @@ -6,7 +6,7 @@ using UnityEngine; namespace MiraAPI.Patches.Roles; /// -/// Patches the haunt menu to show the actual role name rather than team. +/// Patches the to show the actual role name rather than team. /// [HarmonyPatch(typeof(HauntMenuMinigame), nameof(HauntMenuMinigame.SetHauntTarget))] // SetFilterText was INLINED diff --git a/MiraAPI/Patches/Roles/HowToPlayPatch.cs b/MiraAPI/Patches/Roles/HowToPlayPatch.cs index e500068d..ee6e5ff1 100644 --- a/MiraAPI/Patches/Roles/HowToPlayPatch.cs +++ b/MiraAPI/Patches/Roles/HowToPlayPatch.cs @@ -11,7 +11,7 @@ namespace MiraAPI.Patches.Roles; internal static class HowToPlayPatch { // yes i patched the entire method - private static void Prefix(HowToPlayScene __instance) + public static void Prefix(HowToPlayScene __instance) { if (RoleManager.Instance.AllRoles.ToArray().All(x => !x.IsCustomRole())) { @@ -22,22 +22,18 @@ internal static class HowToPlayPatch __instance.startPage.SetActive(false); if (__instance.roleButtonsParent.childCount == 0) { - using (IEnumerator enumerator = RoleManager.Instance.AllRoles.ToArray().Where(x => !x.IsCustomRole()).GetEnumerator()) + foreach (var role in RoleManager.Instance.AllRoles.ToArray().Where(x => !x.IsCustomRole())) { - while (enumerator.MoveNext()) + if (!role.IsSimpleRole && role.Role != RoleTypes.CrewmateGhost && role.Role != RoleTypes.ImpostorGhost) { - RoleBehaviour role = enumerator.Current; - if (!role.IsSimpleRole && role.Role != RoleTypes.CrewmateGhost && role.Role != RoleTypes.ImpostorGhost) + HowToPlayRoleButton component = Object.Instantiate(__instance.roleButtonPrefab, __instance.roleButtonsParent).GetComponent(); + Sprite roleIcon = __instance.rolesScenes.ToArray().First(r => r.role == role.Role).roleIcon; + component.SetRoleInfo(role, roleIcon); + component.SetButtonAction((Il2CppSystem.Action)(() => { - HowToPlayRoleButton component = Object.Instantiate(__instance.roleButtonPrefab, __instance.roleButtonsParent).GetComponent(); - Sprite roleIcon = __instance.rolesScenes.ToArray().First(r => r.role == role.Role).roleIcon; - component.SetRoleInfo(role, roleIcon); - component.SetButtonAction((Il2CppSystem.Action)(() => - { - __instance.OpenRolePage(role.Role); - })); - __instance.controllerSelectables.Add(component.GetComponent()); - } + OpenRolePage(__instance, role.Role); + })); + __instance.controllerSelectables.Add(component.GetComponent()); } } foreach (UiElement uiElement in __instance.controllerSelectables) @@ -50,4 +46,23 @@ internal static class HowToPlayPatch __instance.roleSelectionScene.SetActive(true); ControllerManager.Instance.SetDefaultSelection(__instance.defaultButtonSelected, null); } + public static void OpenRolePage(HowToPlayScene instance, RoleTypes roleType) + { + instance.category = HowToPlayScene.HowToPlayCategory.Roles; + var newList = instance.rolesScenes.ToArray().ToList(); + var buttonList = instance.roleButtons; + instance.sceneIndex = newList.FindIndex(r => r.role == roleType); + if (roleType != RoleTypes.Crewmate) + { + foreach (var button in buttonList) + { + if (button.GetRole().Role == roleType) + { + instance.previouslySelectedRoleButton = button.GetComponent(); + } + } + } + instance.SetupDots(instance.rolesScenes[instance.sceneIndex].rolePages.Count); + instance.ChangeScene(0); + } } diff --git a/MiraAPI/Patches/Roles/HudManagerPatches.cs b/MiraAPI/Patches/Roles/HudManagerPatches.cs index 348f7399..79c23063 100644 --- a/MiraAPI/Patches/Roles/HudManagerPatches.cs +++ b/MiraAPI/Patches/Roles/HudManagerPatches.cs @@ -1,12 +1,14 @@ using HarmonyLib; using InnerNet; using MiraAPI.Roles; +using MiraAPI.Utilities; using Reactor.Utilities.Extensions; +using UnityEngine; namespace MiraAPI.Patches.Roles; /// -/// HudManager patches for roles. +/// patches for roles. /// [HarmonyPatch(typeof(HudManager))] public static class HudManagerPatches @@ -15,11 +17,11 @@ public static class HudManagerPatches public static TaskPanelBehaviour? RoleTab; /// - /// Fixes Kill Button not showing for Neutral killing role. + /// Fixes not showing for Neutral killing role. /// - /// HudManager instance. - /// The local PlayerControl. - /// The player's RoleBehaviour. + /// instance. + /// The local . + /// The player's . /// Whether the Hud should be set active or not. [HarmonyPostfix] [HarmonyPatch(nameof(HudManager.SetHudActive), typeof(PlayerControl), typeof(RoleBehaviour), typeof(bool))] @@ -69,9 +71,10 @@ public static class HudManagerPatches CustomRoleManager.UpdateRoleTab(RoleTab, customRole); } - else if (RoleTab) + else if (RoleTab != null) { - RoleTab?.gameObject.Destroy(); + RoleTab.gameObject.DeepDestroy(); + RoleTab = null; } } } diff --git a/MiraAPI/Patches/Roles/KillButtonPatches.cs b/MiraAPI/Patches/Roles/KillButtonPatches.cs index d8f14c7d..9a004227 100644 --- a/MiraAPI/Patches/Roles/KillButtonPatches.cs +++ b/MiraAPI/Patches/Roles/KillButtonPatches.cs @@ -7,13 +7,13 @@ using UnityEngine; namespace MiraAPI.Patches.Roles; /// -/// Fix kill button issues for neutral killers. +/// Fix issues for neutral killers. /// [HarmonyPatch(typeof(KillButton))] public static class KillButtonPatches { /// - /// SetTarget for custom roles. + /// for custom roles. /// [HarmonyPrefix] [HarmonyPatch(nameof(KillButton.SetTarget))] @@ -46,7 +46,8 @@ public static class KillButtonPatches } /// - /// Use Custom Murder instead of Murder Player from vanilla. + /// Use + /// instead of from vanilla. /// [HarmonyPrefix] [HarmonyPatch(nameof(KillButton.DoClick))] diff --git a/MiraAPI/Patches/Roles/RoleBehaviourPatch.cs b/MiraAPI/Patches/Roles/RoleBehaviourPatch.cs index 1caba498..315f2b20 100644 --- a/MiraAPI/Patches/Roles/RoleBehaviourPatch.cs +++ b/MiraAPI/Patches/Roles/RoleBehaviourPatch.cs @@ -8,7 +8,7 @@ namespace MiraAPI.Patches.Roles; public static class RoleBehaviourPatch { /// - /// Update TeamColor text for Mira roles. + /// Update text for s. /// [HarmonyPrefix] [HarmonyPatch(nameof(RoleBehaviour.TeamColor), MethodType.Getter)] diff --git a/MiraAPI/Patches/Roles/RoleOptionsCollectionPatch.cs b/MiraAPI/Patches/Roles/RoleOptionsCollectionPatch.cs index d933a287..ff57b37c 100644 --- a/MiraAPI/Patches/Roles/RoleOptionsCollectionPatch.cs +++ b/MiraAPI/Patches/Roles/RoleOptionsCollectionPatch.cs @@ -13,7 +13,7 @@ namespace MiraAPI.Patches.Roles; public static class RoleOptionsCollectionPatch { /// - /// This patch fixes GetNumPerGame being inlined (2025.9.9) in the original code. + /// This patch fixes being inlined (2025.9.9) in the original code. /// [HarmonyPrefix] [HarmonyPatch(nameof(RoleOptionsCollectionV10.AnyRolesEnabled))] @@ -32,7 +32,7 @@ public static class RoleOptionsCollectionPatch /// /// Set the role chance for custom Launchpad roles based on config. /// - /// Return false to skip original method, true to not. + /// Return to skip original method, to not. [HarmonyPrefix] [HarmonyPatch(nameof(RoleOptionsCollectionV10.GetChancePerGame))] public static bool GetChancePrefix(RoleTypes role, ref int __result) @@ -62,7 +62,7 @@ public static class RoleOptionsCollectionPatch /// /// Set the amount for custom Launchpad roles based on config. /// - /// Return false to skip original method, true to not. + /// Return to skip original method, to not. [HarmonyPrefix] [HarmonyPatch(nameof(RoleOptionsCollectionV10.GetNumPerGame))] public static bool GetNumPrefix(RoleTypes role, ref int __result) diff --git a/MiraAPI/Patches/Roles/SabotageButtonPatch.cs b/MiraAPI/Patches/Roles/SabotageButtonPatch.cs index 258af831..50c61338 100644 --- a/MiraAPI/Patches/Roles/SabotageButtonPatch.cs +++ b/MiraAPI/Patches/Roles/SabotageButtonPatch.cs @@ -7,7 +7,7 @@ namespace MiraAPI.Patches.Roles; public static class SabotageButtonPatch { /// - /// Patches the Sabotage button to check if the player's custom role can use sabotage. + /// Patches the to check if the player's custom role can use sabotage. /// [HarmonyPatch(nameof(SabotageButton.DoClick))] [HarmonyPrefix] diff --git a/MiraAPI/Patches/Roles/VentPatches.cs b/MiraAPI/Patches/Roles/VentPatches.cs index 6ff28f8c..b475ddf6 100644 --- a/MiraAPI/Patches/Roles/VentPatches.cs +++ b/MiraAPI/Patches/Roles/VentPatches.cs @@ -6,13 +6,13 @@ using UnityEngine; namespace MiraAPI.Patches.Roles; /// -/// Vent patches for Roles. +/// patches for s. /// [HarmonyPatch(typeof(Vent))] public static class VentPatches { /// - /// Set outline to player's custom role color. + /// Set outline to player's . /// [HarmonyPostfix] [HarmonyPatch(nameof(Vent.SetOutline))] diff --git a/MiraAPI/Patches/Stubs/MinigameStubs.cs b/MiraAPI/Patches/Stubs/MinigameStubs.cs index 3818d09b..4c2628fc 100644 --- a/MiraAPI/Patches/Stubs/MinigameStubs.cs +++ b/MiraAPI/Patches/Stubs/MinigameStubs.cs @@ -4,13 +4,13 @@ using HarmonyLib; namespace MiraAPI.Patches.Stubs; /// -/// Reverse patches for Minigames. +/// Reverse patches for s. /// [HarmonyPatch] public static class MinigameStubs { /// - /// Reverse patch for Minigame.Begin. + /// Reverse patch for . /// /// The Minigame instance. /// Associated PlayerTask. @@ -23,7 +23,7 @@ public static class MinigameStubs } /// - /// Reverse patch for Minigame.Close. + /// Reverse patch for . /// /// The Minigame instance. [HarmonyReversePatch] diff --git a/MiraAPI/Patches/Stubs/RoleBehaviourStubs.cs b/MiraAPI/Patches/Stubs/RoleBehaviourStubs.cs index 356bf68b..8743f3be 100644 --- a/MiraAPI/Patches/Stubs/RoleBehaviourStubs.cs +++ b/MiraAPI/Patches/Stubs/RoleBehaviourStubs.cs @@ -6,16 +6,16 @@ using Il2CppSystem.Text; namespace MiraAPI.Patches.Stubs; /// -/// Stub methods for the RoleBehaviour class. Needed because of Il2Cpp limitations on injected classes. +/// Stub methods for the class. Needed because of Il2Cpp limitations on injected classes. /// [HarmonyPatch] public static class RoleBehaviourStubs { /// - /// Stub method for RoleBehaviour.Initialize. + /// Stub method for . /// - /// The RoleBehaviour object. - /// The PlayerControl to initialize. + /// The object. + /// The to initialize. [HarmonyReversePatch] [HarmonyPatch(typeof(RoleBehaviour), nameof(RoleBehaviour.Initialize))] [MethodImpl(MethodImplOptions.NoInlining)] @@ -25,10 +25,10 @@ public static class RoleBehaviourStubs } /// - /// Stub method for RoleBehaviour.AdjustTasks. + /// Stub method for . /// - /// The RoleBehaviour object. - /// The PlayerControl to adjust tasks for. + /// The object. + /// The to adjust tasks for. [HarmonyReversePatch] [HarmonyPatch(typeof(RoleBehaviour), nameof(RoleBehaviour.AdjustTasks))] [MethodImpl(MethodImplOptions.NoInlining)] @@ -38,10 +38,10 @@ public static class RoleBehaviourStubs } /// - /// Stub method for RoleBehaviour.AppendTaskHint. + /// Stub method for . /// - /// The RoleBehaviour object. - /// The StringBuilder to append the task hint to. + /// The object. + /// The to append the task hint to. [HarmonyReversePatch] [HarmonyPatch(typeof(RoleBehaviour), nameof(RoleBehaviour.AppendTaskHint), typeof(StringBuilder))] [MethodImpl(MethodImplOptions.NoInlining)] @@ -51,10 +51,10 @@ public static class RoleBehaviourStubs } /// - /// Stub method for RoleBehaviour.CanUse. + /// Stub method for . /// - /// The RoleBehaviour object. - /// The IUsable console to check. + /// The object. + /// The console to check. /// Whether the console can be used. [HarmonyReversePatch] [HarmonyPatch(typeof(RoleBehaviour), nameof(RoleBehaviour.CanUse))] @@ -65,10 +65,10 @@ public static class RoleBehaviourStubs } /// - /// Stub method for RoleBehaviour.Deinitialize. + /// Stub method for . /// - /// The RoleBehaviour object. - /// The PlayerControl to deinitialize for. + /// The object. + /// The to deinitialize for. [HarmonyReversePatch] [HarmonyPatch(typeof(RoleBehaviour), nameof(RoleBehaviour.Deinitialize))] [MethodImpl(MethodImplOptions.NoInlining)] @@ -78,9 +78,9 @@ public static class RoleBehaviourStubs } /// - /// Stub method for RoleBehaviour.DidWin. + /// Stub method for . /// - /// The RoleBehaviour object. + /// The object. /// The reason for game over. /// Whether the role won. [HarmonyReversePatch] @@ -92,10 +92,10 @@ public static class RoleBehaviourStubs } /// - /// Stub method for RoleBehaviour.FindClosestTarget. + /// Stub method for . /// - /// The RoleBehaviour object. - /// The closest target PlayerControl. + /// The object. + /// The closest target . [HarmonyReversePatch] [HarmonyPatch(typeof(RoleBehaviour), nameof(RoleBehaviour.FindClosestTarget))] [MethodImpl(MethodImplOptions.NoInlining)] @@ -105,9 +105,9 @@ public static class RoleBehaviourStubs } /// - /// Stub method for RoleBehaviour.GetAbilityDistance. + /// Stub method for . /// - /// The RoleBehaviour object. + /// The object. /// The ability distance. [HarmonyReversePatch] [HarmonyPatch(typeof(RoleBehaviour), nameof(RoleBehaviour.GetAbilityDistance))] @@ -118,10 +118,10 @@ public static class RoleBehaviourStubs } /// - /// Stub method for RoleBehaviour.IsValidTarget. + /// Stub method for . /// - /// The RoleBehaviour object. - /// The NetworkedPlayerInfo to validate. + /// The object. + /// The to validate. /// Whether the target is valid. [HarmonyReversePatch] [HarmonyPatch(typeof(RoleBehaviour), nameof(RoleBehaviour.IsValidTarget))] @@ -132,9 +132,9 @@ public static class RoleBehaviourStubs } /// - /// Stub method for RoleBehaviour.OnDeath. + /// Stub method for . /// - /// The RoleBehaviour object. + /// The object. /// The reason for death. [HarmonyReversePatch] [HarmonyPatch(typeof(RoleBehaviour), nameof(RoleBehaviour.OnDeath))] @@ -145,9 +145,9 @@ public static class RoleBehaviourStubs } /// - /// Stub method for RoleBehaviour.OnMeetingStart. + /// Stub method for . /// - /// The RoleBehaviour object. + /// The object. [HarmonyReversePatch] [HarmonyPatch(typeof(RoleBehaviour), nameof(RoleBehaviour.OnMeetingStart))] [MethodImpl(MethodImplOptions.NoInlining)] @@ -157,9 +157,9 @@ public static class RoleBehaviourStubs } /// - /// Stub method for RoleBehaviour.OnVotingComplete. + /// Stub method for . /// - /// The RoleBehaviour object. + /// The object. [HarmonyReversePatch] [HarmonyPatch(typeof(RoleBehaviour), nameof(RoleBehaviour.OnVotingComplete))] [MethodImpl(MethodImplOptions.NoInlining)] @@ -169,9 +169,9 @@ public static class RoleBehaviourStubs } /// - /// Stub method for RoleBehaviour.SetCooldown. + /// Stub method for . /// - /// The RoleBehaviour object. + /// The object. [HarmonyReversePatch] [HarmonyPatch(typeof(RoleBehaviour), nameof(RoleBehaviour.SetCooldown))] [MethodImpl(MethodImplOptions.NoInlining)] @@ -181,10 +181,10 @@ public static class RoleBehaviourStubs } /// - /// Stub method for RoleBehaviour.SetPlayerTarget. + /// Stub method for . /// - /// The RoleBehaviour object. - /// The PlayerControl target to set. + /// The object. + /// The target to set. [HarmonyReversePatch] [HarmonyPatch(typeof(RoleBehaviour), nameof(RoleBehaviour.SetPlayerTarget))] [MethodImpl(MethodImplOptions.NoInlining)] @@ -194,10 +194,10 @@ public static class RoleBehaviourStubs } /// - /// Stub method for RoleBehaviour.SetUsableTarget. + /// Stub method for . /// - /// The RoleBehaviour object. - /// The IUsable target to set. + /// The object. + /// The target to set. [HarmonyReversePatch] [HarmonyPatch(typeof(RoleBehaviour), nameof(RoleBehaviour.SetUsableTarget))] [MethodImpl(MethodImplOptions.NoInlining)] @@ -207,10 +207,10 @@ public static class RoleBehaviourStubs } /// - /// Stub method for RoleBehaviour.SpawnTaskHeader. + /// Stub method for . /// - /// The RoleBehaviour object. - /// The PlayerControl to spawn the task header for. + /// The object. + /// The to spawn the task header for. [HarmonyReversePatch] [HarmonyPatch(typeof(RoleBehaviour), nameof(RoleBehaviour.SpawnTaskHeader))] [MethodImpl(MethodImplOptions.NoInlining)] @@ -220,9 +220,9 @@ public static class RoleBehaviourStubs } /// - /// Stub method for RoleBehaviour.UseAbility. + /// Stub method for . /// - /// The RoleBehaviour object. + /// The object. [HarmonyReversePatch] [HarmonyPatch(typeof(RoleBehaviour), nameof(RoleBehaviour.UseAbility))] [MethodImpl(MethodImplOptions.NoInlining)] @@ -232,9 +232,9 @@ public static class RoleBehaviourStubs } /// - /// Stub method for RoleBehaviour.UseSecondaryAbility. + /// Stub method for . /// - /// The RoleBehaviour object. + /// The object. [HarmonyReversePatch] [HarmonyPatch(typeof(RoleBehaviour), nameof(RoleBehaviour.UseSecondaryAbility))] [MethodImpl(MethodImplOptions.NoInlining)] @@ -244,9 +244,9 @@ public static class RoleBehaviourStubs } /// - /// Stub method for RoleBehaviour.OnRoleSet. + /// Stub method for . /// - /// The RoleBehaviour object. + /// The object. [HarmonyReversePatch] [HarmonyPatch(typeof(RoleBehaviour), nameof(RoleBehaviour.OnRoleSet))] [MethodImpl(MethodImplOptions.NoInlining)] @@ -256,9 +256,9 @@ public static class RoleBehaviourStubs } /// - /// Stub method for RoleBehaviour.InitializeMeetingAbilityButton. + /// Stub method for . /// - /// The RoleBehaviour object. + /// The object. [HarmonyReversePatch] [HarmonyPatch(typeof(RoleBehaviour), nameof(RoleBehaviour.InitializeMeetingAbilityButton))] [MethodImpl(MethodImplOptions.NoInlining)] @@ -268,9 +268,9 @@ public static class RoleBehaviourStubs } /// - /// Stub method for RoleBehaviour.FindClosestBody. + /// Stub method for . /// - /// The RoleBehaviour object. + /// The object. [HarmonyReversePatch] [HarmonyPatch(typeof(RoleBehaviour), nameof(RoleBehaviour.FindClosestBody))] [MethodImpl(MethodImplOptions.NoInlining)] @@ -280,9 +280,9 @@ public static class RoleBehaviourStubs } /// - /// Stub method for RoleBehaviour.HandleRoleRpc. + /// Stub method for . /// - /// The RoleBehaviour object. + /// The object. [HarmonyReversePatch] [HarmonyPatch(typeof(RoleBehaviour), nameof(RoleBehaviour.HandleRoleRpc))] [MethodImpl(MethodImplOptions.NoInlining)] @@ -292,9 +292,9 @@ public static class RoleBehaviourStubs } /// - /// Stub method for RoleBehaviour.KillAnimSpecialSetup. + /// Stub method for . /// - /// The RoleBehaviour object. + /// The object. [HarmonyReversePatch] [HarmonyPatch(typeof(RoleBehaviour), nameof(RoleBehaviour.KillAnimSpecialSetup))] [MethodImpl(MethodImplOptions.NoInlining)] diff --git a/MiraAPI/Patches/VentCanUsePatch.cs b/MiraAPI/Patches/VentCanUsePatch.cs index b2854112..cc4e9e5a 100644 --- a/MiraAPI/Patches/VentCanUsePatch.cs +++ b/MiraAPI/Patches/VentCanUsePatch.cs @@ -8,7 +8,7 @@ using UnityEngine; namespace MiraAPI.Patches; /// -/// Used to change vent behaviour for the event system, custom roles, and modifiers. +/// Used to change behaviour for the system, s, and s. /// [HarmonyPatch(typeof(Vent), nameof(Vent.CanUse))] internal static class VentCanUsePatch @@ -28,7 +28,7 @@ internal static class VentCanUsePatch var @object = pc.Object; var role = @object.Data.Role; - var canVent = role is ICustomRole customRole ? customRole.Configuration.CanUseVent : role.CanVent; + var canVent = role is ICustomRole customRole ? customRole.Configuration.CanUseVent || customRole.Configuration.GetsVentData : role.CanVent; couldUse = canVent; var modifiers = @object.GetModifierComponent().ActiveModifiers; diff --git a/MiraAPI/PluginLoading/IMiraPlugin.cs b/MiraAPI/PluginLoading/IMiraPlugin.cs index e6b2dbb7..f1ef7932 100644 --- a/MiraAPI/PluginLoading/IMiraPlugin.cs +++ b/MiraAPI/PluginLoading/IMiraPlugin.cs @@ -38,8 +38,8 @@ public interface IMiraPlugin public virtual string CustomOptionMenuTwoDescription => "Apply game settings for this mod!"; /// - /// Gets the BepInEx configuration file for the plugin. + /// Gets the for the plugin. /// - /// The BepInEx configuration file for the plugin. + /// The for the plugin. public ConfigFile GetConfigFile(); } diff --git a/MiraAPI/PluginLoading/MiraPluginInfo.cs b/MiraAPI/PluginLoading/MiraPluginInfo.cs index 7168a706..0df7cb5e 100644 --- a/MiraAPI/PluginLoading/MiraPluginInfo.cs +++ b/MiraAPI/PluginLoading/MiraPluginInfo.cs @@ -13,7 +13,7 @@ using MiraAPI.Presets; namespace MiraAPI.PluginLoading; /// -/// Represents a Mira plugin. +/// Represents an . /// public class MiraPluginInfo { @@ -26,32 +26,32 @@ public class MiraPluginInfo } /// - /// Gets a read only collection of this plugin's modifiers. This is not safe for modifiers with constructors. + /// Gets a of this 's s. This is not safe for s with constructors. /// public IReadOnlyCollection Modifiers { get; private set; } = null!; /// - /// Gets a read only collection of this plugin's Option Groups. + /// Gets a of this 's s. /// public IReadOnlyCollection OptionGroups { get; private set; } = null!; /// - /// Gets a read only collection of this plugin's options. + /// Gets a of this 's s. /// public IReadOnlyCollection Options { get; private set; } = null!; /// - /// Gets a read only dictionary of Role IDs and the RoleBehaviour object they are associated with. + /// Gets a of Role IDs and the object they are associated with. /// public ReadOnlyDictionary Roles { get; private set; } = null!; /// - /// Gets a read only collection of this plugin's custom buttons. + /// Gets a of this 's . /// public IReadOnlyCollection Buttons { get; private set; } = null!; /// - /// Gets a read only dictionary of this plugin's custom presets. + /// Gets a of this 's s. /// public IReadOnlyCollection Presets { get; internal set; } = null!; @@ -95,7 +95,7 @@ public class MiraPluginInfo public PluginInfo PluginInfo { get; } /// - /// Gets the plugin's configuration file. + /// Gets the plugin's . /// public ConfigFile PluginConfig { get; } } diff --git a/MiraAPI/PluginLoading/MiraPluginManager.cs b/MiraAPI/PluginLoading/MiraPluginManager.cs index 26a881f4..4639b4fc 100644 --- a/MiraAPI/PluginLoading/MiraPluginManager.cs +++ b/MiraAPI/PluginLoading/MiraPluginManager.cs @@ -153,7 +153,7 @@ public sealed class MiraPluginManager /// Get a mira plugin by its GUID. /// /// The plugin GUID. - /// A MiraPluginInfo. + /// A . public static MiraPluginInfo? GetPluginByGuid(string pluginId) { return Instance._registeredPlugins.Values.FirstOrDefault(plugin => plugin.PluginId == pluginId); diff --git a/MiraAPI/Presets/OptionPreset.cs b/MiraAPI/Presets/OptionPreset.cs index 89786e40..11b6d757 100644 --- a/MiraAPI/Presets/OptionPreset.cs +++ b/MiraAPI/Presets/OptionPreset.cs @@ -23,12 +23,12 @@ public class OptionPreset public MiraPluginInfo Plugin { get; } /// - /// Gets the configuration file of the plugin associated with the preset. + /// Gets the of the plugin associated with the preset. /// public ConfigFile PluginConfig { get; } /// - /// Gets the configuration file for the preset. + /// Gets the for the preset. /// public ConfigFile PresetConfig { get; } @@ -40,9 +40,9 @@ public class OptionPreset /// /// Initializes a new instance of the class with the specified name and configuration file. /// - /// >The name of the preset. + /// The name of the preset. /// The plugin associated with the preset. - /// >The configuration file for the preset. + /// The configuration file for the preset. public OptionPreset(string name, MiraPluginInfo plugin, ConfigFile presetConfig) { Name = name; @@ -75,6 +75,7 @@ public class OptionPreset /// /// Resets the specified option with the preset provided. /// + /// The option to reset. public void ResetOption(OptionBehaviour baseOption) { var selectedOpt = Plugin.InternalOptions.First(x => x.OptionBehaviour == baseOption); @@ -87,7 +88,8 @@ public class OptionPreset /// /// Gets whether the specified option is included in the preset. /// - /// >The value of whether the option is in the preset. + /// The option to check. + /// The value of whether the option is in the preset. public bool IsOptionInPreset(OptionBehaviour baseOption) { var selectedOpt = Plugin.InternalOptions.First(x => x.OptionBehaviour == baseOption); diff --git a/MiraAPI/Presets/PresetManager.cs b/MiraAPI/Presets/PresetManager.cs index ba4289fe..bec1216d 100644 --- a/MiraAPI/Presets/PresetManager.cs +++ b/MiraAPI/Presets/PresetManager.cs @@ -4,13 +4,14 @@ using System.Linq; using BepInEx.Configuration; using MiraAPI.PluginLoading; using MiraAPI.Roles; +using MiraAPI.Utilities; using Reactor.Utilities; using UnityEngine; namespace MiraAPI.Presets; /// -/// Provides functionality to manage and load game option presets for plugins. +/// Provides functionality to manage and load game s for plugins. /// public static class PresetManager { @@ -23,7 +24,7 @@ public static class PresetManager internal static List InternalMasterPresets { get; } = []; /// - /// Gets a read only dictionary of this plugin's custom presets. + /// Gets a of this plugin's s. /// public static IReadOnlyCollection MasterPresets { get; internal set; } = null!; @@ -52,16 +53,16 @@ public static class PresetManager } /// - /// Loads the presets for the specified plugin by reading the configuration files from the preset directory. + /// Loads the s for the specified plugin by reading the s from the preset directory. /// - /// >The plugin for which the presets should be loaded. + /// The plugin for which the s should be loaded. public static void LoadPresets(MiraPluginInfo plugin) { foreach (var btn in plugin.InternalPresets.Select(x=>x.PresetButton)) { if (btn != null) { - Object.DestroyImmediate(btn); + btn.DeepDestroy(); } } @@ -105,7 +106,7 @@ public static class PresetManager } /// - /// Loads the master presets by reading the configuration files from the preset directory. + /// Loads the master presets by reading the s from the preset directory. /// public static void LoadMasterPreset() { @@ -133,7 +134,7 @@ public static class PresetManager { var fileName = Path.GetFileName(file); Info($"Loading preset file {fileName}"); - var presetName = Path.GetFileNameWithoutExtension(file); + // var presetName = Path.GetFileNameWithoutExtension(file); var presetConfig = new ConfigFile(file, false) { SaveOnConfigSet = false, diff --git a/MiraAPI/Presets/SavePresetPopup.cs b/MiraAPI/Presets/SavePresetPopup.cs index 87959e70..23ce48bd 100644 --- a/MiraAPI/Presets/SavePresetPopup.cs +++ b/MiraAPI/Presets/SavePresetPopup.cs @@ -26,7 +26,7 @@ public class SavePresetPopup(nint cppPtr) : Minigame(cppPtr) // Cleanup holder object public void OnDestroy() { - transform.parent.gameObject.Destroy(); + transform.parent.gameObject.DeepDestroy(); } public override void Close() diff --git a/MiraAPI/Roles/CustomRoleConfiguration.cs b/MiraAPI/Roles/CustomRoleConfiguration.cs index a11ddc0a..819eb1ca 100644 --- a/MiraAPI/Roles/CustomRoleConfiguration.cs +++ b/MiraAPI/Roles/CustomRoleConfiguration.cs @@ -24,7 +24,7 @@ public record struct CustomRoleConfiguration /// /// Initializes a new instance of the struct. /// - /// The role in which you are configuring. + /// The in which you are configuring. public CustomRoleConfiguration(ICustomRole role) { var roleBehaviour = role as RoleBehaviour; @@ -76,13 +76,13 @@ public record struct CustomRoleConfiguration public bool CanModifyChance { get; set; } = true; /// - /// Gets or sets the Sprite used for the Role Options menu screenshot. + /// Gets or sets the used for the Role Options menu screenshot. /// [HideFromIl2Cpp] public LoadableAsset? OptionsScreenshot { get; set; } = null; /// - /// Gets or sets the Sprite used for the Role Icon. + /// Gets or sets the used for the Role Icon. /// [HideFromIl2Cpp] public LoadableAsset? Icon { get; set; } = null; @@ -109,10 +109,15 @@ public record struct CustomRoleConfiguration public bool UseVanillaKillButton { get; set; } /// - /// Gets or sets a value indicating whether the role can use vents. + /// Gets or sets a value indicating whether the role can use s. Also sends vanilla data. /// public bool CanUseVent { get; set; } + /// + /// Gets or sets a value indicating whether the role can receive vanilla data. + /// + public bool GetsVentData { get; set; } + /// /// Gets or sets a value indicating whether the role can use the sabotage button. /// @@ -139,12 +144,12 @@ public record struct CustomRoleConfiguration public string FreeplayFolder { get; set; } /// - /// Gets or sets the outline color for the KillButton if is true. + /// Gets or sets the outline for the if is . /// public Color KillButtonOutlineColor { get; set; } /// - /// Gets or sets the role hint style. See enum for all options. + /// Gets or sets the role hint style. See for all options. /// public RoleHintType RoleHintType { get; set; } = RoleHintType.RoleTab; diff --git a/MiraAPI/Roles/CustomRoleManager.cs b/MiraAPI/Roles/CustomRoleManager.cs index 0bbf4ebd..9e6540fa 100644 --- a/MiraAPI/Roles/CustomRoleManager.cs +++ b/MiraAPI/Roles/CustomRoleManager.cs @@ -37,17 +37,17 @@ public static class CustomRoleManager CustomRoleUtils.GetIntroSound(RoleTypes.Impostor)!; /// - /// Gets the list of all roles from vanilla RoleManager. + /// Gets the array of all roles from vanilla . /// public static RoleBehaviour[] AllRoles => RoleManager.Instance.AllRoles.ToArray(); /// - /// Gets the list of custom roles as RoleBehaviour objects. + /// Gets the of custom roles as objects. /// public static IReadOnlyList CustomRoleBehaviours { get; private set; } = []; /// - /// Gets the list of custom roles as ICustomRole objects. + /// Gets the of custom roles as objects. /// public static IReadOnlyList CustomMiraRoles { get; private set; } = []; @@ -139,7 +139,7 @@ public static class CustomRoleManager roleBehaviour.CanBeKilled = customRole.Configuration.CanGetKilled; roleBehaviour.CanUseKillButton = customRole.Configuration.UseVanillaKillButton; roleBehaviour.TasksCountTowardProgress = customRole.Configuration.TasksCountForProgress; - roleBehaviour.CanVent = customRole.Configuration.CanUseVent; + roleBehaviour.CanVent = customRole.Configuration.CanUseVent || customRole.Configuration.GetsVentData; roleBehaviour.DefaultGhostRole = customRole.Configuration.GhostRole; roleBehaviour.MaxCount = customRole.Configuration.MaxRoleCount; roleBehaviour.RoleScreenshot = customRole.Configuration.OptionsScreenshot?.LoadAsset(); @@ -195,19 +195,19 @@ public static class CustomRoleManager /// /// Finds the parent mod of a custom role. /// - /// The ICustomRole object. - /// A MiraPluginInfo object representing the parent mod of the role. + /// The object. + /// A object representing the parent mod of the role. public static MiraPluginInfo FindParentMod(ICustomRole role) { return MiraPluginManager.Instance.RegisteredPlugins.First(plugin => plugin.InternalRoles.ContainsValue(role as RoleBehaviour ?? throw new InvalidOperationException())); } /// - /// Gets a custom role behaviour by role type. + /// Gets a custom role behaviour by . /// - /// The role type enum. - /// The ICustomRole result. - /// True if the role was found. + /// The . + /// The result. + /// if the role was found. public static bool GetCustomRoleBehaviour(RoleTypes roleType, out ICustomRole? result) { CustomRoles.TryGetValue((ushort)roleType, out var temp); diff --git a/MiraAPI/Roles/CustomRoleSingleton.cs b/MiraAPI/Roles/CustomRoleSingleton.cs index 90867af9..fe69eb09 100644 --- a/MiraAPI/Roles/CustomRoleSingleton.cs +++ b/MiraAPI/Roles/CustomRoleSingleton.cs @@ -4,15 +4,15 @@ using System.Linq; namespace MiraAPI.Roles; /// -/// A utility class to get the instance of a custom role. +/// A utility class to get the instance of a custom role. /// -/// The role you are trying to access. +/// The you are trying to access. public static class CustomRoleSingleton where T : ICustomRole { private static T? _instance; /// - /// Gets the instance of the role. + /// Gets the instance of the role. /// [SuppressMessage("Design", "CA1000:Do not declare static members on generic types", Justification = "This is a utility class to get the instance of a custom role.")] public static T Instance => _instance ??= CustomRoleManager.CustomRoles.Values.OfType().Single(); diff --git a/MiraAPI/Roles/CustomRoleUtils.cs b/MiraAPI/Roles/CustomRoleUtils.cs index fba91bfa..08c5cd4c 100644 --- a/MiraAPI/Roles/CustomRoleUtils.cs +++ b/MiraAPI/Roles/CustomRoleUtils.cs @@ -15,10 +15,10 @@ namespace MiraAPI.Roles; public static class CustomRoleUtils { /// - /// Determines whether the specified role can spawn in general, accounting for gamemodes and everything else. + /// Determines whether the specified can spawn in general, accounting for gamemodes and everything else. /// - /// The role you would like to check for. - /// True if the role is able to spawn, otherwise false. + /// The you would like to check for. + /// if the is able to spawn, otherwise . public static bool CanSpawnOnCurrentMode(RoleBehaviour role) { if (role is ICustomRole custom) @@ -56,7 +56,9 @@ public static class CustomRoleUtils var roleOptions = currentGameOptions.RoleOptions; var role = GetRegisteredRole(roleType); - var assignmentData = new RoleManager.RoleAssignmentData(role, roleOptions.GetNumPerGame(role!.Role), + var assignmentData = new RoleManager.RoleAssignmentData( + role, + roleOptions.GetNumPerGame(role!.Role), roleOptions.GetChancePerGame(role.Role)); return assignmentData; @@ -73,7 +75,7 @@ public static class CustomRoleUtils /// /// Gets all active in-game roles. /// - /// A list of roles. + /// An of s. // ReSharper disable once MemberCanBePrivate.Global public static IEnumerable GetActiveRoles() => PlayerControl.AllPlayerControls.ToArray().Select(x => x.Data.Role); @@ -85,17 +87,17 @@ public static class CustomRoleUtils public static IEnumerable GetActiveRolesOfTeam(ModdedRoleTeams team) => GetActiveRoles().Where(x => x is ICustomRole customRole && customRole.Team == team); /// - /// Gets all active in-game roles of a certain type. + /// Gets all active in-game roles. /// - /// The role Type you would like to check for. Must be a RoleBehaviour. - /// A list of roles with that specific type. + /// The you would like to check for. + /// An of s. public static IEnumerable GetActiveRolesOfType() where T : RoleBehaviour => GetActiveRoles().OfType(); /// - /// Creates a string builder for the Role Tab. + /// Creates a for the Role Tab. /// - /// The ICustomRole object. - /// A StringBuilder. + /// The object. + /// A . public static StringBuilder CreateForRole(ICustomRole role) { var taskStringBuilder = new StringBuilder(); @@ -109,7 +111,7 @@ public static class CustomRoleUtils /// Returns an intro sound from a role. /// /// The role type. - /// The intro sound. + /// The intro . public static LoadableAsset? GetIntroSound(RoleTypes roleType) { var role = CustomRoleManager.AllRoles.FirstOrDefault(role => role.Role == roleType); @@ -122,10 +124,10 @@ public static class CustomRoleUtils } /// - /// Determines if a role is a custom role or not. + /// Determines if a is a custom role or not. /// - /// The RoleBehaviour to check. - /// True if the role is a custom role, false otherwise. + /// The to check. + /// if the is a custom role, otherwise. public static bool IsCustomRole(this RoleBehaviour role) { return CustomRoleManager.CustomRoles.ContainsKey((ushort)role.Role); diff --git a/MiraAPI/Roles/ICustomRole.cs b/MiraAPI/Roles/ICustomRole.cs index 3570654c..5b726502 100644 --- a/MiraAPI/Roles/ICustomRole.cs +++ b/MiraAPI/Roles/ICustomRole.cs @@ -30,17 +30,17 @@ public interface ICustomRole : IOptionable string RoleLongDescription { get; } /// - /// Gets the color of the role. + /// Gets the of the role. /// Color RoleColor { get; } /// - /// Gets the color that should be used in the options menu. + /// Gets the that should be used in the options menu. /// Color OptionsMenuColor => RoleColor; /// - /// Gets the team of the role. + /// Gets the of the role. /// ModdedRoleTeams Team { get; } @@ -50,7 +50,7 @@ public interface ICustomRole : IOptionable CustomRoleConfiguration Configuration { get; } /// - /// Gets the role options group. + /// Gets the . /// RoleOptionsGroup RoleOptionsGroup => Team switch { @@ -88,9 +88,9 @@ public interface ICustomRole : IOptionable } /// - /// Saves the role's configuration to a preset ConfigFile. + /// Saves the role's configuration to a preset . /// - /// The ConfigFile to save the preset configuration to. + /// The to save the preset configuration to. /// Whether to use the default values for the configuration. public virtual void SaveToPreset(ConfigFile presetConfig, bool useDefault=false) { @@ -100,9 +100,9 @@ public interface ICustomRole : IOptionable } /// - /// Loads the role's configuration from a preset ConfigFile. + /// Loads the role's configuration from a preset . /// - /// The ConfigFile containing the preset configuration. + /// The containing the preset configuration. public virtual void LoadFromPreset(ConfigFile presetConfig) { if (presetConfig.TryGetEntry(NumConfigDefinition, out ConfigEntry numEntry)) @@ -186,7 +186,7 @@ public interface ICustomRole : IOptionable } /// - /// Whether the local player can see this role. + /// Whether the can see this role. /// /// The player with the role. /// Whether they can see the role (name color) or not. @@ -200,7 +200,7 @@ public interface ICustomRole : IOptionable /// /// The intro cutscene instance. /// The reference to the list of player in the team. - /// True to use the original team intro code, false to skip. + /// to use the original team intro code, to skip. public virtual bool SetupIntroTeam(IntroCutscene instance, ref Il2CppSystem.Collections.Generic.List yourTeam) { if (Team == ModdedRoleTeams.Custom) @@ -216,10 +216,10 @@ public interface ICustomRole : IOptionable } /// - /// Gets a custom ejection message for the role. Return null to use the default message. + /// Gets a custom ejection message for the role. Return to use the default message. /// /// The NetworkedPlayerInfo object for this player. - /// A string with a custom ejection message or null. + /// A string with a custom ejection message or . string? GetCustomEjectionMessage(NetworkedPlayerInfo player) { return Team == ModdedRoleTeams.Impostor ? $"{player.PlayerName} was The {RoleName}" : null; @@ -228,14 +228,14 @@ public interface ICustomRole : IOptionable /// /// Get the custom Role Tab text for this role. /// - /// A StringBuilder with the role tab text. + /// A with the role tab text. StringBuilder SetTabText() => CustomRoleUtils.CreateForRole(this); /// - /// Determine whether a given modifier can be applied to this role. + /// Determine whether a given can be applied to this role. /// /// The modifier to be tested. - /// True if the modifier is valid on this role, false otherwise. + /// if the is valid on this role, otherwise. bool IsModifierApplicable(BaseModifier modifier) { return true; @@ -244,7 +244,7 @@ public interface ICustomRole : IOptionable /// /// Determines whether the role can spawn in general, accounting for gamemodes and everything else. /// - /// True if the role is able to spawn, otherwise false. + /// if the role is able to spawn, otherwise . public virtual bool CanSpawnOnCurrentMode() => !GameManager.Instance.IsHideAndSeek(); /// diff --git a/MiraAPI/Roles/RoleId.cs b/MiraAPI/Roles/RoleId.cs index 91044fbd..189682b3 100644 --- a/MiraAPI/Roles/RoleId.cs +++ b/MiraAPI/Roles/RoleId.cs @@ -8,7 +8,7 @@ namespace MiraAPI.Roles; public static class RoleId { /// - /// Gets the ID of a role. + /// Gets the ID of an . /// /// The type of the role. /// The role ID as a ushort. diff --git a/MiraAPI/Roles/RoleOptionsGroup.cs b/MiraAPI/Roles/RoleOptionsGroup.cs index a1785b06..46b60671 100644 --- a/MiraAPI/Roles/RoleOptionsGroup.cs +++ b/MiraAPI/Roles/RoleOptionsGroup.cs @@ -6,7 +6,7 @@ namespace MiraAPI.Roles; /// Represents a group of roles. /// /// The group's name. -/// The group's color. +/// The group's . /// The priority to sort by on role setting screen. Negative means first. public record struct RoleOptionsGroup(string Name, Color Color, int Priority = 0) { diff --git a/MiraAPI/Roles/TeamIntroConfiguration.cs b/MiraAPI/Roles/TeamIntroConfiguration.cs index 9177722c..b01fe0e0 100644 --- a/MiraAPI/Roles/TeamIntroConfiguration.cs +++ b/MiraAPI/Roles/TeamIntroConfiguration.cs @@ -5,7 +5,7 @@ namespace MiraAPI.Roles; /// /// Used to configure the TEAM part of the intro cutscene. /// -/// The color to show during the "Team" part of the intro cutscene. +/// The to show during the "Team" part of the intro cutscene. /// The title text to show during the "Team" part of the intro cutscene. /// The description text to show during the "Team" part of the intro cutscene. public record struct TeamIntroConfiguration(Color IntroTeamColor, string IntroTeamTitle, string IntroTeamDescription) diff --git a/MiraAPI/Utilities/Assets/AddressablesLoader.cs b/MiraAPI/Utilities/Assets/AddressablesLoader.cs index 64918804..7acf73df 100644 --- a/MiraAPI/Utilities/Assets/AddressablesLoader.cs +++ b/MiraAPI/Utilities/Assets/AddressablesLoader.cs @@ -24,6 +24,26 @@ public static class AddressablesLoader private static readonly List<(string, string)> RegisteredNameplateKeys = []; private static readonly List RegisteredSkinKeys = []; + /// + /// Gets a value indicating whether hats have been loaded by the addressables system. + /// + public static bool AddressableHatsExist { get; private set; } + + /// + /// Gets a value indicating whether visors have been loaded by the addressables system. + /// + public static bool AddressableVisorsExist { get; private set; } + + /// + /// Gets a value indicating whether nameplates have been loaded by the addressables system. + /// + public static bool AddressableNameplatesExist { get; private set; } + + /// + /// Gets a value indicating whether skins have been loaded by the addressables system. + /// + public static bool AddressableSkinsExist { get; private set; } + /// /// Registers a specific addressables package to load asynchronously at the start of the game, when possible. /// @@ -52,6 +72,7 @@ public static class AddressablesLoader return; } + AddressableHatsExist = true; RegisteredHatKeys.Add(addressablesKey); } @@ -67,6 +88,7 @@ public static class AddressablesLoader return; } + AddressableSkinsExist = true; RegisteredSkinKeys.Add(addressablesKey); } @@ -83,6 +105,7 @@ public static class AddressablesLoader return; } + AddressableNameplatesExist = true; RegisteredNameplateKeys.Add((addressablesKey, groupTitle)); } @@ -99,6 +122,7 @@ public static class AddressablesLoader return; } + AddressableVisorsExist = true; RegisteredVisorKeys.Add((addressablesKey, groupTitle)); } @@ -142,29 +166,33 @@ public static class AddressablesLoader while (!AmongUsClient.Instance || CatalogLocations.Select(x=>x.Location).Any(x=>!LoadedLocations.Contains(x))) yield return null; var hatBehaviours = DiscoverData(RegisteredHatKeys); + hatBehaviours = hatBehaviours.OrderBy(x => x.StoreName).ToList(); var skinBehaviours = DiscoverData(RegisteredSkinKeys); + skinBehaviours = skinBehaviours.OrderBy(x => x.StoreName).ToList(); var namePlateBehaviours = DiscoverAndReportData(RegisteredNameplateKeys); + namePlateBehaviours = namePlateBehaviours.OrderBy(x => x.Category).ToList(); var visorBehaviours = DiscoverAndReportData(RegisteredVisorKeys); + visorBehaviours = visorBehaviours.OrderBy(x => x.Category).ToList(); var hatData = new List(); - hatData.AddRange(DestroyableSingleton.Instance.allHats); + hatData.AddRange(HatManager.Instance.allHats); hatData.ForEach(x => x.StoreName = "Vanilla"); - DestroyableSingleton.Instance.allHats = PrepareArray(hatData, hatBehaviours); + HatManager.Instance.allHats = PrepareArray(hatData, hatBehaviours); var skinData = new List(); - skinData.AddRange(DestroyableSingleton.Instance.allSkins); + skinData.AddRange(HatManager.Instance.allSkins); skinData.ForEach(x => x.StoreName = "Vanilla"); - DestroyableSingleton.Instance.allSkins = PrepareArray(skinData, skinBehaviours); + HatManager.Instance.allSkins = PrepareArray(skinData, skinBehaviours); var visorData = new List(); - visorData.AddRange(DestroyableSingleton.Instance.allVisors); + visorData.AddRange(HatManager.Instance.allVisors); VisorsTabPatches.AddRange(visorBehaviours); - DestroyableSingleton.Instance.allVisors = PrepareArray(visorData, visorBehaviours.Select(x=>x.Data).ToList()); + HatManager.Instance.allVisors = PrepareArray(visorData, visorBehaviours.Select(x=>x.Data).ToList()); var namePlateData = new List(); - namePlateData.AddRange(DestroyableSingleton.Instance.allNamePlates); + namePlateData.AddRange(HatManager.Instance.allNamePlates); NameplatesTabPatches.AddRange(namePlateBehaviours); - DestroyableSingleton.Instance.allNamePlates = PrepareArray(namePlateData, namePlateBehaviours.Select(x => x.Data).ToList()); + HatManager.Instance.allNamePlates = PrepareArray(namePlateData, namePlateBehaviours.Select(x => x.Data).ToList()); } private static T[] PrepareArray(List data, List behaviours) where T : CosmeticData diff --git a/MiraAPI/Utilities/Assets/LoadableAddressableAsset.cs b/MiraAPI/Utilities/Assets/LoadableAddressableAsset.cs index bde950c4..b9e8c55f 100644 --- a/MiraAPI/Utilities/Assets/LoadableAddressableAsset.cs +++ b/MiraAPI/Utilities/Assets/LoadableAddressableAsset.cs @@ -15,7 +15,7 @@ public class LoadableAddressableAsset(string uid) : LoadableAsset where T /// /// Initializes a new instance of the class, with added garbageCollector logic, - /// to help with https://github.com/BepInEx/Il2CppInterop/issues/40. + /// to help with . /// /// The guid of the asset. /// A lambda that allows GCHandle.Alloc calls without garbage collection interferences. diff --git a/MiraAPI/Utilities/Assets/LoadableAddressableAssets.cs b/MiraAPI/Utilities/Assets/LoadableAddressableAssets.cs index a6edbf77..9cabf83a 100644 --- a/MiraAPI/Utilities/Assets/LoadableAddressableAssets.cs +++ b/MiraAPI/Utilities/Assets/LoadableAddressableAssets.cs @@ -22,7 +22,7 @@ public class LoadableAddressableAssets(string key) where T : UnityEngine.Obje /// /// Initializes a new instance of the class, with added garbageCollector logic, - /// to help with https://github.com/BepInEx/Il2CppInterop/issues/40. + /// to help with . /// /// The key of the assets. /// A lambda that allows GCHandle.Alloc calls without garbage collection interferences. diff --git a/MiraAPI/Utilities/Assets/LoadableAssetWrapper.cs b/MiraAPI/Utilities/Assets/LoadableAssetWrapper.cs index 578c0511..a3684927 100644 --- a/MiraAPI/Utilities/Assets/LoadableAssetWrapper.cs +++ b/MiraAPI/Utilities/Assets/LoadableAssetWrapper.cs @@ -3,7 +3,7 @@ namespace MiraAPI.Utilities.Assets; /// -/// Wrapper class to turn any UnityEngine.Object into a . +/// Wrapper class to turn any into a . /// /// The type of the asset to be loaded. Must be a subclass of . public class LoadableAssetWrapper : LoadableAsset where T : UnityEngine.Object @@ -11,7 +11,7 @@ public class LoadableAssetWrapper : LoadableAsset where T : UnityEngine.Ob /// /// Initializes a new instance of the class. /// - /// The asset to wrap. This should be a reference to a UnityEngine.Object. + /// The asset to wrap. This should be a reference to a . public LoadableAssetWrapper(T asset) { LoadedAsset = asset.DontDestroy(); diff --git a/MiraAPI/Utilities/Assets/LoadableBundleAsset.cs b/MiraAPI/Utilities/Assets/LoadableBundleAsset.cs index 6f46eef6..3476a9a2 100644 --- a/MiraAPI/Utilities/Assets/LoadableBundleAsset.cs +++ b/MiraAPI/Utilities/Assets/LoadableBundleAsset.cs @@ -5,15 +5,15 @@ using UnityEngine; namespace MiraAPI.Utilities.Assets; /// -/// A utility class for loading assets from an asset bundle. +/// A utility class for loading assets from an . /// /// The name of the asset. -/// The AssetBundle that contains the asset. +/// The that contains the asset. /// The type of the asset to be loaded. public class LoadableBundleAsset(string name, AssetBundle bundle) : LoadableAsset where T : UnityEngine.Object { /// - /// Loads the asset from the asset bundle. + /// Loads the asset from the . /// /// The asset. /// The asset did not load properly. diff --git a/MiraAPI/Utilities/Assets/MiraAssets.cs b/MiraAPI/Utilities/Assets/MiraAssets.cs index bb91416c..8ae8986d 100644 --- a/MiraAPI/Utilities/Assets/MiraAssets.cs +++ b/MiraAPI/Utilities/Assets/MiraAssets.cs @@ -26,12 +26,12 @@ public static class MiraAssets } /// - /// Gets the color used for teal highlighting in UI. + /// Gets the used for teal highlighting in UI. /// public static Color32 AcceptedTeal { get; } = new(43, 233, 198, 255); /// - /// Gets the Mira API asset bundle. + /// Gets the Mira API . /// public static AssetBundle MiraAssetBundle { get; } = AssetBundleManager.Load("mirabundle"); @@ -46,22 +46,22 @@ public static class MiraAssets public static LoadableAsset PresetSavePopup { get; } = new LoadableBundleAsset("PresetSavePopup", MiraAssetBundle); /// - /// Gets the Refresh Icon sprite. + /// Gets the Refresh Icon . /// public static LoadableAsset RefreshIcon { get; } = new LoadableBundleAsset("refresh", MiraAssetBundle); /// - /// Gets the Folder Icon sprite. + /// Gets the Folder Icon . /// public static LoadableAsset FolderIcon { get; } = new LoadableBundleAsset("freePlay_folderTaskRoom", MiraAssetBundle); /// - /// Gets the empty sprite asset. + /// Gets the empty asset. /// public static LoadableResourceAsset Empty { get; } = new("MiraAPI.Resources.Empty.png"); /// - /// Gets the RoundedBox sprite, which is a rounded rectangle used for UI elements. + /// Gets the RoundedBox , which is a rounded rectangle used for UI elements. /// public static LoadableAsset RoundedBox { get; } @@ -71,7 +71,7 @@ public static class MiraAssets public static LoadableResourceAsset NextButton { get; } = new("MiraAPI.Resources.NextButton.png"); /// - /// Gets the Mira settings icon.. + /// Gets the Mira settings icon. /// public static LoadableResourceAsset SettingsIcon { get; } = new("MiraAPI.Resources.Settings.png"); diff --git a/MiraAPI/Utilities/Assets/PreloadedAsset.cs b/MiraAPI/Utilities/Assets/PreloadedAsset.cs index 5f7cd998..cf4ef7cd 100644 --- a/MiraAPI/Utilities/Assets/PreloadedAsset.cs +++ b/MiraAPI/Utilities/Assets/PreloadedAsset.cs @@ -4,9 +4,9 @@ namespace MiraAPI.Utilities.Assets; /// /// An implementation for creating loadable assets from existing assets. +/// /// /// -/// public class PreloadedAsset(T asset) : LoadableAsset where T : UnityEngine.Object { private readonly T _loadedAsset = asset ?? throw new ArgumentNullException(nameof(asset)); diff --git a/MiraAPI/Utilities/Assets/SpriteTools.cs b/MiraAPI/Utilities/Assets/SpriteTools.cs index 8bea6f1d..b0d4a1ed 100644 --- a/MiraAPI/Utilities/Assets/SpriteTools.cs +++ b/MiraAPI/Utilities/Assets/SpriteTools.cs @@ -11,12 +11,12 @@ namespace MiraAPI.Utilities.Assets; public static class SpriteTools { /// - /// Loads and returns a texture from a resource path using the specified assembly. + /// Loads and returns a texture from a resource path using the specified . /// - /// The path to the resource within the assembly. - /// The assembly from which to load the resource. + /// The path to the resource within the . + /// The from which to load the resource. /// A object loaded from the specified resource path. - /// Thrown when the resource cannot be found in the specified assembly. + /// Thrown when the resource cannot be found in the specified . public static Texture2D LoadTextureFromResourcePath(string resourcePath, Assembly assembly) { var tex = new Texture2D(1, 1, TextureFormat.ARGB32, false) @@ -39,10 +39,10 @@ public static class SpriteTools } /// - /// Loads and returns a from a resource path using the specified assembly. + /// Loads and returns a from a resource path using the specified . /// - /// The path to the resource within the assembly. - /// The assembly from which to load the resource. + /// The path to the resource within the . + /// The from which to load the resource. /// The number of pixels per unit for the sprite. /// A object created from the texture loaded from the specified resource path. public static Sprite LoadSpriteFromPath(string resourcePath, Assembly assembly, float pixelsPerUnit) diff --git a/MiraAPI/Utilities/ColorExtensions.cs b/MiraAPI/Utilities/ColorExtensions.cs index f6a121ea..0bf4ebfa 100644 --- a/MiraAPI/Utilities/ColorExtensions.cs +++ b/MiraAPI/Utilities/ColorExtensions.cs @@ -3,14 +3,14 @@ namespace MiraAPI.Utilities; /// -/// Extension methods for the Color struct. +/// Extension methods for the struct. /// public static class ColorExtensions { /// - /// Gets the relative luminance of a color (WCAG 2.1 specification). 0 is black, 1 is white. + /// Gets the relative luminance of a (WCAG 2.1 specification). 0 is black, 1 is white. /// - /// Color to calculate luminance for. + /// to calculate luminance for. /// Luminance value between 0 and 1. public static float GetRelativeLuminance(this Color color) { @@ -21,11 +21,11 @@ public static class ColorExtensions } /// - /// Calculates the contrast ratio between two colors (WCAG 2.1 specification). + /// Calculates the contrast ratio between two s (WCAG 2.1 specification). /// - /// First color. - /// Second color. - /// Contrast ratio between the two colors. + /// First . + /// Second . + /// Contrast ratio between the two s. public static float GetContrastRatio(this Color colorA, Color colorB) { var luminanceA = colorA.GetRelativeLuminance(); @@ -34,11 +34,11 @@ public static class ColorExtensions } /// - /// Generates an accessible alternate color with sufficient contrast. + /// Generates an accessible alternate with sufficient contrast. /// - /// Base color. + /// Base . /// Target contrast ratio (default 4.5f for AA). - /// Alternate color with sufficient contrast. + /// Alternate with sufficient contrast. public static Color FindAlternateColor(this Color color, float desiredRatio = 4.5f) { var lightColor = FindMinimumContrastColor(color, Color.white, desiredRatio); @@ -48,12 +48,12 @@ public static class ColorExtensions } /// - /// Finds the color with the minimum contrast ratio to the target color. + /// Finds the with the minimum contrast ratio to the target . /// - /// The base color to start from. - /// The target color to compare against. + /// The base to start from. + /// The target to compare against. /// The desired contrast ratio. - /// The color with the minimum contrast ratio to the target color. + /// The with the minimum contrast ratio to the target . public static Color FindMinimumContrastColor(Color baseColor, Color targetColor, float desiredRatio) { var baseLuminance = baseColor.GetRelativeLuminance(); diff --git a/MiraAPI/Utilities/EnumerableExtensions.cs b/MiraAPI/Utilities/EnumerableExtensions.cs index 5e0bc35e..f86391a2 100644 --- a/MiraAPI/Utilities/EnumerableExtensions.cs +++ b/MiraAPI/Utilities/EnumerableExtensions.cs @@ -10,23 +10,23 @@ namespace MiraAPI.Utilities; public static class EnumerableExtensions { /// - /// Shuffle the elements of the source enumerable using a new instance of Random. + /// Shuffle the elements of the using a new instance of . /// - /// The source enumerable. + /// The source . /// The type of the elements. - /// >The shuffled enumerable. + /// The shuffled . public static IEnumerable Shuffle(this IEnumerable source) { return source.Shuffle(new Random()); } /// - /// Shuffle the elements of the source enumerable using the provided Random instance. + /// Shuffle the elements of the using the provided instance. /// - /// The source enumerable. - /// The Random instance to use for shuffling. + /// The source . + /// The instance to use for shuffling. /// The type of the elements. - /// >The shuffled enumerable. + /// The shuffled . public static IEnumerable Shuffle(this IEnumerable source, Random rng) { ArgumentNullException.ThrowIfNull(source); diff --git a/MiraAPI/Utilities/Extensions.cs b/MiraAPI/Utilities/Extensions.cs index 8c4acc7b..6c8b74b5 100644 --- a/MiraAPI/Utilities/Extensions.cs +++ b/MiraAPI/Utilities/Extensions.cs @@ -1,4 +1,5 @@ using System; +using System.Collections; using System.Collections.Generic; using System.Globalization; using System.Linq; @@ -7,9 +8,11 @@ using System.Text.RegularExpressions; using HarmonyLib; using MiraAPI.GameOptions; using MiraAPI.Networking; +using MiraAPI.Patches.Menu; using MiraAPI.Roles; using MiraAPI.Voting; using Reactor.Utilities; +using Reactor.Utilities.Extensions; using Rewired; using Rewired.Data; using TMPro; @@ -45,15 +48,15 @@ public static class Extensions } /// - /// Used if you override Minigame.Close. + /// Used if you override . /// - /// The minigame. + /// The . public static void BaseClose(this Minigame self) { bool isComplete; if (self.amClosing == Minigame.CloseState.Closing) { - UnityEngine.Object.Destroy(self.gameObject); + self.gameObject.DeepDestroy(); return; } if (self.CloseSound && Constants.ShouldPlaySfx()) @@ -70,7 +73,7 @@ public static class Extensions } self.amClosing = Minigame.CloseState.Closing; self.logger.Info(string.Concat("Closing minigame ", self.GetType().Name)); - IAnalyticsReporter analytics = DestroyableSingleton.Instance.Analytics; + IAnalyticsReporter analytics = DebugAnalytics.Instance.Analytics; NetworkedPlayerInfo data = PlayerControl.LocalPlayer.Data; TaskTypes taskType = self.TaskType; float realtimeSinceStartup = Time.realtimeSinceStartup - self.timeOpened; @@ -88,16 +91,16 @@ public static class Extensions } /// - /// Sets the cooldown of a button with a formatted string. + /// Sets the cooldown of an with a formatted string. /// - /// The ActionButton to set the cooldown for. + /// The to set the cooldown for. /// The current timer value. /// The maximum timer value. /// The format string to use for the timer text. public static void SetCooldownFormat(this ActionButton? button, float timer, float maxTimer, string format = "0") { var num = Mathf.Clamp(timer / maxTimer, 0f, 1f); - button.isCoolingDown = num > 0f; + button!.isCoolingDown = num > 0f; button.SetCooldownFill(num); if (button.isCoolingDown) { @@ -109,9 +112,9 @@ public static class Extensions } /// - /// Sets the fill-up variant of a cooldown button with a formatted string. + /// Sets the fill-up variant of a cooldown with a formatted string. /// - /// The ActionButton to set the cooldown for. + /// The to set the cooldown for. /// The current timer value. /// The maximum timer value. /// The format string to use for the timer text. @@ -158,43 +161,43 @@ public static class Extensions } /// - /// Gets a PlayerControl from their PlayerVoteArea in a meeting. + /// Gets a from their in a meeting. /// - /// The vote area. - /// The player's PlayerControl. + /// The . + /// The player's . public static PlayerControl? GetPlayer(this PlayerVoteArea state) => GameData.Instance.GetPlayerById(state.TargetPlayerId)?.Object; /// - /// Gets an int representing the amount of tasks a player has left. + /// Gets an representing the amount of tasks a player has left. /// /// The player. /// A count of how many tasks the player has left. public static int GetTasksLeft(this PlayerControl player) => player.Data.Tasks.ToArray().Count(x => !x.Complete); /// - /// Checks if a PlayerControl is the game's host. + /// Checks if a is the game's host. /// - /// The player you're checking for. - /// If the player is the host, true, else false. + /// The you're checking for. + /// If the player is the host, , else . public static bool IsHost(this PlayerControl playerControl) { return TutorialManager.InstanceExists || AmongUsClient.Instance.HostId == playerControl.OwnerId; } /// - /// Checks if a PlayerControl is protected by a Guardian Angel. + /// Checks if a is protected by a Guardian Angel. /// - /// The player you're checking for. - /// If the player is protected, true, else false. + /// The you're checking for. + /// If the player is protected, , else . public static bool ProtectedByGa(this PlayerControl playerControl) { return playerControl.protectedByGuardianId > -1; } /// - /// Used to convert a System.Collections.Generic.List to Il2cppSystem. + /// Used to convert a to . /// - /// The list. + /// The . /// The type in the list. /// The converted list. public static Il2CppSystem.Collections.Generic.List ToIl2CppList(this List systemList) @@ -210,25 +213,150 @@ public static class Extensions } /// - /// Determines if a float is an integer. + /// Determines if a is an integer. /// - /// The float number. - /// True if the float is an integer, false otherwise. + /// The number. + /// if the is an integer, otherwise. public static bool IsInteger(this float number) { return Mathf.Approximately(number, Mathf.Round(number)); } /// - /// Gets a cache of player's vote data components to improve performance. + /// Destroys the properly. + /// + /// The to destroy. + /// Whether to run the garbage collector immediately. + public static void DeepDestroy(this GameObject obj, bool clearGc = true) + { + if (MainMenuManagerPatches.NeedsDeepDestroy) + { + Coroutines.Start(Nuke(obj, clearGc)); + } + else + { + obj?.Destroy(); + } + } + + private static IEnumerator Nuke(GameObject? go, bool clearGc) + { + if (go == null) + yield break; + + try + { + go.transform.SetParent(null, false); + } + catch + { + // ignored + } + + try + { + go.SetActive(false); + } + catch + { + // ignored + } + + foreach (var mb in go.GetComponentsInChildren(true)) + { + if (mb == null) + continue; + + try + { + mb.StopAllCoroutines(); + } + catch + { + // ignored + } + + try + { + mb.enabled = false; + } + catch + { + // ignored + } + } + + foreach (var renderer in go.GetComponentsInChildren(true)) + { + if (renderer == null) + continue; + + try + { + foreach (var mat in renderer.materials) + { + if (mat != null) + UnityEngine.Object.Destroy(mat); + } + } + catch + { + // ignored + } + } + + foreach (var filter in go.GetComponentsInChildren(true)) + { + if (filter == null) + continue; + + try + { + var mesh = filter.mesh; + if (mesh != null) + UnityEngine.Object.Destroy(mesh); + } + catch + { + // ignored + } + } + + UnityEngine.Object.Destroy(go); + yield return null; + if (clearGc) + { + yield return CoFreeResources(); + } + } + + /// + /// Clears up the Garbage Collector manually if necessary. + /// + public static void ClearGarbageCollector() + { + Coroutines.Start(CoFreeResources()); + } + + private static IEnumerator CoFreeResources() + { + yield return Resources.UnloadUnusedAssets(); + + GC.Collect(0, GCCollectionMode.Forced, blocking: true); + GC.WaitForPendingFinalizers(); + GC.Collect(0, GCCollectionMode.Forced, blocking: true); + } + + /// + /// Gets a cache of 's to improve performance. /// public static Dictionary VoteDataComponents { get; } = []; /// - /// Gets the PlayerVoteData of a player. + /// Gets the of a . /// - /// The PlayerControl object. - /// A PlayerVoteData if there is one, null otherwise. + /// The object. + /// A if there is one, otherwise. public static PlayerVoteData GetVoteData(this PlayerControl player) { if (VoteDataComponents.TryGetValue(player, out var component)) @@ -247,11 +375,11 @@ public static class Extensions } /// - /// Gets the maximum value from a dictionary of integers, returning the key and value. + /// Gets the maximum value from a of integers, returning the key and value. /// - /// The dictionary to search. + /// The to search. /// Whether there is a tie for the maximum value. - /// The key-value pair with the maximum value. + /// The with the maximum value. public static KeyValuePair MaxPair(this Dictionary self, out bool tie) { tie = true; @@ -272,11 +400,11 @@ public static class Extensions } /// - /// Gets the maximum value from a dictionary of floats, returning the key and value. + /// Gets the maximum value from a of floats, returning the key and value. /// - /// The dictionary to search. + /// The to search. /// Whether there is a tie for the maximum value. - /// The key-value pair with the maximum value. + /// The with the maximum value. public static KeyValuePair MaxPair(this Dictionary self, out bool tie) { tie = true; @@ -313,10 +441,10 @@ public static class Extensions } /// - /// Gets a proper string for an enum. (with spaces). + /// Gets a proper string for an . (with spaces). /// - /// The enum you would like to change. - /// A proper string for the enum. + /// The you would like to change. + /// A proper string for the . public static string ToDisplayString(this Enum @enum) { var regex = new Regex(@"([^\^])([A-Z][a-z$])"); @@ -366,9 +494,9 @@ public static class Extensions } /// - /// Enables stencil masking on a TMP text object. + /// Enables stencil masking on a object. /// - /// The TMP text. + /// The . public static void EnableStencilMasking(this TMP_Text text) { text.fontMaterial.SetFloat(ShaderID.Stencil, 1); @@ -379,18 +507,18 @@ public static class Extensions /// Checks if a type is static. /// /// The type being checked. - /// True if the type is static, false otherwise. + /// if the type is static, otherwise. public static bool IsStatic(this Type type) { return type is { IsClass: true, IsAbstract: true, IsSealed: true }; } /// - /// Gets a darkened version of a color. + /// Gets a darkened version of a . /// - /// The original color. + /// The original . /// A darkness amount between 0 and 255. - /// The darkened color. + /// The darkened . public static Color32 GetShadowColor(this Color32 color, byte darknessAmount) { return @@ -416,11 +544,11 @@ public static class Extensions } /// - /// Chunks a collection of NetData into smaller arrays. + /// Chunks a collection of into smaller arrays. /// - /// A collection of NetData objects. + /// An of s. /// The max chunk size in bytes. - /// A Queue of NetData arrays. + /// A of arrays. public static Queue ChunkNetData(this IEnumerable dataCollection, int chunkSize) { Queue chunks = []; @@ -457,10 +585,10 @@ public static class Extensions } /// - /// Determines if a given OptionBehaviour is for a custom option. + /// Determines if a given is for a custom option. /// - /// The OptionBehaviour to be tested. - /// True if the OptionBehaviour is for a custom options, false otherwise. + /// The to be tested. + /// if the is for a custom options, otherwise. public static bool IsCustom(this OptionBehaviour optionBehaviour) { return ModdedOptionsManager.ModdedOptions.Values.Any( @@ -468,11 +596,11 @@ public static class Extensions } /// - /// Randomizes a list. + /// Randomizes a . /// - /// The list object. - /// The type of object the list contains. - /// A randomized list made from the original list. + /// The object. + /// The type of object the contains. + /// A randomized made from the original . public static List Randomize(this List list) { List randomizedList = []; @@ -488,33 +616,33 @@ public static class Extensions } /// - /// Darkens a color by a specified amount. + /// Darkens a by a specified amount. /// - /// The original color. - /// A float amount between 0 and 1. - /// The darkened color. + /// The original . + /// A amount between 0 and 1. + /// The darkened . public static Color DarkenColor(this Color color, float amount = 0.45f) { return new Color(color.r - amount, color.g - amount, color.b - amount); } /// - /// Lightens a color by a specified amount. + /// Lightens a by a specified amount. /// - /// The original color. - /// A float amount between 0.0 and 1.0. - /// The lightened color. + /// The original . + /// A amount between 0.0 and 1.0. + /// The lightened . public static Color LightenColor(this Color color, float amount = 0.45f) { return new Color(color.r + amount, color.g + amount, color.b + amount); } /// - /// Gets the nearest dead body to a player. + /// Gets the nearest to a . /// - /// The player object. + /// The object. /// The radius to search within. - /// The dead body if it is found, or null there is none within the radius. + /// The if it is found, or there is none within the radius. public static DeadBody? GetNearestDeadBody(this PlayerControl playerControl, float radius) { return Helpers @@ -523,15 +651,15 @@ public static class Extensions } /// - /// Finds the nearest object of a specified type to a player. It will only work if the object has a collider. + /// Finds the nearest to a . It will only work if the object has a collider. /// - /// The player object. + /// The object. /// The radius to search within. /// The contact filter. /// An optional collider tag. - /// Optional predicate to test if the object is valid. + /// Optional predicate to test if the is valid. /// The type of the object. - /// The object if it was found, or null if there is none within the radius. + /// The if it was found, or if there is none within the radius. public static T? GetNearestObjectOfType( this PlayerControl playerControl, float radius, @@ -544,15 +672,15 @@ public static class Extensions } /// - /// Gets the closest player that matches the given criteria. + /// Gets the closest that matches the given criteria. /// - /// The player object. + /// The object. /// Whether impostors should be included in the search. /// The radius to search within. /// Whether colliders should be ignored when searching. /// Determines if Ghosts are included. - /// Optional predicate to test if the object is valid. - /// The closest player if there is one, false otherwise. + /// Optional predicate to test if the is valid. + /// The closest if there is one, otherwise. public static PlayerControl? GetClosestPlayer( this PlayerControl playerControl, bool includeImpostors, @@ -572,10 +700,10 @@ public static class Extensions } /// - /// Fixed version of Reactor's SetOutline. + /// Fixed version of . /// - /// The renderer you want to update the outline for. - /// The outline color. + /// The you want to update the outline for. + /// The outline . public static void UpdateOutline(this Renderer renderer, Color? color) { renderer.material.SetFloat(ShaderID.Outline, color.HasValue ? 1 : 0); @@ -588,7 +716,7 @@ public static class Extensions /// /// Registers a new mod keybind as a user-assignable button action in Rewired. /// - /// The Rewired user data to add the action to. + /// The Rewired to add the action to. /// The internal name of the action. /// Text shown in the rebinding UI. /// /// Group shown above the label. diff --git a/MiraAPI/Utilities/Helpers.cs b/MiraAPI/Utilities/Helpers.cs index b537ef0d..c089e40d 100644 --- a/MiraAPI/Utilities/Helpers.cs +++ b/MiraAPI/Utilities/Helpers.cs @@ -40,6 +40,11 @@ public static class Helpers return keybindIcon; } + /// + /// Gets the move next of an on . + /// + /// Where the should be parented to. + /// THe corresponding method to patch. public static MethodBase? GetStateMachineMoveNext(string methodName) { var typeName = typeof(T).FullName; @@ -66,11 +71,11 @@ public static class Helpers } /// - /// Creates a draggable scroller. Add items into the scroller.Inner transform. This does not automatically position children. + /// Creates a draggable . Add items into the transform. This does not automatically position children. /// - /// Where the scroller should be parented to. - /// The collider of the scroller. Used to drag. - /// The created scroller object. + /// Where the should be parented to. + /// The collider of the . Used to drag. + /// The created object. public static Scroller CreateScroller(Transform parent, BoxCollider2D hitBoxCollider) { var scrollObj = new GameObject("Scroller"); @@ -95,7 +100,7 @@ public static class Helpers /// /// Divides a button/etc by a certain amount by resizing colliders and renderer sizes. /// - /// The object you want to divide. + /// The you want to divide. /// How much you want to divide by. public static void DivideSize(GameObject obj, float amount) { @@ -129,7 +134,7 @@ public static class Helpers /// Determines whether a given probability check succeeds. /// /// An integer value representing the success probability (0-100). - /// True if the number falls in the range, false if not. + /// if the number falls in the range, if not. public static bool CheckChance(int probability) { switch (probability) @@ -147,21 +152,21 @@ public static class Helpers } /// - /// Retrieves a vent from the ID. + /// Retrieves a from the ID. /// /// The vent ID. - /// The vent. + /// The . public static Vent? GetVentById(int id) { return ShipStatus.Instance.AllVents.FirstOrDefault(vent => vent.Id == id); } /// - /// Creates an arrow. + /// Creates an . /// - /// The arrow gameObject's parent. + /// The arrow 's parent. /// The color of the arrow. - /// The created ArrowBehaviour. + /// The created . public static ArrowBehaviour CreateArrow(Transform parent, Color color) { var prefab = Object.FindObjectOfType(true); @@ -174,10 +179,10 @@ public static class Helpers } /// - /// Get the closest object of a specific type. + /// Get the closest . /// - /// A list of all the objects you'd like to check the distance for. - /// The position of where you want to check from. For example: PlayerControl.LocalPlayer.transform.position. + /// A list of all s you'd like to check the distance for. + /// The position of where you want to check from. For example: PlayerControl.LocalPlayer.transform.position. /// The object type. /// The closest object. public static T? FindClosestObjectOfType(List objectList, Vector3 position) where T : MonoBehaviour @@ -207,9 +212,9 @@ public static class Helpers /// Creates and shows a notification. /// /// The text you want to display. - /// The color of the text and image. + /// The of the text and image. /// The sound you want to play with the notification. - /// The sprite beside the notification. + /// The beside the notification. /// The created notification. public static LobbyNotificationMessage CreateAndShowNotification(string text, Color color, AudioClip? clip = null, Sprite? spr = null) { @@ -220,10 +225,10 @@ public static class Helpers /// Creates and shows a notification. /// /// The text you want to display. - /// The color of the text and image. + /// The of the text and image. /// The position of the notification. /// The sound you want to play with the notification. - /// The sprite beside the notification. + /// The beside the notification. /// The created notification. public static LobbyNotificationMessage CreateAndShowNotification(string text, Color color, Vector3 localPos, AudioClip? clip = null, Sprite? spr = null) { @@ -252,10 +257,10 @@ public static class Helpers } /// - /// Creates a ContactFilter2D from a layer mask. + /// Creates a from a layer mask. /// /// The layer mask. - /// A new ContactFilter2D that represents the layer mask. + /// A new that represents the layer mask. public static ContactFilter2D CreateFilter(int layerMask) { return ContactFilter2D.CreateLegacyFilter(layerMask, float.MinValue, float.MaxValue); @@ -272,12 +277,12 @@ public static class Helpers } /// - /// Gets a list of dead bodies within a radius. + /// Gets a list of s within a radius. /// /// The source location. /// The radius to search in. /// The contact filter. - /// A list of dead bodies. + /// A of s. public static List GetNearestDeadBodies(Vector2 source, float radius, ContactFilter2D filter) { var results = new Il2CppSystem.Collections.Generic.List(); @@ -288,14 +293,14 @@ public static class Helpers } /// - /// Gets a list of objects within a radius. + /// Gets a list of within a radius. /// /// The source point. /// The radius to search in. /// The contact filter. /// An optional collider tag. /// The type of the object. - /// A list of objects of type T. + /// A of s. public static List GetNearestObjectsOfType(Vector2 source, float radius, ContactFilter2D filter, string? colliderTag = null) where T : Component { @@ -307,12 +312,12 @@ public static class Helpers } /// - /// Gets the closest players to a specific point. + /// Gets the closest s to a specific point. /// /// The source point. /// The radius to search in. /// Whether colliders should be ignored. - /// A list of Player Controls in the radius. + /// A of s in the radius. public static List GetClosestPlayersInCircle( Vector2 source, float radius, @@ -337,13 +342,13 @@ public static class Helpers } /// - /// Gets the closest players to a specific player. + /// Gets the closest s to a specific . /// - /// The source player. + /// The source . /// Distance to search in. /// Whether to ignore colliders. - /// Whether to ignore the source player. - /// A list of PlayerControls. + /// Whether to ignore the player. + /// A of s. public static List GetClosestPlayers( PlayerControl source, float distance = 2f, @@ -362,12 +367,12 @@ public static class Helpers } /// - /// Gets the closest players to a specific point. + /// Gets the closest s to a specific point. /// /// The source point. /// The distance to search in. /// Whether to ignore colliders. - /// A list of Player Controls. + /// A of s. public static List GetClosestPlayers( Vector2 source, float distance = 2f, @@ -415,15 +420,15 @@ public static class Helpers } /// - /// Creates a TextMeshPro object with the specified parameters. + /// Creates a with the specified parameters. /// /// The name of the object. - /// The object parent. - /// The alignment of the TMP object. + /// The object's parent. + /// The alignment of the . /// The distance from the edge. /// The font size. /// The text alignment. - /// A new TMP object. + /// A new . public static TextMeshPro CreateTextLabel( string name, Transform parent, @@ -456,20 +461,20 @@ public static class Helpers } /// - /// Gets a DeadBody by its parent ID. + /// Gets a by its parent ID. /// /// The player ID. - /// A dead body or null if its not found. + /// A or if its not found. public static DeadBody? GetBodyById(byte id) { return Object.FindObjectsOfType().FirstOrDefault(body => body.ParentId == id); } /// - /// Gets the suffix for a MiraNumberSuffixes enum. + /// Gets the suffix for a . /// - /// The MiraNumberSuffixes enum. - /// A suffix based on the enum. + /// The . + /// A suffix based on the . public static string GetSuffix(MiraNumberSuffixes suffix) { return suffix switch @@ -525,10 +530,10 @@ public static class Helpers } /// - /// Returns the string of a role. + /// Returns the string of a . /// - /// The role to find. - /// The role name. + /// The to find. + /// The 's name. public static string GetRoleName(this RoleBehaviour role) { if (role is ICustomRole custom) @@ -539,10 +544,10 @@ public static class Helpers } /// - /// Returns whether the role is blacklisted from appearing and spawning. (Only applicable to vanilla roles) + /// Returns whether the is blacklisted from appearing and spawning. (Only applicable to vanilla roles). /// - /// The role to check. - /// The role's blacklist status. + /// The to check. + /// The 's blacklist status. public static bool IsRoleBlacklisted(this RoleBehaviour role) { // This should be patchable by mods when a vanilla role is meant to be replaced by a custom role. diff --git a/MiraAPI/Utilities/StateMachineWrapper.cs b/MiraAPI/Utilities/StateMachineWrapper.cs index e590f579..3c053345 100644 --- a/MiraAPI/Utilities/StateMachineWrapper.cs +++ b/MiraAPI/Utilities/StateMachineWrapper.cs @@ -24,7 +24,7 @@ public class StateMachineWrapper where T : Il2CppObjectBase private T? _parentInstance; /// - /// Gets the instance of the parent class that owns the state machine. + /// Gets the instance of the . /// public T Instance => _parentInstance ??= (T)_thisProperty.GetValue(_stateMachine)!; @@ -68,11 +68,11 @@ public class StateMachineWrapper where T : Il2CppObjectBase public void SetRecentReturn(Object newReturn) => _currentProperty.SetValue(_stateMachine, newReturn); /// - /// Gets a parameter from the state machine by its name. + /// Gets a parameter of type from the state machine by its name. /// /// The name of the parameter to retrieve. /// The type of the parameter to retrieve. - /// >The value of the specified parameter. + /// The value of the specified parameter. /// Thrown if the specified parameter does not exist. public TField GetParameter(string parameterName) { diff --git a/MiraAPI/Voting/PlayerVoteData.cs b/MiraAPI/Voting/PlayerVoteData.cs index f673bc46..0e520786 100644 --- a/MiraAPI/Voting/PlayerVoteData.cs +++ b/MiraAPI/Voting/PlayerVoteData.cs @@ -18,7 +18,7 @@ public class PlayerVoteData(nint cppPtr) : MonoBehaviour(cppPtr) public PlayerControl Owner { get; private set; } = null!; /// - /// Gets the list of votes the owner has. + /// Gets the list of s the owner has. /// [HideFromIl2Cpp] public List Votes { get; private set; } = []; @@ -48,7 +48,7 @@ public class PlayerVoteData(nint cppPtr) : MonoBehaviour(cppPtr) /// Returns whether the owner has voted for the specified player. /// /// The target's playerId. - /// True if the owner voted for the specified player, false otherwise. + /// if the owner voted for the specified player, otherwise. public bool VotedFor(byte playerId) { return Votes.Exists(x => x.Suspect == playerId); @@ -64,9 +64,9 @@ public class PlayerVoteData(nint cppPtr) : MonoBehaviour(cppPtr) } /// - /// Removes the specified vote. + /// Removes the specified . /// - /// The vote you would like to remove. + /// The you would like to remove. public void RemovePlayerVote(CustomVote vote) { Votes.Remove(vote); diff --git a/MiraAPI/Voting/VotingUtils.cs b/MiraAPI/Voting/VotingUtils.cs index 0edd081a..abafdd0a 100644 --- a/MiraAPI/Voting/VotingUtils.cs +++ b/MiraAPI/Voting/VotingUtils.cs @@ -17,11 +17,11 @@ public static class VotingUtils private const byte SkipVoteId = 253; /// - /// Gets the exiled player from the list of votes. Returns null if no player is to be exiled. + /// Gets the exiled player from the list of s. Returns if no player is to be exiled. /// - /// >The list of votes to check. + /// The list of s to check. /// Whether the vote is a tie. - /// The player to be exiled. Will be null if no player is to be exiled. + /// The player to be exiled. Will be if no player is to be exiled. public static NetworkedPlayerInfo? GetExiled(List votes, out bool isTie) { var max = CalculateNumVotes(votes).MaxPair(out var tie); @@ -39,7 +39,7 @@ public static class VotingUtils /// /// Handles when a vote is added and allows for other mods to override/modify. /// - /// The player's vote data. + /// The player's . /// Who the player voted for. /// Whether you want the vote to commence or not. private static void HandleVote(PlayerVoteData voteData, byte suspectIdx, out bool cancelVote) @@ -68,7 +68,7 @@ public static class VotingUtils /// /// Networks the removal of votes. Used to remove votes when a player disconnects. /// - /// The player who is sending the RPC. Should be the host. + /// The who is sending the RPC. Should be the host. /// The player who voted. /// The player who the voter voted for. [MethodRpc((uint)MiraRpc.RemoveVote)] @@ -104,7 +104,7 @@ public static class VotingUtils /// /// Networks the casting of a vote. We replace the vanilla solution with a custom version that works for the use case. /// - /// The player who sent this RPC. + /// The who sent this RPC. /// The id of the player who casted the vote. /// The voted player's id. [MethodRpc((uint)MiraRpc.CastVote)] @@ -163,7 +163,7 @@ public static class VotingUtils /// /// Calculates the total number of votes. /// - /// A list of calculated votes. + /// A list of calculated s. /// The total votes. public static Dictionary CalculateNumVotes(IEnumerable votes) { @@ -183,7 +183,7 @@ public static class VotingUtils /// /// Calculates votes to check if all players have voted. /// - /// The list of votes. + /// The of s. public static List CalculateVotes() { return @@ -196,7 +196,7 @@ public static class VotingUtils /// /// Handles the populating of results locally. Called by the PopulateResultsRpc. /// - /// The list of networked votes. + /// The list of s. public static void HandlePopulateResults(List votes) { PopulateResultsEvent @event = new PopulateResultsEvent(votes); @@ -208,7 +208,7 @@ public static class VotingUtils } MeetingHud.Instance.TitleText.text = - DestroyableSingleton.Instance.GetString( + TranslationController.Instance.GetString( StringNames.MeetingVotingResults, Il2CppSystem.Array.Empty());