示例#1
0
        private void AppendMenuItem_Click(object sender, EventArgs e)
        {
            if (_cdl == null)
            {
                MessageBox.Show(this, "Cannot append with no CDL loaded!", "Alert");
            }
            else
            {
                var file = ToolHelpers.OpenFileDialog(
                    _currentFilename,
                    PathManager.MakeAbsolutePath(Global.Config.PathEntries.LogPathFragment, null),
                    "Code Data Logger Files",
                    "cdl");

                if (file != null)
                {
                    using (var fs = new FileStream(file.FullName, FileMode.Open, FileAccess.Read))
                    {
                        var newCDL = new CodeDataLog();
                        newCDL.Load(fs);
                        if (!_cdl.Check(newCDL))
                        {
                            MessageBox.Show(this, "CDL file does not match emulator's current memory map!");
                            return;
                        }
                        _cdl.LogicalOrFrom(newCDL);
                        UpdateDisplay(true);
                    }
                }
            }
        }
示例#2
0
        private void OpenMenuItem_Click(object sender, EventArgs e)
        {
            var file = ToolHelpers.OpenFileDialog(
                _currentFilename,
                PathManager.MakeAbsolutePath(Global.Config.PathEntries.LogPathFragment, null),
                "Code Data Logger Files",
                "cdl");

            if (file == null)
            {
                return;
            }

            //take care not to clobber an existing CDL
            if (_cdl != null)
            {
                var result = MessageBox.Show(this, "OK to load new CDL?", "Query", MessageBoxButtons.YesNo);
                if (result != DialogResult.Yes)
                {
                    return;
                }
            }

            LoadFile(file.FullName);
        }
示例#3
0
文件: Cheats.cs 项目: budzikt/BizHawk
        private void OpenMenuItem_Click(object sender, EventArgs e)
        {
            var append = sender == AppendMenuItem;
            var file   = ToolHelpers.OpenFileDialog(
                Global.CheatList.CurrentFileName,
                PathManager.GetCheatsPath(Global.Game),
                "Cheat Files",
                "cht");

            LoadFile(file, append);
        }
示例#4
0
        private void OpenMenuItem_Click(object sender, EventArgs e)
        {
            var file = ToolHelpers.OpenFileDialog(
                CurrentFileName,
                PathManager.GetRomsPath(Global.Game.System),                         // TODO: bot path
                "Bot files",
                "bot"
                );

            if (file != null)
            {
                LoadBotFile(file.FullName);
            }
        }
示例#5
0
        private void OpenTasMenuItem_Click(object sender, EventArgs e)
        {
            if (AskSaveChanges())
            {
                var filename = CurrentTasMovie.Filename;
                if (string.IsNullOrWhiteSpace(filename) || filename == DefaultTasProjName())
                {
                    filename = string.Empty;
                }

                var file = ToolHelpers.OpenFileDialog(
                    filename,
                    PathManager.MakeAbsolutePath(Global.Config.PathEntries.MoviesPathFragment, null),
                    "Tas Project Files",
                    "tasproj");

                if (file != null)
                {
                    LoadFile(file);
                }
            }
        }