예제 #1
0
        private void BeforeQuickLoad(object sender, BeforeQuickLoadEventArgs e)
        {
            if (treeView.SelectedNode.Tag is FileInfo)
            {
                treeView.SelectedNode = treeView.SelectedNode.Parent;
            }

            string path = Path.Combine(PathManager.GetSaveStatePath(Global.Game), string.Format(@"{0}\{1}", treeView.SelectedNode.FullPath, e.Name));

            if (File.Exists(string.Format("{0}.State", path)))
            {
                try
                {
                    ClientApi.LoadState(path);
                }
#if DEBUG
                catch (TargetInvocationException ex)
                {
                    MessageBox.Show(ex.Message);
                }
#else
                catch (TargetInvocationException)
                {}
#endif
            }
            e.Handled = true;
        }
 private void loadstate_Click(object sender, EventArgs e)
 {
     if (savestateName.Text.Trim() != string.Empty)
     {
         ClientApi.LoadState(savestateName.Text);
         //BinaryStateLoader.LoadAndDetect(savestateName.Text + ".State").GetLump(BinaryStateLump.Framebuffer, false, Test);
     }
 }
 //We will override F10 quickload behavior
 private void ClientApi_BeforeQuickLoad(object sender, BeforeQuickLoadEventArgs e)
 {
     if (e.Slot == 0)
     {
         string basePath = Path.Combine(PathManager.GetSaveStatePath(Global.Game), "Test");
         ClientApi.LoadState(Path.Combine(basePath, e.Name));
         e.Handled = true;
     }
 }
예제 #4
0
 private void TreeNode_Click(object sender, TreeNodeMouseClickEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
     {
         treeView.SelectedNode = e.Node;
         if (treeView.SelectedNode.Tag is FileInfo)
         {
             try
             {
                 ClientApi.LoadState(Path.Combine(PathManager.GetSaveStatePath(Global.Game), e.Node.FullPath));
                 treeView.SelectedNode = treeView.SelectedNode.Parent;
             }
             catch (TargetInvocationException)
             { }
         }
         nodeStatusLabel.Text = string.Format("Current folder: {0}", treeView.SelectedNode.Text);
     }
     else if (e.Button == MouseButtons.Right)
     {
         treeView.SelectedNode   = e.Node;
         e.Node.ContextMenuStrip = menu;
     }
 }
예제 #5
0
 private void buttonLoadState_Click(object sender, EventArgs e)
 {
     ClientApi.LoadState(SaveStateName);
 }