mirror of
https://github.com/D1GQ/BetterAmongUs.git
synced 2026-10-19 15:51:52 +00:00
clean up
This commit is contained in:
1 parent
671db2ed45
commit
1aee8ba1cd
13 files changed
+27
-40
No files matched your search
@@ -1,7 +1,6 @@
|
||||
using AmongUs.GameOptions;
|
||||
using BetterAmongUs.Interfaces;
|
||||
using BetterAmongUs.Utilities;
|
||||
using InnerNet;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace BetterAmongUs.Data.Replay.Events;
|
||||
@@ -20,7 +19,7 @@ internal sealed class AppearReplayEvent : IReplayEvent<AppearReplayEvent.AppearR
|
||||
if (EventData == null)
|
||||
return;
|
||||
|
||||
var player = Utils.PlayerFromPlayerId((PlayerId)EventData.PlayerId);
|
||||
var player = Utils.PlayerFromPlayerId(EventData.PlayerId);
|
||||
if (player == null)
|
||||
return;
|
||||
|
||||
@@ -39,7 +38,7 @@ internal sealed class AppearReplayEvent : IReplayEvent<AppearReplayEvent.AppearR
|
||||
EventData = new AppearReplayData(args.Player.PlayerId, args.Animate);
|
||||
}
|
||||
|
||||
internal record AppearReplayData(int PlayerId, bool Animate) : IReplayEvent.Data;
|
||||
internal record AppearReplayData(byte PlayerId, bool Animate) : IReplayEvent.Data;
|
||||
|
||||
internal record AppearReplayArgs(PlayerControl Player, bool Animate) : IReplayEvent.Args;
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
using BetterAmongUs.Interfaces;
|
||||
using BetterAmongUs.Utilities;
|
||||
using InnerNet;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace BetterAmongUs.Data.Replay.Events;
|
||||
@@ -19,7 +18,7 @@ internal sealed class ChatEvent : IReplayEvent<ChatEvent.ChatReplayData, ChatEve
|
||||
if (EventData == null)
|
||||
return;
|
||||
|
||||
var player = Utils.PlayerFromPlayerId((PlayerId)EventData.PlayerId);
|
||||
var player = Utils.PlayerFromPlayerId(EventData.PlayerId);
|
||||
if (player == null)
|
||||
return;
|
||||
|
||||
@@ -38,7 +37,7 @@ internal sealed class ChatEvent : IReplayEvent<ChatEvent.ChatReplayData, ChatEve
|
||||
EventData = new ChatReplayData(args.Player.PlayerId, args.Message);
|
||||
}
|
||||
|
||||
internal record ChatReplayData(int PlayerId, string Message) : IReplayEvent.Data;
|
||||
internal record ChatReplayData(byte PlayerId, string Message) : IReplayEvent.Data;
|
||||
|
||||
internal record ChatReplayArgs(PlayerControl Player, string Message) : IReplayEvent.Args;
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
using BetterAmongUs.Interfaces;
|
||||
using BetterAmongUs.Utilities;
|
||||
using InnerNet;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace BetterAmongUs.Data.Replay.Events;
|
||||
@@ -19,7 +18,7 @@ internal sealed class ChatNoteEvent : IReplayEvent<ChatNoteEvent.ChatNoteReplayD
|
||||
if (EventData == null)
|
||||
return;
|
||||
|
||||
var player = Utils.PlayerFromPlayerId((PlayerId)EventData.PlayerId);
|
||||
var player = Utils.PlayerFromPlayerId(EventData.PlayerId);
|
||||
if (player == null)
|
||||
return;
|
||||
|
||||
@@ -38,7 +37,7 @@ internal sealed class ChatNoteEvent : IReplayEvent<ChatNoteEvent.ChatNoteReplayD
|
||||
EventData = new ChatNoteReplayData(args.Player.PlayerId, (int)args.NoteType);
|
||||
}
|
||||
|
||||
internal record ChatNoteReplayData(int PlayerId, int NoteType) : IReplayEvent.Data;
|
||||
internal record ChatNoteReplayData(byte PlayerId, int NoteType) : IReplayEvent.Data;
|
||||
|
||||
internal record ChatNoteReplayArgs(PlayerControl Player, ChatNoteTypes NoteType) : IReplayEvent.Args;
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
using BetterAmongUs.Interfaces;
|
||||
using BetterAmongUs.Utilities;
|
||||
using InnerNet;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace BetterAmongUs.Data.Replay.Events;
|
||||
@@ -16,11 +15,11 @@ internal sealed class MurderReplayEvent : IReplayEvent<MurderReplayEvent.MurderR
|
||||
|
||||
public void Play()
|
||||
{
|
||||
var killer = Utils.PlayerFromPlayerId((PlayerId)EventData.KillerId);
|
||||
var killer = Utils.PlayerFromPlayerId(EventData.KillerId);
|
||||
if (killer == null)
|
||||
return;
|
||||
|
||||
var target = Utils.PlayerFromPlayerId((PlayerId)EventData.TargetId);
|
||||
var target = Utils.PlayerFromPlayerId(EventData.TargetId);
|
||||
if (target == null)
|
||||
return;
|
||||
|
||||
@@ -36,7 +35,7 @@ internal sealed class MurderReplayEvent : IReplayEvent<MurderReplayEvent.MurderR
|
||||
EventData = new MurderReplayData(murderReplayArgs.Killer.PlayerId, murderReplayArgs.Target.PlayerId);
|
||||
}
|
||||
|
||||
internal record MurderReplayData(int KillerId, int TargetId) : IReplayEvent.Data;
|
||||
internal record MurderReplayData(byte KillerId, byte TargetId) : IReplayEvent.Data;
|
||||
|
||||
internal record MurderReplayArgs(PlayerControl Killer, PlayerControl Target) : IReplayEvent.Args;
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
using AmongUs.GameOptions;
|
||||
using BetterAmongUs.Interfaces;
|
||||
using BetterAmongUs.Utilities;
|
||||
using InnerNet;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace BetterAmongUs.Data.Replay.Events;
|
||||
@@ -20,11 +19,11 @@ internal sealed class ProtectReplayEvent : IReplayEvent<ProtectReplayEvent.Prote
|
||||
if (EventData == null)
|
||||
return;
|
||||
|
||||
var player = Utils.PlayerFromPlayerId((PlayerId)EventData.PlayerId);
|
||||
var player = Utils.PlayerFromPlayerId(EventData.PlayerId);
|
||||
if (player == null)
|
||||
return;
|
||||
|
||||
var target = Utils.PlayerFromPlayerId((PlayerId)EventData.TargetId);
|
||||
var target = Utils.PlayerFromPlayerId(EventData.TargetId);
|
||||
if (target == null)
|
||||
return;
|
||||
|
||||
@@ -43,7 +42,7 @@ internal sealed class ProtectReplayEvent : IReplayEvent<ProtectReplayEvent.Prote
|
||||
EventData = new ProtectReplayData(args.Player.PlayerId, args.Target.PlayerId);
|
||||
}
|
||||
|
||||
internal record ProtectReplayData(int PlayerId, int TargetId) : IReplayEvent.Data;
|
||||
internal record ProtectReplayData(byte PlayerId, byte TargetId) : IReplayEvent.Data;
|
||||
|
||||
internal record ProtectReplayArgs(PlayerControl Player, PlayerControl Target) : IReplayEvent.Args;
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
using BetterAmongUs.Interfaces;
|
||||
using BetterAmongUs.Utilities;
|
||||
using InnerNet;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace BetterAmongUs.Data.Replay.Events;
|
||||
@@ -19,7 +18,7 @@ internal sealed class ProtectedReplayEvent : IReplayEvent<ProtectedReplayEvent.P
|
||||
if (EventData == null)
|
||||
return;
|
||||
|
||||
var target = Utils.PlayerFromPlayerId((PlayerId)EventData.TargetId);
|
||||
var target = Utils.PlayerFromPlayerId(EventData.TargetId);
|
||||
if (target == null)
|
||||
return;
|
||||
|
||||
@@ -37,7 +36,7 @@ internal sealed class ProtectedReplayEvent : IReplayEvent<ProtectedReplayEvent.P
|
||||
EventData = new ProtectedReplayData(args.Killer.PlayerId, args.Target.PlayerId);
|
||||
}
|
||||
|
||||
internal record ProtectedReplayData(int KillerId, int TargetId) : IReplayEvent.Data;
|
||||
internal record ProtectedReplayData(byte KillerId, byte TargetId) : IReplayEvent.Data;
|
||||
|
||||
internal record ProtectedReplayArgs(PlayerControl Killer, PlayerControl Target) : IReplayEvent.Args;
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
using AmongUs.GameOptions;
|
||||
using BetterAmongUs.Interfaces;
|
||||
using BetterAmongUs.Utilities;
|
||||
using InnerNet;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace BetterAmongUs.Data.Replay.Events;
|
||||
@@ -20,7 +19,7 @@ internal sealed class SetRoleEvent : IReplayEvent<SetRoleEvent.SetRoleReplayData
|
||||
if (EventData == null)
|
||||
return;
|
||||
|
||||
var player = Utils.PlayerFromPlayerId((PlayerId)EventData.PlayerId);
|
||||
var player = Utils.PlayerFromPlayerId(EventData.PlayerId);
|
||||
if (player == null)
|
||||
return;
|
||||
|
||||
@@ -37,7 +36,7 @@ internal sealed class SetRoleEvent : IReplayEvent<SetRoleEvent.SetRoleReplayData
|
||||
EventData = new SetRoleReplayData(args.Player.PlayerId, (int)args.RoleType);
|
||||
}
|
||||
|
||||
internal record SetRoleReplayData(int PlayerId, int RoleType) : IReplayEvent.Data;
|
||||
internal record SetRoleReplayData(byte PlayerId, int RoleType) : IReplayEvent.Data;
|
||||
|
||||
internal record SetRoleReplayArgs(PlayerControl Player, RoleTypes RoleType) : IReplayEvent.Args;
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
using AmongUs.GameOptions;
|
||||
using BetterAmongUs.Interfaces;
|
||||
using BetterAmongUs.Utilities;
|
||||
using InnerNet;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace BetterAmongUs.Data.Replay.Events;
|
||||
@@ -20,11 +19,11 @@ internal sealed class ShapeshiftReplayEvent : IReplayEvent<ShapeshiftReplayEvent
|
||||
if (EventData == null)
|
||||
return;
|
||||
|
||||
var player = Utils.PlayerFromPlayerId((PlayerId)EventData.PlayerId);
|
||||
var player = Utils.PlayerFromPlayerId(EventData.PlayerId);
|
||||
if (player == null)
|
||||
return;
|
||||
|
||||
var target = Utils.PlayerFromPlayerId((PlayerId)EventData.TargetId);
|
||||
var target = Utils.PlayerFromPlayerId(EventData.TargetId);
|
||||
if (target == null)
|
||||
return;
|
||||
|
||||
@@ -43,7 +42,7 @@ internal sealed class ShapeshiftReplayEvent : IReplayEvent<ShapeshiftReplayEvent
|
||||
EventData = new ShapeshiftReplayData(args.Player.PlayerId, args.Target.PlayerId, args.Animate);
|
||||
}
|
||||
|
||||
internal record ShapeshiftReplayData(int PlayerId, int TargetId, bool Animate) : IReplayEvent.Data;
|
||||
internal record ShapeshiftReplayData(byte PlayerId, byte TargetId, bool Animate) : IReplayEvent.Data;
|
||||
|
||||
internal record ShapeshiftReplayArgs(PlayerControl Player, PlayerControl Target, bool Animate) : IReplayEvent.Args;
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
using BetterAmongUs.Interfaces;
|
||||
using BetterAmongUs.Utilities;
|
||||
using InnerNet;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace BetterAmongUs.Data.Replay.Events;
|
||||
@@ -19,7 +18,7 @@ internal sealed class UpdateSystemReplayEvent : IReplayEvent<UpdateSystemReplayE
|
||||
if (EventData == null)
|
||||
return;
|
||||
|
||||
var player = Utils.PlayerFromPlayerId((PlayerId)EventData.PlayerId);
|
||||
var player = Utils.PlayerFromPlayerId(EventData.PlayerId);
|
||||
if (player == null)
|
||||
return;
|
||||
|
||||
@@ -38,7 +37,7 @@ internal sealed class UpdateSystemReplayEvent : IReplayEvent<UpdateSystemReplayE
|
||||
EventData = new UpdateSystemReplayData(checked((byte)args.System), args.Player.PlayerId, args.Amount);
|
||||
}
|
||||
|
||||
internal record UpdateSystemReplayData(byte SystemType, int PlayerId, byte Amount) : IReplayEvent.Data;
|
||||
internal record UpdateSystemReplayData(byte SystemType, byte PlayerId, byte Amount) : IReplayEvent.Data;
|
||||
|
||||
internal record UpdateSystemReplayArgs(SystemTypes System, PlayerControl Player, byte Amount) : IReplayEvent.Args;
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
using AmongUs.GameOptions;
|
||||
using BetterAmongUs.Interfaces;
|
||||
using BetterAmongUs.Utilities;
|
||||
using InnerNet;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace BetterAmongUs.Data.Replay.Events;
|
||||
@@ -20,7 +19,7 @@ internal sealed class VanishReplayEvent : IReplayEvent<VanishReplayEvent.VanishR
|
||||
if (EventData == null)
|
||||
return;
|
||||
|
||||
var player = Utils.PlayerFromPlayerId((PlayerId)EventData.PlayerId);
|
||||
var player = Utils.PlayerFromPlayerId(EventData.PlayerId);
|
||||
if (player == null)
|
||||
return;
|
||||
|
||||
@@ -39,7 +38,7 @@ internal sealed class VanishReplayEvent : IReplayEvent<VanishReplayEvent.VanishR
|
||||
EventData = new VanishReplayData(args.Player.PlayerId);
|
||||
}
|
||||
|
||||
internal record VanishReplayData(int PlayerId) : IReplayEvent.Data;
|
||||
internal record VanishReplayData(byte PlayerId) : IReplayEvent.Data;
|
||||
|
||||
internal record VanishReplayArgs(PlayerControl Player) : IReplayEvent.Args;
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
using BetterAmongUs.Interfaces;
|
||||
using BetterAmongUs.Utilities;
|
||||
using InnerNet;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace BetterAmongUs.Data.Replay.Events;
|
||||
@@ -19,7 +18,7 @@ internal sealed class VentReplayEvent : IReplayEvent<VentReplayEvent.VentReplayD
|
||||
if (EventData == null)
|
||||
return;
|
||||
|
||||
var player = Utils.PlayerFromPlayerId((PlayerId)EventData.PlayerId);
|
||||
var player = Utils.PlayerFromPlayerId(EventData.PlayerId);
|
||||
if (player == null)
|
||||
return;
|
||||
|
||||
@@ -46,7 +45,7 @@ internal sealed class VentReplayEvent : IReplayEvent<VentReplayEvent.VentReplayD
|
||||
EventData = new VentReplayData(args.Player.PlayerId, args.Exit, args.VentId);
|
||||
}
|
||||
|
||||
internal record VentReplayData(int PlayerId, bool Exit, int VentId) : IReplayEvent.Data;
|
||||
internal record VentReplayData(byte PlayerId, bool Exit, int VentId) : IReplayEvent.Data;
|
||||
|
||||
internal record VentReplayArgs(PlayerControl Player, bool Exit, int VentId) : IReplayEvent.Args;
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
using BetterAmongUs.Generated;
|
||||
using BetterAmongUs.Utilities;
|
||||
using BetterAmongUs.Utilities.Extension;
|
||||
using InnerNet;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BetterAmongUs.Modules.OptionItems;
|
||||
@@ -239,7 +238,7 @@ public sealed class OptionPlayerItem : OptionItem<int>
|
||||
{
|
||||
if (Value != -1)
|
||||
{
|
||||
var player = Utils.PlayerFromPlayerId((PlayerId)Value);
|
||||
var player = Utils.PlayerFromPlayerId((byte)Value);
|
||||
if (player != null)
|
||||
return $"{player.GetPlayerNameAndColor()}";
|
||||
else
|
||||
|
||||
@@ -10,7 +10,6 @@ using BetterAmongUs.Patches.Gameplay.UI.Settings;
|
||||
using BetterAmongUs.Structs;
|
||||
using BetterAmongUs.Utilities;
|
||||
using Il2CppInterop.Runtime.Attributes;
|
||||
using InnerNet;
|
||||
using System.Text.RegularExpressions;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
@@ -218,7 +217,7 @@ internal class PlayerInfoDisplay : MonoBehaviour
|
||||
}
|
||||
else
|
||||
{
|
||||
var targetData = Utils.PlayerDataFromPlayerId((PlayerId)_player.shapeshiftTargetPlayerId);
|
||||
var targetData = Utils.PlayerDataFromPlayerId((byte)_player.shapeshiftTargetPlayerId);
|
||||
if (targetData == null)
|
||||
return;
|
||||
|
||||
|
||||
Reference in new issue
Block a user