diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs deleted file mode 100644 index b28932c..0000000 --- a/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -[assembly: AssemblyTitle("SlideCast")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("SlideCast")] -[assembly: AssemblyCopyright("Copyright © 2020")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -[assembly: ComVisible(false)] - -[assembly: Guid("5be879ec-7a17-44e4-b659-ae84eed2a3ef")] - -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.7.0.0")] -[assembly: AssemblyFileVersion("0.7.0.0")] diff --git a/Properties/Settings.Designer.cs b/Properties/Settings.Designer.cs deleted file mode 100644 index e6ef7e9..0000000 --- a/Properties/Settings.Designer.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace SlideCast.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.4.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default { - get { - return defaultInstance; - } - } - } -} diff --git a/Properties/Settings.settings b/Properties/Settings.settings deleted file mode 100644 index 049245f..0000000 --- a/Properties/Settings.settings +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/SlideCast.cs b/SlideCast.cs index 3e119a6..a115b75 100644 --- a/SlideCast.cs +++ b/SlideCast.cs @@ -1,20 +1,27 @@ using System; -using Dalamud.Plugin; -using ImGuiNET; -using Dalamud.Interface; -using Dalamud.Configuration; -using Num = System.Numerics; using System.Runtime.InteropServices; -using Dalamud.Game.Command; using System.Linq; using System.Collections.Generic; +using ImGuiNET; +using Num = System.Numerics; +using Dalamud.Configuration; +using Dalamud.Game; +using Dalamud.Game.ClientState; +using Dalamud.Game.Command; +using Dalamud.IoC; +using Dalamud.Interface; +using Dalamud.Plugin; namespace SlideCast { public class SlideCast : IDalamudPlugin { + [PluginService] public static DalamudPluginInterface PluginInterface { get; private set; } = null!; + [PluginService] public static CommandManager CommandManager { get; private set; } = null!; + [PluginService] public static SigScanner SigScanner { get; private set; } + [PluginService] public static ClientState ClientState { get; private set; } + public string Name => "Slide Cast"; - private DalamudPluginInterface _pI; private Config _configuration; private bool _enabled; private bool _config; @@ -43,18 +50,17 @@ public class SlideCast : IDalamudPlugin private Colour _colS = new Colour(0.04f, 0.8f, 1f, 1f); private readonly Colour _col1S = new Colour(0.04f, 0.4f, 1f, 1f); - public void Initialize(DalamudPluginInterface pluginInterface) + public SlideCast() { - _pI = pluginInterface; - _configuration = pluginInterface.GetPluginConfig() as Config ?? new Config(); - _scan1 = pluginInterface.TargetModuleScanner.ScanText("E8 ?? ?? ?? ?? 41 b8 01 00 00 00 48 8d 15 ?? ?? ?? ?? 48 8b 48 20 e8 ?? ?? ?? ?? 48 8b cf"); - _scan2 = pluginInterface.TargetModuleScanner.ScanText("e8 ?? ?? ?? ?? 48 8b cf 48 89 87 ?? ?? 00 00 e8 ?? ?? ?? ?? 41 b8 01 00 00 00"); + _configuration = PluginInterface.GetPluginConfig() as Config ?? new Config(); + _scan1 = SigScanner.ScanText("E8 ?? ?? ?? ?? 41 b8 01 00 00 00 48 8d 15 ?? ?? ?? ?? 48 8b 48 20 e8 ?? ?? ?? ?? 48 8b cf"); + _scan2 = SigScanner.ScanText("e8 ?? ?? ?? ?? 48 8b cf 48 89 87 ?? ?? 00 00 e8 ?? ?? ?? ?? 41 b8 01 00 00 00"); _getBaseUiObj = Marshal.GetDelegateForFunctionPointer(_scan1); _getUi2ObjByName = Marshal.GetDelegateForFunctionPointer(_scan2); _castBar = _getUi2ObjByName(Marshal.ReadIntPtr(_getBaseUiObj(), 0x20), "_CastBar", 1) != IntPtr.Zero ? _getUi2ObjByName(Marshal.ReadIntPtr(_getBaseUiObj(), 0x20), "_CastBar", 1) : IntPtr.Zero; - _pI.UiBuilder.OnBuildUi += DrawWindow; - _pI.UiBuilder.OnOpenConfigUi += ConfigWindow; - _pI.CommandManager.AddHandler("/slc", new CommandInfo(Command) + PluginInterface.UiBuilder.Draw += DrawWindow; + PluginInterface.UiBuilder.OpenConfigUi += ConfigWindow; + CommandManager.AddHandler("/slc", new CommandInfo(Command) { HelpMessage = "Open SlideCast config menu" }); @@ -63,8 +69,8 @@ public void Initialize(DalamudPluginInterface pluginInterface) _slideTime = _configuration.SlideTime; _slideCol = _configuration.SlideCol; - pluginInterface.ClientState.OnLogout += (s, e) => _enabled = false; - pluginInterface.ClientState.OnLogin += (s, e) => _enabled = _configuration.Enabled; + ClientState.Logout += (s, e) => _enabled = false; + ClientState.Login += (s, e) => _enabled = _configuration.Enabled; } private void Command(string command, string arguments) @@ -74,12 +80,12 @@ private void Command(string command, string arguments) public void Dispose() { - _pI.UiBuilder.OnBuildUi -= DrawWindow; - _pI.UiBuilder.OnOpenConfigUi -= ConfigWindow; - _pI.CommandManager.RemoveHandler("/slc"); + PluginInterface.UiBuilder.Draw -= DrawWindow; + PluginInterface.UiBuilder.OpenConfigUi -= ConfigWindow; + CommandManager.RemoveHandler("/slc"); } - private void ConfigWindow(object sender, EventArgs args) + private void ConfigWindow() { _config = true; } @@ -231,7 +237,7 @@ private void SaveConfig() _configuration.Enabled = _enabled; _configuration.SlideTime = _slideTime; _configuration.SlideCol = _slideCol; - _pI.SavePluginConfig(_configuration); + PluginInterface.SavePluginConfig(_configuration); } } diff --git a/SlideCast.csproj b/SlideCast.csproj index c396397..4c159b0 100644 --- a/SlideCast.csproj +++ b/SlideCast.csproj @@ -1,74 +1,58 @@ - - - - - Release - AnyCPU - {5BE879EC-7A17-44E4-B659-AE84EED2A3EF} - Library - Properties - SlideCast - SlideCast - v4.7.2 - 512 - {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 15.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages - False - UnitTest - - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - $(APPDATA)\XIVLauncher\addon\Hooks\dev\Dalamud.dll - - - $(APPDATA)\XIVLauncher\addon\Hooks\dev\ImGui.NET.dll - - - $(APPDATA)\XIVLauncher\addon\Hooks\dev\ImGuiScene.dll - - - $(APPDATA)\XIVLauncher\addon\Hooks\dev\Lumina.dll - - - - - - - - True - True - Settings.settings - - - - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - - + + + x64 + x64 + SlideCast + SlideCast + 1.0.0.0 + 1.0.0.0 + net5-windows + latest + Haplo064 + Haplo064 + SlideCast + Copyright © 2021 + bin\$(Configuration)\ + Library + 4 + true + 1.0.0.0 + false + false + false + true + SlideCast + + + + TRACE;DEBUG + + + + TRACE + + + + + + $(AppData)\XIVLauncher\addon\Hooks\dev\Dalamud.dll + false + + + $(AppData)\XIVLauncher\addon\Hooks\dev\ImGui.NET.dll + false + + + $(AppData)\XIVLauncher\addon\Hooks\dev\ImGuiScene.dll + false + + + $(AppData)\XIVLauncher\addon\Hooks\dev\Lumina.dll + false + + + + + + \ No newline at end of file diff --git a/SlideCast.sln b/SlideCast.sln index f74587b..80d0afa 100644 --- a/SlideCast.sln +++ b/SlideCast.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.29613.14 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SlideCast", "SlideCast.csproj", "{5BE879EC-7A17-44E4-B659-AE84EED2A3EF}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SlideCast", "SlideCast.csproj", "{5BE879EC-7A17-44E4-B659-AE84EED2A3EF}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -11,10 +11,10 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {5BE879EC-7A17-44E4-B659-AE84EED2A3EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5BE879EC-7A17-44E4-B659-AE84EED2A3EF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5BE879EC-7A17-44E4-B659-AE84EED2A3EF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5BE879EC-7A17-44E4-B659-AE84EED2A3EF}.Release|Any CPU.Build.0 = Release|Any CPU + {5BE879EC-7A17-44E4-B659-AE84EED2A3EF}.Debug|Any CPU.ActiveCfg = Debug|x64 + {5BE879EC-7A17-44E4-B659-AE84EED2A3EF}.Debug|Any CPU.Build.0 = Debug|x64 + {5BE879EC-7A17-44E4-B659-AE84EED2A3EF}.Release|Any CPU.ActiveCfg = Release|x64 + {5BE879EC-7A17-44E4-B659-AE84EED2A3EF}.Release|Any CPU.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/SlideCast.yaml b/SlideCast.yaml new file mode 100644 index 0000000..054d7a5 --- /dev/null +++ b/SlideCast.yaml @@ -0,0 +1,5 @@ +name: SlideCast +author: Haplo064 +description: Adds an indicator of when it's safe to move while casting. +punchline: Safe casting indicator. +repo_url: https://github.com/Haplo064/SlideCast