当前位置: 首页>>代码示例>>C#>>正文


C# BaseHouse.IsFriend方法代码示例

本文整理汇总了C#中Server.Multis.BaseHouse.IsFriend方法的典型用法代码示例。如果您正苦于以下问题:C# BaseHouse.IsFriend方法的具体用法?C# BaseHouse.IsFriend怎么用?C# BaseHouse.IsFriend使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Server.Multis.BaseHouse的用法示例。


在下文中一共展示了BaseHouse.IsFriend方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: HouseGumpAOS

		public HouseGumpAOS( HouseGumpPageAOS page, Mobile from, BaseHouse house ) : base( 50, 40 )
		{
			m_House = house;
			m_Page = page;

			from.CloseGump( typeof( HouseGumpAOS ) );
			//from.CloseGump( typeof( HouseListGump ) );
			//from.CloseGump( typeof( HouseRemoveGump ) );

			bool isCombatRestricted = house.IsCombatRestricted( from );

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

			if ( isCombatRestricted )
				isFriend = isCoOwner = isOwner = false;

			AddPage( 0 );

			if ( isFriend || page == HouseGumpPageAOS.Vendors )
			{
				AddBackground( 0, 0, 420, page != HouseGumpPageAOS.Vendors ? 440 : 420, 5054 );

				AddImageTiled( 10, 10, 400, 100, 2624 );
				AddAlphaRegion( 10, 10, 400, 100 );

				AddImageTiled( 10, 120, 400, 260, 2624 );
				AddAlphaRegion( 10, 120, 400, 260 );

				AddImageTiled( 10, 390, 400, page != HouseGumpPageAOS.Vendors ? 40 : 20, 2624 );
				AddAlphaRegion( 10, 390, 400, page != HouseGumpPageAOS.Vendors ? 40 : 20 );

				AddButtonLabeled( 250, page != HouseGumpPageAOS.Vendors ? 410 : 390, 0, 1060675 ); // CLOSE
			}

			AddImage( 10, 10, 100 );

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

				if ( lines != null )
				{
					for ( int i = 0, y = (114 - (lines.Count * 14)) / 2; i < lines.Count; ++i, y += 14 )
					{
						string s = (string)lines[i];

						AddLabel( 10 + ((160 - (s.Length * 8)) / 2), y, 0, s );
					}
				}
			}

			if ( page == HouseGumpPageAOS.Vendors )
			{
				AddHtmlLocalized( 10, 120, 400, 20, 1062428, LabelColor, false, false ); // <CENTER>SHOPS</CENTER>

				AddList( house.AvailableVendorsFor( from ), 1, false, false, from );
				return;
			}

			if ( !isFriend )
				return;

			if ( house != null )
			{
				AddButtonLabeled( 10, 390, GetButtonID( 0, 0 ), 1060674 ); // Banish
				AddButtonLabeled( 10, 410, GetButtonID( 0, 1 ), 1011261 ); // Lift a Ban
			}
/*Zycron
			else
			{
				AddButtonLabeled( 10, 390, GetButtonID( 0, 2 ), 1060676 ); // Grant Access
				AddButtonLabeled( 10, 410, GetButtonID( 0, 3 ), 1060677 ); // Revoke Access
			}
Zycron*/
			AddPageButton( 150, 10, GetButtonID( 1, 0 ), 1060668, HouseGumpPageAOS.Information );
			AddPageButton( 150, 30, GetButtonID( 1, 1 ), 1060669, HouseGumpPageAOS.Security );
			AddPageButton( 150, 50, GetButtonID( 1, 2 ), 1060670, HouseGumpPageAOS.Storage );
			AddPageButton( 150, 70, GetButtonID( 1, 3 ), 1060671, HouseGumpPageAOS.Customize );
			AddPageButton( 150, 90, GetButtonID( 1, 4 ), 1060672, HouseGumpPageAOS.Ownership );

			switch ( page )
			{
				case HouseGumpPageAOS.Information:
				{
					AddHtmlLocalized( 20, 130, 200, 20, 1011242, LabelColor, false, false ); // Owned By: 
					AddLabel( 210, 130, LabelHue, GetOwnerName() );

					AddHtmlLocalized( 20, 170, 380, 20, 1018032, SelectedColor, false, false ); // This house is properly placed.
					AddHtmlLocalized( 20, 190, 380, 20, 1018035, SelectedColor, false, false ); // This house is of modern design.
					AddHtmlLocalized( 20, 210, 380, 20, (house is HouseFoundation) ? 1060681 : 1060680, SelectedColor, false, false ); // This is a (pre | custom)-built house.
					AddHtmlLocalized( 20, 230, 380, 20, house.Public ? 1060678 : 1060679, SelectedColor, false, false ); // This house is (private | open to the public).

					switch ( house.DecayType )
					{
						case DecayType.Ageless:
						case DecayType.AutoRefresh:
						{
							AddHtmlLocalized( 20, 250, 380, 20, 1062209, SelectedColor, false, false ); // This house is <a href = "?ForceTopic97">Automatically</a> refreshed.
//.........这里部分代码省略.........
开发者ID:greeduomacro,项目名称:GoUO,代码行数:101,代码来源:HouseGumpAOS.cs

示例2: HouseGump

    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);

//.........这里部分代码省略.........
开发者ID:Grimoric,项目名称:RunUO.T2A,代码行数:101,代码来源:HouseGump.cs

示例3: HouseGump

        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 isCombatRestricted = house.IsCombatRestricted( from );

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

            if ( isCombatRestricted )
                isFriend = isCoOwner = isOwner = false;

            AddPage( 0 );

            if ( isFriend )
            {
                AddBackground( 0, 0, 420, 430, 5054 );
                AddBackground( 10, 10, 400,410, 3000 );
            }

            AddImage( 130, 0, 100 );

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

                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, 0, s );
                    }
                }
            }

            if ( !isFriend )
                return;

            AddHtmlLocalized( 55, 103, 75, 20, 1011233, false, false ); // INFO
            AddButton( 20, 103, 4005, 4007, 0, GumpButtonType.Page, 1 );

            AddHtmlLocalized( 170, 103, 75, 20, 1011234, false, false ); // FRIENDS
            AddButton( 135, 103, 4005, 4007, 0, GumpButtonType.Page, 2 );

            AddHtmlLocalized( 295, 103, 75, 20, 1011235, false, false ); // OPTIONS
            AddButton( 260, 103, 4005, 4007, 0, GumpButtonType.Page, 3 );

            AddHtmlLocalized( 295, 390, 75, 20, 1011441, false, false );  // EXIT
            AddButton( 260, 390, 4005, 4007, 0, GumpButtonType.Reply, 0 );

            AddHtmlLocalized( 55, 390, 200, 20, 1011236, false, false ); // Change this house's name!
            AddButton( 20, 390, 4005, 4007, 1, GumpButtonType.Reply, 0 );

            // Info page
            AddPage( 1 );

            AddHtmlLocalized( 20, 135, 100, 20, 1011242, false, false ); // Owned by:
            AddHtml( 120, 135, 100, 20, GetOwnerName(), false, false );

            AddHtmlLocalized( 20, 170, 275, 20, 1011237, false, false ); // Number of locked down items:
            AddHtml( 320, 170, 50, 20, m_House.LockDownCount.ToString(), false, false );

            AddHtmlLocalized( 20, 190, 275, 20, 1011238, false, false ); // Maximum locked down items:
            AddHtml( 320, 190, 50, 20, m_House.MaxLockDowns.ToString(), false, false );

            AddHtmlLocalized( 20, 210, 275, 20, 1011239, false, false ); // Number of secure containers:
            AddHtml( 320, 210, 50, 20, m_House.SecureCount.ToString(), false, false );

            AddHtmlLocalized( 20, 230, 275, 20, 1011240, false, false ); // Maximum number of secure containers:
            AddHtml( 320, 230, 50, 20, m_House.MaxSecures.ToString(), false, false );

            AddHtmlLocalized( 20, 260, 400, 20, 1018032, false, false ); // This house is properly placed.
            AddHtmlLocalized( 20, 280, 400, 20, 1018035, false, false ); // This house is of modern design.

            if ( m_House.Public )
            {
                // TODO: Validate exact placement
                AddHtmlLocalized( 20, 305, 275, 20, 1011241, false, false ); // Number of visits this building has had
                AddHtml( 320, 305, 50, 20, m_House.Visits.ToString(), false, false );
            }

            // Friends page
            AddPage( 2 );

            AddHtmlLocalized( 45, 130, 150, 20, 1011266, false, false ); // List of co-owners
            AddButton( 20, 130, 2714, 2715, 2, GumpButtonType.Reply, 0 );

            AddHtmlLocalized( 45, 150, 150, 20, 1011267, false, false ); // Add a co-owner
            AddButton( 20, 150, 2714, 2715, 3, GumpButtonType.Reply, 0 );
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:101,代码来源:HouseGump.cs

示例4: ISHOUSEFRIEND

			public static bool ISHOUSEFRIEND(TriggerObject trigObject, Mobile mob, BaseHouse house)
			{
				return mob != null && house != null && house.IsFriend(mob);
			}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:4,代码来源:UberScriptFunctions.cs

示例5: HouseGump

        public HouseGump(Mobile from, BaseHouse house)
            : base(100, 50)
        {
            if (house.Deleted)
                return;

            bool isTent = house is Tent;

            m_House = house;

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

            bool isCombatRestricted = house.IsCombatRestricted(from);

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

            if (isCombatRestricted)
                isFriend = isCoOwner = isOwner = false;

            AddPage(0);

            if (isFriend)
            {
                AddBackground(100, 100, 400, 300, 0xA28);
                AddBackground(116, 165, 369, 25, 0x13EC);
            }

            AddImage(230, 65, 100);

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

                if (lines != null) //HOUSE SIGN NAME TO FIX
                {
                    for (int i = 0, y = (101 - (lines.Count * 14)) / 2; i < lines.Count; ++i, y += 14)
                    {
                        string s = (string)lines[i];

                        string housename = String.Format("<big>{0}</big>", s);
                        AddHtml(230 + ((143 - (s.Length * 8)) / 2), y + 65, 100, 20, housename, false, false);
                    }
                }
            }

            if (!isFriend)
                return;

            AddHtml(125, 168, 75, 20, "<big>INFO</big>", false, false); //INFO
            AddButton(170, 169, 0x1459, 0x138B, 0, GumpButtonType.Page, 1);

            AddHtml(230, 168, 75, 20, "<big>FRIENDS</big>", false, false); //FRIENDS
            AddButton(310, 169, 0x1459, 0x138B, 0, GumpButtonType.Page, 2);

            AddHtml(375, 168, 75, 20, "<big>OPTIONS</big>", false, false); //OPTIONS
            AddButton(455, 169, 0x1459, 0x138B, 0, GumpButtonType.Page, 3);

            // Info page
            AddPage(1);

            AddButton(150, 366, 0xF7, 0xF8, 0, GumpButtonType.Reply, 0); //EXIT;

            AddHtml(245, 365, 300, 20, "<big>Change this house's name!</big>", false, false); //Change this house's name!
            AddButton(425, 365, 0xA9A, 0xA9B, 1, GumpButtonType.Reply, 0);

            string ownedbyname = String.Format("<big><center><basefont color=white>Owned by  <basefont color=black>{0}</big></center>", GetOwnerName());
            AddHtml(100, 205, 400, 20, ownedbyname, false, false);

            string lockdowns = String.Format("<big><basefont color=white>Number of locked down items:<basefont color=black> {0} out of {1}</basefont>", m_House.LockDownCount, m_House.MaxLockDowns);
            AddHtml(140, 240, 350, 20, lockdowns, false, false);

            string secures = String.Format("<big><basefont color=white>Number of secure containers:<basefont color=black> {0} out of {1}</basefont>", m_House.SecureCount, m_House.MaxSecures);
            AddHtml(140, 260, 350, 20, secures, false, false);

            AddHtml(140, 315, 400, 20, "<big><basefont color=white>This house is properly placed.</big></basefont>", false, false);
            AddHtml(140, 333, 400, 20, "<big><basefont color=white>This house is of classic design.</big></basefont>", false, false);

            if (m_House.Public)
            {
                string visits = String.Format("<big><basefont color=white>Number of visits this building has had:  <basefont color=black>{0}</big></basefont>", m_House.Visits);
                AddHtml(140, 295, 400, 20, visits, false, false);
            }

            // Friends page
            AddPage(2);

            AddButton(150, 366, 0xF7, 0xF8, 0, GumpButtonType.Reply, 0); //EXIT;

            AddHtml(153, 194, 150, 20, "<big><basefont color=white>List of co-owners</basefont>", false, false); // <big><basefont color=white>List of co-owners</basefont>
            AddButton(125, 194, 2714, 2715, 2, GumpButtonType.Reply, 0);

            AddHtml(153, 216, 150, 20, "<big><basefont color=white>Add a co-owner</basefont>", false, false); // <big><basefont color=white>Add a co-owner</basefont>
            AddButton(125, 216, 2714, 2715, 3, GumpButtonType.Reply, 0);

            AddHtml(153, 238, 150, 20, "<big><basefont color=white>Remove a co-owner</basefont>", false, false); // <big><basefont color=white>Remove a co-owner</basefont>
            AddButton(125, 238, 2714, 2715, 4, GumpButtonType.Reply, 0);
//.........这里部分代码省略.........
开发者ID:greeduomacro,项目名称:divinity,代码行数:101,代码来源:HouseGump.cs

示例6: HouseGumpAOS

        public HouseGumpAOS( HouseGumpPageAOS page, Mobile from, BaseHouse house )
            : base(50, 40)
        {
            m_House = house;
            m_Page = page;

            from.CloseGump( typeof( HouseGumpAOS ) );
            //from.CloseGump( typeof( HouseListGump ) );
            //from.CloseGump( typeof( HouseRemoveGump ) );

            bool isCombatRestricted = house.IsCombatRestricted( from );

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

            if ( isCombatRestricted )
                isFriend = isCoOwner = isOwner = false;

            AddPage( 0 );

            if ( isFriend || page == HouseGumpPageAOS.Vendors )
            {
                AddBackground(0, 0, 420, page != HouseGumpPageAOS.Vendors ? 440 : 420, 9270);

                AddImageTiled( 10, 10, 400, 100, 2624 );
                //AddAlphaRegion( 10, 10, 400, 100 );

                AddImageTiled( 10, 120, 400, 260, 2624 );
                //AddAlphaRegion( 10, 120, 400, 260 );

                AddImageTiled( 10, 390, 400, page != HouseGumpPageAOS.Vendors ? 40 : 20, 2624 );
                //AddAlphaRegion( 10, 390, 400, page != HouseGumpPageAOS.Vendors ? 40 : 20 );

                AddButtonLabeled( 250, page != HouseGumpPageAOS.Vendors ? 410 : 390, 0, "Fechar", true ); // CLOSE
            }

            AddImage( 10, 10, 100 );

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

                if ( lines != null )
                {
                    for ( int i = 0, y = (114 - (lines.Count * 14)) / 2; i < lines.Count; ++i, y += 14 )
                    {
                        string s = (string)lines[i];

                        AddLabel( 10 + ((160 - (s.Length * 8)) / 2), y, 0, s );
                    }
                }
            }

            if ( page == HouseGumpPageAOS.Vendors )
            {
                AddHtmlLocalized( 10, 120, 400, 20, 1062428, LabelColor, false, false ); // <CENTER>SHOPS</CENTER>

                AddList( house.AvailableVendorsFor( from ), 1, false, false, from );
                return;
            }

            if ( !isFriend )
                return;

            if ( house.Public )
            {
                AddButtonLabeled( 10, 390, GetButtonID( 0, 0 ), "Banir", true); // Banish
                AddButtonLabeled(10, 410, GetButtonID(0, 1), "Remover Ban", true); // Lift a Ban
            }
            else
            {
                AddButtonLabeled(10, 390, GetButtonID(0, 2), "Permitir Acesso", true); // Grant Access
                AddButtonLabeled(10, 410, GetButtonID(0, 3), "Remover Acesso", true); // Revoke Access
            }

            AddPageButton( 150, 10, GetButtonID( 1, 0 ), "INFORMAÇÕES", HouseGumpPageAOS.Information );
            AddPageButton( 150, 30, GetButtonID( 1, 1 ), "SEGURANÇA", HouseGumpPageAOS.Security );
            AddPageButton( 150, 50, GetButtonID( 1, 2 ), "SECURES", HouseGumpPageAOS.Storage );
            AddPageButton( 150, 70, GetButtonID( 1, 3 ), "CUSTOMIZAR", HouseGumpPageAOS.Customize );
            AddPageButton( 150, 90, GetButtonID( 1, 4 ), "TRANSFERIR", HouseGumpPageAOS.Ownership );

            switch ( page )
            {
                case HouseGumpPageAOS.Information:
                {
                    //AddHtmlLocalized( 20, 130, 200, 20, 1011242, LabelColor, false, false ); // Owned By:
                    AddHtml(20, 130, 200, 20, "Dono: " + GetOwnerName(), false, false); // Owned By:
                    //AddLabel( 210, 130, LabelHue, GetOwnerName() );

                    AddHtml(20, 170, 380, 20, "Esta casa está colocada corretamente", false, false); // This house is properly placed.
                    AddHtml(20, 190, 380, 20, "Esta casa é de estilo moderno", false, false); // This house is of modern design.
                    AddHtml(20, 210, 380, 20, (house is HouseFoundation) ? "Esta é uma casa customizada" : "Esta é uma casa pré-moldada", false, false); // This is a (pre | custom)-built house.
                    //AddHtmlLocalized(20, 230, 380, 20, house.Public ? "" : 1060679, SelectedColor, false, false); // This house is (private | open to the public).
                    AddHtml(20, 230, 380, 20, house.Public ? "Esta casa é pública" : "Esta casa é restrita", false, false); // This house is (private | open to the public).

                    switch ( house.DecayType )
                    {
                        case DecayType.Ageless:
                        case DecayType.AutoRefresh:
//.........这里部分代码省略.........
开发者ID:greeduomacro,项目名称:DimensionsNewAge,代码行数:101,代码来源:HouseGumpAOS.cs

示例7: HouseGumpAOS

		public HouseGumpAOS( HouseGumpPageAOS page, Mobile from, BaseHouse house ) : base( 50, 40 )
		{
			m_House = house;
			m_Page = page;

			from.CloseGump( typeof( HouseGumpAOS ) );
			//from.CloseGump( typeof( HouseListGump ) );
			//from.CloseGump( typeof( HouseRemoveGump ) );

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

			AddPage( 0 );

			if ( isFriend )
			{
				AddBackground( 0, 0, 420, 440, 5054 );

				AddImageTiled( 10, 10, 400, 100, 2624 );
				AddAlphaRegion( 10, 10, 400, 100 );

				AddImageTiled( 10, 120, 400, 260, 2624 );
				AddAlphaRegion( 10, 120, 400, 260 );

				AddImageTiled( 10, 390, 400, 40, 2624 );
				AddAlphaRegion( 10, 390, 400, 40 );

				AddButtonLabeled( 250, 410, 0, 1060675 ); // CLOSE
			}

			AddImage( 10, 10, 100 );

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

				if ( lines != null )
				{
					for ( int i = 0, y = (114 - (lines.Count * 14)) / 2; i < lines.Count; ++i, y += 14 )
					{
						string s = (string)lines[i];

						AddLabel( 10 + ((160 - (s.Length * 8)) / 2), y, 0, s );
					}
				}
			}

			if ( !isFriend )
				return;

			if ( house.Public )
			{
				AddButtonLabeled( 10, 390, GetButtonID( 0, 0 ), 1060674 ); // Banish
				AddButtonLabeled( 10, 410, GetButtonID( 0, 1 ), 1011261 ); // Lift a Ban
			}
			else
			{
				AddButtonLabeled( 10, 390, GetButtonID( 0, 2 ), 1060676 ); // Grant Access
				AddButtonLabeled( 10, 410, GetButtonID( 0, 3 ), 1060677 ); // Revoke Access
			}

			AddPageButton( 150, 10, GetButtonID( 1, 0 ), 1060668, HouseGumpPageAOS.Information );
			AddPageButton( 150, 30, GetButtonID( 1, 1 ), 1060669, HouseGumpPageAOS.Security );
			AddPageButton( 150, 50, GetButtonID( 1, 2 ), 1060670, HouseGumpPageAOS.Storage );
			AddPageButton( 150, 70, GetButtonID( 1, 3 ), 1060671, HouseGumpPageAOS.Customize );
			AddPageButton( 150, 90, GetButtonID( 1, 4 ), 1060672, HouseGumpPageAOS.Ownership );

			switch ( page )
			{
				case HouseGumpPageAOS.Information:
				{
					AddHtmlLocalized( 20, 130, 200, 20, 1011242, LabelColor, false, false ); // Owned By: 
					AddLabel( 210, 130, LabelHue, GetOwnerName() );

					AddHtmlLocalized( 20, 170, 380, 20, 1018032, SelectedColor, false, false ); // This house is properly placed.
					AddHtmlLocalized( 20, 190, 380, 20, 1018035, SelectedColor, false, false ); // This house is of modern design.
					AddHtmlLocalized( 20, 210, 380, 20, (house is HouseFoundation) ? 1060681 : 1060680, SelectedColor, false, false ); // This is a (pre | custom)-built house.
					AddHtmlLocalized( 20, 230, 380, 20, house.Public ? 1060678 : 1060679, SelectedColor, false, false ); // This house is (private | open to the public).
					AddHtmlLocalized( 20, 250, 380, 20, 1062209, SelectedColor, false, false ); // This house is <a href = "?ForceTopic97">Automatically</a> refreshed.

					AddHtmlLocalized( 20, 290, 200, 20, 1060692, SelectedColor, false, false ); // Built On:
					AddLabel( 250, 290, LabelHue, GetDateTime( house.BuiltOn ) );

					AddHtmlLocalized( 20, 310, 200, 20, 1060693, SelectedColor, false, false ); // Last Traded:
					AddLabel( 250, 310, LabelHue, GetDateTime( house.LastTraded ) );

					AddHtmlLocalized( 20, 330, 200, 20, 1061793, SelectedColor, false, false ); // House Value
					AddLabel( 250, 330, LabelHue, house.Price.ToString() );

					AddHtmlLocalized( 20, 360, 300, 20, 1011241, SelectedColor, false, false ); // Number of visits this building has had: 
					AddLabel( 350, 360, LabelHue, house.Visits.ToString() );

					break;
				}
				case HouseGumpPageAOS.Security:
				{
					AddButtonLabeled( 10, 130, GetButtonID( 3, 0 ), 1011266, isCoOwner ); // View Co-Owner List
					AddButtonLabeled( 10, 150, GetButtonID( 3, 1 ), 1011267, isOwner ); // Add a Co-Owner
					AddButtonLabeled( 10, 170, GetButtonID( 3, 2 ), 1018036, isOwner ); // Remove a Co-Owner
//.........这里部分代码省略.........
开发者ID:zerodowned,项目名称:angelisland,代码行数:101,代码来源:HouseGumpAOS.cs

示例8: HouseGump

		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, 0, 420, 430, 5054 );
				AddBackground( 10, 10, 400,410, 3000 );
			}

			AddImage( 130, 0, 100 );

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

				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, 0, s );
					}
				}
			}

			if ( !isFriend )
				return;

			AddHtmlLocalized( 55, 103, 75, 20, 1011233, false, false ); // INFO
			AddButton( 20, 103, 4005, 4007, 0, GumpButtonType.Page, 1 );

			AddHtmlLocalized( 170, 103, 75, 20, 1011234, false, false ); // FRIENDS
			AddButton( 135, 103, 4005, 4007, 0, GumpButtonType.Page, 2 );

			AddHtmlLocalized( 295, 103, 75, 20, 1011235, false, false ); // OPTIONS
			AddButton( 260, 103, 4005, 4007, 0, GumpButtonType.Page, 3 );

			AddHtmlLocalized( 295, 390, 75, 20, 1011441, false, false );  // EXIT
			AddButton( 260, 390, 4005, 4007, 0, GumpButtonType.Reply, 0 );

			AddHtmlLocalized( 55, 390, 200, 20, 1011236, false, false ); // Change this house's name!
			AddButton( 20, 390, 4005, 4007, 1, GumpButtonType.Reply, 0 );

			// Info page
			AddPage( 1 );

			//const int fieldStartC = 260;	// Center
			const int fieldStartN = 120;	// Near
			const int fieldStartF = 320;	// Far

			AddHtmlLocalized( 20, 135, 100, 20, 1011242, false, false ); // Owned by:
			AddHtml(fieldStartN, 135, 100, 20, GetOwnerName(), false, false);

			// Angel Island House decay display - owner only.
			if( from.Account == m_House.Owner.Account || from.AccessLevel >= AccessLevel.GameMaster )
			{
				if (m_House.TownshipRestrictedRefresh)
				{	// replace the entire "Decay Time" line
					AddLabel(20, 155, 0x20, @"** NON TOWNSHIP HOUSE - WILL NOT REFRESH! **");
				}
				else
				{
					AddHtml(20, 155, 100, 20, "Decay Time:", false, false); //time until decay
					TimeSpan decay = m_House.StructureDecayTime - DateTime.Now;
					int days = decay.Days;
					double hours = decay.Hours;
					hours += ((double)decay.Minutes) / 60;
					string decaystring = string.Format("{0} days, {1:0.0} hours", days, hours);
					AddHtml(fieldStartN, 155, 300, 20, decaystring, false, false);
				}
			}

			int vstep = 175 - 20;
			AddHtml(20, vstep += 20, 275, 20, "Number of locked down items:", false, false); // Number of locked down items:
			AddHtml(fieldStartF, vstep, 64, 20, String.Format("{0}/{1}", m_House.LockDownCount.ToString(), m_House.MaxLockDowns.ToString()), false, false);
	
			//AddHtmlLocalized(20, vstep += 20, 275, 20, 1011238, false, false); // Maximum locked down items:
			//AddHtml(320, vstep, 50, 20, m_House.MaxLockDowns.ToString(), false, false);

			AddHtml(20, vstep += 20, 275, 20, "Number of secure containers:", false, false); // Number of secure containers:
			AddHtml(fieldStartF, vstep, 64, 20, String.Format("{0}/{1}", m_House.SecureCount.ToString(), m_House.MaxSecures.ToString()), false, false);

			//AddHtmlLocalized(20, vstep += 20, 275, 20, 1011240, false, false); // Maximum number of secure containers:
			//AddHtml(320, vstep, 50, 20, m_House.MaxSecures.ToString(), false, false);

//.........这里部分代码省略.........
开发者ID:zerodowned,项目名称:angelisland,代码行数:101,代码来源:HouseGump.cs


注:本文中的Server.Multis.BaseHouse.IsFriend方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。