Exemplo n.º 1
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);
                    }
                }
            }
        }
        public void GetTextures()
        {
            if (avatar.Textures == null)
            {
                return;
            }

            lblName.Text = 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 {
                            Dock = DockStyle.Top, Text = img.Text, Height = 550
                        };

                        img.Dock = DockStyle.Fill;
                        gbx.Controls.Add(img);
                        pnlImages.Controls.Add(gbx);
                    }
                }
            }
        }
Exemplo n.º 3
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);
            }
        }
Exemplo n.º 4
0
        void attachmentMenuItem_Click(object sender, EventArgs e)
        {
            if (sender is ToolStripMenuItem titem)
            {
                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;
                }
            }
        }
Exemplo n.º 5
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;
        }
Exemplo n.º 6
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;
            }

            parcel = e.Parcel;

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

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

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

            txtParcelName.Text = decodedLandmark == null
                ? $"{parcel.Name} - {parcel.SimName} "
                : $"{parcel.Name} - {parcel.SimName} ({(int) decodedLandmark.Position.X}, {(int) decodedLandmark.Position.Y}, {(int) decodedLandmark.Position.Z}) ";

            txtParcelDescription.Text = parcel.Description;
        }
        void UpdateInfo()
        {
            Primitive root = Exporter.Prims[0];

            objectName.Text         = root.Properties != null ? root.Properties.Name : "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)
                {
                    Height = 96, Width = 96, BorderStyle = BorderStyle.FixedSingle
                };
                texturesPanel.Controls.Add(img);
            }
        }
        void UpdateParcelDisplay()
        {
            Parcel p = instance.State.Parcel;

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

            pnlParcelImage.Controls.Clear();

            if (p.SnapshotID != UUID.Zero)
            {
                SLImageHandler imgParcel = new SLImageHandler {
                    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();
        }
Exemplo n.º 9
0
        public override CmdResult ExecuteRequest(CmdRequest args0)
        {
            var args = args0.GetProperty("image");
            if (args.Length < 1) return ShowUsage();
            UUID AssetID = UUID.Zero;
            int argsUsed;

            if (!UUIDTryParse(args, 0, out AssetID, out argsUsed))
            {
                return Failure("Cant get asset from " + AssetID);
            }

            TheBotClient.InvokeGUI(() =>
                                    {
                                        var v = new SLImageHandler(TheBotClient.TheRadegastInstance, AssetID,
                                                                   AssetID.ToString()) {Dock = DockStyle.Fill};
                                        var f = new RadegastForm();
                                        f.Controls.Add(v);
                                        f.Show();
                                    });
            
            return Success("Done RequestAsset " + AssetID);
        }
Exemplo n.º 10
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);
            }
        }
Exemplo n.º 11
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 });
        }
Exemplo n.º 12
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;
        }
Exemplo n.º 13
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();
        }
Exemplo n.º 14
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;
                }
            }
        }
Exemplo n.º 15
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);
            }
        }
Exemplo n.º 16
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 });
        }
Exemplo n.º 17
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]));
            }
        }
Exemplo n.º 18
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);
     }
 }
Exemplo n.º 19
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 (SLImageID != UUID.Zero)
            {
                SLImageHandler pic = new SLImageHandler(instance, SLImageID, "");
                pic.Dock = DockStyle.Fill;
                pic.SizeMode = PictureBoxSizeMode.StretchImage;
                slPicPanel.Controls.Add(pic);
                slPicPanel.Show();
            }
            else
            {
                slPicPanel.Hide();
            }

            if (FLImageID != UUID.Zero)
            {
                SLImageHandler pic = new SLImageHandler(instance, FLImageID, "");
                pic.Dock = DockStyle.Fill;
                rlPicPanel.Controls.Add(pic);
                rlPicPanel.Show();
            }
            else
            {
                rlPicPanel.Hide();
            }

            this.BeginInvoke(
                new OnSetProfileProperties(SetProfileProperties),
                new object[] { e.Properties });
        }
Exemplo n.º 20
0
        void UpdateItemInfo(InventoryItem item)
        {
            foreach (Control c in pnlDetail.Controls)
            {
                c.Dispose();
            }
            pnlDetail.Controls.Clear();
            pnlItemProperties.Tag = item;

            if (item == null)
            {
                pnlItemProperties.Visible = false;
                return;
            }

            pnlItemProperties.Visible = true;
            btnProfile.Enabled = true;
            txtItemName.Text = item.Name;
            txtItemDescription.Text = item.Description;
            txtCreator.AgentID = item.CreatorID;
            txtCreator.Tag = item.CreatorID;
            txtCreated.Text = item.CreationDate.ToString();

            if (item.AssetUUID != UUID.Zero)
            {
                txtAssetID.Text = item.AssetUUID.ToString();
            }
            else
            {
                txtAssetID.Text = String.Empty;
            }

            Permissions p = item.Permissions;
            cbOwnerModify.Checked = (p.OwnerMask & PermissionMask.Modify) != 0;
            cbOwnerCopy.Checked = (p.OwnerMask & PermissionMask.Copy) != 0;
            cbOwnerTransfer.Checked = (p.OwnerMask & PermissionMask.Transfer) != 0;

            cbNextOwnModify.CheckedChanged -= cbNextOwnerUpdate_CheckedChanged;
            cbNextOwnCopy.CheckedChanged -= cbNextOwnerUpdate_CheckedChanged;
            cbNextOwnTransfer.CheckedChanged -= cbNextOwnerUpdate_CheckedChanged;

            cbNextOwnModify.Checked = (p.NextOwnerMask & PermissionMask.Modify) != 0;
            cbNextOwnCopy.Checked = (p.NextOwnerMask & PermissionMask.Copy) != 0;
            cbNextOwnTransfer.Checked = (p.NextOwnerMask & PermissionMask.Transfer) != 0;

            cbNextOwnModify.CheckedChanged += cbNextOwnerUpdate_CheckedChanged;
            cbNextOwnCopy.CheckedChanged += cbNextOwnerUpdate_CheckedChanged;
            cbNextOwnTransfer.CheckedChanged += cbNextOwnerUpdate_CheckedChanged;

            switch (item.AssetType)
            {
                case AssetType.Texture:
                    SLImageHandler image = new SLImageHandler(instance, item.AssetUUID, item.Name, IsFullPerm(item));
                    image.Dock = DockStyle.Fill;
                    pnlDetail.Controls.Add(image);
                    break;

                case AssetType.Notecard:
                    Notecard note = new Notecard(instance, (InventoryNotecard)item);
                    note.Dock = DockStyle.Fill;
                    note.TabIndex = 3;
                    note.TabStop = true;
                    pnlDetail.Controls.Add(note);
                    note.rtbContent.Focus();
                    break;

                case AssetType.Landmark:
                    Landmark landmark = new Landmark(instance, (InventoryLandmark)item);
                    landmark.Dock = DockStyle.Fill;
                    pnlDetail.Controls.Add(landmark);
                    break;

                case AssetType.LSLText:
                    ScriptEditor script = new ScriptEditor(instance, (InventoryLSL)item);
                    script.Dock = DockStyle.Fill;
                    script.TabIndex = 3;
                    script.TabStop = true;
                    pnlDetail.Controls.Add(script);
                    break;

                case AssetType.Gesture:
                    Guesture gesture = new Guesture(instance, (InventoryGesture)item);
                    gesture.Dock = DockStyle.Fill;
                    pnlDetail.Controls.Add(gesture);
                    break;

            }

            tabsInventory.SelectedTab = tabDetail;
        }
Exemplo n.º 21
0
        public GroupDetails(RadegastInstance instance, Group group)
        {
            InitializeComponent();
            Disposed += new EventHandler(GroupDetails_Disposed);

            this.instance = instance;
            this.group = group;

            if (group.InsigniaID != UUID.Zero)
            {
                SLImageHandler insignia = new SLImageHandler(instance, group.InsigniaID, string.Empty);
                insignia.Dock = DockStyle.Fill;
                pnlInsignia.Controls.Add(insignia);
            }

            lblGroupName.Text = group.Name;
            lvwGeneralMembers.ListViewItemSorter = new GroupMemberSorter();
            lvwMemberDetails.ListViewItemSorter = new GroupMemberSorter();

            isMember = instance.Groups.ContainsKey(group.ID);

            if (isMember)
            {
            }
            else
            {
                tcGroupDetails.TabPages.Remove(tpMembersRoles);
                tcGroupDetails.TabPages.Remove(tpNotices);
            }

            lvwNoticeArchive.SmallImageList = frmMain.ResourceImages;
            lvwNoticeArchive.ListViewItemSorter = new GroupNoticeSorter();

            // Callbacks
            client.Groups.GroupTitlesReply += new EventHandler<GroupTitlesReplyEventArgs>(Groups_GroupTitlesReply);
            client.Groups.GroupMembersReply += new EventHandler<GroupMembersReplyEventArgs>(Groups_GroupMembersReply);
            client.Groups.GroupProfile += new EventHandler<GroupProfileEventArgs>(Groups_GroupProfile);
            client.Groups.CurrentGroups += new EventHandler<CurrentGroupsEventArgs>(Groups_CurrentGroups);
            client.Groups.GroupNoticesListReply += new EventHandler<GroupNoticesListReplyEventArgs>(Groups_GroupNoticesListReply);
            client.Groups.GroupJoinedReply += new EventHandler<GroupOperationEventArgs>(Groups_GroupJoinedReply);
            client.Groups.GroupLeaveReply += new EventHandler<GroupOperationEventArgs>(Groups_GroupLeaveReply);
            client.Groups.GroupRoleDataReply += new EventHandler<GroupRolesDataReplyEventArgs>(Groups_GroupRoleDataReply);
            client.Groups.GroupMemberEjected += new EventHandler<GroupOperationEventArgs>(Groups_GroupMemberEjected);
            client.Groups.GroupRoleMembersReply += new EventHandler<GroupRolesMembersReplyEventArgs>(Groups_GroupRoleMembersReply);
            client.Self.IM += new EventHandler<InstantMessageEventArgs>(Self_IM);
            instance.Names.NameUpdated += new EventHandler<UUIDNameReplyEventArgs>(Names_NameUpdated);
            RefreshControlsAvailability();
            RefreshGroupInfo();
        }
Exemplo n.º 22
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]));
            }
        }
Exemplo n.º 23
0
        void Groups_GroupProfile(object sender, GroupProfileEventArgs e)
        {
            if (group.ID != e.Group.ID) return;

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

            group = e.Group;
            if (group.InsigniaID != UUID.Zero && pnlInsignia.Controls.Count == 0)
            {
                SLImageHandler insignia = new SLImageHandler(instance, group.InsigniaID, string.Empty);
                insignia.Dock = DockStyle.Fill;
                pnlInsignia.Controls.Add(insignia);
            }

            tbxCharter.Text = group.Charter;
            lblFounded.Text = "Founded by: " + instance.Names.Get(group.FounderID);
            cbxShowInSearch.Checked = group.ShowInList;
            cbxOpenEnrollment.Checked = group.OpenEnrollment;

            if (group.MembershipFee > 0)
            {
                cbxEnrollmentFee.Checked = true;
                nudEnrollmentFee.Value = group.MembershipFee;
            }
            else
            {
                cbxEnrollmentFee.Checked = false;
                nudEnrollmentFee.Value = 0;
            }

            if (group.MaturePublish)
            {
                cbxMaturity.SelectedIndex = 1;
            }
            else
            {
                cbxMaturity.SelectedIndex = 0;
            }

            btnJoin.Enabled = btnJoin.Visible = false;

            if (myGroups.ContainsKey(group.ID)) // I am in this group
            {
                cbxReceiveNotices.Checked = myGroups[group.ID].AcceptNotices;
                cbxListInProfile.Checked = myGroups[group.ID].ListInProfile;
                cbxReceiveNotices.CheckedChanged += new EventHandler(cbxListInProfile_CheckedChanged);
                cbxListInProfile.CheckedChanged += new EventHandler(cbxListInProfile_CheckedChanged);
            }
            else if (group.OpenEnrollment) // I am not in this group, but I could join it
            {
                btnJoin.Text = "Join $L" + group.MembershipFee;
                btnJoin.Enabled = btnJoin.Visible = true;
            }

            RefreshControlsAvailability();
        }