mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 10:17:22 +01:00
Fix IDE0300: Use collection expression for array
This commit is contained in:
parent
53914e06d5
commit
4895ee2efc
78 changed files with 159 additions and 163 deletions
|
|
@ -37,7 +37,7 @@ internal class JobGauges : IServiceType, IJobGauges
|
|||
// Since the gauge itself reads from live memory, there isn't much downside to doing this.
|
||||
if (!this.cache.TryGetValue(typeof(T), out var gauge))
|
||||
{
|
||||
gauge = this.cache[typeof(T)] = (T)Activator.CreateInstance(typeof(T), BindingFlags.NonPublic | BindingFlags.Instance, null, new object[] { this.Address }, null);
|
||||
gauge = this.cache[typeof(T)] = (T)Activator.CreateInstance(typeof(T), BindingFlags.NonPublic | BindingFlags.Instance, null, [this.Address], null);
|
||||
}
|
||||
|
||||
return (T)gauge;
|
||||
|
|
|
|||
|
|
@ -82,12 +82,12 @@ public unsafe class BRDGauge : JobGaugeBase<FFXIVClientStructs.FFXIV.Client.Game
|
|||
{
|
||||
get
|
||||
{
|
||||
return new[]
|
||||
{
|
||||
return
|
||||
[
|
||||
this.Struct->SongFlags.HasFlag(SongFlags.MagesBalladCoda) ? Song.Mage : Song.None,
|
||||
this.Struct->SongFlags.HasFlag(SongFlags.ArmysPaeonCoda) ? Song.Army : Song.None,
|
||||
this.Struct->SongFlags.HasFlag(SongFlags.WanderersMinuetCoda) ? Song.Wanderer : Song.None,
|
||||
};
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -212,11 +212,10 @@ internal sealed class Framework : IInternalDisposableService, IFramework
|
|||
if (cancellationToken == default)
|
||||
cancellationToken = this.FrameworkThreadTaskFactory.CancellationToken;
|
||||
return this.FrameworkThreadTaskFactory.ContinueWhenAll(
|
||||
new[]
|
||||
{
|
||||
[
|
||||
Task.Delay(delay, cancellationToken),
|
||||
this.DelayTicks(delayTicks, cancellationToken),
|
||||
},
|
||||
],
|
||||
_ => func(),
|
||||
cancellationToken,
|
||||
TaskContinuationOptions.HideScheduler,
|
||||
|
|
@ -239,11 +238,10 @@ internal sealed class Framework : IInternalDisposableService, IFramework
|
|||
if (cancellationToken == default)
|
||||
cancellationToken = this.FrameworkThreadTaskFactory.CancellationToken;
|
||||
return this.FrameworkThreadTaskFactory.ContinueWhenAll(
|
||||
new[]
|
||||
{
|
||||
[
|
||||
Task.Delay(delay, cancellationToken),
|
||||
this.DelayTicks(delayTicks, cancellationToken),
|
||||
},
|
||||
],
|
||||
_ => action(),
|
||||
cancellationToken,
|
||||
TaskContinuationOptions.HideScheduler,
|
||||
|
|
@ -266,11 +264,10 @@ internal sealed class Framework : IInternalDisposableService, IFramework
|
|||
if (cancellationToken == default)
|
||||
cancellationToken = this.FrameworkThreadTaskFactory.CancellationToken;
|
||||
return this.FrameworkThreadTaskFactory.ContinueWhenAll(
|
||||
new[]
|
||||
{
|
||||
[
|
||||
Task.Delay(delay, cancellationToken),
|
||||
this.DelayTicks(delayTicks, cancellationToken),
|
||||
},
|
||||
],
|
||||
_ => func(),
|
||||
cancellationToken,
|
||||
TaskContinuationOptions.HideScheduler,
|
||||
|
|
@ -293,11 +290,10 @@ internal sealed class Framework : IInternalDisposableService, IFramework
|
|||
if (cancellationToken == default)
|
||||
cancellationToken = this.FrameworkThreadTaskFactory.CancellationToken;
|
||||
return this.FrameworkThreadTaskFactory.ContinueWhenAll(
|
||||
new[]
|
||||
{
|
||||
[
|
||||
Task.Delay(delay, cancellationToken),
|
||||
this.DelayTicks(delayTicks, cancellationToken),
|
||||
},
|
||||
],
|
||||
_ => func(),
|
||||
cancellationToken,
|
||||
TaskContinuationOptions.HideScheduler,
|
||||
|
|
|
|||
|
|
@ -381,7 +381,7 @@ public abstract partial class Payload
|
|||
{
|
||||
if (value < 0xCF)
|
||||
{
|
||||
return new byte[] { (byte)(value + 1) };
|
||||
return [(byte)(value + 1)];
|
||||
}
|
||||
|
||||
var bytes = BitConverter.GetBytes(value);
|
||||
|
|
|
|||
|
|
@ -45,10 +45,10 @@ public class IconPayload : Payload
|
|||
{
|
||||
var indexBytes = MakeInteger((uint)this.Icon);
|
||||
var chunkLen = indexBytes.Length + 1;
|
||||
var bytes = new List<byte>(new byte[]
|
||||
{
|
||||
var bytes = new List<byte>(
|
||||
[
|
||||
START_BYTE, (byte)SeStringChunkType.Icon, (byte)chunkLen,
|
||||
});
|
||||
]);
|
||||
bytes.AddRange(indexBytes);
|
||||
bytes.Add(END_BYTE);
|
||||
return bytes.ToArray();
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ public class ItemPayload : Payload
|
|||
};
|
||||
bytes.AddRange(idBytes);
|
||||
// unk
|
||||
bytes.AddRange(new byte[] { 0x02, 0x01 });
|
||||
bytes.AddRange([0x02, 0x01]);
|
||||
|
||||
// Links don't have to include the name, but if they do, it requires additional work
|
||||
if (hasName)
|
||||
|
|
@ -183,17 +183,17 @@ public class ItemPayload : Payload
|
|||
nameLen += 4; // space plus 3 bytes for HQ symbol
|
||||
}
|
||||
|
||||
bytes.AddRange(new byte[]
|
||||
{
|
||||
bytes.AddRange(
|
||||
[
|
||||
0xFF, // unk
|
||||
(byte)nameLen,
|
||||
});
|
||||
]);
|
||||
bytes.AddRange(Encoding.UTF8.GetBytes(this.displayName));
|
||||
|
||||
if (this.IsHQ)
|
||||
{
|
||||
// space and HQ symbol
|
||||
bytes.AddRange(new byte[] { 0x20, 0xEE, 0x80, 0xBC });
|
||||
bytes.AddRange([0x20, 0xEE, 0x80, 0xBC]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ public class MapLinkPayload : Payload
|
|||
bytes.AddRange(yBytes);
|
||||
|
||||
// unk
|
||||
bytes.AddRange(new byte[] { 0xFF, 0x01, END_BYTE });
|
||||
bytes.AddRange([0xFF, 0x01, END_BYTE]);
|
||||
|
||||
return bytes.ToArray();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ namespace Dalamud.Game.Text.SeStringHandling.Payloads;
|
|||
/// </summary>
|
||||
public class NewLinePayload : Payload, ITextProvider
|
||||
{
|
||||
private readonly byte[] bytes = { START_BYTE, (byte)SeStringChunkType.NewLine, 0x01, END_BYTE };
|
||||
private readonly byte[] bytes = [START_BYTE, (byte)SeStringChunkType.NewLine, 0x01, END_BYTE];
|
||||
|
||||
/// <summary>
|
||||
/// Gets an instance of NewLinePayload.
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ namespace Dalamud.Game.Text.SeStringHandling.Payloads
|
|||
// if the link type is notification, just use premade payload data since it's always the same.
|
||||
// i have no idea why it is formatted like this, but it is how it is.
|
||||
// note it is identical to the link terminator payload except the embedded info type is 0x08
|
||||
if (this.LinkType == PartyFinderLinkType.PartyFinderNotification) return new byte[] { 0x02, 0x27, 0x07, 0x08, 0x01, 0x01, 0x01, 0xFF, 0x01, 0x03, };
|
||||
if (this.LinkType == PartyFinderLinkType.PartyFinderNotification) return [0x02, 0x27, 0x07, 0x08, 0x01, 0x01, 0x01, 0xFF, 0x01, 0x03,];
|
||||
|
||||
// back to our regularly scheduled programming...
|
||||
var listingIDBytes = MakeInteger(this.ListingId);
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ public class QuestPayload : Payload
|
|||
};
|
||||
|
||||
bytes.AddRange(idBytes);
|
||||
bytes.AddRange(new byte[] { 0x01, 0x01, END_BYTE });
|
||||
bytes.AddRange([0x01, 0x01, END_BYTE]);
|
||||
return bytes.ToArray();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ public class RawPayload : Payload
|
|||
/// <summary>
|
||||
/// Gets a fixed Payload representing a common link-termination sequence, found in many payload chains.
|
||||
/// </summary>
|
||||
public static RawPayload LinkTerminator => new(new byte[] { 0x02, 0x27, 0x07, 0xCF, 0x01, 0x01, 0x01, 0xFF, 0x01, 0x03 });
|
||||
public static RawPayload LinkTerminator => new([0x02, 0x27, 0x07, 0xCF, 0x01, 0x01, 0x01, 0xFF, 0x01, 0x03]);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override PayloadType Type => PayloadType.Unknown;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ namespace Dalamud.Game.Text.SeStringHandling.Payloads;
|
|||
/// </summary>
|
||||
public class SeHyphenPayload : Payload, ITextProvider
|
||||
{
|
||||
private readonly byte[] bytes = { START_BYTE, (byte)SeStringChunkType.SeHyphen, 0x01, END_BYTE };
|
||||
private readonly byte[] bytes = [START_BYTE, (byte)SeStringChunkType.SeHyphen, 0x01, END_BYTE];
|
||||
|
||||
/// <summary>
|
||||
/// Gets an instance of SeHyphenPayload.
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ public class StatusPayload : Payload
|
|||
|
||||
bytes.AddRange(idBytes);
|
||||
// unk
|
||||
bytes.AddRange(new byte[] { 0x01, 0x01, 0xFF, 0x02, 0x20, END_BYTE });
|
||||
bytes.AddRange([0x01, 0x01, 0xFF, 0x02, 0x20, END_BYTE]);
|
||||
|
||||
return bytes.ToArray();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,10 +95,10 @@ public class UIForegroundPayload : Payload
|
|||
var colorBytes = MakeInteger(this.colorKey);
|
||||
var chunkLen = colorBytes.Length + 1;
|
||||
|
||||
var bytes = new List<byte>(new byte[]
|
||||
{
|
||||
var bytes = new List<byte>(
|
||||
[
|
||||
START_BYTE, (byte)SeStringChunkType.UIForeground, (byte)chunkLen,
|
||||
});
|
||||
]);
|
||||
|
||||
bytes.AddRange(colorBytes);
|
||||
bytes.Add(END_BYTE);
|
||||
|
|
|
|||
|
|
@ -98,10 +98,10 @@ public class UIGlowPayload : Payload
|
|||
var colorBytes = MakeInteger(this.colorKey);
|
||||
var chunkLen = colorBytes.Length + 1;
|
||||
|
||||
var bytes = new List<byte>(new byte[]
|
||||
{
|
||||
var bytes = new List<byte>(
|
||||
[
|
||||
START_BYTE, (byte)SeStringChunkType.UIGlow, (byte)chunkLen,
|
||||
});
|
||||
]);
|
||||
|
||||
bytes.AddRange(colorBytes);
|
||||
bytes.Add(END_BYTE);
|
||||
|
|
|
|||
|
|
@ -258,13 +258,13 @@ public class SeString
|
|||
var mapPayload = new MapLinkPayload(territoryId, mapId, rawX, rawY);
|
||||
var nameString = GetMapLinkNameString(mapPayload.PlaceName, instance, mapPayload.CoordinateString);
|
||||
|
||||
var payloads = new List<Payload>(new Payload[]
|
||||
{
|
||||
var payloads = new List<Payload>(
|
||||
[
|
||||
mapPayload,
|
||||
// arrow goes here
|
||||
new TextPayload(nameString),
|
||||
RawPayload.LinkTerminator,
|
||||
});
|
||||
]);
|
||||
payloads.InsertRange(1, TextArrowPayloads);
|
||||
|
||||
return new SeString(payloads);
|
||||
|
|
@ -298,13 +298,13 @@ public class SeString
|
|||
var mapPayload = new MapLinkPayload(territoryId, mapId, xCoord, yCoord, fudgeFactor);
|
||||
var nameString = GetMapLinkNameString(mapPayload.PlaceName, instance, mapPayload.CoordinateString);
|
||||
|
||||
var payloads = new List<Payload>(new Payload[]
|
||||
{
|
||||
var payloads = new List<Payload>(
|
||||
[
|
||||
mapPayload,
|
||||
// arrow goes here
|
||||
new TextPayload(nameString),
|
||||
RawPayload.LinkTerminator,
|
||||
});
|
||||
]);
|
||||
payloads.InsertRange(1, TextArrowPayloads);
|
||||
|
||||
return new SeString(payloads);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Dalamud.Utility;
|
||||
|
||||
|
|
@ -37,7 +37,7 @@ public static class FontAwesomeExtensions
|
|||
public static IEnumerable<string> GetSearchTerms(this FontAwesomeIcon icon)
|
||||
{
|
||||
var searchTermsAttribute = icon.GetAttribute<FontAwesomeSearchTermsAttribute>();
|
||||
return searchTermsAttribute == null ? new string[] { } : searchTermsAttribute.SearchTerms;
|
||||
return searchTermsAttribute == null ? [] : searchTermsAttribute.SearchTerms;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -48,6 +48,6 @@ public static class FontAwesomeExtensions
|
|||
public static IEnumerable<string> GetCategories(this FontAwesomeIcon icon)
|
||||
{
|
||||
var categoriesAttribute = icon.GetAttribute<FontAwesomeCategoriesAttribute>();
|
||||
return categoriesAttribute == null ? new string[] { } : categoriesAttribute.Categories;
|
||||
return categoriesAttribute == null ? [] : categoriesAttribute.Categories;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -269,7 +269,7 @@ public class FdtReader
|
|||
/// <summary>
|
||||
/// Mapping of texture channel index to byte index.
|
||||
/// </summary>
|
||||
public static readonly int[] TextureChannelOrder = { 2, 1, 0, 3 };
|
||||
public static readonly int[] TextureChannelOrder = [2, 1, 0, 3];
|
||||
|
||||
/// <summary>
|
||||
/// Integer representation of a Unicode character in UTF-8 in reverse order, read in little endian.
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@ public static class GlyphRangesJapanese
|
|||
/// <summary>
|
||||
/// Gets the unicode glyph ranges for the Japanese language.
|
||||
/// </summary>
|
||||
public static ushort[] GlyphRanges => new ushort[]
|
||||
{
|
||||
public static ushort[] GlyphRanges =>
|
||||
[
|
||||
0x0020, 0x00FF, 0x0391, 0x03A1, 0x03A3, 0x03A9, 0x03B1, 0x03C1, 0x03C3, 0x03C9, 0x0401, 0x0401, 0x0410, 0x044F, 0x0451, 0x0451,
|
||||
0x2000, 0x206F, 0x2103, 0x2103, 0x212B, 0x212B, 0x2190, 0x2193, 0x21D2, 0x21D2, 0x21D4, 0x21D4, 0x2200, 0x2200, 0x2202, 0x2203,
|
||||
0x2207, 0x2208, 0x220B, 0x220B, 0x2212, 0x2212, 0x221A, 0x221A, 0x221D, 0x221E, 0x2220, 0x2220, 0x2227, 0x222C, 0x2234, 0x2235,
|
||||
|
|
@ -524,5 +524,5 @@ public static class GlyphRangesJapanese
|
|||
0x9F4E, 0x9F4F, 0x9F52, 0x9F52, 0x9F54, 0x9F54, 0x9F5F, 0x9F63, 0x9F66, 0x9F67, 0x9F6A, 0x9F6A, 0x9F6C, 0x9F6C, 0x9F72, 0x9F72,
|
||||
0x9F76, 0x9F77, 0x9F8D, 0x9F8D, 0x9F95, 0x9F95, 0x9F9C, 0x9F9D, 0x9FA0, 0x9FA0, 0xFF01, 0xFF01, 0xFF03, 0xFF06, 0xFF08, 0xFF0C,
|
||||
0xFF0E, 0xFF3B, 0xFF3D, 0xFF5D, 0xFF61, 0xFF9F, 0xFFE3, 0xFFE3, 0xFFE5, 0xFFE5, 0xFFFF, 0xFFFF, 0,
|
||||
};
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ public partial class FileDialog
|
|||
|
||||
private static string BytesToString(long byteCount)
|
||||
{
|
||||
string[] suf = { " B", " KB", " MB", " GB", " TB" };
|
||||
string[] suf = [" B", " KB", " MB", " GB", " TB"];
|
||||
if (byteCount == 0)
|
||||
return "0" + suf[0];
|
||||
var bytes = Math.Abs(byteCount);
|
||||
|
|
|
|||
|
|
@ -123,14 +123,14 @@ public partial class FileDialog
|
|||
if (iconMap == null)
|
||||
{
|
||||
iconMap = [];
|
||||
AddToIconMap(new[] { "mp4", "gif", "mov", "avi" }, FontAwesomeIcon.FileVideo, miscTextColor);
|
||||
AddToIconMap(new[] { "pdf" }, FontAwesomeIcon.FilePdf, miscTextColor);
|
||||
AddToIconMap(new[] { "png", "jpg", "jpeg", "tiff" }, FontAwesomeIcon.FileImage, imageTextColor);
|
||||
AddToIconMap(new[] { "cs", "json", "cpp", "h", "py", "xml", "yaml", "js", "html", "css", "ts", "java" }, FontAwesomeIcon.FileCode, codeTextColor);
|
||||
AddToIconMap(new[] { "txt", "md" }, FontAwesomeIcon.FileAlt, standardTextColor);
|
||||
AddToIconMap(new[] { "zip", "7z", "gz", "tar" }, FontAwesomeIcon.FileArchive, miscTextColor);
|
||||
AddToIconMap(new[] { "mp3", "m4a", "ogg", "wav" }, FontAwesomeIcon.FileAudio, miscTextColor);
|
||||
AddToIconMap(new[] { "csv" }, FontAwesomeIcon.FileCsv, miscTextColor);
|
||||
AddToIconMap(["mp4", "gif", "mov", "avi"], FontAwesomeIcon.FileVideo, miscTextColor);
|
||||
AddToIconMap(["pdf"], FontAwesomeIcon.FilePdf, miscTextColor);
|
||||
AddToIconMap(["png", "jpg", "jpeg", "tiff"], FontAwesomeIcon.FileImage, imageTextColor);
|
||||
AddToIconMap(["cs", "json", "cpp", "h", "py", "xml", "yaml", "js", "html", "css", "ts", "java"], FontAwesomeIcon.FileCode, codeTextColor);
|
||||
AddToIconMap(["txt", "md"], FontAwesomeIcon.FileAlt, standardTextColor);
|
||||
AddToIconMap(["zip", "7z", "gz", "tar"], FontAwesomeIcon.FileArchive, miscTextColor);
|
||||
AddToIconMap(["mp3", "m4a", "ogg", "wav"], FontAwesomeIcon.FileAudio, miscTextColor);
|
||||
AddToIconMap(["csv"], FontAwesomeIcon.FileCsv, miscTextColor);
|
||||
}
|
||||
|
||||
return iconMap.TryGetValue(ext.ToLowerInvariant(), out var icon) ? icon : new IconColorItem
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ public sealed class SingleFontChooserDialog : IDisposable
|
|||
private static readonly List<IFontId> EmptyIFontList = [];
|
||||
|
||||
private static readonly (string Name, float Value)[] FontSizeList =
|
||||
{
|
||||
[
|
||||
("9.6", 9.6f),
|
||||
("10", 10f),
|
||||
("12", 12f),
|
||||
|
|
@ -51,7 +51,7 @@ public sealed class SingleFontChooserDialog : IDisposable
|
|||
("46", 46),
|
||||
("68", 68),
|
||||
("90", 90),
|
||||
};
|
||||
];
|
||||
|
||||
private static int counterStatic;
|
||||
|
||||
|
|
|
|||
|
|
@ -25,8 +25,8 @@ internal unsafe class UiDebug
|
|||
private const int UnitListCount = 18;
|
||||
|
||||
private readonly bool[] selectedInList = new bool[UnitListCount];
|
||||
private readonly string[] listNames = new string[UnitListCount]
|
||||
{
|
||||
private readonly string[] listNames =
|
||||
[
|
||||
"Depth Layer 1",
|
||||
"Depth Layer 2",
|
||||
"Depth Layer 3",
|
||||
|
|
@ -45,7 +45,7 @@ internal unsafe class UiDebug
|
|||
"Units 16",
|
||||
"Units 17",
|
||||
"Units 18",
|
||||
};
|
||||
];
|
||||
|
||||
private bool doingSearch;
|
||||
private string searchInput = string.Empty;
|
||||
|
|
|
|||
|
|
@ -19,14 +19,14 @@ internal sealed class ComponentDemoWindow : Window
|
|||
private static readonly TimeSpan DefaultEasingTime = new(0, 0, 0, 1700);
|
||||
|
||||
private readonly List<(string Name, Action Demo)> componentDemos;
|
||||
private readonly IReadOnlyList<Easing> easings = new Easing[]
|
||||
{
|
||||
private readonly IReadOnlyList<Easing> easings =
|
||||
[
|
||||
new InSine(DefaultEasingTime), new OutSine(DefaultEasingTime), new InOutSine(DefaultEasingTime),
|
||||
new InCubic(DefaultEasingTime), new OutCubic(DefaultEasingTime), new InOutCubic(DefaultEasingTime),
|
||||
new InQuint(DefaultEasingTime), new OutQuint(DefaultEasingTime), new InOutQuint(DefaultEasingTime),
|
||||
new InCirc(DefaultEasingTime), new OutCirc(DefaultEasingTime), new InOutCirc(DefaultEasingTime),
|
||||
new InElastic(DefaultEasingTime), new OutElastic(DefaultEasingTime), new InOutElastic(DefaultEasingTime),
|
||||
};
|
||||
];
|
||||
|
||||
private int animationTimeMs = (int)DefaultEasingTime.TotalMilliseconds;
|
||||
private Vector4 defaultColor = ImGuiColors.DalamudOrange;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ namespace Dalamud.Interface.Internal.Windows.Data;
|
|||
internal class DataWindow : Window, IDisposable
|
||||
{
|
||||
private readonly IDataWindowWidget[] modules =
|
||||
{
|
||||
[
|
||||
new AddonInspectorWidget(),
|
||||
new AddonInspectorWidget2(),
|
||||
new AddonLifecycleWidget(),
|
||||
|
|
@ -62,7 +62,7 @@ internal class DataWindow : Window, IDisposable
|
|||
new UiColorWidget(),
|
||||
new UldWidget(),
|
||||
new VfsWidget(),
|
||||
};
|
||||
];
|
||||
|
||||
private readonly IOrderedEnumerable<IDataWindowWidget> orderedModules;
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ internal class GameInventoryTestWidget : IDataWindowWidget
|
|||
private bool rawEnabled;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string[]? CommandShortcuts { get; init; } = { "gameinventorytest" };
|
||||
public string[]? CommandShortcuts { get; init; } = ["gameinventorytest"];
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string DisplayName { get; init; } = "GameInventory Test";
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ internal class AddonInspectorWidget : IDataWindowWidget
|
|||
private UiDebug? addonInspector;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string[]? CommandShortcuts { get; init; } = { "ai", "addoninspector" };
|
||||
public string[]? CommandShortcuts { get; init; } = ["ai", "addoninspector"];
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string DisplayName { get; init; } = "Addon Inspector";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using Dalamud.Game;
|
||||
|
|
@ -15,7 +15,7 @@ internal class AddressesWidget : IDataWindowWidget
|
|||
private nint sigResult = nint.Zero;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string[]? CommandShortcuts { get; init; } = { "address" };
|
||||
public string[]? CommandShortcuts { get; init; } = ["address"];
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string DisplayName { get; init; } = "Addresses";
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ internal class AetherytesWidget : IDataWindowWidget
|
|||
public bool Ready { get; set; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string[]? CommandShortcuts { get; init; } = { "aetherytes" };
|
||||
public string[]? CommandShortcuts { get; init; } = ["aetherytes"];
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string DisplayName { get; init; } = "Aetherytes";
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ internal unsafe class AtkArrayDataBrowserWidget : IDataWindowWidget
|
|||
public bool Ready { get; set; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string[]? CommandShortcuts { get; init; } = { "atkarray" };
|
||||
public string[]? CommandShortcuts { get; init; } = ["atkarray"];
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string DisplayName { get; init; } = "Atk Array Data";
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ internal class BuddyListWidget : IDataWindowWidget
|
|||
public bool Ready { get; set; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string[]? CommandShortcuts { get; init; } = { "buddy", "buddylist" };
|
||||
public string[]? CommandShortcuts { get; init; } = ["buddy", "buddylist"];
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string DisplayName { get; init; } = "Buddy List";
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ namespace Dalamud.Interface.Internal.Windows.Data.Widgets;
|
|||
internal class CommandWidget : IDataWindowWidget
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string[]? CommandShortcuts { get; init; } = { "command" };
|
||||
public string[]? CommandShortcuts { get; init; } = ["command"];
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string DisplayName { get; init; } = "Command";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using Dalamud.Bindings.ImGui;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using Dalamud.Game.ClientState.Conditions;
|
||||
using Dalamud.Utility;
|
||||
|
||||
|
|
@ -13,7 +13,7 @@ internal class ConditionWidget : IDataWindowWidget
|
|||
public bool Ready { get; set; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string[]? CommandShortcuts { get; init; } = { "condition" };
|
||||
public string[]? CommandShortcuts { get; init; } = ["condition"];
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string DisplayName { get; init; } = "Condition";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using Dalamud.Configuration.Internal;
|
||||
using Dalamud.Configuration.Internal;
|
||||
using Dalamud.Utility;
|
||||
|
||||
namespace Dalamud.Interface.Internal.Windows.Data.Widgets;
|
||||
|
|
@ -9,7 +9,7 @@ namespace Dalamud.Interface.Internal.Windows.Data.Widgets;
|
|||
internal class ConfigurationWidget : IDataWindowWidget
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string[]? CommandShortcuts { get; init; } = { "config", "configuration" };
|
||||
public string[]? CommandShortcuts { get; init; } = ["config", "configuration"];
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string DisplayName { get; init; } = "Configuration";
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ internal class DataShareWidget : IDataWindowWidget
|
|||
private List<CallGateChannel>? gatesSorted;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string[]? CommandShortcuts { get; init; } = { "datashare" };
|
||||
public string[]? CommandShortcuts { get; init; } = ["datashare"];
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string DisplayName { get; init; } = "Data Share & Call Gate";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using System.Linq;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
|
||||
using Dalamud.Bindings.ImGui;
|
||||
|
|
@ -21,7 +21,7 @@ internal class DtrBarWidget : IDataWindowWidget, IDisposable
|
|||
private CancellationTokenSource? loadTestThreadCt;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string[]? CommandShortcuts { get; init; } = { "dtr", "dtrbar" };
|
||||
public string[]? CommandShortcuts { get; init; } = ["dtr", "dtrbar"];
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string DisplayName { get; init; } = "DTR Bar";
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ namespace Dalamud.Interface.Internal.Windows.Data.Widgets;
|
|||
internal class FateTableWidget : IDataWindowWidget
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string[]? CommandShortcuts { get; init; } = { "fate", "fatetable" };
|
||||
public string[]? CommandShortcuts { get; init; } = ["fate", "fatetable"];
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string DisplayName { get; init; } = "Fate Table";
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ internal class FlyTextWidget : IDataWindowWidget
|
|||
private Vector4 flyColor = new(1, 0, 0, 1);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string[]? CommandShortcuts { get; init; } = { "flytext" };
|
||||
public string[]? CommandShortcuts { get; init; } = ["flytext"];
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string DisplayName { get; init; } = "Fly Text";
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ internal class FontAwesomeTestWidget : IDataWindowWidget
|
|||
private bool useFixedWidth = false;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string[]? CommandShortcuts { get; init; } = { "fa", "fatest", "fontawesome" };
|
||||
public string[]? CommandShortcuts { get; init; } = ["fa", "fatest", "fontawesome"];
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string DisplayName { get; init; } = "Font Awesome Test";
|
||||
|
|
|
|||
|
|
@ -25,11 +25,11 @@ namespace Dalamud.Interface.Internal.Windows.Data.Widgets;
|
|||
internal class GamePrebakedFontsTestWidget : IDataWindowWidget, IDisposable
|
||||
{
|
||||
private static readonly string[] FontScaleModes =
|
||||
{
|
||||
[
|
||||
nameof(FontScaleMode.Default),
|
||||
nameof(FontScaleMode.SkipHandling),
|
||||
nameof(FontScaleMode.UndoGlobalScale),
|
||||
};
|
||||
];
|
||||
|
||||
private ImVectorWrapper<byte> testStringBuffer;
|
||||
private IFontAtlas? privateAtlas;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using Dalamud.Bindings.ImGui;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using Dalamud.Game.ClientState.GamePad;
|
||||
using Dalamud.Utility;
|
||||
|
||||
|
|
@ -10,7 +10,7 @@ namespace Dalamud.Interface.Internal.Windows.Data.Widgets;
|
|||
internal class GamepadWidget : IDataWindowWidget
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string[]? CommandShortcuts { get; init; } = { "gamepad", "controller" };
|
||||
public string[]? CommandShortcuts { get; init; } = ["gamepad", "controller"];
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string DisplayName { get; init; } = "Gamepad";
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ namespace Dalamud.Interface.Internal.Windows.Data.Widgets;
|
|||
internal class GaugeWidget : IDataWindowWidget
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string[]? CommandShortcuts { get; init; } = { "gauge", "jobgauge", "job" };
|
||||
public string[]? CommandShortcuts { get; init; } = ["gauge", "jobgauge", "job"];
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string DisplayName { get; init; } = "Job Gauge";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
|
@ -55,7 +55,7 @@ internal unsafe class HookWidget : IDataWindowWidget
|
|||
public string DisplayName { get; init; } = "Hook";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string[]? CommandShortcuts { get; init; } = { "hook" };
|
||||
public string[]? CommandShortcuts { get; init; } = ["hook"];
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool Ready { get; set; }
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public class IconBrowserWidget : IDataWindowWidget
|
|||
private Vector2 lastWindowSize = Vector2.Zero;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string[]? CommandShortcuts { get; init; } = { "icon", "icons" };
|
||||
public string[]? CommandShortcuts { get; init; } = ["icon", "icons"];
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string DisplayName { get; init; } = "Icon Browser";
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ internal class ImGuiWidget : IDataWindowWidget
|
|||
private NotificationTemplate notificationTemplate;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string[]? CommandShortcuts { get; init; } = { "imgui" };
|
||||
public string[]? CommandShortcuts { get; init; } = ["imgui"];
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string DisplayName { get; init; } = "ImGui";
|
||||
|
|
@ -334,7 +334,7 @@ internal class ImGuiWidget : IDataWindowWidget
|
|||
private struct NotificationTemplate
|
||||
{
|
||||
public static readonly string[] IconTitles =
|
||||
{
|
||||
[
|
||||
"None (use Type)",
|
||||
"SeIconChar",
|
||||
"FontAwesomeIcon",
|
||||
|
|
@ -344,7 +344,7 @@ internal class ImGuiWidget : IDataWindowWidget
|
|||
"TextureWrap from DalamudAssets(Async)",
|
||||
"TextureWrap from GamePath",
|
||||
"TextureWrap from FilePath",
|
||||
};
|
||||
];
|
||||
|
||||
public static readonly string[] AssetSources =
|
||||
Enum.GetValues<DalamudAsset>()
|
||||
|
|
@ -353,46 +353,46 @@ internal class ImGuiWidget : IDataWindowWidget
|
|||
.ToArray();
|
||||
|
||||
public static readonly string[] ProgressModeTitles =
|
||||
{
|
||||
[
|
||||
"Default",
|
||||
"Random",
|
||||
"Increasing",
|
||||
"Increasing & Auto Dismiss",
|
||||
"Indeterminate",
|
||||
};
|
||||
];
|
||||
|
||||
public static readonly string[] TypeTitles =
|
||||
{
|
||||
[
|
||||
nameof(NotificationType.None),
|
||||
nameof(NotificationType.Success),
|
||||
nameof(NotificationType.Warning),
|
||||
nameof(NotificationType.Error),
|
||||
nameof(NotificationType.Info),
|
||||
};
|
||||
];
|
||||
|
||||
public static readonly string[] InitialDurationTitles =
|
||||
{
|
||||
[
|
||||
"Infinite",
|
||||
"1 seconds",
|
||||
"3 seconds (default)",
|
||||
"10 seconds",
|
||||
};
|
||||
];
|
||||
|
||||
public static readonly string[] HoverExtendDurationTitles =
|
||||
{
|
||||
[
|
||||
"Disable",
|
||||
"1 seconds",
|
||||
"3 seconds (default)",
|
||||
"10 seconds",
|
||||
};
|
||||
];
|
||||
|
||||
public static readonly TimeSpan[] Durations =
|
||||
{
|
||||
[
|
||||
TimeSpan.Zero,
|
||||
TimeSpan.FromSeconds(1),
|
||||
NotificationConstants.DefaultDuration,
|
||||
TimeSpan.FromSeconds(10),
|
||||
};
|
||||
];
|
||||
|
||||
public bool ManualContent;
|
||||
public string Content;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using Dalamud.Bindings.ImGui;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using Dalamud.Game.ClientState.Keys;
|
||||
using Dalamud.Interface.Colors;
|
||||
|
||||
|
|
@ -10,7 +10,7 @@ namespace Dalamud.Interface.Internal.Windows.Data.Widgets;
|
|||
internal class KeyStateWidget : IDataWindowWidget
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string[]? CommandShortcuts { get; init; } = { "keystate" };
|
||||
public string[]? CommandShortcuts { get; init; } = ["keystate"];
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string DisplayName { get; init; } = "KeyState";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using System.Collections.Concurrent;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Globalization;
|
||||
|
||||
using Dalamud.Bindings.ImGui;
|
||||
|
|
@ -44,7 +44,7 @@ internal class MarketBoardWidget : IDataWindowWidget
|
|||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string[]? CommandShortcuts { get; init; } = { "marketboard" };
|
||||
public string[]? CommandShortcuts { get; init; } = ["marketboard"];
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string DisplayName { get; init; } = "Market Board";
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ internal class NetworkMonitorWidget : IDataWindowWidget
|
|||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string[]? CommandShortcuts { get; init; } = { "network", "netmon", "networkmonitor" };
|
||||
public string[]? CommandShortcuts { get; init; } = ["network", "netmon", "networkmonitor"];
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string DisplayName { get; init; } = "Network Monitor";
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ internal class NounProcessorWidget : IDataWindowWidget
|
|||
private int amount = 1;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string[]? CommandShortcuts { get; init; } = { "noun" };
|
||||
public string[]? CommandShortcuts { get; init; } = ["noun"];
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string DisplayName { get; init; } = "Noun Processor";
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ internal class ObjectTableWidget : IDataWindowWidget
|
|||
private float maxCharaDrawDistance = 20.0f;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string[]? CommandShortcuts { get; init; } = { "ot", "objecttable" };
|
||||
public string[]? CommandShortcuts { get; init; } = ["ot", "objecttable"];
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string DisplayName { get; init; } = "Object Table";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using Dalamud.Bindings.ImGui;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using Dalamud.Game.ClientState.Party;
|
||||
using Dalamud.Utility;
|
||||
|
||||
|
|
@ -12,7 +12,7 @@ internal class PartyListWidget : IDataWindowWidget
|
|||
private bool resolveGameData;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string[]? CommandShortcuts { get; init; } = { "partylist", "party" };
|
||||
public string[]? CommandShortcuts { get; init; } = ["partylist", "party"];
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string DisplayName { get; init; } = "Party List";
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ internal class PluginIpcWidget : IDataWindowWidget
|
|||
private string callGateResponse = string.Empty;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string[]? CommandShortcuts { get; init; } = { "ipc" };
|
||||
public string[]? CommandShortcuts { get; init; } = ["ipc"];
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string DisplayName { get; init; } = "Plugin IPC";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using System.Linq;
|
||||
using System.Linq;
|
||||
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using Dalamud.Game.Text;
|
||||
|
|
@ -11,7 +11,7 @@ namespace Dalamud.Interface.Internal.Windows.Data.Widgets;
|
|||
internal class SeFontTestWidget : IDataWindowWidget
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string[]? CommandShortcuts { get; init; } = { "sefont", "sefonttest" };
|
||||
public string[]? CommandShortcuts { get; init; } = ["sefont", "sefonttest"];
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string DisplayName { get; init; } = "SeFont Test";
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ internal class ServicesWidget : IDataWindowWidget
|
|||
private List<List<ServiceDependencyNode>>? dependencyNodes;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string[]? CommandShortcuts { get; init; } = { "services" };
|
||||
public string[]? CommandShortcuts { get; init; } = ["services"];
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string DisplayName { get; init; } = "Service Container";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using Dalamud.Bindings.ImGui;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Dalamud.Interface.Internal.Windows.Data.Widgets;
|
||||
|
|
@ -9,7 +9,7 @@ namespace Dalamud.Interface.Internal.Windows.Data.Widgets;
|
|||
internal class StartInfoWidget : IDataWindowWidget
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string[]? CommandShortcuts { get; init; } = { "startinfo" };
|
||||
public string[]? CommandShortcuts { get; init; } = ["startinfo"];
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string DisplayName { get; init; } = "Start Info";
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ internal class TargetWidget : IDataWindowWidget
|
|||
private bool resolveGameData;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string[]? CommandShortcuts { get; init; } = { "target" };
|
||||
public string[]? CommandShortcuts { get; init; } = ["target"];
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string DisplayName { get; init; } = "Target";
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ internal class TaskSchedulerWidget : IDataWindowWidget
|
|||
private CancellationTokenSource taskSchedulerCancelSource = new();
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string[]? CommandShortcuts { get; init; } = { "tasksched", "taskscheduler" };
|
||||
public string[]? CommandShortcuts { get; init; } = ["tasksched", "taskscheduler"];
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string DisplayName { get; init; } = "Task Scheduler";
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ internal class TexWidget : IDataWindowWidget
|
|||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string[]? CommandShortcuts { get; init; } = { "tex", "texture" };
|
||||
public string[]? CommandShortcuts { get; init; } = ["tex", "texture"];
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string DisplayName { get; init; } = "Tex";
|
||||
|
|
@ -605,7 +605,7 @@ internal class TexWidget : IDataWindowWidget
|
|||
|
||||
ImGui.SameLine();
|
||||
if (ImGuiComponents.IconButton(FontAwesomeIcon.Sync))
|
||||
this.textureManager.InvalidatePaths(new[] { texture.SourcePathForDebug });
|
||||
this.textureManager.InvalidatePaths([texture.SourcePathForDebug]);
|
||||
if (ImGui.IsItemHovered())
|
||||
ImGui.SetTooltip($"Call {nameof(ITextureSubstitutionProvider.InvalidatePaths)}.");
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ internal class ToastWidget : IDataWindowWidget
|
|||
private bool questToastCheckmark;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string[]? CommandShortcuts { get; init; } = { "toast" };
|
||||
public string[]? CommandShortcuts { get; init; } = ["toast"];
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string DisplayName { get; init; } = "Toast";
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ internal class VfsWidget : IDataWindowWidget
|
|||
private int reps = 1;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string[]? CommandShortcuts { get; init; } = { "vfs" };
|
||||
public string[]? CommandShortcuts { get; init; } = ["vfs"];
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string DisplayName { get; init; } = "VFS Performance";
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ internal class PluginImageCache : IInternalDisposableService
|
|||
this.downloadQueue.CompleteAdding();
|
||||
this.loadQueue.CompleteAdding();
|
||||
|
||||
if (!Task.WaitAll(new[] { this.loadTask, this.downloadTask }, 4000))
|
||||
if (!Task.WaitAll([this.loadTask, this.downloadTask], 4000))
|
||||
{
|
||||
Log.Error("Plugin Image download/load thread has not cancelled in time");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2361,7 +2361,7 @@ internal class PluginInstallerWindow : Window, IDisposable
|
|||
else if (!string.IsNullOrWhiteSpace(manifest.Description))
|
||||
{
|
||||
const int punchlineLen = 200;
|
||||
var firstLine = manifest.Description.Split(new[] { '\r', '\n' })[0];
|
||||
var firstLine = manifest.Description.Split(['\r', '\n'])[0];
|
||||
|
||||
ImGui.TextWrapped(firstLine.Length < punchlineLen
|
||||
? firstLine
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ internal sealed partial class FontAtlasFactory
|
|||
};
|
||||
|
||||
if (fontConfig.GlyphRanges is not { Length: > 0 } ranges)
|
||||
ranges = new ushort[] { 1, 0xFFFE, 0 };
|
||||
ranges = [1, 0xFFFE, 0];
|
||||
|
||||
raw.GlyphRanges = (ushort*)this.DisposeAfterBuild(
|
||||
GCHandle.Alloc(ranges, GCHandleType.Pinned)).AddrOfPinnedObject();
|
||||
|
|
@ -382,7 +382,7 @@ internal sealed partial class FontAtlasFactory
|
|||
DalamudAsset.FontAwesomeFreeSolid,
|
||||
fontConfig with
|
||||
{
|
||||
GlyphRanges = new ushort[] { FontAwesomeIconMin, FontAwesomeIconMax, 0 },
|
||||
GlyphRanges = [FontAwesomeIconMin, FontAwesomeIconMax, 0],
|
||||
});
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
|
@ -391,12 +391,12 @@ internal sealed partial class FontAtlasFactory
|
|||
DalamudAsset.LodestoneGameSymbol,
|
||||
fontConfig with
|
||||
{
|
||||
GlyphRanges = new ushort[]
|
||||
{
|
||||
GlyphRanges =
|
||||
[
|
||||
GamePrebakedFontHandle.SeIconCharMin,
|
||||
GamePrebakedFontHandle.SeIconCharMax,
|
||||
0,
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
|
@ -629,7 +629,7 @@ internal sealed partial class FontAtlasFactory
|
|||
{
|
||||
this.AddDalamudAssetFont(
|
||||
DalamudAsset.NotoSansJpMedium,
|
||||
new() { GlyphRanges = new ushort[] { ' ', ' ', '\0' }, SizePx = 1 });
|
||||
new() { GlyphRanges = [' ', ' ', '\0'], SizePx = 1 });
|
||||
}
|
||||
|
||||
if (!this.NewImAtlas.Build())
|
||||
|
|
|
|||
|
|
@ -290,13 +290,13 @@ internal sealed partial class FontAtlasFactory
|
|||
this.factory.InterfaceManager.AfterBuildFonts += this.OnRebuildRecommend;
|
||||
this.disposables.Add(() => this.factory.InterfaceManager.AfterBuildFonts -= this.OnRebuildRecommend);
|
||||
|
||||
this.fontHandleManagers = new IFontHandleManager[]
|
||||
{
|
||||
this.fontHandleManagers =
|
||||
[
|
||||
this.delegateFontHandleManager = this.disposables.Add(
|
||||
new DelegateFontHandle.HandleManager(atlasName)),
|
||||
this.gameFontHandleManager = this.disposables.Add(
|
||||
new GamePrebakedFontHandle.HandleManager(atlasName, factory)),
|
||||
};
|
||||
];
|
||||
foreach (var fhm in this.fontHandleManagers)
|
||||
fhm.RebuildRecommend += this.OnRebuildRecommend;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -417,7 +417,7 @@ internal class GamePrebakedFontHandle : FontHandle
|
|||
DalamudAsset.NotoSansJpMedium,
|
||||
new()
|
||||
{
|
||||
GlyphRanges = new ushort[] { ' ', ' ', '\0' },
|
||||
GlyphRanges = [' ', ' ', '\0'],
|
||||
SizePx = sizePx,
|
||||
});
|
||||
this.templatedFonts.Add(font);
|
||||
|
|
|
|||
|
|
@ -381,10 +381,10 @@ internal sealed partial class TextureManager
|
|||
var tf = new TexFile();
|
||||
typeof(TexFile).GetProperty(nameof(tf.Data))!.GetSetMethod(true)!.Invoke(
|
||||
tf,
|
||||
new object?[] { bytesArray });
|
||||
[bytesArray]);
|
||||
typeof(TexFile).GetProperty(nameof(tf.Reader))!.GetSetMethod(true)!.Invoke(
|
||||
tf,
|
||||
new object?[] { new LuminaBinaryReader(bytesArray) });
|
||||
[new LuminaBinaryReader(bytesArray)]);
|
||||
// Note: FileInfo and FilePath are not used from TexFile; skip it.
|
||||
|
||||
var wrap = this.NoThrottleCreateFromTexFile(tf);
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ public class Localization : IServiceType
|
|||
/// <summary>
|
||||
/// Array of language codes which have a valid translation in Dalamud.
|
||||
/// </summary>
|
||||
public static readonly string[] ApplicableLangCodes = { "de", "ja", "fr", "it", "es", "ko", "no", "ru", "zh", "tw" };
|
||||
public static readonly string[] ApplicableLangCodes = ["de", "ja", "fr", "it", "es", "ko", "no", "ru", "zh", "tw"];
|
||||
|
||||
private const string FallbackLangCode = "en";
|
||||
|
||||
|
|
|
|||
|
|
@ -347,7 +347,7 @@ internal sealed class DalamudPluginInterface : IDalamudPluginInterface, IDisposa
|
|||
{
|
||||
var mi = this.configs.GetType().GetMethod("LoadForType");
|
||||
var fn = mi.MakeGenericMethod(type);
|
||||
return (IPluginConfiguration)fn.Invoke(this.configs, new object[] { this.plugin.InternalName });
|
||||
return (IPluginConfiguration)fn.Invoke(this.configs, [this.plugin.InternalName]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ internal class AssemblyLoadContextBuilder
|
|||
return this;
|
||||
}
|
||||
|
||||
var names = new Queue<AssemblyName>(new[] { assemblyName });
|
||||
var names = new Queue<AssemblyName>([assemblyName]);
|
||||
|
||||
while (names.TryDequeue(out var name))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -11,21 +11,21 @@ internal class PlatformInformation
|
|||
/// <summary>
|
||||
/// Gets a list of native OS specific library extensions.
|
||||
/// </summary>
|
||||
public static string[] NativeLibraryExtensions => new[] { ".dll" };
|
||||
public static string[] NativeLibraryExtensions => [".dll"];
|
||||
|
||||
/// <summary>
|
||||
/// Gets a list of native OS specific library prefixes.
|
||||
/// </summary>
|
||||
public static string[] NativeLibraryPrefixes => new[] { string.Empty };
|
||||
public static string[] NativeLibraryPrefixes => [string.Empty];
|
||||
|
||||
/// <summary>
|
||||
/// Gets a list of native OS specific managed assembly extensions.
|
||||
/// </summary>
|
||||
public static string[] ManagedAssemblyExtensions => new[]
|
||||
{
|
||||
public static string[] ManagedAssemblyExtensions =>
|
||||
[
|
||||
".dll",
|
||||
".ni.dll",
|
||||
".exe",
|
||||
".ni.exe",
|
||||
};
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using Dalamud.Game.Command;
|
||||
|
|
@ -11,7 +11,7 @@ namespace Dalamud.Plugin.Internal;
|
|||
/// </summary>
|
||||
internal static class PluginValidator
|
||||
{
|
||||
private static readonly char[] LineSeparator = new[] { ' ', '\n', '\r' };
|
||||
private static readonly char[] LineSeparator = [' ', '\n', '\r'];
|
||||
|
||||
/// <summary>
|
||||
/// Represents the severity of a validation problem.
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ public abstract class ProfileModel
|
|||
|
||||
// HACK: Just filter the ID for now, we should split the sharing + saving model
|
||||
var serialized = JsonConvert.SerializeObject(this, new JsonSerializerSettings()
|
||||
{ ContractResolver = new IgnorePropertiesResolver(new[] { "WorkingPluginId" }) });
|
||||
{ ContractResolver = new IgnorePropertiesResolver(["WorkingPluginId"]) });
|
||||
|
||||
return prefix + Convert.ToBase64String(Util.CompressString(serialized));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -367,7 +367,7 @@ internal static class ServiceManager
|
|||
BindingFlags.InvokeMethod | BindingFlags.Static | BindingFlags.NonPublic,
|
||||
null,
|
||||
null,
|
||||
new object[] { startLoaderArgs }));
|
||||
[startLoaderArgs]));
|
||||
servicesToLoad.Remove(serviceType);
|
||||
|
||||
#if DEBUG
|
||||
|
|
|
|||
|
|
@ -457,7 +457,7 @@ internal static class ServiceHelpers
|
|||
BindingFlags.InvokeMethod | BindingFlags.Static | BindingFlags.Public,
|
||||
null,
|
||||
null,
|
||||
new object?[] { includeUnloadDependencies }) ?? new List<Type>();
|
||||
[includeUnloadDependencies]) ?? new List<Type>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public static class Troubleshooting
|
|||
{
|
||||
LastException = exception;
|
||||
|
||||
var fixedContext = context?.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries).FirstOrDefault();
|
||||
var fixedContext = context?.Split(['\r', '\n'], StringSplitOptions.RemoveEmptyEntries).FirstOrDefault();
|
||||
|
||||
try
|
||||
{
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ public static class DisposeSafety
|
|||
new AggregateException(
|
||||
new[] { e }.Concat(
|
||||
(IEnumerable<Exception>)r.Exception?.InnerExceptions
|
||||
?? new[] { new OperationCanceledException() })));
|
||||
?? [new OperationCanceledException()])));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ internal static class SignatureHelper
|
|||
continue;
|
||||
}
|
||||
|
||||
var hook = creator.Invoke(null, new object?[] { ptr, detour, false }) as IDalamudHook;
|
||||
var hook = creator.Invoke(null, [ptr, detour, false]) as IDalamudHook;
|
||||
info.SetValue(self, hook);
|
||||
createdHooks.Add(hook);
|
||||
|
||||
|
|
|
|||
|
|
@ -453,7 +453,7 @@ public static partial class Util
|
|||
/// <returns>Human readable version.</returns>
|
||||
public static string FormatBytes(long bytes)
|
||||
{
|
||||
string[] suffix = { "B", "KB", "MB", "GB", "TB" };
|
||||
string[] suffix = ["B", "KB", "MB", "GB", "TB"];
|
||||
int i;
|
||||
double dblSByte = bytes;
|
||||
for (i = 0; i < suffix.Length && bytes >= 1024; i++, bytes /= 1024)
|
||||
|
|
@ -910,7 +910,7 @@ public static partial class Util
|
|||
MethodAttributes.Public | MethodAttributes.Static,
|
||||
CallingConventions.Standard,
|
||||
null,
|
||||
new[] { typeof(object), typeof(IList<string>), typeof(ulong) },
|
||||
[typeof(object), typeof(IList<string>), typeof(ulong)],
|
||||
obj.GetType(),
|
||||
true);
|
||||
|
||||
|
|
@ -937,7 +937,7 @@ public static partial class Util
|
|||
ilg.Emit(OpCodes.Call, mm);
|
||||
ilg.Emit(OpCodes.Ret);
|
||||
|
||||
dm.Invoke(null, new[] { obj, path, addr });
|
||||
dm.Invoke(null, [obj, path, addr]);
|
||||
}
|
||||
|
||||
#pragma warning disable CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue