changed currencies default values

main
Camille 2022-01-19 11:14:20 +01:00
parent d79572fe6f
commit be3d07dd8b
5 changed files with 61 additions and 12 deletions

View File

@ -3,7 +3,7 @@
<PropertyGroup>
<Authors></Authors>
<Company></Company>
<Version>0.2.2.0</Version>
<Version>0.2.2</Version>
<Description>Currency Alert</Description>
<Copyright></Copyright>
<PackageProjectUrl>https://github.com/Lharz/xiv-currency-alert</PackageProjectUrl>
@ -22,6 +22,8 @@
<PropertyGroup>
<DalamudLibPath>$(appdata)\XIVLauncher\addon\Hooks\dev\</DalamudLibPath>
<RepositoryUrl>https://github.com/Lharz/xiv-currency-alert</RepositoryUrl>
<RepositoryType>git</RepositoryType>
</PropertyGroup>
<ItemGroup>

View File

@ -8,9 +8,9 @@ namespace CurrencyAlert.Enum
{
public enum Currency
{
[Name("Tomestones of Poetics"), Slot(6), DefaultThreshold(1500)]
[Name("Tomestones of Poetics"), Slot(6), DefaultThreshold(1400)]
TomestoneOfPoetics,
[Name("Tomestones of Astronomy"), Slot(10), DefaultThreshold(1500)]
[Name("Tomestones of Astronomy"), Slot(10), DefaultThreshold(1800)]
TomestoneOfAstronomy,
[Name("Storm Seals"), Slot(1), DefaultThreshold(75000)]
StormSeal,

View File

@ -66,7 +66,14 @@ namespace CurrencyAlert
EnumHelper.Each<Currency>(currency =>
{
var slot = EnumHelper.GetAttributeOfType<SlotAttribute>(currency).Value;
uint quantity = currencyContainer->GetInventorySlot((int)slot)->Quantity;
InventoryItem* item = currencyContainer->GetInventorySlot((int)slot);
if (item == null)
{
return; // TODO: write a log somewhere
}
uint quantity = item->Quantity;
if (this.Configuration.AlertEnabled[currency] && quantity >= this.Configuration.Threshold[currency])
{

View File

@ -124,17 +124,27 @@ namespace CurrencyAlert
unsafe
{
InventoryManager* inventoryManager = InventoryManager.Instance();
InventoryContainer* currencyContainer = inventoryManager->GetInventoryContainer(InventoryType.Currency);
for (var i = 0; i < 100000; ++i)
EnumHelper.Each<InventoryType>(type =>
{
var item = currencyContainer->GetInventorySlot(i);
InventoryContainer* currencyContainer = inventoryManager->GetInventoryContainer(type);
if (item == null)
continue;
if (currencyContainer == null)
{
return; // TODO: log something
}
ImGui.Text($"Index: {i} Value: {item->Quantity}");
}
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}");
}
});
}
}

View File

@ -11,3 +11,33 @@
"tomestones"
]
}
{
"Disabled": true,
"Testing": false,
"InstalledFromUrl": null,
"Author": "Lharz",
"Name": "Currency Alert",
"Punchline": "Configure alerts upon reaching various currencies amount.",
"Description": "This plugin lets you setup alerts upon reaching configurable currencies amount (such as Poetics or Wolf Marks). You will never overcap your currencies now.",
"Tags": [
"plugin",
"currency",
"tomestones"
],
"IsHide": false,
"InternalName": "CurrencyAlert",
"AssemblyVersion": "0.2.2.0",
"TestingAssemblyVersion": null,
"IsTestingExclusive": false,
"RepoUrl": null,
"ApplicableVersion": "any",
"DalamudApiLevel": 4,
"DownloadCount": 0,
"LastUpdate": 0,
"DownloadLinkInstall": null,
"DownloadLinkUpdate": null,
"DownloadLinkTesting": null,
"LoadPriority": 0,
"ImageUrls": null,
"IconUrl": null
}