Пример #1
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;
 }
Пример #2
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.Log += Logger_Log;
            EliteAPI.Logger.UseLogFile(Wrapper.GetLogFolder().ToString());
            EliteAPI.ChangeJournal(Wrapper.GetJournalFolder());

            //Start the API.
            EliteAPI.Start();

            //Listen for events.
            EliteAPI.Events.AllEvent += Events_AllEvent;
        }