Пример #1
0
        public OverlayHider(TinyIoCContainer container)
        {
            this.config     = container.Resolve <IPluginConfig>();
            this.logger     = container.Resolve <ILogger>();
            this.main       = container.Resolve <PluginMain>();
            this.repository = container.Resolve <FFXIVRepository>();

            container.Resolve <NativeMethods>().ActiveWindowChanged   += ActiveWindowChangedHandler;
            container.Resolve <NetworkParser>().OnOnlineStatusChanged += OnlineStatusChanged;
            container.Resolve <EventSources.EnmityEventSource>().CombatStatusChanged += CombatStatusChanged;

            try
            {
                repository.RegisterProcessChangedHandler(UpdateFFXIVProcess);
            } catch (Exception ex)
            {
                logger.Log(LogLevel.Error, "Failed to register process watcher for FFXIV; this is only an issue if you're playing FFXIV. As a consequence, OverlayPlugin won't be able to hide overlays if you're not in-game.");
                logger.Log(LogLevel.Error, "Details: " + ex.ToString());
            }

            focusTimer          = new Timer();
            focusTimer.Tick    += (o, e) => ActiveWindowChangedHandler(this, IntPtr.Zero);
            focusTimer.Interval = 10000;  // 10 seconds
            focusTimer.Start();
        }
Пример #2
0
        public OverlayHider(TinyIoCContainer container)
        {
            this.config     = container.Resolve <IPluginConfig>();
            this.logger     = container.Resolve <ILogger>();
            this.main       = container.Resolve <PluginMain>();
            this.repository = container.Resolve <FFXIVRepository>();

            container.Resolve <NativeMethods>().ActiveWindowChanged   += ActiveWindowChangedHandler;
            container.Resolve <NetworkParser>().OnOnlineStatusChanged += OnlineStatusChanged;
            repository.RegisterProcessChangedHandler(UpdateFFXIVProcess);

            focusTimer          = new Timer();
            focusTimer.Tick    += (o, e) => ActiveWindowChangedHandler(this, IntPtr.Zero);
            focusTimer.Interval = 10000;  // 10 seconds
            focusTimer.Start();
        }