Exemple #1
0
        void RunSaveAs()
        {
            if (_cdl == null)
            {
                MessageBox.Show(this, "Cannot save with no CDL loaded!", "Alert");
            }
            else
            {
                var file = ToolHelpers.SaveFileDialog(
                    _currentFilename,
                    PathManager.MakeAbsolutePath(Global.Config.PathEntries.LogPathFragment, null),
                    "Code Data Logger Files",
                    "cdl");

                if (file != null)
                {
                    using (var fs = new FileStream(file.FullName, FileMode.Create, FileAccess.Write))
                    {
                        _cdl.Save(fs);
                        _recent.Add(file.FullName);
                        SetCurrentFilename(file.FullName);
                    }
                }
            }
        }
Exemple #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);
        }
Exemple #3
0
        private void SaveAs()
        {
            var result = _watches.SaveAs(ToolHelpers.GetWatchSaveFileFromUser(_watches.CurrentFileName));

            if (result)
            {
                UpdateStatusBar(saved: true);
                Global.Config.RecentWatches.Add(_watches.CurrentFileName);
            }
        }
Exemple #4
0
        private static bool SaveAs()
        {
            var file = ToolHelpers.SaveFileDialog(
                Global.CheatList.CurrentFileName,
                PathManager.GetCheatsPath(Global.Game),
                "Cheat Files",
                "cht");

            return(file != null && Global.CheatList.SaveFile(file.FullName));
        }
Exemple #5
0
		private void SaveAsTasMenuItem_Click(object sender, EventArgs e)
		{
			var file = ToolHelpers.GetTasProjSaveFileFromUser(_tas.Filename);
			if (file != null)
			{
				_tas.Filename = file.FullName;
				_tas.Save();
				Global.Config.RecentTas.Add(_tas.Filename);
				MessageStatusLabel.Text = Path.GetFileName(_tas.Filename) + " saved.";
			}
		}
Exemple #6
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);
        }
Exemple #7
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);
            }
        }
Exemple #8
0
		private void OpenTasMenuItem_Click(object sender, EventArgs e)
		{
			if (AskSave())
			{
				var file = ToolHelpers.GetTasProjFileFromUser(_tas.Filename);
				if (file != null)
				{
					_tas.Filename = file.FullName;
					_tas.Load();
					Global.Config.RecentTas.Add(_tas.Filename);
					RefreshDialog();
					MessageStatusLabel.Text = Path.GetFileName(_tas.Filename) + " loaded.";
				}
			}
		}
Exemple #9
0
        private void OpenTasMenuItem_Click(object sender, EventArgs e)
        {
            if (AskSaveChanges())
            {
                var filename = CurrentTasMovie.Filename;
                if (string.IsNullOrWhiteSpace(filename) || filename == DefaultTasProjName())
                {
                    filename = "";
                }

                var file = ToolHelpers.GetTasProjFileFromUser(filename);
                if (file != null)
                {
                    LoadFile(file);
                }
            }
        }
Exemple #10
0
        private void ViewInHexEditorContextMenuItem_Click(object sender, EventArgs e)
        {
            var selected = SelectedCheats.ToList();

            if (selected.Any())
            {
                GlobalWin.Tools.Load <HexEditor>();

                if (selected.Select(x => x.Domain).Distinct().Count() > 1)
                {
                    ToolHelpers.ViewInHexEditor(selected[0].Domain, new List <long> {
                        selected.First().Address ?? 0
                    }, selected.First().Size);
                }
                else
                {
                    ToolHelpers.ViewInHexEditor(selected.First().Domain, selected.Select(x => x.Address ?? 0), selected.First().Size);
                }
            }
        }
Exemple #11
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.GetCdlFileFromUser(_currentFileName);
         if (file != null)
         {
             using (var fs = new FileStream(file.FullName, FileMode.Open, FileAccess.Read))
             {
                 var newCDL = CodeDataLog.Load(fs);
                 _cdl.LogicalOrFrom(newCDL);
                 UpdateDisplay();
             }
         }
     }
 }
Exemple #12
0
 private void SaveAsMenuItem_Click(object sender, EventArgs e)
 {
     if (_cdl == null)
     {
         MessageBox.Show(this, "Cannot save with no CDL loaded!", "Alert");
     }
     else
     {
         var file = ToolHelpers.GetCdlSaveFileFromUser(_currentFileName);
         if (file != null)
         {
             using (var fs = new FileStream(file.FullName, FileMode.Create, FileAccess.Write))
             {
                 _cdl.Save(fs);
                 Global.Config.RecentPceCdlFiles.Add(file.FullName);
                 _currentFileName = file.FullName;
             }
         }
     }
 }
Exemple #13
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);
                }
            }
        }
Exemple #14
0
        private void OpenMenuItem_Click(object sender, EventArgs e)
        {
            var append = sender == AppendMenuItem;

            LoadFile(ToolHelpers.GetCheatFileFromUser(Global.CheatList.CurrentFileName), append);
        }
Exemple #15
0
        private static bool SaveAs()
        {
            var file = ToolHelpers.GetCheatSaveFileFromUser(Global.CheatList.CurrentFileName);

            return(file != null && Global.CheatList.SaveFile(file.FullName));
        }
Exemple #16
0
        private void OpenMenuItem_Click(object sender, EventArgs e)
        {
            var append = sender == AppendMenuItem;

            LoadWatchFile(ToolHelpers.GetWatchFileFromUser(_watches.CurrentFileName), append);
        }