Esempio n. 1
0
        public MenuGroup_ScoreSaver(StageDataPackage StageData, PointF OriginalPosition) : base(StageData)
        {
            this.OriginalPosition = OriginalPosition;
            ScoreHistorys         = new List <BaseMenuItem>();
            for (int index = 0; index < 10; ++index)
            {
                ScoreHistorys.Add(new DescriptionMenuItem(StageData, string.Format("{0:00}", index + 1)));
            }
            StageDataPackage stageData = StageData.GlobalData.LastState.StageData;

            for (int index1 = 0; index1 < stageData.S_History.Count; ++index1)
            {
                if (stageData.MyPlane.Score > stageData.S_History[index1].Score)
                {
                    ScoreHistory scoreHistory1 = new ScoreHistory {
                        MyPlaneFullName = stageData.MyPlane.FullName,
                        Rank            = stageData.Difficulty,
                        PlayerName      = "",
                        Score           = stageData.MyPlane.Score
                    };
                    ScoreHistory scoreHistory2 = scoreHistory1;
                    DateTime     dateTime      = DateTime.Now;
                    dateTime = dateTime.Date;
                    string str = dateTime.ToString("yyyy'/'MM'/'dd");
                    scoreHistory2.Date     = str;
                    scoreHistory1.Time     = DateTime.Now.ToShortTimeString();
                    scoreHistory1.Stage    = stageData.CurrentStageName;
                    scoreHistory1.SlowRate = stageData.SlowRate;
                    ScoreHistory SH = scoreHistory1;
                    for (int index2 = stageData.S_History.Count - 1; index2 > index1; --index2)
                    {
                        stageData.S_History[index2].Copy(stageData.S_History[index2 - 1]);
                    }
                    stageData.S_History[index1].Copy(SH);
                    HistorySelectIndex = index1;
                    break;
                }
            }
            float x   = OriginalPosition.X + 12f;
            float y   = OriginalPosition.Y + 30f;
            int   num = 0;

            foreach (BaseMenuItem scoreHistory in ScoreHistorys)
            {
                scoreHistory.Position  = new PointF(x, (BoundRect.Top + 40));
                scoreHistory.DestPoint = new PointF(x, y);
                y += 17f;
                if (stageData.CurrentStageName.Contains("St"))
                {
                    ((DescriptionMenuItem)scoreHistory).Description = stageData.S_History[num++].Data2DrawStringSimple();
                }
                else
                {
                    ((DescriptionMenuItem)scoreHistory).Description = stageData.S_History[num++].Data2DrawString();
                }
            }
            if (HistorySelectIndex >= 0)
            {
                ScoreHistorys[HistorySelectIndex].Selected = true;
            }
            string[,] strArray = new string[7, 13] {
                { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M" },
                { "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" },
                { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m" },
                { "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" },
                { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "+", "-", "=" },
                { ".", ",", "!", "?", "@", ":", ";", "[", "]", "(", ")", "_", "/" },
                { "{", "}", "|", "~", "^", "#", "$", "%", "&", "*", " ", "BS", "OK" }
            };
            MenuItemList = new List <BaseMenuItem>();
            for (int index1 = 0; index1 < 7; ++index1)
            {
                for (int index2 = 0; index2 < 13; ++index2)
                {
                    BaseMenuItem baseMenuItem = new DescriptionMenuItem(StageData, strArray[index1, index2])
                    {
                        OriginalPosition = new PointF((stageData.BoundRect.Left + stageData.BoundRect.Width / 2 - 138), 300f),
                        DestPoint        = new PointF((stageData.BoundRect.Left + stageData.BoundRect.Width / 2 - 138 + index2 * 22), (270 + index1 * 22))
                    };
                    MenuItemList.Add(baseMenuItem);
                }
            }
            MenuSelectIndex = MenuItemList.Count - 1;
            if (MenuSelectIndex >= 0)
            {
                MenuItemList[MenuSelectIndex].Selected = true;
            }
            for (char[] charArray = stageData.PData.PlayerName.ToCharArray(); NameIndex < charArray.Length; ++NameIndex)
            {
                PlayerName[NameIndex] = charArray[NameIndex].ToString();
            }
            ShowPlayerName();
        }
Esempio n. 2
0
        public MenuGroup_ReplayStageSelect(StageDataPackage StageData, PointF OriginalPosition, DescriptionMenuItem RepMenuItem) : base(StageData)
        {
            RepIndex        = RepMenuItem.Name;
            MenuSelectIndex = 0;
            MenuItemList    = new List <BaseMenuItem>();
            for (int index = 0; index < 6; ++index)
            {
                MenuItemList.Add(new DescriptionMenuItem(StageData, string.Format("Stage{0:00}", (object)(index + 1)))
                {
                    Description = "----------"
                });
            }
            MenuItemList.Add(new DescriptionMenuItem(StageData, "StageEx")
            {
                Description = "----------"
            });
            float x = OriginalPosition.X + 12f;
            float y = OriginalPosition.Y + 12f;

            foreach (BaseMenuItem menuItem in MenuItemList)
            {
                menuItem.Position  = new PointF(x, OriginalPosition.Y + 10f);
                menuItem.DestPoint = new PointF(x, y);
                y += 17f;
            }
            string str = ".\\Replay\\thSSS_" + RepIndex + ".rpy";

            if (File.Exists(str))
            {
                ReplayInfo replayInfo = Replay.ReadTitle(str);
                if (replayInfo.StartStage == "StEx")
                {
                    ((DescriptionMenuItem)MenuItemList[6]).Description = replayInfo.MyPlaneData[1].Score.ToString().PadLeft(10);
                }
                else
                {
                    int num = !replayInfo.StartStage.Contains("St") ? Convert.ToInt32(replayInfo.StartStage.Replace("Bs", "")) : Convert.ToInt32(replayInfo.StartStage.Replace("St", ""));
                    for (int index = 0; index < replayInfo.MyPlaneData.Count - 1; ++index)
                    {
                        if (num - 1 + index < 6)
                        {
                            ((DescriptionMenuItem)MenuItemList[num - 1 + index]).Description = replayInfo.MyPlaneData[index + 1].Score.ToString().PadLeft(10);
                        }
                    }
                }
            }
            MenuItemList[MenuSelectIndex].Selected = true;
            DescriptionMenuItem descriptionMenuItem = new DescriptionMenuItem(StageData, RepIndex)
            {
                Description      = RepMenuItem.Description,
                OriginalPosition = RepMenuItem.OriginalPosition,
                Selected         = true
            };

            MenuTilte        = descriptionMenuItem;
            MenuTitlePos1    = new PointF(RepMenuItem.OriginalPosition.X, 16f);
            MenuTitlePos2    = RepMenuItem.OriginalPosition;
            TxtureObject     = TextureObjectDictionary["MenuBackground"];
            OriginalPosition = new PointF((BoundRect.Width / 2), (BoundRect.Height / 2));
            AngleDegree      = 90.0;
            ColorValue       = Color.SkyBlue;
        }
Esempio n. 3
0
        public MenuGroup_ReplayNamer(
            StageDataPackage StageData,
            PointF OriginalPosition,
            DescriptionMenuItem RepMenuItem)
            : base(StageData)
        {
            this.RepMenuItem  = RepMenuItem;
            this.MenuItemList = new List <BaseMenuItem>();
            StageDataPackage stageData = StageData.GlobalData.LastState.StageData;

            string[,] strArray = new string[7, 13]
            {
                {
                    "A",
                    "B",
                    "C",
                    "D",
                    "E",
                    "F",
                    "G",
                    "H",
                    "I",
                    "J",
                    "K",
                    "L",
                    "M"
                },
                {
                    "N",
                    "O",
                    "P",
                    "Q",
                    "R",
                    "S",
                    "T",
                    "U",
                    "V",
                    "W",
                    "X",
                    "Y",
                    "Z"
                },
                {
                    "a",
                    "b",
                    "c",
                    "d",
                    "e",
                    "f",
                    "g",
                    "h",
                    "i",
                    "j",
                    "k",
                    "l",
                    "m"
                },
                {
                    "n",
                    "o",
                    "p",
                    "q",
                    "r",
                    "s",
                    "t",
                    "u",
                    "v",
                    "w",
                    "x",
                    "y",
                    "z"
                },
                {
                    "0",
                    "1",
                    "2",
                    "3",
                    "4",
                    "5",
                    "6",
                    "7",
                    "8",
                    "9",
                    "+",
                    "-",
                    "="
                },
                {
                    ".",
                    ",",
                    "!",
                    "?",
                    "@",
                    ":",
                    ";",
                    "[",
                    "]",
                    "(",
                    ")",
                    "_",
                    "/"
                },
                {
                    "{",
                    "}",
                    "|",
                    "~",
                    "^",
                    "#",
                    "$",
                    "%",
                    "&",
                    "*",
                    " ",
                    "BS",
                    "OK"
                }
            };
            for (int index1 = 0; index1 < 7; ++index1)
            {
                for (int index2 = 0; index2 < 13; ++index2)
                {
                    BaseMenuItem baseMenuItem = (BaseMenuItem) new DescriptionMenuItem(StageData, strArray[index1, index2]);
                    baseMenuItem.OriginalPosition = new PointF((float)(stageData.BoundRect.Left + stageData.BoundRect.Width / 2 - 138), 300f);
                    baseMenuItem.DestPoint        = new PointF((float)(stageData.BoundRect.Left + stageData.BoundRect.Width / 2 - 138 + index2 * 22), (float)(270 + index1 * 22));
                    this.MenuItemList.Add(baseMenuItem);
                }
            }
            this.MenuSelectIndex = this.MenuItemList.Count - 1;
            ReplayInfo repInfo = StageData.GlobalData.LastState.StageData.RepInfo;

            this.RepDescription += DateTime.Now.Date.ToString("yy'/'MM'/'dd").PadRight(9);
            this.RepDescription += repInfo.MyPlaneName.PadRight(7);
            switch (repInfo.Rank)
            {
            case DifficultLevel.Easy:
                this.RepDescription += "E  ";
                break;

            case DifficultLevel.Normal:
                this.RepDescription += "N  ";
                break;

            case DifficultLevel.Hard:
                this.RepDescription += "H  ";
                break;

            case DifficultLevel.Lunatic:
                this.RepDescription += "L  ";
                break;

            case DifficultLevel.Ultra:
                this.RepDescription += "U  ";
                break;

            case DifficultLevel.Extra:
                this.RepDescription += "EX ";
                break;
            }
            this.RepDescription += repInfo.LastStage == null ? "   " : repInfo.LastStage.PadRight(4);
            this.MenuItemList[this.MenuSelectIndex].Selected = true;
            DescriptionMenuItem descriptionMenuItem = new DescriptionMenuItem(StageData, RepMenuItem.Name);

            descriptionMenuItem.Description      = "        " + this.RepDescription;
            descriptionMenuItem.OriginalPosition = RepMenuItem.OriginalPosition;
            descriptionMenuItem.Selected         = true;
            this.MenuTilte     = (BaseMenuItem)descriptionMenuItem;
            this.MenuTitlePos1 = new PointF(OriginalPosition.X, OriginalPosition.Y);
            this.MenuTitlePos2 = RepMenuItem.OriginalPosition;
            for (char[] charArray = stageData.PData.PlayerName.ToCharArray(); this.NameIndex < charArray.Length; ++this.NameIndex)
            {
                this.PlayerName[this.NameIndex] = charArray[this.NameIndex].ToString();
            }
            this.ShowPlayerName();
        }