diff --git a/ARDiscard.sln.DotSettings b/ARDiscard.sln.DotSettings new file mode 100644 index 0000000..69b1c96 --- /dev/null +++ b/ARDiscard.sln.DotSettings @@ -0,0 +1,3 @@ + + ExplicitlyExcluded + ExplicitlyExcluded \ No newline at end of file diff --git a/ARDiscard/ARDiscard.csproj b/ARDiscard/ARDiscard.csproj index 2e1e7b7..68f268a 100644 --- a/ARDiscard/ARDiscard.csproj +++ b/ARDiscard/ARDiscard.csproj @@ -1,6 +1,6 @@ - + - 6.3 + 7.0 dist diff --git a/ARDiscard/DalamudPackager.targets b/ARDiscard/DalamudPackager.targets index 44e44a6..b753a48 100644 --- a/ARDiscard/DalamudPackager.targets +++ b/ARDiscard/DalamudPackager.targets @@ -16,6 +16,6 @@ AssemblyName="$(AssemblyName)" MakeZip="true" VersionComponents="2" - Exclude="ARDiscard.deps.json;AutoRetainerAPI.pdb;ClickLib.pdb;ClickLib.xml;ECommons.pdb;ECommons.xml"/> + Exclude="ARDiscard.deps.json;AutoRetainerAPI.pdb;ECommons.pdb;ECommons.xml"/> diff --git a/ARDiscard/GameData/GameStrings.cs b/ARDiscard/GameData/GameStrings.cs index a59b87d..2239c79 100644 --- a/ARDiscard/GameData/GameStrings.cs +++ b/ARDiscard/GameData/GameStrings.cs @@ -2,7 +2,7 @@ using System.Text.RegularExpressions; using Dalamud.Plugin.Services; using LLib; -using Lumina.Excel.GeneratedSheets; +using Lumina.Excel.Sheets; namespace ARDiscard.GameData; diff --git a/ARDiscard/GameData/InventoryUtils.cs b/ARDiscard/GameData/InventoryUtils.cs index 8623a20..f957bbc 100644 --- a/ARDiscard/GameData/InventoryUtils.cs +++ b/ARDiscard/GameData/InventoryUtils.cs @@ -60,7 +60,7 @@ internal sealed class InventoryUtils public unsafe List GetAllItemsToDiscard() { List toDiscard = new List(); - Dictionary itemCounts = new(); + Dictionary itemCounts = new(); InventoryManager* inventoryManager = InventoryManager.Instance(); foreach (InventoryType inventoryType in DefaultInventoryTypes) @@ -83,7 +83,7 @@ internal sealed class InventoryUtils } private unsafe ReadOnlyCollection GetArmouryItemsToDiscard(bool condition, InventoryManager* inventoryManager, - InventoryType[] inventoryTypes, Dictionary itemCounts, List? gearsetItems) + InventoryType[] inventoryTypes, Dictionary itemCounts, List? gearsetItems) { List items = new(); if (condition) @@ -104,7 +104,7 @@ internal sealed class InventoryUtils } private unsafe ReadOnlyCollection GetItemsToDiscard(InventoryManager* inventoryManager, - InventoryType inventoryType, Dictionary itemCounts, + InventoryType inventoryType, Dictionary itemCounts, IReadOnlyList? gearsetItems) { List toDiscard = new List(); @@ -115,7 +115,7 @@ internal sealed class InventoryUtils var item = container->GetInventorySlot(i); if (item != null && item->ItemId != 0) { - if (itemCounts.TryGetValue(item->ItemId, out uint itemCount)) + if (itemCounts.TryGetValue(item->ItemId, out int itemCount)) itemCounts[item->ItemId] = itemCount + item->Quantity; else itemCounts[item->ItemId] = item->Quantity; diff --git a/ARDiscard/GameData/ItemCache.cs b/ARDiscard/GameData/ItemCache.cs index cbfab68..4f64876 100644 --- a/ARDiscard/GameData/ItemCache.cs +++ b/ARDiscard/GameData/ItemCache.cs @@ -3,7 +3,7 @@ using System.Diagnostics.CodeAnalysis; using System.Linq; using Dalamud.Plugin.Services; using Lumina.Excel; -using Lumina.Excel.GeneratedSheets; +using Lumina.Excel.Sheets; namespace ARDiscard.GameData; @@ -13,7 +13,7 @@ internal sealed class ItemCache public ItemCache(IDataManager dataManager, ListManager listManager) { - foreach (var item in dataManager.GetExcelSheet()!) + foreach (var item in dataManager.GetExcelSheet()) { if (item.RowId == 0) continue; @@ -23,36 +23,36 @@ internal sealed class ItemCache ItemId = item.RowId, Name = item.Name.ToString(), IconId = item.Icon, - ILvl = item.LevelItem.Row, + ILvl = item.LevelItem.RowId, Rarity = item.Rarity, IsUnique = item.IsUnique, IsUntradable = item.IsUntradable, IsIndisposable = item.IsIndisposable, Level = item.LevelEquip, - UiCategory = item.ItemUICategory.Row, - UiCategoryName = item.ItemUICategory.Value!.Name.ToString(), - EquipSlotCategory = item.EquipSlotCategory.Row, + UiCategory = item.ItemUICategory.RowId, + UiCategoryName = item.ItemUICategory.Value.Name.ToString(), + EquipSlotCategory = item.EquipSlotCategory.RowId, }; if (item is { Rarity: 3, MateriaSlotCount: 3, RowId: < 33154 or > 33358 }) listManager.AddToInternalBlacklist(item.RowId); - if (item is { ItemSearchCategory.Row: 79, ItemUICategory.Row: >= 101 and <= 104 }) + if (item is { ItemSearchCategory.RowId: 79, ItemUICategory.RowId: >= 101 and <= 104 }) listManager.AddToInternalBlacklist(item.RowId); } - foreach (var shopItem in dataManager.GetExcelSheet()!) + foreach (var shopItem in dataManager.GetSubrowExcelSheet().SelectMany(x => x)) { // exclude base ARR relics, not strictly necessary since we don't allow discarding weapons anyway - if (shopItem.Item.Value!.Rarity == 4) + if (shopItem.Item.Value.Rarity == 4) continue; // the item can be discarded already - if (!_items.TryGetValue(shopItem.Item.Row, out CachedItemInfo? cachedItemInfo) || + if (!_items.TryGetValue(shopItem.Item.RowId, out CachedItemInfo? cachedItemInfo) || cachedItemInfo.CanBeDiscarded(listManager)) continue; - if (shopItem.AchievementRequired.Row != 0) + if (shopItem.AchievementRequired.RowId != 0) continue; // has a quest required to unlock from the shop @@ -62,22 +62,23 @@ internal sealed class ItemCache cachedItemInfo.CanBeBoughtFromCalamitySalvager = true; } - foreach (var collectableItem in dataManager.GetExcelSheet()!) + foreach (var collectableItem in dataManager.GetSubrowExcelSheet().SelectMany(x => x)) { if (collectableItem.RowId == 0) continue; - listManager.AddToInternalWhitelist(collectableItem.Item.Row); + listManager.AddToInternalWhitelist(collectableItem.Item.RowId); } // only look at msq + regional side quests - foreach (var quest in dataManager.GetExcelSheet()!.Where(x => x.JournalGenre.Value?.JournalCategory.Value?.JournalSection.Row is 0 or 1 or 3)) + foreach (var quest in dataManager.GetExcelSheet().Where(x => + x.JournalGenre.ValueNullable?.JournalCategory.ValueNullable?.JournalSection.RowId is 0 or 1 or 3)) { - foreach (var itemId in quest.ItemReward.Where(x => x > 0)) + foreach (var itemRef in quest.Reward.Where(x => x.RowId > 0)) { - var item = dataManager.GetExcelSheet()!.GetRow(itemId); - if (item is { Rarity: 1, ItemAction.Row: 388 } && item.RowId != 38809 && item.RowId != 29679) - listManager.AddToInternalWhitelist(item.RowId); + var item = itemRef.GetValueOrDefault(); + if (item is { Rarity: 1, ItemAction.RowId: 388 } && item.Value.RowId != 38809 && item.Value.RowId != 29679) + listManager.AddToInternalWhitelist(item.Value.RowId); } } @@ -88,11 +89,11 @@ internal sealed class ItemCache public int MaxDungeonItemLevel { get; } - private bool CanDiscardItemsFromQuest(LazyRow quest) + private bool CanDiscardItemsFromQuest(RowRef quest) { - return quest.Row > 0 && - quest.Value?.JournalGenre.Value?.JournalCategory.Value?.JournalSection - .Row is 0 or 1 or 6; // pre-EW MSQ, EW MSQ or Job/Class quest + return quest is { RowId: > 0, IsValid: true } && + quest.ValueNullable?.JournalGenre.ValueNullable?.JournalCategory.ValueNullable?.JournalSection + .RowId is 0 or 1 or 6; // pre-EW MSQ, EW MSQ or Job/Class quest } public IEnumerable AllItems => _items.Values; diff --git a/ARDiscard/Windows/ConfigWindow.cs b/ARDiscard/Windows/ConfigWindow.cs index 04dee0e..100b1c2 100644 --- a/ARDiscard/Windows/ConfigWindow.cs +++ b/ARDiscard/Windows/ConfigWindow.cs @@ -109,7 +109,7 @@ internal sealed class ConfigWindow : LWindow { if (_clientState is { IsLoggedIn: true, LocalContentId: > 0 }) { - string worldName = _clientState.LocalPlayer?.HomeWorld.GameData?.Name ?? "??"; + string worldName = _clientState.LocalPlayer?.HomeWorld.ValueNullable?.Name .ToString() ?? "??"; ImGui.TextWrapped( $"Current Character: {_clientState.LocalPlayer?.Name} @ {worldName} ({_clientState.LocalContentId:X})"); ImGui.Indent(30); diff --git a/ARDiscard/Windows/DiscardWindow.cs b/ARDiscard/Windows/DiscardWindow.cs index 27fc161..e756951 100644 --- a/ARDiscard/Windows/DiscardWindow.cs +++ b/ARDiscard/Windows/DiscardWindow.cs @@ -195,5 +195,5 @@ internal sealed class DiscardWindow : LWindow public void Login() => RefreshInventory(false); - public void Logout() => _displayedItems.Clear(); + public void Logout(int type, int code) => _displayedItems.Clear(); } diff --git a/ARDiscard/packages.lock.json b/ARDiscard/packages.lock.json index 21e8554..9b01336 100644 --- a/ARDiscard/packages.lock.json +++ b/ARDiscard/packages.lock.json @@ -4,9 +4,9 @@ "net8.0-windows7.0": { "DalamudPackager": { "type": "Direct", - "requested": "[2.1.13, )", - "resolved": "2.1.13", - "contentHash": "rMN1omGe8536f4xLMvx9NwfvpAc9YFFfeXJ1t4P4PE6Gu8WCIoFliR1sh07hM+bfODmesk/dvMbji7vNI+B/pQ==" + "requested": "[11.0.0, )", + "resolved": "11.0.0", + "contentHash": "bjT7XUlhIJSmsE/O76b7weUX+evvGQctbQB8aKXt94o+oPWxHpCepxAGMs7Thow3AzCyqWs7cOpp9/2wcgRRQA==" }, "DotNet.ReproducibleBuilds": { "type": "Direct", @@ -88,7 +88,7 @@ "llib": { "type": "Project", "dependencies": { - "DalamudPackager": "[2.1.13, )" + "DalamudPackager": "[11.0.0, )" } } } diff --git a/AutoRetainerAPI b/AutoRetainerAPI index 1c8745e..069cf98 160000 --- a/AutoRetainerAPI +++ b/AutoRetainerAPI @@ -1 +1 @@ -Subproject commit 1c8745ef2757585d2683b4a83c44c8db81ff8955 +Subproject commit 069cf988b5da8657bc13ade73bfcbc2675601023 diff --git a/ECommons b/ECommons index 07c07e0..974a0ef 160000 --- a/ECommons +++ b/ECommons @@ -1 +1 @@ -Subproject commit 07c07e09101e0c8a5f770dbea2ca6eafea5ec705 +Subproject commit 974a0ef35536b7f0a10a278539f7136d6966baa3 diff --git a/LLib b/LLib index fde09c7..e4bbc05 160000 --- a/LLib +++ b/LLib @@ -1 +1 @@ -Subproject commit fde09c705b648f03c287814191a554f0a4b92cc4 +Subproject commit e4bbc05ede6f6f01e7028b24614ed8cb333e909c