Files
plexview/Programs/examples/TestClient/Commands/Prims/FindTextureCommand.cs
T
Blake Bourque 0bb2dff347 Initial commit
I wish I could figure out how to have PlexVie be out of the LibOMV tree but its just not working die to a DLL not found exception about libopenjpeg. (Yes the dll is in the bin folder)
This will do for now
2015-06-18 22:15:24 -04:00

51 lines
1.8 KiB
C#

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]";
Category = CommandCategory.Objects;
}
public override string Execute(string[] args, UUID fromAgentID)
{
int faceIndex;
UUID textureID;
if (args.Length != 2)
return "Usage: findtexture [face-index] [texture-uuid]";
if (Int32.TryParse(args[0], out faceIndex) &&
UUID.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]";
}
}
}
}