Index: Radegast/GUI/Consoles/Inventory/InventoryConsole.cs =================================================================== --- Radegast/GUI/Consoles/Inventory/InventoryConsole.cs (revision 520) +++ Radegast/GUI/Consoles/Inventory/InventoryConsole.cs (working copy) @@ -1023,6 +1035,10 @@ ctxItem.Name = "new_notecard"; ctxInv.Items.Add(ctxItem); + ctxItem = new ToolStripMenuItem("New Script", null, OnInvContextClick); + ctxItem.Name = "new_script"; + ctxInv.Items.Add(ctxItem); + ctxItem = new ToolStripMenuItem("Refresh", null, OnInvContextClick); ctxItem.Name = "refresh"; ctxInv.Items.Add(ctxItem); @@ -1331,6 +1347,11 @@ AssetType.Notecard, UUID.Zero, InventoryType.Notecard, PermissionMask.All, NotecardCreated); break; + case "new_script": + client.Inventory.RequestCreateItem(f.UUID, "New script", "Radegast script: " + DateTime.Now.ToString(), + AssetType.LSLText, UUID.Zero, InventoryType.LSL, PermissionMask.All, NotecardCreated); + break; + case "cut_folder": instance.InventoryClipboard = new InventoryClipboard(ClipboardOperation.Cut, f); break; @@ -1541,6 +1586,31 @@ } } + void ScriptCreated(bool success, InventoryItem item) + { + if (InvokeRequired) + { + BeginInvoke(new MethodInvoker(() => ScriptCreated(success, item))); + return; + } + + if (!success) + { + instance.TabConsole.DisplayNotificationInChat("Creation of script failed"); + return; + } + + instance.TabConsole.DisplayNotificationInChat("New script created, enter script name and press enter", ChatBufferTextStyle.Invisible); + var node = findNodeForItem(item.ParentUUID); + if (node != null) node.Expand(); + node = findNodeForItem(item.UUID); + if (node != null) + { + invTree.SelectedNode = node; + node.BeginEdit(); + } + } + void PerformClipboardOperation(InventoryFolder dest) { if (instance.InventoryClipboard == null) return;