Ejemplo n.º 1
0
        private void CreateOverlay(Process process)
        {
            this.log.Write(LogLevel.Trace, string.Format("Creating overlay for process {0}.", process.Id));

            try
            {
                IOverlay overlay = new OverlayWindow(process);

                process.EnableRaisingEvents = true;
                process.Exited += this.OnProcessExited;

                overlay.Pinned = Settings.Default.OverlayPinned;
                overlay.Position = Settings.Default.OverlayPosition;
                overlay.PositionChanged += this.OnOverlayRelativePositionChangedChanged;

                overlay.DisplayMode = (OverlayDisplayMode)Settings.Default.OverlayDisplayMode;
                overlay.MemoryReader = new FFXIVMemoryReader(process, this.currentMemoryMap);

                overlay.DisplayModeChanged += this.OnOverlayDisplayModeChanged;

                overlay.Show();

                this.overlays.Add(overlay);

                this.CheckGameWindowMode(process);
            }
            catch (Win32Exception ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                this.log.WriteException("Creating overlay failed.", ex);
            }
        }
Ejemplo n.º 2
0
        private void CreateOverlay(Process process)
        {
            this.log.Write(LogLevel.Trace, string.Format("Creating overlay for process {0}.", process.Id));

            try
            {
                IOverlay overlay = new OverlayWindow(process);

                process.EnableRaisingEvents = true;
                process.Exited += this.OnProcessExited;

                if (Settings.Default.OverlayPinned && Environment.Version < CLRRuntimeVersionRequiredToUsePinnedMode && !Settings.Default.WarnedAboutOverlayPinningNotWorkingWithCurrentRuntimeVersion)
                {
                    MessageBox.Show(
                        "You have installed a version of the Microsoft .NET Framework older than version 4.6.\r\nOverlay pinning is the recommended way but only supported for the .NET Framework 4.6 or newer.\r\nThe pinning will be disabled.\r\nPlease install Microsoft .NET Framework 4.6 (https://goo.gl/3uP54q) and reconfigure this option to use the overlay in the recommended way.",
                        "Overlay pining not supported",
                        MessageBoxButton.OK,
                        MessageBoxImage.Warning);

                    Settings.Default.OverlayPinned = false;
                    Settings.Default.WarnedAboutOverlayPinningNotWorkingWithCurrentRuntimeVersion = true;
                    Settings.Default.Save();
                }

                overlay.Pinned = Settings.Default.OverlayPinned;
                overlay.Position = Settings.Default.OverlayPosition;
                overlay.PositionChanged += this.OnOverlayRelativePositionChangedChanged;

                overlay.DisplayMode = (OverlayDisplayMode)Settings.Default.OverlayDisplayMode;
                overlay.MemoryReader = new FFXIVMemoryReader(process, this.currentMemoryMap);

                overlay.DisplayModeChanged += this.OnOverlayDisplayModeChanged;

                overlay.Show();

                this.overlays.Add(overlay);

                this.CheckGameWindowMode(process);
            }
            catch (Win32Exception ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                this.log.WriteException("Creating overlay failed.", ex);
            }
        }