Exemplo n.º 1
0
 private void drawBackButton(Rectangle bounds, ISPDaemonState stateTo = ISPDaemonState.Welcome)
 {
     if (
         !Button.doButton(92271094, bounds.X + 30, bounds.Y + bounds.Height - 50, 200, 25, "Back", os.lockedColor))
     {
         return;
     }
     state = stateTo;
 }
Exemplo n.º 2
0
        private void DrawWelcomeScreen(Rectangle bounds, SpriteBatch sb, Rectangle fullBounds)
        {
            TextItem.doFontLabel(new Vector2(bounds.X + 20, bounds.Y + 20), "ISP Management System", GuiData.font,
                                 Color.White, bounds.Width, float.MaxValue);
            var height = 30;
            var width  = (int)(bounds.Width * 0.800000011920929);
            var num    = bounds.Y + 90;
            var destinationRectangle = fullBounds;

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

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

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

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

            if (Button.doButton(95371001, bounds.X + 20, y1, width, height, "About", os.highlightColor))
            {
                state = ISPDaemonState.About;
            }
            var y2 = y1 + (height + 10);

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

            if (!Button.doButton(95371008, bounds.X + 20, y3, width, height, "Exit", os.highlightColor))
            {
                return;
            }
            os.display.command = "connect";
        }
Exemplo n.º 3
0
        private void DrawLoadingScreen(Rectangle bounds, SpriteBatch sb)
        {
            var num1 = os.timer - timeEnteredLoadingScreen;

            if (num1 >= 2.0)
            {
                scannedComputer = null;
                for (var index = 0; index < os.netMap.nodes.Count; ++index)
                {
                    if (ipSearch == os.netMap.nodes[index].ip)
                    {
                        scannedComputer = os.netMap.nodes[index];
                        break;
                    }
                }
                if (scannedComputer != null)
                {
                    state             = ISPDaemonState.IPEntry;
                    inspectionFlagged = false;
                }
                else
                {
                    state = ISPDaemonState.NotFoundError;
                }
            }
            TextItem.doFontLabel(new Vector2(bounds.X + 30, bounds.Y + bounds.Height / 2 - 35),
                                 "Scanning for " + ipSearch + " ...", GuiData.font, Color.White, bounds.Width, float.MaxValue);
            var 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);
            var num2 = Utils.QuadraticOutCurve(num1 / 2f);

            destinationRectangle.Width = (int)(destinationRectangle.Width * (double)num2);
            sb.Draw(Utils.white, destinationRectangle, os.highlightColor);
        }
Exemplo n.º 4
0
 public override void navigatedTo()
 {
     state = ISPDaemonState.Welcome;
     base.navigatedTo();
 }
Exemplo n.º 5
0
 public override void navigatedTo()
 {
     state = ISPDaemonState.Welcome;
     base.navigatedTo();
 }
Exemplo n.º 6
0
 private void DrawWelcomeScreen(Rectangle bounds, SpriteBatch sb, Rectangle fullBounds)
 {
     TextItem.doFontLabel(new Vector2(bounds.X + 20, bounds.Y + 20), "ISP Management System", GuiData.font,
         Color.White, bounds.Width, float.MaxValue);
     var height = 30;
     var width = (int) (bounds.Width*0.800000011920929);
     var num = bounds.Y + 90;
     var destinationRectangle = fullBounds;
     destinationRectangle.Y = num - 20;
     destinationRectangle.Height = 22;
     var flag = comp.adminIP == os.thisComputer.ip;
     sb.Draw(Utils.white, destinationRectangle, flag ? os.unlockedColor : os.lockedColor);
     var text = "Valid Administrator Account Detected";
     if (!flag)
         text = "Non-Admin Account Active";
     var vector2 = GuiData.smallfont.MeasureString(text);
     var position = new Vector2(destinationRectangle.X + destinationRectangle.Width/2 - vector2.X/2f,
         destinationRectangle.Y);
     sb.DrawString(GuiData.smallfont, text, position, Color.White);
     var y1 = num + 30;
     if (Button.doButton(95371001, bounds.X + 20, y1, width, height, "About", os.highlightColor))
         state = ISPDaemonState.About;
     var y2 = y1 + (height + 10);
     if (Button.doButton(95371004, bounds.X + 20, y2, width, height, "Search for IP", os.highlightColor))
     {
         if (comp.adminIP == os.thisComputer.ip)
         {
             state = ISPDaemonState.EnterIP;
             os.execute("getString IP_Address");
             ipSearch = null;
         }
         else
             state = ISPDaemonState.AdminOnlyError;
     }
     var y3 = y2 + (height + 10);
     if (!Button.doButton(95371008, bounds.X + 20, y3, width, height, "Exit", os.highlightColor))
         return;
     os.display.command = "connect";
 }
Exemplo n.º 7
0
 private void drawBackButton(Rectangle bounds, ISPDaemonState stateTo = ISPDaemonState.Welcome)
 {
     if (
         !Button.doButton(92271094, bounds.X + 30, bounds.Y + bounds.Height - 50, 200, 25, "Back", os.lockedColor))
         return;
     state = stateTo;
 }
Exemplo n.º 8
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 = "";
 }
Exemplo n.º 9
0
 private void DrawLoadingScreen(Rectangle bounds, SpriteBatch sb)
 {
     var num1 = os.timer - timeEnteredLoadingScreen;
     if (num1 >= 2.0)
     {
         scannedComputer = null;
         for (var index = 0; index < os.netMap.nodes.Count; ++index)
         {
             if (ipSearch == os.netMap.nodes[index].ip)
             {
                 scannedComputer = os.netMap.nodes[index];
                 break;
             }
         }
         if (scannedComputer != null)
         {
             state = ISPDaemonState.IPEntry;
             inspectionFlagged = false;
         }
         else
             state = ISPDaemonState.NotFoundError;
     }
     TextItem.doFontLabel(new Vector2(bounds.X + 30, bounds.Y + bounds.Height/2 - 35),
         "Scanning for " + ipSearch + " ...", GuiData.font, Color.White, bounds.Width, float.MaxValue);
     var 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);
     var num2 = Utils.QuadraticOutCurve(num1/2f);
     destinationRectangle.Width = (int) (destinationRectangle.Width*(double) num2);
     sb.Draw(Utils.white, destinationRectangle, os.highlightColor);
 }