Server.Gumps.HouseGump.HouseGump C# (CSharp) Méthode

HouseGump() public méthode

public HouseGump ( Mobile from, BaseHouse house ) : System
from Mobile
house Server.Multis.BaseHouse
Résultat System
    public HouseGump(Mobile from, BaseHouse house) : base(20, 30)
    {
        if (house.Deleted)
            return;

        m_House = house;

        from.CloseGump(typeof(HouseGump));
        from.CloseGump(typeof(HouseListGump));
        from.CloseGump(typeof(HouseRemoveGump));

        bool isOwner = m_House.IsOwner(from);
        bool isCoOwner = isOwner || m_House.IsCoOwner(from);
        bool isFriend = isCoOwner || m_House.IsFriend(from);

        AddPage(0);

        if (isFriend)
        {
            AddBackground(0, 40, 380, 285, 0xA28);
            AddBackground(15, 100, 350, 25, 0x13EC);
        }

        AddImage(120, 0, 100);

        if (m_House.Sign != null)
        {
            ArrayList lines = Wrap(m_House.Sign.GetName());

            if (lines != null)
            {
                for (int i = 0, y = (101 - (lines.Count * 14)) / 2; i < lines.Count; ++i, y += 14)
                {
                    string s = (string)lines[i];
                    AddLabel(130 + ((143 - (s.Length * 8)) / 2), y, 0x455, (string)lines[i]);
                }
            }
        }

        if (!isFriend)
            return;

        AddLabel(30, 102, 0x0, "INFO");
        AddButton(80, 104, 0x1459, 0x1459, 0, GumpButtonType.Page, 1);

        AddLabel(120, 102, 0x0, "FRIENDS");
        AddButton(210, 104, 0x1459, 0x1459, 0, GumpButtonType.Page, 2);

        AddLabel(245, 102, 0x0, "OPTIONS");
        AddButton(335, 103, 0x1459, 0x1459, 0, GumpButtonType.Page, 3);

        AddButton(50, 290, 0xF7, 0xF8, 0, GumpButtonType.Reply, 0);

        // Info page
        AddPage(1);

        AddLabel(100, 140, 0x0, "Owned by");
        AddLabel(180, 140, 0x455, GetOwnerName());

        AddLabel(30, 170, 0x0, "Number of locked down items:");
        AddLabel(250, 170, 0x0, m_House.LockDownCount.ToString() + " out of " + m_House.MaxLockDowns.ToString());

        AddLabel(30, 190, 0x0, "Number of secure containers:");
        AddLabel(250, 190, 0x0, m_House.SecureCount.ToString() + " out of " + m_House.MaxSecures.ToString());

        AddLabel(30, 240, 0x0, "This house is of modern design");

        if (m_House.Public)
        {
            AddHtmlLocalized(30, 260, 275, 20, 1011241, false, false);
            AddHtml(320, 260, 50, 20, m_House.Visits.ToString(), false, false);
        }

        AddLabel(130, 290, 0x0, "Change the house's name!");
        AddButton(310, 290, 0xA9A, 0xA9B, 1, GumpButtonType.Reply, 0);

        // Friends page
        AddPage(2);

        AddLabel(55, 127, 0x0, "List of Co-Owners");
        AddButton(30, 127, 0xA9A, 0xA9B, 2, GumpButtonType.Reply, 0);

        AddLabel(55, 147, 0x0, "Add a Co-Owner");
        AddButton(30, 147, 0xA9A, 0xA9B, 3, GumpButtonType.Reply, 0);

        AddLabel(55, 167, 0x0, "Remove a Co-Owner");
        AddButton(30, 167, 0xA9A, 0xA9B, 4, GumpButtonType.Reply, 0);

        AddLabel(200, 127, 0x0, "List of Friends");
        AddButton(175, 127, 0xA9A, 0xA9B, 6, GumpButtonType.Reply, 0);

        AddLabel(200, 147, 0x0, "Add a Friend");
        AddButton(175, 147, 0xA9A, 0xA9B, 7, GumpButtonType.Reply, 0);

        AddLabel(200, 167, 0x0, "Remove a Friend");
        AddButton(175, 167, 0xA9A, 0xA9B, 8, GumpButtonType.Reply, 0);

        AddLabel(200, 187, 0x0, "Clear Friend List");
        AddButton(175, 187, 0xA9A, 0xA9B, 9, GumpButtonType.Reply, 0);

        AddLabel(100, 207, 0x0, "Ban someone from the house");
        AddButton(75, 207, 0xA9A, 0xA9B, 10, GumpButtonType.Reply, 0);

        AddLabel(100, 227, 0x0, "Eject someone from the house");
        AddButton(75, 227, 0xA9A, 0xA9B, 11, GumpButtonType.Reply, 0);

        AddLabel(100, 247, 0x0, "View list of banned people");
        AddButton(75, 247, 0xA9A, 0xA9B, 12, GumpButtonType.Reply, 0);

        AddLabel(100, 267, 0x0, "Lift a Ban");
        AddButton(75, 267, 0xA9A, 0xA9B, 13, GumpButtonType.Reply, 0);

        // Options page
        AddPage(3);

        AddLabel(55, 140, 0x0, "Transfer ownership of the house");
        AddButton(30, 140, 0xA9A, 0xA9B, 14, GumpButtonType.Reply, 0);

        AddLabel(55, 170, 0x0, "Demolish the house and get a deed back");
        AddButton(30, 170, 0xA9A, 0xA9B, 15, GumpButtonType.Reply, 0);

        if (!m_House.Public)
        {
            AddLabel(55, 200, 0x0, "Change the house locks");
            AddButton(30, 200, 0xA9A, 0xA9B, 16, GumpButtonType.Reply, 0);

            AddLabel(55, 230, 0x0, "Declare this building to be public. This will make your front door unlockable.");
            AddButton(30, 230, 0xA9A, 0xA9B, 17, GumpButtonType.Reply, 0);
        }
        else
        {
            AddLabel(55, 200, 0x0, "Change the sign type");
            AddButton(30, 200, 2714, 2715, 0, GumpButtonType.Page, 4);

            AddLabel(55, 230, 0x0, "Declare this building to be private.");
            AddButton(30, 230, 2714, 2715, 17, GumpButtonType.Reply, 0);

            // Change the sign type
            AddPage(4);

            for (int i = 0; i < 24; ++i)
            {
                AddRadio(53 + ((i / 4) * 50), 137 + ((i % 4) * 35), 210, 211, false, i + 1);
                AddItem(60 + ((i / 4) * 50), 130 + ((i % 4) * 35), 2980 + (i * 2));
            }

            AddLabel(200, 305, 0x0, "Guild sign choices");
            AddButton(350, 305, 252, 253, 0, GumpButtonType.Page, 5);

            AddLabel(200, 340, 0x0, "Okay that is fine.");
            AddButton(350, 340, 4005, 4007, 18, GumpButtonType.Reply, 0);

            AddPage(5);

            for (int i = 0; i < 29; ++i)
            {
                AddRadio(53 + ((i / 5) * 50), 137 + ((i % 5) * 35), 210, 211, false, i + 25);
                AddItem(60 + ((i / 5) * 50), 130 + ((i % 5) * 35), 3028 + (i * 2));
            }

            AddLabel(200, 260, 0x0, "Shop sign choices");
            AddButton(350, 260, 250, 251, 0, GumpButtonType.Page, 4);

            AddLabel(200, 290, 0x0, "Okay that is fine.");
            AddButton(350, 290, 4005, 4007, 18, GumpButtonType.Reply, 0);
        }
        AddPage(6); // Demolish House Menu ??
    }