RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

ItemNaming on UO:RE clients

Sound God

Sorceror
Hi, im using RunUO 2.1 and client v 2.0.3
Expansion.UOR

Now i have a problem, when i singleclicked on item its names not showing
mobiles is ok
let me know how and where i can modify it
Thanks
 

Sound God

Sorceror
Im using old client and want to make it without clilocs, just a name of items
Now names of items just not showing on UO:RE clients

I want to make like it looks on sphereemu

but now names just not showing if click on it
if i click on item with amount>1 my client just crushed

Code:
        public virtual void OnSingleClick( Mobile from )
        {
            if ( Deleted || !from.CanSee( this ) )
                return;

            if ( DisplayLootType )
                LabelLootTypeTo( from );

            NetState ns = from.NetState;

            if ( ns != null )
            {
                if ( this.Name == null )
                {
                    if ( m_Amount <= 1 )
                    ns.Send( new MessageLocalized( m_Serial, m_ItemID, MessageType.Label, 0x3B2, 3, LabelNumber, "", "" ) );
                    else
                        ns.Send( new MessageLocalizedAffix( m_Serial, m_ItemID, MessageType.Label, 0x3B2, 3, LabelNumber, "", AffixType.Append, String.Format( " : {0}", m_Amount ), "" ) );
                }
            else
                {
                ns.Send( new UnicodeMessage( m_Serial, m_ItemID, MessageType.Label, 0x3B2, 3, "ENU", "", this.Name + ( m_Amount > 1 ? " : " + m_Amount : "" ) ) );
                }
            }
        }
 

Jeff

Lord
Have you tried
Code:
ns.Send( new MessageLocalizedAffix( m_Serial, m_ItemID, MessageType.Label, 0x3B2, 3, LabelNumber, "", AffixType.Prepend, String.Format( "{0}", m_Amount ), "" ) );
Notice i changed the format string, and AffixType to Prepend...
 

Sound God

Sorceror
its not work for me
if i click on item with amount>1 my client just crushed
if i click on single item name just not showing
 

Jeff

Lord
If you don't show the crash, we cannot help you. Please show your modified code and the crash.
 

Sound God

Sorceror
Code:
 public virtual void OnSingleClick( Mobile from )
        {
            if ( Deleted || !from.CanSee( this ) )
                return;

            if ( DisplayLootType )
                LabelLootTypeTo( from );

            NetState ns = from.NetState;

            if ( ns != null )
            {
                if ( this.Name == null )
                {
                    if ( m_Amount <= 1 )
                    ns.Send( new MessageLocalized( m_Serial, m_ItemID, MessageType.Label, 0x3B2, 3, LabelNumber, "", "" ) );
                    else
                        ns.Send( new MessageLocalizedAffix( m_Serial, m_ItemID, MessageType.Label, 0x3B2, 3, LabelNumber, "", AffixType.Append, String.Format( " : {0}", m_Amount ), "" ) );
                }
            else
                {
                ns.Send( new UnicodeMessage( m_Serial, m_ItemID, MessageType.Label, 0x3B2, 3, "ENU", "", this.Name + ( m_Amount > 1 ? " : " + m_Amount : "" ) ) );
                }
            }
        }
I don't modifyed any core files yet.
Its code from Items.cs.
If i use newest clients all work fine
 

Sound God

Sorceror
I think that my problem in wrong packets. Im using client v 2.0.3
If you know how i can make a support for these client please let me know right direction )))
 

Sound God

Sorceror
Solved
for an old clients work fine
Code:
ns.Send(new AsciiMessage(m_Serial, m_ItemID, MessageType.Label, 0x3B2, 3, "", this.Name + (m_Amount > 1 ? " : " + m_Amount : "")));
 
Top