refactor: update to api level 3

This commit is contained in:
Anna 2021-04-05 15:16:02 -04:00
parent 0554a87442
commit 65ca700d31
Signed by: anna
GPG Key ID: 0B391D8F06FCD9E0
4 changed files with 34 additions and 38 deletions

0
Macrology.sln Normal file → Executable file
View File

View File

@ -5,7 +5,6 @@
ProjectDir="$(ProjectDir)" ProjectDir="$(ProjectDir)"
OutputPath="$(OutputPath)" OutputPath="$(OutputPath)"
AssemblyName="$(AssemblyName)" AssemblyName="$(AssemblyName)"
ManifestType="yaml"
VersionComponents="3" VersionComponents="3"
MakeZip="true" MakeZip="true"
Include="Macrology.dll;Macrology.pdb"/> Include="Macrology.dll;Macrology.pdb"/>

61
Macrology/Macrology.csproj Normal file → Executable file
View File

@ -1,34 +1,33 @@
<?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>
<LangVersion>8</LangVersion> <LangVersion>latest</LangVersion>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<AssemblyVersion>0.1.0</AssemblyVersion> <Version>0.1.0</Version>
<FileVersion>0.1.0</FileVersion> <TargetFramework>net48</TargetFramework>
<TargetFramework>net48</TargetFramework> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> </PropertyGroup>
</PropertyGroup> <ItemGroup>
<ItemGroup> <Reference Include="Dalamud, Version=5.2.4.2, Culture=neutral, PublicKeyToken=null">
<Reference Include="Dalamud, Version=5.2.1.1, Culture=neutral, PublicKeyToken=null"> <HintPath>$(AppData)\XIVLauncher\addon\Hooks\dev\Dalamud.dll</HintPath>
<HintPath>$(AppData)\XIVLauncher\addon\Hooks\Dalamud.dll</HintPath> <Private>False</Private>
<Private>False</Private> </Reference>
</Reference> <Reference Include="ImGui.NET, Version=1.72.0.0, Culture=neutral, PublicKeyToken=null">
<Reference Include="ImGui.NET, Version=1.72.0.0, Culture=neutral, PublicKeyToken=null"> <HintPath>$(AppData)\XIVLauncher\addon\Hooks\dev\ImGui.NET.dll</HintPath>
<HintPath>$(AppData)\XIVLauncher\addon\Hooks\ImGui.NET.dll</HintPath> <Private>False</Private>
<Private>False</Private> </Reference>
</Reference> <Reference Include="ImGuiScene, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
<Reference Include="ImGuiScene, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"> <HintPath>$(AppData)\XIVLauncher\addon\Hooks\dev\ImGuiScene.dll</HintPath>
<HintPath>$(AppData)\XIVLauncher\addon\Hooks\ImGuiScene.dll</HintPath> <Private>False</Private>
<Private>False</Private> </Reference>
</Reference> <Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed">
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed"> <HintPath>$(AppData)\XIVLauncher\addon\Hooks\dev\Newtonsoft.Json.dll</HintPath>
<HintPath>$(AppData)\XIVLauncher\addon\Hooks\Newtonsoft.Json.dll</HintPath> <Private>False</Private>
<Private>False</Private> </Reference>
</Reference> </ItemGroup>
</ItemGroup> <ItemGroup>
<ItemGroup> <PackageReference Include="DalamudPackager" Version="1.2.1"/>
<PackageReference Include="DalamudPackager" Version="1.0.0" /> <PackageReference Include="ILRepack.Lib.MSBuild.Task" Version="2.0.18.2"/>
<PackageReference Include="ILRepack.Lib.MSBuild.Task" Version="2.0.18.2" /> <PackageReference Include="System.Threading.Channels" Version="5.0.0"/>
<PackageReference Include="System.Threading.Channels" Version="5.0.0" /> </ItemGroup>
</ItemGroup>
</Project> </Project>

View File

@ -82,7 +82,7 @@ namespace Macrology {
ImGui.Text("Running macros"); ImGui.Text("Running macros");
ImGui.PushItemWidth(-1f); ImGui.PushItemWidth(-1f);
if (ImGui.ListBoxHeader("##running-macros", this.Plugin.MacroHandler.Running.Count, 5)) { if (ImGui.BeginListBox("##running-macros")) {
foreach (var entry in this.Plugin.MacroHandler.Running) { foreach (var entry in this.Plugin.MacroHandler.Running) {
var name = $"{entry.Value.Name}"; var name = $"{entry.Value.Name}";
if (this._showIdents) { if (this._showIdents) {
@ -101,7 +101,7 @@ namespace Macrology {
} }
} }
ImGui.ListBoxFooter(); ImGui.EndListBox();
} }
ImGui.PopItemWidth(); ImGui.PopItemWidth();
@ -116,8 +116,7 @@ namespace Macrology {
if (ImGui.Button(paused ? "Resume" : "Pause") && this.RunningChoice != Guid.Empty) { if (ImGui.Button(paused ? "Resume" : "Pause") && this.RunningChoice != Guid.Empty) {
if (paused) { if (paused) {
this.Plugin.MacroHandler.ResumeMacro(this.RunningChoice); this.Plugin.MacroHandler.ResumeMacro(this.RunningChoice);
} } else {
else {
this.Plugin.MacroHandler.PauseMacro(this.RunningChoice); this.Plugin.MacroHandler.PauseMacro(this.RunningChoice);
} }
} }
@ -194,8 +193,7 @@ namespace Macrology {
if (open) { if (open) {
if (node is Macro macro) { if (node is Macro macro) {
this.DrawMacro(macro); this.DrawMacro(macro);
} } else if (node is Folder folder) {
else if (node is Folder folder) {
this.DrawFolder(folder); this.DrawFolder(folder);
foreach (var child in node.Children) { foreach (var child in node.Children) {
toRemove.AddRange(this.DrawNode(child)); toRemove.AddRange(this.DrawNode(child));