Exemplo n.º 1
0
        public void CloseInstrument()
        {
            if (hostProcess)
            {
                if (Sharlayan.MemoryHandler.Instance.IsAttached)
                {
                    if (Sharlayan.Reader.CanGetPerformance())
                    {
                        if (!Sharlayan.Reader.GetPerformance().IsUp())
                        {
                            return;
                        }
                    }
                }
            }

            if (!performanceUp)
            {
                return;
            }

            hook.ClearLastPerformanceKeybinds();

            FFXIVKeybindDat.Keybind keybind = hotkeys["ESC"];
            Console.WriteLine(keybind.ToString());
            if (keybind is FFXIVKeybindDat.Keybind && keybind.GetKey() != Keys.None)
            {
                hook.SendSyncKeybind(keybind);
                performanceUp = false;
            }
        }
 public void EnsembleAccept()
 {
     FFXIVKeybindDat.Keybind keybind = hotkeys["OK"];
     if (keybind is FFXIVKeybindDat.Keybind && keybind.GetKey() != Keys.None)
     {
         hook.SendSyncKeybind(keybind);
         hook.SendSyncKeybind(keybind);
     }
 }
        public void OpenInstrument()
        {
            // Exert the effort to check memory i guess
            if (hostProcess)
            {
                return;
            }

            if (performanceUp)
            {
                return;
            }

            // don't open instrument if we don't have anything loaded
            if (sequencer == null || sequencer.Sequence == null)
            {
                return;
            }

            // don't open instrument if we're not on a valid track
            if (TrackNum == 0 || TrackNum >= sequencer.Sequence.Count)
            {
                return;
            }

            string keyMap = hotbar.GetInstrumentKeyMap(chosenInstrument);

            if (!string.IsNullOrEmpty(keyMap))
            {
                FFXIVKeybindDat.Keybind keybind = hotkeys[keyMap];
                if (keybind is FFXIVKeybindDat.Keybind && keybind.GetKey() != Keys.None)
                {
                    hook.SendTimedSyncKeybind(keybind);
                    openDelay = true;

                    Timer openTimer = new Timer {
                        Interval = 1000
                    };
                    openTimer.Elapsed += delegate(object o, ElapsedEventArgs e) {
                        openTimer.Stop();
                        openTimer = null;

                        openDelay = false;
                    };
                    openTimer.Start();

                    performanceUp = true;
                }
            }
        }
Exemplo n.º 4
0
        public void OpenInstrument()
        {
            // Exert the effort to check memory i guess
            if (hostProcess)
            {
                if (Sharlayan.MemoryHandler.Instance.IsAttached)
                {
                    if (Sharlayan.Reader.CanGetPerformance())
                    {
                        if (Sharlayan.Reader.GetPerformance().IsUp())
                        {
                            return;
                        }
                    }
                }
            }

            if (performanceUp)
            {
                return;
            }

            string keyMap = hotbar.GetInstrumentKeyMap(chosenInstrument);

            if (!string.IsNullOrEmpty(keyMap))
            {
                FFXIVKeybindDat.Keybind keybind = hotkeys[keyMap];
                if (keybind is FFXIVKeybindDat.Keybind && keybind.GetKey() != Keys.None)
                {
                    hook.SendSyncKeybind(keybind);
                    openDelay = true;

                    Timer openTimer = new Timer {
                        Interval = 1000
                    };
                    openTimer.Elapsed += delegate(object o, ElapsedEventArgs e) {
                        openTimer.Stop();
                        openTimer = null;

                        openDelay = false;
                    };
                    openTimer.Start();

                    performanceUp = true;
                }
            }
        }
        public void CloseInstrument()
        {
            if (hostProcess)
            {
                return;
            }

            if (!performanceUp)
            {
                return;
            }

            hook.ClearLastPerformanceKeybinds();

            FFXIVKeybindDat.Keybind keybind = hotkeys["ESC"];
            Console.WriteLine(keybind.ToString());
            if (keybind is FFXIVKeybindDat.Keybind && keybind.GetKey() != Keys.None)
            {
                hook.SendSyncKeybind(keybind);
                performanceUp = false;
            }
        }