Esempio n. 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);
                    }
                }
            }
        }
Esempio n. 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);
        }
Esempio n. 3
0
        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);
        }
Esempio n. 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);
            }
        }
Esempio n. 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);
                }
            }
        }