Exemplo n.º 1
0
        public override void AddGumpLayout()
        {
            base.AddGumpLayout();

            int           gold   = CityLoyaltySystem.GetTitleCost(Title);
            LoyaltyRating rating = CityLoyaltySystem.GetMinimumRating(Title);

            AddHtmlLocalized(60, 40, 300, 20, 1152901, false, false); // Obtain Title
            AddHtmlLocalized(75, 60, 200, 16, CityLoyaltySystem.GetTitleLocalization(User, Title, Citizenship.City), false, false);

            AddHtmlLocalized(60, 120, 200, 16, 1152899, false, false); // Loyalty Required:
            AddHtmlLocalized(60, 140, 200, 16, 1152900, false, false); // Donation Required:

            AddHtmlLocalized(200, 120, 150, 16, CityLoyaltySystem.RatingLocalization(CityLoyaltySystem.GetMinimumRating(Title)), false, false);
            AddHtml(200, 140, 150, 16, CityLoyaltySystem.GetTitleCost(Title).ToString("N0", System.Globalization.CultureInfo.GetCultureInfo("en-US")), false, false);

            if (gold > Banker.GetBalance(User))
            {
                AddHtmlLocalized(30, 180, 280, 80, 1152902, false, false);
                // You do not have enough funds in your bank box to donate for this title.
            }
            else if (rating > Citizenship.GetLoyaltyRating(User))
            {
                AddHtmlLocalized(30, 180, 280, 80, 1152903, false, false);
                // You do not have the required minimum loyalty rating to receive this title.
            }
            else
            {
                AddHtmlLocalized(60, 345, 150, 16, 1152904, false, false); // Gain Title
                AddButton(40, 350, 2103, 2104, 1, GumpButtonType.Reply, 0);
            }

            AddHtmlLocalized(60, 365, 150, 16, 1152889, false, false); // Cancel
            AddButton(40, 370, 2103, 2104, 2, GumpButtonType.Reply, 0);
        }