public Commands() { Instance = this; commandHistory = new List<string>(); drawCommands = new List<string>(); commands = new Dictionary<string, CommandCallback>(); sorted = new List<string>(); RegisterCommand("clear", (string[] args) => { Clear(); }); RegisterCommand("exit", (string[] args) => { Engine.Instance.Exit(); }); RegisterCommand("count", (string[] args) => { if (Engine.Instance.Scene != null) Log("Entity Count: " + Engine.Instance.Scene.EntityCount); }); RegisterCommand("tags", (string[] args) => { if (Engine.Instance.Scene != null) { string[] str = Engine.Instance.Scene.DumpTagInfo().Split(new char[] {'\n'}, StringSplitOptions.RemoveEmptyEntries); foreach (var s in str) Log(s); } }); RegisterCommand("help", (string[] args) => { Log("Commands: " + string.Join(", ", sorted.ToArray())); }); RegisterCommand("opacity", (string[] args) => { if (args.Length == 0) Log("Provide a float (0-1.0) to set console opacity (eg: 'opacity 0.8')."); else Opacity = ParseFloat(args, 0, .8f); }); RegisterCommand("memory", (string[] args) => { Log((GC.GetTotalMemory(true) / 1048576f).ToString("F") + " MB"); }); RegisterCommand("fullscreen", (string[] args) => { if (Engine.Instance.Screen.IsFullscreen) Engine.Instance.Screen.DisableFullscreen(); else Engine.Instance.Screen.EnableFullscreen(Screen.FullscreenMode.LargestIntegerScale); }); }
protected override void Initialize() { base.Initialize(); UpdateView(); MInput.Initialize(); Tracker.Initialize(); Pooler = new Monocle.Pooler(); Commands = new Commands(); }
protected override void Initialize() { base.Initialize(); #if DEBUG #if DESKTOP Commands = new Commands(); #elif OUYA FrameRateDisplay = ""; #endif #endif Music.Initialize(); Input.Initialize(); Screen.Initialize(); Monocle.Draw.Init(GraphicsDevice); Graphics.DeviceReset += OnGraphicsReset; #if DESKTOP Window.Title = windowTitle; #endif }
private static void CommandsOnRender(On.Monocle.Commands.orig_Render orig, Monocle.Commands self) { CenterTheCamera(() => orig(self)); }