Rev | Line | |
---|
[96] | 1 | using System;
|
---|
[107] | 2 | using System.Collections.Generic;
|
---|
[96] | 3 |
|
---|
| 4 | public class CommandExtensions
|
---|
| 5 | {
|
---|
| 6 | public static void InitCommandExtensions (GameManager manager)
|
---|
| 7 | {
|
---|
[107] | 8 | try {
|
---|
| 9 | manager.m_GUIConsole.AddCommand (new GetGamePrefs (manager.m_GUIConsole));
|
---|
| 10 | manager.m_GUIConsole.AddCommand (new GetTime (manager.m_GUIConsole));
|
---|
[109] | 11 | manager.m_GUIConsole.AddCommand (new Kill (manager.m_GUIConsole));
|
---|
[107] | 12 | manager.m_GUIConsole.AddCommand (new ListPlayersExtended (manager.m_GUIConsole));
|
---|
[108] | 13 | manager.m_GUIConsole.AddCommand (new Reply (manager.m_GUIConsole));
|
---|
[107] | 14 | manager.m_GUIConsole.AddCommand (new SayToPlayer (manager.m_GUIConsole));
|
---|
| 15 | manager.m_GUIConsole.AddCommand (new SetTimeReal (manager.m_GUIConsole));
|
---|
| 16 | manager.m_GUIConsole.AddCommand (new ShowInventory (manager.m_GUIConsole));
|
---|
| 17 | } catch (Exception e) {
|
---|
| 18 | Log.Out ("Error registering custom commands: " + e);
|
---|
| 19 | }
|
---|
| 20 | /*
|
---|
| 21 | try {
|
---|
| 22 | List<ConsoleCommand> commands = manager.m_GUIConsole.commands;
|
---|
| 23 | foreach (ConsoleCommand c in commands) {
|
---|
| 24 | string name = string.Empty;
|
---|
| 25 | foreach (string cname in c.Names()) {
|
---|
| 26 | if (cname.Length > 0) {
|
---|
| 27 | if (name.Length > 0)
|
---|
| 28 | name += ", ";
|
---|
| 29 | name += cname;
|
---|
| 30 | }
|
---|
| 31 | }
|
---|
| 32 | name += " => " + c.Description();
|
---|
| 33 | Log.Out (name);
|
---|
| 34 | }
|
---|
| 35 | } catch (Exception e) {
|
---|
| 36 | Log.Out ("Error listing commands: " + e);
|
---|
| 37 | }
|
---|
| 38 | */
|
---|
[96] | 39 | }
|
---|
| 40 | }
|
---|
| 41 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.