本文整理汇总了C#中BizHawk.Client.EmuHawk.InputRoll类的典型用法代码示例。如果您正苦于以下问题:C# InputRoll类的具体用法?C# InputRoll怎么用?C# InputRoll使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InputRoll类属于BizHawk.Client.EmuHawk命名空间,在下文中一共展示了InputRoll类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MarkerView_QueryItemBkColor
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;
}
示例2: MarkerView_QueryItemText
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;
}
}
示例3: QueryItemText
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 TimeColumnName:
text = GetBranch(index).TimeStamp.ToString(@"hh\:mm\:ss\.ff");
break;
}
}
示例4: TasView_PointedCellChanged
private void TasView_PointedCellChanged(object sender, InputRoll.CellEventArgs e)
{
// TODO: think about nullability
// For now return if a null because this happens OnEnter which doesn't have any of the below behaviors yet?
// Most of these are stupid but I got annoyed at null crashes
if (e.OldCell == null || e.OldCell.Column == null || e.OldCell.RowIndex == null ||
e.NewCell == null || e.NewCell.RowIndex == null || e.NewCell.Column == null)
{
return;
}
int startVal, endVal;
int frame = e.NewCell.RowIndex.Value;
if (e.OldCell.RowIndex.Value < e.NewCell.RowIndex.Value)
{
startVal = e.OldCell.RowIndex.Value;
endVal = e.NewCell.RowIndex.Value;
}
else
{
startVal = e.NewCell.RowIndex.Value;
endVal = e.OldCell.RowIndex.Value;
}
if (_startMarkerDrag)
{
if (e.NewCell.RowIndex.HasValue)
{
GoToFrame(e.NewCell.RowIndex.Value);
}
}
else if (_startFrameDrag)
{
if (e.OldCell.RowIndex.HasValue && e.NewCell.RowIndex.HasValue)
{
for (var i = startVal; i <= endVal; i++)
{
TasView.SelectRow(i, _frameDragState);
}
RefreshTasView();
}
}
else if (_rightClickFrame != -1)
{
_triggerAutoRestore = true;
_supressContextMenu = true;
if (frame > CurrentTasMovie.InputLogLength - _rightClickInput.Length)
frame = CurrentTasMovie.InputLogLength - _rightClickInput.Length;
if (_rightClickShift)
{
if (_rightClickControl) // Insert
{
// If going backwards, delete!
bool shouldInsert = true;
if (startVal < _rightClickFrame)
{ // Cloning to a previous frame makes no sense.
startVal = _rightClickFrame - 1;
}
if (startVal < _rightClickLastFrame)
shouldInsert = false;
if (shouldInsert)
{
for (int i = startVal + 1; i <= endVal; i++)
CurrentTasMovie.InsertInput(i, _rightClickInput[(i - _rightClickFrame) % _rightClickInput.Length]);
}
else
{
CurrentTasMovie.RemoveFrames(startVal + 1, endVal + 1);
}
_rightClickLastFrame = frame;
}
else // Overwrite
{
for (int i = startVal; i <= endVal; i++)
CurrentTasMovie.SetFrame(i, _rightClickInput[(_rightClickFrame - i) % _rightClickInput.Length]);
if (startVal < _triggerAutoRestoreFromFrame)
_triggerAutoRestoreFromFrame = startVal;
}
}
else
{
if (_rightClickControl)
{
for (int i = 0; i < _rightClickInput.Length; i++) // Re-set initial range, just to verify it's still there.
CurrentTasMovie.SetFrame(_rightClickFrame + i, _rightClickInput[i]);
if (_rightClickOverInput != null) // Restore overwritten input from previous movement
{
for (int i = 0; i < _rightClickOverInput.Length; i++)
CurrentTasMovie.SetFrame(_rightClickLastFrame + i, _rightClickOverInput[i]);
}
else
_rightClickOverInput = new string[_rightClickInput.Length];
_rightClickLastFrame = frame; // Set new restore log
CurrentTasMovie.GetLogEntries().CopyTo(frame, _rightClickOverInput, 0, _rightClickOverInput.Length);
//.........这里部分代码省略.........
示例5: TasView_ColumnRightClick
private void TasView_ColumnRightClick(object sender, InputRoll.ColumnClickEventArgs e)
{
e.Column.Emphasis ^= true;
UpdateAutoFire(e.Column.Name, e.Column.Emphasis);
RefreshTasView();
}
示例6: TasView_ColumnReordered
private void TasView_ColumnReordered(object sender, InputRoll.ColumnReorderedEventArgs e)
{
CurrentTasMovie.FlagChanges();
}
示例7: TasView_ColumnClick
private void TasView_ColumnClick(object sender, InputRoll.ColumnClickEventArgs e)
{
if (TasView.SelectedRows.Any())
{
var columnName = e.Column.Name;
if (columnName == FrameColumnName)
{
CurrentTasMovie.Markers.Add(TasView.LastSelectedIndex.Value, "");
RefreshDialog();
}
else if (columnName != MarkerColumnName) // TODO: what about float?
{
foreach (var index in TasView.SelectedRows)
{
CurrentTasMovie.ToggleBoolState(index, columnName);
_triggerAutoRestore = true;
_triggerAutoRestoreFromFrame = TasView.SelectedRows.Min();
}
RefreshDialog();
}
}
}
示例8: TasView_QueryItemIcon
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;
}
}
}
示例9: BranchView_CellHovered
private void BranchView_CellHovered(object sender, InputRoll.CellEventArgs e)
{
if (e.NewCell != null && e.NewCell.RowIndex.HasValue && e.NewCell.Column != null && e.NewCell.RowIndex < Movie.BranchCount)
{
if (e.NewCell.Column.Name == BranchNumberColumnName)
{
ScreenShotPopUp(GetBranch(e.NewCell.RowIndex.Value), e.NewCell.RowIndex.Value);
}
else
{
CloseScreenShotPopUp();
}
}
else
{
CloseScreenShotPopUp();
}
}
示例10: TasView_QueryItemText
private void TasView_QueryItemText(int index, InputRoll.RollColumn column, out string text)
{
var overrideText = GetTextOverride(index, column);
if (overrideText != null)
{
text = overrideText;
return;
}
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);
}
}
示例11: QueryItemText
private void QueryItemText(int index, InputRoll.RollColumn column, out string text)
{
text = string.Empty;
if (index >= Tastudio.CurrentTasMovie.TasBranches.Count)
{
return;
}
switch (column.Name)
{
case BranchNumberColumnName:
text = index.ToString();
break;
case FrameColumnName:
text = Branches[index].Frame.ToString();
break;
case TimeColumnName:
text = MovieTime(Branches[index].Frame).ToString(@"hh\:mm\:ss\.fff");
break;
}
}
示例12: TasView_QueryItemBkColor
private void TasView_QueryItemBkColor(int index, InputRoll.RollColumn column, ref Color color)
{
var overrideColor = GetColorOverride(index, column);
if (overrideColor.HasValue)
{
color = overrideColor.Value;
return;
}
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;
}
}
示例13: TasView_QueryItemBkColor
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)
{ // 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
color = Color.FromArgb(32, 0, 0, 0); // same as players 2 and 4
}
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(32, 0, 0, 0);
}
示例14: MarkerView_QueryItemText
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;
}
}
示例15: TasView_QueryItemIcon
private void TasView_QueryItemIcon(int index, InputRoll.RollColumn column, ref Bitmap bitmap)
{
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;
}
}
}