mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-19 15:51:48 +00:00
some updates to example mod
This commit is contained in:
1 parent
f207849e5e
commit
97ded2fc32
5 files changed
+31
-25
No files matched your search
@@ -1,5 +1,7 @@
|
||||
using MiraAPI.Example.Modifiers.Freezer;
|
||||
using MiraAPI.Example.Options.Roles;
|
||||
using MiraAPI.Example.Roles;
|
||||
using MiraAPI.GameOptions;
|
||||
using MiraAPI.Hud;
|
||||
using MiraAPI.Utilities;
|
||||
using MiraAPI.Utilities.Assets;
|
||||
@@ -11,9 +13,9 @@ namespace MiraAPI.Example.Buttons.Freezer;
|
||||
public class FreezeButton : CustomActionButton<PlayerControl>
|
||||
{
|
||||
public override string Name => "Freeze";
|
||||
public override float Cooldown => 5f;
|
||||
public override float Cooldown => OptionGroupSingleton<FreezerRoleSettings>.Instance.FreezeDuration;
|
||||
public override float EffectDuration => 0f;
|
||||
public override int MaxUses => 0;
|
||||
public override int MaxUses => (int)OptionGroupSingleton<FreezerRoleSettings>.Instance.FreezeUses;
|
||||
public override LoadableAsset<Sprite> Sprite => ExampleAssets.ExampleButton;
|
||||
|
||||
protected override void OnClick()
|
||||
@@ -23,7 +25,7 @@ public class FreezeButton : CustomActionButton<PlayerControl>
|
||||
|
||||
public override PlayerControl? GetTarget()
|
||||
{
|
||||
return PlayerControl.LocalPlayer.GetClosestPlayer(true, Distance, false);
|
||||
return PlayerControl.LocalPlayer.GetClosestPlayer(true, Distance);
|
||||
}
|
||||
|
||||
public override void SetOutline(bool active)
|
||||
|
||||
@@ -13,7 +13,7 @@ public class TeleportButton : CustomActionButton
|
||||
{
|
||||
public override string Name => "Teleport";
|
||||
|
||||
public override float Cooldown => OptionGroupSingleton<TeleporterOptions>.Instance.TeleportCooldown;
|
||||
public override float Cooldown => OptionGroupSingleton<TeleporterOptions>.Instance.TeleportCooldown.Value;
|
||||
|
||||
public override float EffectDuration => OptionGroupSingleton<TeleporterOptions>.Instance.TeleportDuration;
|
||||
|
||||
@@ -22,7 +22,7 @@ public class TeleportButton : CustomActionButton
|
||||
public override LoadableAsset<Sprite> Sprite => ExampleAssets.TeleportButton;
|
||||
public static bool IsZoom { get; private set; }
|
||||
|
||||
public override bool Enabled(RoleBehaviour role)
|
||||
public override bool Enabled(RoleBehaviour? role)
|
||||
{
|
||||
return role is TeleporterRole;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user