Exemplo n.º 1
0
        private void ExtractPNGFromImage(WzImage image)
        {
            WzCanvasProperty reactorImage = WzInfoTools.GetReactorImage(image);

            if (reactorImage != null)
            {
                Image  = reactorImage.PngProperty.GetPNG(false);
                Origin = WzInfoTools.VectorToSystemPoint((WzVectorProperty)reactorImage["origin"]);
            }
            else
            {
                Image  = new Bitmap(1, 1);
                Origin = new System.Drawing.Point();
            }
        }
Exemplo n.º 2
0
        private void ExtractPNGFromImage(WzImage image)
        {
            WzCanvasProperty npcImage = WzInfoTools.GetNpcImage(image);

            if (npcImage != null)
            {
                Image = npcImage.PngProperty.GetPNG(false);
                if (Image.Width == 1 && Image.Height == 1)
                {
                    Image = global::HaCreator.Properties.Resources.placeholder;
                }
                Origin = WzInfoTools.VectorToSystemPoint((WzVectorProperty)npcImage["origin"]);
            }
            else
            {
                Image  = new Bitmap(1, 1);
                Origin = new System.Drawing.Point();
            }
        }
        private static ObjectInfo Load(WzSubProperty parentObject, string oS, string l0, string l1, string l2)
        {
            WzCanvasProperty frame1    = (WzCanvasProperty)WzInfoTools.GetRealProperty(parentObject["0"]);
            ObjectInfo       result    = new ObjectInfo(frame1.PngProperty.GetPNG(false), WzInfoTools.VectorToSystemPoint((WzVectorProperty)frame1["origin"]), oS, l0, l1, l2, parentObject);
            WzImageProperty  chairs    = parentObject["seat"];
            WzImageProperty  ropes     = frame1["rope"];
            WzImageProperty  ladders   = frame1["ladder"];
            WzImageProperty  footholds = frame1["foothold"];

            result.footholdOffsets = ParsePropToOffsetMap(footholds);
            result.ropeOffsets     = ParsePropToOffsetMap(ropes);
            result.ladderOffsets   = ParsePropToOffsetMap(ladders);
            if (chairs != null)
            {
                result.chairOffsets = ParsePropToOffsetList(chairs);
            }
            return(result);
        }
Exemplo n.º 4
0
        public static PortalInfo Load(WzCanvasProperty parentObject)
        {
            PortalInfo portal = new PortalInfo(parentObject.Name, parentObject.PngProperty.GetPNG(false), WzInfoTools.VectorToSystemPoint((WzVectorProperty)parentObject["origin"]), parentObject);

            Program.InfoManager.Portals.Add(portal.type, portal);
            return(portal);
        }
Exemplo n.º 5
0
        private static BackgroundInfo Load(WzImageProperty parentObject, string bS, bool ani, string no)
        {
            WzCanvasProperty frame0 = ani ? (WzCanvasProperty)WzInfoTools.GetRealProperty(parentObject["0"]) : (WzCanvasProperty)WzInfoTools.GetRealProperty(parentObject);

            return(new BackgroundInfo(frame0.PngProperty.GetPNG(false), WzInfoTools.VectorToSystemPoint((WzVectorProperty)frame0["origin"]), bS, ani, no, parentObject));
        }
Exemplo n.º 6
0
        private static TileInfo Load(WzCanvasProperty parentObject, string tS, string u, string no, int?mag)
        {
            WzImageProperty  zProp     = parentObject["z"];
            int              z         = zProp == null ? 0 : InfoTool.GetInt(zProp);
            TileInfo         result    = new TileInfo(parentObject.PngProperty.GetPNG(false), WzInfoTools.VectorToSystemPoint((WzVectorProperty)parentObject["origin"]), tS, u, no, mag.HasValue ? mag.Value : 1, z, parentObject);
            WzConvexProperty footholds = (WzConvexProperty)parentObject["foothold"];

            if (footholds != null)
            {
                foreach (WzVectorProperty foothold in footholds.WzProperties)
                {
                    result.footholdOffsets.Add(WzInfoTools.VectorToXNAPoint(foothold));
                }
            }
            if (UserSettings.FixFootholdMispositions)
            {
                FixFootholdMispositions(result);
            }
            return(result);
        }