예제 #1
0
            /// <summary>
            /// Creation of the entity's graphics
            /// </summary>
            void ICommitGumpEntity.Create()
            {
                //Note: The first time the state is created it also takes a snapshot of the current slot distribution
                //This is to prevent exploits when commiting
                if (m_State == null)
                {
                    m_State = new GumpState(m_Gump.Data);
                }
                #region page 4

                //	Page 4 - delegation	 //////////////////////////////////////////////////////////////////////

                StringBuilder htmlSb = new StringBuilder("<basefont color=#FFCC00><center>Guard Post Delegation</center></basefont>");
                m_Gump.AddHtml(170, 40, 409, 19, htmlSb.ToString(), (bool)false, (bool)false);                 //left
                htmlSb = new StringBuilder("<basefont color=gray><center>Here you may delegate the creation of guard posts to beneficiaries</center></basefont>");
                m_Gump.AddHtml(170, 70, 409, 19, htmlSb.ToString(), (bool)false, (bool)false);                 //left
                htmlSb = new StringBuilder(string.Format("<basefont color=white><center>Guard Slots Remaining : {0}/{1}</center></basefont>", m_State.RemainingSlots, KinSystem.GetCityGuardPostSlots(m_Gump.City)));
                m_Gump.AddHtml(170, 100, 409, 19, htmlSb.ToString(), (bool)false, (bool)false);                //left

                //Add a button and label for each beneficiary
                int buttonID  = 1;
                int yLocation = 137;
                int ySpacing  = 25;

                foreach (KinCityData.BeneficiaryData data in m_Gump.Data.BeneficiaryDataList)
                {
                    int pageDivider = (buttonID / 22);
                    int xLocation   = 174 + (pageDivider * 230);
                    m_Gump.AddButton(xLocation, yLocation, 2223, 2223, buttonID, GumpButtonType.Reply, 0);
                    m_Gump.AddButton(xLocation + 20, yLocation, 2224, 2224, buttonID + 1, GumpButtonType.Reply, 0);
                    string caption = string.Format("{0}/{1} slots : {2}", m_State.SlotsRemainingChanged[data.Pm] + m_State.SlotsAssigned[data.Pm], m_State.SlotsRemainingChanged[data.Pm], (data.Pm.Name.Length > 12 ? data.Pm.Name.Substring(0, 12) : data.Pm.Name));
                    m_Gump.AddLabel(xLocation + 45, yLocation - 5, GetStatusColour(data.Pm), caption);
                    yLocation += ySpacing;
                    if (buttonID == 21)
                    {
                        yLocation = 137;
                    }
                    buttonID += 2;
                }

                if (!((ICommitGumpEntity)this).Validate())
                {
                    m_Gump.AddHtml(169, 415, 412, 136, "<basefont color=red><center>Your City's guard data has been modified from elsewhere.  You must close and start again.</center></basefont>", (bool)false, (bool)false);
                }
                else if (!ReferenceEquals(m_Gump.Data.CityLeader, m_Gump.From))
                {
                    m_Gump.AddHtml(169, 425, 412, 136, string.Format("<basefont color=gray><center>{0}</center></basefont>", "Only the city leader may make changes"), false, false);
                }
                else if (m_State.IsDirty)
                {
                    m_Gump.AddHtml(169, 425, 412, 136, "<basefont color=gray><center>You must press OK before these changes will take effect</center></basefont>", false, false);
                }

                //////////////////////////////////////////////////////////////////////////////////////////////

                m_State.Status = string.Empty;

                #endregion
            }
예제 #2
0
            /// <summary>
            /// Creation of the entity's graphics
            /// </summary>
            void ICommitGumpEntity.Create()
            {
                #region page 2

                //	Page 2 - Finances	 //////////////////////////////////////////////////////////////////////

                StringBuilder htmlSb = new StringBuilder("<basefont color=#FFCC00><center>City Finanaces</center></basefont>");
                m_Gump.AddHtml(170, 40, 409, 19, htmlSb.ToString(), (bool)false, (bool)false);
                htmlSb = new StringBuilder("<basefont color=white><center>Tax Rate</center></basefont>");
                m_Gump.AddHtml(170, 80, 409, 19, htmlSb.ToString(), (bool)false, (bool)false);
                htmlSb = new StringBuilder().AppendFormat("<basefont color={0}><center>{1}</center></basefont>", GetTaxColour(), string.Format("{0:0%}", m_State.GetValue <double>("Tax")));
                m_Gump.AddHtml(170, 110, 409, 19, htmlSb.ToString(), (bool)false, (bool)false);

                m_Gump.AddButton(355, 140, 2223, 2223, (int)Buttons.btnLowerTax, GumpButtonType.Reply, 0);
                m_Gump.AddButton(355 + 20, 140, 2224, 2224, (int)Buttons.btnRasieTax, GumpButtonType.Reply, 0);

                htmlSb = new StringBuilder("<basefont color=white><center>Treasury</center></basefont>");
                m_Gump.AddHtml(170, 170, 409, 19, htmlSb.ToString(), (bool)false, (bool)false);
                htmlSb = new StringBuilder();
                htmlSb.AppendFormat("<basefont color=gray><center>{0}</center></basefont>", string.Format("{0:n}", m_Gump.Data.Treasury));
                m_Gump.AddHtml(170, 200, 409, 19, htmlSb.ToString(), (bool)false, (bool)false);


                htmlSb = new StringBuilder();
                htmlSb.AppendFormat("<basefont color=white><center>Pressing the button below will distribute the treasury amongst your <br> beneficiaires.</center></basefont>", string.Format("{0:n}", m_Gump.Data.Treasury));
                m_Gump.AddHtml(170, 230, 409, 50, htmlSb.ToString(), (bool)false, (bool)false);
                //m_Gump.AddButton(355, 300, 2642, 2643, 3, GumpButtonType.Reply, 0);
                m_Gump.AddButton(355, 300, m_State.IsValueDirty <bool>("Distribute") ? 4036 : 4037, m_State.IsValueDirty <bool>("Distribute") ? 4037 : 4036, (int)Buttons.btnDistributeTreasury, GumpButtonType.Reply, 0);

                if (!ReferenceEquals(m_Gump.Data.CityLeader, m_Gump.From))
                {
                    m_Gump.AddHtml(169, 425, 412, 136, "<basefont color=gray><center>Only the city leader may make changes</center></basefont>", false, false);
                }
                else if (m_State.IsValueDirty <double>("Tax") || m_State.IsValueDirty <bool>("Distribute"))
                {
                    m_Gump.AddHtml(169, 425, 412, 136, "<basefont color=gray><center>You must press OK before these changes will take effect</center></basefont>", false, false);
                }

                //////////////////////////////////////////////////////////////////////////////////////////////

                #endregion
            }
예제 #3
0
            /// <summary>
            /// Creation of the entity's graphics
            /// </summary>
            void ICommitGumpEntity.Create()
            {
                #region page 1

                //	Page 1 - overview	 //////////////////////////////////////////////////////////////////////

                StringBuilder htmlSb = new StringBuilder("<basefont color=#FFCC00><center>Candidates for City Leadership</center></basefont>");
                m_Gump.AddHtml(170, 40, 409, 19, htmlSb.ToString(), false, false);
                htmlSb = new StringBuilder("<basefont color=gray><center>Cast your vote by nominating a person below.</center></basefont>");
                m_Gump.AddHtml(170, 80, 409, 19, htmlSb.ToString(), false, false);                 //left

                //If this is a gm+, show a button that allows the vote process to be stopped (for testing shit only)
                if (m_Gump.From.AccessLevel > AccessLevel.Counselor)
                {
                    m_Gump.AddButton(47, 132, 5572, 5572, (int)Buttons.btnStopVoteStageEarly, GumpButtonType.Reply, 1);
                }

                CreateButtons();

                KinCityData.BeneficiaryData bd = m_Gump.Data.GetBeneficiary(m_Gump.From as PlayerMobile);
                if (bd == null)
                {
                    //This mobile is not a beneficiary of the city
                    m_Gump.AddHtml(169, 425, 412, 136, "<basefont color=gray><center>You are not a beneficiary of this city and cannot vote</center></basefont>", false, false);
                    m_CanVote = false;
                }
                else if (bd.HasVoted)
                {
                    //This mobile has already voted..
                    m_Gump.AddHtml(169, 425, 412, 136, "<basefont color=gray><center>You have already voted for a leader and may not vote again</center></basefont>", false, false);
                    m_CanVote = false;
                }
                else if (m_State.IsValueDirty <int>("VotedFor"))
                {
                    m_Gump.AddHtml(169, 425, 412, 136, "<basefont color=gray><center>You must press OK before your vote is cast</center></basefont>", false, false);
                }


                //////////////////////////////////////////////////////////////////////////////////////////////

                #endregion
            }
예제 #4
0
            /// <summary>
            /// Creation of the entity's graphics
            /// </summary>
            void ICommitGumpEntity.Create()
            {
                #region master page

                m_Gump.AddPage(0);
                m_Gump.AddImage(169, 2, 10861);
                m_Gump.AddImage(6, 33, 2623);
                m_Gump.AddImage(6, 242, 2623);
                m_Gump.AddImage(6, 15, 2620);
                m_Gump.AddImage(25, 15, 2621);
                m_Gump.AddImage(295, 14, 2621);
                m_Gump.AddImage(140, 33, 2623);
                m_Gump.AddImage(139, 242, 2623);
                m_Gump.AddImage(140, 15, 2620);
                m_Gump.AddImage(6, 452, 2626);
                m_Gump.AddImage(139, 451, 2626);
                m_Gump.AddImage(26, 462, 2621);
                m_Gump.AddImage(296, 461, 2621);
                m_Gump.AddImage(600, 450, 2628);
                m_Gump.AddImage(600, 14, 2622);
                m_Gump.AddImage(616, 32, 2623);
                m_Gump.AddImage(615, 241, 2623);
                m_Gump.AddImage(332, 14, 2621);
                m_Gump.AddImage(341, 462, 2621);
                m_Gump.AddBackground(144, 22, 470, 441, 9270);
                m_Gump.AddBackground(12, 22, 128, 441, 9270);
                m_Gump.AddAlphaRegion(622, 16, 22, 463);
                m_Gump.AddAlphaRegion(5, 471, 635, 8);

                m_Gump.AddButton(44, 412, 247, 248, (int)Buttons.btnMenuMainOK, GumpButtonType.Reply, 0);

                //Right, special case here. If the city is still in the vote stage, we don't want to show the normal buttons.
                //Instead, the only button will be called Vote (which is normally Overview)

                if (m_Gump.Page == 5)
                {
                    m_Gump.AddButton(47, 40, 5558, 5558, (int)Buttons.btnMenuVote, GumpButtonType.Reply, 1);
                    m_Gump.AddLabel(47, 101, 1359, @"Voting");
                }
                else
                {
                    if (m_Gump.Page == 1)
                    {
                        m_Gump.AddButton(47, 40, 5558, 5558, (int)Buttons.btnMenuOverview, GumpButtonType.Reply, 1);
                    }
                    else
                    {
                        m_Gump.AddButton(47, 40, 5557, 5558, (int)Buttons.btnMenuOverview, GumpButtonType.Reply, 1);
                    }
                    m_Gump.AddLabel(53, 101, 1359, @"Overview");

                    if (m_Gump.Page == 2)
                    {
                        m_Gump.AddButton(47, 132, 5572, 5572, (int)Buttons.btnMenuFinance, GumpButtonType.Reply, 2);
                    }
                    else
                    {
                        m_Gump.AddButton(47, 132, 5571, 5572, (int)Buttons.btnMenuFinance, GumpButtonType.Reply, 2);
                    }
                    m_Gump.AddLabel(55, 191, 1359, @"Finance");

                    if (m_Gump.Page == 3)
                    {
                        m_Gump.AddButton(47, 222, 5576, 5576, (int)Buttons.btnMenuPopulace, GumpButtonType.Reply, 3);
                    }
                    else
                    {
                        m_Gump.AddButton(47, 222, 5575, 5576, (int)Buttons.btnMenuPopulace, GumpButtonType.Reply, 3);
                    }
                    m_Gump.AddLabel(52, 284, 1359, @"Populace");

                    if (m_Gump.Page == 4)
                    {
                        m_Gump.AddButton(47, 312, 5592, 5592, (int)Buttons.btnMenuDelegation, GumpButtonType.Reply, 4);
                    }
                    else
                    {
                        m_Gump.AddButton(47, 312, 5591, 5592, (int)Buttons.btnMenuDelegation, GumpButtonType.Reply, 4);
                    }
                    m_Gump.AddLabel(50, 377, 1359, @"Delegation");
                }
                #endregion
            }
예제 #5
0
            void ICommitGumpEntity.Create()
            {
                #region page 3

                //	Page 3 - Populace	 //////////////////////////////////////////////////////////////////////

                string html = "<basefont color=gray><center>Here you may restrict the legal professions of the civillians living in your city, and select the type of guards that will defend it</basefont></center>";
                m_Gump.AddHtml(170, 40, 412, 19, "<basefont color=#FFCC00><center>City Populace</center></basefont>", false, false);
                m_Gump.AddHtml(170, 118, 205, 314, "<basefont color=white><center>Civillians</center></basefont>", false, false);
                m_Gump.AddHtml(386, 118, 199, 314, "<basefont color=white><center>Guards</center></basefont>", false, false);
                m_Gump.AddHtml(169, 72, 412, 136, html, false, false);

                m_Gump.AddButton(174, 157, GetNPCButtonState(KinCityData.NPCFlags.Bank, true), GetNPCButtonState(KinCityData.NPCFlags.Bank, false), (int)Buttons.btnProfessionBanker, GumpButtonType.Reply, 0);
                m_Gump.AddButton(174, 182, GetNPCButtonState(KinCityData.NPCFlags.Mages, true), GetNPCButtonState(KinCityData.NPCFlags.Mages, false), (int)Buttons.btnProfessionMages, GumpButtonType.Reply, 0);
                m_Gump.AddButton(174, 207, GetNPCButtonState(KinCityData.NPCFlags.WeaponArmour, true), GetNPCButtonState(KinCityData.NPCFlags.WeaponArmour, false), (int)Buttons.btnProfessionWeaponSmiths, GumpButtonType.Reply, 0);
                m_Gump.AddButton(174, 232, GetNPCButtonState(KinCityData.NPCFlags.EatDrink, true), GetNPCButtonState(KinCityData.NPCFlags.EatDrink, false), (int)Buttons.btnProfessionBarStaff, GumpButtonType.Reply, 0);
                m_Gump.AddButton(174, 257, GetNPCButtonState(KinCityData.NPCFlags.Animal, true), GetNPCButtonState(KinCityData.NPCFlags.Animal, false), (int)Buttons.btnProfessionAnimalTenders, GumpButtonType.Reply, 0);
                m_Gump.AddButton(174, 282, GetNPCButtonState(KinCityData.NPCFlags.Patrol, true), GetNPCButtonState(KinCityData.NPCFlags.Patrol, false), (int)Buttons.btnProfessionPatrolGuards, GumpButtonType.Reply, 0);
                m_Gump.AddButton(174, 307, GetNPCButtonState(KinCityData.NPCFlags.Quest, true), GetNPCButtonState(KinCityData.NPCFlags.Quest, false), (int)Buttons.btnProfessionTravellers, GumpButtonType.Reply, 0);
                m_Gump.AddButton(174, 332, GetNPCButtonState(KinCityData.NPCFlags.Gypsy, true), GetNPCButtonState(KinCityData.NPCFlags.Gypsy, false), (int)Buttons.btnProfessionGypsies, GumpButtonType.Reply, 0);
                m_Gump.AddButton(174, 357, GetNPCButtonState(KinCityData.NPCFlags.Carpenter, true), GetNPCButtonState(KinCityData.NPCFlags.Carpenter, false), (int)Buttons.btnProfessionCarpenters, GumpButtonType.Reply, 0);

                m_Gump.AddButton(305, 157, GetNPCButtonState(KinCityData.NPCFlags.Healer, true), GetNPCButtonState(KinCityData.NPCFlags.Healer, false), (int)Buttons.btnProfessionHealers, GumpButtonType.Reply, 0);
                m_Gump.AddButton(305, 182, GetNPCButtonState(KinCityData.NPCFlags.Inn, true), GetNPCButtonState(KinCityData.NPCFlags.Inn, false), (int)Buttons.btnProfessionInnStaff, GumpButtonType.Reply, 0);
                m_Gump.AddButton(305, 207, GetNPCButtonState(KinCityData.NPCFlags.Smith, true), GetNPCButtonState(KinCityData.NPCFlags.Smith, false), (int)Buttons.btnProfessionBlackSmiths, GumpButtonType.Reply, 0);
                m_Gump.AddButton(305, 232, GetNPCButtonState(KinCityData.NPCFlags.Tailor, true), GetNPCButtonState(KinCityData.NPCFlags.Tailor, false), (int)Buttons.btnProfessionTailors, GumpButtonType.Reply, 0);
                m_Gump.AddButton(305, 257, GetNPCButtonState(KinCityData.NPCFlags.TownCrier, true), GetNPCButtonState(KinCityData.NPCFlags.TownCrier, false), (int)Buttons.btnProfessionTownCriers, GumpButtonType.Reply, 0);
                m_Gump.AddButton(305, 282, GetNPCButtonState(KinCityData.NPCFlags.Misc, true), GetNPCButtonState(KinCityData.NPCFlags.Misc, false), (int)Buttons.btnProfessionGeneralShops, GumpButtonType.Reply, 0);
                m_Gump.AddButton(305, 307, GetNPCButtonState(KinCityData.NPCFlags.FightBroker, true), GetNPCButtonState(KinCityData.NPCFlags.FightBroker, false), (int)Buttons.btnProfessionFightBrokers, GumpButtonType.Reply, 0);
                m_Gump.AddButton(305, 332, GetNPCButtonState(KinCityData.NPCFlags.Provisioner, true), GetNPCButtonState(KinCityData.NPCFlags.Provisioner, false), (int)Buttons.btnProfessionProvisioners, GumpButtonType.Reply, 0);


                m_Gump.AddLabel(208, 157, 1359, @"Bankers");
                m_Gump.AddLabel(208, 182, 1359, @"Mages");
                m_Gump.AddLabel(208, 207, 1359, @"Weaponsmiths");
                m_Gump.AddLabel(208, 232, 1359, @"Bar Staff");
                m_Gump.AddLabel(208, 257, 1359, @"Animal Tenders");
                m_Gump.AddLabel(208, 282, 1359, @"Patrol Guards");
                m_Gump.AddLabel(208, 307, 1359, @"Travellers");
                m_Gump.AddLabel(208, 332, 1359, @"Gypsies");
                m_Gump.AddLabel(208, 357, 1359, @"Carpenters");

                m_Gump.AddLabel(343, 157, 1359, @"Healers");
                m_Gump.AddLabel(343, 182, 1359, @"Inn Staff");
                m_Gump.AddLabel(343, 207, 1359, @"Blacksmiths");
                m_Gump.AddLabel(343, 232, 1359, @"Tailors");
                m_Gump.AddLabel(343, 257, 1359, @"Town Criers");
                m_Gump.AddLabel(341, 282, 1359, @"General Shops");
                m_Gump.AddLabel(342, 307, 1359, @"Fight Brokers");
                m_Gump.AddLabel(343, 332, 1359, @"Provisioners");

                if (!ReferenceEquals(m_Gump.Data.CityLeader, m_Gump.From))
                {
                    m_Gump.AddHtml(169, 425, 412, 136, "<basefont color=gray><center>Only the city leader may make changes</center></basefont>", false, false);
                }
                else if (m_State.GuardsChanged && !m_Gump.Data.CanChangeGuards)
                {
                    m_Gump.AddHtml(169, 425, 412, 136, "<basefont color=gray><center>You cannot change the guards yet</center></basefont>", (bool)false, (bool)false);
                }
                else if (m_State.NPCsChanged || m_State.GuardsChanged)
                {
                    m_Gump.AddHtml(169, 425, 412, 136, "<basefont color=gray><center>You must press OK before these changes will take effect</center></basefont>", (bool)false, (bool)false);
                }

                m_Gump.AddButton(440, 157, GetGuardButtonState(KinCityData.GuardOptions.None, true), GetGuardButtonState(KinCityData.GuardOptions.None, false), (int)Buttons.btnGuardsNone, GumpButtonType.Reply, 0);
                m_Gump.AddButton(440, 182, GetGuardButtonState(KinCityData.GuardOptions.LordBritish, true), GetGuardButtonState(KinCityData.GuardOptions.LordBritish, false), (int)Buttons.btnGuardsLordBritish, GumpButtonType.Reply, 0);
                m_Gump.AddButton(440, 207, GetGuardButtonState(KinCityData.GuardOptions.FactionAndReds, true), GetGuardButtonState(KinCityData.GuardOptions.FactionAndReds, false), (int)Buttons.btnGuardsKinsReds, GumpButtonType.Reply, 0);
                m_Gump.AddButton(440, 232, GetGuardButtonState(KinCityData.GuardOptions.FactionAndRedsAndCrim, true), GetGuardButtonState(KinCityData.GuardOptions.FactionAndRedsAndCrim, false), (int)Buttons.btnGuardsKinNonInnocents, GumpButtonType.Reply, 0);
                m_Gump.AddButton(440, 257, GetGuardButtonState(KinCityData.GuardOptions.Everyone, true), GetGuardButtonState(KinCityData.GuardOptions.Everyone, false), (int)Buttons.btnGuardsEveryone, GumpButtonType.Reply, 0);
                m_Gump.AddButton(440, 282, GetGuardButtonState(KinCityData.GuardOptions.RedsAndCrim, true), GetGuardButtonState(KinCityData.GuardOptions.RedsAndCrim, false), (int)Buttons.btnGuardsNonInnocents, GumpButtonType.Reply, 0);
                m_Gump.AddButton(440, 307, GetGuardButtonState(KinCityData.GuardOptions.FactionOnly, true), GetGuardButtonState(KinCityData.GuardOptions.FactionOnly, false), (int)Buttons.btnGuardsKin, GumpButtonType.Reply, 0);
                m_Gump.AddButton(440, 332, GetGuardButtonState(KinCityData.GuardOptions.Crim, true), GetGuardButtonState(KinCityData.GuardOptions.Crim, false), (int)Buttons.btnGuardsCriminals, GumpButtonType.Reply, 0);

                m_Gump.AddLabel(478, 157, 1359, @"None");
                m_Gump.AddLabel(478, 182, 1359, @"Lord British");
                m_Gump.AddLabel(478, 207, 1359, @"Kin/Murderers");
                m_Gump.AddLabel(478, 232, 1359, @"Kin/Non Innocents");
                m_Gump.AddLabel(478, 257, 1359, @"Everyone");
                m_Gump.AddLabel(476, 282, 1359, @"Non Innocents");
                m_Gump.AddLabel(478, 307, 1359, @"Kin");
                m_Gump.AddLabel(477, 332, 1359, @"Criminals");

                //////////////////////////////////////////////////////////////////////////////////////////////

                #endregion
            }