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