Ejemplo n.º 1
0
            public void LoadWzResource()
            {
                var             mapHelperNode = PluginBase.PluginManager.FindWz("Map/MapHelper.img/minimap");
                Action <string> addResource   = (key) =>
                {
                    Wz_Node resNode = mapHelperNode.Nodes[key];
                    var     texture = UIHelper.LoadTexture(resNode);
                    if (texture != null)
                    {
                        this.Resources[key] = texture;
                    }
                };

                if (mapHelperNode != null)
                {
                    addResource("transport");
                    addResource("portal");
                    addResource("enchantportal");
                    addResource("hiddenportal");
                    addResource("npc");
                    addResource("eventnpc");
                    addResource("shop");
                    addResource("trunk");
                    addResource("arrowup");
                }
            }
Ejemplo n.º 2
0
        private TextureItem LoadTextureItem(Wz_Node node, bool loadHitMap = false)
        {
            var item     = new TextureItem();
            var linkNode = node.GetLinkedSourceNode(PluginBase.PluginManager.FindWz);

            item.Texture = UIHelper.LoadTexture(linkNode);
            item.Z       = node.Nodes["z"].GetValueEx <int>(0);
            var origin = node.Nodes["origin"]?.GetValueEx <Wz_Vector>(null);

            item.Origin = origin.ToPointF();
            if (item.Texture != null && loadHitMap)
            {
                item.HitMap = UIHelper.CreateHitMap(item.Texture.GetNativeTexture() as Microsoft.Xna.Framework.Graphics.Texture2D);
            }
            return(item);
        }