Added setting metastate from plugin as well as !report
This commit is contained in:
parent
dceefc3335
commit
f66b15ac57
19 changed files with 1262 additions and 16 deletions
45
GearCycler/GearCore.cs
Normal file
45
GearCycler/GearCore.cs
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using Decal.Adapter;
|
||||
using Decal.Adapter.Wrappers;
|
||||
using VirindiViewService;
|
||||
using VirindiViewService.Controls;
|
||||
|
||||
namespace GearCycler
|
||||
{
|
||||
[ComVisible(true)]
|
||||
[Guid("9b6a07e1-ae78-47f4-b09c-174f6a27d7a3")] // Replace with your own unique GUID if needed
|
||||
[FriendlyName("GearCycler")]
|
||||
public class GearCore : PluginBase
|
||||
{
|
||||
public HudView view;
|
||||
private HudButton btnCycle;
|
||||
|
||||
protected override void Startup()
|
||||
{
|
||||
try
|
||||
{
|
||||
string xml = File.ReadAllText("ViewXML\\mainview.xml");
|
||||
view = HudView.ReadXmlLayout(xml);
|
||||
view.Visible = true;
|
||||
|
||||
btnCycle = (HudButton)view.Controls["btnCycle"];
|
||||
btnCycle.Hit += (s, e) =>
|
||||
{
|
||||
CoreManager.Current.Actions.AddChatText("[GearCycler] Button clicked!", 1);
|
||||
};
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
CoreManager.Current.Actions.AddChatText($"[GearCycler] Failed to load UI: {ex.Message}", 1);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void Shutdown()
|
||||
{
|
||||
btnCycle?.Dispose();
|
||||
view?.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue