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