Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
        public ConfirmPlayScreen(string fname, RemuxWindow wnd)
        {
            this.wnd = wnd;
            romPath  = fname;
            string fileSeparator = OsUtil.IsWindows() ? "\\" : "/";

            romName = fname.Substring(fname.LastIndexOf(fileSeparator));
        }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 4
0
        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));
            }
        }
Exemplo n.º 5
0
 public StateManager(Game game)
 {
     Game = (RemuxWindow)game;
     TransitionTo(new AsciiFileBrowserScreen(Game));
 }