mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-20 11:39:45 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ac2201b3ef | ||
|
|
992df67e18 | ||
|
|
67611471b8 | ||
|
|
5ddf48883c | ||
|
|
df8598db4d | ||
|
|
134e229523 | ||
|
|
cc1e89fd32 | ||
|
|
8bec9efa5c | ||
|
|
41c2a2b118 | ||
|
|
7919b32023 | ||
|
|
95bf1e1448 | ||
|
|
e4adaf7ab4 | ||
|
|
4027257b55 | ||
|
|
6c32c8bed9 | ||
|
|
905cc9e335 | ||
|
|
157aa65c2d | ||
|
|
3693ee754a | ||
|
|
85431d3685 | ||
|
|
2ac6c55cf8 | ||
|
|
db69446352 |
No files matched your search
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Reactor" Version="2.3.1" />
|
<PackageReference Include="Reactor" Version="2.3.1" />
|
||||||
<PackageReference Include="BepInEx.Unity.IL2CPP" Version="6.0.0-be.735" Private="false" ExcludeAssets="runtime;native" />
|
<PackageReference Include="BepInEx.Unity.IL2CPP" Version="6.0.0-be.735" Private="false" ExcludeAssets="runtime;native" />
|
||||||
<PackageReference Include="AmongUs.GameLibs.Steam" Version="2025.9.9" PrivateAssets="all" />
|
<PackageReference Include="AmongUs.GameLibs.Android" Version="2025.9.9" PrivateAssets="all" />
|
||||||
|
|
||||||
<PackageReference Include="BepInEx.AutoPlugin" Version="1.1.0" PrivateAssets="all" />
|
<PackageReference Include="BepInEx.AutoPlugin" Version="1.1.0" PrivateAssets="all" />
|
||||||
<PackageReference Include="BepInEx.IL2CPP.MSBuild" Version="2.1.0-rc.1" PrivateAssets="all" ExcludeAssets="runtime" />
|
<PackageReference Include="BepInEx.IL2CPP.MSBuild" Version="2.1.0-rc.1" PrivateAssets="all" ExcludeAssets="runtime" />
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
|
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
|
||||||
|
|
||||||
<VersionPrefix>0.3.2</VersionPrefix>
|
<VersionPrefix>0.3.1</VersionPrefix>
|
||||||
<VersionSuffix>dev</VersionSuffix>
|
<VersionSuffix>dev</VersionSuffix>
|
||||||
|
|
||||||
<Authors>All Of Us, XtraCube, Angxl</Authors>
|
<Authors>All Of Us, XtraCube, Angxl</Authors>
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System.Collections;
|
||||||
using System.Collections;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using AmongUs.Data;
|
using AmongUs.Data;
|
||||||
using AmongUs.GameOptions;
|
using AmongUs.GameOptions;
|
||||||
@@ -9,10 +8,8 @@ using MiraAPI.Events;
|
|||||||
using MiraAPI.Events.Vanilla.Gameplay;
|
using MiraAPI.Events.Vanilla.Gameplay;
|
||||||
using Reactor.Networking.Attributes;
|
using Reactor.Networking.Attributes;
|
||||||
using Reactor.Networking.Rpc;
|
using Reactor.Networking.Rpc;
|
||||||
using Reactor.Utilities;
|
|
||||||
using Reactor.Utilities.Extensions;
|
using Reactor.Utilities.Extensions;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using Object = UnityEngine.Object;
|
|
||||||
|
|
||||||
namespace MiraAPI.Networking;
|
namespace MiraAPI.Networking;
|
||||||
|
|
||||||
@@ -171,16 +168,9 @@ public static class CustomMurderRpc
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (showKillAnim)
|
if (showKillAnim)
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
HudManager.Instance.KillOverlay.ShowKillAnimation(source.Data, data);
|
HudManager.Instance.KillOverlay.ShowKillAnimation(source.Data, data);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Logger<MiraApiPlugin>.Error($"Error with kill animation: {e.ToString()}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
target.cosmetics.SetNameMask(false);
|
target.cosmetics.SetNameMask(false);
|
||||||
target.RpcSetScanner(false);
|
target.RpcSetScanner(false);
|
||||||
@@ -212,7 +202,7 @@ public static class CustomMurderRpc
|
|||||||
bool teleportMurderer = true)
|
bool teleportMurderer = true)
|
||||||
{
|
{
|
||||||
var cam = Camera.main?.GetComponent<FollowerCamera>();
|
var cam = Camera.main?.GetComponent<FollowerCamera>();
|
||||||
var isParticipant = source.AmOwner || target.AmOwner;
|
var isParticipant = PlayerControl.LocalPlayer == source || PlayerControl.LocalPlayer == target;
|
||||||
var sourcePhys = source.MyPhysics;
|
var sourcePhys = source.MyPhysics;
|
||||||
|
|
||||||
if (teleportMurderer)
|
if (teleportMurderer)
|
||||||
@@ -232,7 +222,7 @@ public static class CustomMurderRpc
|
|||||||
|
|
||||||
if (createDeadBody)
|
if (createDeadBody)
|
||||||
{
|
{
|
||||||
deadBody = Object.Instantiate(GameManager.Instance.GetDeadBody(source.Data.Role));
|
deadBody = Object.Instantiate(GameManager.Instance.deadBodyPrefab[0]);
|
||||||
deadBody.enabled = false;
|
deadBody.enabled = false;
|
||||||
deadBody.ParentId = target.PlayerId;
|
deadBody.ParentId = target.PlayerId;
|
||||||
deadBody.bodyRenderers.ToList().ForEach(target.SetPlayerMaterialColors);
|
deadBody.bodyRenderers.ToList().ForEach(target.SetPlayerMaterialColors);
|
||||||
@@ -243,13 +233,6 @@ public static class CustomMurderRpc
|
|||||||
deadBody.transform.position = vector;
|
deadBody.transform.position = vector;
|
||||||
}
|
}
|
||||||
|
|
||||||
source.Data.Role.KillAnimSpecialSetup(deadBody, source, target);
|
|
||||||
target.Data.Role.KillAnimSpecialSetup(deadBody, source, target);
|
|
||||||
|
|
||||||
// no idea if this causes bugs, but innersloth is brain-dead
|
|
||||||
// I HATE INNERSCUFF I HATE INNERSCUFF I HATE INNERSCUFF I HATE INNERSCUFF I HATE INNERSCUFF I HATE INNERSCUFF
|
|
||||||
PlayerControl.LocalPlayer.Data.Role.KillAnimSpecialSetup(deadBody, source, target);
|
|
||||||
|
|
||||||
if (isParticipant)
|
if (isParticipant)
|
||||||
{
|
{
|
||||||
if (cam != null)
|
if (cam != null)
|
||||||
|
|||||||
@@ -7,6 +7,15 @@ namespace MiraAPI.Patches.Events;
|
|||||||
|
|
||||||
internal static class EndGamePatches
|
internal static class EndGamePatches
|
||||||
{
|
{
|
||||||
|
[HarmonyPatch(typeof(GameManager), nameof(GameManager.Awake))]
|
||||||
|
public static class GameManagerAwakePatch
|
||||||
|
{
|
||||||
|
public static void Postfix(GameManager __instance)
|
||||||
|
{
|
||||||
|
__instance.enabled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[HarmonyPatch(typeof(GameManager), nameof(GameManager.RpcEndGame))]
|
[HarmonyPatch(typeof(GameManager), nameof(GameManager.RpcEndGame))]
|
||||||
public static class GameManagerRpcEndGamePatch
|
public static class GameManagerRpcEndGamePatch
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -73,21 +73,17 @@ public static class HudManagerPatches
|
|||||||
gridArrange.Alignment = GridArrange.StartAlign.Right;
|
gridArrange.Alignment = GridArrange.StartAlign.Right;
|
||||||
aspectPosition.Alignment = AspectPosition.EdgeAlignments.LeftBottom;
|
aspectPosition.Alignment = AspectPosition.EdgeAlignments.LeftBottom;
|
||||||
|
|
||||||
if (Constants.GetPlatformType() is Platforms.Android or Platforms.IPhone)
|
|
||||||
{
|
|
||||||
var fakeButton = Object.Instantiate(__instance.AbilityButton, BottomLeft.transform);
|
var fakeButton = Object.Instantiate(__instance.AbilityButton, BottomLeft.transform);
|
||||||
foreach (var renderer in fakeButton.GetComponentsInChildren<Renderer>())
|
foreach (var renderer in fakeButton.GetComponentsInChildren<Renderer>())
|
||||||
{
|
{
|
||||||
renderer.enabled = false;
|
renderer.enabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
fakeButton.buttonLabelText.Destroy();
|
fakeButton.buttonLabelText.Destroy();
|
||||||
fakeButton.cooldownTimerText.Destroy();
|
fakeButton.cooldownTimerText.Destroy();
|
||||||
fakeButton.usesRemainingText.Destroy();
|
fakeButton.usesRemainingText.Destroy();
|
||||||
fakeButton.GetComponent<PassiveButton>().Destroy();
|
fakeButton.GetComponent<PassiveButton>().Destroy();
|
||||||
fakeButton.ToggleVisible(true);
|
fakeButton.ToggleVisible(true);
|
||||||
fakeButton.Destroy();
|
fakeButton.Destroy();
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var button in CustomButtonManager.CustomButtons)
|
foreach (var button in CustomButtonManager.CustomButtons)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -344,7 +344,7 @@ public static class LobbyViewPanePatches
|
|||||||
}
|
}
|
||||||
|
|
||||||
viewSettingsInfoPanelRoleVariant.SetInfo(
|
viewSettingsInfoPanelRoleVariant.SetInfo(
|
||||||
roleBehaviour.GetRoleName(),
|
roleBehaviour.NiceName,
|
||||||
numPerGame,
|
numPerGame,
|
||||||
chancePerGame,
|
chancePerGame,
|
||||||
61,
|
61,
|
||||||
|
|||||||
@@ -473,7 +473,9 @@ public static class RoleSettingMenuPatches
|
|||||||
RolePositions[GameSettingMenuPatches.SelectedModIdx] = __instance.scrollBar.Inner.localPosition;
|
RolePositions[GameSettingMenuPatches.SelectedModIdx] = __instance.scrollBar.Inner.localPosition;
|
||||||
|
|
||||||
__instance.roleDescriptionText.text = customRole.RoleLongDescription;
|
__instance.roleDescriptionText.text = customRole.RoleLongDescription;
|
||||||
__instance.roleTitleText.text = role.GetRoleName();
|
__instance.roleTitleText.text = TranslationController.Instance.GetString(
|
||||||
|
role.StringName,
|
||||||
|
new Il2CppReferenceArray<Il2CppSystem.Object>(0));
|
||||||
|
|
||||||
var imgBg = __instance.AdvancedRolesSettings.transform.FindChild("Imagebackground");
|
var imgBg = __instance.AdvancedRolesSettings.transform.FindChild("Imagebackground");
|
||||||
var labelBg = __instance.AdvancedRolesSettings.transform.FindChild("InfoLabelBackground");
|
var labelBg = __instance.AdvancedRolesSettings.transform.FindChild("InfoLabelBackground");
|
||||||
@@ -577,7 +579,6 @@ public static class RoleSettingMenuPatches
|
|||||||
roleOptionSetting.transform.localPosition = new Vector3(-0.1f, ScrollerNum, -2f);
|
roleOptionSetting.transform.localPosition = new Vector3(-0.1f, ScrollerNum, -2f);
|
||||||
|
|
||||||
roleOptionSetting.SetRole(GameOptionsManager.Instance.CurrentGameOptions.RoleOptions, role, 20);
|
roleOptionSetting.SetRole(GameOptionsManager.Instance.CurrentGameOptions.RoleOptions, role, 20);
|
||||||
roleOptionSetting.titleText.text = role.GetRoleName();
|
|
||||||
roleOptionSetting.labelSprite.color = customRole.OptionsMenuColor;
|
roleOptionSetting.labelSprite.color = customRole.OptionsMenuColor;
|
||||||
roleOptionSetting.OnValueChanged = new Action<OptionBehaviour>(ValueChanged);
|
roleOptionSetting.OnValueChanged = new Action<OptionBehaviour>(ValueChanged);
|
||||||
roleOptionSetting.SetClickMask(__instance.ButtonClickMask);
|
roleOptionSetting.SetClickMask(__instance.ButtonClickMask);
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using MiraAPI.Roles;
|
using MiraAPI.Roles;
|
||||||
using MiraAPI.Utilities;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace MiraAPI.Patches.Roles;
|
namespace MiraAPI.Patches.Roles;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Patches the haunt menu to show the actual role name rather than team.
|
/// Patches the haunt menu to show the actual role name rather then team.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[HarmonyPatch(typeof(HauntMenuMinigame), nameof(HauntMenuMinigame.SetHauntTarget))]
|
[HarmonyPatch(typeof(HauntMenuMinigame), nameof(HauntMenuMinigame.SetHauntTarget))]
|
||||||
// SetFilterText was INLINED
|
// SetFilterText was INLINED
|
||||||
@@ -23,7 +22,7 @@ public static class HauntMenuMinigamePatch
|
|||||||
var role = __instance.HauntTarget.Data.Role;
|
var role = __instance.HauntTarget.Data.Role;
|
||||||
var color = role is ICustomRole custom ? custom.RoleColor : role.TeamColor;
|
var color = role is ICustomRole custom ? custom.RoleColor : role.TeamColor;
|
||||||
|
|
||||||
__instance.FilterText.text = role.GetRoleName();
|
__instance.FilterText.text = role.NiceName;
|
||||||
__instance.FilterText.color = color;
|
__instance.FilterText.color = color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,7 +4,6 @@ using System.Linq;
|
|||||||
using AmongUs.GameOptions;
|
using AmongUs.GameOptions;
|
||||||
using Il2CppInterop.Runtime;
|
using Il2CppInterop.Runtime;
|
||||||
using Il2CppInterop.Runtime.Injection;
|
using Il2CppInterop.Runtime.Injection;
|
||||||
using Il2CppInterop.Runtime.InteropTypes.Arrays;
|
|
||||||
using MiraAPI.Networking;
|
using MiraAPI.Networking;
|
||||||
using MiraAPI.PluginLoading;
|
using MiraAPI.PluginLoading;
|
||||||
using MiraAPI.Utilities;
|
using MiraAPI.Utilities;
|
||||||
@@ -54,9 +53,6 @@ public static class CustomRoleManager
|
|||||||
internal static readonly Dictionary<ushort, RoleBehaviour> CustomRoles = [];
|
internal static readonly Dictionary<ushort, RoleBehaviour> CustomRoles = [];
|
||||||
internal static readonly Dictionary<Type, ushort> RoleIds = [];
|
internal static readonly Dictionary<Type, ushort> RoleIds = [];
|
||||||
|
|
||||||
private static Il2CppSystem.Collections.Generic.List<BaseGameSetting>? _emptySettings;
|
|
||||||
private static Il2CppReferenceArray<OverlayKillAnimation>? _emptyKillAnimations;
|
|
||||||
|
|
||||||
private static ushort _roleId = 100;
|
private static ushort _roleId = 100;
|
||||||
|
|
||||||
private static ushort GetNextRoleId()
|
private static ushort GetNextRoleId()
|
||||||
@@ -137,12 +133,6 @@ public static class CustomRoleManager
|
|||||||
roleBehaviour.MaxCount = customRole.Configuration.MaxRoleCount;
|
roleBehaviour.MaxCount = customRole.Configuration.MaxRoleCount;
|
||||||
roleBehaviour.RoleScreenshot = customRole.Configuration.OptionsScreenshot?.LoadAsset();
|
roleBehaviour.RoleScreenshot = customRole.Configuration.OptionsScreenshot?.LoadAsset();
|
||||||
|
|
||||||
_emptySettings ??= new(0);
|
|
||||||
_emptyKillAnimations ??= new(0);
|
|
||||||
|
|
||||||
roleBehaviour.AllGameSettings = _emptySettings;
|
|
||||||
roleBehaviour.CustomKillAnimations = _emptyKillAnimations;
|
|
||||||
|
|
||||||
if (customRole.Configuration.Icon != null)
|
if (customRole.Configuration.Icon != null)
|
||||||
{
|
{
|
||||||
var asset = customRole.Configuration.Icon.LoadAsset();
|
var asset = customRole.Configuration.Icon.LoadAsset();
|
||||||
|
|||||||
@@ -19,10 +19,7 @@ public static class SpriteTools
|
|||||||
/// <exception cref="ArgumentException">Thrown when the resource cannot be found in the specified assembly.</exception>
|
/// <exception cref="ArgumentException">Thrown when the resource cannot be found in the specified assembly.</exception>
|
||||||
public static Texture2D LoadTextureFromResourcePath(string resourcePath, Assembly assembly)
|
public static Texture2D LoadTextureFromResourcePath(string resourcePath, Assembly assembly)
|
||||||
{
|
{
|
||||||
var tex = new Texture2D(1, 1, TextureFormat.ARGB32, false)
|
var tex = new Texture2D(1, 1, TextureFormat.ARGB32, false);
|
||||||
{
|
|
||||||
wrapMode = TextureWrapMode.Clamp,
|
|
||||||
};
|
|
||||||
var myStream = assembly.GetManifestResourceStream(resourcePath);
|
var myStream = assembly.GetManifestResourceStream(resourcePath);
|
||||||
if (myStream != null)
|
if (myStream != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,5 +6,6 @@
|
|||||||
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
|
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
|
||||||
<add key="Reactor" value="https://nuget.reactor.gg/v3/index.json" />
|
<add key="Reactor" value="https://nuget.reactor.gg/v3/index.json" />
|
||||||
<add key="Samboy063" value="https://nuget.samboy.dev/v3/index.json" />
|
<add key="Samboy063" value="https://nuget.samboy.dev/v3/index.json" />
|
||||||
|
<add key="Local" value="packages/" />
|
||||||
</packageSources>
|
</packageSources>
|
||||||
</configuration>
|
</configuration>
|
||||||
Binary file not shown.
Reference in new issue
Block a user