OSDN Git Service

RAD-59: Play animations from inventory
authorLatif Khalifa <latifer@streamgrid.net>
Fri, 14 May 2010 11:13:35 +0000 (11:13 +0000)
committerLatif Khalifa <latifer@streamgrid.net>
Fri, 14 May 2010 11:13:35 +0000 (11:13 +0000)
git-svn-id: https://radegast.googlecode.com/svn/trunk@626 f7a694da-4d33-11de-9ad6-1127a62b9fcd

Radegast/GUI/Consoles/Inventory/InventoryConsole.cs

index 2e6017a..ec3eb9e 100644 (file)
@@ -1201,6 +1201,22 @@ namespace Radegast
                         ctxInv.Items.Add(ctxItem);
                     }
 
+                    if (item.InventoryType == InventoryType.Animation)
+                    {
+                        if (!client.Self.SignaledAnimations.ContainsKey(item.AssetUUID))
+                        {
+                            ctxItem = new ToolStripMenuItem("Play", null, OnInvContextClick);
+                            ctxItem.Name = "animation_play";
+                            ctxInv.Items.Add(ctxItem);
+                        }
+                        else
+                        {
+                            ctxItem = new ToolStripMenuItem("Stop", null, OnInvContextClick);
+                            ctxItem.Name = "animation_stop";
+                            ctxInv.Items.Add(ctxItem);
+                        }
+                    }
+
                     if (item.InventoryType == InventoryType.Object)
                     {
                         ctxItem = new ToolStripMenuItem("Rez inworld", null, OnInvContextClick);
@@ -1560,6 +1576,18 @@ namespace Radegast
                         client.Self.PlayGesture(item.AssetUUID);
                         break;
 
+                    case "animation_play":
+                        Dictionary<UUID, bool> anim = new Dictionary<UUID,bool>();
+                        anim.Add(item.AssetUUID, true);
+                        client.Self.Animate(anim, true);
+                        break;
+
+                    case "animation_stop":
+                        Dictionary<UUID, bool> animStop = new Dictionary<UUID, bool>();
+                        animStop.Add(item.AssetUUID, false);
+                        client.Self.Animate(animStop, true);
+                        break;
+
                     case "rez_inworld":
                         Vector3 rezpos = new Vector3(2, 0, 0);
                         rezpos = client.Self.SimPosition + rezpos * client.Self.Movement.BodyRotation;