示例#1
0
 private bool ChatCommandConduct(BmpChatListener.Command cmd)
 {
     if (!cmd.IsCommandListenChannel())
     {
         return(false);
     }
     if (Conductor.IsConductorName(cmd.sender))
     {
         if (cmd.param == "off")
         {
             this.ConfirmSetConductor(string.Empty);
         }
         else
         {
             // Same conductor, idk what i wanna do with this
         }
     }
     else
     {
         if (Properties.Settings.Default.ForceListen)
         {
             this.ConfirmSetConductor(cmd.sender);
         }
         else
         {
             this.BringFront();
             confirmConductor.ConductorName = cmd.sender;
             confirmConductor.ShowDialog(this);
         }
     }
     return(true);
 }
示例#2
0
        private bool ChatCommandOpen(BmpChatListener.Command cmd)
        {
            if (IsCommandPermitted(cmd))
            {
                Performance.Instrument instrument = Player.PreferredInstrument;

                if (!string.IsNullOrEmpty(cmd.param))
                {
                    if (!FFXIV.GetPerformanceInstrument(cmd.param, out instrument))
                    {
                        Log(string.Format("Cannot open [\"{0}\"] - that isn't an instrument.", cmd.param));
                        return(false);
                    }
                }

                if (!FFXIV.GetHotkeyForInstrument(instrument, out FFXIVKeybindDat.Keybind keybind))
                {
                    Log(string.Format("Cannot open [{0}] - that performance action isn't placed on your hotbar.", instrument.ToString()));
                    return(false);
                }
                if (keybind is FFXIVKeybindDat.Keybind && keybind.GetKey() != Keys.None)
                {
                    if (FFXIV.IsPlayerJobReady())
                    {
                        FFXIV.hook.SendSyncKeybind(keybind);
                    }
                }
                else
                {
                    Log(string.Format("Cannot open [{0}] - no keybind is assigned to that hotbar slot.", instrument.ToString()));
                }
            }
            return(true);
        }
示例#3
0
 private bool ChatCommandClose(BmpChatListener.Command cmd)
 {
     if (IsCommandPermitted(cmd))
     {
         FFXIV.UnequipPerformance();
     }
     return(true);
 }
示例#4
0
 private bool ChatCommandNote(BmpChatListener.Command cmd)
 {
     if (IsCommandPermitted(cmd))
     {
         FFXIV.PlayPerformanceNote(cmd.param);
     }
     return(true);
 }
示例#5
0
 private bool ChatCommandStop(BmpChatListener.Command cmd)
 {
     if (IsCommandPermitted(cmd))
     {
         Explorer.EnterFile();
     }
     return(true);
 }
示例#6
0
 private bool ChatCommandPause(BmpChatListener.Command cmd)
 {
     if (IsCommandPermitted(cmd))
     {
         Player.Player.Pause();
     }
     return(true);
 }
示例#7
0
 private bool LyricCommandKey(BmpChatListener.Command cmd)
 {
     if (!string.IsNullOrEmpty(cmd.param))
     {
         KeysConverter kc  = new KeysConverter();
         Keys          key = (Keys)kc.ConvertFrom(cmd.param);
         FFXIV.hook.SendSyncKey(key);
     }
     return(true);
 }
示例#8
0
 private bool ChatCommandSpeedShift(BmpChatListener.Command cmd)
 {
     if (IsCommandPermitted(cmd))
     {
         if (float.TryParse(cmd.param, out float ss))
         {
             Player.SpeedShift = ss;
         }
     }
     return(true);
 }
示例#9
0
 private bool ChatCommandOctaveShift(BmpChatListener.Command cmd)
 {
     if (IsCommandPermitted(cmd))
     {
         if (int.TryParse(cmd.param, out int os))
         {
             Player.OctaveShift = os;
         }
     }
     return(true);
 }
示例#10
0
 private bool ChatCommandTrack(BmpChatListener.Command cmd)
 {
     if (IsCommandPermitted(cmd))
     {
         if (int.TryParse(cmd.param, out int track))
         {
             Explorer.SelectTrack(track.Clamp(0, Player.Player.MaxTrack));
         }
     }
     return(true);
 }
示例#11
0
 private bool ChatCommandLoad(BmpChatListener.Command cmd)
 {
     if (IsCommandPermitted(cmd))
     {
         if (Explorer.SelectFile(cmd.param))
         {
             Explorer.EnterFile();
         }
     }
     return(true);
 }
示例#12
0
 private bool ChatCommandCommand(BmpChatListener.Command cmd)
 {
     if (IsCommandPermitted(cmd))
     {
         if (!string.IsNullOrEmpty(cmd.param))
         {
             if (Properties.Settings.Default.PlayLyrics)
             {
                 FFXIV.SendChatString(cmd.param);
             }
         }
     }
     return(true);
 }
示例#13
0
        private bool ChatCommandSeek(BmpChatListener.Command cmd)
        {
            if (IsCommandPermitted(cmd))
            {
                if (int.TryParse(cmd.param, out int delay))
                {
                    delay = delay.Clamp(-500, 500);

                    if (FFXIV.IsPerformanceReady() && Player.Player.IsPlaying)
                    {
                        Player.Player.Seek(delay);
                    }
                }
            }
            return(true);
        }
示例#14
0
 private bool LyricCommandHotbar(BmpChatListener.Command cmd)
 {
     if (!string.IsNullOrEmpty(cmd.param))
     {
         if (int.TryParse(cmd.param, out int hotbarNum))
         {
             int hotbar = (int)Math.Floor(hotbarNum / 12.0);
             int slot   = hotbarNum % 12 - 1;
             int job    = FFXIV.memory.currentPlayer.CurrentPlayer.JobID;
             if (FFXIV.GetHotkeyForHotbarSlot(hotbar, slot, job, out FFXIVKeybindDat.Keybind keybind))
             {
                 FFXIV.hook.SendSyncKeybind(keybind);
             }
         }
     }
     return(true);
 }
示例#15
0
 private bool ChatCommandLoop(BmpChatListener.Command cmd)
 {
     if (IsCommandPermitted(cmd))
     {
         if (string.IsNullOrEmpty(cmd.param))
         {
             Player.Loop = !Player.Loop;
         }
         else
         {
             if (bool.TryParse(cmd.param, out bool loop))
             {
                 Player.Loop = loop;
             }
         }
     }
     return(true);
 }
示例#16
0
 private bool IsCommandPermitted(BmpChatListener.Command cmd)
 {
     if (Conductor.IsConductorName(cmd.sender))
     {
         if (cmd.sender == FFXIV.memory.currentPlayer.CurrentPlayer.Name)
         {
             // Disable making the same f*****g command to yourself as conductor
             return(false);
         }
         return(cmd.IsCommandListenChannel());
     }
     else
     {
         if (Properties.Settings.Default.ForceListen)
         {
             if (cmd.IsCommandListenChannel())
             {
                 return(true);
             }
         }
     }
     return(false);
 }