public PanicScreen(Game g, string msg, Exception e) { blueRectangle = new Texture2D(g.GraphicsDevice, 3000, 3000); Color[] color = new Color[blueRectangle.Width * blueRectangle.Height]; for (int i = 0; i < color.Length; i++) { color[i] = Color.Blue; } blueRectangle.SetData(color); wnd = (RemuxWindow)g; this.msg = msg; for (int i = 0; i < positions.Length; i++) { positions[i] = new Vector2(r.Next(wnd.WndWidth), r.Next(wnd.WndHeight)); int num1 = r.Next(6) + 3; int num2 = r.Next(6) + 3; if (r.Next(2) == 1) { num1 *= -1; } if (r.Next(2) == 1) { num2 *= -1; } velocities[i] = new Vector2(num1, num2); } Console.WriteLine(e.Message); Console.WriteLine(e.StackTrace); }
public ConfirmPlayScreen(string fname, RemuxWindow wnd) { this.wnd = wnd; romPath = fname; string fileSeparator = OsUtil.IsWindows() ? "\\" : "/"; romName = fname.Substring(fname.LastIndexOf(fileSeparator)); }
public GameboyPlayScreen(string fname, RemuxWindow wnd) { romFile = fname; vm = new GameBoy(new EmulatedCartridge(File.ReadAllBytes(fname))); vm.Gpu.VideoOutput = this; vm.Cpu.Run(); this.wnd = wnd; ioman = new IoManager(vm); }
private void EnterPressed() { if (pointerIndex < subDirectories.Count) { string chosenDir = subDirectories[pointerIndex]; if (chosenDir == ".." && currentDirectory.Length > 3) { bool flag = OsUtil.IsWindows() ? currentDirectory.LastIndexOf("\\") != 2 : currentDirectory != "/"; if (flag) { if (OsUtil.IsWindows()) { currentDirectory = currentDirectory.Substring(0, currentDirectory.LastIndexOf("\\")); } else { currentDirectory = currentDirectory.Substring(0, currentDirectory.LastIndexOf("/")); if (currentDirectory == "") { currentDirectory = "/"; } } } else { currentDirectory = currentDirectory.Substring(0, 3); } } else if (pointerIndex != 0) { currentDirectory = subDirectories[pointerIndex]; } RefreshDirectory(); } else { string fname = GetFileBrowserIndex(pointerIndex).Item1; RemuxWindow wnd = (RemuxWindow)game; wnd.StateManager.TransitionTo(fname.EndsWith(".gb") ? (IState) new GameboyPlayScreen(fname, wnd) : new ConfirmPlayScreen(fname, wnd)); } }
public StateManager(Game game) { Game = (RemuxWindow)game; TransitionTo(new AsciiFileBrowserScreen(Game)); }