mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-25 12:46:46 +00:00
improve example
This commit is contained in:
1 parent
29c2939871
commit
c1d2455e4d
2 files changed
+8
-16
No files matched your search
@@ -25,22 +25,6 @@ public partial class ExamplePlugin : BasePlugin, IMiraPlugin
|
||||
public ConfigFile GetConfigFile() => Config;
|
||||
public override void Load()
|
||||
{
|
||||
MiraEventManager.RegisterEventHandler<MiraButtonClickEvent<FreezeButton>>(e=>
|
||||
{
|
||||
Logger<ExamplePlugin>.Warning("Freeze button clicked!");
|
||||
|
||||
if (PlayerControl.LocalPlayer.Data.PlayerName == "stupid")
|
||||
{
|
||||
e.Cancel();
|
||||
e.Button.SetTimer(15f);
|
||||
}
|
||||
});
|
||||
|
||||
MiraEventManager.RegisterEventHandler<MiraButtonCancelledEvent<FreezeButton>>(e=>
|
||||
{
|
||||
Logger<ExamplePlugin>.Warning("Freeze button cancelled!");
|
||||
e.Button.OverrideName("Freeze Canceled");
|
||||
});
|
||||
Harmony.PatchAll();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user