예제 #1
0
        public void Update(float t)
        {
            float alertTimer = this.alertTimer;

            if (!this.os.Flags.HasFlag("FirstAlertComplete"))
            {
                this.alertTimer -= t * 0.65f;
            }
            else
            {
                this.alertTimer -= t;
            }
            if ((double)this.alertTimer <= 0.0)
            {
                this.alertTimer = 0.0f;
            }
            if ((double)alertTimer <= 0.0 || (double)this.alertTimer > 0.0)
            {
                return;
            }
            float radius = 280f;

            if (!this.os.Flags.HasFlag("FirstAlertComplete"))
            {
                this.os.Flags.AddFlag("FirstAlertComplete");
                radius *= this.firstEverAlertMod;
            }
            SFX.addCircle(this.pos + new Vector2((float)((double)this.tex.Width * (double)MailIcon.SCALE / 2.0), (float)((double)this.tex.Height * (double)MailIcon.SCALE / 2.0)), MailIcon.uncheckedMailPulseColor, radius);
        }
예제 #2
0
        public static void ReDsicoverAllVisibleNodesInOSCache(object osobj)
        {
            OS    os   = (OS)osobj;
            float num1 = 0.0f;
            float num2 = 8f;
            float num3 = num2 / (float)os.netMap.nodes.Count;

            string[] strArray = os.PreDLCVisibleNodesCache.Split(Utils.commaDelim, StringSplitOptions.RemoveEmptyEntries);
            for (int index = 0; index < strArray.Length; ++index)
            {
                try
                {
                    int nIndex = Convert.ToInt32(strArray[index]);
                    os.delayer.Post(ActionDelayer.Wait((double)num1), (Action)(() =>
                    {
                        os.netMap.visibleNodes.Add(nIndex);
                        os.netMap.nodes[nIndex].highlightFlashTime = 1f;
                        SFX.addCircle(os.netMap.nodes[nIndex].getScreenSpacePosition(), Utils.AddativeWhite * 0.4f, 70f);
                    }));
                    os.delayer.Post(ActionDelayer.Wait((double)num2), (Action)(() => SFX.addCircle(os.netMap.nodes[nIndex].getScreenSpacePosition(), Utils.AddativeWhite * 0.3f, 30f)));
                }
                catch (FormatException ex)
                {
                    Console.WriteLine("Error restoring node " + (object)index);
                }
                num1 += num3;
                os.PreDLCVisibleNodesCache = "";
            }
        }
예제 #3
0
        private void UpdateState(float t)
        {
            this.TimeInThisState += t;
            switch (this.State)
            {
            case DLCIntroExe.IntroState.SpinningUp:
                if ((double)this.TimeInThisState >= (double)DLCIntroExe.SpinUpTime)
                {
                    this.PrepareForUIBreakdown();
                    this.State           = DLCIntroExe.IntroState.Flickering;
                    this.PhaseTitle      = LocaleTerms.Loc("INITIALIZING");
                    this.PhaseSubtitle   = "---";
                    this.TimeInThisState = 0.0f;
                    this.os.execute("dc");
                    this.os.execute("clear");
                    this.os.warningFlash();
                }
                this.percentageThroughThisState = this.TimeInThisState / DLCIntroExe.SpinUpTime;
                break;

            case DLCIntroExe.IntroState.Flickering:
                if ((double)this.TimeInThisState >= (double)DLCIntroExe.FlickeringTime)
                {
                    this.State           = DLCIntroExe.IntroState.MailIconPhasingOut;
                    this.TimeInThisState = 0.0f;
                    SFX.addCircle(this.os.mailicon.pos + new Vector2(20f, 6f), Utils.AddativeRed, 100f);
                    this.os.execute("clear");
                    this.os.warningFlash();
                }
                this.percentageThroughThisState = this.TimeInThisState / DLCIntroExe.FlickeringTime;
                break;

            case DLCIntroExe.IntroState.MailIconPhasingOut:
                if ((double)this.TimeInThisState >= (double)DLCIntroExe.MailIconFlickerOutTime)
                {
                    this.CompleteMailPhaseOut();
                    this.State           = DLCIntroExe.IntroState.AssignMission1;
                    this.TimeInThisState = 0.0f;
                    this.os.warningFlash();
                }
                this.percentageThroughThisState = this.TimeInThisState / DLCIntroExe.MailIconFlickerOutTime;
                break;

            case DLCIntroExe.IntroState.AssignMission1:
                this.percentageThroughThisState = this.TimeInThisState / DLCIntroExe.AssignMission1Time;
                break;

            case DLCIntroExe.IntroState.OnMission1:
            case DLCIntroExe.IntroState.OnMission2:
                this.CheckProgressOfCurrentAssignment();
                break;

            case DLCIntroExe.IntroState.AssignMission2:
                this.percentageThroughThisState = this.TimeInThisState / DLCIntroExe.AssignMission2Time;
                break;
            }
            this.explosion.Update(t);
        }
예제 #4
0
 private void saveEmail()
 {
     try
     {
         Utils.appendToFile(this.email + "\r\n", "Emails.txt");
         AddEmailDaemon.lastSentEmail = this.email;
         SFX.addCircle(this.os.netMap.GetNodeDrawPos(this.comp) + new Vector2((float)this.os.netMap.bounds.X, (float)this.os.netMap.bounds.Y) + new Vector2((float)(NetworkMap.NODE_SIZE / 2)), this.os.thisComputerNode, 100f);
         this.state = 0;
         this.os.display.command = "connect";
     }
     catch (Exception ex)
     {
         this.state = 3;
     }
 }
예제 #5
0
 private void UpdateMailePhaseOut(float t)
 {
     this.AddRadialMailLine();
     this.AddRadialMailLine();
     if ((double)this.percentageThroughThisState > 0.200000002980232)
     {
         this.AddRadialMailLine();
         this.AddRadialMailLine();
     }
     if ((double)this.TimeInThisState % 0.600000023841858 <= (double)t)
     {
         SFX.addCircle(this.os.mailicon.pos + new Vector2(20f, 6f), Utils.AddativeRed, (float)(100.0 + 200.0 * (double)this.percentageThroughThisState));
     }
     this.os.topBarIconsColor = (double)Utils.randm(1f) < (double)this.percentageThroughThisState ? Color.Red : this.originalTopBarIconsColor;
     Utils.FillEverywhereExcept(Utils.InsetRectangle(this.os.terminal.Bounds, 1), Utils.GetFullscreen(), this.spriteBatch, Color.Black * (0.8f * this.percentageThroughThisState));
 }
예제 #6
0
 public void hostileActionTaken()
 {
     if (os.connectedComp == null || !os.connectedComp.ip.Equals(ip))
     {
         return;
     }
     if (traceTime > 0.0)
     {
         os.traceTracker.start(traceTime);
     }
     if (os.timer - (double)timeLastPinged <= 0.349999994039536)
     {
         return;
     }
     SFX.addCircle(getScreenSpacePosition(), os.brightLockedColor, 25f);
     timeLastPinged = os.timer;
 }
예제 #7
0
 private void saveEmail()
 {
     try
     {
         Utils.appendToFile(email + "\r\n", "Emails.txt");
         lastSentEmail = email;
         SFX.addCircle(
             os.netMap.GetNodeDrawPos(comp.location) + new Vector2(os.netMap.bounds.X, os.netMap.bounds.Y) +
             new Vector2(NetworkMap.NODE_SIZE / 2), os.thisComputerNode, 100f);
         state = 0;
         os.display.command = "connect";
     }
     catch (Exception ex)
     {
         state = 3;
     }
 }
예제 #8
0
        public void Update(float t)
        {
            var num = alertTimer;

            alertTimer -= t;
            if (alertTimer <= 0.0)
            {
                alertTimer = 0.0f;
            }
            if (num <= 0.0 || alertTimer > 0.0)
            {
                return;
            }
            SFX.addCircle(
                pos + new Vector2((float)(tex.Width * (double)SCALE / 2.0), (float)(tex.Height * (double)SCALE / 2.0)),
                uncheckedMailPulseColor, 280f);
        }
예제 #9
0
        private void CompleteMailPhaseOut()
        {
            this.os.DisableEmailIcon = true;
            SFX.addCircle(this.os.mailicon.pos + new Vector2(20f, 6f), Utils.AddativeRed * 0.8f, 100f);
            for (int index = 0; index < 12; ++index)
            {
                this.os.delayer.Post(ActionDelayer.Wait((double)index / 7.0), (Action)(() => SFX.addCircle(this.os.mailicon.pos + new Vector2(20f, 6f), Utils.AddativeRed * 0.8f, 400f)));
            }
            Vector2 mailIconPos = this.os.mailicon.pos;

            this.explosion.Explode(1500, new Vector2(-0.1f, 3.241593f), mailIconPos, 1f, 8f, 100f, 1600f, 1000f, 1200f, 3f, 7f);
            this.os.delayer.Post(ActionDelayer.Wait(0.1), (Action)(() => this.explosion.Explode(100, new Vector2(-0.1f, 3.241593f), mailIconPos, 1f, 6f, 100f, 1300f, 1000f, 1300f, 3f, 7f)));
            this.BreakSound.Play();
            this.os.topBarIconsColor = this.originalTopBarIconsColor;
            PostProcessor.EndingSequenceFlashOutActive             = false;
            PostProcessor.EndingSequenceFlashOutPercentageComplete = 0.0f;
            this.os.terminal.reset();
        }
예제 #10
0
 public void Draw(Rectangle dest, SpriteBatch sb)
 {
     if (Button.doButton(4568702, dest.X, dest.Y, dest.Width, dest.Height, "", new Color?(this.os.topBarIconsColor), this.icon) && this.IsEnabled)
     {
         this.ConnectToServer();
     }
     if (this.RadiusCircles.Count > 0)
     {
         for (int index = 0; index < this.RadiusCircles.Count; ++index)
         {
             float renderSize  = (float)(320.0 - (double)this.RadiusCircles[index] * 240.0) * Utils.QuadraticOutCurve(Utils.QuadraticOutCurve(this.RadiusCircles[index]));
             int   activeIndex = index;
             this.os.postFXDrawActions += (Action)(() => sb.Draw(this.circle, Utils.InsetRectangle(new Rectangle(dest.X + dest.Width / 2, dest.Y + dest.Height / 2, 1, 1), (int)renderSize), this.os.highlightColor * (1f - this.RadiusCircles[activeIndex])));
         }
     }
     else if (this.PendingAlerts && (double)this.os.timer % 2.0 < 0.0322580635547638)
     {
         SFX.addCircle(new Vector2((float)dest.X, (float)dest.Y) + new Vector2((float)(dest.Width / 2), (float)(dest.Height / 2)), this.os.highlightColor, 40f);
     }
 }
예제 #11
0
 public void sendEmail()
 {
     if (AddEmailDaemon.lastSentEmail != null && AddEmailDaemon.lastSentEmail.Equals(this.email))
     {
         return;
     }
     if (this.email != null && this.email.Contains <char>('@'))
     {
         new Thread(new ThreadStart(this.makeWebRequest))
         {
             IsBackground = true
         }.Start();
         AddEmailDaemon.lastSentEmail = this.email;
         SFX.addCircle(this.comp.location + new Vector2((float)this.os.netMap.bounds.X, (float)this.os.netMap.bounds.Y) + new Vector2((float)(NetworkMap.NODE_SIZE / 2)), this.os.thisComputerNode, 100f);
         this.state = 0;
         this.os.display.command = "connect";
     }
     else
     {
         this.state = 3;
     }
 }
예제 #12
0
 public override void Completed()
 {
     base.Completed();
     IsComplete = true;
     if (targetComp.attatchedDeviceIDs != null)
     {
         var strArray = targetComp.attatchedDeviceIDs.Split(Utils.commaDelim,
                                                            StringSplitOptions.RemoveEmptyEntries);
         var num = 0.0f;
         for (var index = 0; index < strArray.Length; ++index)
         {
             var device = Programs.getComputer(os, strArray[index]);
             if (device != null)
             {
                 Action action = () =>
                 {
                     os.netMap.discoverNode(device);
                     var loc = os.netMap.GetNodeDrawPos(device.location) +
                               new Vector2(os.netMap.bounds.X, os.netMap.bounds.Y) +
                               new Vector2(NetworkMap.NODE_SIZE / 2);
                     SFX.addCircle(loc, os.highlightColor, 120f);
                     os.delayer.Post(ActionDelayer.Wait(0.2), () => SFX.addCircle(loc, os.highlightColor, 80f));
                     os.delayer.Post(ActionDelayer.Wait(0.4), () => SFX.addCircle(loc, os.highlightColor, 65f));
                     os.write("eOS Device \"" + device.name + "\" opened for connection at " + device.ip);
                     ResultTitles.Add(device.name);
                     ResultBodies.Add(device.ip + " " + device.location + "\n" + Guid.NewGuid());
                 };
                 os.delayer.Post(ActionDelayer.Wait(num), action);
                 ++num;
                 ++devicesFound;
             }
         }
     }
     if (devicesFound != 0)
     {
         return;
     }
     isError = true;
 }
예제 #13
0
        public void Draw()
        {
            if (
                Button.doButton(45687, (int)pos.X, (int)pos.Y, (int)(tex.Width * (double)SCALE),
                                (int)(tex.Height * (double)SCALE), "", os.topBarIconsColor, tex) && isEnabled)
            {
                connectToMail();
            }
            var percent = alertTimer / ALERT_TIME;

            percent *= percent;
            percent *= percent;
            percent  = (float)Math.Pow(percent, 1.0 - percent);
            var iconPositionOffset = new Vector2(-100f, 20f);

            if (alertTimer > 0.0)
            {
                os.postFXDrawActions += () =>
                {
                    var origin = new Vector2((float)(texBig.Width * (double)SCALE / 2.0),
                                             (float)(texBig.Height * (double)SCALE / 2.0));
                    GuiData.spriteBatch.Draw(texBig, pos + origin * bigTexScaleMod + iconPositionOffset * percent,
                                             new Rectangle?(), Color.White * (1f - percent), 0.0f, origin,
                                             (Vector2.One + Vector2.One * percent * 25f) * bigTexScaleMod, SpriteEffects.None, 0.5f);
                };
            }
            else
            {
                if (!mailUnchecked || os.timer % 2.0 >= 0.0322580635547638)
                {
                    return;
                }
                SFX.addCircle(
                    pos + new Vector2((float)(tex.Width * (double)SCALE / 2.0), (float)(tex.Height * (double)SCALE / 2.0)),
                    uncheckedMailPulseColor, 40f);
            }
        }
예제 #14
0
 public override void Completed()
 {
     base.Completed();
     this.IsComplete = true;
     if (this.targetComp.attatchedDeviceIDs != null)
     {
         string[] strArray = this.targetComp.attatchedDeviceIDs.Split(Utils.commaDelim, StringSplitOptions.RemoveEmptyEntries);
         float    num      = 0.0f;
         for (int index = 0; index < strArray.Length; ++index)
         {
             Computer device = Programs.getComputer(this.os, strArray[index]);
             if (device != null)
             {
                 Action action = (Action)(() =>
                 {
                     this.os.netMap.discoverNode(device);
                     Vector2 loc = this.os.netMap.GetNodeDrawPos(device) + new Vector2((float)this.os.netMap.bounds.X, (float)this.os.netMap.bounds.Y) + new Vector2((float)(NetworkMap.NODE_SIZE / 2));
                     SFX.addCircle(loc, this.os.highlightColor, 120f);
                     this.os.delayer.Post(ActionDelayer.Wait(0.2), (Action)(() => SFX.addCircle(loc, this.os.highlightColor, 80f)));
                     this.os.delayer.Post(ActionDelayer.Wait(0.4), (Action)(() => SFX.addCircle(loc, this.os.highlightColor, 65f)));
                     this.os.write(string.Format(LocaleTerms.Loc("eOS Device \"{0}\" opened for connection at {1}"), (object)device.name, (object)device.ip));
                     this.ResultTitles.Add(device.name);
                     this.ResultBodies.Add(device.ip + " " + device.location.ToString() + "\n" + Guid.NewGuid().ToString());
                 });
                 this.os.delayer.Post(ActionDelayer.Wait((double)num), action);
                 ++num;
                 ++this.devicesFound;
             }
         }
     }
     if (this.devicesFound != 0)
     {
         return;
     }
     this.isError = true;
 }
예제 #15
0
 public void sendEmail()
 {
     if (lastSentEmail != null && lastSentEmail.Equals(email))
     {
         return;
     }
     if (email != null && email.Contains('@'))
     {
         new Thread(makeWebRequest)
         {
             IsBackground = true
         }.Start();
         lastSentEmail = email;
         SFX.addCircle(
             comp.location + new Vector2(os.netMap.bounds.X, os.netMap.bounds.Y) +
             new Vector2(NetworkMap.NODE_SIZE / 2), os.thisComputerNode, 100f);
         state = 0;
         os.display.command = "connect";
     }
     else
     {
         state = 3;
     }
 }
예제 #16
0
        public void Draw()
        {
            if (Button.doButton(45687, (int)this.pos.X, (int)this.pos.Y, (int)((double)this.tex.Width * (double)MailIcon.SCALE), (int)((double)this.tex.Height * (double)MailIcon.SCALE), "", new Color?(this.os.topBarIconsColor), this.tex) && this.isEnabled)
            {
                this.connectToMail();
            }
            float percent = this.alertTimer / MailIcon.ALERT_TIME;

            percent *= percent;
            percent *= percent;
            percent  = (float)Math.Pow((double)percent, 1.0 - (double)percent);
            Vector2 iconPositionOffset = new Vector2(-100f, 20f);
            float   scaleMod           = this.bigTexScaleMod;

            if (!this.os.Flags.HasFlag("FirstAlertComplete"))
            {
                scaleMod           += this.firstEverAlertMod * percent;
                iconPositionOffset *= this.firstEverAlertMod * percent;
            }
            if ((double)this.alertTimer > 0.0)
            {
                this.os.postFXDrawActions += (Action)(() =>
                {
                    Vector2 origin = new Vector2((float)((double)this.texBig.Width * (double)MailIcon.SCALE / 2.0), (float)((double)this.texBig.Height * (double)MailIcon.SCALE / 2.0));
                    GuiData.spriteBatch.Draw(this.texBig, this.pos + origin * scaleMod + iconPositionOffset * percent, new Rectangle?(), Color.White * (1f - percent), 0.0f, origin, (Vector2.One + Vector2.One * percent * 25f) * scaleMod, SpriteEffects.None, 0.5f);
                });
            }
            else
            {
                if (!this.mailUnchecked || (double)this.os.timer % 2.0 >= 0.0322580635547638)
                {
                    return;
                }
                SFX.addCircle(this.pos + new Vector2((float)((double)this.tex.Width * (double)MailIcon.SCALE / 2.0), (float)((double)this.tex.Height * (double)MailIcon.SCALE / 2.0)), MailIcon.uncheckedMailPulseColor, 40f);
            }
        }
예제 #17
0
        public void doEmailViewerDisplay(Rectangle bounds, SpriteBatch sb)
        {
            var vector2 = new Vector2(bounds.X + 2, bounds.Y + 20);

            if (Button.doButton(800007, (int)vector2.X, (int)vector2.Y, bounds.Width - 20 - corner.Width, 30,
                                "Return to Inbox", os.darkBackgroundColor))
            {
                state = 3;
            }
            vector2.Y += 35f;
            var destinationRectangle = GuiData.tmpRect;

            destinationRectangle.X      = bounds.X + 1;
            destinationRectangle.Y      = (int)vector2.Y;
            destinationRectangle.Width  = bounds.Width - 2;
            destinationRectangle.Height = 38;
            sb.Draw(Utils.white, destinationRectangle, textColor);
            vector2.Y += 3f;
            sb.DrawString(GuiData.UITinyfont, "<" + emailData[1] + ">", vector2, Color.Black);
            vector2.Y += 18f;
            sb.DrawString(GuiData.UITinyfont, "Subject: " + emailData[2], vector2, Color.Black);
            vector2.Y += 25f;
            vector2.X += 20f;
            var num1       = 25;
            var num2       = (emailData.Length - 4 + 1) * num1;
            var textBounds = new Rectangle((int)vector2.X, (int)vector2.Y, bounds.Width - 22,
                                           (int)(bounds.Height - (vector2.Y - (double)bounds.Y) - num2));
            var str = Utils.SmartTwimForWidth(emailData[3], bounds.Width - 50, GuiData.tinyfont);

            vector2.Y += DrawMailMessageText(textBounds, sb, str.Split(Utils.newlineDelim));
            vector2.Y += num1 - 5;
            var num3 = 0;

            for (var index1 = 4; index1 < emailData.Length; ++index1)
            {
                var strArray = emailData[index1].Split(spaceDelim, StringSplitOptions.RemoveEmptyEntries);
                var flag     = true;
                if (strArray.Length >= 1)
                {
                    if (strArray[0].Equals("link"))
                    {
                        var labelSize = TextItem.doMeasuredTinyLabel(vector2,
                                                                     "LINK : " + strArray[1] + "@" + strArray[2], new Color?());
                        var computer = Programs.getComputer(os, strArray[2]);
                        if (!os.netMap.visibleNodes.Contains(os.netMap.nodes.IndexOf(computer)))
                        {
                            DrawButtonGlow(vector2, labelSize);
                        }
                        if (Button.doButton(800009 + num3, (int)(vector2.X + (double)labelSize.X + 5.0),
                                            (int)vector2.Y, 20, 17, "+", new Color?()))
                        {
                            computer.highlightFlashTime = 1f;
                            os.netMap.discoverNode(computer);
                            SFX.addCircle(Programs.getComputer(os, strArray[2]).getScreenSpacePosition(), Color.White,
                                          32f);
                            buttonSound.Play();
                        }
                    }
                    else if (strArray[0].Equals("account"))
                    {
                        var labelSize = TextItem.doMeasuredTinyLabel(vector2,
                                                                     "ACCOUNT : " + strArray[1] + " : User="******" Pass="******"+", new Color?()))
                        {
                            var computer = Programs.getComputer(os, strArray[1]);
                            computer.highlightFlashTime = 1f;
                            os.netMap.discoverNode(computer);
                            computer.highlightFlashTime = 1f;
                            SFX.addCircle(computer.getScreenSpacePosition(), Color.White, 32f);
                            for (var index2 = 0; index2 < computer.users.Count; ++index2)
                            {
                                var userDetail = computer.users[index2];
                                if (userDetail.name.Equals(strArray[3]))
                                {
                                    userDetail.known       = true;
                                    computer.users[index2] = userDetail;
                                    break;
                                }
                            }
                            buttonSound.Play();
                        }
                    }
                    else if (strArray[0].Equals("note"))
                    {
                        var labelSize = TextItem.doMeasuredTinyLabel(vector2, "NOTE : " + strArray[1], new Color?());
                        if (!NotesExe.NoteExists(strArray[2], os))
                        {
                            DrawButtonGlow(vector2, labelSize);
                        }
                        if (Button.doButton(800009 + num3, (int)(vector2.X + (double)labelSize.X + 5.0),
                                            (int)vector2.Y, 20, 17, "+", new Color?()))
                        {
                            NotesExe.AddNoteToOS(strArray[2], os, false);
                        }
                    }
                    else
                    {
                        flag = false;
                    }
                    if (flag)
                    {
                        ++num3;
                        vector2.Y += num1;
                    }
                }
            }
            vector2.Y = bounds.Y + bounds.Height - 35;
            if (!Button.doButton(90200, (int)vector2.X, (int)vector2.Y, 300, 30, "Reply", new Color?()))
            {
                return;
            }
            emailReplyStrings.Clear();
            addingNewReplyString   = false;
            missionIncompleteReply = false;
            state = 5;
        }
예제 #18
0
        public override void draw(Rectangle bounds, SpriteBatch sb)
        {
            base.draw(bounds, sb);
            bounds = Utils.InsetRectangle(bounds, 1);
            int num1    = 90;
            int height1 = 30;

            TextItem.doCenteredFontLabel(new Rectangle(bounds.X, bounds.Y + height1, bounds.Width, num1 - height1), this.OverrideTitle == null ? LocaleTerms.Loc("Labyrinths Project") : this.OverrideTitle, GuiData.font, Color.White, false);
            Rectangle rectangle = new Rectangle(bounds.X, bounds.Y + num1 + height1, bounds.Width, bounds.Height - (num1 + 2 * height1));

            if (this.showingCredits)
            {
                this.timeInCredits += (float)this.os.lastGameTime.ElapsedGameTime.TotalSeconds;
                float timeInCredits = this.timeInCredits;
                float num2          = ((double)timeInCredits > 5.0 ? timeInCredits - 4f : Utils.CubicInCurve(timeInCredits / 5f)) % 165f;
                Utils.FillEverywhereExcept(rectangle, Utils.GetFullscreen(), sb, Color.Black * 0.5f);
                float num3 = 20f;
                float num4 = (float)(rectangle.Y - height1 + rectangle.Height) - num2 * num3;
                for (int index = 0; index < this.CreditsData.Length; ++index)
                {
                    int        height2 = 22;
                    SpriteFont font    = GuiData.smallfont;
                    Color      color   = Color.LightGray * 0.9f;
                    string     text    = this.CreditsData[index];
                    if (text.StartsWith("%"))
                    {
                        text    = text.Substring(1);
                        height2 = 45;
                        font    = GuiData.font;
                        color   = Utils.AddativeWhite * 0.9f;
                    }
                    else if (text.StartsWith("^"))
                    {
                        text    = text.Substring(1);
                        height2 = 30;
                        font    = GuiData.font;
                        color   = Color.White;
                    }
                    if ((double)num4 >= (double)(rectangle.Y - height1))
                    {
                        TextItem.doCenteredFontLabel(new Rectangle(rectangle.X, (int)num4, rectangle.Width, height2), text, font, color, false);
                    }
                    num4 += (float)(height2 + 2);
                    if ((double)num4 > (double)(rectangle.Y + rectangle.Height))
                    {
                        break;
                    }
                }
                if ((double)this.timeInCredits > 40.0 && Button.doButton(18394902, rectangle.X + rectangle.Width / 4, rectangle.Y + rectangle.Height - 23, rectangle.Width / 2, 20, LocaleTerms.Loc("Proceed"), new Color?((double)this.timeInCredits > 65.0 ? this.os.highlightColor : Color.Black)))
                {
                    this.os.display.command = "connect";
                }
            }
            else if (this.isInResetSequence)
            {
                this.timeInReset += (float)this.os.lastGameTime.ElapsedGameTime.TotalSeconds;
                if ((double)this.timeInReset >= 5.0)
                {
                    this.showingCredits = true;
                    PostProcessor.EndingSequenceFlashOutActive             = false;
                    PostProcessor.EndingSequenceFlashOutPercentageComplete = 0.0f;
                    if (!Settings.IsInExtensionMode)
                    {
                        this.EndDLC();
                        if (!this.hasCuedFinaleSong)
                        {
                            this.os.delayer.Post(ActionDelayer.Wait(2.0), (Action)(() => MusicManager.playSongImmediatley("DLC\\Music\\DreamHead")));
                            this.hasCuedFinaleSong = true;
                        }
                        MediaPlayer.IsRepeating = true;
                        for (int index = 0; index < 9; ++index)
                        {
                            this.os.delayer.Post(ActionDelayer.Wait((double)index / 7.0), (Action)(() => SFX.addCircle(this.os.mailicon.pos + new Vector2(20f, 6f), Utils.AddativeWhite * 0.8f, 400f)));
                        }
                    }
                }
                else
                {
                    float num2 = Math.Min(this.timeInReset, 1f);
                    Utils.FillEverywhereExcept(rectangle, Utils.GetFullscreen(), sb, Color.Black * 0.5f * num2);
                    PatternDrawer.draw(rectangle, 0.3f, Color.Transparent, Color.Black * 0.7f, sb, PatternDrawer.binaryTile);
                    this.AddRadialMailLine();
                    PostProcessor.EndingSequenceFlashOutActive             = true;
                    PostProcessor.EndingSequenceFlashOutPercentageComplete = num2;
                    if (!this.hasCuedBuildup && (double)this.timeInReset > 2.8)
                    {
                        this.buildup.Play();
                        this.hasCuedBuildup = true;
                    }
                    TextItem.doCenteredFontLabel(rectangle, LocaleTerms.Loc("Disabling..."), GuiData.font, Color.White, false);
                }
            }
            else
            {
                PatternDrawer.draw(rectangle, 0.3f, Color.Transparent, Color.Black * 0.7f, sb, PatternDrawer.binaryTile);
                string text = this.OverrideButtonText == null?LocaleTerms.Loc("Disable Agent Monitoring") : this.OverrideButtonText;

                bool flag = this.OverrideButtonText != null;
                if (Button.doButton(38101920, rectangle.X + 50, rectangle.Y + rectangle.Height / 2 - 13, rectangle.Width - 100, 26, text, new Color?(this.os.highlightColor)))
                {
                    if (!flag)
                    {
                        this.isInResetSequence = true;
                        this.timeInReset       = 0.0f;
                        if (MusicManager.currentSongName == "DLC/Music/RemiDrone")
                        {
                            MusicManager.stop();
                        }
                        this.spindownImpact.Play();
                        if (this.spindown != null)
                        {
                            this.os.delayer.Post(ActionDelayer.Wait(1.1), (Action)(() => this.spindown.Play()));
                        }
                        DLC1SessionUpgrader.ReDsicoverAllVisibleNodesInOSCache((object)this.os);
                    }
                    else
                    {
                        this.isInResetSequence = false;
                        this.showingCredits    = true;
                        if (this.ConditionalActionsToLoadOnButtonPress != null)
                        {
                            RunnableConditionalActions.LoadIntoOS(this.ConditionalActionsToLoadOnButtonPress, (object)this.os);
                        }
                    }
                }
            }
            Rectangle destinationRectangle = new Rectangle(bounds.X, bounds.Y + num1, bounds.Width, height1);

            sb.Draw(Utils.white, destinationRectangle, Utils.VeryDarkGray);
            destinationRectangle.Y = bounds.Y + num1 + height1 + rectangle.Height;
            sb.Draw(Utils.white, destinationRectangle, Utils.VeryDarkGray);
        }