Chromatics.Chromatics.InitPlugin C# (CSharp) Method

InitPlugin() public method

public InitPlugin ( TabPage pluginScreenSpace, Label pluginStatusText ) : void
pluginScreenSpace System.Windows.Forms.TabPage
pluginStatusText System.Windows.Forms.Label
return void
        public void InitPlugin(TabPage pluginScreenSpace, Label pluginStatusText)
        {
            ActPluginData pluginData = ActGlobals.oFormActMain.PluginGetSelfData(this);
            pluginEnviroment = Path.GetDirectoryName(pluginData.pluginFile.ToString());

            AppDomain currentDomain = AppDomain.CurrentDomain;
            currentDomain.AssemblyResolve += new ResolveEventHandler((sender, e) => LoadFromSameFolder(sender, e, pluginEnviroment));

            if (File.Exists(Environment.GetEnvironmentVariable("ProgramFiles") + @"\Razer Chroma SDK\bin\RzChromaSDK64.dll"))
            {
                RazerSDK = true;
                InitializeComponent();
                InitializeDevices();
            }
            else
            {
                RazerSDK = false;
                InitializeComponent();
                InitializeDevices();
            }

            lblStatus = pluginStatusText;
            pluginScreenSpace.Text = "Chromatics";
            pluginScreenSpace.Controls.Add(this);
            this.Dock = DockStyle.Fill;
            xmlSettings = new SettingsSerializer(this);
            var cTriggers = ActGlobals.oFormActMain.ActiveCustomTriggers;
            pic_Logo.Image = Image.FromFile(pluginEnviroment + "\\lib\\logo.png");
            LoadSettings();

            // Create parsing event handlers.  After the "+=" hit TAB twice and the code will be generated for you.
            ActGlobals.oFormActMain.AfterCombatAction += new CombatActionDelegate(oFormActMain_AfterCombatAction);
            ActGlobals.oFormActMain.OnCombatStart += new CombatToggleEventDelegate(oFormActMain_OnCombatStart);
            ActGlobals.oFormActMain.OnCombatEnd += new CombatToggleEventDelegate(oFormActMain_OnCombatEnd);
            ActGlobals.oFormActMain.BeforeLogLineRead += new LogLineEventDelegate(oFormActMain_BeforeLogLineRead); //READ
            ActGlobals.oFormSpellTimers.OnSpellTimerExpire += new SpellTimerEventDelegate(oFormSpellTimers_OnSpellTimerExpire);
            ActGlobals.oFormSpellTimers.OnSpellTimerWarning += new SpellTimerEventDelegate(oFormSpellTimers_OnSpellTimerWarning);
            ActGlobals.oFormSpellTimers.OnSpellTimerRemoved += new SpellTimerEventDelegate(oFormSpellTimers_OnSpellTimerRemoved);
            Application.ApplicationExit += new EventHandler(this.OnApplicationExit);
            ActGlobals.oFormActMain.UpdateCheckClicked += new FormActMain.NullDelegate(oFormActMain_UpdateCheckClicked);

            //Start Automatic update listener on init
            if (ActGlobals.oFormActMain.GetAutomaticUpdatesAllowed())
            {
                new Thread(new ThreadStart(oFormActMain_UpdateCheckClicked)).Start();
            }

            //Fetch custom triggers from ACT and store in array
            foreach (var cTrigger in cTriggers)
            {
                var preparse = cTrigger.Key;
                string[] preparsearray = preparse.Split(new string[] { "|" }, StringSplitOptions.None);
                customTriggers.Add(preparsearray[1]);
            }

            //Setup Weather timer
            skyWatcher = new System.Timers.Timer();
            skyWatcher.Elapsed += (source, e) => { weatherLoop(); };
            skyWatcher.Interval = 10000;
            skyWatcher.Enabled = false;

            if (chk_reactiveWeather.Checked)
            {
                skyWatcher.Enabled = true;
            }

            //Setup Raid Zones
            raidZoneList.Add("Lower Aetheroacoustic Exploratory Site");
            raidZoneList.Add("Upper Aetheroacoustic Exploratory Site");
            raidZoneList.Add("The Ragnarok");
            raidZoneList.Add("Ragnarok Drive Cylinder");
            raidZoneList.Add("Ragnarok Central Core");
            raidZoneList.Add("Dalamud's Shadow");
            raidZoneList.Add("The Outer Coil");
            raidZoneList.Add("Central Decks");
            raidZoneList.Add("The Holocharts");
            raidZoneList.Add("IC-06 Central Decks");
            raidZoneList.Add("IC-06 Regeneration Grid");
            raidZoneList.Add("IC-06 Main Bridge");
            raidZoneList.Add("The Burning Heart");
            raidZoneList.Add("Labyrinth Of The Ancients");
            raidZoneList.Add("Syrcus Tower");
            raidZoneList.Add("The World Of Darkness");
            raidZoneList.Add("Fist Of The Father");
            raidZoneList.Add("Cuff Of The Father");
            raidZoneList.Add("Arm Of The Father");
            raidZoneList.Add("Burden Of The Father");
            raidZoneList.Add("Fist Of The Father (Savage)");
            raidZoneList.Add("Cuff Of The Father (Savage)");
            raidZoneList.Add("Arm Of The Father (Savage)");
            raidZoneList.Add("Burden Of The Father (Savage)");
            raidZoneList.Add("Void Ark");
            raidZoneList.Add("The Binding Coil Of Bahamut - Turn (1)");
            raidZoneList.Add("The Binding Coil Of Bahamut - Turn (2)");
            raidZoneList.Add("The Binding Coil Of Bahamut - Turn (3)");
            raidZoneList.Add("The Binding Coil Of Bahamut - Turn (4)");
            raidZoneList.Add("The Binding Coil Of Bahamut - Turn (5)");
            raidZoneList.Add("The Second Coil Of Bahamut - Turn (1)");
            raidZoneList.Add("The Second Coil Of Bahamut - Turn (2)");
            raidZoneList.Add("The Second Coil Of Bahamut - Turn (3)");
            raidZoneList.Add("The Second Coil Of Bahamut - Turn (4)");
            raidZoneList.Add("The Second Coil Of Bahamut - Turn (1)(Savage)");
            raidZoneList.Add("The Second Coil Of Bahamut - Turn (2)(Savage)");
            raidZoneList.Add("The Second Coil Of Bahamut - Turn (3)(Savage)");
            raidZoneList.Add("The Second Coil Of Bahamut - Turn (4)(Savage)");
            raidZoneList.Add("The Final Coil Of Bahamut - Turn (1)");
            raidZoneList.Add("The Final Coil Of Bahamut - Turn (2)");
            raidZoneList.Add("The Final Coil Of Bahamut - Turn (3)");
            raidZoneList.Add("The Final Coil Of Bahamut - Turn (4)");

            //Return positive attach
            lblStatus.Text = "Chromatics Plugin Started";
        }
Chromatics