Пример #1
0
        void UpdateInfo()
        {
            Primitive root = Exporter.Prims[0];

            if (root.Properties != null)
            {
                objectName.Text = root.Properties.Name;
            }
            else
            {
                objectName.Text = "Object";
            }
            objectUUID.Text         = root.ID.ToString();
            primCount.Text          = Exporter.Prims.Count.ToString();
            exportablePrims.Text    = Exporter.ExportablePrims.ToString();
            textureCount.Text       = Exporter.Textures.Count.ToString();
            exportableTextures.Text = Exporter.ExportableTextures.ToString();
            texturesPanel.Controls.Clear();
            foreach (UUID textureID in Exporter.Textures)
            {
                var img = new SLImageHandler(instance, textureID, string.Empty);
                img.Height      = 96;
                img.Width       = 96;
                img.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
                texturesPanel.Controls.Add(img);
            }
        }
Пример #2
0
        void attachmentMenuItem_Click(object sender, EventArgs e)
        {
            if (sender is ToolStripMenuItem)
            {
                ToolStripMenuItem titem = (ToolStripMenuItem)sender;
                InventoryItem     item  = (InventoryItem)titem.Tag;

                switch (item.AssetType)
                {
                case AssetType.Texture:
                    SLImageHandler ih = new SLImageHandler(instance, item.AssetUUID, string.Empty);
                    ih.Text = item.Name;
                    ih.ShowDetached();
                    break;

                case AssetType.Landmark:
                    Landmark ln = new Landmark(instance, (InventoryLandmark)item);
                    ln.ShowDetached();
                    break;

                case AssetType.Notecard:
                    client.Inventory.RequestCopyItemFromNotecard(UUID.Zero,
                                                                 notecard.UUID,
                                                                 notecard.ParentUUID,
                                                                 item.UUID,
                                                                 Inventory_OnInventoryItemCopied);
                    break;
                }
            }
        }
Пример #3
0
        public void GetTextures()
        {
            if (avatar.Textures == null)
            {
                return;
            }

            lblName.Text = this.avatar.Name;

            for (int j = 0; j < avatar.Textures.FaceTextures.Length; j++)
            {
                Primitive.TextureEntryFace face = avatar.Textures.FaceTextures[j];

                if (face != null)
                {
                    if (face.TextureID != AppearanceManager.DEFAULT_AVATAR_TEXTURE)
                    {
                        SLImageHandler img = new SLImageHandler(instance, face.TextureID, ((AvatarTextureIndex)j).ToString());

                        GroupBox gbx = new GroupBox();
                        gbx.Dock   = DockStyle.Top;
                        gbx.Text   = img.Text;
                        gbx.Height = 550;

                        img.Dock = DockStyle.Fill;
                        gbx.Controls.Add(img);
                        pnlImages.Controls.Add(gbx);
                    }
                }
            }
        }
Пример #4
0
        void Parcels_ParcelInfoReply(object sender, ParcelInfoReplyEventArgs e)
        {
            if (e.Parcel.ID != parcelID)
            {
                return;
            }

            if (InvokeRequired)
            {
                if (!instance.MonoRuntime || IsHandleCreated)
                {
                    BeginInvoke(new MethodInvoker(() => Parcels_ParcelInfoReply(sender, e)));
                }
                return;
            }

            this.parcel = e.Parcel;

            pnlDetail.Visible = true;
            if (parcel.SnapshotID != UUID.Zero)
            {
                SLImageHandler img = new SLImageHandler(instance, parcel.SnapshotID, "");
                img.Dock = DockStyle.Fill;
                pnlDetail.Controls.Add(img);
                pnlDetail.Disposed += (object senderx, EventArgs ex) =>
                {
                    img.Dispose();
                };
                img.BringToFront();
            }

            btnTeleport.Enabled  = true;
            btnShowOnMap.Enabled = true;

            if (parcelLocation)
            {
                localPosition   = new Vector3();
                localPosition.X = parcel.GlobalX % 256;
                localPosition.Y = parcel.GlobalY % 256;
                localPosition.Z = parcel.GlobalZ;
            }

            if (decodedLandmark == null)
            {
                txtParcelName.Text = string.Format("{0} - {1} ", parcel.Name, parcel.SimName);
            }
            else
            {
                txtParcelName.Text = string.Format("{0} - {1} ({2}, {3}, {4}) ", parcel.Name, parcel.SimName, (int)decodedLandmark.Position.X, (int)decodedLandmark.Position.Y, (int)decodedLandmark.Position.Z);
            }

            txtParcelDescription.Text = parcel.Description;
        }
Пример #5
0
        void UpdateParcelDisplay()
        {
            Parcel p = instance.State.Parcel;

            txtParcelTitle.Text       = p.Name;
            txtParcelDescription.Text = p.Desc;
            lblSimType.Text           = client.Network.CurrentSim.ProductName.ToString();

            pnlParcelImage.Controls.Clear();

            if (p.SnapshotID != UUID.Zero)
            {
                SLImageHandler imgParcel = new SLImageHandler();
                imgParcel.Dock = DockStyle.Fill;
                pnlParcelImage.Controls.Add(imgParcel);
                imgParcel.Init(instance, p.SnapshotID, string.Empty);
            }

            if (p.IsGroupOwned)
            {
                txtOwner.Text = "(Group owned)";
            }
            else
            {
                txtOwner.AgentID = p.OwnerID;
            }

            if (p.GroupID != UUID.Zero)
            {
                parcelGroupID = p.GroupID;
                client.Groups.RequestGroupName(p.GroupID);
            }

            lblTraffic.Text     = string.Format("{0:0}", p.Dwell);
            lblSimPrims.Text    = string.Format("{0} / {1}", p.SimWideTotalPrims, p.SimWideMaxPrims);
            lblParcelPrims.Text = string.Format("{0} / {1}", p.TotalPrims, p.MaxPrims);
            lblAutoReturn.Text  = p.OtherCleanTime.ToString();
            lblArea.Text        = p.Area.ToString();
        }
Пример #6
0
        private void texturesBtn_Click(object sender, EventArgs e)
        {
            pnlImages.Controls.Clear();

            List <UUID> textures = new List <UUID>();

            textures.Add(selectedPrim.Textures.DefaultTexture.TextureID);

            for (int i = 0; i < selectedPrim.Textures.FaceTextures.Length; i++)
            {
                if (selectedPrim.Textures.FaceTextures[i] != null && (!textures.Contains(selectedPrim.Textures.FaceTextures[i].TextureID)))
                {
                    textures.Add(selectedPrim.Textures.FaceTextures[i].TextureID);
                }
            }

            int nTextures = 0;

            foreach (UUID textureID in textures)
            {
                SLImageHandler img = new SLImageHandler(instance, textureID, "Texture " + (nTextures + 1).ToString());
                img.Location = new Point(0, nTextures++ *img.Height);
                img.Dock     = DockStyle.Top;
                img.Height   = 450;
                pnlImages.Controls.Add(img);
//                nTextures++;
            }

            if (selectedPrim.Sculpt != null && selectedPrim.Sculpt.SculptTexture != UUID.Zero)
            {
                SLImageHandler img = new SLImageHandler(instance, selectedPrim.Sculpt.SculptTexture, "Sculp Texture");
                img.Location = new Point(0, nTextures * img.Height);
                img.Dock     = DockStyle.Top;
                img.Height   = 450;
                pnlImages.Controls.Add(img);
            }
        }
Пример #7
0
        void Avatars_AvatarPropertiesReply(object sender, AvatarPropertiesReplyEventArgs e)
        {
            if (e.AvatarID != agentID)
            {
                return;
            }

            if (InvokeRequired)
            {
                Invoke(new MethodInvoker(() => Avatars_AvatarPropertiesReply(sender, e)));
                return;
            }
            Profile = e.Properties;

            FLImageID = e.Properties.FirstLifeImage;
            SLImageID = e.Properties.ProfileImage;

            if (agentID == client.Self.AgentID || SLImageID != UUID.Zero)
            {
                SLImageHandler pic = new SLImageHandler(instance, SLImageID, "");

                if (agentID == client.Self.AgentID)
                {
                    pic.AllowUpdateImage = true;
                    pic.ImageUpdated    += (usender, ue) =>
                    {
                        Profile.ProfileImage = ue.NewImageID;
                        pic.UpdateImage(ue.NewImageID);
                        client.Self.UpdateProfile(Profile);
                    };
                }

                pic.Dock     = DockStyle.Fill;
                pic.SizeMode = PictureBoxSizeMode.StretchImage;
                slPicPanel.Controls.Add(pic);
                slPicPanel.Show();
            }
            else
            {
                slPicPanel.Hide();
            }

            if (agentID == client.Self.AgentID || FLImageID != UUID.Zero)
            {
                SLImageHandler pic = new SLImageHandler(instance, FLImageID, "");
                pic.Dock = DockStyle.Fill;

                if (agentID == client.Self.AgentID)
                {
                    pic.AllowUpdateImage = true;
                    pic.ImageUpdated    += (usender, ue) =>
                    {
                        Profile.FirstLifeImage = ue.NewImageID;
                        pic.UpdateImage(ue.NewImageID);
                        client.Self.UpdateProfile(Profile);
                    };
                }

                rlPicPanel.Controls.Add(pic);
                rlPicPanel.Show();
            }
            else
            {
                rlPicPanel.Hide();
            }

            this.BeginInvoke(
                new OnSetProfileProperties(SetProfileProperties),
                new object[] { e.Properties });
        }
Пример #8
0
        void Avatars_PickInfoReply(object sender, PickInfoReplyEventArgs e)
        {
            if (e.PickID != requestedPick)
            {
                return;
            }

            if (InvokeRequired)
            {
                BeginInvoke(new MethodInvoker(() => Avatars_PickInfoReply(sender, e)));
                return;
            }

            lock (pickCache)
            {
                if (!pickCache.ContainsKey(e.PickID))
                {
                    pickCache.Add(e.PickID, e.Pick);
                }
            }

            currentPick = e.Pick;

            if (pickPicturePanel.Controls.Count > 0)
            {
                pickPicturePanel.Controls[0].Dispose();
            }
            pickPicturePanel.Controls.Clear();

            if (agentID == client.Self.AgentID || e.Pick.SnapshotID != UUID.Zero)
            {
                SLImageHandler img = new SLImageHandler(instance, e.Pick.SnapshotID, string.Empty);
                img.Dock     = DockStyle.Fill;
                img.SizeMode = PictureBoxSizeMode.StretchImage;
                pickPicturePanel.Controls.Add(img);

                if (agentID == client.Self.AgentID)
                {
                    img.AllowUpdateImage = true;
                    ProfilePick p = e.Pick;
                    img.ImageUpdated += (psender, pe) =>
                    {
                        img.UpdateImage(pe.NewImageID);
                        p.SnapshotID = pe.NewImageID;
                        client.Self.PickInfoUpdate(p.PickID, p.TopPick, p.ParcelID, p.Name, p.PosGlobal, p.SnapshotID, p.Desc);
                    };
                }
            }

            pickTitle.Text = e.Pick.Name;

            pickDetail.Text = e.Pick.Desc;

            if (!parcelCache.ContainsKey(e.Pick.ParcelID))
            {
                pickLocation.Text = string.Format("Unkown parcel, {0} ({1}, {2}, {3})",
                                                  e.Pick.SimName,
                                                  ((int)e.Pick.PosGlobal.X) % 256,
                                                  ((int)e.Pick.PosGlobal.Y) % 256,
                                                  ((int)e.Pick.PosGlobal.Z) % 256
                                                  );
                client.Parcels.RequestParcelInfo(e.Pick.ParcelID);
            }
            else
            {
                Parcels_ParcelInfoReply(this, new ParcelInfoReplyEventArgs(parcelCache[e.Pick.ParcelID]));
            }
        }