コード例 #1
0
        private static void OnDrawMainMenu(DrawMainMenuEvent args)
        {
            if (needsApproval == null)
            {
                return;
            }

            GuiData.spriteBatch.Draw(Utils.white,
                                     new Rectangle(0, 0, GuiData.spriteBatch.GraphicsDevice.Viewport.Width,
                                                   GuiData.spriteBatch.GraphicsDevice.Viewport.Height), new Color(0, 0, 0, 0.75f));

            TextItem.doLabel(new Vector2(650, 230), "Arbitary Code Warning", new Color(255, 130, 130));
            var endPfMessage = (int)TextItem.doMeasuredSmallLabel(new Vector2(650, 270),
                                                                  Utils.SuperSmartTwimForWidth(
                                                                      $"The extension {needsApproval.Name} contains DLLs inside the plugin folder that Pathfinder will attempt to load.\nThis will allow whatever code is in that DLL to be ran on your machine.\nPlease confirm that you acknowledge this and are comfortable with loading these plugins.\n\nLoading from {needsApproval.GetFullFolderPath()}",
                                                                      GuiData.spriteBatch.GraphicsDevice.Viewport.Width - 660, GuiData.smallfont), Color.White).Y + 280;
            var messageTextEnd = (int)TextItem.doMeasuredTinyLabel(new Vector2(650, endPfMessage), messages, Color.White).Y +
                                 endPfMessage + 10;

            Continue.Y = messageTextEnd;
            Cancel.Y   = messageTextEnd;
            if (Continue.Do())
            {
                approvedInfo  = needsApproval;
                needsApproval = null;
                screen.ActivateExtensionPage(approvedInfo);
            }
            else if (Cancel.Do())
            {
                needsApproval = null;
            }
        }
コード例 #2
0
        private void drawSearchState(Rectangle bounds, SpriteBatch sb)
        {
            if (Button.doButton(456010, bounds.X + 2, bounds.Y + 2, 160, 30, LocaleTerms.Loc("Back"), new Color?(this.darkThemeColor)))
            {
                this.state = AcademicDatabaseDaemon.ADDState.Welcome;
            }
            string  str       = "";
            int     x         = bounds.X + 6;
            int     num1      = bounds.Y + 100;
            Vector2 vector2_1 = TextItem.doMeasuredSmallLabel(new Vector2((float)x, (float)num1), LocaleTerms.Loc("Please enter the name you with to search for:"), new Color?());
            int     y1        = num1 + ((int)vector2_1.Y + 10);

            string[] strArray = this.os.getStringCache.Split(new string[1] {
                "#$#$#$$#$&$#$#$#$#"
            }, StringSplitOptions.None);
            if (strArray.Length > 1)
            {
                str = strArray[1];
                if (str.Equals(""))
                {
                    str = this.os.terminal.currentLine;
                }
            }
            Rectangle destinationRectangle = new Rectangle(x, y1, bounds.Width - 12, 80);

            sb.Draw(Utils.white, destinationRectangle, this.os.darkBackgroundColor);
            int     num2      = y1 + 28;
            Vector2 vector2_2 = TextItem.doMeasuredSmallLabel(new Vector2((float)x, (float)num2), LocaleTerms.Loc("Name") + ": " + str, new Color?());

            destinationRectangle.X      = x + (int)vector2_2.X + 2;
            destinationRectangle.Y      = num2;
            destinationRectangle.Width  = 7;
            destinationRectangle.Height = 20;
            if ((double)this.os.timer % 1.0 < 0.300000011920929)
            {
                sb.Draw(Utils.white, destinationRectangle, this.os.outlineColor);
            }
            int y2 = num2 + 122;

            if (strArray.Length <= 2 && !Button.doButton(30, x, y2, 300, 22, LocaleTerms.Loc("Search"), new Color?(this.os.highlightColor)))
            {
                return;
            }
            if (strArray.Length <= 2)
            {
                this.os.terminal.executeLine();
            }
            if (str.Length > 0)
            {
                this.state           = AcademicDatabaseDaemon.ADDState.PendingResult;
                this.searchedName    = str;
                this.searchStartTime = this.os.timer;
                this.comp.log("ACADEMIC_DATABASE::RecordSearch_:_" + str);
            }
            else
            {
                this.state = AcademicDatabaseDaemon.ADDState.EntryNotFound;
            }
        }
コード例 #3
0
        private void DrawEnterIPScreen(Rectangle bounds, SpriteBatch sb)
        {
            var strArray = os.getStringCache.Split(new string[1]
            {
                "#$#$#$$#$&$#$#$#$#"
            }, StringSplitOptions.None);
            string str       = null;
            var    x         = bounds.X + 10;
            var    num1      = bounds.Y + 10;
            var    vector2_1 = TextItem.doMeasuredSmallLabel(new Vector2(x, num1), "Enter IP Address to Scan for :",
                                                             new Color?());
            var y1 = num1 + ((int)vector2_1.Y + 5);

            if (strArray.Length > 1)
            {
                str = strArray[1];
                if (str.Equals(""))
                {
                    str = os.terminal.currentLine;
                }
            }
            var destinationRectangle = new Rectangle(x, y1, bounds.Width - 20, 200);

            sb.Draw(Utils.white, destinationRectangle, os.darkBackgroundColor);
            var num2      = y1 + 80;
            var vector2_2 = TextItem.doMeasuredSmallLabel(new Vector2(x, num2), "IP Address: " + str, new Color?());

            destinationRectangle.X      = x + (int)vector2_2.X + 2;
            destinationRectangle.Y      = num2;
            destinationRectangle.Width  = 7;
            destinationRectangle.Height = 20;
            if (os.timer % 1.0 < 0.300000011920929)
            {
                sb.Draw(Utils.white, destinationRectangle, os.outlineColor);
            }
            var y2 = num2 + 122;

            if (strArray.Length > 2 || Button.doButton(30, x, y2, 300, 22, "Scan", os.highlightColor))
            {
                if (strArray.Length <= 2)
                {
                    os.terminal.executeLine();
                }
                ipSearch = str;
                state    = ISPDaemonState.Loading;
                timeEnteredLoadingScreen = os.timer;
                os.getStringCache        = "";
            }
            var y3 = y2 + 26;

            if (!Button.doButton(35, x, y3, 300, 22, "Cancel", os.lockedColor))
            {
                return;
            }
            os.terminal.executeLine();
            state             = ISPDaemonState.Welcome;
            os.getStringCache = "";
        }
コード例 #4
0
ファイル: ISPDaemon.cs プロジェクト: hochladen/Hacknet
        private void DrawEnterIPScreen(Rectangle bounds, SpriteBatch sb)
        {
            string[] strArray = this.os.getStringCache.Split(new string[1] {
                "#$#$#$$#$&$#$#$#$#"
            }, StringSplitOptions.None);
            string  str       = (string)null;
            int     x         = bounds.X + 10;
            int     num1      = bounds.Y + 10;
            Vector2 vector2_1 = TextItem.doMeasuredSmallLabel(new Vector2((float)x, (float)num1), LocaleTerms.Loc("Enter IP Address to Scan for") + " :", new Color?());
            int     y1        = num1 + ((int)vector2_1.Y + 5);

            if (strArray.Length > 1)
            {
                str = strArray[1];
                if (str.Equals(""))
                {
                    str = this.os.terminal.currentLine;
                }
            }
            Rectangle destinationRectangle = new Rectangle(x, y1, bounds.Width - 20, 200);

            sb.Draw(Utils.white, destinationRectangle, this.os.darkBackgroundColor);
            int     num2      = y1 + 80;
            Vector2 vector2_2 = TextItem.doMeasuredSmallLabel(new Vector2((float)x, (float)num2), LocaleTerms.Loc("IP Address") + ": " + str, new Color?());

            destinationRectangle.X      = x + (int)vector2_2.X + 2;
            destinationRectangle.Y      = num2;
            destinationRectangle.Width  = 7;
            destinationRectangle.Height = 20;
            if ((double)this.os.timer % 1.0 < 0.300000011920929)
            {
                sb.Draw(Utils.white, destinationRectangle, this.os.outlineColor);
            }
            int y2 = num2 + 122;

            if (strArray.Length > 2 || Button.doButton(30, x, y2, 300, 22, LocaleTerms.Loc("Scan"), new Color?(this.os.highlightColor)))
            {
                if (strArray.Length <= 2)
                {
                    this.os.terminal.executeLine();
                }
                this.ipSearch = str;
                this.state    = ISPDaemon.ISPDaemonState.Loading;
                this.timeEnteredLoadingScreen = this.os.timer;
                this.os.getStringCache        = "";
            }
            int y3 = y2 + 26;

            if (!Button.doButton(35, x, y3, 300, 22, LocaleTerms.Loc("Cancel"), new Color?(this.os.lockedColor)))
            {
                return;
            }
            this.os.terminal.executeLine();
            this.state             = ISPDaemon.ISPDaemonState.Welcome;
            this.os.getStringCache = "";
        }
コード例 #5
0
        private void DrawRecord(Rectangle bounds, SpriteBatch sb, DeathRowEntry entry)
        {
            bounds.X     += 2;
            bounds.Width -= 2;
            var flag = TextItem.DrawShadow;

            TextItem.DrawShadow = false;
            var height = 850;

            ScrollablePanel.beginPanel(98302836, new Rectangle(bounds.X, bounds.Y, bounds.Width, height),
                                       recordScrollPosition);
            var num1      = bounds.Width - 16;
            var vector2_1 = new Vector2(5f, 5f);

            GuiData.spriteBatch.Draw(Logo, new Rectangle((int)vector2_1.X, (int)vector2_1.Y, 60, 60), Color.White);
            vector2_1.X += 70f;
            TextItem.doFontLabel(vector2_1, "DEATH ROW : EXECUTED OFFENDERS LISTING", GuiData.titlefont, themeColor,
                                 num1 - 80, 45f);
            vector2_1.Y += 22f;
            if (Button.doButton(98102855, (int)vector2_1.X, (int)vector2_1.Y, bounds.Width / 2, 25, "Return",
                                Color.Black))
            {
                SelectedIndex = -1;
            }
            vector2_1.X  = 5f;
            vector2_1.Y += 55f;
            TextItem.doFontLabel(vector2_1, "RECORD " + entry.RecordNumber, GuiData.titlefont, Color.White, num1 - 4,
                                 60f);
            vector2_1.Y += 70f;
            var seperatorHeight = 18;
            var margin          = 12;
            var drawPos         = DrawCompactLabel("Name:", entry.LName + ", " + entry.FName, vector2_1, margin, seperatorHeight,
                                                   num1);
            var pos  = DrawCompactLabel("Age:", entry.Age, drawPos, margin, seperatorHeight, num1);
            var num2 = 20;
            var num3 = 20;
            var zero = Vector2.Zero;

            TextItem.doFontLabel(pos, "Incident Report:", GuiData.smallfont, themeColor, num1, float.MaxValue);
            pos.Y += num2;
            TextItem.DrawShadow = false;
            var vector2_2 = TextItem.doMeasuredSmallLabel(pos,
                                                          Utils.SmartTwimForWidth(entry.IncidentReport, num1, GuiData.smallfont), Color.White);

            pos.Y += Math.Max(vector2_2.Y, num2);
            pos.Y += num3;
            TextItem.doFontLabel(pos, "Final Statement:", GuiData.smallfont, themeColor, num1, float.MaxValue);
            pos.Y    += num2;
            vector2_2 = TextItem.doMeasuredSmallLabel(pos,
                                                      Utils.SmartTwimForWidth(entry.Statement, num1, GuiData.smallfont), Color.White);
            pos.Y += num3;
            recordScrollPosition = ScrollablePanel.endPanel(98302836, recordScrollPosition, bounds,
                                                            height - bounds.Height, true);
            TextItem.DrawShadow = flag;
        }
コード例 #6
0
        public static void DrawMenu(ModManager.ModEntry modEntry, object[] param)
        {
            if (param == null || param.Length <= 1)
            {
                return;
            }
            if (param.Length == 2 && !((param[1] is Vector2) || (param[1] is Vector4)))
            {
                return;
            }
            if (!(param[0] is ScreenManager))
            {
                return;
            }
            ScreenManager screenManager = (ScreenManager)param[0];
            Vector4       ranged;

            if (param[1] is Vector2)
            {
                ranged = new Vector4((Vector2)param[1], screenManager.GraphicsDevice.Viewport.Width - ((Vector2)param[1]).X - 55, screenManager.GraphicsDevice.Viewport.Height - ((Vector2)param[1]).Y - 55);
            }
            else if (param[1] is Vector4)
            {
                ranged = (Vector4)param[1];
            }
            else if ((param[1] is int) && param.Length >= 3 && param.Length != 4)
            {
                int x = (int)param[1];
                int y = (int)param[2];

                int w = screenManager.GraphicsDevice.Viewport.Width - x - 55;
                int h = screenManager.GraphicsDevice.Viewport.Height - y - 55;

                if (param.Length == 5)
                {
                    w = (int)param[3];
                    h = (int)param[4];
                }

                ranged = new Vector4(x, y, w, h);
            }
            else
            {
                return;
            }

            TextItem.doMeasuredSmallLabel(new Vector2(ranged.X + 25, ranged.Y + 25), "ModsCore.Settings.FontName".Translate(), Color.White);
            settings.CurFont = SelectableTextList.doFancyList((modEntry.Info.Id + "FontName").GetHashCode(), (int)ranged.X, (int)ranged.Y + 50, (int)ranged.Z - 50, (int)ranged.W - 50, Main.FontName.ToArray(), settings.CurFont, Color.White);
        }
コード例 #7
0
        private void DrawRecord(Rectangle bounds, SpriteBatch sb, DeathRowDatabaseDaemon.DeathRowEntry entry)
        {
            bounds.X     += 2;
            bounds.Width -= 2;
            bool drawShadow = TextItem.DrawShadow;

            TextItem.DrawShadow = false;
            int height = 850;

            ScrollablePanel.beginPanel(98302836, new Rectangle(bounds.X, bounds.Y, bounds.Width, height), this.recordScrollPosition);
            int     num1      = bounds.Width - 16;
            Vector2 vector2_1 = new Vector2(5f, 5f);

            GuiData.spriteBatch.Draw(DeathRowDatabaseDaemon.Logo, new Rectangle((int)vector2_1.X, (int)vector2_1.Y, 60, 60), Color.White);
            vector2_1.X += 70f;
            TextItem.doFontLabel(vector2_1, "DEATH ROW : EXECUTED OFFENDERS LISTING", GuiData.titlefont, new Color?(this.themeColor), (float)(num1 - 80), 45f, false);
            vector2_1.Y += 22f;
            if (Button.doButton(98102855, (int)vector2_1.X, (int)vector2_1.Y, bounds.Width / 2, 25, "Return", new Color?(Color.Black)))
            {
                this.SelectedIndex = -1;
            }
            vector2_1.X  = 5f;
            vector2_1.Y += 55f;
            TextItem.doFontLabel(vector2_1, "RECORD " + entry.RecordNumber, GuiData.titlefont, new Color?(Color.White), (float)(num1 - 4), 60f, false);
            vector2_1.Y += 70f;
            int seperatorHeight = 18;
            int margin          = 12;

            vector2_1 = this.DrawCompactLabel(LocaleTerms.Loc("Name") + ":", entry.LName + ", " + entry.FName, vector2_1, margin, seperatorHeight, num1);
            vector2_1 = this.DrawCompactLabel(LocaleTerms.Loc("Age") + ":", entry.Age, vector2_1, margin, seperatorHeight, num1);
            int     num2      = 20;
            int     num3      = 20;
            Vector2 vector2_2 = Vector2.Zero;

            TextItem.doFontLabel(vector2_1, LocaleTerms.Loc("Incident Report") + ":", GuiData.smallfont, new Color?(this.themeColor), (float)num1, float.MaxValue, false);
            vector2_1.Y        += (float)num2;
            TextItem.DrawShadow = false;
            Vector2 vector2_3 = TextItem.doMeasuredSmallLabel(vector2_1, Utils.SmartTwimForWidth(entry.IncidentReport, num1, GuiData.smallfont), new Color?(Color.White));

            vector2_1.Y += Math.Max(vector2_3.Y, (float)num2);
            vector2_1.Y += (float)num3;
            TextItem.doFontLabel(vector2_1, LocaleTerms.Loc("Final Statement") + ":", GuiData.smallfont, new Color?(this.themeColor), (float)num1, float.MaxValue, false);
            vector2_1.Y += (float)num2;
            vector2_2    = TextItem.doMeasuredSmallLabel(vector2_1, Utils.SmartTwimForWidth(entry.Statement, num1, GuiData.smallfont), new Color?(Color.White));
            vector2_1.Y += (float)num3;
            this.recordScrollPosition = ScrollablePanel.endPanel(98302836, this.recordScrollPosition, bounds, (float)(height - bounds.Height), true);
            TextItem.DrawShadow       = drawShadow;
        }
コード例 #8
0
ファイル: DebugDaemon.cs プロジェクト: oxygencraft/DebugMod
        private void DrawDebug(Rectangle rect, Instance instance, float ticks, SpriteBatch sb)
        {
            OS           os      = instance.os;
            Color        colour  = new Color(45, 180, 231);
            const string doLabel = "doLabel";
            const string doMeasuredSmallLabel = "doMeasuredSmallLabel";
            const string doMeasuredTinyLabel  = "doMeasuredTinyLabel";
            const string doSmallLabel         = "doSmallLabel";

            TextItem.doLabel(new Vector2(500f, 400f), doLabel, null);
            TextItem.doMeasuredSmallLabel(new Vector2(500f, 500f), doMeasuredSmallLabel, null);
            TextItem.doMeasuredTinyLabel(new Vector2(500f, 600f), doMeasuredTinyLabel, null);
            TextItem.doSmallLabel(new Vector2(500f, 300f), doSmallLabel, null);
            if (Button.doButton(1, 800, 100, 200, 75, "Button", null))
            {
                State = DebugModState.HomePage;
            }
            Button.doButton(2, 685, 843, 25, 25, "<-", null);
            Button.doButton(2, 733, 843, 25, 25, "->", null);
        }
コード例 #9
0
        public static void DrawGetStringControlInactive(string prompt, string valueText, Rectangle bounds, SpriteBatch sb, object os_obj, string upperPrompt = null)
        {
            OS os = (OS)os_obj;

            upperPrompt = upperPrompt == null ? prompt : upperPrompt;
            string    str                  = valueText;
            int       x                    = bounds.X + 6;
            int       num1                 = bounds.Y + 2;
            Vector2   vector2_1            = TextItem.doMeasuredSmallLabel(new Vector2((float)x, (float)num1), upperPrompt, new Color?());
            int       y                    = num1 + ((int)vector2_1.Y + 10);
            Rectangle destinationRectangle = new Rectangle(x, y, bounds.Width - 12, bounds.Height - 46);

            sb.Draw(Utils.white, destinationRectangle, os.darkBackgroundColor);
            int     num2      = y + 28;
            Vector2 vector2_2 = TextItem.doMeasuredSmallLabel(new Vector2((float)x, (float)num2), prompt + str, new Color?());

            destinationRectangle.X      = x + (int)vector2_2.X + 2;
            destinationRectangle.Y      = num2;
            destinationRectangle.Width  = 7;
            destinationRectangle.Height = 20;
            int num3 = num2 + (bounds.Height - 44);
        }
コード例 #10
0
        public static string DrawGetStringControl(string prompt, Rectangle bounds, Action errorOccurs, Action cancelled,
                                                  SpriteBatch sb, object os_obj, Color SearchButtonColor, Color CancelButtonColor, string upperPrompt = null,
                                                  Color?BackingPanelColor = null)
        {
            var os = (OS)os_obj;

            upperPrompt = upperPrompt == null ? prompt : upperPrompt;
            var str  = "";
            var x    = bounds.X + 6;
            var y1   = bounds.Y + 2;
            var zero = Vector2.Zero;

            if (upperPrompt.Length > 0)
            {
                var vector2 = TextItem.doMeasuredSmallLabel(new Vector2(x, y1), upperPrompt, new Color?());
                y1 += (int)vector2.Y + 10;
            }
            var separator = new string[1]
            {
                "#$#$#$$#$&$#$#$#$#"
            };
            var strArray = os.getStringCache.Split(separator, StringSplitOptions.None);

            if (strArray.Length > 1)
            {
                str = strArray[1];
                if (str.Equals(""))
                {
                    str = os.terminal.currentLine;
                }
            }
            var destinationRectangle = new Rectangle(x, y1, bounds.Width - 12, bounds.Height - 46);

            sb.Draw(Utils.white, destinationRectangle,
                    BackingPanelColor.HasValue ? BackingPanelColor.Value : os.darkBackgroundColor);
            var num       = y1 + 18;
            var vector2_1 = TextItem.doMeasuredSmallLabel(new Vector2(x, num), prompt + str, new Color?());

            destinationRectangle.X      = x + (int)vector2_1.X + 2;
            destinationRectangle.Y      = num;
            destinationRectangle.Width  = 7;
            destinationRectangle.Height = 20;
            if (os.timer % 1.0 < 0.300000011920929)
            {
                sb.Draw(Utils.white, destinationRectangle, os.outlineColor);
            }
            var y2 = num + (bounds.Height - 44);

            if (strArray.Length > 2 || Button.doButton(30, x, y2, 300, 22, "Search", SearchButtonColor))
            {
                if (strArray.Length <= 2)
                {
                    os.terminal.executeLine();
                }
                if (str.Length > 0)
                {
                    return(str);
                }
                errorOccurs();
                return(null);
            }
            if (Button.doButton(38, x, y2 + 24, 300, 22, "Cancel", CancelButtonColor))
            {
                cancelled();
                os.terminal.clearCurrentLine();
                os.terminal.executeLine();
            }
            return(null);
        }
コード例 #11
0
        public static string DrawGetStringControl(string prompt, Rectangle bounds, Action errorOccurs, Action cancelled, SpriteBatch sb, object os_obj, Color SearchButtonColor, Color CancelButtonColor, string upperPrompt = null, Color?BackingPanelColor = null)
        {
            OS os = (OS)os_obj;

            upperPrompt = upperPrompt == null ? prompt : upperPrompt;
            string  str  = "";
            int     x    = bounds.X + 6;
            int     y1   = bounds.Y + 2;
            Vector2 zero = Vector2.Zero;

            if (upperPrompt.Length > 0)
            {
                Vector2 vector2 = TextItem.doMeasuredSmallLabel(new Vector2((float)x, (float)y1), upperPrompt, new Color?());
                y1 += (int)vector2.Y + 10;
            }
            string[] separator = new string[1] {
                "#$#$#$$#$&$#$#$#$#"
            };
            string[] strArray = os.getStringCache.Split(separator, StringSplitOptions.None);
            if (strArray.Length > 1)
            {
                str = strArray[1];
                if (str.Equals(""))
                {
                    str = os.terminal.currentLine;
                }
            }
            Rectangle destinationRectangle = new Rectangle(x, y1, bounds.Width - 12, bounds.Height - 46);

            sb.Draw(Utils.white, destinationRectangle, BackingPanelColor.HasValue ? BackingPanelColor.Value : os.darkBackgroundColor);
            int     num              = y1 + 18;
            string  bracketedBit     = "";
            string  bracketedSection = Utils.ExtractBracketedSection(prompt, out bracketedBit);
            Vector2 vector2_1        = TextItem.doMeasuredSmallLabel(new Vector2((float)x, (float)num), bracketedSection + str, new Color?());

            TextItem.doSmallLabel(new Vector2((float)x, (float)((double)num + (double)vector2_1.Y + 2.0)), bracketedBit, new Color?());
            destinationRectangle.X      = x + (int)vector2_1.X + 2;
            destinationRectangle.Y      = num;
            destinationRectangle.Width  = 7;
            destinationRectangle.Height = 20;
            if ((double)os.timer % 1.0 < 0.300000011920929)
            {
                sb.Draw(Utils.white, destinationRectangle, os.outlineColor);
            }
            int y2 = num + (bounds.Height - 44);

            if (strArray.Length > 2 || Button.doButton(30, x, y2, 300, 22, LocaleTerms.Loc("Search"), new Color?(SearchButtonColor)))
            {
                if (strArray.Length <= 2)
                {
                    os.terminal.executeLine();
                }
                if (str.Length > 0)
                {
                    return(str);
                }
                errorOccurs();
                return((string)null);
            }
            if (Button.doButton(38, x, y2 + 24, 300, 22, LocaleTerms.Loc("Cancel"), new Color?(CancelButtonColor)))
            {
                cancelled();
                os.terminal.clearCurrentLine();
                os.terminal.executeLine();
            }
            return((string)null);
        }
コード例 #12
0
        public override void draw(Rectangle bounds, SpriteBatch sb)
        {
            base.draw(bounds, sb);
            int x    = bounds.X + 10;
            int num1 = bounds.Y + 10;

            TextItem.doFontLabel(new Vector2((float)x, (float)num1), "Email Verification", GuiData.font, new Color?(), (float)(bounds.Width - 20), (float)bounds.Height, false);
            int num2 = num1 + 50;

            switch (this.state)
            {
            case 1:
                Vector2  vector2_1 = TextItem.doMeasuredSmallLabel(new Vector2((float)x, (float)num2), "Enter a secure email address :\nEnsure that you are the only one with access to it", new Color?());
                int      y1        = num2 + ((int)vector2_1.Y + 10);
                string[] strArray  = this.os.getStringCache.Split(new string[1] {
                    "#$#$#$$#$&$#$#$#$#"
                }, StringSplitOptions.None);
                if (strArray.Length > 1)
                {
                    this.email = strArray[1];
                    if (this.email.Equals(""))
                    {
                        this.email = this.os.terminal.currentLine;
                    }
                }
                Rectangle destinationRectangle = new Rectangle(x, y1, bounds.Width - 20, 200);
                sb.Draw(Utils.white, destinationRectangle, this.os.darkBackgroundColor);
                int     num3      = y1 + 80;
                Vector2 vector2_2 = TextItem.doMeasuredSmallLabel(new Vector2((float)x, (float)num3), "Email: " + this.email, new Color?());
                destinationRectangle.X      = x + (int)vector2_2.X + 2;
                destinationRectangle.Y      = num3;
                destinationRectangle.Width  = 7;
                destinationRectangle.Height = 20;
                if ((double)this.os.timer % 1.0 < 0.300000011920929)
                {
                    sb.Draw(Utils.white, destinationRectangle, this.os.outlineColor);
                }
                int y2 = num3 + 122;
                if (strArray.Length <= 2 && !Button.doButton(30, x, y2, 300, 22, "Confirm", new Color?(this.os.highlightColor)))
                {
                    break;
                }
                if (strArray.Length <= 2)
                {
                    this.os.terminal.executeLine();
                }
                this.state = 2;
                break;

            case 2:
                int num4 = num2 + 20;
                TextItem.doSmallLabel(new Vector2((float)x, (float)num4), "Confirm this Email Address :\n" + this.email, new Color?());
                int y3 = num4 + 60;
                if (Button.doButton(21, x, y3, 200, 50, "Confirm Email", new Color?(this.os.highlightColor)))
                {
                    if (!Settings.isDemoMode)
                    {
                        this.sendEmail();
                    }
                    else
                    {
                        this.saveEmail();
                    }
                }
                if (!Button.doButton(20, x + 220, y3, 200, 50, "Re-Enter Email", new Color?()))
                {
                    break;
                }
                this.state = 1;
                this.email = "";
                this.os.execute("getString Email");
                break;

            default:
                int y4 = num2 + (bounds.Height / 2 - 60);
                if (this.state == 3)
                {
                    TextItem.doSmallLabel(new Vector2((float)x, (float)(y4 - 60)), "Error - Invalid Email Address", new Color?());
                }
                if (Button.doButton(10, x, y4, 300, 50, "Add Email", new Color?(this.os.highlightColor)))
                {
                    this.state = 1;
                    this.os.execute("getString Email");
                }
                if (!Button.doButton(12, x, y4 + 55, 300, 20, LocaleTerms.Loc("Exit"), new Color?(this.os.lockedColor)))
                {
                    break;
                }
                this.os.display.command = "connect";
                break;
            }
        }
コード例 #13
0
        private void drawSearchState(Rectangle bounds, SpriteBatch sb)
        {
            if (Button.doButton(456010, bounds.X + 2, bounds.Y + 2, 160, 30, "Back", darkThemeColor))
            {
                state = ADDState.Welcome;
            }
            var str       = "";
            var x         = bounds.X + 6;
            var num1      = bounds.Y + 100;
            var vector2_1 = TextItem.doMeasuredSmallLabel(new Vector2(x, num1),
                                                          "Please enter the name you with to search for:", new Color?());
            var y1       = num1 + ((int)vector2_1.Y + 10);
            var strArray = os.getStringCache.Split(new string[1]
            {
                "#$#$#$$#$&$#$#$#$#"
            }, StringSplitOptions.None);

            if (strArray.Length > 1)
            {
                str = strArray[1];
                if (str.Equals(""))
                {
                    str = os.terminal.currentLine;
                }
            }
            var destinationRectangle = new Rectangle(x, y1, bounds.Width - 12, 80);

            sb.Draw(Utils.white, destinationRectangle, os.darkBackgroundColor);
            var num2      = y1 + 28;
            var vector2_2 = TextItem.doMeasuredSmallLabel(new Vector2(x, num2), "Name: " + str, new Color?());

            destinationRectangle.X      = x + (int)vector2_2.X + 2;
            destinationRectangle.Y      = num2;
            destinationRectangle.Width  = 7;
            destinationRectangle.Height = 20;
            if (os.timer % 1.0 < 0.300000011920929)
            {
                sb.Draw(Utils.white, destinationRectangle, os.outlineColor);
            }
            var y2 = num2 + 122;

            if (strArray.Length <= 2 && !Button.doButton(30, x, y2, 300, 22, "Search", os.highlightColor))
            {
                return;
            }
            if (strArray.Length <= 2)
            {
                os.terminal.executeLine();
            }
            if (str.Length > 0)
            {
                state           = ADDState.PendingResult;
                searchedName    = str;
                searchStartTime = os.timer;
                comp.log("ACADEMIC_DATABASE::RecordSearch_:_" + str);
            }
            else
            {
                state = ADDState.EntryNotFound;
            }
        }