Files
libremetaverse/libsecondlife/examples/TestClient/Commands/Prims/FindTextureCommand.cs
John Hurliman ba153c9749 * Removed LLUUID.ToStringHyphenated(), LLUUID.ToString() has hyphens now
* Fixed a CAPS crash when the callback was triggered with a null LLSD object
* Fixed TextureEntry bugs, added support for the new glow parameter
* Prim import and export are working now, but need rigorous testing

git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@1507 52acb1d6-8a22-11de-b505-999d5b087335
2007-11-30 13:15:31 +00:00

50 lines
1.7 KiB
C#

using System;
using libsecondlife;
namespace libsecondlife.TestClient
{
public class FindTextureCommand : Command
{
public FindTextureCommand(TestClient testClient)
{
Name = "findtexture";
Description = "Checks if a specified texture is currently visible on a specified face. " +
"Usage: findtexture [face-index] [texture-uuid]";
}
public override string Execute(string[] args, LLUUID fromAgentID)
{
int faceIndex;
LLUUID textureID;
if (args.Length != 2)
return "Usage: findtexture [face-index] [texture-uuid]";
if (Int32.TryParse(args[0], out faceIndex) &&
LLUUID.TryParse(args[1], out textureID))
{
Client.Network.CurrentSim.Objects.ForEach(
delegate(Primitive prim)
{
if (prim.Textures != null && prim.Textures.FaceTextures[faceIndex] != null)
{
if (prim.Textures.FaceTextures[faceIndex].TextureID == textureID)
{
Client.Log(String.Format("Primitive {0} ({1}) has face index {2} set to {3}",
prim.ID.ToString(), prim.LocalID, faceIndex, textureID.ToString()),
Helpers.LogLevel.Info);
}
}
}
);
return "Done searching";
}
else
{
return "Usage: findtexture [face-index] [texture-uuid]";
}
}
}
}