Esempio n. 1
0
            //---------------------------------------------------------

            /// <summary>
            /// this is for: <see cref="LabelControlSpecies.RankingBackGroundLabel"/>
            /// </summary>
            /// <param name="myRes"></param>
            /// <param name="father"></param>
            /// <param name="activeRankingLabel"></param>
            /// <param name="kingdomInfo"></param>
            public RankingBackGroundLabel(IRes myRes, SandBoxBase father,
                                          RankingKindLabel activeRankingLabel, KingdomInfo kingdomInfo) :
                base(myRes, LabelControlSpecies.RankingBackGroundLabel, father)
            {
                ActiveKindRankingLabel = activeRankingLabel;
                KingdomInfo            = kingdomInfo;
                Initialize_ForRankingBackGround_Component();
            }
Esempio n. 2
0
            public void SetActiveRankingKind(RankingKindLabel rankingLabel, bool setAnyway = false)
            {
                if (this.ActiveKindRankingLabel == rankingLabel && !setAnyway)
                {
                    return;
                }

                this.ActiveKindRankingLabel = rankingLabel;
                ReloadUPW();
                this.TitleRanking.MessageLabel3.CurrentStatus     =
                    this.TitleRanking.MessageLabel4.CurrentStatus =
                        (uint)ActiveKindRankingLabel.RankingsMode;
                this.TitleRanking.MessageLabel3.SetLabelText();
                this.TitleRanking.MessageLabel4.SetLabelText();

                if (ActiveKindRankingLabel.RankingsMode == RankingsMode.PowerRankings)
                {
                    for (int i = 0; i < PlayersInRanking.Length; i++)
                    {
                        PlayersInRanking[i].MessageLabel1.SetLabelText((i + 1).ToString());
                        PlayersInRanking[i].MessageLabel2.SetLabelText(
                            this.KingdomInfo.Rankings.PowerRankings.PlayerNames[i]);
                        PlayersInRanking[i].MessageLabel3.SetLabelText(string.Empty);
                        PlayersInRanking[i].MessageLabel4.SetLabelText(
                            this.KingdomInfo.Rankings.PowerRankings.PlayerPowers[i].ToString());
                    }
                }
                else if (ActiveKindRankingLabel.RankingsMode == RankingsMode.LevelRankings)
                {
                    for (int i = 0; i < PlayersInRanking.Length; i++)
                    {
                        PlayersInRanking[i].MessageLabel1.SetLabelText((i + 1).ToString());
                        PlayersInRanking[i].MessageLabel2.SetLabelText(
                            this.KingdomInfo.Rankings.LevelRankings.PlayerNames[i]);
                        PlayersInRanking[i].MessageLabel3.SetLabelText(
                            this.KingdomInfo.Rankings.LevelRankings.PlayerLevels[i].ToString());
                        PlayersInRanking[i].MessageLabel4.SetLabelText(
                            this.KingdomInfo.Rankings.LevelRankings.PlayerTotalExp[i].ToString());
                    }
                }
                for (int i = 0; i < PlayersInRanking.Length; i++)
                {
                    if (PlayersInRanking[i].Parent != null)
                    {
                        this.Controls.Remove(PlayersInRanking[i]);
                    }
                }
                this.PlayersInRanking[0].Location =
                    new Point(TitleRanking.Location.X,
                              TitleRanking.Location.Y + TitleRanking.Height +
                              ThereIsConstants.AppSettings.Between_GameControls);
                for (int i = 1; i < PlayersInRanking.Length; i++)
                {
                    PlayersInRanking[i].Location =
                        new Point(PlayersInRanking[i - 1].Location.X,
                                  PlayersInRanking[i - 1].Location.Y +
                                  PlayersInRanking[i - 1].Height +
                                  (ThereIsConstants.AppSettings.Between_GameControls / 2));
                }
                for (int i = 0; i < PlayersInRanking.Length; i++)
                {
                    if (PlayersInRanking[i].Location.Y > 0 &&
                        PlayersInRanking[i].Location.Y <= Height)
                    {
                        this.Controls.Add(PlayersInRanking[i]);
                    }
                }
            }