updated to api 6

This commit is contained in:
Camille 2022-04-16 09:14:07 +02:00
parent 91b788d5df
commit 9e2989ba4f
4 changed files with 13 additions and 64 deletions

View File

@ -3,7 +3,7 @@
<PropertyGroup> <PropertyGroup>
<Authors></Authors> <Authors></Authors>
<Company></Company> <Company></Company>
<Version>0.3.1.0</Version> <Version>0.3.2.0</Version>
<Description>Currency Alert</Description> <Description>Currency Alert</Description>
<Copyright></Copyright> <Copyright></Copyright>
<PackageProjectUrl>https://github.com/Lharz/xiv-currency-alert</PackageProjectUrl> <PackageProjectUrl>https://github.com/Lharz/xiv-currency-alert</PackageProjectUrl>
@ -27,7 +27,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="DalamudPackager" Version="2.1.5" /> <PackageReference Include="DalamudPackager" Version="2.1.6" />
<Reference Include="FFXIVClientStructs"> <Reference Include="FFXIVClientStructs">
<HintPath>$(DalamudLibPath)FFXIVClientStructs.dll</HintPath> <HintPath>$(DalamudLibPath)FFXIVClientStructs.dll</HintPath>
<Private>false</Private> <Private>false</Private>

View File

@ -32,7 +32,7 @@ namespace CurrencyAlert.Enum
[Name("Sack of Nuts"), ItemID(26533), DefaultThreshold(3500), Category("Battle")] [Name("Sack of Nuts"), ItemID(26533), DefaultThreshold(3500), Category("Battle")]
SackOfNut, SackOfNut,
[Name("Bicolor Gemstone"), ItemID(26807), DefaultThreshold(1000), Category("Battle")] [Name("Bicolor Gemstone"), ItemID(26807), DefaultThreshold(800), Category("Battle")]
BicolorGemstone, BicolorGemstone,
[Name("White Crafters' Scrip"), ItemID(25199), DefaultThreshold(1500), Category("Other")] [Name("White Crafters' Scrip"), ItemID(25199), DefaultThreshold(1500), Category("Other")]

View File

@ -19,12 +19,6 @@ namespace CurrencyAlert
get { return settingsVisible; } get { return settingsVisible; }
set { settingsVisible = value; } set { settingsVisible = value; }
} }
private bool debugVisible = false;
public bool DebugVisible
{
get { return debugVisible; }
set { debugVisible = value; }
}
public Dictionary<Currency, bool> AlertVisible { get; set; } = new Dictionary<Currency, bool>(); public Dictionary<Currency, bool> AlertVisible { get; set; } = new Dictionary<Currency, bool>();
public PluginUI(Configuration configuration) public PluginUI(Configuration configuration)
@ -45,9 +39,6 @@ namespace CurrencyAlert
if (this.SettingsVisible) if (this.SettingsVisible)
DrawSettingsWindow(); DrawSettingsWindow();
if (this.DebugVisible)
DrawDebugWindow();
} }
public void DrawMainWindow() public void DrawMainWindow()
@ -114,53 +105,6 @@ namespace CurrencyAlert
} }
} }
#if DEBUG
if (ImGui.Button("Open Debug"))
this.DebugVisible = true;
#endif
ImGui.End();
}
public void DrawDebugWindow()
{
ImGui.SetNextWindowSize(new Vector2(375, 330), ImGuiCond.FirstUseEver);
ImGui.SetNextWindowSizeConstraints(new Vector2(375, 330), new Vector2(float.MaxValue, float.MaxValue));
if (ImGui.Begin("Currency Alert Debug", ref this.debugVisible))
{
unsafe
{
InventoryManager* inventoryManager = InventoryManager.Instance();
ImGui.Text($"ItemID: 42 Value: {inventoryManager->GetInventoryItemCount(42)}");
EnumHelper.Each<InventoryType>(type =>
{
if (type != InventoryType.Currency)
return;
InventoryContainer* currencyContainer = inventoryManager->GetInventoryContainer(type);
if (currencyContainer == null)
{
return; // TODO: log something
}
ImGui.Text($"----- {type.ToString()} -----");
for (var i = 0; i < int.MaxValue; ++i)
{
var item = currencyContainer->GetInventorySlot(i);
if (item == null)
break;
ImGui.Text($"Index: {i} Value: {item->Quantity}");
}
});
}
}
ImGui.End(); ImGui.End();
} }
} }

View File

@ -1,15 +1,20 @@
{ {
"Author": "Lharz", "Author": "Lharz",
"Name": "Currency Alert", "Name": "Currency Alert",
"Punchline": "Lets you setup alerts upon reaching certain currencies amount (such as Poetics or PVP marks).", "Punchline": "Display alerts upon reaching configurable currencies thresholds (such as Poetics or PVP marks).",
"Description": "/currencyalert: show the configuration panel.", "Description": "/currencyalert: shows the configuration panel.",
"InternalName": "currencyAlert", "Changelog": null,
"ApplicableVersion": "any",
"Tags": [ "Tags": [
"plugin", "plugin",
"currency", "currency",
"tomestones", "tomestones",
"utility", "utility",
"other" "other"
] ],
"CategoryTags": null,
"AssemblyVersion": "0.3.2.0",
"RepoUrl": "https://github.com/Lharz/xiv-currency-alert",
"DalamudApiLevel": 6,
"ImageUrls": null,
"IconUrl": null
} }