mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-20 01:46:15 +00:00
Bug fixes and new teleport button
This commit is contained in:
1 parent
acf1d44b52
commit
2f09baa371
5 files changed
+17
-2
No files matched your search
@@ -19,7 +19,7 @@ public class TeleportButton : CustomActionButton
|
|||||||
|
|
||||||
public override int MaxUses => 0;
|
public override int MaxUses => 0;
|
||||||
|
|
||||||
public override LoadableAsset<Sprite> Sprite => ExampleAssets.ExampleButton;
|
public override LoadableAsset<Sprite> Sprite => ExampleAssets.TeleportButton;
|
||||||
public static bool IsZoom { get; private set; }
|
public static bool IsZoom { get; private set; }
|
||||||
|
|
||||||
public override bool Enabled(RoleBehaviour role)
|
public override bool Enabled(RoleBehaviour role)
|
||||||
|
|||||||
@@ -5,5 +5,8 @@ namespace MiraAPI.Example;
|
|||||||
public static class ExampleAssets
|
public static class ExampleAssets
|
||||||
{
|
{
|
||||||
public static LoadableResourceAsset ExampleButton { get; } = new("MiraAPI.Example.Resources.ExampleButton.png");
|
public static LoadableResourceAsset ExampleButton { get; } = new("MiraAPI.Example.Resources.ExampleButton.png");
|
||||||
|
|
||||||
|
// Credit to EpicHorrors for the teleport button asset.
|
||||||
|
public static LoadableResourceAsset TeleportButton { get; } = new("MiraAPI.Example.Resources.TeleportButton.png");
|
||||||
public static LoadableResourceAsset Banner { get; } = new("MiraAPI.Example.Resources.FortniteBanner.jpeg");
|
public static LoadableResourceAsset Banner { get; } = new("MiraAPI.Example.Resources.FortniteBanner.jpeg");
|
||||||
}
|
}
|
||||||
@@ -9,6 +9,9 @@
|
|||||||
<Description>Example mod for Mira API</Description>
|
<Description>Example mod for Mira API</Description>
|
||||||
<Authors>Angxl, XtraCube</Authors>
|
<Authors>Angxl, XtraCube</Authors>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Remove="Resources\TeleportButton.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Reactor" Version="2.3.1" />
|
<PackageReference Include="Reactor" Version="2.3.1" />
|
||||||
@@ -28,6 +31,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Include="Resources\ExampleButton.png" />
|
<EmbeddedResource Include="Resources\ExampleButton.png" />
|
||||||
<EmbeddedResource Include="Resources\FortniteBanner.jpeg" />
|
<EmbeddedResource Include="Resources\FortniteBanner.jpeg" />
|
||||||
|
<EmbeddedResource Include="Resources\TeleportButton.png" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Target Name="Copy" AfterTargets="Build" Condition="'$(AmongUs)' != ''">
|
<Target Name="Copy" AfterTargets="Build" Condition="'$(AmongUs)' != ''">
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
@@ -36,16 +36,24 @@ public class ModifierComponent(IntPtr ptr) : MonoBehaviour(ptr)
|
|||||||
|
|
||||||
public void FixedUpdate()
|
public void FixedUpdate()
|
||||||
{
|
{
|
||||||
|
if (ActiveModifiers is null) return;
|
||||||
|
|
||||||
foreach (var modifier in ActiveModifiers)
|
foreach (var modifier in ActiveModifiers)
|
||||||
{
|
{
|
||||||
|
if (modifier is null) continue;
|
||||||
|
|
||||||
modifier.FixedUpdate();
|
modifier.FixedUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Update()
|
public void Update()
|
||||||
{
|
{
|
||||||
|
if (ActiveModifiers is null) return;
|
||||||
|
|
||||||
foreach (var modifier in ActiveModifiers)
|
foreach (var modifier in ActiveModifiers)
|
||||||
{
|
{
|
||||||
|
if (modifier is null) continue;
|
||||||
|
|
||||||
modifier.Update();
|
modifier.Update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -156,7 +164,7 @@ public class ModifierComponent(IntPtr ptr) : MonoBehaviour(ptr)
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ActiveModifiers.Find(x=>x.ModifierId == modifierId) != null)
|
if (ActiveModifiers.Find(x => x.ModifierId == modifierId) != null)
|
||||||
{
|
{
|
||||||
Logger<MiraApiPlugin>.Error($"Player already has modifier with id {modifierId}!");
|
Logger<MiraApiPlugin>.Error($"Player already has modifier with id {modifierId}!");
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in new issue
Block a user