예제 #1
0
    public void OnBeginDrag(PointerEventData eventData)
    {
        //selecetdItem = gameObject;
        startPosition = this.transform.position;
        startParent = transform.parent;
        GetComponent<CanvasGroup>().blocksRaycasts = false;

        shipSlot = transform.parent.GetComponent<ShipSlot>();
    }
예제 #2
0
        private void DrawSlotItem(Graphics g, ShipSlot slotItem, int x, int y)
        {
            var font8 = new Font(this.Font.FontFamily, 8);
            var item  = slotItem.Item;

            var sloticon = ImageAssets.GetSlotIconImage(item.Info.IconType);

            g.DrawImage(sloticon, new Rectangle(x + 4, y, 28, 28));

            if (item.Level > 0)
            {
                using (SolidBrush b = new SolidBrush(Color.FromArgb(0x40, 0x00, 0x00, 0x00)))
                    g.FillRectangle(b, new Rectangle(x, y + 16, 36, 12));

                TextRenderer.DrawText(
                    g,
                    item.LevelText,
                    font8,
                    new Rectangle(x, y + 16, 36, 12),
                    Color.White,
                    TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter
                    );
            }

            if (item.Proficiency > 0)
            {
                using (SolidBrush b = new SolidBrush(Color.FromArgb(0x60, 0x00, 0x00, 0x00)))
                    g.FillRectangle(b, new Rectangle(x + 36 - 12, y, 12, 12));

                var proficiency = ImageAssets.GetProficiencyImage(item.Proficiency);
                g.DrawImage(proficiency, new Rectangle(x + 36 - 11, y + 1, 10, 10));
            }

            var w = TextRenderer.MeasureText(slotItem.Current.ToString(), font8).Width;

            using (SolidBrush b = new SolidBrush(Color.FromArgb(0x60, 0x00, 0x00, 0x00)))
                g.FillRectangle(b, new Rectangle(x + 2, y, w - 1, 12));

            var currentColor = slotItem.Lost == 0 ? Color.White : Color.FromArgb(0xDD, 0x35, 0x35);

            if (!slotItem.IsAirplane)
            {
                currentColor = Color.FromArgb(
                    currentColor.R * 5 / 7,
                    currentColor.G * 5 / 7,
                    currentColor.B * 5 / 7
                    );
            }
            TextRenderer.DrawText(
                g,
                slotItem.Current.ToString(),
                font8,
                new Rectangle(x + 2, y, 36, 12),
                currentColor,
                TextFormatFlags.Left | TextFormatFlags.VerticalCenter
                );
        }
예제 #3
0
 public EquiptInfo(ShipSlot ss, int id = 0, int count = 0)
 {
     if (ss != null)
     {
         Id          = ss.Item.Id;
         EquiptId    = ss.Item.Info.Id;
         EquiptName  = ss.Item.Info.Name;
         Level       = ss.Item.Level;
         AsControl   = ss.Item.Info.IsAirSuperiorityFighter ? ss.Item.Info.AA : 0;
         EquiptCount = ss.Current;
     }
     else
     {
         Id          = EquiptId = id;
         AsControl   = Level = 0;
         EquiptCount = count;
         EquiptName  = id.ToString();
     }
 }
예제 #4
0
 public ShipSlotData(ShipSlot slot)
     : this(slot.Item?.Info, slot.Maximum, slot.Current)
 {
 }
예제 #5
0
 public ShipSlotData(ShipSlot slot) : this(slot.Item?.Info, slot.Maximum, slot.Current, slot.Item?.Level ?? 0, slot.Item?.Proficiency ?? 0)
 {
 }
 public SlotItemViewModel(ShipSlot item)
 {
     this.Slot = item;
     this.Info = Slot.Item.Info;
 }
예제 #7
0
 public bool Predicate(ShipSlot item) => this.Predicate(item.Item);
예제 #8
0
 public ShipSlotData(ShipSlot slot)
     : this(slot.Item != null ? slot.Item.Info : null, slot.Maximum, slot.Current)
 {
 }