Switch to `string.Replace(char, char)` and `string.LastIndexOf(char)`
This commit is contained in:
parent
0067dd4b0a
commit
504ba590b1
src
BizHawk.Client.Common/movie/bk2
BizHawk.Client.EmuHawk
BizHawk.Emulation.Common/vpads_schemata
|
@ -23,7 +23,7 @@ namespace BizHawk.Client.Common
|
|||
}
|
||||
|
||||
var backupName = Filename;
|
||||
backupName = backupName.Insert(Filename.LastIndexOf(".", StringComparison.Ordinal), $".{DateTime.Now:yyyy-MM-dd HH.mm.ss}");
|
||||
backupName = backupName.Insert(Filename.LastIndexOf('.'), $".{DateTime.Now:yyyy-MM-dd HH.mm.ss}");
|
||||
backupName = Path.Combine(Session.BackupDirectory, Path.GetFileName(backupName));
|
||||
|
||||
Write(backupName, isBackup: true);
|
||||
|
|
|
@ -791,7 +791,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
OSTailoredCode.WindowsVersion._11 => null,
|
||||
OSTailoredCode.WindowsVersion._10 when win10PlusVersion! < new Version(10, 0, 19044) => $"Quick reminder: Your copy of Windows 10 (build {win10PlusVersion.Build}) is no longer supported by Microsoft.\nEmuHawk will probably continue working, but please update to at least 21H2 for increased security.",
|
||||
OSTailoredCode.WindowsVersion._10 => null,
|
||||
_ => $"Quick reminder: Windows {winVersion.ToString().RemovePrefix('_').Replace("_", ".")} is no longer supported by Microsoft.\nEmuHawk will probably continue working, but please get a new operating system for increased security (either Windows 10+ or a GNU+Linux distro)."
|
||||
_ => $"Quick reminder: Windows {winVersion.ToString().RemovePrefix('_').Replace('_', '.')} is no longer supported by Microsoft.\nEmuHawk will probably continue working, but please get a new operating system for increased security (either Windows 10+ or a GNU+Linux distro)."
|
||||
};
|
||||
if (message is not null)
|
||||
{
|
||||
|
|
|
@ -101,7 +101,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
_inputManager.StickyXorAdapter,
|
||||
name,
|
||||
RangeX,
|
||||
!string.IsNullOrEmpty(secondaryName) ? secondaryName : Name.Replace("X", "Y"),
|
||||
string.IsNullOrEmpty(secondaryName) ? Name.Replace('X', 'Y') : secondaryName,
|
||||
RangeY
|
||||
);
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@ namespace BizHawk.Emulation.Common
|
|||
|
||||
public AnalogSchema(int x, int y, string nameX)
|
||||
: base(new Point(x, y), nameX)
|
||||
=> SecondaryName = nameX.Replace("X", "Y");
|
||||
=> SecondaryName = nameX.Replace('X', 'Y');
|
||||
}
|
||||
|
||||
/// <summary>An (X, Y) pair intended to be a screen coordinate (for zappers, mouse, stylus, etc.)</summary>
|
||||
|
@ -111,9 +111,7 @@ namespace BizHawk.Emulation.Common
|
|||
/// <remarks>Using this ctor, the valid ranges for the X and Y axes are taken to be <c>(0..TargetSize.Width)</c> and <c>(0..TargetSize.Height)</c>.</remarks>
|
||||
public TargetedPairSchema(int x, int y, string nameX)
|
||||
: base(new Point(x, y), nameX)
|
||||
{
|
||||
SecondaryName = nameX.Replace("X", "Y");
|
||||
}
|
||||
=> SecondaryName = nameX.Replace('X', 'Y');
|
||||
|
||||
/// <remarks>Using this ctor, the valid ranges for the X and Y axes are taken to be <c>(0..maxX)</c> and <c>(0..maxY)</c>.</remarks>
|
||||
public TargetedPairSchema(int x, int y, string nameX, int maxX, int maxY)
|
||||
|
|
Loading…
Reference in New Issue