Ejemplo n.º 1
0
        public override void AddGumpLayout()
        {
            if (!CityLoyaltySystem.Enabled || CityLoyaltySystem.Cities == null)
            {
                return;
            }

            base.AddGumpLayout();
            int y = 40;

            for (int i = 0; i < CityLoyaltySystem.Cities.Count; i++)
            {
                CityLoyaltySystem city = CityLoyaltySystem.Cities[i];

                if (city.CanUtilize && Citizenship == null && CityLoyaltySystem.CanAddCitizen(User))
                {
                    AddButton(30, y + 3, 2103, 2104, 100 + i, GumpButtonType.Reply, 0);
                }

                AddHtmlLocalized(50, y, 200, 16, CityLoyaltySystem.CityLocalization(city.City), false, false);
                AddHtmlLocalized(200, y, 200, 16, CityLoyaltySystem.RatingLocalization(city.GetLoyaltyRating(User)), false, false);

                y += 20;
            }

            y += 20;

            AddHtmlLocalized(70, y, 250, 16, 1152883, false, false);             // Citizenship:
            AddHtmlLocalized(200, y, 100, 16, Citizenship != null ? CityLoyaltySystem.CityLocalization(Citizenship.City) : 1152884, false, false);

            y += 40;

            if (!CityLoyaltySystem.IsSetup())
            {
                AddHtml(70, y, 250, 60, "City Loyalty System has not been enabled by your server owner yet.", false, false);
            }
            else if (Citizenship != null)
            {
                AddHtmlLocalized(115, y - 5, 150, 16, 1152890, false, false); // Citizenship Titles
                AddButton(100, y, 2103, 2104, 1, GumpButtonType.Reply, 0);

                y += 20;

                AddHtmlLocalized(115, y - 5, 150, 16, 1152888, false, false); // Renounce Citizenship
                AddButton(100, y, 2103, 2104, 2, GumpButtonType.Reply, 0);
            }
            else
            {
                if (CityLoyaltySystem.CanAddCitizen(User))
                {
                    AddHtmlLocalized(30, y, 280, 90, 1152885, false, false);

                    /*Click the gem next to the name of a city to declare your
                     * citizenship. You may renounce citizenship, but afterwards
                     * you may not declare new citizenship for one week.*/
                }
                else
                {
                    AddHtmlLocalized(30, y, 285, 80, 1152886, CityLoyaltySystem.NextJoinCity(User).ToString(), 0, false, false);

                    /*You recently renounced citizenship, so you must wait ~1_COUNT~
                     * more days before you may declare citizenship again.*/
                }
            }
        }