add LSL_String osGetInventoryName(LSL_Key itemId) and LSL_String osGetInventoryDescription(LSL_String itemNameOrId)
parent
ece3843798
commit
bd27573130
|
@ -5404,7 +5404,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
return 1;
|
||||
}
|
||||
|
||||
public LSL_Key osGetInventoryLastOwner(string itemNameorid)
|
||||
public LSL_Key osGetInventoryLastOwner(LSL_String itemNameorid)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
|
@ -5423,5 +5423,37 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
id= item.OwnerID;
|
||||
return id.ToString();
|
||||
}
|
||||
|
||||
public LSL_String osGetInventoryName(LSL_Key itemId)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
TaskInventoryItem item = null;
|
||||
UUID itemID;
|
||||
if (UUID.TryParse(itemId, out itemID))
|
||||
item = m_host.Inventory.GetInventoryItem(itemID);
|
||||
|
||||
if (item == null)
|
||||
return String.Empty;
|
||||
|
||||
return item.Name;
|
||||
}
|
||||
|
||||
public LSL_String osGetInventoryDescription(LSL_String itemNameorid)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
TaskInventoryItem item = null;
|
||||
UUID itemID;
|
||||
if (UUID.TryParse(itemNameorid, out itemID))
|
||||
item = m_host.Inventory.GetInventoryItem(itemID);
|
||||
else
|
||||
item = m_host.Inventory.GetInventoryItem(itemNameorid);
|
||||
|
||||
if (item == null)
|
||||
return String.Empty;
|
||||
|
||||
return item.Description;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -547,6 +547,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
|||
LSL_Integer osApproxEquals(vector va, vector vb, LSL_Float margin);
|
||||
LSL_Integer osApproxEquals(rotation ra, rotation rb);
|
||||
LSL_Integer osApproxEquals(rotation ra, rotation rb, LSL_Float margin);
|
||||
LSL_Key osGetInventoryLastOwner(string itemNameOrId);
|
||||
LSL_Key osGetInventoryLastOwner(LSL_String itemNameOrId);
|
||||
LSL_String osGetInventoryName(LSL_Key itemId);
|
||||
LSL_String osGetInventoryDescription(LSL_String itemNameOrId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1367,10 +1367,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
|||
return m_OSSL_Functions.osApproxEquals(ra, rb, margin);
|
||||
}
|
||||
|
||||
public LSL_Key osGetInventoryLastOwner(string itemNameOrId)
|
||||
public LSL_Key osGetInventoryLastOwner(LSL_String itemNameOrId)
|
||||
{
|
||||
return m_OSSL_Functions.osGetInventoryLastOwner(itemNameOrId);
|
||||
}
|
||||
|
||||
public LSL_String osGetInventoryName(LSL_Key itemId)
|
||||
{
|
||||
return m_OSSL_Functions.osGetInventoryName(itemId);
|
||||
}
|
||||
|
||||
public LSL_String osGetInventoryDescription(LSL_String itemNameOrId)
|
||||
{
|
||||
return m_OSSL_Functions.osGetInventoryDescription(itemNameOrId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue