Exemple #1
0
        public void Start(PictureBox pb, SlotTrackerImage lastSlot)
        {
            var view = WinFormsUtil.FindFirstControlOfType <ISlotViewer <PictureBox> >(pb);

            if (view == null)
            {
                throw new ArgumentNullException(nameof(view));
            }
            var data = view.GetSlotData(pb);
            var pk   = data.Read(view.SAV);

            Slot     = pb;
            LastSlot = lastSlot;

            var orig = LastSlot.OriginalBackground = pb.BackgroundImage;

            Bitmap bg;

            if (GlowHover)
            {
                HoverWorker.Stop();
                var hover = Hover;
                SpriteUtil.GetSpriteGlow(pk, Draw.GlowInitial.B, Draw.GlowInitial.G, Draw.GlowInitial.R, out var glowdata, out var GlowBase);
                bg = ImageUtil.LayerImage(GlowBase, hover, 0, 0);
                HoverWorker.GlowToColor   = Draw.GlowFinal;
                HoverWorker.GlowFromColor = Draw.GlowInitial;
                HoverWorker.Start(pb, GlowBase, glowdata, orig, hover);
            }
            else
            {
                bg = Hover;
            }

            if (orig != null)
            {
                bg = ImageUtil.LayerImage(orig, bg, 0, 0);
            }
            pb.BackgroundImage = LastSlot.CurrentBackground = bg;

            if (Settings.Default.HoverSlotShowText)
            {
                Preview.Show(pb, pk);
            }
            if (Settings.Default.HoverSlotPlayCry)
            {
                CryPlayer.PlayCry(pk);
            }
        }
Exemple #2
0
        private void BeginHoverSlot(PictureBox pb)
        {
            var view = WinFormsUtil.FindFirstControlOfType <ISlotViewer <PictureBox> >(pb);
            var data = view.GetSlotData(pb);
            var pk   = SAV.GetStoredSlot(data.Offset);

            HoveredSlot = pb;

            OriginalBackground = pb.BackgroundImage;

            Bitmap hover;

            if (GlowHover)
            {
                HoverWorker?.Stop();

                var GlowBase = GetGlowSprite(pk);
                hover       = ImageUtil.LayerImage(GlowBase, Resources.slotHover, 0, 0);
                HoverWorker = new BitmapAnimator(GlowBase, Resources.slotHover)
                {
                    GlowFromColor = GlowInitial, GlowToColor = GlowFinal
                };
                HoverWorker.Start(pb, OriginalBackground);
            }
            else
            {
                hover = Resources.slotHover;
            }

            pb.BackgroundImage = CurrentBackground = OriginalBackground == null ? hover : ImageUtil.LayerImage(OriginalBackground, hover, 0, 0);

            if (Settings.Default.HoverSlotShowText)
            {
                ShowSimulatorSetTooltip(pb, pk);
            }
            if (Settings.Default.HoverSlotPlayCry)
            {
                PlayCry(pk);
            }
        }