public void UpdateView(AllItemAttributes attributes) { if (ourContext != FFTPatch.Context) { ourContext = FFTPatch.Context; ClipBoardAttributes = null; offsetListBox.ContextMenu.MenuItems[1].Enabled = false; } offsetListBox.SelectedIndexChanged -= offsetListBox_SelectedIndexChanged; offsetListBox.DataSource = attributes.ItemAttributes; offsetListBox.SelectedIndexChanged += offsetListBox_SelectedIndexChanged; offsetListBox.SelectedIndex = 0; itemAttributeEditor.ItemAttributes = offsetListBox.SelectedItem as ItemAttributes; }
public void UpdateView(AllItems items, AllStoreInventories storeInventories, AllInflictStatuses inflictStatuses, AllItemAttributes itemAttributes, Context context) { ourContext = context; this.inflictStatuses = inflictStatuses; this.itemAttributes = itemAttributes; itemListBox.SelectedIndexChanged -= itemListBox_SelectedIndexChanged; itemListBox.DataSource = items.Items; itemListBox.SelectedIndexChanged += itemListBox_SelectedIndexChanged; itemListBox.SelectedIndex = 0; itemEditor.BuildItemNameLists(context); itemEditor.StoreInventories = storeInventories; //itemEditor.Item = itemListBox.SelectedItem as Item; itemEditor.SetItem(itemListBox.SelectedItem as Item, context); itemListBox.SetChangedColors(); }
public void UpdateView(AllItemAttributes attributes, Context context) { if (ourContext != context) { ourContext = context; ClipBoardAttributes = null; offsetListBox.ContextMenu.MenuItems[1].Enabled = false; } offsetListBox.SelectedIndexChanged -= offsetListBox_SelectedIndexChanged; offsetListBox.DataSource = attributes.ItemAttributes; offsetListBox.SelectedIndexChanged += offsetListBox_SelectedIndexChanged; offsetListBox.SelectedIndex = 0; PatchUtility.CheckDuplicates <ItemAttributes>(attributes.ItemAttributes); offsetListBox.SetChangedColors <ItemAttributes>(); //itemAttributeEditor.ItemAttributes = offsetListBox.SelectedItem as ItemAttributes; itemAttributeEditor.SetItemAttributes(offsetListBox.SelectedItem as ItemAttributes, context); }
public static void RepointItemAttributes(AllItems items, AllItemAttributes allItemAttributes) { Dictionary <int, int> repointMap = GetRepointMap <ItemAttributes>(allItemAttributes.ItemAttributes); for (int itemIndex = 0; itemIndex < items.Items.Count; itemIndex++) { Item item = items.Items[itemIndex]; int newID = 0; if (repointMap.TryGetValue((int)item.SIA, out newID)) { item.SIA = (byte)newID; item.OldSIA = (byte)newID; allItemAttributes.ItemAttributes[newID].ReferencingItemIndexes.Add(itemIndex); } } foreach (int index in repointMap.Keys) { allItemAttributes.ItemAttributes[index].ReferencingItemIndexes.Clear(); } }