コード例 #1
0
        private void OnEquippedMainHandIDChanged(object sender, ValueChangedEventArgs <int> e)
        {
            this.NotifyPropertyChanged(() => this.IsOverlayVisible);
            this.NotifyPropertyChanged(() => this.IsMainHandVisible);
            this.NotifyPropertyChanged(() => this.IsSeparatorVisible);
            this.NotifyPropertyChanged(() => this.ClassSymbolUri);

            FFXIVItemSet itemSet = this.glass.ReadItemSet();

            if (itemSet.Weapon.IsNovusWeapon || itemSet.Shield.IsNovusWeapon)
            {
                this.ignoreNextMainHandAdditionCount = 1;
            }
            else if (itemSet.Weapon.IsZodiacWeapon)
            {
                this.ignoreNextMainHandAdditionCount = 2;
            }
        }
コード例 #2
0
        private void OnHelpFindOverlayButtonClicked()
        {
            const string msgCaption = "You can't find the overlay?";

            IOverlay overlay = this.overlays.FirstOrDefault(o => o.Process.MainWindowTitle == "FINAL FANTASY XIV");

            this.log.Write(LogLevel.Info, string.Format("MainWindowTitle: {0}", overlay.Process.MainWindowTitle));

            if (overlay != null)
            {
                FFXIVItemSet itemSet = overlay.MemoryReader.ReadItemSet();

                if (itemSet.Weapon != FFXIVWeapon.None)
                {
                    if (overlay.IsVisable)
                    {
                        if (MessageBox.Show(string.Format("You should see the overlay at the following position.\r\n X: {0} Y: {1}\r\nShould I highlight the overlay for a few seconds?", overlay.Position.X, overlay.Position.Y), msgCaption, MessageBoxButton.YesNo, MessageBoxImage.Information) == MessageBoxResult.Yes)
                        {
                            overlay.Highlight(10);
                        }

                        // activate the game window
                        Native.NativeMethods.SetForegroundWindow(overlay.Process.MainWindowHandle);
                    }
                    else
                    {
                        MessageBox.Show(string.Format("You have not equipped a supported weapon.\r\n Weapon: {0}, Shield: {1}", itemSet.Weapon.ID, itemSet.Shield.ID), msgCaption, MessageBoxButton.OK, MessageBoxImage.Warning);
                    }
                }
                else
                {
                    MessageBox.Show(string.Format("Can't find the equipped items. You're not logged on or the memory addresses has change({0},{1}).", Process.GetProcessesByName(App.XIVProcessName).Length.ToString(), Process.GetProcessesByName(App.XIV_DX11_ProcessName).Length.ToString()), msgCaption, MessageBoxButton.OK, MessageBoxImage.Warning);
                }
            }
            else if (Process.GetProcessesByName(App.XIVProcessName).Any() || Process.GetProcessesByName(App.XIV_DX11_ProcessName).Any())
            {
                MessageBox.Show("The overlay was never created. It looks like a bug. Please look into the logs to get more details.", msgCaption, MessageBoxButton.OK, MessageBoxImage.Warning);
            }
            else
            {
                MessageBox.Show("There is no FFXIV running. Start the game and try again.", msgCaption, MessageBoxButton.OK, MessageBoxImage.Warning);
            }
        }
コード例 #3
0
        private void OnCurrentMahatmaChangeChanged(object sender, ValueChangedEventArgs <int> e)
        {
            this.NotifyPropertyChanged(() => this.EquippedMainHandLightAmount);

            if (this.ignoreNextMainHandAdditionCount-- <= 0)
            {
                if (this.glass != null)
                {
                    FFXIVItemSet itemSet = this.glass.ReadItemSet();

                    if (Enum.IsDefined(typeof(FFXIVZodiacWeaponID), itemSet.Weapon.ID) && e.NewValue > e.OldValue)
                    {
                        this.MainHandAddition = e.NewValue - e.OldValue;

                        Task.Factory.StartNew(() =>
                        {
                            Thread.Sleep(AdditionLifeTime);
                            this.MainHandAddition = 0;
                        });
                    }
                }
            }
        }