Esempio n. 1
0
        public PlayerScoreGump(Mobile from, PlayerScoreGump pageType, ArrayList list, int listPage, string notice, object state)
            : base(50, 40)
        {
            from.CloseGump(typeof(PlayerScoreGump));

            m_List = list;
            m_From = from;

            ArrayList playerlist = new ArrayList();

            foreach (Mobile m in World.Mobiles.Values)
            {
                if (m != null && m.Player)
                {
                    PlayerMobile pm = (PlayerMobile)(m);

                    if (pm != null && (pm.Wins != 0 && pm.Loses != 0))
                    {
                        playerlist.Add(new RankSort(pm));
                    }
                }
            }

            for (int i = 0; i < playerlist.Count; i++)
            {
                if (i > 9)
                {
                    break;
                }

                RankSort p = playerlist[i] as RankSort;
            }



            AddPage(0);

            AddBackground(0, 0, 420, 540, 5054);

            AddBlackAlpha(10, 10, 400, 520);

            if (notice != null)
            {
                AddHtml(12, 392, 396, 36, Color(notice, LabelColor32), false, false);
            }


            AddLabel(160, 15, RedHue, "Top 20 Duelers");
            AddLabel(20, 40, LabelHue, "Players");
            AddLabel(185, 40, LabelHue, "Wins");
            AddLabel(345, 40, LabelHue, "Loses");

            playerlist.Sort();

            for (int i = 0; i < playerlist.Count; ++i)
            {
                if (i >= 20)
                {
                    break;
                }

                RankSort g = (RankSort)playerlist[i];

                string name = null;

                if ((name = g.Killer.Name) != null && (name = name.Trim()).Length <= 15)
                {
                    name = g.Killer.Name;
                }

                string wins = null;

                if (g.Killer is PlayerMobile)
                {
                    wins = ((PlayerMobile)g.Killer).Wins.ToString();
                }

                string loses = null;

                if (g.Killer is PlayerMobile)
                {
                    loses = ((PlayerMobile)g.Killer).Loses.ToString();
                }

                AddLabel(20, 70 + ((i % 20) * 20), GreenHue, name);
                AddLabel(198, 70 + ((i % 20) * 20), GreenHue, wins);
                AddLabel(358, 70 + ((i % 20) * 20), GreenHue, loses);
            }
        }