Ejemplo n.º 1
0
        public override void OnInitialize()
        {
            this.SetPadding(0);

            this.Top.Pixels  = 18;
            this.Left.Pixels = 44;

            this.Width.Pixels  = this.Parent.Width.Pixels / 2 - 34;
            this.Height.Pixels = this.Parent.Height.Pixels - SoulIndexUIListPanel.height - 18 - this.Top.Pixels;

            soulSlots = new SoulIndexUISoulSlot[3];
            for (int i = 0; i < soulSlots.Length; ++i)
            {
                soulSlots[i] = new SoulIndexUISoulSlot
                {
                    soulType = (SoulType)i
                };

                soulSlots[i].Top.Pixels  = 19 + 30 * i;
                soulSlots[i].Left.Pixels = 10;

                soulSlots[i].Width.Pixels = this.Width.Pixels - 20;

                soulSlots[i].OnClick      += SoulSlotLeftClick;
                soulSlots[i].OnRightClick += SoulSlotRightClick;

                this.Append(soulSlots[i]);
            }
        }
Ejemplo n.º 2
0
        public void ReloadList()
        {
            this.Clear();

            SoulPlayer sp = Main.LocalPlayer.GetModPlayer <SoulPlayer>();

            foreach (short key in sp.UnlockedSouls.Keys)
            {
                if (!MysticHunter.Instance.SoulDict.TryGetValue(key, out BaseSoul value) || value.soulType != filter)
                {
                    continue;
                }

                SoulIndexUISoulSlot newSoulSlot = new SoulIndexUISoulSlot(value);

                newSoulSlot.Width.Pixels = this.Width.Pixels / 2 - 12;

                newSoulSlot.OnClick     += SetSoulSlot;
                newSoulSlot.OnMouseOver += SetDescriptionPanelContent;
                newSoulSlot.OnMouseOut  += ResetDescriptionPanelContent;
                this.Add(newSoulSlot);
            }
        }