Move `&&`/`||` to start of next line in EmuHawk project
This commit is contained in:
parent
8987ba8650
commit
b0ba7a1246
|
@ -377,16 +377,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
/// </summary>
|
||||
public void SetVideoParameters(int width, int height)
|
||||
{
|
||||
var change = _parameters.width != width ||
|
||||
_parameters.height != height;
|
||||
|
||||
var change = width != _parameters.width || height != _parameters.height;
|
||||
if (!change) return;
|
||||
_parameters.width = width;
|
||||
_parameters.height = height;
|
||||
|
||||
if (change)
|
||||
{
|
||||
Segment();
|
||||
}
|
||||
Segment();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -394,20 +389,14 @@ namespace BizHawk.Client.EmuHawk
|
|||
/// </summary>
|
||||
public void SetAudioParameters(int sampleRate, int channels, int bits)
|
||||
{
|
||||
var change = _parameters.a_samplerate != sampleRate ||
|
||||
_parameters.a_channels != channels ||
|
||||
_parameters.a_bits != bits ||
|
||||
_parameters.has_audio != true;
|
||||
|
||||
var change = !_parameters.has_audio || sampleRate != _parameters.a_samplerate
|
||||
|| channels != _parameters.a_channels || bits != _parameters.a_bits;
|
||||
if (!change) return;
|
||||
_parameters.a_samplerate = sampleRate;
|
||||
_parameters.a_channels = channels;
|
||||
_parameters.a_bits = bits;
|
||||
_parameters.has_audio = true;
|
||||
|
||||
if (change)
|
||||
{
|
||||
Segment();
|
||||
}
|
||||
Segment();
|
||||
}
|
||||
|
||||
public class CodecToken : IDisposable
|
||||
|
|
|
@ -1593,8 +1593,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
_lastCell = CurrentCell;
|
||||
CurrentCell = newCell;
|
||||
|
||||
if (PointedCellChanged != null &&
|
||||
(_lastCell?.Column != CurrentCell.Column || _lastCell?.RowIndex != CurrentCell.RowIndex))
|
||||
if (PointedCellChanged is not null
|
||||
&& !(_lastCell?.Column == CurrentCell.Column && _lastCell?.RowIndex == CurrentCell.RowIndex)) //TODO isn't this just `Cell.==`? --yoshi
|
||||
{
|
||||
PointedCellChanged(this, new CellEventArgs(_lastCell, CurrentCell));
|
||||
}
|
||||
|
|
|
@ -15,10 +15,10 @@ namespace BizHawk.Client.EmuHawk
|
|||
/// <remarks>http://stackoverflow.com/questions/139010/how-to-resolve-a-lnk-in-c-sharp</remarks>
|
||||
public static string ResolveShortcut(string filename)
|
||||
{
|
||||
if (filename.Contains("|") || OSTailoredCode.IsUnixHost ||
|
||||
!".lnk".Equals(Path.GetExtension(filename), StringComparison.OrdinalIgnoreCase))
|
||||
if (OSTailoredCode.IsUnixHost || filename.Contains("|")
|
||||
|| !".lnk".Equals(Path.GetExtension(filename), StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return filename; // archive internal files are never shortcuts (and choke when analyzing any further)
|
||||
return filename; // archive internal files are never shortcuts (and choke when analyzing any further)
|
||||
}
|
||||
|
||||
using var link = new ShellLinkImports.ShellLink();
|
||||
|
|
|
@ -1944,10 +1944,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
DumpStatusButton.ToolTipText = "Verified good dump";
|
||||
}
|
||||
|
||||
if (_multiDiskMode && !(
|
||||
Game.Status == RomStatus.Imperfect ||
|
||||
Game.Status == RomStatus.Unimplemented ||
|
||||
Game.Status == RomStatus.NotWorking))
|
||||
if (_multiDiskMode
|
||||
&& Game.Status is not (RomStatus.Imperfect or RomStatus.Unimplemented or RomStatus.NotWorking))
|
||||
{
|
||||
DumpStatusButton.ToolTipText = "Multi-disk bundler";
|
||||
DumpStatusButton.Image = Properties.Resources.RetroQuestion;
|
||||
|
@ -3264,32 +3262,21 @@ namespace BizHawk.Client.EmuHawk
|
|||
CalcFramerateAndUpdateDisplay(currentTimestamp, isRewinding, isFastForwarding);
|
||||
}
|
||||
|
||||
if (Tools.IsLoaded<TAStudio>() &&
|
||||
Tools.TAStudio.LastPositionFrame == Emulator.Frame)
|
||||
if (IsSeeking && PauseOnFrame.Value <= Emulator.Frame)
|
||||
{
|
||||
if (PauseOnFrame.HasValue &&
|
||||
PauseOnFrame.Value <= Tools.TAStudio.LastPositionFrame)
|
||||
if (PauseOnFrame.Value == Emulator.Frame)
|
||||
{
|
||||
var record = (MovieSession.Movie as ITasMovie)[Emulator.Frame];
|
||||
if (!record.Lagged.HasValue && IsSeeking)
|
||||
{
|
||||
// haven't yet greenzoned the frame, hence it's after editing
|
||||
// then we want to pause here. taseditor fashion
|
||||
PauseEmulator();
|
||||
}
|
||||
PauseEmulator();
|
||||
if (Tools.IsLoaded<TAStudio>()) Tools.TAStudio.StopSeeking();
|
||||
else PauseOnFrame = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (IsSeeking && Emulator.Frame == PauseOnFrame.Value)
|
||||
{
|
||||
PauseEmulator();
|
||||
if (Tools.IsLoaded<TAStudio>())
|
||||
else if (Tools.IsLoaded<TAStudio>()
|
||||
&& Tools.TAStudio.LastPositionFrame == Emulator.Frame
|
||||
&& ((ITasMovie) MovieSession.Movie)[Emulator.Frame].Lagged is null)
|
||||
{
|
||||
Tools.TAStudio.StopSeeking();
|
||||
}
|
||||
else
|
||||
{
|
||||
PauseOnFrame = null;
|
||||
// haven't yet greenzoned the frame, hence it's after editing
|
||||
// then we want to pause here. taseditor fashion
|
||||
PauseEmulator();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,10 +48,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void OkBtn_Click(object sender, EventArgs e)
|
||||
{
|
||||
bool changed =
|
||||
_settings.OSDMessageVerbosity.ToString() != osdMessageVerbositycomboBox1.SelectedItem.ToString() ||
|
||||
_settings.BackgroundColor != _bgColor ||
|
||||
_settings.UseCoreBorderForBackground != checkBoxShowCoreBrdColor.Checked;
|
||||
var changed = checkBoxShowCoreBrdColor.Checked != _settings.UseCoreBorderForBackground
|
||||
|| _bgColor != _settings.BackgroundColor
|
||||
|| osdMessageVerbositycomboBox1.SelectedItem.ToString() != _settings.OSDMessageVerbosity.ToString();
|
||||
|
||||
if (changed)
|
||||
{
|
||||
|
|
|
@ -595,15 +595,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
_config.TurboSeek = TurboCheckbox.Checked;
|
||||
Run();
|
||||
_movieSession.ReadOnly = ReadOnlyCheckBox.Checked;
|
||||
|
||||
if (StopOnFrameCheckbox.Checked &&
|
||||
(StopOnFrameTextBox.ToRawInt().HasValue || LastFrameCheckbox.Checked))
|
||||
if (StopOnFrameCheckbox.Checked)
|
||||
{
|
||||
_mainForm.PauseOnFrame = LastFrameCheckbox.Checked
|
||||
? _movieSession.Movie.InputLogLength
|
||||
: StopOnFrameTextBox.ToRawInt();
|
||||
if (LastFrameCheckbox.Checked) _mainForm.PauseOnFrame = _movieSession.Movie.InputLogLength;
|
||||
else if (StopOnFrameTextBox.ToRawInt() is int i) _mainForm.PauseOnFrame = i;
|
||||
}
|
||||
|
||||
Close();
|
||||
}
|
||||
|
||||
|
|
|
@ -94,12 +94,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
foreach (var callback in Mcs)
|
||||
{
|
||||
if (!_breakpoints.Any(b =>
|
||||
b.Type == callback.Type &&
|
||||
b.Address == callback.Address &&
|
||||
b.AddressMask == callback.AddressMask &&
|
||||
b.Name == callback.Name &&
|
||||
b.Callback == callback.Callback))
|
||||
if (!_breakpoints.Any(b => b.Type == callback.Type
|
||||
&& b.Address == callback.Address
|
||||
&& b.AddressMask == callback.AddressMask
|
||||
&& b.Name == callback.Name
|
||||
&& b.Callback == callback.Callback))
|
||||
{
|
||||
_breakpoints.Add(new Breakpoint(Core, callback));
|
||||
}
|
||||
|
|
|
@ -906,9 +906,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
if (_secondaryHighlightedAddresses.Any())
|
||||
{
|
||||
MainForm.CheatList.RemoveRange(
|
||||
MainForm.CheatList.Where(
|
||||
cheat => !cheat.IsSeparator && cheat.Domain == _domain &&
|
||||
_secondaryHighlightedAddresses.Contains(cheat.Address ?? 0)));
|
||||
MainForm.CheatList.Where(cheat => !cheat.IsSeparator && cheat.Domain == _domain
|
||||
&& _secondaryHighlightedAddresses.Contains(cheat.Address ?? 0)));
|
||||
}
|
||||
|
||||
MemoryViewerBox.Refresh();
|
||||
|
@ -1539,10 +1538,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
AddToRamWatchMenuItem.Enabled =
|
||||
_highlightedAddress.HasValue;
|
||||
|
||||
PokeAddressMenuItem.Enabled =
|
||||
FreezeAddressMenuItem.Enabled =
|
||||
_highlightedAddress.HasValue &&
|
||||
_domain.Writable;
|
||||
PokeAddressMenuItem.Enabled = FreezeAddressMenuItem.Enabled
|
||||
= _highlightedAddress is not null && _domain.Writable;
|
||||
}
|
||||
|
||||
private void MemoryDomainsMenuItem_DropDownOpened(object sender, EventArgs e)
|
||||
|
@ -1966,25 +1963,19 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
var data = Clipboard.GetDataObject();
|
||||
|
||||
CopyContextItem.Visible =
|
||||
AddToRamWatchContextItem.Visible =
|
||||
_highlightedAddress.HasValue || _secondaryHighlightedAddresses.Any();
|
||||
var selectionNotEmpty = _highlightedAddress is not null || _secondaryHighlightedAddresses.Any();
|
||||
CopyContextItem.Visible = AddToRamWatchContextItem.Visible = selectionNotEmpty;
|
||||
|
||||
FreezeContextItem.Visible =
|
||||
PokeContextItem.Visible =
|
||||
IncrementContextItem.Visible =
|
||||
DecrementContextItem.Visible =
|
||||
ContextSeparator2.Visible =
|
||||
(_highlightedAddress.HasValue || _secondaryHighlightedAddresses.Any()) &&
|
||||
_domain.Writable;
|
||||
FreezeContextItem.Visible = PokeContextItem.Visible
|
||||
= IncrementContextItem.Visible
|
||||
= DecrementContextItem.Visible
|
||||
= ContextSeparator2.Visible
|
||||
= selectionNotEmpty && _domain.Writable;
|
||||
|
||||
UnfreezeAllContextItem.Visible = MainForm.CheatList.AnyActive;
|
||||
PasteContextItem.Visible = _domain.Writable && data != null && data.GetDataPresent(DataFormats.Text);
|
||||
|
||||
ContextSeparator1.Visible =
|
||||
_highlightedAddress.HasValue ||
|
||||
_secondaryHighlightedAddresses.Any() ||
|
||||
(data != null && data.GetDataPresent(DataFormats.Text));
|
||||
ContextSeparator1.Visible = selectionNotEmpty || data?.GetDataPresent(DataFormats.Text) is true;
|
||||
|
||||
if (_highlightedAddress.HasValue && IsFrozen(_highlightedAddress.Value))
|
||||
{
|
||||
|
|
|
@ -50,8 +50,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void PathBox_DragEnter(object sender, DragEventArgs e)
|
||||
{
|
||||
if (e.Data.GetDataPresent(DataFormats.FileDrop) &&
|
||||
((string[])e.Data.GetData(DataFormats.FileDrop)).Length == 1)
|
||||
if (e.Data.GetDataPresent(DataFormats.FileDrop)
|
||||
&& ((string[]) e.Data.GetData(DataFormats.FileDrop)).Length is 1)
|
||||
{
|
||||
e.Effect = DragDropEffects.Copy;
|
||||
}
|
||||
|
|
|
@ -142,10 +142,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
|
||||
// Highlight the branch cell a little, if hovering over it
|
||||
if (BranchView.CurrentCell.IsDataCell()
|
||||
&& BranchView.CurrentCell.Column.Name == BranchNumberColumnName &&
|
||||
column.Name == BranchNumberColumnName &&
|
||||
index == BranchView.CurrentCell.RowIndex)
|
||||
if (BranchView.CurrentCell is { RowIndex: int targetRow, Column.Name: BranchNumberColumnName }
|
||||
&& index == targetRow && column.Name is BranchNumberColumnName)
|
||||
{
|
||||
color = Color.FromArgb((byte)(color.A - 24), (byte)(color.R - 24), (byte)(color.G - 24), (byte)(color.B - 24));
|
||||
}
|
||||
|
@ -676,11 +674,10 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
if (e.NewCell?.RowIndex != null && e.NewCell.Column != null && e.NewCell.RowIndex < Branches.Count)
|
||||
{
|
||||
if (BranchView.CurrentCell.Column.Name == BranchNumberColumnName &&
|
||||
BranchView.CurrentCell.RowIndex.HasValue &&
|
||||
BranchView.CurrentCell.RowIndex < Branches.Count)
|
||||
if (BranchView.CurrentCell is { RowIndex: int targetRow, Column.Name: BranchNumberColumnName }
|
||||
&& targetRow < Branches.Count)
|
||||
{
|
||||
var branch = Branches[BranchView.CurrentCell.RowIndex.Value];
|
||||
var branch = Branches[targetRow];
|
||||
Point location = PointToScreen(Location);
|
||||
int width = branch.OSDFrameBuffer.Width;
|
||||
int height = branch.OSDFrameBuffer.Height;
|
||||
|
|
|
@ -915,9 +915,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
if (e.Button == MouseButtons.Left)
|
||||
{
|
||||
if (TasView.CurrentCell.RowIndex.HasValue &&
|
||||
TasView.CurrentCell.Column.Name == FrameColumnName &&
|
||||
!AxisEditingMode)
|
||||
if (!AxisEditingMode && TasView.CurrentCell is { RowIndex: not null, Column.Name: FrameColumnName })
|
||||
{
|
||||
var existingMarker = CurrentTasMovie.Markers.FirstOrDefault(m => m.Frame == TasView.CurrentCell.RowIndex.Value);
|
||||
|
||||
|
|
|
@ -22,9 +22,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void FileSubMenu_DropDownOpened(object sender, EventArgs e)
|
||||
{
|
||||
ToBk2MenuItem.Enabled =
|
||||
!string.IsNullOrWhiteSpace(CurrentTasMovie.Filename) &&
|
||||
(CurrentTasMovie.Filename != DefaultTasProjName());
|
||||
ToBk2MenuItem.Enabled = !string.IsNullOrWhiteSpace(CurrentTasMovie.Filename)
|
||||
&& CurrentTasMovie.Filename != DefaultTasProjName();
|
||||
|
||||
saveSelectionToMacroToolStripMenuItem.Enabled =
|
||||
placeMacroAtSelectionToolStripMenuItem.Enabled =
|
||||
|
|
|
@ -1137,13 +1137,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
MoveBottomContextMenuItem.Visible =
|
||||
WatchListView.AnyRowsSelected;
|
||||
|
||||
ReadBreakpointContextMenuItem.Visible =
|
||||
WriteBreakpointContextMenuItem.Visible =
|
||||
Separator6.Visible =
|
||||
SelectedWatches.Any() &&
|
||||
Debuggable != null &&
|
||||
Debuggable.MemoryCallbacksAvailable() &&
|
||||
SelectedWatches.All(w => w.Domain.Name == (MemoryDomains != null ? MemoryDomains.SystemBus.Name : ""));
|
||||
var sysBusName = MemoryDomains?.SystemBus?.Name ?? string.Empty;
|
||||
ReadBreakpointContextMenuItem.Visible = WriteBreakpointContextMenuItem.Visible
|
||||
= Separator6.Visible
|
||||
= Debuggable?.MemoryCallbacksAvailable() is true
|
||||
&& SelectedWatches.Any() && SelectedWatches.All(w => w.Domain.Name == sysBusName);
|
||||
|
||||
SplitContextMenuItem.Enabled = MaySplitAllSelected;
|
||||
|
||||
|
|
Loading…
Reference in New Issue