protected override SlotItem GetSlot(int index) { CollectionInventory.Entry collectionEntryFromId = CollectionManager.GetCollectionEntryFromId(index); if (!collectionEntryFromId.IsValid) { return(null); } return(new SlotItem(index, collectionEntryFromId)); }
private void AssignCollectionId(int id, CollectionInventory.Entry entry) { Win32.SetRedraw(this, false); UndoManager.RecordUndo(); if (!entry.IsValid) { CollectionManager.ClearMaskId(id); } CollectionManager.AssignCollectionId(id, entry); UndoManager.CommitUndo(); this.UpdateList(); Win32.SetRedraw(this, true); this.Refresh(); }
private void UpdateList() { this.treeView.BeginUpdate(); this.treeView.Nodes.Clear(); this.imageList.Images.Clear(); for (int i = 0; i < 8; i++) { CollectionInventory.Entry collectionEntryFromId = CollectionManager.GetCollectionEntryFromId(i); string text; string text2; if (collectionEntryFromId.IsValid) { text = collectionEntryFromId.IconName; if (!this.imageList.Images.ContainsKey(text)) { this.imageList.Images.Add(text, collectionEntryFromId.Icon); } text2 = collectionEntryFromId.DisplayName; } else { text = "empty16"; if (!this.imageList.Images.ContainsKey(text)) { this.imageList.Images.Add(text, Resources.empty16); } text2 = Localizer.Localize("PARAM_EMPTY"); } CollectionTreeItem tag = new CollectionTreeItem(i, collectionEntryFromId); TreeNode treeNode = this.treeView.Nodes.Add(text2); treeNode.ImageKey = text; treeNode.SelectedImageKey = text; treeNode.Tag = tag; } this.UpdateSelection(); this.treeView.EndUpdate(); }
protected override void OnPaint(float dt, Vec2 pos) { base.OnPaint(dt, pos); int num; if (Control.ModifierKeys != Keys.Control) { num = this.m_paramCollection.Value; if (num == -1) { return; } CollectionInventory.Entry collectionEntryFromId = CollectionManager.GetCollectionEntryFromId(num); if (!collectionEntryFromId.IsValid) { return; } } else { num = CollectionManager.EmptyCollectionId; } CollectionManipulator.Paint(pos, num, this.m_brush); }