Chromatics.Chromatics.oFormActMain_BeforeLogLineRead C# (CSharp) Метод

oFormActMain_BeforeLogLineRead() приватный Метод

private oFormActMain_BeforeLogLineRead ( bool isImport, LogLineEventArgs logInfo ) : void
isImport bool
logInfo LogLineEventArgs
Результат void
        void oFormActMain_BeforeLogLineRead(bool isImport, LogLineEventArgs logInfo)
        {
            //Init
            string log = logInfo.logLine;
            int chattick = 4;
            int chatspeed = 300;

            //Zone Engine
            if (currentZone != logInfo.detectedZone)
            {
                currentZone = logInfo.detectedZone;

                if (RzPulse == true)
                {
                    CTS.Cancel();
                    RzPulse = false;
                }

                //Raid Effects Mode
                if (chk_raidEffects.Checked && raidZoneList.Contains(currentZone))
                {
                    if (state != 4)
                    {
                        state = 4;
                        skyWatcher.Enabled = false;
                        updateState("breath", btn_raidEffectsA.BackColor, btn_raidEffectsB.BackColor);
                    }
                    else
                    {
                        updateState("static", btn_defaultCol.BackColor, btn_defaultCol.BackColor);
                        state = 1;
                        currentZone = "";
                    }
                }

                //Gold Saucer Vegas Mode
                else if (chk_GoldSaucerVegas.Checked && (currentZone == "The Golden Saucer" || currentZone == "Chocobo Square" || currentZone == "Unknown Zone (184)"))
                {
                    skyWatcher.Enabled = false;
                    updateState("wave", btn_defaultCol.BackColor, btn_defaultCol.BackColor);
                    state = 3;
                }

                //Reactive Weather
                else if (chk_reactiveWeather.Checked)
                {
                    state = 6;
                    setWeather(calculateWeather(currentZone));
                    skyWatcher.Enabled = true;
                }

                //Return to Default
                else
                {
                    updateState("static", btn_defaultCol.BackColor, btn_defaultCol.BackColor);
                    state = 1;
                    CTS.Cancel();
                    skyWatcher.Enabled = false;
                }
            }

            //DPS Threshold
            if (chk_DPSLimit.Checked && inCombat == true)
            {
                int currentDPS = Convert.ToInt32(ActiveEnconter.GetCombatant("YOU").EncDPS);
                int limitDPS = Convert.ToInt32(txt_DPSlimit.Value);
                int notifyDPS = Convert.ToInt32(txt_DPSNotify.Value);
                int min = 120;
                int max = 800;

                int tickspeed = ((currentDPS - notifyDPS) * (min - max) / (limitDPS - notifyDPS)) + max;

                if (currentDPS >= limitDPS)
                {
                    if (reachDPS == 1 || reachDPS == 2)
                    {
                        Debug.WriteLine(reachDPS);
                        DPSparse = true;
                        reachDPS = 3;
                        updateState("static", btn_DPSLimitCol.BackColor, btn_defaultCol.BackColor);
                        dpsloop.Stop();
                        dpstickstart = false;
                        dpsloop.Enabled = false;
                    }
                }
                else if ((currentDPS >= notifyDPS && currentDPS < limitDPS) && notifyDPS >= 0)
                {
                    if (dpstickstart == false)
                    {
                        DPSparse = true;
                        reachDPS = 2;
                        if (chk_enableEmnity.Checked)
                        {
                            new Task(() =>
                            {
                                dpstickstart = true;
                                updateState("static", btn_emnityCol.BackColor, btn_defaultCol.BackColor);
                                dpsloop = new System.Timers.Timer();
                                dpsloop.Elapsed += (source, e) => { flashDPSTimer(source, currentDPS); };
                                dpsloop.Interval = tickspeed;
                                dpsloop.Enabled = true;
                            }).Start();
                        }
                        else
                        {
                            new Task(() =>
                            {
                                dpstickstart = true;
                                updateState("static", btn_defaultCol.BackColor, btn_defaultCol.BackColor);
                                dpsloop = new System.Timers.Timer();
                                dpsloop.Elapsed += (source, e) => { flashDPSTimer(source, currentDPS); };
                                dpsloop.Interval = tickspeed;
                                dpsloop.Enabled = true;
                            }).Start();
                        }
                    }
                    else
                    {
                        dpsloop.Interval = tickspeed;
                    }
                }
                else
                {
                    if (reachDPS == 2 || reachDPS == 3)
                    {
                        if (chk_enableEmnity.Checked)
                        {
                            updateState("static", btn_emnityCol.BackColor, btn_defaultCol.BackColor);
                        }
                        else
                        {
                            updateState("static", btn_defaultCol.BackColor, btn_defaultCol.BackColor);
                        }
                        reachDPS = 1;
                        DPSparse = false;
                        dpsloop.Stop();
                        dpstickstart = false;
                        dpsloop.Enabled = false;
                    }
                }
            }

            //Chat Engine
            string receipt = log.Split('.')[1];
            string author = receipt.Split(']')[0];
            string messagetype = log.Substring(20).Split(':')[0];

            if (author == "000")
            {

                //SAY
                if (messagetype == "0a")
                {
                    if (ChromaReady == true && chk_say.Checked)
                    {
                        flashState("say", chattick, chatspeed);
                    }
                }
                //TELL
               else  if (messagetype == "0d")
                {
                    if (ChromaReady == true && chk_tell.Checked)
                    {
                        flashState("tell", chattick, chatspeed);
                    }
                }
                //YELL
                else if (messagetype == "1e")
                {
                    if (ChromaReady == true && chk_yell.Checked)
                    {
                        flashState("yell", chattick, chatspeed);
                    }
                }
                //PARTY
                else if (messagetype == "0e")
                {
                    if (ChromaReady == true && chk_party.Checked)
                    {
                        flashState("party", chattick, chatspeed);
                    }
                }
                //ALLIANCE
                else if (messagetype == "0f")
                {
                    if (ChromaReady == true && chk_alliance.Checked)
                    {
                        flashState("alliance", chattick, chatspeed);
                    }
                }
                //FC
                else if (messagetype == "18")
                {
                    if (ChromaReady == true && chk_fc.Checked)
                    {
                        flashState("fc", chattick, chatspeed);
                    }
                }
                //SHOUT
                else if (messagetype == "0b")
                {
                    if (ChromaReady == true && chk_shout.Checked)
                    {
                        flashState("shout", chattick, chatspeed);
                    }
                }
                //LS1
                else if (messagetype == "10")
                {
                    if (ChromaReady == true && chk_ls1.Checked)
                    {
                        flashState("ls1", chattick, chatspeed);
                    }
                }
                //LS2
                else if (messagetype == "11")
                {
                    if (ChromaReady == true && chk_ls2.Checked)
                    {
                        flashState("ls2", chattick, chatspeed);
                    }
                }
                //LS3
                else if (messagetype == "12")
                {
                    if (ChromaReady == true && chk_ls3.Checked)
                    {
                        flashState("ls3", chattick, chatspeed);
                    }
                }
                //LS4
                else if (messagetype == "13")
                {
                    if (ChromaReady == true && chk_ls4.Checked)
                    {
                        flashState("ls4", chattick, chatspeed);
                    }
                }
                //LS5
                else if (messagetype == "14")
                {
                    if (ChromaReady == true && chk_ls5.Checked)
                    {
                        flashState("ls5", chattick, chatspeed);
                    }
                }
                //LS6
                else if (messagetype == "15")
                {
                    if (ChromaReady == true && chk_ls6.Checked)
                    {
                        flashState("ls6", chattick, chatspeed);
                    }
                }
                //LS7
                else if (messagetype == "16")
                {
                    if (ChromaReady == true && chk_ls7.Checked)
                    {
                        flashState("ls7", chattick, chatspeed);
                    }
                }
                //LS8
                else if (messagetype == "17")
                {
                    if (ChromaReady == true && chk_ls8.Checked)
                    {
                        flashState("ls8", chattick, chatspeed);
                    }
                }
            }

            //Custom Triggers
            string loglineA = log.Substring(23);

            if (customTriggers.Any(str => loglineA.Contains(str)))
            {
                if (ChromaReady == true && chk_enableTriggers.Checked)
                {
                    flashState("trigger", maxtick, tickspeed);
                }

            }
        }
Chromatics