private void RecreateItemToggles() { ToggleBag.RemoveChildren(); var itemKeys = ItemDataManager.Categories[ActiveCategory]; foreach (var itemKey in itemKeys) { var item = ItemDataManager.GetItem(itemKey); var toggle = ToggleBag.AddChild(new ItemToggle(TooltipManager, item, ChestData.Accepts(itemKey))); toggle.OnToggle += () => ToggleItem(itemKey); } }
private void RecreateItemToggles() { ToggleBag.RemoveChildren(); var itemKeys = ItemDataManager.Categories[ActiveCategory] .OrderBy(p => ItemDataManager.GetItem(p).DisplayName) .Skip(Row * MaxItemColumns) .Take(MaxItemsPage).ToList(); foreach (var itemKey in itemKeys) { var item = ItemDataManager.GetItem(itemKey); var toggle = ToggleBag.AddChild(new ItemToggle(TooltipManager, item, ChestData.Accepts(itemKey))); toggle.OnToggle += () => ToggleItem(itemKey); } }