45 lines
1.3 KiB
C#
45 lines
1.3 KiB
C#
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();
|
|
}
|
|
}
|
|
}
|