public void ApplyToItem(Item item) { baseItemSelector.ApplyToItem(item); if (radBuried.Checked) { itemConvertor.ApplyPresentation(item, PresentationType.Buried); ApplyStackSize(item); } else if (radDropped.Checked) { itemConvertor.ApplyPresentation(item, PresentationType.Dropped); ApplyStackSize(item); } else if (radHung.Checked) { itemConvertor.ApplyPresentation(item, PresentationType.Hung); directionSelector.ApplyToItem(item); } else if (radRecipe.Checked) { itemConvertor.ApplyPresentation(item, PresentationType.Recipe); } else { directionSelector.ApplyToItem(item); } }
public DiySegmentLayout(ItemConvertor itemConvertor, Item rawItem) { this.itemConvertor = itemConvertor; this.item = new Item(); item.CopyFrom(rawItem); itemConvertor.ApplyPresentation(item, PresentationType.Recipe); }
public DisplaySegmentLayout(ItemConvertor itemConvertor, Item rawItem, DisplaySegmentLayoutOptions options) { this.options = options; itemInfo = itemConvertor.FromItemId(itemConvertor.GetItemId(rawItem)); ushort displayItemId; if (this.itemInfo.Kind == ItemKind.Kind_Fish || this.itemInfo.Kind == ItemKind.Kind_Insect) { ushort modelId = itemConvertor.GetCreatureModel(itemInfo.ItemId); switch (options.CreatureDisplayStyle) { case CreatureDisplayStyle.AsModel: displayItemId = modelId; break; case CreatureDisplayStyle.InTank: displayItemId = itemInfo.ItemId; break; default: throw new Exception("Unsupported creature display type"); } if (options.CreatureDropStyle.HasFlag(CreatureDropStyle.Creature)) { droppedItems.Add(itemConvertor.ApplyPresentation(new Item(itemInfo.ItemId), PresentationType.Dropped)); } if (options.CreatureDropStyle.HasFlag(CreatureDropStyle.Model)) { droppedItems.Add(itemConvertor.ApplyPresentation(new Item(modelId), PresentationType.Dropped)); } } else { var item = new Item(); item.CopyFrom(rawItem); if (!itemInfo.HasVariants) { item.Count = (ushort)(itemInfo.MaxStackSize - 1); } droppedItems.Add(itemConvertor.ApplyPresentation(item, PresentationType.Dropped)); } placedItem = new Item(); placedItem.CopyFrom(rawItem); itemConvertor.ApplyPresentation(placedItem, PresentationType.Hung, PresentationType.Placed, PresentationType.Dropped); placedItemSize = placedItem.GetSize(); if (itemInfo.CanRecipe) { recipeItem = new Item(); recipeItem.CopyFrom(rawItem); itemConvertor.ApplyPresentation(recipeItem, PresentationType.Recipe, PresentationType.Dropped); recipeItemSize = recipeItem.GetSize(); } else { recipeItem = null; recipeItemSize = Size.Empty; } }