mirror of
https://github.com/opensim/opensim.git
synced 2026-07-31 22:05:36 +08:00
mantis 8577: add key osGetInventoryItemKey(string name) to get a inventory item ID within prim inventory. the llGetInventory does return the asset it, not item.
This commit is contained in:
@@ -5479,6 +5479,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
return id.ToString();
|
||||
}
|
||||
|
||||
public LSL_Key osGetInventoryItemKey(LSL_String name)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
TaskInventoryItem item = m_host.Inventory.GetInventoryItem(name);
|
||||
|
||||
if (item == null)
|
||||
return UUID.Zero.ToString();
|
||||
|
||||
if ((item.CurrentPermissions
|
||||
& (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify))
|
||||
== (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify))
|
||||
{
|
||||
return item.ItemID.ToString();
|
||||
}
|
||||
|
||||
return UUID.Zero.ToString();
|
||||
}
|
||||
|
||||
public LSL_String osGetInventoryName(LSL_Key itemId)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
@@ -549,6 +549,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||
LSL_Integer osApproxEquals(rotation ra, rotation rb);
|
||||
LSL_Integer osApproxEquals(rotation ra, rotation rb, LSL_Float margin);
|
||||
LSL_Key osGetInventoryLastOwner(LSL_String itemNameOrId);
|
||||
LSL_Key osGetInventoryItemKey(LSL_String name);
|
||||
LSL_String osGetInventoryName(LSL_Key itemId);
|
||||
LSL_String osGetInventoryDesc(LSL_String itemNameOrId);
|
||||
LSL_Key osGetLastChangedEventKey();
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
public partial class ScriptBaseClass
|
||||
{
|
||||
// SCRIPTS CONSTANTS
|
||||
public static readonly LSLInteger OS_APIVERSION = 5;
|
||||
public static readonly LSLInteger OS_APIVERSION = 6;
|
||||
|
||||
public static readonly LSLInteger TRUE = 1;
|
||||
public static readonly LSLInteger FALSE = 0;
|
||||
|
||||
@@ -1382,6 +1382,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
return m_OSSL_Functions.osGetInventoryLastOwner(itemNameOrId);
|
||||
}
|
||||
|
||||
public LSL_Key osGetInventoryItemKey(LSL_String name)
|
||||
{
|
||||
return m_OSSL_Functions.osGetInventoryItemKey(name);
|
||||
}
|
||||
|
||||
public LSL_String osGetInventoryName(LSL_Key itemId)
|
||||
{
|
||||
return m_OSSL_Functions.osGetInventoryName(itemId);
|
||||
|
||||
Reference in New Issue
Block a user