Adds osGetMapTexture() and osGetRegionMapTexture() methods to retrieve region map texture uuids0.6.8-post-fixes
parent
d95df603df
commit
fe82471c2b
|
@ -1910,5 +1910,42 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
module.DeleteNPC(new UUID(npc.m_string), World);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get current region's map texture UUID
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public LSL_Key osGetMapTexture()
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.None, "osGetMapTexture");
|
||||
return m_ScriptEngine.World.RegionInfo.RegionSettings.TerrainImageID.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get a region's map texture UUID by region UUID or name.
|
||||
/// </summary>
|
||||
/// <param name="regionName"></param>
|
||||
/// <returns></returns>
|
||||
public LSL_Key osGetRegionMapTexture(string regionName)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.High, "osGetRegionMapTexture");
|
||||
Scene scene = m_ScriptEngine.World;
|
||||
UUID key = UUID.Zero;
|
||||
GridRegion region;
|
||||
|
||||
//If string is a key, use it. Otherwise, try to locate region by name.
|
||||
if (UUID.TryParse(regionName, out key))
|
||||
region = scene.GridService.GetRegionByUUID(UUID.Zero, key);
|
||||
else
|
||||
region = scene.GridService.GetRegionByName(UUID.Zero, regionName);
|
||||
|
||||
// If region was found, return the regions map texture key.
|
||||
if (region != null)
|
||||
key = region.TerrainImage;
|
||||
|
||||
ScriptSleep(1000);
|
||||
|
||||
return key.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -160,5 +160,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
|||
void osNpcSay(key npc, string message);
|
||||
void osNpcRemove(key npc);
|
||||
|
||||
key osGetMapTexture();
|
||||
key osGetRegionMapTexture(string regionName);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -622,5 +622,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public key osGetMapTexture()
|
||||
{
|
||||
return m_OSSL_Functions.osGetMapTexture();
|
||||
}
|
||||
|
||||
public key osGetRegionMapTexture(string regionName)
|
||||
{
|
||||
return m_OSSL_Functions.osGetRegionMapTexture(regionName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue