コード例 #1
0
        private void DrawLoading(Rectangle dest, SpriteBatch sb)
        {
            TextItem.doCenteredFontLabel(dest, "Loading...", GuiData.font, Color.White, false);
            Rectangle rectangle = new Rectangle(dest.X, dest.Y + 30, dest.Width, dest.Height);

            TextItem.doCenteredFontLabel(dest, this.loadProgress.ToString("00.00") + "%", GuiData.font, Color.White, false);
        }
コード例 #2
0
        private void DrawHeadings(Rectangle bounds, SpriteBatch sb)
        {
            Rectangle rectangle1 = new Rectangle(bounds.X, bounds.Y + 4, bounds.Width, 40);
            Rectangle dest1      = rectangle1;

            dest1.X     += 8;
            dest1.Width -= 8;
            TextItem.doFontLabelToSize(dest1, this.name, GuiData.font, Color.White, true, true);
            rectangle1.Y     += rectangle1.Height - 1;
            rectangle1.Height = 1;
            sb.Draw(Utils.white, rectangle1, Color.White);
            Color themeColor = this.ThemeColor;

            rectangle1.Y     += 2;
            rectangle1.Height = 20;
            Color patternColor = this.IsInCriticalFirmwareFailure ? Color.DarkRed : themeColor * 0.28f;

            if (!this.IsInCriticalFirmwareFailure && this.PilotAlerted)
            {
                patternColor = this.os.warningColor * 0.5f;
            }
            PatternDrawer.draw(rectangle1, 1f, themeColor * 0.1f, patternColor, sb, PatternDrawer.warningStripe);
            if (this.IsReloadingFirmware)
            {
                Rectangle destinationRectangle = rectangle1;
                destinationRectangle.Width = (int)((double)destinationRectangle.Width * (double)Utils.QuadraticOutCurve(this.firmwareReloadProgress / 6f));
                sb.Draw(Utils.white, destinationRectangle, Utils.AddativeWhite * 0.4f);
            }
            Rectangle dest2 = Utils.InsetRectangle(rectangle1, 1);
            string    text  = this.IsReloadingFirmware ? LocaleTerms.Loc("RELOADING FIRMWARE") : (this.IsInCriticalFirmwareFailure ? LocaleTerms.Loc("CRITICAL FIRMWARE FAILURE") : (this.PilotAlerted ? LocaleTerms.Loc("PILOT ALERTED") : LocaleTerms.Loc("FLIGHT IN PROGRESS")));

            TextItem.doCenteredFontLabel(dest2, text, GuiData.font, Color.White, false);
            Rectangle rectangle2 = new Rectangle(dest2.X, dest2.Y + dest2.Height + 8, dest2.Width, 24);
            int       num1       = 4;
            int       num2       = (rectangle2.Width - num1 * 3) / 3;

            if (Button.doButton(632877701, rectangle2.X, rectangle2.Y, num2 - 20, rectangle2.Height, LocaleTerms.Loc("Disconnect"), new Color?(this.os.lockedColor)))
            {
                this.os.runCommand("disconnect");
            }
            if (Button.doButton(632877703, rectangle2.X + num1 + num2 - 20, rectangle2.Y, num2 + 10 + num1, rectangle2.Height, LocaleTerms.Loc("Pilot Alert"), new Color?(this.ThemeColor)))
            {
                this.PilotAlerted = true;
            }
            if (Button.doButton(632877706, rectangle2.X + num1 * 3 + num2 * 2 - 10, rectangle2.Y, num2 + 10 + num1, rectangle2.Height, LocaleTerms.Loc("Reload Firmware"), new Color?(this.os.lockedColor)))
            {
                this.StartReloadFirmware();
            }
            Rectangle dest3   = new Rectangle(rectangle2.X + 6, rectangle2.Y + rectangle2.Height + 20, rectangle2.Width - 75, 70);
            byte      status1 = (double)this.currentAirspeed <= 500.0 ? (byte)0 : ((double)this.currentAirspeed < 600.0 ? (byte)1 : (byte)2);

            this.DrawFieldDisplay(dest3, sb, LocaleTerms.Loc("Air Speed (kn)"), this.currentAirspeed.ToString("0.0"), status1);
            dest3.Y += dest3.Height + 6;
            byte status2 = (double)this.rateOfClimb > -0.200000002980232 ? (byte)0 : ((double)this.rateOfClimb > -1.0 ? (byte)1 : (byte)2);

            this.DrawFieldDisplay(dest3, sb, LocaleTerms.Loc("Rate of Climb (f/s)"), this.rateOfClimb.ToString("0.000"), status2);
            dest3.Y += dest3.Height + 6;
            this.DrawFieldDisplay(dest3, sb, LocaleTerms.Loc("Heading (deg)"), string.Concat((object)67.228f), (byte)0);
            dest3.Y += dest3.Height + 6;
        }
コード例 #3
0
        internal virtual void DrawCautionLinedMessage(Rectangle dest, int stripHeight, Color color, string Message, SpriteBatch sb, Texture2D stripTexture = null, int textOffsetY = 0)
        {
            if (stripTexture == null)
            {
                stripTexture = PatternDrawer.warningStripe;
            }
            Rectangle dest1 = dest;

            dest1.Height = stripHeight;
            PatternDrawer.draw(dest1, 1f, Color.Transparent, color, sb, stripTexture);
            dest1 = new Rectangle(dest1.X, dest.Y + dest.Height - stripHeight, dest1.Width, stripHeight);
            PatternDrawer.draw(dest1, 1f, Color.Transparent, color, sb, stripTexture);
            int       height = dest.Height - dest1.Height * 2 + dest.Height / 10;
            Rectangle dest2  = new Rectangle(dest.X, dest.Y + stripHeight + 2 + textOffsetY, dest.Width, height);

            if (Settings.ActiveLocale == "en-us")
            {
                TextItem.doFontLabelToSize(dest2, Message, GuiData.titlefont, color, true, false);
            }
            else
            {
                TextItem.doCenteredFontLabel(dest2, Message, GuiData.font, color, false);
            }
            Rectangle rectangle = dest2;

            rectangle.Y      = dest.Y + dest.Height + 2;
            rectangle.Height = 30;
        }
コード例 #4
0
ファイル: LogoDaemon.cs プロジェクト: hochladen/Hacknet
        public override void draw(Rectangle bounds, SpriteBatch sb)
        {
            base.draw(bounds, sb);
            bounds = Utils.InsetRectangle(bounds, 1);
            sb.Draw(Utils.white, bounds, Color.Black * 0.4f);
            Rectangle dest      = new Rectangle(bounds.X, bounds.Y, bounds.Width, bounds.Height / 8);
            Rectangle rectangle = new Rectangle(bounds.X, bounds.Y + dest.Height, bounds.Width, bounds.Height / 8 * 7);

            if (!this.showsTitle)
            {
                rectangle.Y      -= dest.Height;
                rectangle.Height += dest.Height;
                rectangle.Y      += 6;
                rectangle.Height -= 6;
            }
            int num1 = 40;

            rectangle.Height -= num1;
            if (!string.IsNullOrWhiteSpace(this.BodyText))
            {
                string[] strArray = this.BodyText.Trim().Split(Utils.robustNewlineDelim, StringSplitOptions.None);
                int      num2     = (int)GuiData.smallfont.MeasureString("W").Y + 2;
                int      num3     = 6;
                int      num4     = num2 * strArray.Length + num3 * 2;
                rectangle.Height -= num4;
                int num5 = bounds.Y + bounds.Height - num3 - num2 + 1 - num1;
                for (int index = strArray.Length - 1; index >= 0; --index)
                {
                    TextItem.doCenteredFontLabel(new Rectangle(bounds.X, num5 + 1, bounds.Width, num2 - 1), strArray[index], GuiData.smallfont, this.TextColor, false);
                    num5 -= num2;
                }
            }
            if (this.LoadedLogo == null)
            {
                this.timeOnPage += (float)this.os.lastGameTime.ElapsedGameTime.TotalSeconds;
                this.spinner.Draw(rectangle, sb, 1f, (float)(1.0 - (double)this.timeOnPage * 0.400000005960464), 0.0f, new Color?(this.TextColor));
            }
            else
            {
                Utils.DrawSpriteAspectCorrect(rectangle, sb, this.LoadedLogo, Color.White, false);
            }
            if (this.showsTitle)
            {
                TextItem.doCenteredFontLabel(dest, this.name, GuiData.font, this.TextColor, false);
            }
            int width  = bounds.Width / 2;
            int height = 26;

            if (!Button.doButton(22928201, bounds.X + (bounds.Width - width) / 2, bounds.Y + bounds.Height - (num1 - height) / 2 - height, width, height, LocaleTerms.Loc("Proceed"), new Color?(Color.Black)))
            {
                return;
            }
            this.os.display.command = "connect";
        }
コード例 #5
0
        public override void draw(Rectangle bounds, SpriteBatch sb)
        {
            base.draw(bounds, sb);
            bool      flag = !this.RequiresLogin || this.comp.adminIP == this.os.thisComputer.ip || this.comp.userLoggedIn;
            Rectangle dest = Utils.InsetRectangle(bounds, 2);
            Rectangle destinationRectangle = new Rectangle(dest.X, dest.Y - 1, 18, dest.Height + 2);

            sb.Draw(Utils.white, destinationRectangle, this.ThemeColor);
            destinationRectangle.X     += destinationRectangle.Width / 2;
            destinationRectangle.Width /= 2;
            sb.Draw(Utils.white, destinationRectangle, Color.Black * 0.2f);
            dest.X     += 20;
            dest.Width -= 25;
            Rectangle rectangle1 = new Rectangle(dest.X + 4, dest.Y, dest.Width, 35);

            TextItem.doFontLabelToSize(rectangle1, this.name, GuiData.font, Color.White, true, true);
            int width   = dest.Width / 4;
            int height1 = 22;

            if (Button.doButton(37849102, rectangle1.X + rectangle1.Width - 6 - width, rectangle1.Y + rectangle1.Height - rectangle1.Height / 2 - height1 / 2, width, height1, LocaleTerms.Loc("Exit IRC View"), new Color?(this.ThemeColor)))
            {
                this.os.display.command = "connect";
            }
            rectangle1.Y     += rectangle1.Height;
            rectangle1.X     -= 6;
            dest.Y           += rectangle1.Height;
            dest.Height      -= rectangle1.Height;
            rectangle1.Height = 2;
            sb.Draw(Utils.white, rectangle1, this.ThemeColor);
            dest.Y      += rectangle1.Height + 2;
            dest.Height -= rectangle1.Height + 2;
            dest.Height -= 6;
            PatternDrawer.draw(dest, 0.22f, Color.Black * 0.5f, flag ? this.ThemeColor * 0.12f : Utils.AddativeRed * 0.2f, sb, flag ? PatternDrawer.thinStripe : PatternDrawer.warningStripe);
            dest.X      += 2;
            dest.Width  -= 4;
            dest.Height -= 4;
            if (flag)
            {
                this.System.Draw(dest, sb, false, LocaleTerms.Loc("UNKNOWN"), this.UserColors);
            }
            else
            {
                int       height2    = dest.Height / 4;
                Rectangle rectangle2 = new Rectangle(dest.X - 4, dest.Y + dest.Height / 2 - height2 / 2, dest.Width + 6, height2);
                sb.Draw(Utils.white, rectangle2, this.os.lockedColor);
                rectangle2.Height -= 35;
                TextItem.doCenteredFontLabel(rectangle2, LocaleTerms.Loc("Login To Server"), GuiData.font, Color.White, false);
                if (Button.doButton(84109551, rectangle2.X + rectangle2.Width / 2 - rectangle2.Width / 4, rectangle2.Y + rectangle2.Height - 32, rectangle2.Width / 2, 28, "Login", new Color?()))
                {
                    this.os.runCommand("login");
                }
            }
        }
コード例 #6
0
 private void doCatDisplay()
 {
     if (this.os.hasConnectionPermission(false))
     {
         if (Button.doButton(299999, this.bounds.X + (this.bounds.Width - 41), this.bounds.Y + 12, 27, 29, "<-", new Color?()))
         {
             this.os.runCommand("ls");
         }
         Rectangle tmpRect = GuiData.tmpRect;
         tmpRect.Width  = this.bounds.Width;
         tmpRect.X      = this.bounds.X;
         tmpRect.Y      = this.bounds.Y + 1;
         tmpRect.Height = this.bounds.Height - 2;
         if (this.os.connectedComp != null && this.os.connectedComp.ip != this.LastDisplayedFileSourceIP && this.LastDisplayedFileSourceIP != this.os.thisComputer.ip)
         {
             this.command = "dc";
         }
         else
         {
             string data = "";
             for (int index = 1; index < this.commandArgs.Length; ++index)
             {
                 data = data + this.commandArgs[index] + " ";
             }
             string text1 = LocalizedFileLoader.SafeFilterString(data);
             if (this.LastDisplayedFileFolder.searchForFile(text1.Trim()) == null)
             {
                 this.os.postFXDrawActions += (Action)(() =>
                 {
                     Rectangle rectangle = new Rectangle(this.bounds.X + 1, this.bounds.Y + this.bounds.Height / 2 - 70, this.bounds.Width - 2, 140);
                     this.spriteBatch.Draw(Utils.white, rectangle, this.os.lockedColor);
                     TextItem.doCenteredFontLabel(rectangle, "File Not Found", GuiData.font, Color.White, false);
                 });
                 this.catScroll = Vector2.Zero;
             }
             else
             {
                 TextItem.doFontLabel(new Vector2((float)this.x, (float)(this.y + 3)), text1, GuiData.font, new Color?(Color.White), (float)(this.bounds.Width - 70), float.MaxValue, false);
                 int       num          = 55;
                 Rectangle dest         = new Rectangle(tmpRect.X + 4, tmpRect.Y + num, tmpRect.Width - 6, tmpRect.Height - num - 2);
                 string    displayCache = this.os.displayCache;
                 this.y += 70;
                 string text2 = Utils.SuperSmartTwimForWidth(LocalizedFileLoader.SafeFilterString(displayCache), this.bounds.Width - 40, GuiData.tinyfont);
                 this.catTextRegion.Draw(dest, text2, this.spriteBatch);
             }
         }
     }
     else
     {
         this.command = "connect";
     }
 }
コード例 #7
0
        private void DrawBrowse(Rectangle dest, SpriteBatch spriteBatch)
        {
            Rectangle drawRectForRow1 = this.GetDrawRectForRow(0, 12);
            bool      flag            = this.Permissions == DatabaseDaemon.DatabasePermissions.Public || this.comp.adminIP == this.os.thisComputer.ip;

            TextItem.doFontLabelToSize(drawRectForRow1, string.Format(LocaleTerms.Loc("{0} : Records"), (object)this.name), GuiData.font, Color.White, true, true);
            Rectangle drawRectForRow2 = this.GetDrawRectForRow(0, 0);

            PatternDrawer.draw(drawRectForRow2, 0.5f, Color.Transparent, this.ThemeColor * 0.2f, spriteBatch, PatternDrawer.thinStripe);
            Rectangle rectangle = new Rectangle(drawRectForRow2.X + 4, drawRectForRow2.Y + drawRectForRow2.Height / 2 + 12, drawRectForRow2.Width / 3, drawRectForRow2.Height / 2 - 15);

            if (Button.doButton(71118000, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, LocaleTerms.Loc("Back"), new Color?(Color.Gray)))
            {
                this.State = DatabaseDaemon.DatabaseState.Welcome;
            }
            if (this.DataType == (Type)null || string.IsNullOrWhiteSpace(this.DataTypeIdentifier) || this.DataTypeIdentifier.ToLower() == "none")
            {
                Rectangle drawRectForRow3 = this.GetDrawRectForRow(1, 2);
                drawRectForRow3.Height += (int)((double)this.blockSize * (double)(this.blocksHigh - 3));
                PatternDrawer.draw(drawRectForRow3, 0.4f, Color.Black * 0.3f, Utils.makeColorAddative(this.ThemeColor) * 0.25f, spriteBatch, PatternDrawer.binaryTile);
                TextItem.doCenteredFontLabel(this.GetDrawRectForRow(3, 8), " - " + LocaleTerms.Loc("API Access Enabled") + " - ", GuiData.smallfont, Color.White, false);
            }
            else
            {
                Rectangle ListDest = this.GetDrawRectForRow(1, 4);
                ListDest.Height += (int)((double)this.blockSize * ((double)this.blocksHigh - 2.5));
                this.ScrollPanel.NumberOfPanels = this.DatasetFolder.files.Count;
                this.ScrollPanel.Draw((Action <int, Rectangle, SpriteBatch>)((i, bounds, sb) =>
                {
                    FileEntry file = this.DatasetFolder.files[i];
                    string text    = "REC#" + i.ToString("000") + " : " + this.GetAnnounceNameForFileName(file.name);
                    int width      = Math.Max(160, bounds.Width / 3);
                    if (Button.doButton(71118100 + i, bounds.X, bounds.Y + 2, width, bounds.Height - 4, string.Format(LocaleTerms.Loc("View Record #{0}"), (object)i.ToString("000")), new Color?(this.ThemeColor)))
                    {
                        this.ActiveFile       = this.DatasetFolder.files[i];
                        this.State            = DatabaseDaemon.DatabaseState.EntryDisplay;
                        this.DeserializedFile = (object)null;
                    }
                    Vector2 vector2 = GuiData.smallfont.MeasureString(text);
                    Rectangle destinationRectangle = new Rectangle(bounds.X + bounds.Width / 3 + 6, bounds.Y + bounds.Height / 2 - 1, ListDest.Width - (width + (int)vector2.X + 26), 1);
                    sb.Draw(Utils.white, destinationRectangle, Color.White * 0.1f);
                    TextItem.doFontLabel(new Vector2((float)(destinationRectangle.X + destinationRectangle.Width) + 6f, (float)bounds.Y + 2f), text, GuiData.smallfont, new Color?(Color.White), (float)bounds.Width, (float)bounds.Height, false);
                }), spriteBatch, ListDest);
            }
        }
コード例 #8
0
        private void DrawWelcome(Rectangle dest, SpriteBatch sb)
        {
            this.TextRegion.UpdateScroll(0.0f);
            Rectangle drawRectForRow1 = this.GetDrawRectForRow(0, 12);
            bool      flag            = this.Permissions == DatabaseDaemon.DatabasePermissions.Public || this.comp.adminIP == this.os.thisComputer.ip;

            TextItem.doCenteredFontLabel(drawRectForRow1, this.name, GuiData.font, Color.White, true);
            PatternDrawer.draw(new Rectangle(dest.X + 1, (int)this.BlockStartTopLeft.Y, dest.Width - 2, (int)((double)this.blockSize * 2.0)), 0.5f, Color.Transparent, (flag ? this.ThemeColor : Utils.AddativeRed) * 0.2f, sb, flag ? PatternDrawer.thinStripe : PatternDrawer.errorTile);
            TextItem.doCenteredFontLabel(this.GetDrawRectForRow(1, 12), flag ? LocaleTerms.Loc("Access Granted") : LocaleTerms.Loc("Administrator Login Required"), GuiData.font, flag ? this.ThemeColor * 0.8f : Utils.AddativeRed * 0.8f, true);
            Rectangle drawRectForRow2 = this.GetDrawRectForRow(3, 14);

            if (flag && Button.doButton(73616101, (int)this.BlockStartTopLeft.X, drawRectForRow2.Y, dest.Width / 2, drawRectForRow2.Height, LocaleTerms.Loc("Browse Records"), new Color?(this.ThemeColor)))
            {
                this.State = DatabaseDaemon.DatabaseState.Browse;
            }
            drawRectForRow2.Y     += drawRectForRow2.Height + 10;
            drawRectForRow2.Height = drawRectForRow2.Height / 2;
            if (Button.doButton(73616102, (int)this.BlockStartTopLeft.X, drawRectForRow2.Y, dest.Width / 2, drawRectForRow2.Height, LocaleTerms.Loc("Login"), new Color?(this.ThemeColor)))
            {
                this.os.execute("login");
            }
            drawRectForRow2.Y += drawRectForRow2.Height + 6;
            Color color = Color.Lerp(Color.Black, this.ThemeColor, 0.5f);

            if (!string.IsNullOrWhiteSpace(this.adminResetPassEmailAccount) && Button.doButton(73616106, (int)this.BlockStartTopLeft.X, drawRectForRow2.Y, dest.Width / 2, drawRectForRow2.Height, this.AdminEmailResetHasHappened ? LocaleTerms.Loc("Password Reset In Cooldown") : (this.AdminEmailResetStarted ? LocaleTerms.Loc("Cancel") : LocaleTerms.Loc("Reset Access Password")), new Color?(this.AdminEmailResetStarted ? (this.AdminEmailResetHasHappened ? Color.Gray : Color.DarkRed) : color)))
            {
                this.AdminEmailResetStarted = !this.AdminEmailResetStarted;
            }
            if (this.AdminEmailResetStarted)
            {
                Rectangle rectangle = this.GetDrawRectForRow(3, 10);
                rectangle.X     += dest.Width / 2 + 10;
                rectangle.Width -= dest.Width / 2;
                rectangle.Height = Math.Max(300, (int)((double)this.blockSize * 3.0 - 30.0));
                rectangle.Width += 30;
                if (rectangle.Height == 300)
                {
                    rectangle.Y -= (int)this.blockSize;
                }
                Color backingColor = Color.Gray * 0.3f;
                sb.Draw(Utils.white, rectangle, Color.Black * 0.8f);
                rectangle = Utils.InsetRectangle(rectangle, 2);
                PatternDrawer.draw(rectangle, 0.5f, backingColor, backingColor * 0.4f, sb, PatternDrawer.thinStripe);
                int       num = 20;
                Rectangle destinationRectangle = new Rectangle(rectangle.X - num - 2, drawRectForRow2.Y + (drawRectForRow2.Height - num) / 2, num, num);
                sb.Draw(this.Triangle, destinationRectangle, Color.Black * 0.8f);
                Rectangle dest1 = new Rectangle(rectangle.X + 6, rectangle.Y, rectangle.Width - 12, rectangle.Height / 6);
                TextItem.doCenteredFontLabel(dest1, LocaleTerms.Loc("Reset Admin Password"), GuiData.font, Color.LightGray, true);
                Rectangle dest2 = new Rectangle(dest1.X, dest1.Y + dest1.Height + 4, dest1.Width + 9, rectangle.Height / 6 * 4);
                if (this.passwordResetHelperString == null)
                {
                    this.passwordResetHelperString = Utils.readEntireFile("Content/DLC/Docs/PasswordResetText.txt");
                }
                string data = this.passwordResetHelperString.Replace("[PASSWORD]", this.adminResetPassEmailAccount);
                if (this.AdminEmailResetHasHappened)
                {
                    data = this.passwordResetMessage;
                }
                string text = Utils.SuperSmartTwimForWidth(data, dest2.Width, GuiData.UITinyfont);
                TextItem.doFontLabelToSize(dest2, text, GuiData.tinyfont, Color.White, true, true);
                if (!this.AdminEmailResetHasHappened && Button.doButton(73606111, rectangle.X + 4, rectangle.Y + rectangle.Height - 28, rectangle.Width - 8, 26, LocaleTerms.Loc("Reset Password"), new Color?(Color.Red)))
                {
                    this.ResetAccessPassword();
                }
            }
            drawRectForRow2.Y += drawRectForRow2.Height + 6;
            if (!Button.doButton(73616129, (int)this.BlockStartTopLeft.X, drawRectForRow2.Y, dest.Width / 2, drawRectForRow2.Height, LocaleTerms.Loc("Exit"), new Color?(Color.Black)))
            {
                return;
            }
            this.os.display.command = "connect";
        }
コード例 #9
0
ファイル: DLCCreditsDaemon.cs プロジェクト: hochladen/Hacknet
        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);
        }
コード例 #10
0
        public override void Draw(float t)
        {
            base.Draw(t);
            this.drawOutline();
            this.drawTarget("app:");
            this.UpdateState(t);
            Rectangle dest1 = new Rectangle(this.bounds.X + 2, this.bounds.Y + Module.PANEL_HEIGHT + 2, this.bounds.Width - 4, this.bounds.Height - (Module.PANEL_HEIGHT + 4));
            Rectangle dest2 = new Rectangle(this.bounds.X + 2, this.bounds.Y + Module.PANEL_HEIGHT + 10, this.bounds.Width - 4, this.bounds.Height - (Module.PANEL_HEIGHT + 6));

            switch (this.State)
            {
            case DLCIntroExe.IntroState.NotStarted:
                this.BackgroundEffect.Update(t);
                this.BackgroundEffect.Draw(dest2, this.spriteBatch, Color.Black, this.themeColor * 0.2f, HexGridBackground.ColoringAlgorithm.CorrectedSinWash, 0.0f);
                int height1 = 30;
                this.spriteBatch.Draw(Utils.white, new Rectangle(this.bounds.X + 10, this.bounds.Y + this.bounds.Height / 2 - height1 / 2, this.bounds.Width - 20, height1), Color.Black);
                if (!this.os.Flags.HasFlag("KaguyaTrialComplete"))
                {
                    if (Button.doButton(8310101 + this.PID, this.bounds.X + 10, this.bounds.Y + this.bounds.Height / 2 - height1 / 2, this.bounds.Width - 20, height1, LocaleTerms.Loc("BEGIN TRIAL"), new Color?(this.os.highlightColor)))
                    {
                        this.State           = DLCIntroExe.IntroState.SpinningUp;
                        this.TimeInThisState = 0.0f;
                        MusicManager.stop();
                        MusicManager.playSongImmediatley("DLC\\Music\\snidelyWhiplash");
                        this.os.mailicon.isEnabled = false;
                        this.os.thisComputer.links.Clear();
                        this.os.traceCompleteOverrideAction += new Action(this.PlayerLostToTraceTimer);
                        this.OSTraceTimerOverrideActive      = true;
                        break;
                    }
                    break;
                }
                TextItem.doCenteredFontLabel(dest1, LocaleTerms.Loc("Trials Locked"), GuiData.font, Color.White, false);
                if (Button.doButton(8310101 + this.PID, dest1.X + 10, dest1.Y + dest1.Height - 22, dest1.Width - 20, 18, "Exit", new Color?(this.os.lockedColor)))
                {
                    this.isExiting = true;
                }
                break;

            case DLCIntroExe.IntroState.SpinningUp:
                Utils.LCG.reSeed(this.PID);
                Rectangle destinationRectangle = new Rectangle(dest1.X, dest1.Y, dest1.Width, 1);
                for (int index = 0; index < dest1.Height; ++index)
                {
                    float point = Math.Min(1f, this.TimeInThisState / (Utils.LCG.NextFloatScaled() * DLCIntroExe.SpinUpTime));
                    float num1;
                    if ((double)Utils.LCG.NextFloatScaled() > 0.5)
                    {
                        float num2 = 0.8f;
                        float num3 = point * (1f - num2);
                        if ((double)point > (double)num2)
                        {
                            float num4 = 1f - num3;
                            float num5 = Utils.QuadraticOutCurve((float)(((double)point - (double)num2) / (1.0 - (double)num2)));
                            num1 = num3 + num4 * num5;
                        }
                        else
                        {
                            num1 = num3;
                        }
                    }
                    else
                    {
                        num1 = Utils.QuadraticOutCurve(point);
                    }
                    destinationRectangle.Y     = dest1.Y + index;
                    destinationRectangle.Width = (int)((double)num1 * (double)dest1.Width);
                    Color color = Color.Lerp(Utils.AddativeWhite * 0.1f, this.themeColor, Utils.LCG.NextFloatScaled());
                    this.spriteBatch.Draw(Utils.white, destinationRectangle, color);
                }
                break;

            case DLCIntroExe.IntroState.Flickering:
                this.UpdateUIFlickerIn();
                this.UpdateUIBreaking(t);
                this.DrawPhaseTitle(t, dest2);
                break;

            case DLCIntroExe.IntroState.MailIconPhasingOut:
                this.DrawPhaseTitle(t, dest2);
                this.UpdateMailePhaseOut(t);
                break;

            case DLCIntroExe.IntroState.AssignMission1:
            case DLCIntroExe.IntroState.AssignMission2:
            case DLCIntroExe.IntroState.Outro:
                this.DrawPhaseTitle(t, dest2);
                this.DrawAssignmentPhase(t);
                break;

            case DLCIntroExe.IntroState.OnMission1:
            case DLCIntroExe.IntroState.OnMission2:
                this.DrawPhaseTitle(t, dest2);
                if (Settings.forceCompleteEnabled)
                {
                    int height2 = 19;
                    if (Button.doButton(8310102, this.bounds.X + 10, this.bounds.Y + height2 + 4, this.bounds.Width - 20, height2, LocaleTerms.Loc("DEBUG: Skip"), new Color?(this.os.highlightColor)))
                    {
                        this.os.thisComputer.files.root.searchForFolder("bin").files.Add(new FileEntry(PortExploits.crackExeData[6881], PortExploits.cracks[6881]));
                        this.CompleteExecution();
                    }
                    break;
                }
                break;

            case DLCIntroExe.IntroState.Exiting:
                this.DrawPhaseTitle(t, dest2);
                Utils.FillEverywhereExcept(Utils.InsetRectangle(this.os.terminal.Bounds, 1), Utils.GetFullscreen(), this.spriteBatch, Color.Black * 0.8f * (1f - Math.Min(1f, this.TimeInThisState)));
                break;
            }
            this.UpdateImpactEffects(t);
            this.DrawImpactEffects(this.ImpactEffects);
            this.explosion.Render(this.spriteBatch);
        }