The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 2 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[UPDATED]Paperdoll & Web
Author Message
evening
Journeyman
*

Posts: 138
Likes Given: 0
Likes Received: 14 in 9 posts
Joined: Apr 2012
Reputation: 1

Finally Land

Post: #41
RE: [UPDATED]Paperdoll & Web
Yes
The database system is too strong
I like this style
I think I will try to learn it
06-05-2014 01:21 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Avatar
Journeyman
*

Posts: 172
Likes Given: 6
Likes Received: 27 in 12 posts
Joined: Apr 2012
Reputation: 5

The North Shield

Post: #42
RE: [UPDATED]Paperdoll & Web
Keep on working, you will certainly get what you want Wink
(This post was last modified: 06-07-2014 01:29 AM by Avatar.)
06-07-2014 01:29 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
evening
Journeyman
*

Posts: 138
Likes Given: 0
Likes Received: 14 in 9 posts
Joined: Apr 2012
Reputation: 1

Finally Land

Post: #43
RE: [UPDATED]Paperdoll & Web
Thank you
06-07-2014 01:14 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
admin phoenix
Master
**

Posts: 354
Likes Given: 1
Likes Received: 23 in 13 posts
Joined: Mar 2012
Reputation: 3



Post: #44
RE: [UPDATED]Paperdoll & Web
I think it will be very easy to do this one if we have ingame a command which will show us the link from art to gump.
At the moment you have to find it out with a lot of work arounds and def names.
don´t know if it is hardcoded in the client?
06-10-2014 06:39 PM
Find all posts by this user Like Post Quote this message in a reply
horadryn
Apprentice
*

Posts: 8
Likes Given: 2
Likes Received: 0 in 0 posts
Joined: Nov 2012
Reputation: 0



Post: #45
RE: [UPDATED]Paperdoll & Web
Can someone translate this?

Code:
using System;
using System.Collections;

namespace Server.Engines.MyRunUO
{
    public class LayerComparer : IComparer
    {
        private static Layer PlateArms = (Layer)255;
        private static Layer ChainTunic = (Layer)254;
        private static Layer LeatherShorts = (Layer)253;

        private static Layer[] m_DesiredLayerOrder = new Layer[]
        {
            Layer.Cloak,
            Layer.Bracelet,
            Layer.Ring,
            Layer.Shirt,
            Layer.Pants,
            Layer.InnerLegs,
            Layer.Shoes,
            LeatherShorts,
            Layer.Arms,
            Layer.InnerTorso,
            LeatherShorts,
            PlateArms,
            Layer.MiddleTorso,
            Layer.OuterLegs,
            Layer.Neck,
            Layer.Waist,
            Layer.Gloves,
            Layer.OuterTorso,
            Layer.OneHanded,
            Layer.TwoHanded,
            Layer.FacialHair,
            Layer.Hair,
            Layer.Helm,
            Layer.Talisman
        };

        private static int[] m_TranslationTable;

        public static int[] TranslationTable
        {
            get{ return m_TranslationTable; }
        }

        static LayerComparer()
        {
            m_TranslationTable = new int[256];

            for ( int i = 0; i < m_DesiredLayerOrder.Length; ++i )
                m_TranslationTable[(int)m_DesiredLayerOrder[i]] = m_DesiredLayerOrder.Length - i;
        }

        public static bool IsValid( Item item )
        {
            return ( m_TranslationTable[(int)item.Layer] > 0 );
        }

        public static readonly IComparer Instance = new LayerComparer();

        public LayerComparer()
        {
        }

        public Layer Fix( int itemID, Layer oldLayer )
        {
            if ( itemID == 0x1410 || itemID == 0x1417 ) // platemail arms
                return PlateArms;

            if ( itemID == 0x13BF || itemID == 0x13C4 ) // chainmail tunic
                return ChainTunic;

            if ( itemID == 0x1C08 || itemID == 0x1C09 ) // leather skirt
                return LeatherShorts;

            if ( itemID == 0x1C00 || itemID == 0x1C01 ) // leather shorts
                return LeatherShorts;

            return oldLayer;
        }

        public int Compare( object x, object y )
        {
            Item a = (Item)x;
            Item b = (Item)y;

            Layer aLayer = a.Layer;
            Layer bLayer = b.Layer;

            aLayer = Fix( a.ItemID, aLayer );
            bLayer = Fix( b.ItemID, bLayer );

            return m_TranslationTable[(int)bLayer] - m_TranslationTable[(int)aLayer];
        }
    }
}
06-15-2014 09:14 PM
Find all posts by this user Like Post Quote this message in a reply
Feeh
Sphere Developer
*****

Posts: 156
Likes Given: 6
Likes Received: 40 in 29 posts
Joined: Sep 2012
Reputation: 4



Post: #46
RE: [UPDATED]Paperdoll & Web
(06-15-2014 09:14 PM)horadryn Wrote:  Can someone translate this?

Code:
using System;
using System.Collections;
...

That's a layer comparer as the class name says.
RunUO does use it to place in order every gump piece of your paperdoll.
There is no easy translation to that, depends on what context you will be using, and may even be better to create a new way to compare depending on what you will use it.
I've played with RunUO for a long time and I can say its code is made to fit their specific needs, it can tell you what is needed to do something, but will not tell you how to do it
So, if you're playing with Sphere scripts, this class will take a totally different form than C#, the same for PHP, C++, etc...

(06-10-2014 06:39 PM)admin phoenix Wrote:  I think it will be very easy to do this one if we have ingame a command which will show us the link from art to gump.
At the moment you have to find it out with a lot of work arounds and def names.
don´t know if it is hardcoded in the client?
I never saw anything inside the client files that link an item art with gump art.
UO client always had (at least for me) a fame to be badly coded with lots of workarounds. UO community have a incredible vast amount of knowledge around UO classic client that if there were something like that the community would already have found it, unless EA made it well hidden Tongue
Even UltimaXNA and other custom clients does use a very same method to draw the gump in order

Feeh/Epila - Nightly releases / SphereWiki / Github Issues / Sphere's GitHub
(This post was last modified: 06-16-2014 03:25 AM by Feeh.)
06-16-2014 03:24 AM
Find all posts by this user Like Post Quote this message in a reply
horadryn
Apprentice
*

Posts: 8
Likes Given: 2
Likes Received: 0 in 0 posts
Joined: Nov 2012
Reputation: 0



Post: #47
RE: [UPDATED]Paperdoll & Web
I think this is the part that establishes the hierarchy of the layers ... To avoid seeing the pants over the armor ...

although, looking deeply, I think this is the right part

Code:
public void InsertItems( Mobile mob )
        {
            ArrayList items = m_Items;
            items.AddRange( mob.Items );
            string serial = mob.Serial.Value.ToString();

            items.Sort( LayerComparer.Instance );

            int index = 0;

            bool hidePants = false;
            bool alive = mob.Alive;
            bool hideHair = !alive;

            for ( int i = 0; i < items.Count; ++i )
            {
                Item item = (Item)items[i];

                if ( !LayerComparer.IsValid( item ) )
                    break;

                if ( !alive && item.ItemID != 8270 )
                    continue;

                if ( item.ItemID == 0x1411 || item.ItemID == 0x141A ) // plate legs
                    hidePants = true;
                else if ( hidePants && item.Layer == Layer.Pants )
                    continue;

                if ( !hideHair && item.Layer == Layer.Helm )
                    hideHair = true;

                InsertItem( serial, index++, item.ItemID, item.Hue );
            }

            if ( mob.FacialHairItemID != 0 && alive )
                InsertItem( serial, index++, mob.FacialHairItemID, mob.FacialHairHue );

            if ( mob.HairItemID != 0 && !hideHair )
                InsertItem( serial, index++, mob.HairItemID, mob.HairHue );

            items.Clear();
        }
(This post was last modified: 06-16-2014 04:11 AM by horadryn.)
06-16-2014 03:43 AM
Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #48
RE: [UPDATED]Paperdoll & Web
This code is used to set the order of the layers to be shown at paperdoll.

What you want is needed to properly show the gumps at website.
Yes, I have it done and I am sure Coruja too.

I can't share it right now because I'm not home.. Maybe wednesday, I'm not sure.

For the phoenix question, of course there is a way to get the gumps, how do you think they will show at website??
You can find it on paperdoll php file.

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
06-16-2014 07:19 AM
Find all posts by this user Like Post Quote this message in a reply
horadryn
Apprentice
*

Posts: 8
Likes Given: 2
Likes Received: 0 in 0 posts
Joined: Nov 2012
Reputation: 0



Post: #49
RE: [UPDATED]Paperdoll & Web
i love you!

A kiss, all for you

[Image: gene-simmons.jpg?w=300&amp;h=225]
06-16-2014 08:31 PM
Find all posts by this user Like Post Quote this message in a reply
admin phoenix
Master
**

Posts: 354
Likes Given: 1
Likes Received: 23 in 13 posts
Joined: Mar 2012
Reputation: 3



Post: #50
RE: [UPDATED]Paperdoll & Web
@extreme
I mean ingame.
On the Homepage I already got it in the past with php Smile
06-17-2014 06:36 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 2 Guest(s)