Esempio n. 1
0
        public ConfirmPlayScreen(string fname, RemuxWindow wnd)
        {
            this.wnd = wnd;
            romPath  = fname;
            string fileSeparator = OsUtil.IsWindows() ? "\\" : "/";

            romName = fname.Substring(fname.LastIndexOf(fileSeparator));
        }
Esempio n. 2
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));
            }
        }