Пример #1
0
        private void Events_AllEvent(object sender, dynamic e)
        {
            if (!EliteAPI.IsReady)
            {
                return;
            }
            string commandName = $"((EliteAPI.{Wrapper.GetEventName(e)}))";

            if (commandName.Contains("Status"))
            {
                //Set status variables.
                SetVariables(Wrapper.GetVariables());
            }
            string macroGUID = vmCommand.CommandExists(commandName);

            if (macroGUID != null)
            {
                //Set event variables.
                EliteAPI.Logger.Log(Severity.Debug, $"Executing VoiceMacro command '{commandName}'.");
                SetVariables(Wrapper.GetEventVariables(e));
                vmCommand.ExecuteMacro(macroGUID);
            }
            else
            {
                EliteAPI.Logger.Log(Severity.Debug, $"VoiceMacro command '{commandName}' was not found, continuing.");
            }
        }
Пример #2
0
        private static void Events_AllEvent(object sender, dynamic e)
        {
            if (!EliteAPI.IsReady)
            {
                return;
            }
            string commandName = $"((EliteAPI.{Wrapper.GetEventName(e)}))";

            if (commandName.Contains("Status"))
            {
                //Set status variables.
                SetVariables(Wrapper.GetVariables());
            }
            if (proxy.CommandExists(commandName))
            {
                //Set event variables.
                EliteAPI.Logger.Log(Severity.Debug, $"Executing VoiceAttack command '{commandName}'.");
                SetVariables(Wrapper.GetEventVariables(e));
                proxy.ExecuteCommand(commandName);
            }
            else
            {
                EliteAPI.Logger.Log(Severity.Debug, $"VoiceAttack command '{commandName}' was not found, continuing.");
            }
        }
Пример #3
0
 void vmInterface.Init()
 {
     //Create new EliteAPI.
     EliteAPI = new EliteDangerousAPI(EliteDangerousAPI.StandardDirectory);
     //Create new Wrapper.
     Wrapper = new ThirdPartyWrapper(EliteAPI, DisplayName, $@"{vmCommand.GetDataDirectory()}\EliteMacro.ini");
     //Setup EliteAPI.
     EliteAPI.Logger.LogEvent += Logger_Log;
     EliteAPI.Logger.AddHandler(new LogFileHandler(Directory.GetCurrentDirectory(), "EliteAPI"));
     EliteAPI.ChangeJournal(Wrapper.GetJournalFolder());
     //Start the API.
     EliteAPI.Start(Wrapper.GetRichPresenceSetting());
     SetVariables(Wrapper.GetVariables());
     //Listen for events.
     EliteAPI.Events.AllEvent += Events_AllEvent;
 }
Пример #4
0
 public static void VA_Init1(dynamic vaProxy)
 {
     proxy = vaProxy;
     //Create new EliteAPI.
     EliteAPI = new EliteDangerousAPI(EliteDangerousAPI.StandardDirectory);
     //Create new Wrapper.
     Wrapper = new ThirdPartyWrapper(EliteAPI, VA_DisplayName(), $@"{Directory.GetCurrentDirectory()}\EliteVA.ini");
     //Setup EliteAPI.
     EliteAPI.Logger.LogEvent += Logger_Log;
     EliteAPI.Logger.AddHandler(new LogFileHandler(Wrapper.GetLogFolder().ToString(), "EliteAPI"));
     EliteAPI.ChangeJournal(Wrapper.GetJournalFolder());
     //Start the API.
     EliteAPI.Start(Wrapper.GetRichPresenceSetting());
     SetVariables(Wrapper.GetVariables());
     //Listen for events.
     EliteAPI.Events.AllEvent += Events_AllEvent;
 }