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

View File

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