Display help commander topics in capitalized form - the commands themselves are still lowercase.
Also convert the estate commands to simply AddCommand() calls so that commands from two different modules can be placed in the same category0.7.3-extended
parent
1480845597
commit
8cc5322b39
|
@ -242,8 +242,10 @@ namespace OpenSim
|
|||
|
||||
foreach (string topic in topics)
|
||||
{
|
||||
m_console.Commands.AddCommand(topic, false, "help " + topic,
|
||||
"help " + topic,
|
||||
string capitalizedTopic = char.ToUpper(topic[0]) + topic.Substring(1);
|
||||
|
||||
m_console.Commands.AddCommand(capitalizedTopic, false, "help " + capitalizedTopic,
|
||||
"help " + capitalizedTopic,
|
||||
"Get help on plugin command '" + topic + "'",
|
||||
HandleCommanderHelp);
|
||||
//
|
||||
|
@ -267,7 +269,7 @@ namespace OpenSim
|
|||
|
||||
foreach (string command in commander.Commands.Keys)
|
||||
{
|
||||
m_console.Commands.AddCommand(topic, false,
|
||||
m_console.Commands.AddCommand(capitalizedTopic, false,
|
||||
topic + " " + command,
|
||||
topic + " " + commander.Commands[command].ShortHelp(),
|
||||
String.Empty, HandleCommanderCommand);
|
||||
|
@ -286,7 +288,7 @@ namespace OpenSim
|
|||
// Only safe for the interactive console, since it won't
|
||||
// let us come here unless both scene and commander exist
|
||||
//
|
||||
ICommander moduleCommander = SceneManager.CurrentOrFirstScene.GetCommander(cmd[1]);
|
||||
ICommander moduleCommander = SceneManager.CurrentOrFirstScene.GetCommander(cmd[1].ToLower());
|
||||
if (moduleCommander != null)
|
||||
m_console.Output(moduleCommander.Help);
|
||||
}
|
||||
|
|
|
@ -62,58 +62,25 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
|||
{
|
||||
m_log.DebugFormat("[ESTATE MODULE]: Setting up estate commands for region {0}", m_module.Scene.RegionInfo.RegionName);
|
||||
|
||||
m_module.Scene.AddCommand("estate", m_module, "set terrain texture",
|
||||
m_module.Scene.AddCommand("Regions", m_module, "set terrain texture",
|
||||
"set terrain texture <number> <uuid> [<x>] [<y>]",
|
||||
"Sets the terrain <number> to <uuid>, if <x> or <y> are specified, it will only " +
|
||||
"set it on regions with a matching coordinate. Specify -1 in <x> or <y> to wildcard" +
|
||||
" that coordinate.",
|
||||
consoleSetTerrainTexture);
|
||||
|
||||
m_module.Scene.AddCommand("estate", m_module, "set terrain heights",
|
||||
m_module.Scene.AddCommand("Regions", m_module, "set terrain heights",
|
||||
"set terrain heights <corner> <min> <max> [<x>] [<y>]",
|
||||
"Sets the terrain texture heights on corner #<corner> to <min>/<max>, if <x> or <y> are specified, it will only " +
|
||||
"set it on regions with a matching coordinate. Specify -1 in <x> or <y> to wildcard" +
|
||||
" that coordinate. Corner # SW = 0, NW = 1, SE = 2, NE = 3.",
|
||||
consoleSetTerrainHeights);
|
||||
|
||||
Command showCommand
|
||||
= new Command("show", CommandIntentions.COMMAND_STATISTICAL, ShowEstatesCommand, "Shows all estates on the simulator.");
|
||||
consoleSetTerrainHeights);
|
||||
|
||||
m_commander.RegisterCommand("show", showCommand);
|
||||
|
||||
m_module.Scene.RegisterModuleCommander(m_commander);
|
||||
|
||||
m_module.Scene.EventManager.OnPluginConsole += EventManagerOnPluginConsole;
|
||||
m_module.Scene.AddCommand(
|
||||
"Estates", m_module, "estate show", "estate show", "Shows all estates on the simulator.", "", ShowEstatesCommand);
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
m_module.Scene.EventManager.OnPluginConsole -= EventManagerOnPluginConsole;
|
||||
m_module.Scene.UnregisterModuleCommander(m_commander.Name);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Processes commandline input. Do not call directly.
|
||||
/// </summary>
|
||||
/// <param name="args">Commandline arguments</param>
|
||||
protected void EventManagerOnPluginConsole(string[] args)
|
||||
{
|
||||
if (args[0] == "estate")
|
||||
{
|
||||
if (args.Length == 1)
|
||||
{
|
||||
m_commander.ProcessConsoleCommand("help", new string[0]);
|
||||
return;
|
||||
}
|
||||
|
||||
string[] tmpArgs = new string[args.Length - 2];
|
||||
int i;
|
||||
for (i = 2; i < args.Length; i++)
|
||||
tmpArgs[i - 2] = args[i];
|
||||
|
||||
m_commander.ProcessConsoleCommand(args[1], tmpArgs);
|
||||
}
|
||||
}
|
||||
public void Close() {}
|
||||
|
||||
protected void consoleSetTerrainTexture(string module, string[] args)
|
||||
{
|
||||
|
@ -201,7 +168,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
|||
}
|
||||
}
|
||||
|
||||
protected void ShowEstatesCommand(Object[] args)
|
||||
protected void ShowEstatesCommand(string module, string[] cmd)
|
||||
{
|
||||
StringBuilder report = new StringBuilder();
|
||||
RegionInfo ri = m_module.Scene.RegionInfo;
|
||||
|
|
|
@ -642,7 +642,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
#endregion Region Settings
|
||||
|
||||
MainConsole.Instance.Commands.AddCommand("estate", false, "reload estate",
|
||||
MainConsole.Instance.Commands.AddCommand("Estates", false, "reload estate",
|
||||
"reload estate",
|
||||
"Reload the estate data", HandleReloadEstate);
|
||||
|
||||
|
|
Loading…
Reference in New Issue