Exemplo n.º 1
0
        private void MarkerView_QueryItemBkColor(int index, InputRoll.RollColumn column, ref Color color)
        {
            var prev = Markers.PreviousOrCurrent(Global.Emulator.Frame);            //Temp fix

            if (prev != null && index == Markers.IndexOf(prev))
            {
                color = TAStudio.Marker_FrameCol;
            }
            else if (index < Markers.Count)
            {
                var marker = Markers[index];
                var record = Tastudio.CurrentTasMovie[marker.Frame];

                if (record.Lagged.HasValue)
                {
                    if (record.Lagged.Value)
                    {
                        color = column.Name == "FrameColumn" ? TAStudio.LagZone_FrameCol : TAStudio.LagZone_InputLog;
                    }
                    else
                    {
                        color = column.Name == "LabelColumn" ? TAStudio.GreenZone_FrameCol : TAStudio.GreenZone_InputLog;
                    }
                }
                else
                {
                    color = Color.White;
                }
            }
            else
            {
                color = Color.White;
            }
        }
Exemplo n.º 2
0
        private void QueryItemBkColor(int index, InputRoll.RollColumn column, ref Color color)
        {
            TasBranch branch = GetBranch(index);

            if (branch != null)
            {
                var record = Tastudio.CurrentTasMovie[branch.Frame];
                if (index == Movie.CurrentBranch)
                {
                    color = TAStudio.CurrentFrame_InputLog;                     // SystemColors.HotTrack;
                }
                else if (record.Lagged.HasValue)
                {
                    if (record.Lagged.Value)
                    {
                        color = TAStudio.LagZone_InputLog;
                    }
                    else
                    {
                        color = TAStudio.GreenZone_InputLog;
                    }
                }
            }

            // Highlight the branch cell a little, if hovering over it
            if (BranchView.CurrentCellIsDataCell &&
                BranchView.CurrentCell.Column.Name == BranchNumberColumnName &&
                column.Name == BranchNumberColumnName &&
                index == BranchView.CurrentCell.RowIndex)
            {
                color = Color.FromArgb((byte)(color.A - 24), (byte)(color.R - 24), (byte)(color.G - 24), (byte)(color.B - 24));
            }
        }
        public void UpdateTextColumnWidth()
        {
            int temp = 0;

            foreach (TasBranch b in Movie.Branches)
            {
                if (string.IsNullOrEmpty(b.UserText))
                {
                    continue;
                }

                if (temp < b.UserText.Length)
                {
                    temp = b.UserText.Length;
                }
            }
            LongestBranchText = temp;

            int textWidth = LongestBranchText * 12 + 14;             // sorry for magic numbers. see TAStudio.SetUpColumns()

            InputRoll.RollColumn column = BranchView.AllColumns.Where(c => c.Name == UserTextColumnName).SingleOrDefault();

            if (textWidth < 90)
            {
                textWidth = 90;
            }

            if (column.Width != textWidth)
            {
                column.Width = textWidth;
                BranchView.AllColumns.ColumnsChanged();
            }
        }
Exemplo n.º 4
0
        private void TasView_QueryItemText(int index, InputRoll.RollColumn column, out string text)
        {
            try
            {
                text = string.Empty;
                var columnName = column.Name;

                if (columnName == MarkerColumnName)
                {
                    // Do nothing
                }
                else if (columnName == FrameColumnName)
                {
                    text = (index).ToString().PadLeft(CurrentTasMovie.InputLogLength.ToString().Length, '0');
                }
                else
                {
                    if (index < CurrentTasMovie.InputLogLength)
                    {
                        text = CurrentTasMovie.DisplayValue(index, columnName);
                    }
                }
            }
            catch (Exception ex)
            {
                text = string.Empty;
                MessageBox.Show("oops\n" + ex);
            }
        }
Exemplo n.º 5
0
        private void MarkerView_QueryItemBkColor(int index, InputRoll.RollColumn column, ref Color color)
        {
            var prev = Markers.PreviousOrCurrent(Tastudio.Emulator.Frame);

            if (prev != null && index == Markers.IndexOf(prev))
            {
                // feos: taseditor doesn't have it, so we're free to set arbitrary color scheme. and I prefer consistency
                color = TAStudio.CurrentFrame_InputLog;
            }
            else if (index < Markers.Count)
            {
                var marker = Markers[index];
                var record = Tastudio.CurrentTasMovie[marker.Frame];

                if (record.Lagged.HasValue)
                {
                    if (record.Lagged.Value)
                    {
                        color = column.Name == "FrameColumn" ? TAStudio.LagZone_FrameCol : TAStudio.LagZone_InputLog;
                    }
                    else
                    {
                        color = column.Name == "LabelColumn" ? TAStudio.GreenZone_FrameCol : TAStudio.GreenZone_InputLog;
                    }
                }
                else
                {
                    color = Color.White;
                }
            }
            else
            {
                color = Color.White;
            }
        }
Exemplo n.º 6
0
        private void TasView_QueryItemIcon(int index, InputRoll.RollColumn column, ref Bitmap bitmap)
        {
            var columnName = column.Name;

            if (columnName == MarkerColumnName)
            {
                if (index == Emulator.Frame && index == GlobalWin.MainForm.PauseOnFrame)
                {
                    bitmap = TasView.HorizontalOrientation ?
                             Properties.Resources.ts_v_arrow_green_blue :
                             Properties.Resources.ts_h_arrow_green_blue;
                }
                else if (index == Emulator.Frame)
                {
                    bitmap = TasView.HorizontalOrientation ?
                             Properties.Resources.ts_v_arrow_blue :
                             Properties.Resources.ts_h_arrow_blue;
                }
                else if (index == GlobalWin.MainForm.PauseOnFrame)
                {
                    bitmap = TasView.HorizontalOrientation ?
                             Properties.Resources.ts_v_arrow_green :
                             Properties.Resources.ts_h_arrow_green;
                }
            }
        }
Exemplo n.º 7
0
        private void LuaListView_QueryItemImage(int index, InputRoll.RollColumn column, ref Bitmap bitmap, ref int offsetX, ref int offsetY)
        {
            if (column.Name != IconColumnName)
            {
                return;
            }

            if (LuaImp.ScriptList[index].IsSeparator)
            {
                return;
            }

            if (LuaImp.ScriptList[index].Paused)
            {
                bitmap = Properties.Resources.Pause;
            }
            else if (LuaImp.ScriptList[index].Enabled)
            {
                bitmap = Properties.Resources.ts_h_arrow_green;
            }
            else
            {
                bitmap = Properties.Resources.StopButton;
            }
        }
Exemplo n.º 8
0
        private void TasView_QueryItemBkColor(int index, InputRoll.RollColumn column, ref Color color)
        {
            string columnName = column.Name;

            if (columnName == MarkerColumnName)
            {             // For debugging purposes, let's visually show the state frames
                if (VersionInfo.DeveloperBuild && CurrentTasMovie.TasStateManager.HasState(index))
                {
                    color = Color.FromArgb(0xEEEEEE);
                }
                else
                {
                    color = Color.FromArgb(0xFEFFFF);
                }
                return;
            }

            if (columnName == FrameColumnName)
            {
                if (Emulator.Frame != index && CurrentTasMovie.Markers.IsMarker(index))
                {
                    color = Marker_FrameCol;
                }
            }
            else if (index == _floatEditRow && columnName == _floatEditColumn)
            {             // SuuperW: Analog editing is indicated by a color change.
                color = AnalogEdit_Col;
            }
        }
Exemplo n.º 9
0
        private void QueryItemText(int index, InputRoll.RollColumn column, out string text, ref int offsetX, ref int offsetY)
        {
            text = string.Empty;

            if (index >= Movie.BranchCount)
            {
                return;
            }

            switch (column.Name)
            {
            case BranchNumberColumnName:
                text = index.ToString();
                break;

            case FrameColumnName:
                text = GetBranch(index).Frame.ToString();
                break;

            case UserTextColumnName:
                //text = GetBranch(index).TimeStamp.ToString(@"hh\:mm\:ss\.ff");
                text = GetBranch(index).UserText;
                break;
            }
        }
Exemplo n.º 10
0
		private void TasView_QueryItemBkColor(int index, InputRoll.RollColumn column, ref Color color)
		{
			Color? overrideColor = GetColorOverride(index, column);

			if (overrideColor.HasValue)
			{
				color = overrideColor.Value;
				return;
			}

			string columnName = column.Name;
            
			if (columnName == CursorColumnName)
                color = Color.FromArgb(0xFEFFFF);
            
			if (columnName == FrameColumnName)
			{
				if (Emulator.Frame != index && CurrentTasMovie.Markers.IsMarker(index) && TasView.denoteMarkersWithBGColor)
					color = Marker_FrameCol;
                else
                    color = Color.FromArgb(0x60FFFFFF);
			}
			else if (index == _floatEditRow && columnName == _floatEditColumn)
			{ // SuuperW: Analog editing is indicated by a color change.
				color = AnalogEdit_Col;
			}

			int player = Global.Emulator.ControllerDefinition.PlayerNumber(columnName);
			if (player != 0 && player % 2 == 0)
				color = Color.FromArgb(0x0D000000);
		}
Exemplo n.º 11
0
        private string GetTextOverride(int index, InputRoll.RollColumn column)
        {
            if (QueryItemTextCallback != null)
            {
                return(QueryItemTextCallback(index, column.Name));
            }

            return(null);
        }
Exemplo n.º 12
0
        private Color?GetColorOverride(int index, InputRoll.RollColumn column)
        {
            if (QueryItemBgColorCallback != null)
            {
                return(QueryItemBgColorCallback(index, column.Name));
            }

            return(null);
        }
        private Bitmap GetIconOverride(int index, InputRoll.RollColumn column)
        {
            if (QueryItemIconCallback != null)
            {
                return(QueryItemIconCallback(index, column.Name));
            }

            return(null);
        }
Exemplo n.º 14
0
        private void WatchListView_QueryItemText(int index, InputRoll.RollColumn column, out string text, ref int offsetX, ref int offsetY)
        {
            text = "";
            if (index >= _watches.Count)
            {
                return;
            }

            if (_watches[index].IsSeparator)
            {
                if (column.Name == WatchList.ADDRESS)
                {
                    text = _watches[index].Notes;
                }

                return;
            }

            switch (column.Name)
            {
            case WatchList.ADDRESS:
                text = _watches[index].AddressString;
                break;

            case WatchList.VALUE:
                text = _watches[index].ValueString;
                break;

            case WatchList.PREV:
                text = _watches[index].PreviousStr;
                break;

            case WatchList.CHANGES:
                if (!_watches[index].IsSeparator)
                {
                    text = _watches[index].ChangeCount.ToString();
                }

                break;

            case WatchList.DIFF:
                text = _watches[index].Diff;
                break;

            case WatchList.TYPE:
                text = ComputeDisplayType(_watches[index]);
                break;

            case WatchList.DOMAIN:
                text = _watches[index].Domain.Name;
                break;

            case WatchList.NOTES:
                text = _watches[index].Notes;
                break;
            }
        }
Exemplo n.º 15
0
        private void TasView_QueryItemIcon(int index, InputRoll.RollColumn column, ref Bitmap bitmap, ref int offsetX, ref int offsetY)
        {
            var overrideIcon = GetIconOverride(index, column);

            if (overrideIcon != null)
            {
                bitmap = overrideIcon;
                return;
            }

            var columnName = column.Name;

            if (columnName == CursorColumnName)
            {
                if (index == Emulator.Frame && index == GlobalWin.MainForm.PauseOnFrame)
                {
                    bitmap = TasView.HorizontalOrientation ?
                             ts_v_arrow_green_blue :
                             ts_h_arrow_green_blue;
                }
                else if (index == Emulator.Frame)
                {
                    bitmap = TasView.HorizontalOrientation ?
                             ts_v_arrow_blue :
                             ts_h_arrow_blue;
                }
                else if (index == GlobalWin.MainForm.PauseOnFrame)
                {
                    bitmap = TasView.HorizontalOrientation ?
                             ts_v_arrow_green :
                             ts_h_arrow_green;
                }
            }
            else if (columnName == FrameColumnName)
            {
                TasMovieRecord record = CurrentTasMovie[index];
                offsetX = -3;
                offsetY = 1;

                if (CurrentTasMovie.Markers.IsMarker(index) && TasView.denoteMarkersWithIcons)
                {
                    bitmap = icon_marker;
                }
                else if (record.HasState && TasView.denoteStatesWithIcons)
                {
                    if (record.Lagged.HasValue && record.Lagged.Value)
                    {
                        bitmap = icon_anchor_lag;
                    }
                    else
                    {
                        bitmap = icon_anchor;
                    }
                }
            }
        }
Exemplo n.º 16
0
 private void DisassemblerView_QueryItemBkColor(int index, InputRoll.RollColumn column, ref Color color)
 {
     if (_disassemblyLines.Any() && index < _disassemblyLines.Count)
     {
         if (_disassemblyLines[index].Address == _currentDisassemblerAddress)
         {
             color = Color.LightCyan;
         }
     }
 }
Exemplo n.º 17
0
 private void HistoryView_QueryItemBkColor(int index, InputRoll.RollColumn column, ref Color color)
 {
     if (index == Log.UndoIndex)
     {
         color = TAStudio.GreenZone_InputLog;
     }
     else if (index > Log.UndoIndex)
     {
         color = TAStudio.LagZone_InputLog;
     }
 }
Exemplo n.º 18
0
        private void OrderColumn(InputRoll.RollColumn column)
        {
            if (column.Name != _sortedColumn)
            {
                _sortReverse = false;
            }

            _watches.OrderWatches(column.Name, _sortReverse);

            _sortedColumn = column.Name;
            _sortReverse ^= true;
            WatchListView.Refresh();
        }
Exemplo n.º 19
0
        private void MarkerView_QueryItemText(int index, InputRoll.RollColumn column, out string text)
        {
            text = "";

            if (column.Name == "FrameColumn")
            {
                text = Tastudio.CurrentTasMovie.Markers[index].Frame.ToString();
            }
            else if (column.Name == "LabelColumn")
            {
                text = Tastudio.CurrentTasMovie.Markers[index].Message;
            }
        }
Exemplo n.º 20
0
        private void MarkerView_QueryItemText(int index, InputRoll.RollColumn column, out string text, ref int offsetX, ref int offsetY)
        {
            text = "";

            if (column.Name == "FrameColumn")
            {
                text = Markers[index].Frame.ToString();
            }
            else if (column.Name == "LabelColumn")
            {
                text = Markers[index].Message;
            }
        }
Exemplo n.º 21
0
        public void AddColumn(string columnName, string columnText, int columnWidth)
        {
            if (TasView.AllColumns[columnName] == null)
            {
                var column = new InputRoll.RollColumn
                {
                    Name  = columnName,
                    Text  = columnText,
                    Width = columnWidth
                };

                TasView.AllColumns.Add(column);
            }
        }
Exemplo n.º 22
0
 private void CheatListView_QueryItemBkColor(int index, InputRoll.RollColumn column, ref Color color)
 {
     if (index < Global.CheatList.Count)
     {
         if (Global.CheatList[index].IsSeparator)
         {
             color = BackColor;
         }
         else if (Global.CheatList[index].Enabled)
         {
             color = Color.LightCyan;
         }
     }
 }
Exemplo n.º 23
0
 private void LuaListView_QueryItemBkColor(int index, InputRoll.RollColumn column, ref Color color)
 {
     if (LuaImp.ScriptList[index].IsSeparator)
     {
         color = BackColor;
     }
     else if (LuaImp.ScriptList[index].Enabled && !LuaImp.ScriptList[index].Paused)
     {
         color = Color.LightCyan;
     }
     else if (LuaImp.ScriptList[index].Enabled && LuaImp.ScriptList[index].Paused)
     {
         color = Color.LightPink;
     }
 }
Exemplo n.º 24
0
        public void AddColumn(string columnName, string columnText, int columnWidth, InputRoll.RollColumn.InputType columnType = InputRoll.RollColumn.InputType.Boolean)
        {
            if (TasView.AllColumns[columnName] == null)
            {
                var column = new InputRoll.RollColumn
                {
                    Name  = columnName,
                    Text  = columnText,
                    Width = columnWidth,
                    Type  = columnType
                };

                TasView.AllColumns.Add(column);
            }
        }
Exemplo n.º 25
0
 private void QueryItemBkColor(int index, InputRoll.RollColumn column, ref Color color)
 {
     if (index == CurrentBranch)
     {
         color = TAStudio.CurrentFrame_InputLog; // SystemColors.HotTrack;
     }
     // Highlight the branch cell a little, if hovering over it
     if (BranchView.CurrentCellIsDataCell &&
         BranchView.CurrentCell.Column.Name == BranchNumberColumnName &&
         column.Name == BranchNumberColumnName &&
         index == BranchView.CurrentCell.RowIndex)
     {
         color = Color.FromArgb((byte)(color.A - 24), (byte)(color.R - 24), (byte)(color.G - 24), (byte)(color.B - 24));
     }
 }
Exemplo n.º 26
0
        private void DisassemblerView_QueryItemText(int index, InputRoll.RollColumn column, out string text, ref int offsetX, ref int offsetY)
        {
            text = "";

            if (index < _disassemblyLines.Count)
            {
                if (column.Name == AddressColumnName)
                {
                    text = _disassemblyLines[index].Address.ToHexString(_pcRegisterSize);
                }
                else if (column.Name == InstructionColumnName)
                {
                    text = _disassemblyLines[index].Mnemonic;
                }
            }
        }
Exemplo n.º 27
0
        private void TasView_QueryItemText(int index, InputRoll.RollColumn column, out string text, ref int offsetX, ref int offsetY)
        {
            var overrideText = GetTextOverride(index, column);

            if (overrideText != null)
            {
                text = overrideText;
                return;
            }

            try
            {
                text = string.Empty;
                var columnName = column.Name;

                if (columnName == CursorColumnName)
                {
                    int branchIndex = CurrentTasMovie.BranchIndexByFrame(index);
                    if (branchIndex != -1)
                    {
                        text = branchIndex.ToString();
                    }
                }
                else if (columnName == FrameColumnName)
                {
                    offsetX = 7;
                    text    = (index).ToString().PadLeft(CurrentTasMovie.InputLogLength.ToString().Length, '0');
                }
                else
                {
                    // Display typed float value (string "-" can't be parsed, so CurrentTasMovie.DisplayValue can't return it)
                    if (index == _floatEditRow && columnName == _floatEditColumn)
                    {
                        text = _floatTypedValue;
                    }
                    else if (index < CurrentTasMovie.InputLogLength)
                    {
                        text = CurrentTasMovie.DisplayValue(index, columnName);
                    }
                }
            }
            catch (Exception ex)
            {
                text = string.Empty;
                MessageBox.Show("oops\n" + ex);
            }
        }
Exemplo n.º 28
0
        private void TraceView_QueryItemText(int index, InputRoll.RollColumn column, out string text, ref int offsetX, ref int offsetY)
        {
            text = "";
            if (index < _instructions.Count)
            {
                switch (column.Name)
                {
                case DisasmColumnName:
                    text = _instructions[index].Disassembly.TrimEnd();
                    break;

                case RegistersColumnName:
                    text = _instructions[index].RegisterInfo;
                    break;
                }
            }
        }
Exemplo n.º 29
0
        private void LuaListView_QueryItemText(int index, InputRoll.RollColumn column, out string text, ref int offsetX, ref int offsetY)
        {
            text = "";

            if (LuaImp.ScriptList[index].IsSeparator)
            {
                return;
            }

            if (column.Name == ScriptColumnName)
            {
                text = Path.GetFileNameWithoutExtension(LuaImp.ScriptList[index].Path);                 // TODO: how about allow the user to name scripts?
            }
            else if (column.Name == PathColumnName)
            {
                text = DressUpRelative(LuaImp.ScriptList[index].Path);
            }
        }
Exemplo n.º 30
0
        private void TasView_QueryItemIcon(int index, InputRoll.RollColumn column, ref Bitmap bitmap, ref int offsetX, ref int offsetY)
        {
            var overrideIcon = GetIconOverride(index, column);

            if (overrideIcon != null)
            {
                bitmap = overrideIcon;
                return;
            }

            var columnName = column.Name;

            if (columnName == CursorColumnName)
            {
                if (index == Emulator.Frame && index == GlobalWin.MainForm.PauseOnFrame)
                {
                    bitmap = TasView.HorizontalOrientation ?
                             Properties.Resources.ts_v_arrow_green_blue :
                             Properties.Resources.ts_h_arrow_green_blue;
                }
                else if (index == Emulator.Frame)
                {
                    bitmap = TasView.HorizontalOrientation ?
                             Properties.Resources.ts_v_arrow_blue :
                             Properties.Resources.ts_h_arrow_blue;
                }
                else if (index == GlobalWin.MainForm.PauseOnFrame)
                {
                    bitmap = TasView.HorizontalOrientation ?
                             Properties.Resources.ts_v_arrow_green :
                             Properties.Resources.ts_h_arrow_green;
                }
            }
            else if (columnName == FrameColumnName && VersionInfo.DeveloperBuild)
            {
                TasMovieRecord record = CurrentTasMovie[index];
                if (record.HasState)
                {
                    offsetX = -2;
                    offsetY = 2;
                    bitmap  = Properties.Resources.anchor;
                }
            }
        }
Exemplo n.º 31
0
		public void AddColumn(string columnName, string columnText, int columnWidth)
		{
			if (TasView.AllColumns[columnName] == null)
			{
				var column = new InputRoll.RollColumn
				{
					Name = columnName,
					Text = columnText,
					Width = columnWidth
				};

				TasView.AllColumns.Add(column);
			}
		}