public new void Show() { base.Show(); Width = _pSettings.Width; Height = _pSettings.Height; Left = _pSettings.Left; Top = _pSettings.Top; Topmost = true; IsClosed = false; Handle = new WindowInteropHelper(this).Handle; Various.SetWindowStyle(new WindowInteropHelper(this).Handle, PredefinedTypes.CustomWindowStyles.NotClickable); TransformImage(); }
void _tmrMainTick_Tick(object sender, EventArgs e) { try { if (!Refresh()) { Opacity = 0.3; cnvMiddle.Visibility = Visibility.Hidden; } else { Opacity = 1; cnvMiddle.Visibility = Visibility.Visible; } if (Gameinfo == null || Various.HotkeysPressed(_pSettings.HomeKey) || !Gameinfo.IsIngame || _bMouseDown) { if (Various.HotkeysPressed(_pSettings.HomeKey) || _bMouseDown) { brdCanvasBorder.BorderThickness = new Thickness(4, 4, 4, 4); brdCanvasBorder.BorderBrush = new SolidColorBrush(Colors.YellowGreen); Opacity = Constants.MaximalOpacity; } btnSettings.Visibility = Visibility.Visible; Various.SetWindowStyle(Handle, PredefinedTypes.CustomWindowStyles.Clickable); } else { Various.SetWindowStyle(Handle, PredefinedTypes.CustomWindowStyles.NotClickable); brdCanvasBorder.BorderThickness = new Thickness(0, 0, 0, 0); btnSettings.Visibility = Visibility.Hidden; } if (Gameinfo != null) { if (!Gameinfo.IsIngame) { _iTimerSum = 0; _iTimerEnd = 0; _iTimerBegin = 0; } if (Opacity >= 1) { if (!_bWorkerOverlayIsActive) { _iTimerBegin = Gameinfo.Timer; _bWorkerOverlayIsActive = true; } else { _iTimerEnd = Gameinfo.Timer; } } else { if (_bWorkerOverlayIsActive) { _iTimerEnd = Gameinfo.Timer; _bWorkerOverlayIsActive = false; _iTimerSum += _iTimerEnd - _iTimerBegin; } } var strText = ((_iTimerEnd - _iTimerBegin) / 60) + ":" + (_iTimerEnd - _iTimerBegin) % 60; var iNewSum = _iTimerSum + (_iTimerEnd - _iTimerBegin); var strTextSum = iNewSum / 60 + ":" + iNewSum % 60; txtTimerSum.Text = strText + " [" + strTextSum + "]"; } } catch (Exception ex) { throw new Exception("If you see this: copy the message and send it to me!", ex); } }