protected override void OnAssignSlot(int id, Inventory.Entry entry) { base.OnAssignSlot(id, entry); if (entry == null || !entry.IsValid) { CollectionManager.ClearMaskId(id); CollectionManager.AssignCollectionId(id, CollectionInventory.Entry.Null); return; } CollectionManager.AssignCollectionId(id, (CollectionInventory.Entry)entry); }
protected override void OnAssignSlot(int id, Inventory.Entry entry) { base.OnAssignSlot(id, entry); if (entry == null || !entry.IsValid) { TerrainManager.ClearTextureId(id); TerrainManager.AssignTextureId(id, TextureInventory.Entry.Null); return; } TerrainManager.AssignTextureId(id, (TextureInventory.Entry)entry); }
protected override void OnAssignSlot(int id, Inventory.Entry entry) { base.OnAssignSlot(id, entry); if (entry == null || !entry.IsValid) { SplineManager.DestroyRoad(id); return; } SplineRoad splineRoad = SplineManager.GetRoadFromId(id); if (!splineRoad.IsValid) { splineRoad = SplineManager.CreateRoad(id); } SplineInventory.Entry entry2 = (SplineInventory.Entry)entry; splineRoad.Entry = entry2; splineRoad.Width = entry2.DefaultWidth; splineRoad.UpdateSpline(); }
private void AssignSlot(int id, Inventory.Entry entry) { Win32.SetRedraw(this, false); UndoManager.RecordUndo(); this.OnAssignSlot(id, entry); UndoManager.CommitUndo(); if (entry != null) { this.OnValueChanged(id); } else { this.OnValueChanged(-1); } this.UpdateList(); Win32.SetRedraw(this, true); this.Refresh(); }
public void SetChildIndex(Inventory.Entry child, int index) { Binding.FCE_Inventory_Entry_SetChildIndex(this.m_entryPtr, child.Pointer, index); }
private void FillCategories(Inventory.Entry entry, IndentedComboBox.Item item) { if (!entry.IsDirectory) { return; } if (entry.Deleted) { return; } IndentedComboBox.Item item2 = new IndentedComboBox.Item(); item2.Tag = entry; item2.Text = entry.DisplayName; item2.Image = entry.Icon; item.Add(item2); int num = 0; Inventory.Entry[] children = entry.Children; for (int i = 0; i < children.Length; i++) { Inventory.Entry entry2 = children[i]; if (entry2.IsDirectory) { this.FillCategories(entry2, item2); } else { num++; } } if (num > 0) { item2.SubText = "(" + num + ")"; } }
private void FillNodes(Inventory.Entry root, TreeNodeCollection nodes) { Inventory.Entry[] children = root.Children; for (int i = 0; i < children.Length; i++) { Inventory.Entry entry = children[i]; if ((!this.m_onlyDirectories || entry.IsDirectory) && !entry.Deleted) { TreeNode treeNode = this.CreateNode(entry); nodes.Add(treeNode); this.FillNodes(entry, treeNode.Nodes); } } }
public void RemoveEntry(Inventory.Entry entry) { TreeNode treeNode; this.m_nodes.TryGetValue(entry, out treeNode); if (treeNode == null) { return; } Inventory.Entry[] children = entry.Children; for (int i = 0; i < children.Length; i++) { Inventory.Entry entry2 = children[i]; this.RemoveEntry(entry2); } treeNode.Remove(); this.m_nodes.Remove(entry); }
public CollectionTreeItem(int id, Inventory.Entry entry) { this.m_id = id; this.m_entry = entry; }
private ListViewItem CreateItem(Inventory.Entry entry) { if (entry.Deleted) { return null; } ListViewItem listViewItem = new ListViewItem(entry.DisplayName); this.m_listItems[entry] = listViewItem; listViewItem.Tag = entry; base.Items.Add(listViewItem); return listViewItem; }
public void RemoveEntry(Inventory.Entry entry) { ListViewItem listViewItem; this.m_listItems.TryGetValue(entry, out listViewItem); if (listViewItem == null) { return; } listViewItem.Remove(); }
public ListViewItem FindEntry(Inventory.Entry entry) { ListViewItem result; this.m_listItems.TryGetValue(entry, out result); return result; }
public void AddEntry(Inventory.Entry entry) { ListViewItem listViewItem; this.m_listItems.TryGetValue(entry, out listViewItem); if (listViewItem == null) { listViewItem = this.CreateItem(entry); if (listViewItem == null) { return; } } base.SelectedItems.Clear(); if (listViewItem != null) { listViewItem.Selected = true; } }
protected virtual void DestroyFilterDirectory(Inventory.Entry entry) { }
public virtual void SearchInventory(string criteria, Inventory.Entry resultEntry) { }
public override void SearchInventory(string criteria, Inventory.Entry resultEntry) { Binding.FCE_Inventory_Object_SearchInventoryEntry(this.Root.Pointer, criteria, resultEntry.Pointer); }
protected override void DestroyFilterDirectory(Inventory.Entry entry) { Binding.FCE_Inventory_Object_DestroyFilterDirectory(entry.Pointer); }
public TextureTreeItem(int id, Inventory.Entry entry) { this.m_id = id; this.m_entry = entry; }
public void AddEntry(Inventory.Entry entry) { if (this.OnlyDirectories && !entry.IsDirectory) { return; } TreeNode treeNode; this.m_nodes.TryGetValue(entry.Parent, out treeNode); if (treeNode == null) { return; } TreeNode treeNode2 = this.CreateNode(entry); int num = -1; Inventory.Entry[] children = entry.Parent.Children; for (int i = 0; i < children.Length; i++) { Inventory.Entry entry2 = children[i]; if (entry2 == entry) { break; } TreeNode treeNode3; this.m_nodes.TryGetValue(entry2, out treeNode3); if (treeNode3 != null && treeNode3.Parent == treeNode) { num = treeNode3.Index + 1; } } if (num == -1) { treeNode.Nodes.Add(treeNode2); } else { treeNode.Nodes.Insert(num, treeNode2); } this.FillNodes(entry, treeNode2.Nodes); this.Value = entry; }
private bool IsNotRootEntry(Inventory.Entry entry) { return this.IsValidEntry(entry) && entry != ObjectInventory.Instance.Root; }
private TreeNode CreateNode(Inventory.Entry entry) { TreeNode treeNode = new TreeNode(); treeNode.Text = entry.DisplayName; treeNode.Tag = entry; string iconName = entry.IconName; if (!this.imageList.Images.ContainsKey(iconName)) { this.imageList.Images.Add(iconName, entry.Icon); } treeNode.ImageKey = iconName; treeNode.SelectedImageKey = iconName; this.m_nodes.Add(entry, treeNode); return treeNode; }
private bool IsValidEntry(Inventory.Entry entry) { return entry != null && entry.IsValid; }
private IndentedComboBox.Item FindCategory(Inventory.Entry entry) { foreach (IndentedComboBox.Item current in this.categoryComboBox.GetItems()) { Inventory.Entry entry2 = (Inventory.Entry)current.Tag; if (entry2.Pointer == entry.Pointer) { return current; } } return null; }
public SlotItem(int id, Inventory.Entry entry) { this.m_id = id; this.m_entry = entry; }
protected virtual void OnAssignSlot(int id, Inventory.Entry entry) { }
public void AddChild(Inventory.Entry child) { Binding.FCE_Inventory_Entry_AddChild(this.Pointer, child.Pointer); }