mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-19 15:51:48 +00:00
Merge branch 'dev' into pr/91
This commit is contained in:
commit
39da0e7d08
103 files changed
+5715
-442
No files matched your search
@@ -9,5 +9,6 @@ public static class ExampleAssets
|
||||
|
||||
// Credit to EpicHorrors for the teleport button asset.
|
||||
public static LoadableResourceAsset TeleportButton { get; } = new("MiraAPI.Example.Resources.TeleportButton.png");
|
||||
public static LoadableResourceAsset SharpshootButton { get; } = new("MiraAPI.Example.Resources.SharpshootButton.png");
|
||||
public static LoadableResourceAsset Banner { get; } = new("MiraAPI.Example.Resources.FortniteBanner.jpeg");
|
||||
}
|
||||
@@ -4,9 +4,11 @@ using BepInEx.Unity.IL2CPP;
|
||||
using HarmonyLib;
|
||||
using MiraAPI.PluginLoading;
|
||||
using MiraAPI.Translation;
|
||||
using MiraAPI.Utilities.Assets;
|
||||
using Reactor;
|
||||
using Reactor.Networking;
|
||||
using Reactor.Networking.Attributes;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MiraAPI.Example;
|
||||
|
||||
@@ -23,6 +25,7 @@ public partial class ExamplePlugin : BasePlugin, IMiraPlugin
|
||||
}
|
||||
public Harmony Harmony { get; } = new(Id);
|
||||
public string OptionsTitleText => "Mira API\nExample Mod";
|
||||
public string CustomOptionMenuNameTwo => "angxl's Options";
|
||||
public ConfigFile GetConfigFile() => Config;
|
||||
public override void Load()
|
||||
{
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
using MiraAPI.GameModes;
|
||||
using MiraAPI.Utilities.Assets;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MiraAPI.Example.GameModes;
|
||||
|
||||
public class ExampleMode : AbstractGameMode
|
||||
{
|
||||
public override string Name => "Example Mode";
|
||||
public override string Description => "An example gamemode.";
|
||||
public override LoadableAsset<Sprite>? Icon => ExampleAssets.ExampleButton;
|
||||
public override Color Color => Color.red;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
using MiraAPI.Example.Modifiers;
|
||||
using MiraAPI.Example.Roles;
|
||||
using MiraAPI.Hud;
|
||||
using MiraAPI.Keybinds;
|
||||
using MiraAPI.MeetingAbilities;
|
||||
using MiraAPI.Modifiers;
|
||||
using MiraAPI.Utilities.Assets;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MiraAPI.Example.MeetingAbilities;
|
||||
|
||||
public class EndMeetingButton : MeetingActionButton
|
||||
{
|
||||
public override string Name => "End Meeting";
|
||||
|
||||
public override float Cooldown => 15;
|
||||
|
||||
public override float InitialCooldown => 30;
|
||||
|
||||
public override int MaxUses => 3;
|
||||
|
||||
public override LoadableAsset<Sprite> Sprite => ExampleAssets.ExampleButton;
|
||||
|
||||
public override bool Enabled(RoleBehaviour? role)
|
||||
{
|
||||
return PlayerControl.LocalPlayer != null && role is MayorRole;
|
||||
}
|
||||
|
||||
protected override void OnClick()
|
||||
{
|
||||
MeetingHud.Instance.RpcClose();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using MiraAPI.MeetingAbilities;
|
||||
using MiraAPI.Networking;
|
||||
using MiraAPI.Utilities;
|
||||
using MiraAPI.Utilities.Assets;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MiraAPI.Example.MeetingAbilities;
|
||||
|
||||
public class ShootButton : TargetedMeetingButton
|
||||
{
|
||||
public override string Name => "Shoot";
|
||||
|
||||
public override int MaxUses => 3;
|
||||
|
||||
public override float InitialCooldown => 5;
|
||||
|
||||
public override float Cooldown => 3;
|
||||
|
||||
public override LoadableAsset<Sprite> Sprite => ExampleAssets.SharpshootButton;
|
||||
|
||||
public override Color OutlineColor => Color.red;
|
||||
|
||||
public override bool Enabled(RoleBehaviour r)
|
||||
{
|
||||
return r.IsImpostor;
|
||||
}
|
||||
|
||||
protected override void OnClick(PlayerVoteArea playerVoteArea)
|
||||
{
|
||||
playerVoteArea.SetDisabled();
|
||||
var player = playerVoteArea.GetPlayer();
|
||||
PlayerControl.LocalPlayer.RpcCustomMurder(player);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using MiraAPI.MeetingAbilities;
|
||||
using MiraAPI.Networking;
|
||||
using MiraAPI.Utilities;
|
||||
using MiraAPI.Utilities.Assets;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MiraAPI.Example.MeetingAbilities;
|
||||
|
||||
public class ShotgunButton : MultiTargetMeetingButton
|
||||
{
|
||||
public override string Name => "Shotgun";
|
||||
|
||||
public override int MaxUses => 3;
|
||||
|
||||
public override float InitialCooldown => 5;
|
||||
|
||||
public override float Cooldown => 3;
|
||||
|
||||
public override LoadableAsset<Sprite> Sprite => ExampleAssets.SharpshootButton;
|
||||
|
||||
public override Color OutlineColor => Color.red;
|
||||
|
||||
public override bool Enabled(RoleBehaviour r)
|
||||
{
|
||||
return r.IsImpostor;
|
||||
}
|
||||
|
||||
protected override void OnClick(PlayerVoteArea playerVoteArea)
|
||||
{
|
||||
}
|
||||
|
||||
public override LoadableAsset<Sprite> SpriteActive => ExampleAssets.CallMeetingButton;
|
||||
|
||||
public override int TargetsCount => 4;
|
||||
|
||||
protected override void OnSelect(PlayerVoteArea playerVoteArea, bool toggle)
|
||||
{
|
||||
HudManager.Instance.PlayerCam.ShakeScreen(0.5f, 2);
|
||||
}
|
||||
|
||||
public override void OnFinish()
|
||||
{
|
||||
foreach (var playerVoteArea in Targets.Keys)
|
||||
{
|
||||
playerVoteArea.SetDisabled();
|
||||
var player = playerVoteArea.GetPlayer();
|
||||
PlayerControl.LocalPlayer.RpcCustomMurder(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 5.7 KiB |
Reference in new issue
Block a user