public void HandleMovePKM(PictureBox pb, bool encrypt) { // Create a temporary PKM file to perform a drag drop operation. // Set flag to prevent re-entering. DragInfo.DragDropInProgress = true; // Prepare Data DragInfo.Source = GetViewParent(pb).GetSlotData(pb); DragInfo.Source.PKM = SAV.GetStoredSlot(DragInfo.Source.Offset); // Make a new file name based off the PID string newfile = CreateDragDropPKM(pb, encrypt, out bool external); DragInfo.Reset(); SetCursor(SE.GetDefaultCursor, pb); // Browser apps need time to load data since the file isn't moved to a location on the user's local storage. // Tested 10ms -> too quick, 100ms was fine. 500ms should be safe? // Keep it to 10 seconds; Discord upload only stores the file path until you click Upload. int delay = external ? 10_000 : 0; DeleteAsync(newfile, delay); if (DragInfo.Source.IsParty || DragInfo.Destination.IsParty) { SE.SetParty(); } }
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; if (Settings.Default.HoverSlotShowText) { ShowSimulatorSetTooltip(pb, pk); } if (Settings.Default.HoverSlotPlayCry) { PlayCry(pk); } }
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); } }