コード例 #1
0
ファイル: MissionHubServer.cs プロジェクト: hochladen/Hacknet
        private void doUserListScreen(Rectangle bounds, SpriteBatch sb)
        {
            if (Button.doButton(101801, bounds.X + 2, bounds.Y + 20, bounds.Width / 4, 22, LocaleTerms.Loc("Back"), new Color?(this.themeColor)))
            {
                this.state = MissionHubServer.HubState.Menu;
            }
            Rectangle rectangle = new Rectangle(bounds.X + 30, bounds.Y + 50, bounds.Width / 2, 30);
            int       num1      = 18 + rectangle.Height - 8;
            int       num2      = (bounds.Height - 90) / num1;
            int       num3      = num2 * this.userListPageNumber;
            int       num4      = 0;

            for (int index1 = num2 * this.userListPageNumber; index1 < this.usersFolder.files.Count && index1 < num3 + num2; ++index1)
            {
                string[] strArray = this.usersFolder.files[index1].data.Split(Utils.newlineDelim);
                string   str1;
                string   str2 = str1 = "";
                string   str3 = str1;
                string   str4 = str1;
                string   str5 = str1;
                for (int index2 = 0; index2 < strArray.Length; ++index2)
                {
                    if (strArray[index2].StartsWith("USER"))
                    {
                        str5 = this.getDataFromConfigLine(strArray[index2], ": ");
                    }
                    if (strArray[index2].StartsWith("Rank"))
                    {
                        str2 = this.getDataFromConfigLine(strArray[index2], ": ");
                    }
                    if (strArray[index2].StartsWith("Handle"))
                    {
                        str4 = this.getDataFromConfigLine(strArray[index2], ": ");
                    }
                    if (strArray[index2].StartsWith("Date"))
                    {
                        str3 = this.getDataFromConfigLine(strArray[index2], ": ");
                    }
                }
                Rectangle destinationRectangle = new Rectangle(rectangle.X + (bounds.Width - 60) - 10, rectangle.Y + 2, rectangle.Height + 1, bounds.Width - 60);
                GuiData.spriteBatch.Draw(Utils.gradient, destinationRectangle, new Rectangle?(), this.themeColorLine, 1.570796f, Vector2.Zero, SpriteEffects.FlipHorizontally, 0.8f);
                TextItem.doSmallLabel(new Vector2((float)rectangle.X, (float)rectangle.Y), "#" + str5 + " - \"" + str4 + "\" Rank:" + str2, new Color?());
                rectangle.Y += 18;
                TextItem.doFontLabel(new Vector2((float)rectangle.X, (float)rectangle.Y), string.Format(LocaleTerms.Loc("Joined {0}"), (object)str3), GuiData.detailfont, new Color?(), float.MaxValue, float.MaxValue, false);
                rectangle.Y += rectangle.Height - 10;
                num4         = index1;
            }
            rectangle.Y += 16;
            if (this.userListPageNumber > 0 && Button.doButton(101005, rectangle.X, rectangle.Y, rectangle.Width / 2 - 20, 15, LocaleTerms.Loc("Previous Page"), new Color?()))
            {
                --this.userListPageNumber;
            }
            TextItem.doTinyLabel(new Vector2((float)(rectangle.X + rectangle.Width / 2 - 8), (float)rectangle.Y), string.Concat((object)this.userListPageNumber), new Color?());
            if (this.usersFolder.files.Count <= num4 + 1 || !Button.doButton(101010, rectangle.X + rectangle.Width / 2 + 10, rectangle.Y, rectangle.Width / 2 - 10, 15, LocaleTerms.Loc("Next Page"), new Color?()))
            {
                return;
            }
            ++this.userListPageNumber;
        }
コード例 #2
0
        public void drawMessageLog(int x, int y)
        {
            var num = 1f;
            var pos = new Vector2(x, y);

            for (var index = 0; index < 20 && index < messages.Count; ++index)
            {
                if (index > 10)
                {
                    num = (float)(1.0 - (index - 10) / 10.0);
                }
                TextItem.doTinyLabel(pos, messages[messages.Count - 1 - index], Color.White * num);
                pos.Y += 13f;
            }
        }
コード例 #3
0
ファイル: ServerScreen.cs プロジェクト: hochladen/Hacknet
        public void drawMessageLog(int x, int y)
        {
            float   num = 1f;
            Vector2 pos = new Vector2((float)x, (float)y);

            for (int index = 0; index < 20 && index < this.messages.Count; ++index)
            {
                if (index > 10)
                {
                    num = (float)(1.0 - (double)(index - 10) / 10.0);
                }
                TextItem.doTinyLabel(pos, this.messages[this.messages.Count - 1 - index], new Color?(Color.White * num));
                pos.Y += 13f;
            }
        }
コード例 #4
0
        private void doUserListScreen(Rectangle bounds, SpriteBatch sb)
        {
            if (Button.doButton(101801, bounds.X + 2, bounds.Y + 20, bounds.Width / 4, 22, "Back", themeColor))
            {
                state = HubState.Menu;
            }
            var rectangle = new Rectangle(bounds.X + 30, bounds.Y + 50, bounds.Width / 2, 30);
            var num1      = 18 + rectangle.Height - 8;
            var num2      = (bounds.Height - 90) / num1;
            var num3      = num2 * userListPageNumber;
            var num4      = 0;

            for (var index1 = num2 * userListPageNumber;
                 index1 < usersFolder.files.Count && index1 < num3 + num2;
                 ++index1)
            {
                var    strArray = usersFolder.files[index1].data.Split(Utils.newlineDelim);
                string str1;
                var    str2 = str1 = "";
                var    str3 = str1;
                var    str4 = str1;
                var    str5 = str1;
                for (var index2 = 0; index2 < strArray.Length; ++index2)
                {
                    if (strArray[index2].StartsWith("USER"))
                    {
                        str5 = getDataFromConfigLine(strArray[index2], ": ");
                    }
                    if (strArray[index2].StartsWith("Rank"))
                    {
                        str2 = getDataFromConfigLine(strArray[index2], ": ");
                    }
                    if (strArray[index2].StartsWith("Handle"))
                    {
                        str4 = getDataFromConfigLine(strArray[index2], ": ");
                    }
                    if (strArray[index2].StartsWith("Date"))
                    {
                        str3 = getDataFromConfigLine(strArray[index2], ": ");
                    }
                }
                var destinationRectangle = new Rectangle(rectangle.X + (bounds.Width - 60) - 10, rectangle.Y + 2,
                                                         rectangle.Height + 1, bounds.Width - 60);
                GuiData.spriteBatch.Draw(Utils.gradient, destinationRectangle, new Rectangle?(), themeColorLine,
                                         1.570796f, Vector2.Zero, SpriteEffects.FlipHorizontally, 0.8f);
                TextItem.doSmallLabel(new Vector2(rectangle.X, rectangle.Y),
                                      "#" + str5 + " - \"" + str4 + "\" Rank:" + str2, new Color?());
                rectangle.Y += 18;
                TextItem.doFontLabel(new Vector2(rectangle.X, rectangle.Y), "Joined " + str3, GuiData.detailfont,
                                     new Color?(), float.MaxValue, float.MaxValue);
                rectangle.Y += rectangle.Height - 10;
                num4         = index1;
            }
            rectangle.Y += 16;
            if (userListPageNumber > 0 &&
                Button.doButton(101005, rectangle.X, rectangle.Y, rectangle.Width / 2 - 20, 15, "Previous Page",
                                new Color?()))
            {
                --userListPageNumber;
            }
            TextItem.doTinyLabel(new Vector2(rectangle.X + rectangle.Width / 2 - 8, rectangle.Y),
                                 string.Concat(userListPageNumber), new Color?());
            if (usersFolder.files.Count <= num4 + 1 ||
                !Button.doButton(101010, rectangle.X + rectangle.Width / 2 + 10, rectangle.Y, rectangle.Width / 2 - 10, 15,
                                 "Next Page", new Color?()))
            {
                return;
            }
            ++userListPageNumber;
        }