Exemple #1
0
        private void Tastudio_Load(object sender, EventArgs e)
        {
            if (!Engage())
            {
                Close();
                return;
            }

            if (TasView.Rotatable)
            {
                RightClickMenu.Items.AddRange(TasView.GenerateContextMenuItems()
                                              .ToArray());

                RightClickMenu.Items
                .OfType <ToolStripMenuItem>()
                .First(t => t.Name == "RotateMenuItem")
                .Click += (o, ov) => { CurrentTasMovie.FlagChanges(); };
            }

            TasView.ScrollSpeed           = Settings.ScrollSpeed;
            TasView.AlwaysScroll          = Settings.FollowCursorAlwaysScroll;
            TasView.ScrollMethod          = Settings.FollowCursorScrollMethod;
            TasView.SeekingCutoffInterval = Settings.SeekingCutoffInterval;
            BookMarkControl.HoverInterval = Settings.BranchCellHoverInterval;

            _autosaveTimer       = new Timer(components);
            _autosaveTimer.Tick += AutosaveTimerEventProcessor;
            if (Settings.AutosaveInterval > 0)
            {
                _autosaveTimer.Interval = (int)Settings.AutosaveInterval;
                _autosaveTimer.Start();
            }

            MainVertialSplit.SetDistanceOrDefault(
                Settings.MainVerticalSplitDistance,
                _defaultMainSplitDistance);

            BranchesMarkersSplit.SetDistanceOrDefault(
                Settings.BranchMarkerSplitDistance,
                _defaultBranchMarkerSplitDistance);

            TasView.Font = TasViewFont;
            CurrentTasMovie.BindMarkersToInput = Settings.BindMarkersToInput;
            RefreshDialog();
            _initialized = true;
        }
Exemple #2
0
 private void SaveTasMenuItem_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(CurrentTasMovie.Filename) ||
         CurrentTasMovie.Filename == DefaultTasProjName())
     {
         SaveAsTasMenuItem_Click(sender, e);
     }
     else
     {
         _autosaveTimer.Stop();
         MessageStatusLabel.Text = "Saving...";
         this.Cursor             = Cursors.WaitCursor;
         Update();
         if (_autosaveAppendFilenamePending)
         {
             // temp filename
             var ext = CurrentTasMovie.PreferredExtension;
             CurrentTasMovie.Filename = CurrentTasMovie.Filename.Replace(ext, "backup." + ext);
         }
         CurrentTasMovie.Save();
         if (Settings.AutosaveInterval > 0)
         {
             _autosaveTimer.Start();
         }
         MessageStatusLabel.Text = CurrentTasMovie.Name + " saved.";
         if (_autosaveAppendFilenamePending)
         {
             // switch back to original
             CurrentTasMovie.Filename = CurrentTasMovie.Filename.Replace("backup.", "");
             // we should only arrive here if changes were true
             // and saving to a different file clears changes
             // so assuming the original file remains unsaved, keep changes flagged
             CurrentTasMovie.FlagChanges();
         }
         else
         {
             Settings.RecentTas.Add(CurrentTasMovie.Filename);
         }
         this.Cursor = Cursors.Default;
     }
 }
Exemple #3
0
        private void Tastudio_Load(object sender, EventArgs e)
        {
            if (!InitializeOnLoad())
            {
                Close();
                DialogResult = DialogResult.Cancel;
                return;
            }

            SetColumnsFromCurrentStickies();

            if (TasView.Rotatable)
            {
                RightClickMenu.Items.AddRange(TasView.GenerateContextMenuItems()
                                              .ToArray());

                RightClickMenu.Items
                .OfType <ToolStripMenuItem>()
                .First(t => t.Name == "RotateMenuItem")
                .Click += (o, ov) => { CurrentTasMovie.FlagChanges(); };
            }

            TasView.ScrollSpeed           = Settings.ScrollSpeed;
            TasView.AlwaysScroll          = Settings.FollowCursorAlwaysScroll;
            TasView.ScrollMethod          = Settings.FollowCursorScrollMethod;
            TasView.SeekingCutoffInterval = Settings.SeekingCutoffInterval;
            BookMarkControl.HoverInterval = Settings.BranchCellHoverInterval;

            _autosaveTimer       = new Timer(components);
            _autosaveTimer.Tick += AutosaveTimerEventProcessor;
            if (Settings.AutosaveInterval > 0)
            {
                _autosaveTimer.Interval = (int)Settings.AutosaveInterval;
                _autosaveTimer.Start();
            }

            // Remembering Split container logic
            if (Settings.MainVerticalSplitDistance > 0)
            {
                try
                {
                    MainVertialSplit.SplitterDistance = Settings.MainVerticalSplitDistance;
                }
                catch (Exception)
                {
                    MainVertialSplit.SplitterDistance = _defaultMainSplitDistance;
                }
            }

            if (Settings.BranchMarkerSplitDistance > 0)
            {
                try
                {
                    BranchesMarkersSplit.SplitterDistance = Settings.BranchMarkerSplitDistance;
                }
                catch (Exception)
                {
                    BranchesMarkersSplit.SplitterDistance = _defaultBranchMarkerSplitDistance;
                }
            }

            TasView.Font = TasViewFont;
            CurrentTasMovie.BindMarkersToInput = Settings.BindMarkersToInput;
            RefreshDialog();
            _initialized = true;
        }
Exemple #4
0
 private void TasView_ColumnReordered(object sender, InputRoll.ColumnReorderedEventArgs e)
 {
     CurrentTasMovie.FlagChanges();
 }
Exemple #5
0
        private void Tastudio_Load(object sender, EventArgs e)
        {
            if (!InitializeOnLoad())
            {
                Close();
                DialogResult = DialogResult.Cancel;
                return;
            }

            SetColumnsFromCurrentStickies();

            if (VersionInfo.DeveloperBuild)
            {
                RightClickMenu.Items.AddRange(TasView.GenerateContextMenuItems().ToArray());

                RightClickMenu.Items
                .OfType <ToolStripMenuItem>()
                .First(t => t.Name == "RotateMenuItem")
                .Click += (o, ov) =>
                {
                    CurrentTasMovie.FlagChanges();
                };
            }

            TasView.InputPaintingMode     = Settings.DrawInput;
            TasView.ScrollSpeed           = Settings.ScrollSpeed;
            TasView.AlwaysScroll          = Settings.FollowCursorAlwaysScroll;
            TasView.ScrollMethod          = Settings.FollowCursorScrollMethod;
            TasView.SeekingCutoffInterval = Settings.SeekingCutoffInterval;
            BookMarkControl.HoverInterval = Settings.BranchCellHoverInterval;

            _autosaveTimer       = new Timer(components);
            _autosaveTimer.Tick += AutosaveTimerEventProcessor;
            if (Settings.AutosaveInterval > 0)
            {
                _autosaveTimer.Interval = (int)Settings.AutosaveInterval;
                _autosaveTimer.Start();
            }

            // Remembering Split container logic
            int defaultMainSplitDistance         = MainVertialSplit.SplitterDistance;
            int defaultBranchMarkerSplitDistance = BranchesMarkersSplit.SplitterDistance;

            ToolStripMenuItem restoreDefaults = TASMenu.Items
                                                .OfType <ToolStripMenuItem>()
                                                .Single(t => t.Name == "SettingsSubMenu")
                                                .DropDownItems
                                                .OfType <ToolStripMenuItem>()
                                                .Single(t => t.Text == "Restore &Defaults");

            restoreDefaults.Click += (o, ev) =>
            {
                MainVertialSplit.SplitterDistance     = defaultMainSplitDistance;
                BranchesMarkersSplit.SplitterDistance = defaultBranchMarkerSplitDistance;
            };

            if (Settings.MainVerticalSplitDistance > 0)
            {
                try
                {
                    MainVertialSplit.SplitterDistance = Settings.MainVerticalSplitDistance;
                }
                catch (Exception)
                {
                    MainVertialSplit.SplitterDistance = defaultMainSplitDistance;
                }
            }

            if (Settings.BranchMarkerSplitDistance > 0)
            {
                try
                {
                    BranchesMarkersSplit.SplitterDistance = Settings.BranchMarkerSplitDistance;
                }
                catch (Exception)
                {
                    BranchesMarkersSplit.SplitterDistance = defaultBranchMarkerSplitDistance;
                }
            }

            RefreshDialog();
            _initialized = true;
        }
        private void SetUpToolStripColumns()
        {
            ColumnsSubMenu.DropDownItems.Clear();

            var columns = TasView.AllColumns
                          .Where(x => !string.IsNullOrWhiteSpace(x.Text))
                          .Where(x => x.Name != "FrameColumn");

            ToolStripMenuItem[] playerMenus = new ToolStripMenuItem[Global.Emulator.ControllerDefinition.PlayerCount + 1];
            playerMenus[0] = ColumnsSubMenu;
            for (int i = 1; i < playerMenus.Length; i++)
            {
                playerMenus[i] = new ToolStripMenuItem("Player " + i);
            }
            int player = 0;

            foreach (InputRoll.RollColumn column in columns)
            {
                ToolStripMenuItem menuItem = new ToolStripMenuItem
                {
                    Text         = column.Text + " (" + column.Name + ")",
                    Checked      = column.Visible,
                    CheckOnClick = true,
                    Tag          = column.Name
                };

                menuItem.CheckedChanged += (o, ev) =>
                {
                    ToolStripMenuItem sender = o as ToolStripMenuItem;
                    TasView.AllColumns.Find(c => c.Name == (string)sender.Tag).Visible = sender.Checked;
                    TasView.AllColumns.ColumnsChanged();
                    CurrentTasMovie.FlagChanges();
                    RefreshTasView();
                    ColumnsSubMenu.ShowDropDown();
                    (sender.OwnerItem as ToolStripMenuItem).ShowDropDown();
                };

                if (column.Name.StartsWith("P") && column.Name.Length > 1 && char.IsNumber(column.Name, 1))
                {
                    player = int.Parse(column.Name[1].ToString());
                }
                else
                {
                    player = 0;
                }

                playerMenus[player].DropDownItems.Add(menuItem);
            }

            for (int i = 1; i < playerMenus.Length; i++)
            {
                ColumnsSubMenu.DropDownItems.Add(playerMenus[i]);
            }

            ColumnsSubMenu.DropDownItems.Add(new ToolStripSeparator());
            for (int i = 1; i < playerMenus.Length; i++)
            {
                ToolStripMenuItem item = new ToolStripMenuItem("Show Player " + i);
                item.CheckOnClick = true;
                item.Checked      = true;

                int dummyInt = i;
                ToolStripMenuItem dummyObject = playerMenus[i];
                item.CheckedChanged += (o, ev) =>
                {
                    ToolStripMenuItem sender = o as ToolStripMenuItem;
                    foreach (ToolStripMenuItem menuItem in dummyObject.DropDownItems)
                    {
                        TasView.AllColumns.Find(c => c.Name == (string)menuItem.Tag).Visible = sender.Checked;
                    }

                    CurrentTasMovie.FlagChanges();
                    RefreshTasView();
                };

                ColumnsSubMenu.DropDownItems.Add(item);
            }

            ColumnsSubMenu.DropDownItems.Add(new ToolStripSeparator());
            var defaults = new ToolStripMenuItem
            {
                Name = "RestoreDefaultColumnConfiguration",
                Text = "Restore defaults"
            };

            defaults.Click += (o, ev) =>
            {
                TasView.AllColumns.Clear();
                SetUpColumns();
                RefreshTasView();
                CurrentTasMovie.FlagChanges();
            };

            ColumnsSubMenu.DropDownItems.Add(defaults);
        }
 private void RotateMenuItem_Click(object sender, EventArgs e)
 {
     TasView.HorizontalOrientation ^= true;
     CurrentTasMovie.FlagChanges();
 }
Exemple #8
0
        private void Tastudio_Load(object sender, EventArgs e)
        {
            if (!InitializeOnLoad())
            {
                Close();
                DialogResult = DialogResult.Cancel;
                return;
            }

            // Set the screenshot to "1x" resolution of the core
            // cores like n64 and psx are going to still have sizes too big for the control, so cap them
            int width  = VideoProvider.BufferWidth;
            int height = VideoProvider.BufferHeight;

            if (width > 320)
            {
                double ratio = 320.0 / (double)width;
                width  = 320;
                height = (int)((double)(height) * ratio);
            }
            ScreenshotControl.DrawingHeight = height;
            ScreenshotControl.Size          = new Size(width, ScreenshotControl.DrawingHeight + ScreenshotControl.UserPadding);


            ScreenshotControl.Visible = false;
            Controls.Add(ScreenshotControl);
            ScreenshotControl.BringToFront();

            SetColumnsFromCurrentStickies();

            if (VersionInfo.DeveloperBuild)
            {
                RightClickMenu.Items.AddRange(TasView.GenerateContextMenuItems().ToArray());

                RightClickMenu.Items
                .OfType <ToolStripMenuItem>()
                .First(t => t.Name == "RotateMenuItem")
                .Click += (o, ov) =>
                {
                    CurrentTasMovie.FlagChanges();
                };
            }

            TasView.InputPaintingMode     = Settings.DrawInput;
            TasView.ScrollSpeed           = Settings.ScrollSpeed;
            TasView.AlwaysScroll          = Settings.FollowCursorAlwaysScroll;
            TasView.ScrollMethod          = Settings.FollowCursorScrollMethod;
            TasView.SeekingCutoffInterval = Settings.SeekingCutoffInterval;
            BookMarkControl.HoverInterval = Settings.BranchCellHoverInterval;

            _autosaveTimer.Tick += AutosaveTimerEventProcessor;
            if (Settings.AutosaveInterval > 0)
            {
                _autosaveTimer.Interval = (int)Settings.AutosaveInterval;
                _autosaveTimer.Start();
            }

            // Remembering Split container logic
            int defaultMainSplitDistance         = MainVertialSplit.SplitterDistance;
            int defaultBranchMarkerSplitDistance = BranchesMarkersSplit.SplitterDistance;

            ToolStripMenuItem restoreDefaults = TASMenu.Items
                                                .OfType <ToolStripMenuItem>()
                                                .Single(t => t.Name == "SettingsSubMenu")
                                                .DropDownItems
                                                .OfType <ToolStripMenuItem>()
                                                .Single(t => t.Text == "Restore &Defaults");

            restoreDefaults.Click += (o, ev) =>
            {
                MainVertialSplit.SplitterDistance     = defaultMainSplitDistance;
                BranchesMarkersSplit.SplitterDistance = defaultBranchMarkerSplitDistance;
            };

            if (Settings.MainVerticalSplitDistance > 0)
            {
                MainVertialSplit.SplitterDistance = Settings.MainVerticalSplitDistance;
            }

            if (Settings.BranchMarkerSplitDistance > 0)
            {
                BranchesMarkersSplit.SplitterDistance = Settings.BranchMarkerSplitDistance;
            }

            ////////////////

            RefreshDialog();
            _initialized = true;
        }