mirror of
https://github.com/ppy/osu.git
synced 2024-11-14 15:17:27 +08:00
Add missing verbatim string markers
This commit is contained in:
parent
32817a4c66
commit
6b250955d7
@ -199,7 +199,7 @@ namespace osu.Game.Tests.Skins.IO
|
|||||||
return zipStream;
|
return zipStream;
|
||||||
}
|
}
|
||||||
|
|
||||||
private MemoryStream createOskWithIni(string name, string author, bool makeUnique = false, string iniFilename = "skin.ini")
|
private MemoryStream createOskWithIni(string name, string author, bool makeUnique = false, string iniFilename = @"skin.ini")
|
||||||
{
|
{
|
||||||
var zipStream = new MemoryStream();
|
var zipStream = new MemoryStream();
|
||||||
using var zip = ZipArchive.Create();
|
using var zip = ZipArchive.Create();
|
||||||
|
@ -108,7 +108,7 @@ namespace osu.Game.Skinning
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool ShouldDeleteArchive(string path) => Path.GetExtension(path)?.ToLowerInvariant() == ".osk";
|
protected override bool ShouldDeleteArchive(string path) => Path.GetExtension(path)?.ToLowerInvariant() == @".osk";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns a list of all usable <see cref="SkinInfo"/>s. Includes the special default skin plus all skins from <see cref="GetAllUserSkins"/>.
|
/// Returns a list of all usable <see cref="SkinInfo"/>s. Includes the special default skin plus all skins from <see cref="GetAllUserSkins"/>.
|
||||||
@ -149,9 +149,9 @@ namespace osu.Game.Skinning
|
|||||||
CurrentSkinInfo.Value = ModelStore.ConsumableItems.Single(i => i.ID == chosen.ID);
|
CurrentSkinInfo.Value = ModelStore.ConsumableItems.Single(i => i.ID == chosen.ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override SkinInfo CreateModel(ArchiveReader archive) => new SkinInfo { Name = archive.Name ?? "No name" };
|
protected override SkinInfo CreateModel(ArchiveReader archive) => new SkinInfo { Name = archive.Name ?? @"No name" };
|
||||||
|
|
||||||
private const string unknown_creator_string = "Unknown";
|
private const string unknown_creator_string = @"Unknown";
|
||||||
|
|
||||||
protected override bool HasCustomHashFunction => true;
|
protected override bool HasCustomHashFunction => true;
|
||||||
|
|
||||||
@ -164,7 +164,7 @@ namespace osu.Game.Skinning
|
|||||||
// `Skin` will parse the skin.ini and populate `Skin.Configuration` during construction above.
|
// `Skin` will parse the skin.ini and populate `Skin.Configuration` during construction above.
|
||||||
string skinIniSourcedName = instance.Configuration.SkinInfo.Name;
|
string skinIniSourcedName = instance.Configuration.SkinInfo.Name;
|
||||||
string skinIniSourcedCreator = instance.Configuration.SkinInfo.Creator;
|
string skinIniSourcedCreator = instance.Configuration.SkinInfo.Creator;
|
||||||
string archiveName = item.Name.Replace(".osk", "", StringComparison.OrdinalIgnoreCase);
|
string archiveName = item.Name.Replace(@".osk", string.Empty, StringComparison.OrdinalIgnoreCase);
|
||||||
|
|
||||||
bool isImport = item.ID == 0;
|
bool isImport = item.ID == 0;
|
||||||
|
|
||||||
@ -177,7 +177,7 @@ namespace osu.Game.Skinning
|
|||||||
// In an ideal world, skin.ini would be the only source of metadata, but a lot of skin creators and users don't update it when making modifications.
|
// In an ideal world, skin.ini would be the only source of metadata, but a lot of skin creators and users don't update it when making modifications.
|
||||||
// In both of these cases, the expectation from the user is that the filename or folder name is displayed somewhere to identify the skin.
|
// In both of these cases, the expectation from the user is that the filename or folder name is displayed somewhere to identify the skin.
|
||||||
if (archiveName != item.Name)
|
if (archiveName != item.Name)
|
||||||
item.Name = $"{item.Name} [{archiveName}]";
|
item.Name = @$"{item.Name} [{archiveName}]";
|
||||||
}
|
}
|
||||||
|
|
||||||
// By this point, the metadata in SkinInfo will be correct.
|
// By this point, the metadata in SkinInfo will be correct.
|
||||||
@ -191,8 +191,8 @@ namespace osu.Game.Skinning
|
|||||||
|
|
||||||
private void updateSkinIniMetadata(SkinInfo item)
|
private void updateSkinIniMetadata(SkinInfo item)
|
||||||
{
|
{
|
||||||
string nameLine = $"Name: {item.Name}";
|
string nameLine = @$"Name: {item.Name}";
|
||||||
string authorLine = $"Author: {item.Creator}";
|
string authorLine = @$"Author: {item.Creator}";
|
||||||
|
|
||||||
var existingFile = item.Files.SingleOrDefault(f => f.Filename.Equals(@"skin.ini", StringComparison.OrdinalIgnoreCase));
|
var existingFile = item.Files.SingleOrDefault(f => f.Filename.Equals(@"skin.ini", StringComparison.OrdinalIgnoreCase));
|
||||||
|
|
||||||
@ -210,12 +210,12 @@ namespace osu.Game.Skinning
|
|||||||
|
|
||||||
while ((line = sr.ReadLine()) != null)
|
while ((line = sr.ReadLine()) != null)
|
||||||
{
|
{
|
||||||
if (line.StartsWith("Name:", StringComparison.Ordinal))
|
if (line.StartsWith(@"Name:", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
outputLines.Add(nameLine);
|
outputLines.Add(nameLine);
|
||||||
addedName = true;
|
addedName = true;
|
||||||
}
|
}
|
||||||
else if (line.StartsWith("Author:", StringComparison.Ordinal))
|
else if (line.StartsWith(@"Author:", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
outputLines.Add(authorLine);
|
outputLines.Add(authorLine);
|
||||||
addedAuthor = true;
|
addedAuthor = true;
|
||||||
@ -229,7 +229,7 @@ namespace osu.Game.Skinning
|
|||||||
{
|
{
|
||||||
outputLines.AddRange(new[]
|
outputLines.AddRange(new[]
|
||||||
{
|
{
|
||||||
"[General]",
|
@"[General]",
|
||||||
nameLine,
|
nameLine,
|
||||||
authorLine,
|
authorLine,
|
||||||
});
|
});
|
||||||
@ -252,13 +252,13 @@ namespace osu.Game.Skinning
|
|||||||
{
|
{
|
||||||
using (var sw = new StreamWriter(stream, Encoding.UTF8, 1024, true))
|
using (var sw = new StreamWriter(stream, Encoding.UTF8, 1024, true))
|
||||||
{
|
{
|
||||||
sw.WriteLine("[General]");
|
sw.WriteLine(@"[General]");
|
||||||
sw.WriteLine(nameLine);
|
sw.WriteLine(nameLine);
|
||||||
sw.WriteLine(authorLine);
|
sw.WriteLine(authorLine);
|
||||||
sw.WriteLine("Version: latest");
|
sw.WriteLine(@"Version: latest");
|
||||||
}
|
}
|
||||||
|
|
||||||
AddFile(item, stream, "skin.ini");
|
AddFile(item, stream, @"skin.ini");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -295,7 +295,7 @@ namespace osu.Game.Skinning
|
|||||||
// if the user is attempting to save one of the default skin implementations, create a copy first.
|
// if the user is attempting to save one of the default skin implementations, create a copy first.
|
||||||
CurrentSkinInfo.Value = Import(new SkinInfo
|
CurrentSkinInfo.Value = Import(new SkinInfo
|
||||||
{
|
{
|
||||||
Name = skin.SkinInfo.Name + " (modified)",
|
Name = skin.SkinInfo.Name + @" (modified)",
|
||||||
Creator = skin.SkinInfo.Creator,
|
Creator = skin.SkinInfo.Creator,
|
||||||
InstantiationInfo = skin.SkinInfo.InstantiationInfo,
|
InstantiationInfo = skin.SkinInfo.InstantiationInfo,
|
||||||
}).Result.Value;
|
}).Result.Value;
|
||||||
@ -312,7 +312,7 @@ namespace osu.Game.Skinning
|
|||||||
|
|
||||||
using (var streamContent = new MemoryStream(Encoding.UTF8.GetBytes(json)))
|
using (var streamContent = new MemoryStream(Encoding.UTF8.GetBytes(json)))
|
||||||
{
|
{
|
||||||
string filename = $"{drawableInfo.Key}.json";
|
string filename = @$"{drawableInfo.Key}.json";
|
||||||
|
|
||||||
var oldFile = skin.SkinInfo.Files.FirstOrDefault(f => f.Filename == filename);
|
var oldFile = skin.SkinInfo.Files.FirstOrDefault(f => f.Filename == filename);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user