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