fix: final work
This commit is contained in:
parent
1a0790ffd4
commit
c62a553427
Binary file not shown.
Before Width: | Height: | Size: 11 KiB |
@ -13,7 +13,8 @@ using Dalamud.Game.Network;
|
|||||||
using Dalamud.Game.Command;
|
using Dalamud.Game.Command;
|
||||||
using Dalamud.Game.ClientState;
|
using Dalamud.Game.ClientState;
|
||||||
using Dalamud.Game.ClientState.Objects;
|
using Dalamud.Game.ClientState.Objects;
|
||||||
using FFXIVClientStructs.FFXIV.Client.Graphics.Kernel;
|
using FFXIVClientStructs.FFXIV.Client.Graphics.Kernel;
|
||||||
|
using Dalamud.Interface.Windowing;
|
||||||
|
|
||||||
// FFXIV_Vibe_Plugin libs
|
// FFXIV_Vibe_Plugin libs
|
||||||
using FFXIV_Vibe_Plugin.Commons;
|
using FFXIV_Vibe_Plugin.Commons;
|
||||||
@ -24,7 +25,7 @@ using FFXIV_Vibe_Plugin.Migrations;
|
|||||||
|
|
||||||
|
|
||||||
namespace FFXIV_Vibe_Plugin {
|
namespace FFXIV_Vibe_Plugin {
|
||||||
internal class App {
|
public class App {
|
||||||
private Dalamud.Game.Gui.ChatGui? DalamudChat { get; init; }
|
private Dalamud.Game.Gui.ChatGui? DalamudChat { get; init; }
|
||||||
public Configuration Configuration { get; init; }
|
public Configuration Configuration { get; init; }
|
||||||
private GameNetwork GameNetwork { get; init; }
|
private GameNetwork GameNetwork { get; init; }
|
||||||
@ -35,12 +36,13 @@ namespace FFXIV_Vibe_Plugin {
|
|||||||
private DalamudPluginInterface PluginInterface { get; init; }
|
private DalamudPluginInterface PluginInterface { get; init; }
|
||||||
|
|
||||||
// Custom variables from Kacie
|
// Custom variables from Kacie
|
||||||
|
private readonly Plugin Plugin;
|
||||||
private readonly bool wasInit = false;
|
private readonly bool wasInit = false;
|
||||||
public readonly string CommandName = "";
|
public readonly string CommandName = "";
|
||||||
|
public PluginUI PluginUi { get; init; }
|
||||||
private readonly string ShortName = "";
|
private readonly string ShortName = "";
|
||||||
private bool _firstUpdated = false;
|
private bool _firstUpdated = false;
|
||||||
private readonly PlayerStats PlayerStats;
|
private readonly PlayerStats PlayerStats;
|
||||||
private PluginUI PluginUi { get; init; }
|
|
||||||
private ConfigurationProfile ConfigurationProfile;
|
private ConfigurationProfile ConfigurationProfile;
|
||||||
private readonly Logger Logger;
|
private readonly Logger Logger;
|
||||||
private readonly ActionEffect hook_ActionEffect;
|
private readonly ActionEffect hook_ActionEffect;
|
||||||
@ -51,8 +53,8 @@ namespace FFXIV_Vibe_Plugin {
|
|||||||
// Experiments
|
// Experiments
|
||||||
private readonly NetworkCapture experiment_networkCapture;
|
private readonly NetworkCapture experiment_networkCapture;
|
||||||
|
|
||||||
public App(string commandName, string shortName, GameNetwork gameNetwork, ClientState clientState, DataManager dataManager, Dalamud.Game.Gui.ChatGui? dalamudChat, Configuration configuration, SigScanner scanner, ObjectTable gameObjects, DalamudPluginInterface pluginInterface) {
|
public App(Plugin plugin, string commandName, string shortName, GameNetwork gameNetwork, ClientState clientState, DataManager dataManager, Dalamud.Game.Gui.ChatGui? dalamudChat, Configuration configuration, SigScanner scanner, ObjectTable gameObjects, DalamudPluginInterface pluginInterface) {
|
||||||
return;
|
this.Plugin = plugin;
|
||||||
this.CommandName = commandName;
|
this.CommandName = commandName;
|
||||||
this.ShortName = shortName;
|
this.ShortName = shortName;
|
||||||
this.GameNetwork = gameNetwork;
|
this.GameNetwork = gameNetwork;
|
||||||
@ -63,25 +65,33 @@ namespace FFXIV_Vibe_Plugin {
|
|||||||
this.GameObjects = gameObjects;
|
this.GameObjects = gameObjects;
|
||||||
this.Scanner = scanner;
|
this.Scanner = scanner;
|
||||||
this.PluginInterface = pluginInterface;
|
this.PluginInterface = pluginInterface;
|
||||||
|
|
||||||
|
|
||||||
if (DalamudChat != null) {
|
if (DalamudChat != null) {
|
||||||
DalamudChat.ChatMessage += ChatWasTriggered;
|
DalamudChat.ChatMessage += ChatWasTriggered;
|
||||||
}
|
}
|
||||||
this.Logger = new Logger(this.DalamudChat, ShortName, Logger.LogLevel.VERBOSE);
|
this.Logger = new Logger(this.DalamudChat, ShortName, Logger.LogLevel.VERBOSE);
|
||||||
|
|
||||||
|
|
||||||
// Migrations
|
// Migrations
|
||||||
Migration migration = new(Configuration, Logger);
|
Migration migration = new(Configuration, Logger);
|
||||||
migration.Patch_0_2_0_to_1_0_0_config_profile();
|
migration.Patch_0_2_0_to_1_0_0_config_profile();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Configuration Profile
|
// Configuration Profile
|
||||||
this.ConfigurationProfile = this.Configuration.GetDefaultProfile();
|
this.ConfigurationProfile = this.Configuration.GetDefaultProfile();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Patterns
|
// Patterns
|
||||||
this.Patterns = new Patterns();
|
this.Patterns = new Patterns();
|
||||||
this.Patterns.SetCustomPatterns(this.ConfigurationProfile.PatternList);
|
this.Patterns.SetCustomPatterns(this.ConfigurationProfile.PatternList);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Initialize the devices Controller
|
// Initialize the devices Controller
|
||||||
/* TODO: this.DeviceController = new Device.DevicesController(this.Logger, this.Configuration, this.ConfigurationProfile, this.Patterns);*/
|
this.DeviceController = new Device.DevicesController(this.Logger, this.Configuration, this.ConfigurationProfile, this.Patterns);
|
||||||
this.DeviceController = null;
|
|
||||||
if (this.ConfigurationProfile.AUTO_CONNECT) {
|
if (this.ConfigurationProfile.AUTO_CONNECT) {
|
||||||
Thread t = new(delegate () {
|
Thread t = new(delegate () {
|
||||||
Thread.Sleep(2000);
|
Thread.Sleep(2000);
|
||||||
@ -89,10 +99,13 @@ namespace FFXIV_Vibe_Plugin {
|
|||||||
});
|
});
|
||||||
t.Start();
|
t.Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Initialize Hook ActionEffect
|
// Initialize Hook ActionEffect
|
||||||
this.hook_ActionEffect = new(this.DataManager, this.Logger, this.Scanner, clientState, gameObjects);
|
this.hook_ActionEffect = new(this.DataManager, this.Logger, this.Scanner, clientState, gameObjects);
|
||||||
this.hook_ActionEffect.ReceivedEvent += SpellWasTriggered;
|
this.hook_ActionEffect.ReceivedEvent += SpellWasTriggered;
|
||||||
|
|
||||||
|
|
||||||
// Init the login event.
|
// Init the login event.
|
||||||
this.ClientState.Login += this.ClientState_LoginEvent;
|
this.ClientState.Login += this.ClientState_LoginEvent;
|
||||||
@ -101,24 +114,25 @@ namespace FFXIV_Vibe_Plugin {
|
|||||||
this.PlayerStats = new PlayerStats(this.Logger, this.ClientState);
|
this.PlayerStats = new PlayerStats(this.Logger, this.ClientState);
|
||||||
PlayerStats.Event_CurrentHpChanged += this.PlayerCurrentHPChanged;
|
PlayerStats.Event_CurrentHpChanged += this.PlayerCurrentHPChanged;
|
||||||
PlayerStats.Event_MaxHpChanged += this.PlayerCurrentHPChanged;
|
PlayerStats.Event_MaxHpChanged += this.PlayerCurrentHPChanged;
|
||||||
|
|
||||||
|
|
||||||
// Triggers
|
// Triggers
|
||||||
this.TriggersController = new Triggers.TriggersController(this.Logger, this.PlayerStats, this.ConfigurationProfile);
|
this.TriggersController = new Triggers.TriggersController(this.Logger, this.PlayerStats, this.ConfigurationProfile);
|
||||||
|
|
||||||
// UI
|
// UI
|
||||||
this.PluginUi = new PluginUI(this, this.Logger, this.PluginInterface, this.Configuration, this.ConfigurationProfile, this.DeviceController, this.TriggersController, this.Patterns);
|
this.PluginUi = new PluginUI(this, this.Logger, this.PluginInterface, this.Configuration, this.ConfigurationProfile, this.DeviceController, this.TriggersController, this.Patterns);
|
||||||
|
|
||||||
// Experimental
|
// Experimental
|
||||||
this.experiment_networkCapture = new NetworkCapture(this.Logger, this.GameNetwork);
|
this.experiment_networkCapture = new NetworkCapture(this.Logger, this.GameNetwork);
|
||||||
|
|
||||||
// Make sure we set the current profile everywhere.
|
// Make sure we set the current profile everywhere.
|
||||||
this.SetProfile(this.Configuration.CurrentProfileName);
|
this.SetProfile(this.Configuration.CurrentProfileName);
|
||||||
|
|
||||||
// Set the init variable
|
// Set the init variable
|
||||||
this.wasInit = true;
|
this.wasInit = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose() {
|
public void Dispose() {
|
||||||
if (!this.wasInit) { return; }
|
if (!this.wasInit) { return; }
|
||||||
this.Logger.Debug("Disposing plugin...");
|
this.Logger.Debug("Disposing plugin...");
|
||||||
|
|
||||||
@ -171,8 +185,8 @@ namespace FFXIV_Vibe_Plugin {
|
|||||||
this.Command_SendIntensity(args);
|
this.Command_SendIntensity(args);
|
||||||
} else if (args.StartsWith("stop")) {
|
} else if (args.StartsWith("stop")) {
|
||||||
this.DeviceController.SendVibeToAll(0);
|
this.DeviceController.SendVibeToAll(0);
|
||||||
}
|
}
|
||||||
// Experimental
|
// Experimental
|
||||||
else if (args.StartsWith("exp_network_start")) {
|
else if (args.StartsWith("exp_network_start")) {
|
||||||
this.experiment_networkCapture.StartNetworkCapture();
|
this.experiment_networkCapture.StartNetworkCapture();
|
||||||
} else if (args.StartsWith("exp_network_stop")) {
|
} else if (args.StartsWith("exp_network_stop")) {
|
||||||
@ -192,23 +206,20 @@ namespace FFXIV_Vibe_Plugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void DisplayUI() {
|
private void DisplayUI() {
|
||||||
if (this.PluginUi != null) {
|
this.Plugin.DrawConfigUI();
|
||||||
this.PluginUi.Display();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DisplayConfigUI() {
|
private void DisplayConfigUI() {
|
||||||
this.PluginUi.Display();
|
this.Plugin.DrawConfigUI();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DrawUI() {
|
public void DrawUI() {
|
||||||
|
|
||||||
if(this.PluginUi == null) {
|
if(this.PluginUi == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.PluginUi.Draw();
|
|
||||||
|
|
||||||
if (this.ClientState.IsLoggedIn) {
|
if (this.ClientState.IsLoggedIn) {
|
||||||
this.PlayerStats.Update(this.ClientState);
|
this.PlayerStats.Update(this.ClientState);
|
||||||
}
|
}
|
||||||
@ -220,10 +231,10 @@ namespace FFXIV_Vibe_Plugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Command_DeviceController_Connect() {
|
public void Command_DeviceController_Connect() {
|
||||||
if (this.DeviceController == null) {
|
if (this.DeviceController == null) {
|
||||||
this.Logger.Error("No device controller available to connect.");
|
this.Logger.Error("No device controller available to connect.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this.ConfigurationProfile != null) {
|
if (this.ConfigurationProfile != null) {
|
||||||
string host = this.ConfigurationProfile.BUTTPLUG_SERVER_HOST;
|
string host = this.ConfigurationProfile.BUTTPLUG_SERVER_HOST;
|
||||||
@ -232,10 +243,10 @@ namespace FFXIV_Vibe_Plugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Command_DeviceController_Disconnect() {
|
private void Command_DeviceController_Disconnect() {
|
||||||
if (this.DeviceController == null) {
|
if (this.DeviceController == null) {
|
||||||
this.Logger.Error("No device controller available to disconnect.");
|
this.Logger.Error("No device controller available to disconnect.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.DeviceController.Disconnect();
|
this.DeviceController.Disconnect();
|
||||||
}
|
}
|
||||||
@ -251,13 +262,13 @@ namespace FFXIV_Vibe_Plugin {
|
|||||||
} catch (Exception e) when (e is FormatException or IndexOutOfRangeException) {
|
} catch (Exception e) when (e is FormatException or IndexOutOfRangeException) {
|
||||||
this.Logger.Error($"Malformed arguments for send [intensity].", e);
|
this.Logger.Error($"Malformed arguments for send [intensity].", e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.DeviceController == null) {
|
if (this.DeviceController == null) {
|
||||||
this.Logger.Error("No device controller available to send intensity.");
|
this.Logger.Error("No device controller available to send intensity.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.DeviceController.SendVibeToAll(intensity);
|
this.DeviceController.SendVibeToAll(intensity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ using Dalamud.IoC;
|
|||||||
|
|
||||||
namespace FFXIV_Vibe_Plugin.Commons {
|
namespace FFXIV_Vibe_Plugin.Commons {
|
||||||
|
|
||||||
internal class Logger {
|
public class Logger {
|
||||||
|
|
||||||
// Initialize the Dalamud.Gui system.
|
// Initialize the Dalamud.Gui system.
|
||||||
private readonly Dalamud.Game.Gui.ChatGui? DalamudChatGui;
|
private readonly Dalamud.Game.Gui.ChatGui? DalamudChatGui;
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace FFXIV_Vibe_Plugin.Commons {
|
namespace FFXIV_Vibe_Plugin.Commons {
|
||||||
internal class Structures {
|
public class Structures {
|
||||||
|
|
||||||
public enum ActionEffectType : byte {
|
public enum ActionEffectType : byte {
|
||||||
Any = 0,
|
Any = 0,
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 131 KiB |
@ -14,7 +14,7 @@ using Buttplug;
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
namespace FFXIV_Vibe_Plugin.Device {
|
namespace FFXIV_Vibe_Plugin.Device {
|
||||||
internal class DevicesController {
|
public class DevicesController {
|
||||||
private readonly Logger Logger;
|
private readonly Logger Logger;
|
||||||
private readonly Configuration Configuration;
|
private readonly Configuration Configuration;
|
||||||
private ConfigurationProfile Profile;
|
private ConfigurationProfile Profile;
|
||||||
|
@ -5,7 +5,7 @@ using FFXIV_Vibe_Plugin.Commons;
|
|||||||
|
|
||||||
namespace FFXIV_Vibe_Plugin {
|
namespace FFXIV_Vibe_Plugin {
|
||||||
|
|
||||||
internal class PlayerStats {
|
public class PlayerStats {
|
||||||
private readonly Logger Logger;
|
private readonly Logger Logger;
|
||||||
|
|
||||||
// EVENTS
|
// EVENTS
|
||||||
@ -27,33 +27,33 @@ namespace FFXIV_Vibe_Plugin {
|
|||||||
this.UpdatePlayerState(clientState);
|
this.UpdatePlayerState(clientState);
|
||||||
this.UpdatePlayerName(clientState);
|
this.UpdatePlayerName(clientState);
|
||||||
this.UpdateCurrentHp(clientState);
|
this.UpdateCurrentHp(clientState);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdatePlayerState(ClientState clientState) {
|
public void UpdatePlayerState(ClientState clientState) {
|
||||||
if(clientState != null && clientState.LocalPlayer != null) {
|
if(clientState != null && clientState.LocalPlayer != null) {
|
||||||
if(this._CurrentHp == -1 || this._MaxHp == -1) {
|
if(this._CurrentHp == -1 || this._MaxHp == -1) {
|
||||||
this.Logger.Debug($"UpdatePlayerState {this._CurrentHp} {this._MaxHp}");
|
this.Logger.Debug($"UpdatePlayerState {this._CurrentHp} {this._MaxHp}");
|
||||||
this._CurrentHp = this._prevCurrentHp = clientState.LocalPlayer.CurrentHp;
|
this._CurrentHp = this._prevCurrentHp = clientState.LocalPlayer.CurrentHp;
|
||||||
this._MaxHp = this._prevMaxHp = clientState.LocalPlayer.MaxHp;
|
this._MaxHp = this._prevMaxHp = clientState.LocalPlayer.MaxHp;
|
||||||
this.Logger.Debug($"UpdatePlayerState {this._CurrentHp} {this._MaxHp}");
|
this.Logger.Debug($"UpdatePlayerState {this._CurrentHp} {this._MaxHp}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public string UpdatePlayerName(ClientState clientState) {
|
public string UpdatePlayerName(ClientState clientState) {
|
||||||
if(clientState != null && clientState.LocalPlayer != null) {
|
if(clientState != null && clientState.LocalPlayer != null) {
|
||||||
this.PlayerName = clientState.LocalPlayer.Name.TextValue;
|
this.PlayerName = clientState.LocalPlayer.Name.TextValue;
|
||||||
}
|
}
|
||||||
return this.PlayerName;
|
return this.PlayerName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GetPlayerName() {
|
public string GetPlayerName() {
|
||||||
return this.PlayerName;
|
return this.PlayerName;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateCurrentHp(ClientState clientState) {
|
private void UpdateCurrentHp(ClientState clientState) {
|
||||||
// Updating current values
|
// Updating current values
|
||||||
if(clientState != null && clientState.LocalPlayer != null) {
|
if(clientState != null && clientState.LocalPlayer != null) {
|
||||||
this._CurrentHp = clientState.LocalPlayer.CurrentHp;
|
this._CurrentHp = clientState.LocalPlayer.CurrentHp;
|
||||||
this._MaxHp = clientState.LocalPlayer.MaxHp;
|
this._MaxHp = clientState.LocalPlayer.MaxHp;
|
||||||
}
|
}
|
||||||
|
@ -7,13 +7,13 @@ using System.Threading.Tasks;
|
|||||||
using FFXIV_Vibe_Plugin.Device;
|
using FFXIV_Vibe_Plugin.Device;
|
||||||
|
|
||||||
namespace FFXIV_Vibe_Plugin.Triggers {
|
namespace FFXIV_Vibe_Plugin.Triggers {
|
||||||
enum KIND {
|
public enum KIND {
|
||||||
Chat,
|
Chat,
|
||||||
Spell,
|
Spell,
|
||||||
HPChange
|
HPChange
|
||||||
}
|
}
|
||||||
|
|
||||||
enum DIRECTION {
|
public enum DIRECTION {
|
||||||
Any,
|
Any,
|
||||||
Outgoing,
|
Outgoing,
|
||||||
Incoming,
|
Incoming,
|
||||||
|
@ -12,7 +12,7 @@ using FFXIV_Vibe_Plugin.Commons;
|
|||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
namespace FFXIV_Vibe_Plugin.Triggers {
|
namespace FFXIV_Vibe_Plugin.Triggers {
|
||||||
internal class TriggersController {
|
public class TriggersController {
|
||||||
private readonly Logger Logger;
|
private readonly Logger Logger;
|
||||||
private readonly PlayerStats PlayerStats;
|
private readonly PlayerStats PlayerStats;
|
||||||
private ConfigurationProfile Profile;
|
private ConfigurationProfile Profile;
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,12 +1,12 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Authors></Authors>
|
<Authors>KacieXX</Authors>
|
||||||
<Company></Company>
|
<Company>Karsian</Company>
|
||||||
<Version>0.0.0.1</Version>
|
<Version>1.7.0.1</Version>
|
||||||
<Description>A sample plugin.</Description>
|
<Description>A plugin to help you vibe your controller or toys</Description>
|
||||||
<Copyright></Copyright>
|
<Copyright>kacieXX 2023</Copyright>
|
||||||
<PackageProjectUrl>https://github.com/goatcorp/SamplePlugin</PackageProjectUrl>
|
<PackageProjectUrl>https://github.com/kaciexx/FFXIV_Vibe_Plugin</PackageProjectUrl>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
@ -21,9 +21,9 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="..\Data\logo.png">
|
<Content Include="..\images\icon.png">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
<Visible>false</Visible>
|
<Visible>true</Visible>
|
||||||
</Content>
|
</Content>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
@ -7,7 +7,6 @@ using Dalamud.Game.Network;
|
|||||||
using Dalamud.Interface.Windowing;
|
using Dalamud.Interface.Windowing;
|
||||||
using Dalamud.IoC;
|
using Dalamud.IoC;
|
||||||
using Dalamud.Plugin;
|
using Dalamud.Plugin;
|
||||||
using FFXIV_Vibe_Plugin.Windows;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
namespace FFXIV_Vibe_Plugin {
|
namespace FFXIV_Vibe_Plugin {
|
||||||
@ -42,14 +41,7 @@ namespace FFXIV_Vibe_Plugin {
|
|||||||
this.CommandManager = commandManager;
|
this.CommandManager = commandManager;
|
||||||
|
|
||||||
this.Configuration = this.PluginInterface.GetPluginConfig() as Configuration ?? new Configuration();
|
this.Configuration = this.PluginInterface.GetPluginConfig() as Configuration ?? new Configuration();
|
||||||
this.Configuration.Initialize(this.PluginInterface);
|
this.Configuration.Initialize(this.PluginInterface);
|
||||||
|
|
||||||
// you might normally want to embed resources and load them from the manifest stream
|
|
||||||
var imagePath = Path.Combine(PluginInterface.AssemblyLocation.Directory?.FullName!, "logo.png");
|
|
||||||
var logoImage = this.PluginInterface.UiBuilder.LoadImage(imagePath);
|
|
||||||
|
|
||||||
WindowSystem.AddWindow(new ConfigWindow(this));
|
|
||||||
WindowSystem.AddWindow(new MainWindow(this, logoImage));
|
|
||||||
|
|
||||||
this.CommandManager.AddHandler(CommandName, new CommandInfo(OnCommand) {
|
this.CommandManager.AddHandler(CommandName, new CommandInfo(OnCommand) {
|
||||||
HelpMessage = "A vibe plugin for fun..."
|
HelpMessage = "A vibe plugin for fun..."
|
||||||
@ -59,7 +51,10 @@ namespace FFXIV_Vibe_Plugin {
|
|||||||
this.PluginInterface.UiBuilder.OpenConfigUi += DrawConfigUI;
|
this.PluginInterface.UiBuilder.OpenConfigUi += DrawConfigUI;
|
||||||
|
|
||||||
// Init our own app
|
// Init our own app
|
||||||
this.app = new FFXIV_Vibe_Plugin.App(CommandName, ShortName, gameNetwork, clientState, dataManager, DalamudChat, Configuration, scanner, gameObjects, pluginInterface);
|
this.app = new FFXIV_Vibe_Plugin.App(this, CommandName, ShortName, gameNetwork, clientState, dataManager, DalamudChat, Configuration, scanner, gameObjects, pluginInterface);
|
||||||
|
|
||||||
|
// Setting the windows
|
||||||
|
WindowSystem.AddWindow(this.app.PluginUi);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose() {
|
public void Dispose() {
|
||||||
@ -70,18 +65,15 @@ namespace FFXIV_Vibe_Plugin {
|
|||||||
|
|
||||||
|
|
||||||
private void OnCommand(string command, string args) {
|
private void OnCommand(string command, string args) {
|
||||||
// in response to the slash command, just display our main ui
|
|
||||||
WindowSystem.GetWindow("My Amazing Window").IsOpen = true;
|
|
||||||
this.app.OnCommand(command, args);
|
this.app.OnCommand(command, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawUI() {
|
private void DrawUI() {
|
||||||
this.WindowSystem.Draw();
|
this.WindowSystem.Draw();
|
||||||
this.app.DrawUI();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DrawConfigUI() {
|
public void DrawConfigUI() {
|
||||||
WindowSystem.GetWindow("A Wonderful Configuration Window").IsOpen = true;
|
WindowSystem.GetWindow("FFXIV_Vibe_Plugin_UI").IsOpen = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,32 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Numerics;
|
|
||||||
using Dalamud.Interface.Windowing;
|
|
||||||
using ImGuiNET;
|
|
||||||
|
|
||||||
namespace FFXIV_Vibe_Plugin.Windows;
|
|
||||||
|
|
||||||
public class ConfigWindow : Window, IDisposable {
|
|
||||||
private Configuration Configuration;
|
|
||||||
|
|
||||||
public ConfigWindow(Plugin plugin) : base(
|
|
||||||
"A Wonderful Configuration Window",
|
|
||||||
ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoScrollbar |
|
|
||||||
ImGuiWindowFlags.NoScrollWithMouse) {
|
|
||||||
this.Size = new Vector2(232, 75);
|
|
||||||
this.SizeCondition = ImGuiCond.Always;
|
|
||||||
|
|
||||||
this.Configuration = plugin.Configuration;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Dispose() { }
|
|
||||||
|
|
||||||
public override void Draw() {
|
|
||||||
// can't ref a property, so use a local copy
|
|
||||||
/*var configValue = this.Configuration.SomePropertyToBeSavedAndWithADefault;
|
|
||||||
if (ImGui.Checkbox("Random Config Bool", ref configValue)) {
|
|
||||||
this.Configuration.SomePropertyToBeSavedAndWithADefault = configValue;
|
|
||||||
// can save immediately on change, if you don't want to provide a "Save and Close" button
|
|
||||||
this.Configuration.Save();
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,42 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Numerics;
|
|
||||||
using Dalamud.Interface.Windowing;
|
|
||||||
using ImGuiNET;
|
|
||||||
using ImGuiScene;
|
|
||||||
|
|
||||||
namespace FFXIV_Vibe_Plugin.Windows;
|
|
||||||
|
|
||||||
public class MainWindow : Window, IDisposable {
|
|
||||||
private TextureWrap GoatImage;
|
|
||||||
private Plugin Plugin;
|
|
||||||
|
|
||||||
public MainWindow(Plugin plugin, TextureWrap goatImage) : base(
|
|
||||||
"My Amazing Window", ImGuiWindowFlags.NoScrollbar | ImGuiWindowFlags.NoScrollWithMouse) {
|
|
||||||
this.SizeConstraints = new WindowSizeConstraints {
|
|
||||||
MinimumSize = new Vector2(375, 330),
|
|
||||||
MaximumSize = new Vector2(float.MaxValue, float.MaxValue)
|
|
||||||
};
|
|
||||||
|
|
||||||
this.GoatImage = goatImage;
|
|
||||||
this.Plugin = plugin;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Dispose() {
|
|
||||||
this.GoatImage.Dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Draw() {
|
|
||||||
/*ImGui.Text($"The random config bool is {this.Plugin.Configuration.SomePropertyToBeSavedAndWithADefault}");*/
|
|
||||||
|
|
||||||
if (ImGui.Button("Show Settings")) {
|
|
||||||
this.Plugin.DrawConfigUI();
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGui.Spacing();
|
|
||||||
|
|
||||||
ImGui.Text("Have a goat:");
|
|
||||||
ImGui.Indent(55);
|
|
||||||
ImGui.Image(this.GoatImage.ImGuiHandle, new Vector2(this.GoatImage.Width, this.GoatImage.Height));
|
|
||||||
ImGui.Unindent(55);
|
|
||||||
}
|
|
||||||
}
|
|
@ -3,7 +3,7 @@
|
|||||||
<img src="https://img.shields.io/github/downloads/kaciexx/FFXIV_Vibe_Plugin/total?label=Downloads" /> <img src="https://img.shields.io/discord/914941648859963503"/> <img src="https://img.shields.io/github/last-commit/kaciexx/FFXIV_Vibe_Plugin" />
|
<img src="https://img.shields.io/github/downloads/kaciexx/FFXIV_Vibe_Plugin/total?label=Downloads" /> <img src="https://img.shields.io/discord/914941648859963503"/> <img src="https://img.shields.io/github/last-commit/kaciexx/FFXIV_Vibe_Plugin" />
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<img width="200" height="200" src="./Data/logo.png" />
|
<img width="200" height="200" src="./images/icon.png" />
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
A plugin for FFXIV that will let you vibe your controller or toys.
|
A plugin for FFXIV that will let you vibe your controller or toys.
|
||||||
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
@ -13,7 +13,7 @@
|
|||||||
"wave"
|
"wave"
|
||||||
],
|
],
|
||||||
"DalamudApiLevel": 7,
|
"DalamudApiLevel": 7,
|
||||||
"IconUrl": "https://github.com/kaciexx/FFXIV_Vibe_Plugin/raw/master/Data/logo.png",
|
"IconUrl": "https://github.com/kaciexx/FFXIV_Vibe_Plugin/raw/master/images/logo.png",
|
||||||
"IsHide": "False",
|
"IsHide": "False",
|
||||||
"IsTestingExclusive": "False",
|
"IsTestingExclusive": "False",
|
||||||
"LastUpdated": 1662225133,
|
"LastUpdated": 1662225133,
|
||||||
|
Loading…
Reference in New Issue
Block a user