Ejemplo n.º 1
0
        private ItemTransform CreateTransform(PlaceObject po)
        {
            Matrix3x2 geoRotate;
            Vector2   geoTranslate;

            if (po.Flags.HasFlag(PlaceObjectFlags.HasMatrix))
            {
                geoRotate = new Matrix3x2(po.RotScale.M11, po.RotScale.M12,
                                          po.RotScale.M21, po.RotScale.M22,
                                          0, 0);
                geoTranslate = new Vector2(po.Translation.X, po.Translation.Y);
            }
            else
            {
                geoRotate    = Matrix3x2.Identity;
                geoTranslate = Vector2.Zero;
            }

            ColorRgbaF colorTransform;

            if (po.Flags.HasFlag(PlaceObjectFlags.HasColorTransform))
            {
                colorTransform = po.Color.ToColorRgbaF();
            }
            else
            {
                colorTransform = ColorRgbaF.White;
            }

            return(new ItemTransform(colorTransform, geoRotate, geoTranslate));
        }
Ejemplo n.º 2
0
        private ItemTransform CreateTransform(PlaceObject po)
        {
            Matrix3x2 geoRotate;
            Vector2   geoTranslate;

            if (po.Flags.HasFlag(PlaceObjectFlags.HasMatrix))
            {
                geoRotate = new Matrix3x2(po.RotScale.M11, po.RotScale.M12,
                                          po.RotScale.M21, po.RotScale.M22,
                                          0, 0);
                geoTranslate = new Vector2(po.Translation.X, po.Translation.Y);
            }
            else
            {
                geoRotate    = Matrix3x2.Identity;
                geoTranslate = Vector2.Zero;
            }

            ColorRgbaF tintColor;
            ColorRgbaF additiveColor;

            if (po.Flags.HasFlag(PlaceObjectFlags.HasColorTransform))
            {
                tintColor     = po.TintColor.ToColorRgbaF();
                additiveColor = po.AdditiveColor.ToColorRgbaF();
            }
            else
            {
                tintColor     = ColorRgbaF.White;
                additiveColor = ColorRgbaF.Transparent;
            }

            return(new ItemTransform(tintColor, additiveColor, geoRotate, geoTranslate));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Find a list of characters that match a qname pattern. If nothing is found, an
        /// exception is thrown.
        /// </summary>
        /// <param name="qname">The qname to find.</param>
        /// <param name="swf">The SWF to search.</param>
        /// <param name="patternPermitted">If this is false, the returned array will have 1 element.</param>
        /// <returns>An array of characters matching the qname or qname pattern.</returns>
        public Sprite[] SpritesFromQname(string qname, SWF swf, bool patternPermitted)
        {
            /* ISSUE 62: If qname is a pattern, we should return more than one character. */
            /* ISSUE 62: If qname is a pattern, and patternPermitted is false, throw a wobbler. */

            PlaceObject po = swf.LookupInstance(qname);

            /* ISSUE 63: There is a question of whether to error if the instance is not found. Some are
             * found with a pattern rather than a path, and you may not expect it to always find something.
             * At the moment, we shall throw an exception, because it suits our development, unit testing
             * fail-fast strictness. */
            if (po == null)
            {
                throw new SwiffotronException(
                          SwiffotronError.BadPathOrID,
                          this.Context.Sentinel("FindSpriteByQName"),
                          @"Instance not found: " + qname);
            }

            Sprite sprite = po.Character as Sprite;

            if (sprite == null)
            {
                throw new SwiffotronException(
                          SwiffotronError.BadPathOrID,
                          this.Context,
                          @"Instance does not point to sprite: " + qname);
            }

            return(new Sprite[] { sprite });
        }
    /// <summary>
    /// Place a certain amount of objects randomly in the level in rooms
    /// </summary>
    private void PlaceObjects(PlaceObject objectPlacer, int count)
    {
        for (int i = 0; i < count; i++)
        {
            Room        randomRoom;
            Vector2Int  objectPosition;
            int         infCounter = 0;
            List <Room> roomPos    = rooms.Values.ToList();
            do
            {
                infCounter++;
                if (infCounter > 100)
                {
                    Debug.LogError("Too many objects for one room: Increase the size of your room, or reduce the number of objects.");
                    return;
                }
                randomRoom = roomPos[Random.Range(0, roomPos.Count)];
                int posX = randomRoom.lowerLeftCorner.x + Random.Range(0, randomRoom.GetWidth());
                int posY = randomRoom.lowerLeftCorner.y + Random.Range(0, randomRoom.GetHeight());
                objectPosition = new Vector2Int(posX, posY);
            } while (randomRoom.SpotTaken(objectPosition) || NextToDoor(objectPosition));

            randomRoom.ClaimRoomSpot(objectPosition);
            objectPlacer(objectPosition);
        }
    }
Ejemplo n.º 5
0
        public PartialViewResult _Reviews(string userID)
        {
            string currentUserID = User.Identity.GetUserId();
            ICollection <Review>   reviewsList         = db.Reviews.SqlQuery("dbo.Review_Search @p0", userID).ToList();
            List <ReviewViewModel> formattedReviewList = new List <ReviewViewModel>();

            using (WebClient wc = new WebClient())
            {
                foreach (Review review in reviewsList)
                {
                    // string url = String.Format("https://maps.googleapis.com/maps/api/place/details/json?&placeid={0}&key=AIzaSyBI5B2snURiIE8VkeuNYL2Es3ZZf8veRf4", review.PlaceID);
                    string      url        = String.Format("https://maps.googleapis.com/maps/api/place/details/json?&placeid={0}&key=AIzaSyAuQaBzbJrduma-UhUFoWNyLWfJFoR3vac", review.PlaceID);
                    string      json       = wc.DownloadString(url);
                    PlaceObject jsonObject = JsonConvert.DeserializeObject <PlaceObject>(json);
                    Image       picture    = (review.ImageID != null) ? db.Images.Find(review.ImageID) : new Image();

                    ReviewViewModel formattedReview = new ReviewViewModel(review, jsonObject, picture);
                    formattedReviewList.Add(formattedReview);
                }

                if (userID == currentUserID)
                {
                    Session["Reviews"] = "self";
                }
                else
                {
                    Session["Reviews"] = "user";
                }
                return(PartialView("ProfilePage/_Reviews", formattedReviewList.OrderByDescending(i => i.ReviewID)));
            }
        }
Ejemplo n.º 6
0
 void Init()
 {
     if (place == null)
     {
         place = new PlaceObject();
     }
 }
Ejemplo n.º 7
0
        static uint WriteImpl(MemoryPool memory, PlaceObject placeObject)
        {
            var placeObjectMemory = memory.AllocatePadded(Constants.IntPtrSize * 16, Constants.IntPtrSize);

            using (var placeObjectWriter = GetWriter(placeObjectMemory))
            {
                placeObjectWriter.Write((UInt32)FrameItemType.PlaceObject);
                placeObjectWriter.Write((UInt32)placeObject.Flags);
                placeObjectWriter.Write((Int32)placeObject.Depth);
                placeObjectWriter.Write((Int32)placeObject.Character);
                placeObjectWriter.Write((Matrix2x2)placeObject.RotScale);
                placeObjectWriter.Write((Vector2)placeObject.Translation);
                placeObjectWriter.Write((ColorRgba)placeObject.Color);
                placeObjectWriter.Write((UInt32)0); // unknown
                placeObjectWriter.Write((Single)placeObject.Ratio);

                var nameAddress = placeObject.Flags.HasFlag(PlaceObjectFlags.HasName) ? Write(memory, placeObject.Name) : 0;
                placeObjectWriter.Write((UInt32)nameAddress);

                placeObjectWriter.Write((Int32)placeObject.ClipDepth);

                var clipEventArrayAddress = placeObject.Flags.HasFlag(PlaceObjectFlags.HasClipAction) ? WriteClipEventArray(memory, placeObject.ClipEvents) : 0;
                placeObjectWriter.Write((UInt32)clipEventArrayAddress);
            }
            return(placeObjectMemory.StartAddress);
        }
    public bool ChangePlace(string name)
    {
        bool canAccess = true;

        PlaceObject newPlace = GameInfoManager.getPlace(name);

        if (PlayerPrefs.GetInt("Lucidity") < newPlace.lucidityLevel)
        {
            canAccess = false;
        }
        else
        {
            currentPlace = newPlace;

            nodeHandler.ClearNodes();

            transform.position = mainInitPos;

            Camera.main.transform.position = cameraInitPos;

            if (SceneManager.GetActiveScene().name != "Main")
            {
                SceneManager.LoadScene("Main");
            }

            ChangeSequence(newPlace.firstSequenceId, false, -1, true);
        }

        return(canAccess);
    }
Ejemplo n.º 9
0
        public Bitmap GetFrame(int position, int width, int height)
        {
            if (!is_prepared_picture_)
            {
                PreparePicture();
                is_prepared_picture_ = true;
            }

            CacheItem cache_item = new CacheItem();
            int       prev       = frame_position_list_[position];
            int       current    = frame_position_list_[position + 1];

            for (int i = prev; i < current; ++i)
            {
                if ((int)tag_list_[i].tag == (int)ObjectType.PlaceObject2)
                {
                    PlaceObject place = new PlaceObject(tag_list_[i], data_reader_, (int)tag_list_[i].size);
                    cache_item.AddCommand(FindPicture(place.ObjectId), place.ObjectId, place.X / 20, place.Y / 20, place.Alpha);
                }
            }

            int src_width  = (frame_size_.x_max - frame_size_.x_min) / 20;
            int src_height = (frame_size_.y_max - frame_size_.y_min) / 20;

            Bitmap bitmap = cache_.GetBitmap(cache_item, (width > 0 ? width : src_width),
                                             (height > 0 ? height : src_height), src_width, src_height);

            return((Bitmap)bitmap.Clone());
        }
Ejemplo n.º 10
0
        private void PlaceItem(PlaceObject po)
        {
            var character     = _context.GetCharacter(po.Character, _sprite);
            var itemTransform = CreateTransform(po);

            IDisplayItem displayItem;

            if (character is Playable)
            {
                displayItem = new SpriteItem()
                {
                    Transform = itemTransform
                }
            }
            ;
            else
            {
                displayItem = new RenderItem()
                {
                    Transform = itemTransform
                }
            };

            displayItem.Create(character, _context, this);

            //add this object as an AS property
            if (po.Flags.HasFlag(PlaceObjectFlags.HasName))
            {
                _scriptObject.Variables[po.Name] = Value.FromObject(displayItem.ScriptObject);
                displayItem.Name = po.Name;
            }

            _content.Items[po.Depth] = displayItem;
        }
Ejemplo n.º 11
0
        private void MoveItem(PlaceObject po)
        {
            if (!Content.Items.ContainsKey(po.Depth))
            {
                //TODO WARN
                return;
            }

            var displayItem = Content.Items[po.Depth];
            var cTransform  = displayItem.Transform;

            if (po.Flags.HasFlag(PlaceObjectFlags.HasMatrix))
            {
                cTransform.GeometryRotation = new Matrix3x2(po.RotScale.M11, po.RotScale.M12,
                                                            po.RotScale.M21, po.RotScale.M22,
                                                            0, 0);
                cTransform.GeometryTranslation = new Vector2(po.Translation.X, po.Translation.Y);
            }

            if (po.Flags.HasFlag(PlaceObjectFlags.HasColorTransform))
            {
                cTransform.ColorTransform = po.Color.ToColorRgbaF();
            }

            if (po.Flags.HasFlag(PlaceObjectFlags.HasName))
            {
                ScriptObject.Variables[po.Name] = Value.FromObject(displayItem.ScriptObject);
            }

            displayItem.Transform = cTransform;
        }
Ejemplo n.º 12
0
        private void PlaceItem(PlaceObject po)
        {
            if (Content.Items.ContainsKey(po.Depth))
            {
                return;
            }

            var character     = Context.GetCharacter(po.Character, _sprite);
            var itemTransform = CreateTransform(po);

            DisplayItem displayItem;

            if (character is Playable)
            {
                displayItem = new SpriteItem();
            }
            else if (character is Button)
            {
                displayItem = new ButtonItem();
            }
            else
            {
                displayItem = new RenderItem();
            }

            displayItem.Transform = itemTransform;
            displayItem.Create(character, Context, this);

            //add this object as an AS property
            if (po.Flags.HasFlag(PlaceObjectFlags.HasName))
            {
                ScriptObject.Variables[po.Name] = Value.FromObject(displayItem.ScriptObject);
                displayItem.Name = po.Name;
            }

            if (po.Flags.HasFlag(PlaceObjectFlags.HasClipAction))
            {
                if (po.ClipEvents != null)
                {
                    foreach (var clipEvent in po.ClipEvents)
                    {
                        if (clipEvent.Flags.HasFlag(ClipEventFlags.Initialize))
                        {
                            Context.Avm.Execute(clipEvent.Instructions, displayItem.ScriptObject,
                                                Character.Container.Constants.Entries);
                        }
                    }
                }
            }

            if (po.Flags.HasFlag(PlaceObjectFlags.HasClipDepth))
            {
                displayItem.ClipDepth = po.ClipDepth;

                // TODO: Need to dispose this.
                displayItem.ClipMask = new RenderTarget(Context.Window.ContentManager.GraphicsDevice);
            }

            Content.AddItem(po.Depth, displayItem);
        }
Ejemplo n.º 13
0
        public static void GetPlaceObject(ref PlaceObject _temCafe, WcfService1.PlaceObjectViewData temp)
        {
            _temCafe.Address    = temp.Address;
            _temCafe.Article    = temp.Article;
            _temCafe.background = temp.background;
            _temCafe.Content    = temp.Content;
            try
            {
                _temCafe.DatePost = (DateTime)temp.DatePost;
            }
            catch (InvalidOperationException e)
            {
            }
            _temCafe.geoCoor = new System.Device.Location.GeoCoordinate((double)temp.lattitude, (double)temp.longtitude);

            _temCafe.IsFavorite = (bool)temp.IsFavorite;
            try
            {
                _temCafe.LinkYoutube = new Uri(temp.LinkYoutube, UriKind.RelativeOrAbsolute);
            }
            catch (ArgumentNullException e)
            {
                _temCafe.LinkYoutube = null;
            }

            _temCafe.ListComment = new System.Collections.ObjectModel.ObservableCollection <ItemComment>();
            foreach (WcfService1.ItemComment tempString in temp.ListComment)
            {
                _temCafe.ListComment.Add(convertItemCommnet(tempString));
            }


            _temCafe.NameAuthor      = temp.NameAuthor;
            _temCafe.RatingLevel     = (int)temp.RatingLevel;
            _temCafe.ShorDescription = temp.ShorDescription;
            _temCafe.Title           = temp.Title;
            _temCafe.ZoomLevel       = temp.ZoomLevel;


            BitmapImage bitmap = new BitmapImage();


            bitmap = WP7Shared.ImageUtilitys.GetBitmapImageFromArrayByte(temp.ImageUrl);

            _temCafe.NameImageMain = Guid.NewGuid().ToString();
            //_temCafe.ImageMain = bitmap;


            _temCafe.listImageName = new System.Collections.ObjectModel.ObservableCollection <String>();
            //_temCafe.listImage = new System.Collections.ObjectModel.ObservableCollection<BitmapImage>();
            foreach (byte[] tempIndex in temp.listImage)
            {
                BitmapImage t     = new BitmapImage();
                String      temp1 = Guid.NewGuid().ToString();
                t = WP7Shared.ImageUtilitys.GetBitmapImageFromArrayByte(tempIndex);
                //_temCafe.listImage.Add(t);
                _temCafe.listImageName.Add(temp1);
            }
        }
Ejemplo n.º 14
0
    PlaceObject CreateObject(Vector3 pos, PlaceObject prefab)
    {
        PlaceObject po = Instantiate(prefab);

        po.transform.SetParent(transform);
        po.Setup(pos, 0);
        return(po);
    }
Ejemplo n.º 15
0
    private void Awake()
    {
        slotSelection = FindObjectOfType <SlotSelection>();
        placeObject   = FindObjectOfType <PlaceObject>();

        selectedSlotInstance = Instantiate(selectedSlotPrefab);
        Initiate();
    }
Ejemplo n.º 16
0
    public void TryPlace(PlaceObject placeObject)
    {
        PlaceZone zone = Places.FirstOrDefault((place) => place.IsFree);

        zone?.SetObject(placeObject);
        //Variant for check contains this product
        //        if(Places.Where((place)=> !place.IsFree && place.PlaceObject.Name == placeObject.Name).Count() == 0)
    }
Ejemplo n.º 17
0
    private bool isInRange = false; // This bool indicate when the player is near this place or not.

    void Start()
    {
        // this function is called after the Awake function.

        PlaceObject thisPlace = new PlaceObject(gameObject.name, gameObject); // Creates a new PlaceObject object and assign this information to the new object.

        ProjectManager.PM.m_Places.Add(thisPlace);                            // Dynamic assignment to the database by calling the PM and adding the new PlaceObject object to the database.
        halo = (Behaviour)GetComponent("Halo");                               // getting the halo reference.
    }
Ejemplo n.º 18
0
    public void SetObject(PlaceObject placeObject)
    {
        IsFree = false;
        GameObject obj = Instantiate(placeObject.gameObject);

        obj.transform.SetParent(gameObject.transform);
        obj.transform.position = transform.position;
        PlaceObject            = placeObject;
    }
Ejemplo n.º 19
0
    public void DetachObject()
    {
        if (_attached != null)
        {
            _attached.Detach();

            _attached = null;
        }
    }
Ejemplo n.º 20
0
    public void AttachObject(Vector2 pos, PlaceObject obj)
    {
        var tile = GetTile(pos);

        if (tile != null)
        {
            tile.AttachObject(obj);
        }
    }
Ejemplo n.º 21
0
    void copy(PlaceObject characterToCopy)
    {
        name = characterToCopy.name;

        mapPicturePath = characterToCopy.mapPicturePath;

        lucidityLevel = characterToCopy.lucidityLevel;

        firstSequenceId = characterToCopy.firstSequenceId;
    }
 public override void  placeObject2(PlaceObject tag)
 {
     if (tag.hasClipAction())
     {
         System.Collections.IEnumerator it = tag.clipActions.clipActionRecords.GetEnumerator();
         while (it.MoveNext())
         {
             ClipActionRecord record = (ClipActionRecord)it.Current;
             recordActions(record.actionList);
         }
     }
 }
Ejemplo n.º 23
0
 public void RemovePlaceObject(int depth)
 {
     if (!_placeObjects.ContainsKey(depth))
     {
         throw new AptEditorException(ErrorType.InvalidPlaceObjectDepth);
     }
     var toBeRemovedIndex = CurrentItems.FindIndex(item => item switch
     {
         PlaceObject p => p.Depth == depth,
         RemoveObject r => r.Depth == depth,
         _ => false
     });
Ejemplo n.º 24
0
 public PlaceObject FindInstance(string name)
 {
     foreach (Frame f in FrameList)
     {
         PlaceObject po = f.FindInstance(name);
         if (po != null)
         {
             return(po);
         }
     }
     return(null);
 }
Ejemplo n.º 25
0
        private void PlaceItem(PlaceObject po)
        {
            if (_content.Items.ContainsKey(po.Depth))
            {
                return;
            }

            var character     = Context.GetCharacter(po.Character, _sprite);
            var itemTransform = CreateTransform(po);

            IDisplayItem displayItem;

            if (character is Playable)
            {
                displayItem = new SpriteItem()
                {
                    Transform = itemTransform
                }
            }
            ;
            else
            {
                displayItem = new RenderItem()
                {
                    Transform = itemTransform
                }
            };

            displayItem.Create(character, Context, this);

            //add this object as an AS property
            if (po.Flags.HasFlag(PlaceObjectFlags.HasName))
            {
                ScriptObject.Variables[po.Name] = Value.FromObject(displayItem.ScriptObject);
                displayItem.Name = po.Name;
            }

            if (po.Flags.HasFlag(PlaceObjectFlags.HasClipAction))
            {
                if (po.ClipEvents != null)
                {
                    foreach (var clipEvent in po.ClipEvents)
                    {
                        if (clipEvent.Flags.HasFlag(ClipEventFlags.Initialize))
                        {
                            Context.Avm.Execute(clipEvent.Instructions, displayItem.ScriptObject);
                        }
                    }
                }
            }

            _content.Items[po.Depth] = displayItem;
        }
Ejemplo n.º 26
0
        public PartialViewResult PlaceDetails(string placeID)
        {
            using (WebClient wc = new WebClient())
            {
                // string url = String.Format("https://maps.googleapis.com/maps/api/place/details/json?&placeid={0}&key=AIzaSyBI5B2snURiIE8VkeuNYL2Es3ZZf8veRf4", placeID);
                string      url        = String.Format("https://maps.googleapis.com/maps/api/place/details/json?&placeid={0}&key=AIzaSyAuQaBzbJrduma-UhUFoWNyLWfJFoR3vac", placeID);
                var         json       = wc.DownloadString(url);
                PlaceObject jsonObject = JsonConvert.DeserializeObject <PlaceObject>(json);

                PlaceViewModel placeViewModel = new PlaceViewModel(jsonObject);
                return(PartialView("DisplayReviews/PlaceDetails", placeViewModel));
            }
        }
Ejemplo n.º 27
0
    public static PlaceObject getPlace(string placeName)
    {
        PlaceObject pO = gameInfo.places[0];

        foreach (PlaceObject p in gameInfo.places)
        {
            if (p.name == placeName)
            {
                pO = p;
            }
        }

        return(pO);
    }
Ejemplo n.º 28
0
        public bool RemoveInstance(string name)
        {
            List <KeyValuePair <Frame, IDisplayListItem> > hitList = new List <KeyValuePair <Frame, IDisplayListItem> >();
            List <PlaceObject> openTimelines = new List <PlaceObject>();

            /* ISSUE 71: The unit test for this has no RemoveObject dli items in it, so we don't really
             * know if the crazy timeline searching found here actually works. Make a harsher test. */

            foreach (Frame f in FrameList)
            {
                foreach (IDisplayListItem dli in f.DisplayList)
                {
                    switch (dli.Type)
                    {
                    case DisplayListItemType.PlaceObjectX:
                        PlaceObject po = (PlaceObject)dli;
                        if (po.Name == name)
                        {
                            hitList.Add(new KeyValuePair <Frame, IDisplayListItem>(f, po));
                            openTimelines.Add(po);
                        }
                        break;

                    case DisplayListItemType.RemoveObjectX:
                        RemoveObject ro = (RemoveObject)dli;
                        foreach (PlaceObject openPo in openTimelines)
                        {
                            if ((!ro.HasCharacter || openPo.Character == ro.Character) && ro.Layer == openPo.Layer)
                            {
                                hitList.Add(new KeyValuePair <Frame, IDisplayListItem>(f, ro));
                                openTimelines.Remove(openPo);
                                break;
                            }
                        }
                        break;

                    default:
                        /* ISSUE 73 */
                        throw new SWFModellerException(SWFModellerError.UnimplementedFeature, "Crazy, hitherto not seen display list item: " + dli.Type.ToString());
                    }
                }
            }

            foreach (KeyValuePair <Frame, IDisplayListItem> hit in hitList)
            {
                hit.Key.RemoveDisplayListItem(hit.Value);
            }

            return(hitList.Count > 0);
        }
Ejemplo n.º 29
0
    // Use this for initialization
    void Start()
    {
        databaseAcces = new DatabaseAcces();
        databaseAcces.OpenDatabase("collections.data");

        blockDatas = new List<BlockData>();

        SqliteDataReader reader = databaseAcces.ExecuteQuery("SELECT * FROM blocks");

        while (reader.Read())
        {
            blockDatas.Add(new BlockData(reader));
        }

        placeObjectScript = GetComponent<PlaceObject>();
    }
 void Start()
 {
     _ToolGetInfo = GetComponent <ToolGetInfo>();
     _ChooseTool.SetActive(false);
     _PlaceObjScript = GetComponent <PlaceObject>();
     _CurrentSlotID  = 9;
     for (int i = 0; i < _InvSlots.Length; i++)
     {
         _InvSlots[i].interactable = false;
         _ObjAmountText[i].text    = "";
     }
     for (int i = 0; i < _ToolButtons.Length; i++)
     {
         _ToolButtons[i].interactable = false;
     }
 }
Ejemplo n.º 31
0
        private void BuildDictionary(Timeline timeline, StringBuilder buff)
        {
            if (this.OutputComments)
            {
                buff.AppendLine("  /* timeline for " + timeline.ToString() + " */");
            }

            foreach (Frame f in Swf.Frames)
            {
                foreach (IDisplayListItem dli in f.DisplayList)
                {
                    if (!Dict.ContainsKey(dli) && dli.Type == DisplayListItemType.PlaceObjectX)
                    {
                        string name = "mc" + Dict.Count + 1;
                        Dict.Add(dli, name);

                        PlaceObject po = dli as PlaceObject;
                        ICharacter  ch = po.Character;

                        if (ch is Shape)
                        {
                            buff.AppendLine("  dict['" + name + "'] = \"" + ShapeToJS(ch as Shape) + "\";");
                        }
                        else if (ch is Sprite)
                        {
                            string clipName = RegisterTimeline((Timeline)ch);

                            buff.AppendLine("  var " + clipName + " = swiffoid.createMovieClipClass([o,o,o,o,o]);");
                            buff.AppendLine("  swiffoid.addClip('" + clipName + "', " + clipName + ");");
                            buff.AppendLine("  var instance = swiffoid.instantiateClip('" + clipName + "');");

                            html.JQueryAppendNew(buff, "  ", "$root", "canvas", new string[][] {
                                new string[] { "width", this.Width + "px" },
                                new string[] { "height", this.Height + "px" },
                            });

                            BuildDictionary((Sprite)ch, buff);
                        }
                    }
                }
            }
        }
Ejemplo n.º 32
0
		public override void  placeObject(PlaceObject tag)
		{
			int idref = dict.getId(tag.ref_Renamed);
			tagw.writeUI16(idref);
			tagw.writeUI16(tag.depth);
			encodeMatrix(tag.matrix, tagw);
			if (tag.colorTransform != null)
			{
				encodeCxform(tag.colorTransform, tagw);
			}
			encodeTag(tag);
		}
Ejemplo n.º 33
0
		public override void  placeObject(PlaceObject tag)
		{
			open(tag);
			out_Renamed.Write(" idref='" + idRef(tag.ref_Renamed) + "'");
			out_Renamed.Write(" depth='" + tag.depth + "'");
			out_Renamed.Write(" matrix='" + tag.matrix + "'");
			if (tag.colorTransform != null)
			{
				out_Renamed.Write(" colorXform='" + tag.colorTransform + "'");
			}
			close();
		}
Ejemplo n.º 34
0
		public override void  placeObject(PlaceObject tag)
		{
			placeObject2(tag);
		}
Ejemplo n.º 35
0
		public override void  placeObject3(PlaceObject tag)
		{
			frame.controlTags.Add(tag);
		}
Ejemplo n.º 36
0
		public void  placeObject23(PlaceObject tag)
		{
			if (tag.hasCharID())
			{
				if (tag.ref_Renamed.name != null)
				{
					indent();
					//UPGRADE_TODO: Method 'java.io.PrintWriter.println' was converted to 'System.IO.TextWriter.WriteLine' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioPrintWriterprintln_javalangString'"
					out_Renamed.WriteLine("<!-- instance of " + tag.ref_Renamed.name + " -->");
				}
			}
			
			open(tag);
			if (tag.hasClassName())
				out_Renamed.Write(" className='" + tag.className + "'");
			if (tag.hasImage())
				out_Renamed.Write(" hasImage='true' ");
			if (tag.hasCharID())
				out_Renamed.Write(" idref='" + idRef(tag.ref_Renamed) + "'");
			if (tag.hasName())
				out_Renamed.Write(" name='" + tag.name + "'");
			out_Renamed.Write(" depth='" + tag.depth + "'");
			if (tag.hasClipDepth())
				out_Renamed.Write(" clipDepth='" + tag.clipDepth + "'");
			if (tag.hasRatio())
				out_Renamed.Write(" ratio='" + tag.ratio + "'");
			if (tag.hasCxform())
			{
				out_Renamed.Write(" cxform='" + tag.colorTransform + "'");
			}
			if (tag.hasMatrix())
			{
				out_Renamed.Write(" matrix='" + tag.matrix + "'");
			}
			if (tag.hasBlendMode())
				out_Renamed.Write(" blendmode='" + tag.blendMode + "'");
			if (tag.hasFilterList())
			{
				// todo - pretty print this once we actually care
				out_Renamed.Write(" filters='");
				//UPGRADE_TODO: Method 'java.util.Iterator.hasNext' was converted to 'System.Collections.IEnumerator.MoveNext' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratorhasNext'"
				for (System.Collections.IEnumerator it = tag.filters.GetEnumerator(); it.MoveNext(); )
				{
					//UPGRADE_TODO: Method 'java.util.Iterator.next' was converted to 'System.Collections.IEnumerator.Current' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratornext'"
					out_Renamed.Write((((Filter) it.Current).getID()) + " ");
				}
				out_Renamed.Write("'");
			}
			
			if (tag.hasClipAction())
			{
				end();
				System.Collections.IEnumerator it = tag.clipActions.clipActionRecords.GetEnumerator();
				
				openCDATA();
				//UPGRADE_TODO: Method 'java.util.Iterator.hasNext' was converted to 'System.Collections.IEnumerator.MoveNext' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratorhasNext'"
				while (it.MoveNext())
				{
					//UPGRADE_TODO: Method 'java.util.Iterator.next' was converted to 'System.Collections.IEnumerator.Current' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratornext'"
					ClipActionRecord record = (ClipActionRecord) it.Current;
					indent();
					//UPGRADE_TODO: Method 'java.io.PrintWriter.println' was converted to 'System.IO.TextWriter.WriteLine' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioPrintWriterprintln_javalangString'"
					out_Renamed.WriteLine("onClipEvent(" + printClipEventFlags(record.eventFlags) + (record.hasKeyPress()?"<" + record.keyCode + ">":"") + ") {");
					indent_Renamed_Field++;
					if (showActions)
					{
						printActions(record.actionList);
					}
					else
					{
						indent();
						//UPGRADE_TODO: Method 'java.io.PrintWriter.println' was converted to 'System.IO.TextWriter.WriteLine' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioPrintWriterprintln_javalangString'"
						out_Renamed.WriteLine("// " + record.actionList.size() + " action(s) elided");
					}
					indent_Renamed_Field--;
					indent();
					//UPGRADE_TODO: Method 'java.io.PrintWriter.println' was converted to 'System.IO.TextWriter.WriteLine' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioPrintWriterprintln_javalangString'"
					out_Renamed.WriteLine("}");
				}
				closeCDATA();
				close(tag);
			}
			else
			{
				close();
			}
		}
Ejemplo n.º 37
0
		public virtual void  placeObject23(PlaceObject tag)
		{
			tagw.writeUI8(tag.flags);
			if (tag.code == flash.swf.TagValues_Fields.stagPlaceObject3)
			{
				tagw.writeUI8(tag.flags2);
			}
			tagw.writeUI16(tag.depth);
			if (tag.hasClassName())
			{
				tagw.writeString(tag.className);
			}
			if (tag.hasCharID())
			{
				int idref = dict.getId(tag.ref_Renamed);
				tagw.writeUI16(idref);
			}
			if (tag.hasMatrix())
			{
				encodeMatrix(tag.matrix, tagw);
			}
			if (tag.hasCxform())
			{
				// ed 5/22/03 the SWF 6 file format spec says this should be a CXFORM, but
				// the spec is wrong.  the player expects a CXFORMA.
				encodeCxforma(((CXFormWithAlpha) tag.colorTransform), tagw);
			}
			if (tag.hasRatio())
			{
				tagw.writeUI16(tag.ratio);
			}
			if (tag.hasName())
			{
				tagw.writeString(tag.name);
			}
			if (tag.hasClipDepth())
			{
				tagw.writeUI16(tag.clipDepth);
			}
			if (tag.code == flash.swf.TagValues_Fields.stagPlaceObject3)
			{
				if (tag.hasFilterList())
				{
					encodeFilterList(tag.filters, tagw);
				}
				if (tag.hasBlendMode())
				{
					tagw.writeUI8(tag.blendMode);
				}
			}
			if (tag.hasClipAction())
			{
				int adjust = 0;
				if (Debug)
				{
					adjust = writer.Pos + 6;
					debug.adjust += adjust;
				}
				new ActionEncoder(tagw, debug).encodeClipActions(tag.clipActions);
				if (Debug)
				{
					debug.adjust -= adjust;
				}
			}
			encodeTag(tag);
		}