Example #1
0
 private int getLastUnfilledByType(MysteryGift Gift, MysteryGiftAlbum Album)
 {
     for (int i = 0; i < Album.Gifts.Length; i++)
     {
         if (!Album.Gifts[i].Empty)
             continue;
         if (Album.Gifts[i].Type != Gift.Type)
             continue;
         return i;
     }
     return -1;
 }
Example #2
0
        public SAV_Wondercard(MysteryGift g = null)
        {
            InitializeComponent();
            Util.TranslateInterface(this, Main.curlanguage);
            mga = Main.SAV.GiftAlbum;

            switch (SAV.Generation)
            {
                case 4:
                    pba = popG4Gifts().ToArray();
                    break;
                case 5:
                case 6:
                case 7:
                    pba = popG567Gifts().ToArray();
                    break;
                default:
                    throw new ArgumentException("Game not supported.");
            }

            foreach (PictureBox pb in pba)
            {
                pb.AllowDrop = true;
                pb.DragDrop += pbBoxSlot_DragDrop;
                pb.DragEnter += pbBoxSlot_DragEnter;
                pb.MouseDown += pbBoxSlot_MouseDown;
                pb.ContextMenuStrip = mnuVSD;
            }

            setGiftBoxes();
            getReceivedFlags();

            if (LB_Received.Items.Count > 0)
                LB_Received.SelectedIndex = 0;

            DragEnter += tabMain_DragEnter;
            DragDrop += tabMain_DragDrop;

            if (g == null)
                clickView(pba[0], null);
            else
                viewGiftData(g);
        }
Example #3
0
 private int getLastUnfilledByType(MysteryGift Gift, MysteryGiftAlbum Album)
 {
     for (int i = 0; i < Album.Gifts.Length; i++)
     {
         if (!Album.Gifts[i].Empty)
             continue;
         if (Album.Gifts[i].Type != Gift.Type)
             continue;
         return i;
     }
     return -1;
 }