Finish BiS bucket stuff
This commit is contained in:
@@ -352,20 +352,27 @@ public static class CategoryBucketManager
|
|||||||
if (!bucket.Used)
|
if (!bucket.Used)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
// TODO: Make configurable
|
||||||
bucket.Items.Sort(ItemCountDescComparer.Instance);
|
bucket.Items.Sort(ItemCountDescComparer.Instance);
|
||||||
sortedCategoryKeys.Add(bucket.Key);
|
sortedCategoryKeys.Add(bucket.Key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Make sortable by user
|
||||||
sortedCategoryKeys.Sort((left, right) =>
|
sortedCategoryKeys.Sort((left, right) =>
|
||||||
{
|
{
|
||||||
bool leftUser = IsUserCategoryKey(left);
|
int GetPriority(uint key)
|
||||||
bool rightUser = IsUserCategoryKey(right);
|
{
|
||||||
bool leftAllagan = IsAllaganFilterKey(left);
|
if (IsUserCategoryKey(key)) return 1;
|
||||||
bool rightAllagan = IsAllaganFilterKey(right);
|
if (IsBisBuddyKey(key)) return 2;
|
||||||
if (leftUser != rightUser) return leftUser ? -1 : 1;
|
if (IsAllaganFilterKey(key)) return 3;
|
||||||
if (leftAllagan != rightAllagan) return leftAllagan ? -1 : 1;
|
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)
|
if (config.Categories.BisBuddyMode == PluginFilterMode.Categorize)
|
||||||
{
|
{
|
||||||
CategoryBucketManager.BucketByAllaganFilters(ItemInfoByKey, BucketsByKey, ClaimedKeys, true);
|
CategoryBucketManager.BucketByBisBuddyItems(ItemInfoByKey, BucketsByKey, ClaimedKeys, true);
|
||||||
HighlightState.ClearFilter(HighlightSource.AllaganTools);
|
HighlightState.ClearFilter(HighlightSource.BiSBuddy);
|
||||||
}
|
}
|
||||||
else
|
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)
|
public IReadOnlyList<CategorizedInventory> GetCategories(string filter = "", bool invert = false)
|
||||||
=> InventoryFilter.FilterCategories(AllCategories, BucketsByKey, FilteredCategories, filter, invert);
|
=> InventoryFilter.FilterCategories(AllCategories, BucketsByKey, FilteredCategories, filter, invert);
|
||||||
|
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ public sealed class CategoryGeneralConfigurationNode : TabbedVerticalListNode
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
AddNode(bisBuddyEnabled);
|
AddNode(bisBuddyEnabled);
|
||||||
AddNode(bbModeDropdown);
|
AddNode(1, bbModeDropdown);
|
||||||
|
|
||||||
bool allaganReady = System.IPC.AllaganTools?.IsReady ?? false;
|
bool allaganReady = System.IPC.AllaganTools?.IsReady ?? false;
|
||||||
|
|
||||||
@@ -162,8 +162,7 @@ public sealed class CategoryGeneralConfigurationNode : TabbedVerticalListNode
|
|||||||
};
|
};
|
||||||
AddNode(_allaganToolsCheckbox);
|
AddNode(_allaganToolsCheckbox);
|
||||||
|
|
||||||
AddTab(1);
|
AddNode(1, atModeDropdown);
|
||||||
AddNode(atModeDropdown);
|
|
||||||
SubtractTab(1);
|
SubtractTab(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
Submodule KamiToolKit updated: 1d838e8bfa...5886600a04
Reference in New Issue
Block a user