示例#1
0
        public override void Draw(float t)
        {
            base.Draw(t);
            this.spriteBatch.Draw(Utils.white, this.infoBar, this.os.indentBackgroundColor);
            this.infoBarUsedRam.Width = (int)((double)this.infoBar.Width * (1.0 - (double)this.os.ramAvaliable / (double)this.os.totalRam));
            this.spriteBatch.Draw(Utils.white, this.infoBarUsedRam, RamModule.USED_RAM_COLOR);
            this.spriteBatch.DrawString(GuiData.detailfont, this.infoString, new Vector2((float)this.infoBar.X, (float)this.infoBar.Y), Color.White);
            this.spriteBatch.DrawString(GuiData.detailfont, string.Concat((object)this.os.exes.Count), new Vector2((float)(this.bounds.X + this.bounds.Width - (this.os.exes.Count >= 10 ? 24 : 12)), (float)this.infoBar.Y), Color.White);
            if ((double)this.OutOfMemoryFlashTime <= 0.0)
            {
                return;
            }
            float num    = Math.Min(1f, this.OutOfMemoryFlashTime);
            float amount = Math.Max(0.0f, this.OutOfMemoryFlashTime - (RamModule.FLASH_TIME - 1f));

            PatternDrawer.draw(this.bounds, 0.0f, Color.Transparent, Color.Lerp(this.os.lockedColor, Utils.AddativeRed, amount) * num, this.spriteBatch, PatternDrawer.errorTile);
            int       height    = 40;
            Rectangle rectangle = new Rectangle(this.bounds.X, this.bounds.Y + this.bounds.Height - height - 1, this.bounds.Width, height);

            this.spriteBatch.Draw(Utils.white, Utils.InsetRectangle(rectangle, 4), Color.Black * 0.75f);
            --rectangle.X;
            string text = " ^ " + LocaleTerms.Loc("INSUFFICIENT MEMORY") + " ^ ";

            TextItem.doFontLabelToSize(rectangle, text, GuiData.font, Color.Black * num, false, false);
            rectangle.X += 2;
            TextItem.doFontLabelToSize(rectangle, text, GuiData.font, Color.Black * num, false, false);
            --rectangle.X;
            TextItem.doFontLabelToSize(rectangle, text, GuiData.font, Color.White * num, false, false);
        }
示例#2
0
        private void DrawBasePanel(Rectangle dest)
        {
            int width1 = dest.Width - 8;
            int width2 = (int)((double)width1 * 0.4);
            int width3 = (int)((double)width1 * 0.6);

            if (!this.gettingNewNote && Button.doButton(631012 + this.os.exes.IndexOf((ExeModule)this), dest.X + dest.Width - width2, dest.Y + 4, width2, dest.Height - 6, LocaleTerms.Loc("Close"), new Color?(this.os.lockedColor * this.fade)))
            {
                if (this.gettingNewNote)
                {
                    this.os.terminal.executeLine();
                    this.gettingNewNote = false;
                }
                this.Completed();
                this.RemoveReopnener();
                this.isExiting = true;
            }
            if (!this.gettingNewNote && Button.doButton(611014 + this.os.exes.IndexOf((ExeModule)this), dest.X, dest.Y + 4, width3, dest.Height - 6, LocaleTerms.Loc("Add Note"), new Color?(this.os.highlightColor * this.fade)))
            {
                this.os.runCommand("getString Note");
                this.os.getStringCache = "";
                this.gettingNewNote    = true;
            }
            else
            {
                if (!this.gettingNewNote)
                {
                    return;
                }
                Rectangle dest1 = new Rectangle(dest.X, dest.Y + 4, width1, dest.Height - 6);
                PatternDrawer.draw(dest1, 1f, Color.Transparent, this.os.highlightColor * 0.5f, this.spriteBatch, PatternDrawer.thinStripe);
                TextItem.doFontLabelToSize(dest1, LocaleTerms.Loc("Type In Terminal..."), GuiData.smallfont, Color.White, false, false);
            }
        }
示例#3
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;
        }
示例#4
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;
        }
示例#5
0
        protected override void Update(GameTime gameTime)
        {
            if (!this.HasLoadedContent)
            {
                this.LoadContent();
            }
            if (WebRenderer.Enabled)
            {
                XNAWebRenderer.XNAWR_Update();
            }
            if (!this.resolutionSet)
            {
                this.setNewGraphics();
                this.resolutionSet = true;
            }
            TimeSpan elapsedGameTime = gameTime.ElapsedGameTime;

            PatternDrawer.update((float)elapsedGameTime.TotalSeconds);
            elapsedGameTime = gameTime.ElapsedGameTime;
            GuiData.setTimeStep((float)elapsedGameTime.TotalSeconds);
            elapsedGameTime = gameTime.ElapsedGameTime;
            MusicManager.Update((float)elapsedGameTime.TotalSeconds);
            elapsedGameTime = gameTime.ElapsedGameTime;
            ThemeManager.Update((float)elapsedGameTime.TotalSeconds);
            AlienwareFXManager.UpdateForOS((object)OS.currentInstance);
            base.Update(gameTime);
        }
        public override void Draw(GameTime gameTime)
        {
            base.Draw(gameTime);
            this.ScreenManager.FadeBackBufferToBlack((int)Math.Min(this.TransitionAlpha, (byte)150));
            GuiData.startDraw();
            float num = 1f - this.TransitionPosition;

            PatternDrawer.draw(this.contentRect, 1f, (this.isWinner ? this.winBacking : this.lossBacking) * num, (this.isWinner ? this.winPattern : this.lossPattern) * num, GuiData.spriteBatch);
            string  text = this.isWinner ? "VICTORY" : "DEFEAT";
            Vector2 pos  = this.font.MeasureString(text);

            pos.X = (float)(this.contentRect.X + this.contentRect.Width / 2) - pos.X / 2f;
            pos.Y = (float)(this.contentRect.Y + this.contentRect.Height / 2) - pos.Y / 2f;
            TextItem.DrawShadow = false;
            TextItem.doFontLabel(pos, text, this.font, new Color?(Color.White * num), float.MaxValue, float.MaxValue, false);
            if (Button.doButton(1008, this.contentRect.X + 10, this.contentRect.Y + this.contentRect.Height - 60, 230, 55, LocaleTerms.Loc("Exit"), new Color?(Color.Black)))
            {
                if (OS.currentInstance != null)
                {
                    OS.currentInstance.ExitScreen();
                }
                this.ExitScreen();
                this.ScreenManager.AddScreen((GameScreen) new MainMenu());
            }
            GuiData.endDraw();
        }
        public override void Draw(GameTime gameTime)
        {
            base.Draw(gameTime);
            ScreenManager.FadeBackBufferToBlack(Math.Min(TransitionAlpha, (byte)150));
            GuiData.startDraw();
            var num = 1f - TransitionPosition;

            PatternDrawer.draw(contentRect, 1f, (isWinner ? winBacking : lossBacking) * num,
                               (isWinner ? winPattern : lossPattern) * num, GuiData.spriteBatch);
            var text = isWinner ? "VICTORY" : "DEFEAT";
            var pos  = font.MeasureString(text);

            pos.X = contentRect.X + contentRect.Width / 2 - pos.X / 2f;
            pos.Y = contentRect.Y + contentRect.Height / 2 - pos.Y / 2f;
            TextItem.DrawShadow = false;
            TextItem.doFontLabel(pos, text, font, Color.White * num, float.MaxValue, float.MaxValue);
            if (Button.doButton(1008, contentRect.X + 10, contentRect.Y + contentRect.Height - 60, 230, 55, "Exit",
                                Color.Black))
            {
                if (OS.currentInstance != null)
                {
                    OS.currentInstance.ExitScreen();
                }
                ExitScreen();
                ScreenManager.AddScreen(new MainMenu());
            }
            GuiData.endDraw();
        }
示例#8
0
        public override void Draw(float t)
        {
            base.Draw(t);
            spriteBatch.Draw(Utils.white, infoBar, os.indentBackgroundColor);
            infoBarUsedRam.Width = (int)(infoBar.Width * (1.0 - os.ramAvaliable / (double)os.totalRam));
            spriteBatch.Draw(Utils.white, infoBarUsedRam, USED_RAM_COLOR);
            spriteBatch.DrawString(GuiData.detailfont, infoString, new Vector2(infoBar.X, infoBar.Y), Color.White);
            spriteBatch.DrawString(GuiData.detailfont, string.Concat(os.exes.Count),
                                   new Vector2(bounds.X + bounds.Width - (os.exes.Count >= 10 ? 24 : 12), infoBar.Y), Color.White);
            if (OutOfMemoryFlashTime <= 0.0)
            {
                return;
            }
            var num    = Math.Min(1f, OutOfMemoryFlashTime);
            var amount = Math.Max(0.0f, OutOfMemoryFlashTime - (FLASH_TIME - 1f));

            PatternDrawer.draw(bounds, 0.0f, Color.Transparent,
                               Color.Lerp(os.lockedColor, Utils.AddativeRed, amount) * num, spriteBatch, PatternDrawer.errorTile);
            var height    = 40;
            var rectangle = new Rectangle(bounds.X, bounds.Y + bounds.Height - height - 1, bounds.Width, height);

            spriteBatch.Draw(Utils.white, Utils.InsetRectangle(rectangle, 4), Color.Black * 0.75f);
            --rectangle.X;
            var text = " ^ INSUFFICIENT MEMORY ^ ";

            TextItem.doFontLabelToSize(rectangle, text, GuiData.font, Color.Black * num);
            rectangle.X += 2;
            TextItem.doFontLabelToSize(rectangle, text, GuiData.font, Color.Black * num);
            --rectangle.X;
            TextItem.doFontLabelToSize(rectangle, text, GuiData.font, Color.White * num);
        }
示例#9
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");
                }
            }
        }
示例#10
0
 protected override void Initialize()
 {
     this.sman = new ScreenManager((Game)this);
     this.Components.Add((IGameComponent)this.sman);
     this.graphics.PreferMultiSampling = true;
     NameGenerator.init();
     PatternDrawer.init(this.Content);
     ProgramList.init();
     Cube3D.Initilize(this.graphics.GraphicsDevice);
     AlienwareFXManager.Init();
     this.graphics.GraphicsDevice.DeviceLost += new EventHandler <EventArgs>(this.GraphicsDevice_DeviceLost);
     base.Initialize();
 }
示例#11
0
 protected override void Initialize()
 {
     sman = new ScreenManager(this);
     Components.Add(sman);
     graphics.PreferMultiSampling = true;
     NameGenerator.init();
     Helpfile.init();
     FileEntry.init(Content);
     PatternDrawer.init(Content);
     ProgramList.init();
     Cube3D.Initilize(graphics.GraphicsDevice);
     base.Initialize();
 }
示例#12
0
        public override void Draw(GameTime gameTime)
        {
            base.Draw(gameTime);
            PostProcessor.begin();
            ScreenManager.FadeBackBufferToBlack(byte.MaxValue);
            GuiData.startDraw();
            PatternDrawer.draw(
                new Rectangle(0, 0, ScreenManager.GraphicsDevice.Viewport.Width,
                              ScreenManager.GraphicsDevice.Viewport.Height), 0.5f, Color.Black, new Color(2, 2, 2),
                GuiData.spriteBatch);
            if (Button.doButton(999, 10, 10, 200, 30, "<- Back", Color.Gray))
            {
                SettingsLoader.writeStatusFile();
                ExitScreen();
            }
            TextItem.doLabel(new Vector2(400f, 65f), "Resolutions", new Color?());
            var num = currentResIndex;

            currentResIndex = SelectableTextList.doFancyList(10, 400, 100, 200, 450, resolutions, currentResIndex,
                                                             new Color?(), false);
            if (!mouseHasBeenReleasedOnThisScreen)
            {
                currentResIndex = num;
            }
            else if (SelectableTextList.wasActivated)
            {
                resolutionChanged = true;
            }
            TextItem.doLabel(new Vector2(100f, 64f), "Fullscreen", new Color?());
            windowed = CheckBox.doCheckBox(20, 100, 100, windowed, new Color?());
            TextItem.doLabel(new Vector2(100f, 124f), "Bloom", new Color?());
            PostProcessor.bloomEnabled = CheckBox.doCheckBox(21, 100, 160, PostProcessor.bloomEnabled, new Color?());
            TextItem.doLabel(new Vector2(100f, 184f), "Scanlines", new Color?());
            PostProcessor.scanlinesEnabled = CheckBox.doCheckBox(22, 100, 220, PostProcessor.scanlinesEnabled,
                                                                 new Color?());
            TextItem.doLabel(new Vector2(100f, 244f), "Sound Enabled", new Color?());
            MusicManager.setIsMuted(!CheckBox.doCheckBox(23, 100, 280, !MusicManager.isMuted, new Color?()));
            TextItem.doLabel(new Vector2(100f, 305f), "Music Volume", new Color?());
            MusicManager.setVolume(SliderBar.doSliderBar(24, 100, 350, 210, 30, 1f, 0.0f, MusicManager.getVolume(),
                                                         1.0f / 1000.0f));
            TextItem.doLabel(new Vector2(100f, 384f), "Text Size", new Color?());
            currentFontIndex = SelectableTextList.doFancyList(25, 100, 414, 200, 160, fontConfigs, currentFontIndex,
                                                              new Color?(), false);
            if (Button.doButton(990, 10, ScreenManager.GraphicsDevice.Viewport.Height - 120, 200, 30, "Apply Changes",
                                Color.LightBlue))
            {
                needsApply = true;
            }
            GuiData.endDraw();
            PostProcessor.end();
        }
示例#13
0
        public override void Draw(float t)
        {
            base.Draw(t);
            this.drawOutline();
            this.drawTarget("app:");
            Rectangle contentAreaDest = this.GetContentAreaDest();

            contentAreaDest.X      += 2;
            contentAreaDest.Width  -= 4;
            contentAreaDest.Height -= Module.PANEL_HEIGHT + 1;
            contentAreaDest.Y      += Module.PANEL_HEIGHT;
            PatternDrawer.draw(contentAreaDest, -1f, Color.Transparent, this.os.darkBackgroundColor, this.spriteBatch);
            PatternDrawer.draw(contentAreaDest, 3f, Color.Transparent, this.os.lockedColor, this.spriteBatch, PatternDrawer.errorTile);
        }
示例#14
0
        public override void Draw(float t)
        {
            base.Draw(t);
            drawOutline();
            drawTarget("app:");
            var dest = bounds;

            dest.X      += 2;
            dest.Width  -= 4;
            dest.Height -= PANEL_HEIGHT + 1;
            dest.Y      += PANEL_HEIGHT;
            PatternDrawer.draw(dest, -1f, Color.Transparent, os.darkBackgroundColor, spriteBatch);
            PatternDrawer.draw(dest, 3f, Color.Transparent, os.lockedColor, spriteBatch, PatternDrawer.errorTile);
        }
示例#15
0
 protected override void Update(GameTime gameTime)
 {
     if (!HasLoadedContent)
     {
         LoadContent();
     }
     if (!resolutionSet)
     {
         setNewGraphics();
         resolutionSet = true;
     }
     PatternDrawer.update((float)gameTime.ElapsedGameTime.TotalSeconds);
     GuiData.setTimeStep((float)gameTime.ElapsedGameTime.TotalSeconds);
     MusicManager.Update((float)gameTime.ElapsedGameTime.TotalSeconds);
     ThemeManager.Update((float)gameTime.ElapsedGameTime.TotalSeconds);
     base.Update(gameTime);
 }
示例#16
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);
            }
        }
示例#17
0
 private void drawMainIntro(Rectangle dest)
 {
     if ((double)this.currentStateTimer < 0.800000011920929)
     {
         if ((double)this.currentStateTimer % 0.200000002980232 < 0.0700000002980232)
         {
             PatternDrawer.draw(dest, 3f, this.os.darkBackgroundColor * 0.2f, this.os.lockedColor, this.spriteBatch, PatternDrawer.binaryTile);
         }
         else
         {
             this.spriteBatch.DrawString(GuiData.detailfont, "M3^ORK CO3@PI\"} DGT^C.D\n##Ini$$!l^zi/g SQ: -!re 3@Hp##>#>##>#>#>#>>>>>".Replace("#", ""), new Vector2((float)(dest.X + 2), (float)(dest.Y + 2)), Color.White);
         }
     }
     else
     {
         this.spriteBatch.DrawString(GuiData.detailfont, this.getDelayDrawString("MEMORY CORRUPTION DETECTED\n##Initializing SQL Core Dump##>#>##>#>#>#>>>>>", this.currentStateTimer - 0.8f), new Vector2((float)(dest.X + 2), (float)(dest.Y + 2)), Color.White);
     }
 }
示例#18
0
        public void RenderMainDisplay(Rectangle dest, SpriteBatch sb)
        {
            dest = this.RenderMainDisplayHeaders(dest, sb);
            switch (this.State)
            {
            case MemoryForensicsExe.MemForensicsState.Error:
                PatternDrawer.draw(dest, 1f, Color.Transparent, Utils.AddativeRed, this.spriteBatch, PatternDrawer.errorTile);
                Rectangle rectangle1 = new Rectangle(dest.X, dest.Y + dest.Height / 3, dest.Width, 60);
                sb.Draw(Utils.white, rectangle1, Color.Black * 0.4f);
                TextItem.doFontLabelToSize(rectangle1, LocaleTerms.Loc("ERROR"), GuiData.font, Color.White, true, true);
                Rectangle rectangle2 = new Rectangle(dest.X, rectangle1.Y + rectangle1.Height + 2, dest.Width, dest.Height / 2);
                sb.Draw(Utils.white, rectangle2, Color.Black * 0.8f);
                string text = Utils.SuperSmartTwimForWidth(this.ErrorMessage.Length > 500 ? this.ErrorMessage.Substring(0, 500) : this.ErrorMessage, rectangle2.Width, GuiData.smallfont);
                TextItem.doFontLabelToSize(rectangle2, text, GuiData.smallfont, Utils.AddativeRed, true, true);
                if (!Button.doButton(381023801, dest.X + 2, rectangle2.Y + rectangle2.Height + 2, this.bounds.Width / 3, 30, LocaleTerms.Loc("Close"), new Color?(this.os.lockedColor)))
                {
                    break;
                }
                this.isExiting = true;
                break;

            case MemoryForensicsExe.MemForensicsState.ReadingFile:
                Rectangle bounds = new Rectangle(dest.X, dest.Y, (int)((double)dest.Width * ((double)this.timeInCurrentState / 2.0)), dest.Height);
                bounds = new Rectangle(dest.X + (int)((double)dest.Width * (1.0 - (double)this.timeInCurrentState / 2.0)), dest.Y, (int)((double)dest.Width * ((double)this.timeInCurrentState / 2.0)), dest.Height);
                this.GridEffect.RenderGrid(bounds, sb, this.ThemeColorDark * 0.5f, this.ThemeColorMain, this.ThemeColorDark, false);
                break;

            case MemoryForensicsExe.MemForensicsState.Main:
                this.DrawMainStateBackground(dest, sb);
                this.RenderMenuMainState(dest, sb);
                break;

            case MemoryForensicsExe.MemForensicsState.Processing:
                this.DrawMainStateBackground(dest, sb);
                this.RenderResultsDisplayMainState(dest, sb, true);
                break;

            case MemoryForensicsExe.MemForensicsState.DisplayingSolution:
                this.DrawMainStateBackground(dest, sb);
                this.RenderResultsDisplayMainState(dest, sb, false);
                break;
            }
        }
示例#19
0
        public override void Draw(float t)
        {
            base.Draw(t);
            drawOutline();
            var rectangle = bounds;

            ++rectangle.X;
            ++rectangle.Y;
            rectangle.Width  -= 2;
            rectangle.Height -= 2;
            rectangle.Height -= PANEL_HEIGHT;
            rectangle.Y      += PANEL_HEIGHT;
            PatternDrawer.draw(rectangle, 1f, os.highlightColor * 0.2f, os.highlightColor, spriteBatch);
            rectangle.X      += 2;
            rectangle.Y      += 2;
            rectangle.Width  -= 4;
            rectangle.Height -= 4;
            spriteBatch.Draw(Utils.white, rectangle, os.darkBackgroundColor * 0.99f);
            spriteBatch.Draw(Utils.white, rectangle, os.highlightColor * flashTimer);
            drawTarget("");
            spriteBatch.DrawString(GuiData.font, "Tutorial", new Vector2(bounds.X + 3, bounds.Y + 22),
                                   os.subtleTextColor);
            var num      = 12f;
            var position = new Vector2(bounds.X + 5, bounds.Y + 57);

            for (var index = 0; index < renderText.Length; ++index)
            {
                var text = renderText[index];
                if (text.Length > 0)
                {
                    var flag = false;
                    if (text[0] == 35)
                    {
                        text = text.Substring(1, text.Length - 2);
                        flag = true;
                    }
                    spriteBatch.DrawString(GuiData.tinyfont, text, position, flag ? os.highlightColor : Color.White);
                    position.Y += num;
                }
            }
            position.Y += num;
        }
示例#20
0
        public override void Draw(float t)
        {
            base.Draw(t);
            this.drawOutline();
            Rectangle bounds = this.bounds;

            ++bounds.X;
            ++bounds.Y;
            bounds.Width  -= 2;
            bounds.Height -= 2;
            bounds.Height -= Module.PANEL_HEIGHT;
            bounds.Y      += Module.PANEL_HEIGHT;
            PatternDrawer.draw(bounds, 1f, this.os.highlightColor * 0.2f, this.os.highlightColor, this.spriteBatch);
            bounds.X      += 2;
            bounds.Y      += 2;
            bounds.Width  -= 4;
            bounds.Height -= 4;
            this.spriteBatch.Draw(Utils.white, bounds, this.os.darkBackgroundColor * 0.99f);
            this.spriteBatch.Draw(Utils.white, bounds, this.os.highlightColor * this.flashTimer);
            this.drawTarget("");
            this.spriteBatch.DrawString(GuiData.font, "Tutorial", new Vector2((float)(this.bounds.X + 3), (float)(this.bounds.Y + 22)), this.os.subtleTextColor);
            float   num      = 12f;
            Vector2 position = new Vector2((float)(this.bounds.X + 5), (float)(this.bounds.Y + 57));

            for (int index = 0; index < this.renderText.Length; ++index)
            {
                string text = this.renderText[index];
                if (text.Length > 0)
                {
                    bool flag = false;
                    if ((int)text[0] == 35)
                    {
                        text = text.Substring(1, text.Length - 2);
                        flag = true;
                    }
                    this.spriteBatch.DrawString(GuiData.tinyfont, text, position, flag ? this.os.highlightColor : Color.White);
                    position.Y += num;
                }
            }
            position.Y += num;
        }
示例#21
0
        public override void draw(Rectangle bounds, SpriteBatch sb)
        {
            base.draw(bounds, sb);
            if (state == ISPDaemonState.AdminOnlyError || state == ISPDaemonState.NotFoundError)
            {
                PatternDrawer.draw(bounds, 0.1f, Color.Transparent, os.lockedColor, sb, PatternDrawer.errorTile);
            }
            var bounds1 = new Rectangle(bounds.X + 40, bounds.Y + 40, bounds.Width - 80, bounds.Height - 80);

            switch (state)
            {
            case ISPDaemonState.Welcome:
                DrawWelcomeScreen(bounds1, sb, bounds);
                break;

            case ISPDaemonState.About:
                DrawAboutScreen(bounds1, sb);
                break;

            case ISPDaemonState.Loading:
                DrawLoadingScreen(bounds1, sb);
                break;

            case ISPDaemonState.IPEntry:
                DrawIPEntryScreen(bounds1, sb);
                break;

            case ISPDaemonState.EnterIP:
                DrawEnterIPScreen(bounds1, sb);
                break;

            case ISPDaemonState.AdminOnlyError:
                DrawAdminOnlyError(bounds1, sb);
                break;

            case ISPDaemonState.NotFoundError:
                DrawNotFoundError(bounds1, sb);
                break;
            }
            drawOutlineEffect(bounds, sb);
        }
示例#22
0
 public void doGui()
 {
     PatternDrawer.draw(new Rectangle(180, 160, 500, 85), 1f, darkgrey, dark_ish_gray, GuiData.spriteBatch);
     TextItem.doSmallLabel(new Vector2(200f, 170f), "IP To Connect to:", new Color?());
     destination = TextBox.doTextBox(100, 200, 200, 300, 1, destination, GuiData.smallfont);
     if (Button.doButton(123, 510, 201, 120, 23, "Connect", new Color?()) || TextBox.BoxWasActivated)
     {
         ConnectToServer(destination);
     }
     else
     {
         if (isConnecting)
         {
             drawConnectingGui();
         }
         TextItem.doLabel(new Vector2(200f, 300f), "Local IPs: " + myIP, new Color?());
         var y = 340f;
         for (var index = 0; index < allLocalIPs.Count - 1; ++index)
         {
             TextItem.doLabel(new Vector2(351f, y), allLocalIPs[index], new Color?());
             y += 40f;
         }
         TextItem.doLabel(new Vector2(200f, y + 40f), "Extrn IP: " + externalIP, new Color?());
         var pos = new Vector2(610f, 280f);
         TextItem.doLabel(pos, "Info:", new Color?());
         pos.Y += 40f;
         var text =
             DisplayModule.cleanSplitForWidth(
                 "To Begin a multiplayer session, type in the IP of the computer you want to connect to and press enter or connect. Both players must be on this screen. To connect over the internet, use the extern IP address and ensure port 3030 is open.",
                 400);
         TextItem.doFontLabel(pos, text, GuiData.tinyfont, Color.DarkGray, float.MaxValue, float.MaxValue);
         if (!Button.doButton(999, 10, 10, 200, 30, "<- Back to Menu", Color.Gray))
         {
             return;
         }
         ExitScreen();
         ScreenManager.AddScreen(new MainMenu(), ScreenManager.controllingPlayer);
     }
 }
示例#23
0
        private void DrawError(Rectangle dest, SpriteBatch sb)
        {
            Rectangle drawRectForRow1 = this.GetDrawRectForRow(0, 12);
            bool      flag            = this.Permissions == DatabaseDaemon.DatabasePermissions.Public || this.comp.adminIP == this.os.thisComputer.ip;

            TextItem.doFontLabelToSize(drawRectForRow1, this.name, GuiData.font, Color.White, false, 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, Utils.AddativeRed * 0.2f, sb, flag ? PatternDrawer.thinStripe : PatternDrawer.errorTile);
            TextItem.doFontLabelToSize(this.GetDrawRectForRow(1, 12), LocaleTerms.Loc("ERROR"), GuiData.font, Utils.AddativeRed * 0.8f, true, true);
            Rectangle drawRectForRow2 = this.GetDrawRectForRow(2, 14);

            if (Button.doButton(73616101, (int)this.BlockStartTopLeft.X, drawRectForRow2.Y, dest.Width / 2, drawRectForRow2.Height, LocaleTerms.Loc("Back"), new Color?(this.ThemeColor)))
            {
                this.State = DatabaseDaemon.DatabaseState.Welcome;
            }
            Rectangle rectangle = this.GetDrawRectForRow(3, 14);

            rectangle.Height = (int)(((double)this.blocksHigh - 4.0) * (double)this.blockSize);
            rectangle        = Utils.InsetRectangle(rectangle, 2);
            string text = Utils.SuperSmartTwimForWidth(this.errorMessage, rectangle.Width, GuiData.smallfont);

            this.TextRegion.Draw(rectangle, text, sb, Utils.AddativeRed);
        }
示例#24
0
        public override void Draw(float t)
        {
            base.Draw(t);
            this.drawOutline();
            this.drawTarget("app:");
            Rectangle contentAreaDest = this.GetContentAreaDest();

            if (contentAreaDest.Height < 5)
            {
                return;
            }
            PatternDrawer.draw(contentAreaDest, 0.1f, Color.Transparent, this.os.highlightColor * 0.1f, this.spriteBatch, PatternDrawer.wipTile);
            int       height    = Math.Min(contentAreaDest.Height / 2, 30);
            Rectangle rectangle = new Rectangle(contentAreaDest.X, contentAreaDest.Y + contentAreaDest.Height / 2 - height, contentAreaDest.Width, height);

            this.spriteBatch.Draw(Utils.white, rectangle, Color.Black);
            if (this.DownloadComplete)
            {
                this.spriteBatch.Draw(Utils.white, rectangle, this.DidFail ? Color.Red * 0.5f : this.os.highlightColor * 0.5f);
                TextItem.doFontLabelToSize(Utils.InsetRectangle(rectangle, 4), this.DidFail ? LocaleTerms.Loc("Empty Scan Detected") : LocaleTerms.Loc("Download Complete"), GuiData.smallfont, Utils.AddativeWhite, true, false);
                rectangle.Y      += rectangle.Height;
                rectangle.Height -= 4;
                rectangle.X      += 4;
                rectangle.Width  -= 8;
                if (this.DidFail)
                {
                    return;
                }
                TextItem.doFontLabelToSize(rectangle, this.savedFileName, GuiData.font, Utils.AddativeWhite, true, false);
            }
            else
            {
                float num = this.elapsedTime / 6f;
                rectangle.Width = (int)((double)rectangle.Width * (double)num);
                this.spriteBatch.Draw(Utils.white, rectangle, this.os.highlightColor * 0.5f);
            }
        }
        private void DrawNoAdminMenuSection(Rectangle bounds, SpriteBatch sb)
        {
            bounds.Height -= 2;
            ++bounds.X;
            bounds.Width  -= 2;
            bounds.Height -= 30;
            PatternDrawer.draw(bounds, 0.2f, Color.Transparent, os.brightLockedColor, sb, PatternDrawer.errorTile);
            bounds.Height += 30;
            var dest = bounds;

            dest.Height = 36;
            dest.Y      = bounds.Y + bounds.Height / 2 - dest.Height / 2;
            DrawMessage("Admin Access", true, sb, dest, os.brightLockedColor * 0.8f, Color.Black);
            dest.Y     += dest.Height + 2;
            dest.Height = 22;
            DrawMessage("Required for use", false, sb, dest, theme_back, os.brightLockedColor);
            if (
                !Button.doButton(444402800, bounds.X + 1, bounds.Y + bounds.Height - 28, bounds.Width, 24,
                                 "Exit Database View", os.lockedColor))
            {
                return;
            }
            os.display.command = "connect";
        }
示例#26
0
        private void DrawBasePanel(Rectangle dest)
        {
            var width = Math.Min(120, (dest.Width - 8) / 2);

            if (Button.doButton(631012 + os.exes.IndexOf(this), dest.X + dest.Width - width, dest.Y + 4, width,
                                dest.Height - 6, "Close", os.lockedColor * fade))
            {
                if (gettingNewNote)
                {
                    os.terminal.executeLine();
                    gettingNewNote = false;
                }
                Completed();
                RemoveReopnener();
                isExiting = true;
            }
            if (!gettingNewNote &&
                Button.doButton(631014 + os.exes.IndexOf(this), dest.X, dest.Y + 4, width, dest.Height - 6, "Add Note",
                                os.highlightColor * fade))
            {
                os.runCommand("getString Note");
                os.getStringCache = "";
                gettingNewNote    = true;
            }
            else
            {
                if (!gettingNewNote)
                {
                    return;
                }
                var dest1 = new Rectangle(dest.X, dest.Y + 4, width, dest.Height - 6);
                PatternDrawer.draw(dest1, 1f, Color.Transparent, os.highlightColor * 0.5f, spriteBatch,
                                   PatternDrawer.thinStripe);
                TextItem.doFontLabelToSize(dest1, "Type In Terminal...", GuiData.smallfont, Color.White);
            }
        }
示例#27
0
        public void doRespondDisplay(Rectangle bounds, SpriteBatch sb)
        {
            Vector2 pos   = new Vector2((float)(bounds.X + 2), (float)(bounds.Y + 20));
            string  str   = (string)null;
            int     width = bounds.Width - 20 - this.corner.Width;

            if (Button.doButton(800007, (int)pos.X, (int)pos.Y, width, 30, LocaleTerms.Loc("Return to Inbox"), new Color?(this.os.darkBackgroundColor)))
            {
                this.state = 3;
            }
            pos.Y += 50f;
            int num1 = 24;

            TextItem.doFontLabel(pos, LocaleTerms.Loc("Additional Details") + " :", GuiData.smallfont, new Color?(), (float)bounds.Width - (float)(((double)pos.X - (double)bounds.Width) * 1.20000004768372), float.MaxValue, false);
            pos.Y += (float)num1;
            for (int index = 0; index < this.emailReplyStrings.Count; ++index)
            {
                TextItem.doFontLabel(pos + new Vector2(25f, 0.0f), this.emailReplyStrings[index], GuiData.tinyfont, new Color?(), (float)((double)bounds.Width - ((double)pos.X - (double)bounds.X) * 2.0 - 20.0), float.MaxValue, false);
                float num2 = Math.Min(GuiData.tinyfont.MeasureString(this.emailReplyStrings[index]).X, (float)((double)bounds.Width - ((double)pos.X - (double)bounds.X) * 2.0 - 20.0));
                if (Button.doButton(80000 + index * 100, (int)((double)pos.X + (double)num2 + 30.0), (int)pos.Y, 20, 20, "-", new Color?()))
                {
                    this.emailReplyStrings.RemoveAt(index);
                }
                pos.Y += (float)num1;
            }
            if (this.addingNewReplyString)
            {
                string data             = (string)null;
                bool   getStringCommand = Programs.parseStringFromGetStringCommand(this.os, out data);
                if (data == null)
                {
                    data = "";
                }
                pos.Y += 5f;
                GuiData.spriteBatch.Draw(Utils.white, new Rectangle(bounds.X + 1, (int)pos.Y, bounds.Width - 2 - bounds.Width / 9, 40), this.os.indentBackgroundColor);
                pos.Y += 10f;
                TextItem.doFontLabel(pos + new Vector2(25f, 0.0f), data, GuiData.tinyfont, new Color?(), float.MaxValue, float.MaxValue, false);
                Vector2 vector2 = GuiData.tinyfont.MeasureString(data);
                vector2.Y = 0.0f;
                if ((double)this.os.timer % 1.0 <= 0.5)
                {
                    GuiData.spriteBatch.Draw(Utils.white, new Rectangle((int)((double)pos.X + (double)vector2.X + 2.0) + 25, (int)pos.Y, 4, 20), Color.White);
                }
                int num2 = bounds.Width - 1 - bounds.Width / 10;
                if (getStringCommand || Button.doButton(8000094, bounds.X + num2 - 4, (int)pos.Y - 10, bounds.Width / 9 - 3, 40, LocaleTerms.Loc("Add"), new Color?(this.os.highlightColor)))
                {
                    if (!getStringCommand)
                    {
                        this.os.terminal.executeLine();
                    }
                    this.addingNewReplyString = false;
                    this.emailReplyStrings.Add(data);
                    str = (string)null;
                }
                else
                {
                    str = data;
                }
            }
            else if (Button.doButton(8000098, (int)((double)pos.X + 25.0), (int)pos.Y, 20, 20, "+", new Color?()))
            {
                this.addingNewReplyString = true;
                this.os.execute("getString Detail");
                this.os.terminal.executionPreventionIsInteruptable = true;
            }
            pos.Y += 50f;
            if (Button.doButton(800008, (int)pos.X, (int)pos.Y, width, 30, LocaleTerms.Loc("Send"), new Color?()) && this.os.currentMission != null)
            {
                if (str != null)
                {
                    this.os.terminal.executeLine();
                    this.addingNewReplyString = false;
                    if (!string.IsNullOrEmpty(str))
                    {
                        this.emailReplyStrings.Add(str);
                    }
                }
                ActiveMission currentMission = this.os.currentMission;
                bool          flag           = this.attemptCompleteMission(this.os.currentMission);
                if (!flag)
                {
                    for (int index = 0; index < this.os.branchMissions.Count && !flag; ++index)
                    {
                        flag = this.attemptCompleteMission(this.os.branchMissions[index]);
                        if (flag)
                        {
                            this.os.branchMissions.Clear();
                        }
                    }
                }
                if (!flag)
                {
                    this.missionIncompleteReply = true;
                }
                else
                {
                    this.AddSentEmailRecordFileForMissionCompletion(currentMission, this.emailReplyStrings);
                }
            }
            pos.Y += 45f;
            if (Settings.forceCompleteEnabled && Button.doButton(800009, (int)pos.X, (int)pos.Y, width, 30, LocaleTerms.Loc("Force Complete"), new Color?()))
            {
                if (this.os.currentMission != null)
                {
                    this.os.currentMission.finish();
                    this.os.MissionCompleteFlashTime = 3f;
                }
                this.state = 3;
            }
            pos.Y += 70f;
            if (!this.missionIncompleteReply || !(this.comp.idName == "jmail"))
            {
                return;
            }
            PatternDrawer.draw(new Rectangle(bounds.X + 2, (int)pos.Y, bounds.Width - 4, 128), 1f, this.os.lockedColor * 0.1f, this.os.brightLockedColor, sb, PatternDrawer.errorTile);
            string  text      = LocaleTerms.Loc("Mission Incomplete");
            Vector2 vector2_1 = GuiData.font.MeasureString(text);

            TextItem.doLabel(new Vector2((float)(bounds.X + bounds.Width / 2) - vector2_1.X / 2f, pos.Y + 40f), text, new Color?());
        }
示例#28
0
        public override void Draw(float t)
        {
            base.Draw(t);
            drawOutline();
            var rectangle = this.bounds;

            ++rectangle.X;
            ++rectangle.Y;
            rectangle.Width  -= 2;
            rectangle.Height -= 2;
            rectangle.Height -= PANEL_HEIGHT;
            rectangle.Y      += PANEL_HEIGHT;
            PatternDrawer.draw(rectangle, 1f, os.highlightColor * 0.2f, os.highlightColor, spriteBatch);
            rectangle.X      += 2;
            rectangle.Y      += 2;
            rectangle.Width  -= 4;
            rectangle.Height -= 4;
            spriteBatch.Draw(Utils.white, rectangle, os.darkBackgroundColor * 0.99f);
            drawTarget("app:");
            var height1 = 260;
            var bounds  = new Rectangle(this.bounds.X + 1, this.bounds.Y + this.bounds.Height - height1,
                                        this.bounds.Width - 2, height1);

            bounceEffect.Draw(spriteBatch, bounds, Utils.AdditivizeColor(os.highlightColor) * 0.35f,
                              Utils.AddativeWhite * 0.5f);
            var height2 = 210;
            var destinationRectangle1 = new Rectangle(bounds.X, bounds.Y + (height1 - height2), bounds.Width, height2);

            spriteBatch.Draw(Utils.gradient, destinationRectangle1, new Rectangle?(), os.darkBackgroundColor, 0.0f,
                             Vector2.Zero, SpriteEffects.FlipVertically, 0.7f);
            var destinationRectangle2 = destinationRectangle1;

            destinationRectangle2.Y      = bounds.Y;
            destinationRectangle2.Height = height1 - height2;
            spriteBatch.Draw(Utils.white, destinationRectangle2, os.darkBackgroundColor);
            spriteBatch.Draw(Utils.white, rectangle, os.highlightColor * flashTimer);
            spriteBatch.DrawString(GuiData.font, Utils.FlipRandomChars("Tutorial", 0.024),
                                   new Vector2(this.bounds.X + 5, this.bounds.Y + 22), os.subtleTextColor * 0.6f);
            spriteBatch.DrawString(GuiData.font, "Tutorial", new Vector2(this.bounds.X + 5, this.bounds.Y + 22),
                                   os.subtleTextColor);
            var charHeight = GuiData.ActiveFontConfig.tinyFontCharHeight + 1f;
            var dpos       = RenderText(renderText, new Vector2(this.bounds.X + 5, this.bounds.Y + 67), charHeight, 1f);

            dpos.Y += charHeight;
            if (state == 0)
            {
                if (
                    !Button.doButton(2933201, this.bounds.X + 10, (int)(dpos.Y + 20.0), this.bounds.Width - 20, 30,
                                     "Continue", new Color?()) &&
                    (os.terminal.visible || !Utils.keyPressed(GuiData.lastInput, Keys.Enter, new PlayerIndex?())))
                {
                    return;
                }
                advanceState();
                startSound.Play(1f, 0.0f, 0.0f);
                startSound.Play(1f, 0.0f, 0.0f);
            }
            else
            {
                if (hintButtonText == null)
                {
                    return;
                }
                if (Button.doButton(2933202, this.bounds.X + 10, (int)(dpos.Y + 6.0), this.bounds.Width - 20, 20,
                                    "Hint", new Color?()))
                {
                    hintTextFadeTimer = 9f;
                }
                dpos.Y += 30f;
                dpos.X += 10f;
                var opacityMod = Math.Min(1f, hintTextFadeTimer / 3f);
                RenderText(hintButtonText, dpos, charHeight, opacityMod);
            }
        }
        public override void draw(Rectangle bounds, SpriteBatch sb)
        {
            base.draw(bounds, sb);
            PatternDrawer.draw(new Rectangle(bounds.X + 1, bounds.Y + 1, bounds.Width - 2, bounds.Height - 2), 0.28f,
                               Color.Transparent, themeColor * 0.1f, sb, PatternDrawer.thinStripe);
            drawTopBar(bounds, sb);
            if (!hasSysfile())
            {
                if (Button.doButton(800003, bounds.X + 10, bounds.Y + topBar.Height + 10, 300, 30, "Exit", themeColor))
                {
                    os.display.command = "connect";
                }
                PatternDrawer.draw(
                    new Rectangle(bounds.X + 1, bounds.Y + 1 + 64, bounds.Width - 2, bounds.Height - 2 - 64), 1f,
                    Color.Transparent, os.lockedColor, sb, PatternDrawer.errorTile);
                var num1 = bounds.X + 20;
                var num2 = bounds.Y + bounds.Height / 2 - 20;
                TextItem.doLabel(new Vector2(num1, num2), "CRITICAL ERROR", new Color?());
                var num3 = num2 + 40;
                TextItem.doSmallLabel(new Vector2(num1, num3),
                                      "ERROR #4040408 - NULL_SYSFILE\nUnhandled Exception - IOException@L 2217 :R 28\nSystem Files Corrupted and/or Destroyed\nContact the System Administrator",
                                      new Color?());
            }
            else
            {
                switch (state)
                {
                case 0:
                    if (Button.doButton(800003, bounds.X + 10, bounds.Y + topBar.Height + 10, 300, 30, "Exit",
                                        themeColor))
                    {
                        os.display.command = "connect";
                    }
                    sb.Draw(logo, new Rectangle(bounds.X + 30, bounds.Y + 115, 128, 128), Color.White);
                    TextItem.doFontLabel(new Vector2(bounds.X + 40 + 128, bounds.Y + 115),
                                         groupName + " Group\nMessage Board", GuiData.font, new Color?(), bounds.Width - 40, 60f);
                    if (
                        !Button.doButton(800004, bounds.X + 30, bounds.Y + bounds.Height / 2, 300, 40, "Login",
                                         themeColor))
                    {
                        break;
                    }
                    startLogin();
                    state = 3;
                    break;

                case 1:
                    if (Button.doButton(800003, bounds.X + 10, bounds.Y + topBar.Height + 10, 300, 30, "Exit",
                                        themeColor))
                    {
                        os.display.command = "connect";
                    }
                    var num4 = bounds.X + 10;
                    var num5 = bounds.Y + topBar.Height + 50;
                    logoRect.X = num4;
                    logoRect.Y = num5;
                    sb.Draw(logo, logoRect, Color.White);
                    var x = num4 + (logoRect.Width + 5);
                    TextItem.doLabel(new Vector2(x, num5), listingTitle, new Color?());
                    var y = num5 + 40;
                    for (var index = 0; index < missions.Count; ++index)
                    {
                        if (hasListingFile(missions[index].postingTitle))
                        {
                            if (Button.doButton(87654 + index, x, y, (int)(bounds.Width * 0.800000011920929), 30,
                                                missions[index].postingTitle, new Color?()))
                            {
                                state       = 2;
                                targetIndex = index;
                            }
                            y += 35;
                        }
                    }
                    break;

                case 2:
                    if (Button.doButton(800003, bounds.X + 10, bounds.Y + topBar.Height + 10, 300, 30, "Back",
                                        themeColor))
                    {
                        state = 1;
                    }
                    var num6 = 60;
                    var num7 = 84;
                    var destinationRectangle = new Rectangle(bounds.X + 30, bounds.Y + topBar.Height + num6, num7,
                                                             num7);
                    sb.Draw(logo, destinationRectangle, themeColor);
                    var num8 = num6 + 30;
                    TextItem.doFontLabel(new Vector2(bounds.X + 34 + num7, bounds.Y + topBar.Height + num8),
                                         missions[targetIndex].postingTitle, GuiData.font, new Color?(),
                                         bounds.Width - (36 + num7 + 6), 40f);
                    var num9 = num8 + 40;
                    PatternDrawer.draw(
                        new Rectangle(destinationRectangle.X + destinationRectangle.Width + 2,
                                      bounds.Y + topBar.Height + num9 - 8,
                                      bounds.Width - (destinationRectangle.X - bounds.X + destinationRectangle.Width + 10),
                                      PatternDrawer.warningStripe.Height / 2), 1f, Color.Transparent, themeColor, sb,
                        PatternDrawer.warningStripe);
                    var num10 = num9 + 36;
                    var text  = Utils.SuperSmartTwimForWidth(missions[targetIndex].postingBody, bounds.Width - 60,
                                                             GuiData.tinyfont);
                    TextItem.doFontLabel(new Vector2(bounds.X + 30, bounds.Y + topBar.Height + num10), text,
                                         GuiData.tinyfont, new Color?(), bounds.Width, bounds.Height - num10 - topBar.Height - 10);
                    var flag = os.currentFaction.idName.ToLower() == groupName.ToLower();
                    if (missionAssigner && os.currentMission == null &&
                        (flag &&
                         Button.doButton(800005, bounds.X + bounds.Width / 2 - 10, bounds.Y + bounds.Height - 35,
                                         bounds.Width / 2, 30, "Accept", os.highlightColor)))
                    {
                        os.currentMission = missions[targetIndex];
                        var activeMission =
                            (ActiveMission)ComputerLoader.readMission(missions[targetIndex].reloadGoalsSourceFile);
                        missions[targetIndex].sendEmail(os);
                        missions[targetIndex].ActivateSuppressedStartFunctionIfPresent();
                        removeMission(targetIndex);
                        state = 1;
                        break;
                    }
                    if (missionAssigner && os.currentMission != null)
                    {
                        if (os.currentMission.wasAutoGenerated &&
                            Button.doButton(8000105, bounds.X + 6, bounds.Y + bounds.Height - 29, 210, 25,
                                            "Abandon Current Contract", os.lockedColor))
                        {
                            os.currentMission = null;
                            os.currentFaction.contractAbbandoned(os);
                        }
                        TextItem.doFontLabel(new Vector2(bounds.X + 10, bounds.Y + bounds.Height - 52),
                                             "Mission Unavaliable : " +
                                             (flag ? "Complete Existing Contracts" : "user ID Assigned to Different Faction "),
                                             GuiData.smallfont, new Color?(), bounds.Width - 20, 30f);
                        break;
                    }
                    if (!missionAssigner || flag)
                    {
                        break;
                    }
                    TextItem.doFontLabel(new Vector2(bounds.X + 10, bounds.Y + bounds.Height - 52),
                                         "Mission Unavaliable : User ID Assigned to Different Faction ", GuiData.smallfont,
                                         new Color?(), bounds.Width - 20, 30f);
                    break;

                case 3:
                    doLoginDisplay(bounds, sb);
                    break;
                }
            }
        }
示例#30
0
        public override void Draw(GameTime gameTime)
        {
            base.Draw(gameTime);
            PostProcessor.begin();
            this.ScreenManager.FadeBackBufferToBlack((int)byte.MaxValue);
            GuiData.startDraw();
            int      x        = 0;
            int      y        = 0;
            Viewport viewport = this.ScreenManager.GraphicsDevice.Viewport;
            int      width    = viewport.Width;

            viewport = this.ScreenManager.GraphicsDevice.Viewport;
            int height = viewport.Height;

            PatternDrawer.draw(new Rectangle(x, y, width, height), 0.5f, Color.Black, new Color(2, 2, 2), GuiData.spriteBatch);
            if (Button.doButton(999, 10, 10, 220, 30, "<- " + LocaleTerms.Loc("Back"), new Color?(Color.Gray)))
            {
                SettingsLoader.writeStatusFile();
                this.ExitScreen();
            }
            if (Button.doButton(9907, 10, 44, 220, 20, LocaleTerms.Loc("Apply Changes"), new Color?(Color.LightBlue)))
            {
                this.needsApply = true;
            }
            int num1 = 100;

            TextItem.doLabel(new Vector2(400f, (float)num1), LocaleTerms.Loc("Resolutions"), new Color?(), 200f);
            int currentResIndex = this.currentResIndex;

            this.currentResIndex = SelectableTextList.doFancyList(10, 400, num1 + 36, 200, 450, this.resolutions, this.currentResIndex, new Color?(), false);
            if (!this.mouseHasBeenReleasedOnThisScreen)
            {
                this.currentResIndex = currentResIndex;
            }
            else if (SelectableTextList.wasActivated)
            {
                this.resolutionChanged = true;
            }
            if (!this.startedFromGameContext)
            {
                TextItem.doLabel(new Vector2(620f, (float)num1), LocaleTerms.Loc("Language"), new Color?(), 200f);
                int currentLocaleIndex = this.currentLocaleIndex;
                this.currentLocaleIndex = SelectableTextList.doFancyList(1013, 620, num1 + 36, 200, 450, this.localeNames, this.currentLocaleIndex, new Color?(), false);
                if (!this.mouseHasBeenReleasedOnThisScreen)
                {
                    this.currentLocaleIndex = currentLocaleIndex;
                }
                else if (SelectableTextList.wasActivated)
                {
                    LocaleActivator.ActivateLocale(LocaleActivator.SupportedLanguages[this.currentLocaleIndex].Code, Game1.getSingleton().Content);
                    Settings.ActiveLocale = LocaleActivator.SupportedLanguages[this.currentLocaleIndex].Code;
                }
            }
            int   num2     = 64;
            float MaxWidth = 280f;
            int   num3;

            TextItem.doLabel(new Vector2(100f, (float)(num3 = num2 + 36)), LocaleTerms.Loc("Fullscreen"), new Color?(), MaxWidth);
            int num4;

            this.windowed = CheckBox.doCheckBox(20, 100, num4 = num3 + 34, this.windowed, new Color?());
            int num5;

            TextItem.doLabel(new Vector2(100f, (float)(num5 = num4 + 32)), LocaleTerms.Loc("Bloom"), new Color?(), MaxWidth);
            int num6;

            PostProcessor.bloomEnabled = CheckBox.doCheckBox(21, 100, num6 = num5 + 34, PostProcessor.bloomEnabled, new Color?());
            int num7;

            TextItem.doLabel(new Vector2(100f, (float)(num7 = num6 + 32)), LocaleTerms.Loc("Scanlines"), new Color?(), MaxWidth);
            int num8;

            PostProcessor.scanlinesEnabled = CheckBox.doCheckBox(22, 100, num8 = num7 + 34, PostProcessor.scanlinesEnabled, new Color?());
            int num9;

            TextItem.doLabel(new Vector2(100f, (float)(num9 = num8 + 32)), LocaleTerms.Loc("Multisampling"), new Color?(), MaxWidth);
            bool shouldMultisample = SettingsLoader.ShouldMultisample;
            int  num10;

            SettingsLoader.ShouldMultisample = CheckBox.doCheckBox(221, 100, num10 = num9 + 34, SettingsLoader.ShouldMultisample, new Color?());
            if (shouldMultisample != SettingsLoader.ShouldMultisample)
            {
                this.resolutionChanged = true;
            }
            int num11;

            TextItem.doLabel(new Vector2(100f, (float)(num11 = num10 + 32)), LocaleTerms.Loc("Audio Visualiser"), new Color?(), MaxWidth);
            int num12;

            SettingsLoader.ShouldDrawMusicVis = CheckBox.doCheckBox(223, 100, num12 = num11 + 34, SettingsLoader.ShouldDrawMusicVis, new Color?());
            int num13;

            TextItem.doLabel(new Vector2(100f, (float)(num13 = num12 + 32)), LocaleTerms.Loc("Sound Enabled"), new Color?(), MaxWidth);
            int num14;

            MusicManager.setIsMuted(!CheckBox.doCheckBox(23, 100, num14 = num13 + 34, !MusicManager.isMuted, new Color?()));
            int num15;

            TextItem.doLabel(new Vector2(100f, (float)(num15 = num14 + 32)), LocaleTerms.Loc("Music Volume"), new Color?(), MaxWidth);
            int num16;

            MusicManager.setVolume(SliderBar.doSliderBar(24, 100, num16 = num15 + 34, 210, 30, 1f, 0.0f, MusicManager.getVolume(), 1f / 1000f));
            int num17;

            TextItem.doLabel(new Vector2(100f, (float)(num17 = num16 + 32)), LocaleTerms.Loc("Text Size"), new Color?(), MaxWidth);
            int currentFontIndex = this.currentFontIndex;
            int num18;

            this.currentFontIndex = SelectableTextList.doFancyList(25, 100, num18 = num17 + 34, 200, 160, this.fontConfigs, this.currentFontIndex, new Color?(), false);
            if (this.currentFontIndex != currentFontIndex && this.startedFromGameContext)
            {
                try
                {
                    if (OS.currentInstance != null)
                    {
                        OS.currentInstance.terminal.reset();
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine((object)ex);
                    Utils.AppendToErrorFile(Utils.GenerateReportFromException(ex));
                }
            }
            if (Button.doButton(990, 10, num18 + 150, 220, 30, LocaleTerms.Loc("Apply Changes"), new Color?(Color.LightBlue)))
            {
                this.needsApply = true;
            }
            GuiData.endDraw();
            PostProcessor.end();
        }