Moving examples, mapgenerator, and VisualParamGenerator to Programs folder (SVN is seriously ruined still, don't check out yet)
git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@1961 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
using System;
|
||||
using OpenMetaverse;
|
||||
|
||||
namespace OpenMetaverse.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.ObjectsPrimitives.ForEach(
|
||||
delegate(Primitive prim)
|
||||
{
|
||||
if (prim.Textures != null && prim.Textures.FaceTextures[faceIndex] != null)
|
||||
{
|
||||
if (prim.Textures.FaceTextures[faceIndex].TextureID == textureID)
|
||||
{
|
||||
Logger.Log(String.Format("Primitive {0} ({1}) has face index {2} set to {3}",
|
||||
prim.ID.ToString(), prim.LocalID, faceIndex, textureID.ToString()),
|
||||
Helpers.LogLevel.Info, Client);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
return "Done searching";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "Usage: findtexture [face-index] [texture-uuid]";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user