Automatically adjust max gear item level based on the highest ilvl green item (dungeon drop)
This commit is contained in:
parent
d730e2c039
commit
cfbd064d4a
@ -1,6 +1,6 @@
|
||||
<Project Sdk="Dalamud.NET.Sdk/9.0.2">
|
||||
<PropertyGroup>
|
||||
<Version>6.1</Version>
|
||||
<Version>6.2</Version>
|
||||
<OutputPath>dist</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
|
@ -72,8 +72,14 @@ internal sealed class ItemCache
|
||||
listManager.AddToInternalWhitelist(item.RowId);
|
||||
}
|
||||
}
|
||||
|
||||
MaxDungeonItemLevel = _items.Values.Where(x => x.Rarity == 2)
|
||||
.Select(x => (int)x.ILvl)
|
||||
.Max();
|
||||
}
|
||||
|
||||
public int MaxDungeonItemLevel { get; }
|
||||
|
||||
private bool CanDiscardItemsFromQuest(LazyRow<Quest> quest)
|
||||
{
|
||||
return quest.Row > 0 &&
|
||||
|
@ -234,7 +234,8 @@ internal sealed class ConfigWindow : LWindow
|
||||
if (ImGui.InputInt("Ignore items >= this ilvl (Armoury Chest only)",
|
||||
ref maximumItemLevel))
|
||||
{
|
||||
_configuration.Armoury.MaximumGearItemLevel = Math.Max(0, Math.Min(625, maximumItemLevel));
|
||||
_configuration.Armoury.MaximumGearItemLevel =
|
||||
Math.Max(0, Math.Min(_itemCache.MaxDungeonItemLevel, maximumItemLevel));
|
||||
Save();
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,7 @@ namespace ARDiscard.Windows
|
||||
protected override string RightSideLabel => "Items that will be automatically discarded";
|
||||
internal required ExcludedListTab ExcludedTab { private get; init; }
|
||||
|
||||
public override IEnumerable<uint> ToSavedItems()
|
||||
public IEnumerable<uint> ToSavedItems()
|
||||
{
|
||||
SelectedItems.RemoveAll(x => ExcludedTab.IsBlacklistedInConfiguration(x.ItemId));
|
||||
return SelectedItems.Select(x => x.ItemId);
|
||||
|
@ -20,7 +20,7 @@ internal sealed class ExcludedListTab : ItemListTab
|
||||
|
||||
protected override string RightSideLabel => "Items that will never be discarded";
|
||||
|
||||
public override IEnumerable<uint> ToSavedItems()
|
||||
public IEnumerable<uint> ToSavedItems()
|
||||
{
|
||||
return SelectedItems
|
||||
.Select(x => x.ItemId)
|
||||
|
@ -26,8 +26,6 @@ internal abstract class ItemListTab
|
||||
protected abstract string RightSideLabel { get; }
|
||||
protected List<(uint ItemId, string Name)> SelectedItems { get; } = new();
|
||||
|
||||
public abstract IEnumerable<uint> ToSavedItems();
|
||||
|
||||
public void Draw()
|
||||
{
|
||||
var ws = ImGui.GetWindowSize();
|
||||
@ -143,8 +141,6 @@ internal abstract class ItemListTab
|
||||
|
||||
protected virtual (string Name, bool Enabled) AsLeftSideDisplay(uint itemId, string name) => (name, true);
|
||||
|
||||
protected virtual (string Name, bool Enabled) AsRightSideDisplay(uint itemId, string name) => (name, true);
|
||||
|
||||
protected void Save() => _parent.Save();
|
||||
|
||||
private void UpdateResults()
|
||||
|
Loading…
Reference in New Issue
Block a user