refactor: move to net5
This commit is contained in:
parent
f797ad8968
commit
4592d66c60
|
@ -10,13 +10,13 @@ namespace TextBoxStyler {
|
|||
internal Commands(Plugin plugin) {
|
||||
this.Plugin = plugin;
|
||||
|
||||
this.Plugin.Interface.CommandManager.AddHandler(CommandName, new CommandInfo(this.OnCommand) {
|
||||
this.Plugin.CommandManager.AddHandler(CommandName, new CommandInfo(this.OnCommand) {
|
||||
HelpMessage = $"Opens the settings for {this.Plugin.Name}",
|
||||
});
|
||||
}
|
||||
|
||||
public void Dispose() {
|
||||
this.Plugin.Interface.CommandManager.RemoveHandler(CommandName);
|
||||
this.Plugin.CommandManager.RemoveHandler(CommandName);
|
||||
}
|
||||
|
||||
private void OnCommand(string command, string args) {
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
|
||||
<ILMerge/>
|
||||
</Weavers>
|
|
@ -1,19 +1,24 @@
|
|||
using Dalamud.Plugin;
|
||||
using Dalamud.Game.Command;
|
||||
using Dalamud.IoC;
|
||||
using Dalamud.Plugin;
|
||||
|
||||
namespace TextBoxStyler {
|
||||
// ReSharper disable once ClassNeverInstantiated.Global
|
||||
public class Plugin : IDalamudPlugin {
|
||||
public string Name => "Text Box Styler";
|
||||
|
||||
internal DalamudPluginInterface Interface { get; private set; } = null!;
|
||||
internal PluginConfiguration Config { get; private set; } = null!;
|
||||
internal PluginUi Ui { get; private set; } = null!;
|
||||
private Styler Styler { get; set; } = null!;
|
||||
private Commands Commands { get; set; } = null!;
|
||||
[PluginService]
|
||||
internal DalamudPluginInterface Interface { get; private init; } = null!;
|
||||
|
||||
public void Initialize(DalamudPluginInterface pluginInterface) {
|
||||
this.Interface = pluginInterface;
|
||||
[PluginService]
|
||||
internal CommandManager CommandManager { get; private init; } = null!;
|
||||
|
||||
internal PluginConfiguration Config { get; }
|
||||
internal PluginUi Ui { get; }
|
||||
private Styler Styler { get; }
|
||||
private Commands Commands { get; }
|
||||
|
||||
public Plugin() {
|
||||
this.Config = this.Interface.GetPluginConfig() as PluginConfiguration ?? new PluginConfiguration();
|
||||
this.Config.Initialise(this);
|
||||
|
||||
|
|
|
@ -18,16 +18,16 @@ namespace TextBoxStyler {
|
|||
internal PluginUi(Plugin plugin) {
|
||||
this.Plugin = plugin;
|
||||
|
||||
this.Plugin.Interface.UiBuilder.OnBuildUi += this.Draw;
|
||||
this.Plugin.Interface.UiBuilder.OnOpenConfigUi += this.ToggleConfig;
|
||||
this.Plugin.Interface.UiBuilder.Draw += this.Draw;
|
||||
this.Plugin.Interface.UiBuilder.OpenConfigUi += this.ToggleConfig;
|
||||
}
|
||||
|
||||
public void Dispose() {
|
||||
this.Plugin.Interface.UiBuilder.OnOpenConfigUi -= this.ToggleConfig;
|
||||
this.Plugin.Interface.UiBuilder.OnBuildUi -= this.Draw;
|
||||
this.Plugin.Interface.UiBuilder.OpenConfigUi -= this.ToggleConfig;
|
||||
this.Plugin.Interface.UiBuilder.Draw -= this.Draw;
|
||||
}
|
||||
|
||||
internal void ToggleConfig(object? sender = null, EventArgs? e = null) {
|
||||
internal void ToggleConfig() {
|
||||
this.DrawUi = !this.DrawUi;
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ namespace TextBoxStyler {
|
|||
|
||||
public Styler(Plugin plugin) {
|
||||
this.Plugin = plugin;
|
||||
this.Common = new XivCommonBase(this.Plugin.Interface, Hooks.Talk | Hooks.BattleTalk);
|
||||
this.Common = new XivCommonBase(Hooks.Talk | Hooks.BattleTalk);
|
||||
|
||||
this.Common.Functions.Talk.OnTalk += this.StyleTalk;
|
||||
this.Common.Functions.BattleTalk.OnBattleTalk += this.StyleBattleTalk;
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net48</TargetFramework>
|
||||
<TargetFramework>net5-windows</TargetFramework>
|
||||
<Version>1.1.0</Version>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
<ProduceReferenceAssembly>false</ProduceReferenceAssembly>
|
||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -23,10 +25,8 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="DalamudPackager" Version="1.2.1" />
|
||||
<PackageReference Include="Fody" Version="6.5.1" PrivateAssets="all" />
|
||||
<PackageReference Include="ILMerge.Fody" Version="1.16.0" PrivateAssets="all" />
|
||||
<PackageReference Include="XivCommon" Version="1.4.0" />
|
||||
<PackageReference Include="DalamudPackager" Version="2.1.2" />
|
||||
<PackageReference Include="XivCommon" Version="3.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
Loading…
Reference in New Issue