Skip to content

Commit

Permalink
Merge pull request #50 from Sarafini/master
Browse files Browse the repository at this point in the history
Fix skeleton crash,, add Touch action to Inventory Console
  • Loading branch information
cinderblocks authored Feb 15, 2024
2 parents 8295249 + a8c34e3 commit bb4a04a
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Radegast/Core/Contexts/ContextActionsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ private string ToString(object sender)
/// </summary>
/// <param name="strip">The form's menu</param>
/// <param name="type">The type it will target</param>
/// <param name="obj">the Target ofbject</param>
/// <param name="obj">the Target object</param>
/// <param name="controls">Control to search for extra contributions (like buttons)</param>
public void GleanContributions(ToolStripDropDown strip, Type type, Object obj, params Control[] controls)
{
Expand Down
20 changes: 20 additions & 0 deletions Radegast/GUI/Consoles/Inventory/InventoryConsole.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1529,6 +1529,14 @@ private void ctxInv_Opening(object sender, CancelEventArgs e)
}
ctxInv.Items.Add(ctxItem);

if (item.InventoryType == InventoryType.Object && IsAttached(item))
{
ctxItem = new ToolStripMenuItem("Touch", null, OnInvContextClick) { Name = "touch" };
//TODO: add RLV support
if ((attachments[item.UUID].Prim.Flags & PrimFlags.Touch) == 0) ctxItem.Enabled = false;
ctxInv.Items.Add(ctxItem);
}

if (IsAttached(item) && instance.RLV.AllowDetach(attachments[item.UUID]))
{
ctxItem =
Expand Down Expand Up @@ -1839,6 +1847,18 @@ private void OnInvContextClick(object sender, EventArgs e)
invTree.SelectedNode.BeginEdit();
break;

case "touch":
lock (attachments[item.UUID])
{
AttachmentInfo aInfo = attachments[item.UUID];
Client.Self.Grab(aInfo.Prim.LocalID, Vector3.Zero, Vector3.Zero, Vector3.Zero, 0,
Vector3.Zero, Vector3.Zero, Vector3.Zero);
Thread.Sleep(100);
Client.Self.DeGrab(aInfo.Prim.LocalID, Vector3.Zero, Vector3.Zero, 0, Vector3.Zero,
Vector3.Zero, Vector3.Zero);
}
break;

case "detach":
instance.COF.Detach(item);
lock (attachments) attachments.Remove(item.UUID);
Expand Down
9 changes: 8 additions & 1 deletion Radegast/GUI/Rendering/Rendering.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1668,7 +1668,14 @@ private void UpdateAvatarAnimations(RenderAvatar av)
BinBVHAnimationReader bvh;
if (skeleton.mAnimationCache.TryGetValue(anim.AnimationID, out bvh))
{
skeleton.addanimation(null, tid, bvh, anim.AnimationID);
try
{
skeleton.addanimation(null, tid, bvh, anim.AnimationID);
}
catch (Exception ex)
{
Logger.Log($"Failure in skel.addanimation: {ex.Message}", Helpers.LogLevel.Error);
}
continue;
}

Expand Down

0 comments on commit bb4a04a

Please sign in to comment.