Finish BiS bucket stuff
This commit is contained in:
@@ -246,7 +246,7 @@ public static class CategoryBucketManager
|
||||
if (!System.IPC.BisBuddy.IsReady) return;
|
||||
|
||||
var bisItems = System.IPC.BisBuddy.ItemLookup;
|
||||
if (bisItems. Count == 0) return;
|
||||
if (bisItems.Count == 0) return;
|
||||
|
||||
uint bucketKey = MakeBisBuddyKey();
|
||||
|
||||
@@ -265,7 +265,7 @@ public static class CategoryBucketManager
|
||||
FilteredItems = new List<ItemInfo>(capacity: 16),
|
||||
Used = true,
|
||||
};
|
||||
bucketsByKey. Add(bucketKey, bucket);
|
||||
bucketsByKey.Add(bucketKey, bucket);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -282,7 +282,7 @@ public static class CategoryBucketManager
|
||||
|
||||
if (bisItems.ContainsKey(item.Item.ItemId))
|
||||
{
|
||||
bucket.Items. Add(item);
|
||||
bucket.Items.Add(item);
|
||||
claimedKeys.Add(itemKey);
|
||||
}
|
||||
}
|
||||
@@ -352,20 +352,27 @@ public static class CategoryBucketManager
|
||||
if (!bucket.Used)
|
||||
continue;
|
||||
|
||||
// TODO: Make configurable
|
||||
bucket.Items.Sort(ItemCountDescComparer.Instance);
|
||||
sortedCategoryKeys.Add(bucket.Key);
|
||||
}
|
||||
|
||||
// TODO: Make sortable by user
|
||||
sortedCategoryKeys.Sort((left, right) =>
|
||||
{
|
||||
bool leftUser = IsUserCategoryKey(left);
|
||||
bool rightUser = IsUserCategoryKey(right);
|
||||
bool leftAllagan = IsAllaganFilterKey(left);
|
||||
bool rightAllagan = IsAllaganFilterKey(right);
|
||||
if (leftUser != rightUser) return leftUser ? -1 : 1;
|
||||
if (leftAllagan != rightAllagan) return leftAllagan ? -1 : 1;
|
||||
int GetPriority(uint key)
|
||||
{
|
||||
if (IsUserCategoryKey(key)) return 1;
|
||||
if (IsBisBuddyKey(key)) return 2;
|
||||
if (IsAllaganFilterKey(key)) return 3;
|
||||
if (key == 0) return 99;
|
||||
return 10;
|
||||
}
|
||||
|
||||
return left.CompareTo(right);
|
||||
int leftPrio = GetPriority(left);
|
||||
int rightPrio = GetPriority(right);
|
||||
|
||||
return leftPrio != rightPrio ? leftPrio.CompareTo(rightPrio) : left.CompareTo(right);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -97,8 +97,8 @@ public abstract class InventoryStateBase
|
||||
{
|
||||
if (config.Categories.BisBuddyMode == PluginFilterMode.Categorize)
|
||||
{
|
||||
CategoryBucketManager.BucketByAllaganFilters(ItemInfoByKey, BucketsByKey, ClaimedKeys, true);
|
||||
HighlightState.ClearFilter(HighlightSource.AllaganTools);
|
||||
CategoryBucketManager.BucketByBisBuddyItems(ItemInfoByKey, BucketsByKey, ClaimedKeys, true);
|
||||
HighlightState.ClearFilter(HighlightSource.BiSBuddy);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -141,6 +141,25 @@ public abstract class InventoryStateBase
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateBisBuddyHighlight(string? filterKey)
|
||||
{
|
||||
if (string.IsNullOrEmpty(filterKey) || !System.IPC.BisBuddy.IsReady)
|
||||
{
|
||||
HighlightState.ClearFilter(HighlightSource.BiSBuddy);
|
||||
return;
|
||||
}
|
||||
|
||||
var filterItems = System.IPC.AllaganTools.GetFilterItems(filterKey);
|
||||
if (filterItems != null)
|
||||
{
|
||||
HighlightState.SetFilter(HighlightSource.BiSBuddy, filterItems.Keys);
|
||||
}
|
||||
else
|
||||
{
|
||||
HighlightState.ClearFilter(HighlightSource.BiSBuddy);
|
||||
}
|
||||
}
|
||||
|
||||
public IReadOnlyList<CategorizedInventory> GetCategories(string filter = "", bool invert = false)
|
||||
=> InventoryFilter.FilterCategories(AllCategories, BucketsByKey, FilteredCategories, filter, invert);
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ public sealed class CategoryGeneralConfigurationNode : TabbedVerticalListNode
|
||||
}
|
||||
};
|
||||
AddNode(bisBuddyEnabled);
|
||||
AddNode(bbModeDropdown);
|
||||
AddNode(1, bbModeDropdown);
|
||||
|
||||
bool allaganReady = System.IPC.AllaganTools?.IsReady ?? false;
|
||||
|
||||
@@ -162,8 +162,7 @@ public sealed class CategoryGeneralConfigurationNode : TabbedVerticalListNode
|
||||
};
|
||||
AddNode(_allaganToolsCheckbox);
|
||||
|
||||
AddTab(1);
|
||||
AddNode(atModeDropdown);
|
||||
AddNode(1, atModeDropdown);
|
||||
SubtractTab(1);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
Submodule KamiToolKit updated: 1d838e8bfa...5886600a04
Reference in New Issue
Block a user