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 ListPlayersExtended (manager.m_GUIConsole));
|
---|
12 | manager.m_GUIConsole.AddCommand (new Reply (manager.m_GUIConsole));
|
---|
13 | manager.m_GUIConsole.AddCommand (new SayToPlayer (manager.m_GUIConsole));
|
---|
14 | manager.m_GUIConsole.AddCommand (new SetTimeReal (manager.m_GUIConsole));
|
---|
15 | manager.m_GUIConsole.AddCommand (new ShowInventory (manager.m_GUIConsole));
|
---|
16 | } catch (Exception e) {
|
---|
17 | Log.Out ("Error registering custom commands: " + e);
|
---|
18 | }
|
---|
19 | /*
|
---|
20 | try {
|
---|
21 | List<ConsoleCommand> commands = manager.m_GUIConsole.commands;
|
---|
22 | foreach (ConsoleCommand c in commands) {
|
---|
23 | string name = string.Empty;
|
---|
24 | foreach (string cname in c.Names()) {
|
---|
25 | if (cname.Length > 0) {
|
---|
26 | if (name.Length > 0)
|
---|
27 | name += ", ";
|
---|
28 | name += cname;
|
---|
29 | }
|
---|
30 | }
|
---|
31 | name += " => " + c.Description();
|
---|
32 | Log.Out (name);
|
---|
33 | }
|
---|
34 | } catch (Exception e) {
|
---|
35 | Log.Out ("Error listing commands: " + e);
|
---|
36 | }
|
---|
37 | */
|
---|
38 | }
|
---|
39 | }
|
---|
40 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.