mirror of
https://github.com/opensim/opensim.git
synced 2026-07-14 03:15:36 +08:00
Add osGetInventoryDesc() as per http://opensimulator.org/mantis/view.php?id=5927
This allows one to get description data for a given prim inventory item. Thanks MarcelEdward and GuduleLapointe!
This commit is contained in:
@@ -2957,5 +2957,28 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
return date.ToString("yyyy-MM-ddTHH:mm:ss.fffffffZ");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the description from an inventory item
|
||||
/// </summary>
|
||||
/// <param name="inventoryName"></param>
|
||||
/// <returns>Item description</returns>
|
||||
public LSL_String osGetInventoryDesc(string item)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
lock (m_host.TaskInventory)
|
||||
{
|
||||
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
||||
{
|
||||
if (inv.Value.Name == item)
|
||||
{
|
||||
return inv.Value.Description.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return String.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user