Exemplo n.º 1
0
        public void DeleteMemoryEchoes(Collections.NgbhItems items, uint ownerID)
        {
            int deletedCount       = 0;
            ExceptionBuilder trace = new ExceptionBuilder();

            trace.Append("Memories found:" + Helper.lbr);

            Collections.NgbhSlots slots = this.GetSlots(Data.NeighborhoodSlots.Sims);
            foreach (NgbhSlot slot in slots)
            {
                // skip my own memories?
                if (ownerID == slot.SlotID)
                {
                    continue;
                }

                SDesc simDesc = FileTable.ProviderRegistry.SimDescriptionProvider.SimInstance[(ushort)slot.SlotID] as SDesc;
                Collections.NgbhItems simMemories = slot.ItemsB;

                Collections.NgbhItems memoryToRemove = new SimPe.Plugin.Collections.NgbhItems(null);
                for (int j = 0; j < simMemories.Length; j++)
                {
                    for (int i = 0; i < items.Length; i++)
                    {
                        NgbhItem item      = items[i];
                        NgbhItem simMemory = simMemories[j];

                        if (
                            simMemory.IsMemory && item.IsMemory &&
                            simMemory.Guid == item.Guid &&
                            ArrayEquals(simMemory.Data, item.Data) &&
                            !simMemory.Flags.IsVisible
                            )
                        {
                            memoryToRemove.Add(simMemory);                             // simMemory.RemoveFromParentB();
                        }
                    }
                }

                if (memoryToRemove.Count > 0)
                {
                    deletedCount += memoryToRemove.Count;
                    trace.AppendFormat("{0} {1}: {2} \r\n", simDesc.SimName, simDesc.SimFamilyName, memoryToRemove.Count);
                    foreach (NgbhItem item in memoryToRemove)
                    {
                        trace.AppendFormat("\t- {0}\r\n", item.ToString());
                    }
                    trace.Append("\t\r\n\r\n");
                    slot.ItemsB.Remove(memoryToRemove);
                }
            }

            if (deletedCount > 0)
            {
                Message.Show(String.Format("Deleted {0} memories from the sim pool", deletedCount) + Helper.lbr + Helper.lbr + trace.ToString());
            }
        }
Exemplo n.º 2
0
        internal void Update()
        {
            this.Text = item.ToString();
            if (!item.Flags.IsVisible)
            {
                this.ForeColor = Color.SteelBlue;
            }
            if (item.Flags.IsControler)
            {
                this.ForeColor = Color.Gray;
            }
            if (item.IsInventory)
            {
                this.ForeColor = Color.MediumSeaGreen;
            }
            if (item.IsGossip)
            {
                this.Font = new Font(this.Font.FontFamily, this.Font.Size, FontStyle.Italic, this.Font.Unit);
            }

            if (parent.SmallImageList != null)
            {
                Image i = item.Icon;
                if (i != null)
                {
                    if (this.ImageIndex >= 0)
                    {
                        parent.SmallImageList.Images[this.ImageIndex] = i;
                    }
                    else
                    {
                        parent.SmallImageList.Images.Add(i);
                        this.ImageIndex = parent.SmallImageList.Images.Count - 1;
                    }
                }
            }
        }