Ejemplo n.º 1
0
 private void drawBackButton(Rectangle bounds, ISPDaemon.ISPDaemonState stateTo = ISPDaemon.ISPDaemonState.Welcome)
 {
     if (!Button.doButton(92271094, bounds.X + 30, bounds.Y + bounds.Height - 50, 200, 25, LocaleTerms.Loc("Back"), new Color?(this.os.lockedColor)))
     {
         return;
     }
     this.state = stateTo;
 }
Ejemplo n.º 2
0
        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 = "";
        }
Ejemplo n.º 3
0
        private void DrawWelcomeScreen(Rectangle bounds, SpriteBatch sb, Rectangle fullBounds)
        {
            TextItem.doFontLabel(new Vector2((float)(bounds.X + 20), (float)(bounds.Y + 20)), LocaleTerms.Loc("ISP Management System"), GuiData.font, new Color?(Color.White), (float)bounds.Width, float.MaxValue, false);
            int       height = 30;
            int       width  = (int)((double)bounds.Width * 0.800000011920929);
            int       num    = bounds.Y + 90;
            Rectangle destinationRectangle = fullBounds;

            destinationRectangle.Y      = num - 20;
            destinationRectangle.Height = 22;
            bool flag = this.comp.adminIP == this.os.thisComputer.ip;

            sb.Draw(Utils.white, destinationRectangle, flag ? this.os.unlockedColor : this.os.lockedColor);
            string text = LocaleTerms.Loc("Valid Administrator Account Detected");

            if (!flag)
            {
                text = LocaleTerms.Loc("Non-Admin Account Active");
            }
            Vector2 vector2  = GuiData.smallfont.MeasureString(text);
            Vector2 position = new Vector2((float)(destinationRectangle.X + destinationRectangle.Width / 2) - vector2.X / 2f, (float)destinationRectangle.Y);

            sb.DrawString(GuiData.smallfont, text, position, Color.White);
            int y1 = num + 30;

            if (Button.doButton(95371001, bounds.X + 20, y1, width, height, LocaleTerms.Loc("About"), new Color?(this.os.highlightColor)))
            {
                this.state = ISPDaemon.ISPDaemonState.About;
            }
            int y2 = y1 + (height + 10);

            if (Button.doButton(95371004, bounds.X + 20, y2, width, height, LocaleTerms.Loc("Search for IP"), new Color?(this.os.highlightColor)))
            {
                if (this.comp.adminIP == this.os.thisComputer.ip)
                {
                    this.state = ISPDaemon.ISPDaemonState.EnterIP;
                    this.os.execute("getString IP_Address");
                    this.ipSearch = (string)null;
                }
                else
                {
                    this.state = ISPDaemon.ISPDaemonState.AdminOnlyError;
                }
            }
            int y3 = y2 + (height + 10);

            if (!Button.doButton(95371008, bounds.X + 20, y3, width, height, LocaleTerms.Loc("Exit"), new Color?(this.os.highlightColor)))
            {
                return;
            }
            this.os.display.command = "connect";
        }
Ejemplo n.º 4
0
        private void DrawLoadingScreen(Rectangle bounds, SpriteBatch sb)
        {
            float num1 = this.os.timer - this.timeEnteredLoadingScreen;

            if ((double)num1 >= 2.0)
            {
                this.scannedComputer = (Computer)null;
                for (int index = 0; index < this.os.netMap.nodes.Count; ++index)
                {
                    if (this.ipSearch == this.os.netMap.nodes[index].ip)
                    {
                        this.scannedComputer = this.os.netMap.nodes[index];
                        break;
                    }
                }
                if (this.scannedComputer != null)
                {
                    this.state             = ISPDaemon.ISPDaemonState.IPEntry;
                    this.inspectionFlagged = false;
                }
                else
                {
                    this.state = ISPDaemon.ISPDaemonState.NotFoundError;
                }
            }
            TextItem.doFontLabel(new Vector2((float)(bounds.X + 30), (float)(bounds.Y + bounds.Height / 2 - 35)), LocaleTerms.Loc("Scanning for") + " " + this.ipSearch + " ...", GuiData.font, new Color?(Color.White), (float)bounds.Width, float.MaxValue, false);
            Rectangle destinationRectangle = new Rectangle(bounds.X + 10, bounds.Y + bounds.Height / 2, bounds.Width - 20, 16);

            sb.Draw(Utils.white, destinationRectangle, Color.Gray);
            ++destinationRectangle.X;
            ++destinationRectangle.Y;
            destinationRectangle.Width  -= 2;
            destinationRectangle.Height -= 2;
            sb.Draw(Utils.white, destinationRectangle, Color.Black);
            float num2 = Utils.QuadraticOutCurve(num1 / 2f);

            destinationRectangle.Width = (int)((double)destinationRectangle.Width * (double)num2);
            sb.Draw(Utils.white, destinationRectangle, this.os.highlightColor);
        }
Ejemplo n.º 5
0
 public override void navigatedTo()
 {
     this.state = ISPDaemon.ISPDaemonState.Welcome;
     base.navigatedTo();
 }