muffin v7.4

This commit is contained in:
alydev 2025-12-18 00:49:57 +10:00
parent 8a7847ff37
commit a4175abacd
54 changed files with 95984 additions and 123967 deletions

View file

@ -3,7 +3,7 @@
<PropertyGroup>
<AssemblyName>GatheringPaths</AssemblyName>
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
<TargetFramework>netcoreapp9.0</TargetFramework>
<TargetFramework>netcoreapp1.0</TargetFramework>
</PropertyGroup>
<PropertyGroup>
<LangVersion>12.0</LangVersion>

View file

@ -207,7 +207,7 @@ public sealed class GearStatsCalculator
num2--;
continue;
}
if (i == 0 && !CanHaveOffhand.Contains(rowOrDefault.Value.ItemUICategory.RowId))
if (i == 0 && !((ReadOnlySpan<uint>)CanHaveOffhand).Contains(rowOrDefault.Value.ItemUICategory.RowId))
{
num += rowOrDefault.Value.LevelItem.RowId;
i++;

View file

@ -3,7 +3,7 @@
<PropertyGroup>
<AssemblyName>LLib</AssemblyName>
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
<TargetFramework>netcoreapp9.0</TargetFramework>
<TargetFramework>netcoreapp1.0</TargetFramework>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<PropertyGroup>

View file

@ -3,7 +3,7 @@
<PropertyGroup>
<AssemblyName>QuestPaths</AssemblyName>
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
<TargetFramework>netcoreapp9.0</TargetFramework>
<TargetFramework>netcoreapp1.0</TargetFramework>
</PropertyGroup>
<PropertyGroup>
<LangVersion>12.0</LangVersion>

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text.Json;
using System.Text.Json.Serialization;
@ -11,20 +12,26 @@ public sealed class StringListOrValueConverter : JsonConverter<List<string>>
{
if (reader.TokenType == JsonTokenType.String)
{
return new List<string>(1) { reader.GetString() };
int num = 1;
List<string> list = new List<string>(num);
CollectionsMarshal.SetCount(list, num);
Span<string> span = CollectionsMarshal.AsSpan(list);
int index = 0;
span[index] = reader.GetString();
return list;
}
if (reader.TokenType != JsonTokenType.StartArray)
{
throw new JsonException();
}
reader.Read();
List<string> list = new List<string>();
List<string> list2 = new List<string>();
while (reader.TokenType != JsonTokenType.EndArray)
{
list.Add(reader.GetString());
list2.Add(reader.GetString());
reader.Read();
}
return list;
return list2;
}
public override void Write(Utf8JsonWriter writer, List<string>? value, JsonSerializerOptions options)

View file

@ -95,7 +95,7 @@ public abstract class ElementId : IComparable<ElementId>, IEquatable<ElementId>
if (value.StartsWith("A"))
{
value = value.Substring(1);
string[] array = value.Split(new char[1] { 'x' });
string[] array = value.Split('x');
if (array.Length == 2)
{
return new AlliedSocietyDailyId(byte.Parse(array[0], CultureInfo.InvariantCulture), byte.Parse(array[1], CultureInfo.InvariantCulture));

View file

@ -16,10 +16,10 @@ public sealed class QuestRoot
public string? Comment { get; set; }
[JsonIgnore(/*Could not decode attribute arguments.*/)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? IsSeasonalQuest { get; set; }
[JsonIgnore(/*Could not decode attribute arguments.*/)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public DateTime? SeasonalQuestExpiry { get; set; }
public List<QuestSequence> QuestSequence { get; set; } = new List<QuestSequence>();

View file

@ -22,7 +22,7 @@ public sealed class QuestStep
public ushort TerritoryId { get; set; }
[JsonIgnore(/*Could not decode attribute arguments.*/)]
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
public EInteractionType InteractionType { get; set; }
public float? NpcWaitDistance { get; set; }

View file

@ -21,15 +21,15 @@ public sealed class QuestWorkValue(byte? high, byte? low, EQuestWorkMode mode)
{
if (High.HasValue && Low.HasValue)
{
return ((byte)(High << 4).Value + Low).ToString();
return ((byte)((High.Value << 4) + Low.Value)).ToString();
}
if (High.HasValue)
{
return High + "H";
return High.Value + "H";
}
if (Low.HasValue)
{
return Low + "L";
return Low.Value + "L";
}
return "-";
}

View file

@ -61,6 +61,6 @@ public sealed class SkipStepConditions
public override string ToString()
{
return string.Format("{0}: {1}, {2}: {3}, {4}: {5}, {6}: {7}, {8}: {9}, {10}: {11}, {12}: {13}, {14}: {15}, {16}: {17}, {18}: {19}, {20}: {21}, {22}: {23}, {24}: {25}, {26}: {27}", "Never", Never, "CompletionQuestVariablesFlags", CompletionQuestVariablesFlags, "Flying", Flying, "Chocobo", Chocobo, "Diving", Diving, "NotTargetable", NotTargetable, "InTerritory", string.Join(" ", InTerritory), "NotInTerritory", string.Join(" ", NotInTerritory), "Item", Item, "QuestsAccepted", string.Join(" ", QuestsAccepted), "QuestsCompleted", string.Join(" ", QuestsCompleted), "NotNamePlateIconId", string.Join(" ", NotNamePlateIconId), "NearPosition", NearPosition, "ExtraCondition", ExtraCondition);
return $"{"Never"}: {Never}, {"CompletionQuestVariablesFlags"}: {CompletionQuestVariablesFlags}, {"Flying"}: {Flying}, {"Chocobo"}: {Chocobo}, {"Diving"}: {Diving}, {"NotTargetable"}: {NotTargetable}, {"InTerritory"}: {string.Join(" ", InTerritory)}, {"NotInTerritory"}: {string.Join(" ", NotInTerritory)}, {"Item"}: {Item}, {"QuestsAccepted"}: {string.Join(" ", QuestsAccepted)}, {"QuestsCompleted"}: {string.Join(" ", QuestsCompleted)}, {"NotNamePlateIconId"}: {string.Join(" ", NotNamePlateIconId)}, {"NearPosition"}: {NearPosition}, {"ExtraCondition"}: {ExtraCondition}";
}
}

View file

@ -3,7 +3,7 @@
<PropertyGroup>
<AssemblyName>Questionable.Model</AssemblyName>
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>netcoreapp1.0</TargetFramework>
</PropertyGroup>
<PropertyGroup>
<LangVersion>12.0</LangVersion>
@ -26,12 +26,5 @@
<EmbeddedResource Include="Questionable.Model.CommonRequiredVariables" LogicalName="Questionable.Model.CommonRequiredVariables" />
<EmbeddedResource Include="Questionable.Model.CommonVector3" LogicalName="Questionable.Model.CommonVector3" />
</ItemGroup>
<ItemGroup>
<Reference Include="System.Numerics.Vectors">
<HintPath>C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.32\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Text.Json">
<HintPath>C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.32\System.Text.Json.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup />
</Project>

View file

@ -0,0 +1,8 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Auto)]
[InlineArray(7)]
internal struct _003C_003Ey__InlineArray7<T>
{
}

View file

@ -138,7 +138,7 @@ internal sealed class CraftworksSupplyController : IDisposable
address->Close(fireCallback: true);
if (addonById->NameString == "BankaCraftworksSupply")
{
_framework.RunOnTick((Action)InteractWithBankaCraftworksSupply, TimeSpan.FromMilliseconds(50L, 0L), 0, default(CancellationToken));
_framework.RunOnTick((Action)InteractWithBankaCraftworksSupply, TimeSpan.FromMilliseconds(50L), 0, default(CancellationToken));
}
}
else

View file

@ -44,7 +44,7 @@ internal sealed class CreditsController : IDisposable
private static DateTime _lastHandledAt = DateTime.MinValue;
private static readonly TimeSpan _reentrancySuppress = TimeSpan.FromMilliseconds(500L, 0L);
private static readonly TimeSpan _reentrancySuppress = TimeSpan.FromMilliseconds(500L);
private static long _lastHandledAddr;

View file

@ -686,7 +686,6 @@ internal sealed class InteractionUiController : IDisposable
if (aetheryte.HasValue)
{
EAetheryteLocation valueOrDefault = aetheryte.GetValueOrDefault();
Span<DialogueChoice> span2;
Span<DialogueChoice> span;
switch (_aetheryteFunctions.CanRegisterFreeOrFavoriteAetheryte(valueOrDefault))
{
@ -696,12 +695,12 @@ internal sealed class InteractionUiController : IDisposable
int num2 = 1 + list.Count;
List<DialogueChoice> list3 = new List<DialogueChoice>(num2);
CollectionsMarshal.SetCount(list3, num2);
span2 = CollectionsMarshal.AsSpan(list3);
Span<DialogueChoice> span3 = CollectionsMarshal.AsSpan(list3);
int num = 0;
span = CollectionsMarshal.AsSpan(list);
span.CopyTo(span2.Slice(num, span.Length));
span.CopyTo(span3.Slice(num, span.Length));
num += span.Length;
span2[num] = new DialogueChoice
span3[num] = new DialogueChoice
{
Type = EDialogChoiceType.YesNo,
ExcelSheet = "Addon",
@ -719,7 +718,7 @@ internal sealed class InteractionUiController : IDisposable
CollectionsMarshal.SetCount(list2, num);
span = CollectionsMarshal.AsSpan(list2);
int num2 = 0;
span2 = CollectionsMarshal.AsSpan(list);
Span<DialogueChoice> span2 = CollectionsMarshal.AsSpan(list);
span2.CopyTo(span.Slice(num2, span2.Length));
num2 += span2.Length;
span[num2] = new DialogueChoice

View file

@ -59,7 +59,7 @@ internal static class SendNotification
}
}
internal sealed class Executor(NotificationMasterIpc notificationMasterIpc, IChatGui chatGui, Configuration configuration) : TaskExecutor<Task>()
internal sealed class Executor(IChatGui chatGui, Configuration configuration) : TaskExecutor<Task>()
{
protected override bool Start()
{
@ -142,7 +142,6 @@ internal static class SendNotification
XivChatEntry chat = xivChatEntry;
chatGui.Print(chat);
}
notificationMasterIpc.Notify(text2);
return true;
}

View file

@ -161,7 +161,6 @@ internal static class EquipItem
{
return new List<ushort>();
}
Span<ushort> span;
switch (item.Value.EquipSlotCategory.RowId)
{
case 1u:
@ -179,9 +178,9 @@ internal static class EquipItem
int index = 1;
List<ushort> list4 = new List<ushort>(index);
CollectionsMarshal.SetCount(list4, index);
span = CollectionsMarshal.AsSpan(list4);
Span<ushort> span4 = CollectionsMarshal.AsSpan(list4);
int num = 0;
span[num] = (ushort)(item.Value.EquipSlotCategory.RowId - 1);
span4[num] = (ushort)(item.Value.EquipSlotCategory.RowId - 1);
return list4;
}
case 12u:
@ -189,11 +188,11 @@ internal static class EquipItem
int num = 2;
List<ushort> list3 = new List<ushort>(num);
CollectionsMarshal.SetCount(list3, num);
span = CollectionsMarshal.AsSpan(list3);
Span<ushort> span3 = CollectionsMarshal.AsSpan(list3);
int index = 0;
span[index] = 11;
span3[index] = 11;
index++;
span[index] = 12;
span3[index] = 12;
return list3;
}
case 13u:
@ -201,9 +200,9 @@ internal static class EquipItem
int index = 1;
List<ushort> list2 = new List<ushort>(index);
CollectionsMarshal.SetCount(list2, index);
span = CollectionsMarshal.AsSpan(list2);
Span<ushort> span2 = CollectionsMarshal.AsSpan(list2);
int num = 0;
span[num] = 0;
span2[num] = 0;
return list2;
}
case 17u:
@ -211,7 +210,7 @@ internal static class EquipItem
int num = 1;
List<ushort> list = new List<ushort>(num);
CollectionsMarshal.SetCount(list, num);
span = CollectionsMarshal.AsSpan(list);
Span<ushort> span = CollectionsMarshal.AsSpan(list);
int index = 0;
span[index] = 13;
return list;

View file

@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
@ -52,7 +53,11 @@ internal static class SkipCondition
SkipStepConditions skipConditions = base.Task.SkipConditions;
QuestStep step = base.Task.Step;
ElementId elementId = base.Task.ElementId;
logger.LogInformation("Checking skip conditions; {ConfiguredConditions}", string.Join(",", skipConditions));
ILogger<CheckSkip> logger = logger;
object[] array = new object[1];
object reference = skipConditions;
array[0] = string.Join(",", new ReadOnlySpan<object>(in reference));
logger.LogInformation("Checking skip conditions; {ConfiguredConditions}", array);
if (CheckFlyingCondition(step, skipConditions))
{
return true;

View file

@ -53,9 +53,9 @@ internal sealed class TaskCreator
int index = 1;
List<ITask> list3 = new List<ITask>(index);
CollectionsMarshal.SetCount(list3, index);
Span<ITask> span = CollectionsMarshal.AsSpan(list3);
Span<ITask> span2 = CollectionsMarshal.AsSpan(list3);
int num = 0;
span[num] = new WaitAtEnd.WaitNextStepOrSequence();
span2[num] = new WaitAtEnd.WaitNextStepOrSequence();
list2 = list3;
}
else

View file

@ -61,10 +61,19 @@ internal sealed class CommandHandler : IDisposable
_configuration = configuration;
_changelogWindow = changelogWindow;
_clientState.Logout += OnLogout;
_commandManager.AddHandler("/qst", new CommandInfo(ProcessCommand)
{
HelpMessage = string.Join(Environment.NewLine + "\t", "Opens the Questing window", "/qst help - displays simplified commands", "/qst help-all - displays all available commands", "/qst config - opens the configuration window", "/qst changelog - opens the changelog window", "/qst start - starts doing quests", "/qst stop - stops doing quests")
});
ICommandManager commandManager2 = _commandManager;
CommandInfo commandInfo = new CommandInfo(ProcessCommand);
string separator = Environment.NewLine + "\t";
_003C_003Ey__InlineArray7<string> buffer = default(_003C_003Ey__InlineArray7<string>);
global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<_003C_003Ey__InlineArray7<string>, string>(ref buffer, 0) = "Opens the Questing window";
global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<_003C_003Ey__InlineArray7<string>, string>(ref buffer, 1) = "/qst help - displays simplified commands";
global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<_003C_003Ey__InlineArray7<string>, string>(ref buffer, 2) = "/qst help-all - displays all available commands";
global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<_003C_003Ey__InlineArray7<string>, string>(ref buffer, 3) = "/qst config - opens the configuration window";
global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<_003C_003Ey__InlineArray7<string>, string>(ref buffer, 4) = "/qst changelog - opens the changelog window";
global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<_003C_003Ey__InlineArray7<string>, string>(ref buffer, 5) = "/qst start - starts doing quests";
global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<_003C_003Ey__InlineArray7<string>, string>(ref buffer, 6) = "/qst stop - stops doing quests";
commandInfo.HelpMessage = string.Join(separator, global::_003CPrivateImplementationDetails_003E.InlineArrayAsReadOnlySpan<_003C_003Ey__InlineArray7<string>, string>(in buffer, 7));
commandManager2.AddHandler("/qst", commandInfo);
}
private void ProcessCommand(string command, string arguments)

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -149,7 +149,7 @@ internal sealed class TerritoryData
{
return name;
}
return string.Concat(name[0].ToString().ToUpper(CultureInfo.InvariantCulture), name.AsSpan(1));
return string.Concat(name[0].ToString().ToUpper(CultureInfo.InvariantCulture).AsSpan(), name.AsSpan(1));
}
private static IEnumerable<(ElementId QuestId, byte Index, uint QuestBattleId)> GetQuestBattles(Quest quest)

View file

@ -43,6 +43,26 @@ internal sealed class NavmeshIpc
private readonly ICallGateSubscriber<bool> _navRebuild;
public bool IsNavmeshAvailable
{
get
{
try
{
_isNavReady.InvokeFunc();
return true;
}
catch (IpcNotReadyError)
{
return false;
}
catch (IpcError)
{
return true;
}
}
}
public bool IsReady
{
get
@ -125,6 +145,10 @@ internal sealed class NavmeshIpc
public void Stop()
{
if (!IsNavmeshAvailable)
{
return;
}
try
{
_pathStop.InvokeAction();
@ -137,6 +161,10 @@ internal sealed class NavmeshIpc
public void Reload()
{
if (!IsNavmeshAvailable)
{
return;
}
try
{
_navReload.InvokeFunc();
@ -149,6 +177,10 @@ internal sealed class NavmeshIpc
public void Rebuild()
{
if (!IsNavmeshAvailable)
{
return;
}
try
{
_navRebuild.InvokeFunc();
@ -161,6 +193,10 @@ internal sealed class NavmeshIpc
public Task<List<Vector3>> Pathfind(Vector3 localPlayerPosition, Vector3 targetPosition, bool fly, CancellationToken cancellationToken)
{
if (!IsNavmeshAvailable)
{
return Task.FromResult(new List<Vector3>());
}
try
{
_pathSetTolerance.InvokeAction(0.25f);
@ -175,10 +211,14 @@ internal sealed class NavmeshIpc
public Task<List<Vector3>> PathfindWithTolerance(Vector3 localPlayerPosition, Vector3 targetPosition, bool fly, float tolerance, CancellationToken cancellationToken)
{
if (!IsNavmeshAvailable)
{
return Task.FromResult(new List<Vector3>());
}
try
{
_pathSetTolerance.InvokeAction(tolerance);
return _pluginInterface.GetIpcSubscriber<Vector3, Vector3, bool, float, Task<List<Vector3>>>("vnavmesh.Nav.PathfindWithTolerance").InvokeFunc(localPlayerPosition, targetPosition, fly, tolerance);
return _pluginInterface.GetIpcSubscriber<Vector3, Vector3, bool, float, CancellationToken, Task<List<Vector3>>>("vnavmesh.Nav.PathfindWithToleranceCancelable").InvokeFunc(localPlayerPosition, targetPosition, fly, tolerance, cancellationToken);
}
catch (IpcError exception)
{
@ -189,6 +229,10 @@ internal sealed class NavmeshIpc
public void MoveTo(List<Vector3> position, bool fly)
{
if (!IsNavmeshAvailable)
{
return;
}
Stop();
try
{

View file

@ -680,9 +680,9 @@ internal sealed class QuestionableIpc : IDisposable
int num = 1;
List<ElementId> list15 = new List<ElementId>(num);
CollectionsMarshal.SetCount(list15, num);
Span<ElementId> span = CollectionsMarshal.AsSpan(list15);
Span<ElementId> span15 = CollectionsMarshal.AsSpan(list15);
int index = 0;
span[index] = new AethernetId(1);
span15[index] = new AethernetId(1);
source = list15;
break;
}
@ -691,9 +691,9 @@ internal sealed class QuestionableIpc : IDisposable
int index = 1;
List<ElementId> list14 = new List<ElementId>(index);
CollectionsMarshal.SetCount(list14, index);
Span<ElementId> span = CollectionsMarshal.AsSpan(list14);
Span<ElementId> span14 = CollectionsMarshal.AsSpan(list14);
int num = 0;
span[num] = new AethernetId(2);
span14[num] = new AethernetId(2);
source = list14;
break;
}
@ -702,9 +702,9 @@ internal sealed class QuestionableIpc : IDisposable
int num = 1;
List<ElementId> list13 = new List<ElementId>(num);
CollectionsMarshal.SetCount(list13, num);
Span<ElementId> span = CollectionsMarshal.AsSpan(list13);
Span<ElementId> span13 = CollectionsMarshal.AsSpan(list13);
int index = 0;
span[index] = new AethernetId(3);
span13[index] = new AethernetId(3);
source = list13;
break;
}
@ -713,9 +713,9 @@ internal sealed class QuestionableIpc : IDisposable
int index = 1;
List<ElementId> list12 = new List<ElementId>(index);
CollectionsMarshal.SetCount(list12, index);
Span<ElementId> span = CollectionsMarshal.AsSpan(list12);
Span<ElementId> span12 = CollectionsMarshal.AsSpan(list12);
int num = 0;
span[num] = new AethernetId(4);
span12[num] = new AethernetId(4);
source = list12;
break;
}
@ -724,9 +724,9 @@ internal sealed class QuestionableIpc : IDisposable
int num = 1;
List<ElementId> list11 = new List<ElementId>(num);
CollectionsMarshal.SetCount(list11, num);
Span<ElementId> span = CollectionsMarshal.AsSpan(list11);
Span<ElementId> span11 = CollectionsMarshal.AsSpan(list11);
int index = 0;
span[index] = new AethernetId(5);
span11[index] = new AethernetId(5);
source = list11;
break;
}
@ -735,9 +735,9 @@ internal sealed class QuestionableIpc : IDisposable
int index = 1;
List<ElementId> list10 = new List<ElementId>(index);
CollectionsMarshal.SetCount(list10, index);
Span<ElementId> span = CollectionsMarshal.AsSpan(list10);
Span<ElementId> span10 = CollectionsMarshal.AsSpan(list10);
int num = 0;
span[num] = new AethernetId(6);
span10[num] = new AethernetId(6);
source = list10;
break;
}
@ -746,9 +746,9 @@ internal sealed class QuestionableIpc : IDisposable
int num = 1;
List<ElementId> list9 = new List<ElementId>(num);
CollectionsMarshal.SetCount(list9, num);
Span<ElementId> span = CollectionsMarshal.AsSpan(list9);
Span<ElementId> span9 = CollectionsMarshal.AsSpan(list9);
int index = 0;
span[index] = new AethernetId(7);
span9[index] = new AethernetId(7);
source = list9;
break;
}
@ -757,9 +757,9 @@ internal sealed class QuestionableIpc : IDisposable
int index = 1;
List<ElementId> list8 = new List<ElementId>(index);
CollectionsMarshal.SetCount(list8, index);
Span<ElementId> span = CollectionsMarshal.AsSpan(list8);
Span<ElementId> span8 = CollectionsMarshal.AsSpan(list8);
int num = 0;
span[num] = new AethernetId(8);
span8[num] = new AethernetId(8);
source = list8;
break;
}
@ -768,9 +768,9 @@ internal sealed class QuestionableIpc : IDisposable
int num = 1;
List<ElementId> list7 = new List<ElementId>(num);
CollectionsMarshal.SetCount(list7, num);
Span<ElementId> span = CollectionsMarshal.AsSpan(list7);
Span<ElementId> span7 = CollectionsMarshal.AsSpan(list7);
int index = 0;
span[index] = new AethernetId(9);
span7[index] = new AethernetId(9);
source = list7;
break;
}
@ -779,9 +779,9 @@ internal sealed class QuestionableIpc : IDisposable
int index = 1;
List<ElementId> list6 = new List<ElementId>(index);
CollectionsMarshal.SetCount(list6, index);
Span<ElementId> span = CollectionsMarshal.AsSpan(list6);
Span<ElementId> span6 = CollectionsMarshal.AsSpan(list6);
int num = 0;
span[num] = new AethernetId(10);
span6[num] = new AethernetId(10);
source = list6;
break;
}
@ -790,9 +790,9 @@ internal sealed class QuestionableIpc : IDisposable
int num = 1;
List<ElementId> list5 = new List<ElementId>(num);
CollectionsMarshal.SetCount(list5, num);
Span<ElementId> span = CollectionsMarshal.AsSpan(list5);
Span<ElementId> span5 = CollectionsMarshal.AsSpan(list5);
int index = 0;
span[index] = new AethernetId(11);
span5[index] = new AethernetId(11);
source = list5;
break;
}
@ -801,9 +801,9 @@ internal sealed class QuestionableIpc : IDisposable
int index = 1;
List<ElementId> list4 = new List<ElementId>(index);
CollectionsMarshal.SetCount(list4, index);
Span<ElementId> span = CollectionsMarshal.AsSpan(list4);
Span<ElementId> span4 = CollectionsMarshal.AsSpan(list4);
int num = 0;
span[num] = new AethernetId(12);
span4[num] = new AethernetId(12);
source = list4;
break;
}
@ -812,9 +812,9 @@ internal sealed class QuestionableIpc : IDisposable
int num = 1;
List<ElementId> list3 = new List<ElementId>(num);
CollectionsMarshal.SetCount(list3, num);
Span<ElementId> span = CollectionsMarshal.AsSpan(list3);
Span<ElementId> span3 = CollectionsMarshal.AsSpan(list3);
int index = 0;
span[index] = new AethernetId(13);
span3[index] = new AethernetId(13);
source = list3;
break;
}
@ -823,9 +823,9 @@ internal sealed class QuestionableIpc : IDisposable
int index = 1;
List<ElementId> list2 = new List<ElementId>(index);
CollectionsMarshal.SetCount(list2, index);
Span<ElementId> span = CollectionsMarshal.AsSpan(list2);
Span<ElementId> span2 = CollectionsMarshal.AsSpan(list2);
int num = 0;
span[num] = new AethernetId(14);
span2[num] = new AethernetId(14);
source = list2;
break;
}
@ -878,7 +878,7 @@ internal sealed class QuestionableIpc : IDisposable
EExpansionVersion.Dawntrail => new uint[6] { 1187u, 1188u, 1189u, 1190u, 1191u, 1192u },
_ => Array.Empty<uint>(),
};
return QuestData.AetherCurrentQuestsByTerritory.Where<KeyValuePair<uint, ImmutableList<QuestId>>>((KeyValuePair<uint, ImmutableList<QuestId>> kvp) => territoryRanges.Contains(kvp.Key)).SelectMany((KeyValuePair<uint, ImmutableList<QuestId>> kvp) => kvp.Value).Cast<ElementId>()
return QuestData.AetherCurrentQuestsByTerritory.Where<KeyValuePair<uint, ImmutableList<QuestId>>>((KeyValuePair<uint, ImmutableList<QuestId>> kvp) => ((ReadOnlySpan<uint>)territoryRanges).Contains(kvp.Key)).SelectMany((KeyValuePair<uint, ImmutableList<QuestId>> kvp) => kvp.Value).Cast<ElementId>()
.ToList();
}

View file

@ -517,7 +517,7 @@ internal sealed class QuestFunctions
if (dataId.HasValue)
{
uint valueOrDefault = dataId.GetValueOrDefault();
return dataIds.Contains(valueOrDefault);
return ((ReadOnlySpan<uint>)dataIds).Contains(valueOrDefault);
}
}
return false;
@ -567,11 +567,10 @@ internal sealed class QuestFunctions
{
return new PriorityQuestInfo(x, "Can't teleport to start");
}
DefaultInterpolatedStringHandler handler;
if (gil < EstimateTeleportCosts(quest))
{
IFormatProvider invariantCulture = CultureInfo.InvariantCulture;
handler = new DefaultInterpolatedStringHandler(32, 2, invariantCulture);
DefaultInterpolatedStringHandler handler = new DefaultInterpolatedStringHandler(32, 2, invariantCulture);
handler.AppendLiteral("Not enough gil, estimated cost: ");
handler.AppendFormatted(EstimateTeleportCosts(quest), "N0");
handler.AppendFormatted(SeIconChar.Gil.ToIconString());
@ -606,14 +605,7 @@ internal sealed class QuestFunctions
}
return (EAetheryteLocation?)null;
}).FirstOrDefault((EAetheryteLocation? y) => y.HasValue);
if (value.HasValue)
{
handler = new DefaultInterpolatedStringHandler(18, 1);
handler.AppendLiteral("Aetheryte locked: ");
handler.AppendFormatted(value);
return new PriorityQuestInfo(x, handler.ToStringAndClear());
}
return new PriorityQuestInfo(x);
return value.HasValue ? new PriorityQuestInfo(x, $"Aetheryte locked: {value}") : new PriorityQuestInfo(x);
}).ToList();
}
@ -654,7 +646,7 @@ internal sealed class QuestFunctions
QuestInfo questInfo = info as QuestInfo;
if (questInfo != null)
{
if (shadowbringersRoleQuestChapters.Contains(questInfo.NewGamePlusChapter))
if (((ReadOnlySpan<uint>)shadowbringersRoleQuestChapters).Contains(questInfo.NewGamePlusChapter))
{
return !QuestData.FinalShadowbringersRoleQuests.Any(IsQuestComplete);
}

View file

@ -110,7 +110,7 @@ internal sealed class DutyConfigComponent : ConfigComponent
ImGui.SameLine();
int currentItem = (int)base.Configuration.Duties.DefaultDutyMode;
ImGui.SetNextItemWidth(200f);
if (ImGui.Combo("##DefaultDutyMode", ref currentItem, in DutyModeLabels, DutyModeLabels.Length))
if (ImGui.Combo((ImU8String)"##DefaultDutyMode", ref currentItem, (ReadOnlySpan<string>)DutyModeLabels, DutyModeLabels.Length))
{
base.Configuration.Duties.DefaultDutyMode = (EDutyMode)currentItem;
Save();
@ -201,11 +201,11 @@ internal sealed class DutyConfigComponent : ConfigComponent
DutyOptions dutyOptions;
bool flag = _questRegistry.TryGetDutyByContentFinderConditionId(num, out dutyOptions);
ImGui.TableNextRow();
string[] items;
string[] array;
int currentItem;
if (flag)
{
items = (dutyOptions.Enabled ? SupportedCfcOptions : UnsupportedCfcOptions);
array = (dutyOptions.Enabled ? SupportedCfcOptions : UnsupportedCfcOptions);
currentItem = 0;
if (base.Configuration.Duties.WhitelistedDutyCfcIds.Contains(num))
{
@ -218,7 +218,7 @@ internal sealed class DutyConfigComponent : ConfigComponent
}
else
{
items = new string[2] { "Disabled", "Enabled" };
array = new string[2] { "Disabled", "Enabled" };
currentItem = (base.Configuration.Duties.WhitelistedDutyCfcIds.Contains(num) ? 1 : 0);
}
if (ImGui.TableNextColumn())
@ -232,14 +232,14 @@ internal sealed class DutyConfigComponent : ConfigComponent
{
ImGui.TextUnformatted(text);
ImGui.Separator();
table = new ImU8String(13, 1);
table.AppendLiteral("TerritoryId: ");
table.AppendFormatted(value2);
ImGui.BulletText(table);
table = new ImU8String(26, 1);
table.AppendLiteral("ContentFinderConditionId: ");
table.AppendFormatted(num);
ImGui.BulletText(table);
ImU8String text2 = new ImU8String(13, 1);
text2.AppendLiteral("TerritoryId: ");
text2.AppendFormatted(value2);
ImGui.BulletText(text2);
ImU8String text3 = new ImU8String(26, 1);
text3.AppendLiteral("ContentFinderConditionId: ");
text3.AppendFormatted(num);
ImGui.BulletText(text3);
if (flag)
{
ImGui.BulletText("Duty Support: Available");
@ -257,13 +257,13 @@ internal sealed class DutyConfigComponent : ConfigComponent
}
if (ImGui.TableNextColumn())
{
table = new ImU8String(16, 1);
table.AppendLiteral("##DungeonEnabled");
table.AppendFormatted(num);
using (ImRaii.PushId(table))
ImU8String id = new ImU8String(16, 1);
id.AppendLiteral("##DungeonEnabled");
id.AppendFormatted(num);
using (ImRaii.PushId(id))
{
ImGui.SetNextItemWidth(200f);
if (ImGui.Combo(string.Empty, ref currentItem, in items, items.Length))
if (ImGui.Combo((ImU8String)string.Empty, ref currentItem, (ReadOnlySpan<string>)array, array.Length))
{
base.Configuration.Duties.WhitelistedDutyCfcIds.Remove(num);
base.Configuration.Duties.BlacklistedDutyCfcIds.Remove(num);
@ -291,10 +291,10 @@ internal sealed class DutyConfigComponent : ConfigComponent
{
continue;
}
table = new ImU8String(13, 1);
table.AppendLiteral("##DungeonMode");
table.AppendFormatted(num);
using (ImRaii.PushId(table))
ImU8String id2 = new ImU8String(13, 1);
id2.AppendLiteral("##DungeonMode");
id2.AppendFormatted(num);
using (ImRaii.PushId(id2))
{
EDutyMode value3;
bool flag2 = base.Configuration.Duties.DutyModeOverrides.TryGetValue(num, out value3);
@ -302,16 +302,16 @@ internal sealed class DutyConfigComponent : ConfigComponent
Name = "Use Default";
string[] dutyModeLabels = DutyModeLabels;
int num3 = 0;
string[] array = new string[1 + dutyModeLabels.Length];
array[num3] = Name;
string[] array2 = new string[1 + dutyModeLabels.Length];
array2[num3] = Name;
num3++;
ReadOnlySpan<string> readOnlySpan = new ReadOnlySpan<string>(dutyModeLabels);
readOnlySpan.CopyTo(new Span<string>(array).Slice(num3, readOnlySpan.Length));
readOnlySpan.CopyTo(new Span<string>(array2).Slice(num3, readOnlySpan.Length));
num3 += readOnlySpan.Length;
string[] items2 = array;
string[] array3 = array2;
int currentItem2 = (int)(num2 + 1);
ImGui.SetNextItemWidth(150f);
if (ImGui.Combo(string.Empty, ref currentItem2, in items2, items2.Length))
if (ImGui.Combo((ImU8String)string.Empty, ref currentItem2, (ReadOnlySpan<string>)array3, array3.Length))
{
if (currentItem2 == 0)
{

View file

@ -95,7 +95,7 @@ internal sealed class GeneralConfigComponent : ConfigComponent
return;
}
int currentItem = (int)base.Configuration.General.CombatModule;
if (ImGui.Combo("Preferred Combat Module", ref currentItem, in _combatModuleNames, _combatModuleNames.Length))
if (ImGui.Combo((ImU8String)"Preferred Combat Module", ref currentItem, (ReadOnlySpan<string>)_combatModuleNames, _combatModuleNames.Length))
{
base.Configuration.General.CombatModule = (Configuration.ECombatModule)currentItem;
Save();
@ -150,7 +150,7 @@ internal sealed class GeneralConfigComponent : ConfigComponent
_mountComboJustOpened = false;
}
int currentItem2 = (int)base.Configuration.General.GrandCompany;
if (ImGui.Combo("Preferred Grand Company", ref currentItem2, in _grandCompanyNames, _grandCompanyNames.Length))
if (ImGui.Combo((ImU8String)"Preferred Grand Company", ref currentItem2, (ReadOnlySpan<string>)_grandCompanyNames, _grandCompanyNames.Length))
{
base.Configuration.General.GrandCompany = (FFXIVClientStructs.FFXIV.Client.UI.Agent.GrandCompany)currentItem2;
Save();
@ -162,7 +162,7 @@ internal sealed class GeneralConfigComponent : ConfigComponent
Save();
currentItem3 = 0;
}
if (ImGui.Combo("Preferred Combat Job", ref currentItem3, in _classJobNames, _classJobNames.Length))
if (ImGui.Combo((ImU8String)"Preferred Combat Job", ref currentItem3, (ReadOnlySpan<string>)_classJobNames, _classJobNames.Length))
{
base.Configuration.General.CombatJob = _classJobIds[currentItem3];
Save();
@ -279,11 +279,11 @@ internal sealed class GeneralConfigComponent : ConfigComponent
Save();
}
Vector4 col = new Vector4(0.7f, 0.7f, 0.7f, 1f);
ImU8String text2 = new ImU8String(77, 1);
text2.AppendLiteral("Quest steps will refresh automatically after ");
text2.AppendFormatted(v10);
text2.AppendLiteral(" seconds if no progress is made.");
ImGui.TextColored(in col, text2);
ImU8String text3 = new ImU8String(77, 1);
text3.AppendLiteral("Quest steps will refresh automatically after ");
text3.AppendFormatted(v10);
text3.AppendLiteral(" seconds if no progress is made.");
ImGui.TextColored(in col, text3);
ImGui.Unindent();
}
ImGui.Spacing();

View file

@ -2,22 +2,17 @@ using System;
using System.Linq;
using Dalamud.Bindings.ImGui;
using Dalamud.Game.Text;
using Dalamud.Interface.Components;
using Dalamud.Interface.Utility.Raii;
using Dalamud.Plugin;
using Dalamud.Utility;
using Questionable.External;
namespace Questionable.Windows.ConfigComponents;
internal sealed class NotificationConfigComponent : ConfigComponent
{
private readonly NotificationMasterIpc _notificationMasterIpc;
public NotificationConfigComponent(IDalamudPluginInterface pluginInterface, Configuration configuration, NotificationMasterIpc notificationMasterIpc)
public NotificationConfigComponent(IDalamudPluginInterface pluginInterface, Configuration configuration)
: base(pluginInterface, configuration)
{
_notificationMasterIpc = notificationMasterIpc;
}
public override void DrawTab()
@ -41,31 +36,12 @@ internal sealed class NotificationConfigComponent : ConfigComponent
where x != XivChatType.StandardEmote
select x).ToArray();
int currentItem = Array.IndexOf(array, base.Configuration.Notifications.ChatType);
string[] items = array.Select((XivChatType t) => t.GetAttribute<XivChatTypeInfoAttribute>()?.FancyName ?? t.ToString()).ToArray();
if (ImGui.Combo("Chat channel", ref currentItem, in items, items.Length))
string[] array2 = array.Select((XivChatType t) => t.GetAttribute<XivChatTypeInfoAttribute>()?.FancyName ?? t.ToString()).ToArray();
if (ImGui.Combo((ImU8String)"Chat channel", ref currentItem, (ReadOnlySpan<string>)array2, array2.Length))
{
base.Configuration.Notifications.ChatType = array[currentItem];
Save();
}
ImGui.Separator();
ImGui.Text("NotificationMaster settings");
ImGui.SameLine();
ImGuiComponents.HelpMarker("Requires the plugin 'NotificationMaster' to be installed.");
using (ImRaii.Disabled(!_notificationMasterIpc.Enabled))
{
bool v2 = base.Configuration.Notifications.ShowTrayMessage;
if (ImGui.Checkbox("Show tray notification", ref v2))
{
base.Configuration.Notifications.ShowTrayMessage = v2;
Save();
}
bool v3 = base.Configuration.Notifications.FlashTaskbar;
if (ImGui.Checkbox("Flash taskbar icon", ref v3))
{
base.Configuration.Notifications.FlashTaskbar = v3;
Save();
}
}
}
}
}

View file

@ -66,13 +66,12 @@ internal sealed class PluginConfigComponent : ConfigComponent
_pluginInterface = pluginInterface;
_uiUtils = uiUtils;
_commandManager = commandManager;
PluginInfo[] obj = new PluginInfo[6]
PluginInfo[] obj = new PluginInfo[5]
{
new PluginInfo("Artisan", "Artisan", "Handles automatic crafting for quests that require\ncrafted items.", new Uri("https://github.com/PunishXIV/Artisan"), new Uri("https://puni.sh/api/plugins")),
new PluginInfo("AutoDuty", "AutoDuty", "Automatically handles dungeon and trial completion during\nMain Scenario Quest progression.", new Uri("https://github.com/erdelf/AutoDuty"), new Uri("https://puni.sh/api/repository/erdelf")),
null,
null,
null,
null
};
Uri websiteUri = new Uri("https://github.com/Jaksuhn/Automaton");
@ -84,17 +83,16 @@ internal sealed class PluginConfigComponent : ConfigComponent
int index = 0;
span[index] = new PluginDetailInfo("'Sniper no sniping' enabled", "Automatically completes sniping tasks introduced in Stormblood", () => automatonIpc.IsAutoSnipeEnabled);
obj[2] = new PluginInfo("CBT (formerly known as Automaton)", "Automaton", "Automaton is a collection of automation-related tweaks.", websiteUri, dalamudRepositoryUri, "/cbt", list);
obj[3] = new PluginInfo("NotificationMaster", "NotificationMaster", "Sends a configurable out-of-game notification if a quest\nrequires manual actions.", new Uri("https://github.com/NightmareXIV/NotificationMaster"), null);
Uri websiteUri2 = new Uri("https://github.com/PunishXIV/PandorasBox");
Uri dalamudRepositoryUri2 = new Uri("https://puni.sh/api/plugins");
index = 1;
List<PluginDetailInfo> list2 = new List<PluginDetailInfo>(index);
CollectionsMarshal.SetCount(list2, index);
span = CollectionsMarshal.AsSpan(list2);
Span<PluginDetailInfo> span2 = CollectionsMarshal.AsSpan(list2);
num = 0;
span[num] = new PluginDetailInfo("'Auto Active Time Maneuver' enabled", "Automatically completes active time maneuvers in\nsingle player instances, trials and raids\"", () => pandorasBoxIpc.IsAutoActiveTimeManeuverEnabled);
obj[4] = new PluginInfo("Pandora's Box", "PandorasBox", "Pandora's Box is a collection of tweaks.", websiteUri2, dalamudRepositoryUri2, "/pandora", list2);
obj[5] = new PluginInfo("QuestMap", "QuestMap", "Displays quest objectives and markers on the map for\nbetter navigation and tracking.", new Uri("https://github.com/rreminy/QuestMap"), null);
span2[num] = new PluginDetailInfo("'Auto Active Time Maneuver' enabled", "Automatically completes active time maneuvers in\nsingle player instances, trials and raids\"", () => pandorasBoxIpc.IsAutoActiveTimeManeuverEnabled);
obj[3] = new PluginInfo("Pandora's Box", "PandorasBox", "Pandora's Box is a collection of tweaks.", websiteUri2, dalamudRepositoryUri2, "/pandora", list2);
obj[4] = new PluginInfo("QuestMap", "QuestMap", "Displays quest objectives and markers on the map for\nbetter navigation and tracking.", new Uri("https://github.com/rreminy/QuestMap"), null);
_recommendedPlugins = new global::_003C_003Ez__ReadOnlyArray<PluginInfo>(obj);
}

View file

@ -641,7 +641,7 @@ internal sealed class SinglePlayerDutyConfigComponent : ConfigComponent
foreach (SinglePlayerDutyInfo dutyInfo in dutyInfos)
{
ImGui.TableNextRow();
string[] items = (dutyInfo.EnabledByDefault ? SupportedCfcOptions : UnsupportedCfcOptions);
string[] array = (dutyInfo.EnabledByDefault ? SupportedCfcOptions : UnsupportedCfcOptions);
int currentItem = 0;
if (base.Configuration.SinglePlayerDuties.WhitelistedSinglePlayerDutyCfcIds.Contains(dutyInfo.ContentFinderConditionId))
{
@ -651,7 +651,6 @@ internal sealed class SinglePlayerDutyConfigComponent : ConfigComponent
{
currentItem = 2;
}
ImU8String text;
if (ImGui.TableNextColumn())
{
ImGui.AlignTextToFramePadding();
@ -663,14 +662,14 @@ internal sealed class SinglePlayerDutyConfigComponent : ConfigComponent
{
ImGui.TextUnformatted(dutyInfo.Name);
ImGui.Separator();
text = new ImU8String(13, 1);
ImU8String text = new ImU8String(13, 1);
text.AppendLiteral("TerritoryId: ");
text.AppendFormatted(dutyInfo.TerritoryId);
ImGui.BulletText(text);
text = new ImU8String(26, 1);
text.AppendLiteral("ContentFinderConditionId: ");
text.AppendFormatted(dutyInfo.ContentFinderConditionId);
ImGui.BulletText(text);
ImU8String text2 = new ImU8String(26, 1);
text2.AppendLiteral("ContentFinderConditionId: ");
text2.AppendFormatted(dutyInfo.ContentFinderConditionId);
ImGui.BulletText(text2);
}
}
if (!dutyInfo.Enabled)
@ -686,15 +685,15 @@ internal sealed class SinglePlayerDutyConfigComponent : ConfigComponent
{
continue;
}
text = new ImU8String(6, 1);
text.AppendLiteral("##Duty");
text.AppendFormatted(dutyInfo.ContentFinderConditionId);
using (ImRaii.PushId(text))
ImU8String id = new ImU8String(6, 1);
id.AppendLiteral("##Duty");
id.AppendFormatted(dutyInfo.ContentFinderConditionId);
using (ImRaii.PushId(id))
{
using (ImRaii.Disabled(!dutyInfo.Enabled))
{
ImGui.SetNextItemWidth(200f);
if (ImGui.Combo(string.Empty, ref currentItem, in items, items.Length))
if (ImGui.Combo((ImU8String)string.Empty, ref currentItem, (ReadOnlySpan<string>)array, array.Length))
{
base.Configuration.SinglePlayerDuties.WhitelistedSinglePlayerDutyCfcIds.Remove(dutyInfo.ContentFinderConditionId);
base.Configuration.SinglePlayerDuties.BlacklistedSinglePlayerDutyCfcIds.Remove(dutyInfo.ContentFinderConditionId);

View file

@ -124,11 +124,11 @@ internal sealed class StopConditionComponent : ConfigComponent
{
int sequence = currentQuest.Sequence;
ImGui.SameLine();
ImU8String text = new ImU8String(11, 1);
text.AppendLiteral("(Current: ");
text.AppendFormatted(sequence);
text.AppendLiteral(")");
ImGui.TextDisabled(text);
ImU8String text2 = new ImU8String(11, 1);
text2.AppendLiteral("(Current: ");
text2.AppendFormatted(sequence);
text2.AppendLiteral(")");
ImGui.TextDisabled(text2);
}
ImGui.TextWrapped("Note: Individual quest sequences below override this global setting.");
}
@ -165,10 +165,10 @@ internal sealed class StopConditionComponent : ConfigComponent
{
continue;
}
ImU8String text = new ImU8String(5, 1);
text.AppendLiteral("Quest");
text.AppendFormatted(elementId);
using (ImRaii.PushId(text))
ImU8String id = new ImU8String(5, 1);
id.AppendLiteral("Quest");
id.AppendFormatted(elementId);
using (ImRaii.PushId(id))
{
(Vector4, FontAwesomeIcon, string) questStyle = _uiUtils.GetQuestStyle(elementId);
bool flag;
@ -187,21 +187,21 @@ internal sealed class StopConditionComponent : ConfigComponent
_questTooltipComponent.Draw(quest2.Info);
}
ImGui.SameLine();
string text2 = elementId.ToString();
base.Configuration.Stop.QuestSequences.TryGetValue(text2, out var value);
string text3 = elementId.ToString();
base.Configuration.Stop.QuestSequences.TryGetValue(text3, out var value);
bool v4 = value.HasValue;
text = new ImU8String(8, 1);
text.AppendLiteral("##UseSeq");
text.AppendFormatted(text2);
if (ImGui.Checkbox(text, ref v4))
ImU8String label = new ImU8String(8, 1);
label.AppendLiteral("##UseSeq");
label.AppendFormatted(text3);
if (ImGui.Checkbox(label, ref v4))
{
if (v4)
{
base.Configuration.Stop.QuestSequences[text2] = 1;
base.Configuration.Stop.QuestSequences[text3] = 1;
}
else
{
base.Configuration.Stop.QuestSequences.Remove(text2);
base.Configuration.Stop.QuestSequences.Remove(text3);
}
Save();
}
@ -216,12 +216,12 @@ internal sealed class StopConditionComponent : ConfigComponent
ImGui.SameLine();
ImGui.SetNextItemWidth(85f);
int data3 = value ?? 1;
text = new ImU8String(10, 1);
text.AppendLiteral("##SeqValue");
text.AppendFormatted(text2);
if (ImGui.InputInt(text, ref data3, 1, 1) && v4)
ImU8String label2 = new ImU8String(10, 1);
label2.AppendLiteral("##SeqValue");
label2.AppendFormatted(text3);
if (ImGui.InputInt(label2, ref data3, 1, 1) && v4)
{
base.Configuration.Stop.QuestSequences[text2] = Math.Max(0, Math.Min(255, data3));
base.Configuration.Stop.QuestSequences[text3] = Math.Max(0, Math.Min(255, data3));
Save();
}
}

View file

@ -107,32 +107,32 @@ internal sealed class AlliedSocietyJournalComponent
ImGui.TextColored(in col, text);
ImGui.SameLine();
col = ImGuiColors.DalamudGrey3;
text = new ImU8String(13, 1);
text.AppendLiteral("(Resets in: ");
text.AppendFormatted(value2);
text.AppendLiteral(")");
ImGui.TextColored(in col, text);
ImU8String text2 = new ImU8String(13, 1);
text2.AppendLiteral("(Resets in: ");
text2.AppendFormatted(value2);
text2.AppendLiteral(")");
ImGui.TextColored(in col, text2);
if (ImGui.IsItemHovered())
{
ImGui.BeginTooltip();
ImGui.TextUnformatted("Shared across all allied societies");
text = new ImU8String(12, 1);
text.AppendLiteral("Used today: ");
text.AppendFormatted(value);
ImGui.TextUnformatted(text);
ImU8String text3 = new ImU8String(12, 1);
text3.AppendLiteral("Used today: ");
text3.AppendFormatted(value);
ImGui.TextUnformatted(text3);
ImGui.Spacing();
ImGui.Separator();
ImGui.Spacing();
col = ImGuiColors.DalamudGrey3;
text = new ImU8String(12, 1);
text.AppendLiteral("Next reset: ");
text.AppendFormatted(item, "g");
ImGui.TextColored(in col, text);
ImU8String text4 = new ImU8String(12, 1);
text4.AppendLiteral("Next reset: ");
text4.AppendFormatted(item, "g");
ImGui.TextColored(in col, text4);
col = ImGuiColors.DalamudGrey3;
text = new ImU8String(18, 1);
text.AppendLiteral("Time until reset: ");
text.AppendFormatted(value2);
ImGui.TextColored(in col, text);
ImU8String text5 = new ImU8String(18, 1);
text5.AppendLiteral("Time until reset: ");
text5.AppendFormatted(value2);
ImGui.TextColored(in col, text5);
ImGui.EndTooltip();
}
ImGui.Spacing();
@ -317,130 +317,125 @@ internal sealed class AlliedSocietyJournalComponent
ImGui.BeginTooltip();
if (remainingAllowances == 0)
{
ImU8String text;
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed))
{
text = new ImU8String(0, 1);
ImU8String text = new ImU8String(0, 1);
text.AppendFormatted(SeIconChar.Cross.ToIconString());
ImGui.Text(text);
ImGui.SameLine();
ImGui.TextUnformatted("No daily allowances remaining");
}
Vector4 col = ImGuiColors.DalamudGrey3;
text = new ImU8String(44, 1);
text.AppendLiteral("You've used all ");
text.AppendFormatted(12);
text.AppendLiteral(" shared allowances for today");
ImGui.TextColored(in col, text);
ImU8String text2 = new ImU8String(44, 1);
text2.AppendLiteral("You've used all ");
text2.AppendFormatted(12);
text2.AppendLiteral(" shared allowances for today");
ImGui.TextColored(in col, text2);
}
else if (questsToAddCount == remainingAllowances && questsToAddCount < availableCount)
{
ImU8String text;
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGreen))
{
text = new ImU8String(0, 1);
text.AppendFormatted(SeIconChar.QuestSync.ToIconString());
ImGui.Text(text);
ImU8String text3 = new ImU8String(0, 1);
text3.AppendFormatted(SeIconChar.QuestSync.ToIconString());
ImGui.Text(text3);
ImGui.SameLine();
text = new ImU8String(5, 2);
text.AppendLiteral("Add ");
text.AppendFormatted(questsToAddCount);
text.AppendLiteral(" ");
text.AppendFormatted((questsToAddCount == 1) ? "quest" : "quests");
ImGui.TextUnformatted(text);
ImU8String text4 = new ImU8String(5, 2);
text4.AppendLiteral("Add ");
text4.AppendFormatted(questsToAddCount);
text4.AppendLiteral(" ");
text4.AppendFormatted((questsToAddCount == 1) ? "quest" : "quests");
ImGui.TextUnformatted(text4);
}
Vector4 col = ImGuiColors.DalamudGrey3;
text = new ImU8String(44, 2);
text.AppendLiteral("You can complete ");
text.AppendFormatted(remainingAllowances);
text.AppendLiteral(" more allied society ");
text.AppendFormatted((remainingAllowances == 1) ? "quest" : "quests");
text.AppendLiteral(" today");
ImGui.TextColored(in col, text);
ImU8String text5 = new ImU8String(44, 2);
text5.AppendLiteral("You can complete ");
text5.AppendFormatted(remainingAllowances);
text5.AppendLiteral(" more allied society ");
text5.AppendFormatted((remainingAllowances == 1) ? "quest" : "quests");
text5.AppendLiteral(" today");
ImGui.TextColored(in col, text5);
ImGui.Spacing();
ImGui.TextColored(ImGuiColors.DalamudGrey3, "Prioritises highest rank quests first");
}
else if (questsToAddCount == dailyLimit)
{
ImU8String text;
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGreen))
{
text = new ImU8String(0, 1);
text.AppendFormatted(SeIconChar.QuestSync.ToIconString());
ImGui.Text(text);
ImU8String text6 = new ImU8String(0, 1);
text6.AppendFormatted(SeIconChar.QuestSync.ToIconString());
ImGui.Text(text6);
ImGui.SameLine();
text = new ImU8String(11, 1);
text.AppendLiteral("Add ");
text.AppendFormatted(dailyLimit);
text.AppendLiteral(" quests");
ImGui.TextUnformatted(text);
ImU8String text7 = new ImU8String(11, 1);
text7.AppendLiteral("Add ");
text7.AppendFormatted(dailyLimit);
text7.AppendLiteral(" quests");
ImGui.TextUnformatted(text7);
}
Vector4 col = ImGuiColors.DalamudGrey3;
text = new ImU8String(51, 2);
text.AppendLiteral("This will use ");
text.AppendFormatted(dailyLimit);
text.AppendLiteral(" of your ");
text.AppendFormatted(remainingAllowances);
text.AppendLiteral(" remaining shared allowances");
ImGui.TextColored(in col, text);
ImU8String text8 = new ImU8String(51, 2);
text8.AppendLiteral("This will use ");
text8.AppendFormatted(dailyLimit);
text8.AppendLiteral(" of your ");
text8.AppendFormatted(remainingAllowances);
text8.AppendLiteral(" remaining shared allowances");
ImGui.TextColored(in col, text8);
ImGui.Spacing();
ImGui.TextColored(ImGuiColors.DalamudGrey3, "Prioritises highest rank quests first");
}
else if (questsToAddCount == availableCount)
{
ImU8String text;
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGreen))
{
text = new ImU8String(0, 1);
text.AppendFormatted(SeIconChar.QuestSync.ToIconString());
ImGui.Text(text);
ImU8String text9 = new ImU8String(0, 1);
text9.AppendFormatted(SeIconChar.QuestSync.ToIconString());
ImGui.Text(text9);
ImGui.SameLine();
text = new ImU8String(20, 3);
text.AppendLiteral("Add all ");
text.AppendFormatted(questsToAddCount);
text.AppendLiteral(" available ");
text.AppendFormatted(alliedSociety);
text.AppendLiteral(" ");
text.AppendFormatted((questsToAddCount == 1) ? "quest" : "quests");
ImGui.TextUnformatted(text);
ImU8String text10 = new ImU8String(20, 3);
text10.AppendLiteral("Add all ");
text10.AppendFormatted(questsToAddCount);
text10.AppendLiteral(" available ");
text10.AppendFormatted(alliedSociety);
text10.AppendLiteral(" ");
text10.AppendFormatted((questsToAddCount == 1) ? "quest" : "quests");
ImGui.TextUnformatted(text10);
}
Vector4 col = ImGuiColors.DalamudGrey3;
text = new ImU8String(37, 2);
text.AppendLiteral("Uses ");
text.AppendFormatted(questsToAddCount);
text.AppendLiteral(" of ");
text.AppendFormatted(remainingAllowances);
text.AppendLiteral(" shared allowances remaining");
ImGui.TextColored(in col, text);
ImU8String text11 = new ImU8String(37, 2);
text11.AppendLiteral("Uses ");
text11.AppendFormatted(questsToAddCount);
text11.AppendLiteral(" of ");
text11.AppendFormatted(remainingAllowances);
text11.AppendLiteral(" shared allowances remaining");
ImGui.TextColored(in col, text11);
ImGui.Spacing();
ImGui.TextColored(ImGuiColors.DalamudGrey3, "Prioritises highest rank quests first");
}
else
{
ImU8String text;
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudYellow))
{
text = new ImU8String(0, 1);
text.AppendFormatted(SeIconChar.BoxedLetterQ.ToIconString());
ImGui.Text(text);
ImU8String text12 = new ImU8String(0, 1);
text12.AppendFormatted(SeIconChar.BoxedLetterQ.ToIconString());
ImGui.Text(text12);
ImGui.SameLine();
text = new ImU8String(6, 3);
text.AppendLiteral("Add ");
text.AppendFormatted(questsToAddCount);
text.AppendLiteral(" ");
text.AppendFormatted(alliedSociety);
text.AppendLiteral(" ");
text.AppendFormatted((questsToAddCount == 1) ? "quest" : "quests");
ImGui.TextUnformatted(text);
ImU8String text13 = new ImU8String(6, 3);
text13.AppendLiteral("Add ");
text13.AppendFormatted(questsToAddCount);
text13.AppendLiteral(" ");
text13.AppendFormatted(alliedSociety);
text13.AppendLiteral(" ");
text13.AppendFormatted((questsToAddCount == 1) ? "quest" : "quests");
ImGui.TextUnformatted(text13);
}
Vector4 col = ImGuiColors.DalamudGrey3;
text = new ImU8String(55, 2);
text.AppendLiteral("Limited by available quests (");
text.AppendFormatted(availableCount);
text.AppendLiteral(") and shared allowances (");
text.AppendFormatted(remainingAllowances);
text.AppendLiteral(")");
ImGui.TextColored(in col, text);
ImU8String text14 = new ImU8String(55, 2);
text14.AppendLiteral("Limited by available quests (");
text14.AppendFormatted(availableCount);
text14.AppendLiteral(") and shared allowances (");
text14.AppendFormatted(remainingAllowances);
text14.AppendLiteral(")");
ImGui.TextColored(in col, text14);
ImGui.Spacing();
ImGui.TextColored(ImGuiColors.DalamudGrey3, "Prioritises highest rank quests first");
}
@ -452,89 +447,86 @@ internal sealed class AlliedSocietyJournalComponent
ImGui.BeginTooltip();
if (availableCount > remainingAllowances)
{
ImU8String text;
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudOrange))
{
text = new ImU8String(0, 1);
ImU8String text = new ImU8String(0, 1);
text.AppendFormatted(SeIconChar.Cross.ToIconString());
ImGui.Text(text);
ImGui.SameLine();
ImGui.TextUnformatted("Warning: Exceeds remaining allowances");
}
ImGui.Spacing();
text = new ImU8String(54, 1);
text.AppendLiteral("This adds all ");
text.AppendFormatted(availableCount);
text.AppendLiteral(" available quests to your priority list,");
ImGui.TextUnformatted(text);
text = new ImU8String(37, 2);
text.AppendLiteral("but you only have ");
text.AppendFormatted(remainingAllowances);
text.AppendLiteral(" shared ");
text.AppendFormatted((remainingAllowances == 1) ? "allowance" : "allowances");
text.AppendLiteral(" remaining.");
ImGui.TextUnformatted(text);
ImU8String text2 = new ImU8String(54, 1);
text2.AppendLiteral("This adds all ");
text2.AppendFormatted(availableCount);
text2.AppendLiteral(" available quests to your priority list,");
ImGui.TextUnformatted(text2);
ImU8String text3 = new ImU8String(37, 2);
text3.AppendLiteral("but you only have ");
text3.AppendFormatted(remainingAllowances);
text3.AppendLiteral(" shared ");
text3.AppendFormatted((remainingAllowances == 1) ? "allowance" : "allowances");
text3.AppendLiteral(" remaining.");
ImGui.TextUnformatted(text3);
ImGui.Spacing();
ImGui.TextColored(ImGuiColors.DalamudGrey3, "The excess quests won't be completable until tomorrow.");
}
else if (availableCount > dailyLimit)
{
ImU8String text;
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudOrange))
{
text = new ImU8String(0, 1);
text.AppendFormatted(SeIconChar.Cross.ToIconString());
ImGui.Text(text);
ImU8String text4 = new ImU8String(0, 1);
text4.AppendFormatted(SeIconChar.Cross.ToIconString());
ImGui.Text(text4);
ImGui.SameLine();
ImGui.TextUnformatted("Warning: Exceeds daily optimal amount");
}
ImGui.Spacing();
text = new ImU8String(32, 1);
text.AppendLiteral("This adds all ");
text.AppendFormatted(availableCount);
text.AppendLiteral(" available quests,");
ImGui.TextUnformatted(text);
text = new ImU8String(48, 1);
text.AppendLiteral("using more than the typical ");
text.AppendFormatted(3);
text.AppendLiteral(" quests per society.");
ImGui.TextUnformatted(text);
ImU8String text5 = new ImU8String(32, 1);
text5.AppendLiteral("This adds all ");
text5.AppendFormatted(availableCount);
text5.AppendLiteral(" available quests,");
ImGui.TextUnformatted(text5);
ImU8String text6 = new ImU8String(48, 1);
text6.AppendLiteral("using more than the typical ");
text6.AppendFormatted(3);
text6.AppendLiteral(" quests per society.");
ImGui.TextUnformatted(text6);
ImGui.Spacing();
Vector4 col = ImGuiColors.ParsedGreen;
text = new ImU8String(37, 1);
text.AppendLiteral("You have ");
text.AppendFormatted(remainingAllowances);
text.AppendLiteral(" shared allowances remaining");
ImGui.TextColored(in col, text);
ImU8String text7 = new ImU8String(37, 1);
text7.AppendLiteral("You have ");
text7.AppendFormatted(remainingAllowances);
text7.AppendLiteral(" shared allowances remaining");
ImGui.TextColored(in col, text7);
ImGui.TextColored(ImGuiColors.DalamudGrey3, "You may want to save allowances for other societies.");
}
else
{
ImU8String text;
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGreen))
{
text = new ImU8String(0, 1);
text.AppendFormatted(SeIconChar.QuestSync.ToIconString());
ImGui.Text(text);
ImU8String text8 = new ImU8String(0, 1);
text8.AppendFormatted(SeIconChar.QuestSync.ToIconString());
ImGui.Text(text8);
ImGui.SameLine();
text = new ImU8String(20, 3);
text.AppendLiteral("Add all ");
text.AppendFormatted(availableCount);
text.AppendLiteral(" available ");
text.AppendFormatted(alliedSociety);
text.AppendLiteral(" ");
text.AppendFormatted((availableCount == 1) ? "quest" : "quests");
ImGui.TextUnformatted(text);
ImU8String text9 = new ImU8String(20, 3);
text9.AppendLiteral("Add all ");
text9.AppendFormatted(availableCount);
text9.AppendLiteral(" available ");
text9.AppendFormatted(alliedSociety);
text9.AppendLiteral(" ");
text9.AppendFormatted((availableCount == 1) ? "quest" : "quests");
ImGui.TextUnformatted(text9);
}
ImGui.Spacing();
Vector4 col = ImGuiColors.DalamudGrey3;
text = new ImU8String(27, 2);
text.AppendLiteral("Uses ");
text.AppendFormatted(availableCount);
text.AppendLiteral(" of ");
text.AppendFormatted(remainingAllowances);
text.AppendLiteral(" shared allowances");
ImGui.TextColored(in col, text);
ImU8String text10 = new ImU8String(27, 2);
text10.AppendLiteral("Uses ");
text10.AppendFormatted(availableCount);
text10.AppendLiteral(" of ");
text10.AppendFormatted(remainingAllowances);
text10.AppendLiteral(" shared allowances");
ImGui.TextColored(in col, text10);
ImGui.TextColored(ImGuiColors.DalamudGrey3, "All can be completed today");
}
ImGui.EndTooltip();
@ -571,18 +563,18 @@ internal sealed class AlliedSocietyJournalComponent
{
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGreen))
{
text = new ImU8String(0, 1);
text.AppendFormatted(SeIconChar.QuestSync.ToIconString());
ImGui.Text(text);
ImU8String text2 = new ImU8String(0, 1);
text2.AppendFormatted(SeIconChar.QuestSync.ToIconString());
ImGui.Text(text2);
ImGui.SameLine();
text = new ImU8String(17, 3);
text.AppendLiteral("Uses ");
text.AppendFormatted(availableQuests.Count);
text.AppendLiteral(" of ");
text.AppendFormatted(remainingAllowances);
text.AppendLiteral(" shared ");
text.AppendFormatted((remainingAllowances == 1) ? "allowance" : "allowances");
ImGui.TextUnformatted(text);
ImU8String text3 = new ImU8String(17, 3);
text3.AppendLiteral("Uses ");
text3.AppendFormatted(availableQuests.Count);
text3.AppendLiteral(" of ");
text3.AppendFormatted(remainingAllowances);
text3.AppendLiteral(" shared ");
text3.AppendFormatted((remainingAllowances == 1) ? "allowance" : "allowances");
ImGui.TextUnformatted(text3);
}
ImGui.TextColored(ImGuiColors.DalamudGrey3, "All can be completed today");
}
@ -590,15 +582,15 @@ internal sealed class AlliedSocietyJournalComponent
{
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudOrange))
{
text = new ImU8String(0, 1);
text.AppendFormatted(SeIconChar.Cross.ToIconString());
ImGui.Text(text);
ImU8String text4 = new ImU8String(0, 1);
text4.AppendFormatted(SeIconChar.Cross.ToIconString());
ImGui.Text(text4);
ImGui.SameLine();
text = new ImU8String(31, 1);
text.AppendLiteral("Exceeds remaining allowances (");
text.AppendFormatted(remainingAllowances);
text.AppendLiteral(")");
ImGui.TextUnformatted(text);
ImU8String text5 = new ImU8String(31, 1);
text5.AppendLiteral("Exceeds remaining allowances (");
text5.AppendFormatted(remainingAllowances);
text5.AppendLiteral(")");
ImGui.TextUnformatted(text5);
}
ImGui.TextColored(ImGuiColors.DalamudGrey3, "Some quests won't be completable until tomorrow");
}

View file

@ -44,18 +44,17 @@ internal sealed class QuestJournalUtils
public void ShowContextMenu(IQuestInfo questInfo, Quest? quest, string label)
{
ImU8String strId;
if (ImGui.IsItemClicked(ImGuiMouseButton.Right))
{
strId = new ImU8String(12, 1);
ImU8String strId = new ImU8String(12, 1);
strId.AppendLiteral("##QuestPopup");
strId.AppendFormatted(questInfo.QuestId);
ImGui.OpenPopup(strId);
}
strId = new ImU8String(12, 1);
strId.AppendLiteral("##QuestPopup");
strId.AppendFormatted(questInfo.QuestId);
using ImRaii.IEndObject endObject = ImRaii.Popup(strId);
ImU8String id = new ImU8String(12, 1);
id.AppendLiteral("##QuestPopup");
id.AppendFormatted(questInfo.QuestId);
using ImRaii.IEndObject endObject = ImRaii.Popup(id);
if (!endObject)
{
return;

View file

@ -85,10 +85,10 @@ internal sealed class QuestRewardComponent
using ImRaii.IEndObject endObject = ImRaii.Tooltip();
if (!(!endObject))
{
label2 = new ImU8String(15, 1);
label2.AppendLiteral("Obtained from: ");
label2.AppendFormatted(questInfo.Name);
ImGui.Text(label2);
ImU8String text2 = new ImU8String(15, 1);
text2.AppendLiteral("Obtained from: ");
text2.AppendFormatted(questInfo.Name);
ImGui.Text(text2);
using (ImRaii.PushIndent())
{
_questTooltipComponent.DrawInner(questInfo, showItemRewards: false);

View file

@ -54,7 +54,7 @@ internal sealed class ActiveQuestComponent
public event EventHandler? Reload;
[GeneratedRegex("\\s\\s+", RegexOptions.IgnoreCase, "en-US")]
[GeneratedCode("System.Text.RegularExpressions.Generator", "9.0.13.1716")]
[GeneratedCode("System.Text.RegularExpressions.Generator", "10.0.13.7005")]
private static Regex MultipleWhitespaceRegex()
{
return _003CRegexGenerator_g_003EFBB8301322196CF81C64F1652C2FA6E1D6BF3907141F781E9D97ABED51BF056C4__MultipleWhitespaceRegex_0.Instance;
@ -195,16 +195,16 @@ internal sealed class ActiveQuestComponent
{
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGold))
{
ImU8String text = new ImU8String(20, 4);
text.AppendLiteral("Gathering: ");
text.AppendFormatted(Shorten(currentQuest.Quest.Info.Name));
text.AppendLiteral(" (");
text.AppendFormatted(currentQuest.Quest.Id);
text.AppendLiteral(") / ");
text.AppendFormatted(currentQuest.Sequence);
text.AppendLiteral(" / ");
text.AppendFormatted(currentQuest.Step);
ImGui.TextUnformatted(text);
ImU8String text2 = new ImU8String(20, 4);
text2.AppendLiteral("Gathering: ");
text2.AppendFormatted(Shorten(currentQuest.Quest.Info.Name));
text2.AppendLiteral(" (");
text2.AppendFormatted(currentQuest.Quest.Id);
text2.AppendLiteral(") / ");
text2.AppendFormatted(currentQuest.Sequence);
text2.AppendLiteral(" / ");
text2.AppendFormatted(currentQuest.Step);
ImGui.TextUnformatted(text2);
return;
}
}
@ -222,16 +222,16 @@ internal sealed class ActiveQuestComponent
ImGui.SetTooltip("This quest is loaded from your 'pluginConfigs\\Questionable\\Quests' directory.\nThis gets loaded even if Questionable ships with a newer/different version of the quest.");
}
}
ImU8String text = new ImU8String(16, 4);
text.AppendLiteral("Quest: ");
text.AppendFormatted(Shorten(startedQuest.Quest.Info.Name));
text.AppendLiteral(" (");
text.AppendFormatted(startedQuest.Quest.Id);
text.AppendLiteral(") / ");
text.AppendFormatted(startedQuest.Sequence);
text.AppendLiteral(" / ");
text.AppendFormatted(startedQuest.Step);
ImGui.TextUnformatted(text);
ImU8String text3 = new ImU8String(16, 4);
text3.AppendLiteral("Quest: ");
text3.AppendFormatted(Shorten(startedQuest.Quest.Info.Name));
text3.AppendLiteral(" (");
text3.AppendFormatted(startedQuest.Quest.Id);
text3.AppendLiteral(") / ");
text3.AppendFormatted(startedQuest.Sequence);
text3.AppendLiteral(" / ");
text3.AppendFormatted(startedQuest.Step);
ImGui.TextUnformatted(text3);
if (startedQuest.Quest.Root.Disabled)
{
ImGui.SameLine();
@ -271,30 +271,30 @@ internal sealed class ActiveQuestComponent
if (flag)
{
int num2 = _objectTable.LocalPlayer?.Level ?? 0;
text = new ImU8String(14, 1);
text.AppendLiteral("Stop at level ");
text.AppendFormatted(_configuration.Stop.TargetLevel);
ImGui.BulletText(text);
ImU8String text4 = new ImU8String(14, 1);
text4.AppendLiteral("Stop at level ");
text4.AppendFormatted(_configuration.Stop.TargetLevel);
ImGui.BulletText(text4);
if (num2 > 0)
{
ImGui.SameLine();
if (num2 >= _configuration.Stop.TargetLevel)
{
Vector4 col2 = ImGuiColors.ParsedGreen;
text = new ImU8String(22, 1);
text.AppendLiteral("(Current: ");
text.AppendFormatted(num2);
text.AppendLiteral(" - Reached!)");
ImGui.TextColored(in col2, text);
ImU8String text5 = new ImU8String(22, 1);
text5.AppendLiteral("(Current: ");
text5.AppendFormatted(num2);
text5.AppendLiteral(" - Reached!)");
ImGui.TextColored(in col2, text5);
}
else
{
Vector4 col2 = ImGuiColors.ParsedBlue;
text = new ImU8String(11, 1);
text.AppendLiteral("(Current: ");
text.AppendFormatted(num2);
text.AppendLiteral(")");
ImGui.TextColored(in col2, text);
ImU8String text6 = new ImU8String(11, 1);
text6.AppendLiteral("(Current: ");
text6.AppendFormatted(num2);
text6.AppendLiteral(")");
ImGui.TextColored(in col2, text6);
}
}
}
@ -305,28 +305,28 @@ internal sealed class ActiveQuestComponent
ImGui.Spacing();
}
int sequence = startedQuest.Sequence;
text = new ImU8String(23, 1);
text.AppendLiteral("Stop at quest sequence ");
text.AppendFormatted(_configuration.Stop.TargetSequence);
ImGui.BulletText(text);
ImU8String text7 = new ImU8String(23, 1);
text7.AppendLiteral("Stop at quest sequence ");
text7.AppendFormatted(_configuration.Stop.TargetSequence);
ImGui.BulletText(text7);
ImGui.SameLine();
if (sequence >= _configuration.Stop.TargetSequence)
{
Vector4 col2 = ImGuiColors.ParsedGreen;
text = new ImU8String(22, 1);
text.AppendLiteral("(Current: ");
text.AppendFormatted(sequence);
text.AppendLiteral(" - Reached!)");
ImGui.TextColored(in col2, text);
ImU8String text8 = new ImU8String(22, 1);
text8.AppendLiteral("(Current: ");
text8.AppendFormatted(sequence);
text8.AppendLiteral(" - Reached!)");
ImGui.TextColored(in col2, text8);
}
else
{
Vector4 col2 = ImGuiColors.ParsedBlue;
text = new ImU8String(11, 1);
text.AppendLiteral("(Current: ");
text.AppendFormatted(sequence);
text.AppendLiteral(")");
ImGui.TextColored(in col2, text);
ImU8String text9 = new ImU8String(11, 1);
text9.AppendLiteral("(Current: ");
text9.AppendFormatted(sequence);
text9.AppendLiteral(")");
ImGui.TextColored(in col2, text9);
}
}
if (flag2)
@ -373,12 +373,12 @@ internal sealed class ActiveQuestComponent
{
if (_questRegistry.TryGetQuest(item2, out Quest quest2))
{
text = new ImU8String(3, 2);
text.AppendFormatted(quest2.Info.Name);
text.AppendLiteral(" (");
text.AppendFormatted(item2);
text.AppendLiteral(")");
ImGui.BulletText(text);
ImU8String text10 = new ImU8String(3, 2);
text10.AppendFormatted(quest2.Info.Name);
text10.AppendLiteral(" (");
text10.AppendFormatted(item2);
text10.AppendLiteral(")");
ImGui.BulletText(text10);
}
}
}
@ -396,13 +396,13 @@ internal sealed class ActiveQuestComponent
{
if (_questRegistry.TryGetQuest(elementId2, out Quest quest3))
{
text = new ImU8String(6, 3);
text.AppendFormatted(quest3.Info.Name);
text.AppendLiteral(" (");
text.AppendFormatted(elementId2);
text.AppendLiteral(") - ");
text.AppendFormatted(value);
ImGui.BulletText(text);
ImU8String text12 = new ImU8String(6, 3);
text12.AppendFormatted(quest3.Info.Name);
text12.AppendLiteral(" (");
text12.AppendFormatted(elementId2);
text12.AppendLiteral(") - ");
text12.AppendFormatted(value);
ImGui.BulletText(text12);
}
}
}
@ -416,16 +416,16 @@ internal sealed class ActiveQuestComponent
{
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudYellow))
{
ImU8String text = new ImU8String(21, 4);
text.AppendLiteral("Next Quest: ");
text.AppendFormatted(Shorten(nextQuest.Quest.Info.Name));
text.AppendLiteral(" (");
text.AppendFormatted(nextQuest.Quest.Id);
text.AppendLiteral(") / ");
text.AppendFormatted(nextQuest.Sequence);
text.AppendLiteral(" / ");
text.AppendFormatted(nextQuest.Step);
ImGui.TextUnformatted(text);
ImU8String text13 = new ImU8String(21, 4);
text13.AppendLiteral("Next Quest: ");
text13.AppendFormatted(Shorten(nextQuest.Quest.Info.Name));
text13.AppendLiteral(" (");
text13.AppendFormatted(nextQuest.Quest.Id);
text13.AppendLiteral(") / ");
text13.AppendFormatted(nextQuest.Sequence);
text13.AppendLiteral(" / ");
text13.AppendFormatted(nextQuest.Step);
ImGui.TextUnformatted(text13);
}
}
}
@ -462,10 +462,10 @@ internal sealed class ActiveQuestComponent
if (currentQuest.Quest.Info.AlliedSociety != EAlliedSociety.None)
{
ImGui.SameLine();
text = new ImU8String(2, 1);
text.AppendLiteral("/ ");
text.AppendFormatted(questProgressInfo.ClassJob);
ImGui.Text(text);
ImU8String text3 = new ImU8String(2, 1);
text3.AppendLiteral("/ ");
text3.AppendFormatted(questProgressInfo.ClassJob);
ImGui.Text(text3);
}
}
}
@ -600,12 +600,12 @@ internal sealed class ActiveQuestComponent
}
using (ImRaii.PushId("SimulatedStep"))
{
text = new ImU8String(9, 2);
text.AppendLiteral("Step: ");
text.AppendFormatted(simulatedQuest.Step);
text.AppendLiteral(" / ");
text.AppendFormatted(questSequence.Steps.Count - 1);
ImGui.Text(text);
ImU8String text2 = new ImU8String(9, 2);
text2.AppendLiteral("Step: ");
text2.AppendFormatted(simulatedQuest.Step);
text2.AppendLiteral(" / ");
text2.AppendFormatted(questSequence.Steps.Count - 1);
ImGui.Text(text2);
ImGui.BeginDisabled(simulatedQuest.Step == 0);
if (ImGuiComponents.IconButton(FontAwesomeIcon.Minus))
{
@ -641,7 +641,7 @@ internal sealed class ActiveQuestComponent
{
if (text.Length > 35)
{
return string.Concat(text.AsSpan(0, 30).Trim(), ((SeIconChar)57434).ToIconString());
return string.Concat(text.AsSpan(0, 30).Trim(), ((SeIconChar)57434).ToIconString().AsSpan());
}
return text;
}

View file

@ -101,28 +101,24 @@ internal sealed class CreationUtilsComponent
if (hoveredItem != 0L)
{
ImGui.Separator();
ImU8String text = new ImU8String(14, 1);
text.AppendLiteral("Hovered Item: ");
text.AppendFormatted(hoveredItem);
ImGui.Text(text);
ImU8String text2 = new ImU8String(14, 1);
text2.AppendLiteral("Hovered Item: ");
text2.AppendFormatted(hoveredItem);
ImGui.Text(text2);
}
}
private unsafe void DrawTargetDetails(IGameObject target)
{
string value = string.Empty;
DefaultInterpolatedStringHandler handler;
if (target is ICharacter { NameId: not 0u } character)
{
handler = new DefaultInterpolatedStringHandler(4, 1);
handler.AppendLiteral("; n=");
handler.AppendFormatted(character.NameId);
value = handler.ToStringAndClear();
value = $"; n={character.NameId}";
}
ImGui.Separator();
IFormatProvider invariantCulture = CultureInfo.InvariantCulture;
IFormatProvider provider = invariantCulture;
handler = new DefaultInterpolatedStringHandler(14, 4, invariantCulture);
DefaultInterpolatedStringHandler handler = new DefaultInterpolatedStringHandler(14, 4, invariantCulture);
handler.AppendLiteral("Target: ");
handler.AppendFormatted(target.Name);
handler.AppendLiteral(" (");
@ -136,18 +132,18 @@ internal sealed class CreationUtilsComponent
{
invariantCulture = CultureInfo.InvariantCulture;
IFormatProvider provider2 = invariantCulture;
handler = new DefaultInterpolatedStringHandler(10, 1, invariantCulture);
handler.AppendLiteral("Distance: ");
handler.AppendFormatted((target.Position - _objectTable.LocalPlayer.Position).Length(), "F2");
ImGui.Text(string.Create(provider2, ref handler));
DefaultInterpolatedStringHandler handler2 = new DefaultInterpolatedStringHandler(10, 1, invariantCulture);
handler2.AppendLiteral("Distance: ");
handler2.AppendFormatted((target.Position - _objectTable.LocalPlayer.Position).Length(), "F2");
ImGui.Text(string.Create(provider2, ref handler2));
ImGui.SameLine();
float value2 = target.Position.Y - _objectTable.LocalPlayer.Position.Y;
invariantCulture = CultureInfo.InvariantCulture;
IFormatProvider provider3 = invariantCulture;
handler = new DefaultInterpolatedStringHandler(3, 1, invariantCulture);
handler.AppendLiteral("Y: ");
handler.AppendFormatted(value2, "F2");
string text = string.Create(provider3, ref handler);
DefaultInterpolatedStringHandler handler3 = new DefaultInterpolatedStringHandler(3, 1, invariantCulture);
handler3.AppendLiteral("Y: ");
handler3.AppendFormatted(value2, "F2");
string text = string.Create(provider3, ref handler3);
if (Math.Abs(value2) >= 1.95f)
{
ImGui.TextColored(ImGuiColors.DalamudOrange, text);
@ -217,10 +213,9 @@ internal sealed class CreationUtilsComponent
}
if (num)
{
ImU8String clipboardText;
if (target.ObjectKind == Dalamud.Game.ClientState.Objects.Enums.ObjectKind.GatheringPoint)
{
clipboardText = new ImU8String(59, 4);
ImU8String clipboardText = new ImU8String(59, 4);
clipboardText.AppendLiteral("\"DataId\": ");
clipboardText.AppendFormatted(target.BaseId);
clipboardText.AppendLiteral(",\n\"Position\": {\n \"X\": ");
@ -265,31 +260,30 @@ internal sealed class CreationUtilsComponent
break;
}
string value = text;
clipboardText = new ImU8String(99, 6);
clipboardText.AppendLiteral("\"DataId\": ");
clipboardText.AppendFormatted(target.BaseId);
clipboardText.AppendLiteral(",\n\"Position\": {\n \"X\": ");
clipboardText.AppendFormatted(target.Position.X.ToString(CultureInfo.InvariantCulture));
clipboardText.AppendLiteral(",\n \"Y\": ");
clipboardText.AppendFormatted(target.Position.Y.ToString(CultureInfo.InvariantCulture));
clipboardText.AppendLiteral(",\n \"Z\": ");
clipboardText.AppendFormatted(target.Position.Z.ToString(CultureInfo.InvariantCulture));
clipboardText.AppendLiteral("\n},\n\"TerritoryId\": ");
clipboardText.AppendFormatted(_clientState.TerritoryType);
clipboardText.AppendLiteral(",\n\"InteractionType\": \"");
clipboardText.AppendFormatted(value);
clipboardText.AppendLiteral("\"");
ImGui.SetClipboardText(clipboardText);
ImU8String clipboardText2 = new ImU8String(99, 6);
clipboardText2.AppendLiteral("\"DataId\": ");
clipboardText2.AppendFormatted(target.BaseId);
clipboardText2.AppendLiteral(",\n\"Position\": {\n \"X\": ");
clipboardText2.AppendFormatted(target.Position.X.ToString(CultureInfo.InvariantCulture));
clipboardText2.AppendLiteral(",\n \"Y\": ");
clipboardText2.AppendFormatted(target.Position.Y.ToString(CultureInfo.InvariantCulture));
clipboardText2.AppendLiteral(",\n \"Z\": ");
clipboardText2.AppendFormatted(target.Position.Z.ToString(CultureInfo.InvariantCulture));
clipboardText2.AppendLiteral("\n},\n\"TerritoryId\": ");
clipboardText2.AppendFormatted(_clientState.TerritoryType);
clipboardText2.AppendLiteral(",\n\"InteractionType\": \"");
clipboardText2.AppendFormatted(value);
clipboardText2.AppendLiteral("\"");
ImGui.SetClipboardText(clipboardText2);
}
else if (ImGui.IsItemClicked(ImGuiMouseButton.Right))
{
DefaultInterpolatedStringHandler handler;
if (target.ObjectKind == Dalamud.Game.ClientState.Objects.Enums.ObjectKind.Aetheryte)
{
EAetheryteLocation baseId = (EAetheryteLocation)target.BaseId;
IFormatProvider invariantCulture = CultureInfo.InvariantCulture;
IFormatProvider provider = invariantCulture;
handler = new DefaultInterpolatedStringHandler(36, 4, invariantCulture);
DefaultInterpolatedStringHandler handler = new DefaultInterpolatedStringHandler(36, 4, invariantCulture);
handler.AppendLiteral("{EAetheryteLocation.");
handler.AppendFormatted(baseId);
handler.AppendLiteral(", new(");
@ -305,15 +299,15 @@ internal sealed class CreationUtilsComponent
{
IFormatProvider invariantCulture = CultureInfo.InvariantCulture;
IFormatProvider provider2 = invariantCulture;
handler = new DefaultInterpolatedStringHandler(12, 3, invariantCulture);
handler.AppendLiteral("new(");
handler.AppendFormatted(target.Position.X);
handler.AppendLiteral("f, ");
handler.AppendFormatted(target.Position.Y);
handler.AppendLiteral("f, ");
handler.AppendFormatted(target.Position.Z);
handler.AppendLiteral("f)");
ImGui.SetClipboardText(string.Create(provider2, ref handler));
DefaultInterpolatedStringHandler handler2 = new DefaultInterpolatedStringHandler(12, 3, invariantCulture);
handler2.AppendLiteral("new(");
handler2.AppendFormatted(target.Position.X);
handler2.AppendLiteral("f, ");
handler2.AppendFormatted(target.Position.Y);
handler2.AppendLiteral("f, ");
handler2.AppendFormatted(target.Position.Z);
handler2.AppendLiteral("f)");
ImGui.SetClipboardText(string.Create(provider2, ref handler2));
}
}
}

View file

@ -168,10 +168,10 @@ internal sealed class EventInfoComponent
{
continue;
}
ImU8String text3 = new ImU8String(21, 1);
text3.AppendLiteral("##EventQuestSelection");
text3.AppendFormatted(questId);
using (ImRaii.PushId(text3))
ImU8String id = new ImU8String(21, 1);
id.AppendLiteral("##EventQuestSelection");
id.AppendFormatted(questId);
using (ImRaii.PushId(id))
{
string name = _questData.GetQuestInfo(questId).Name;
if (list.Contains(questId) && _questRegistry.TryGetQuest(questId, out Questionable.Model.Quest quest))

View file

@ -136,10 +136,10 @@ internal sealed class ManualPriorityComponent
using (ImRaii.PushId(id))
{
ImGui.AlignTextToFramePadding();
id = new ImU8String(1, 1);
id.AppendFormatted(i + 1);
id.AppendLiteral(".");
ImGui.Text(id);
ImU8String text = new ImU8String(1, 1);
text.AppendFormatted(i + 1);
text.AppendLiteral(".");
ImGui.Text(text);
ImGui.SameLine();
(Vector4, FontAwesomeIcon, string) questStyle = _uiUtils.GetQuestStyle(quest3.Id);
bool flag;

View file

@ -331,11 +331,11 @@ internal sealed class PresetBuilderComponent
}
if (ImGui.IsItemHovered())
{
label = new ImU8String(23, 1);
label.AppendLiteral("Add '");
label.AppendFormatted(questInfo.Name);
label.AppendLiteral("' to priority list");
ImGui.SetTooltip(label);
ImU8String tooltip = new ImU8String(23, 1);
tooltip.AppendLiteral("Add '");
tooltip.AppendFormatted(questInfo.Name);
tooltip.AppendLiteral("' to priority list");
ImGui.SetTooltip(tooltip);
}
}
}
@ -600,7 +600,7 @@ internal sealed class PresetBuilderComponent
EExpansionVersion.Dawntrail => new uint[6] { 1187u, 1188u, 1189u, 1190u, 1191u, 1192u },
_ => Array.Empty<uint>(),
};
return QuestData.AetherCurrentQuestsByTerritory.Where<KeyValuePair<uint, ImmutableList<QuestId>>>((KeyValuePair<uint, ImmutableList<QuestId>> kvp) => territoryRanges.Contains(kvp.Key)).SelectMany((KeyValuePair<uint, ImmutableList<QuestId>> kvp) => kvp.Value).Cast<ElementId>()
return QuestData.AetherCurrentQuestsByTerritory.Where<KeyValuePair<uint, ImmutableList<QuestId>>>((KeyValuePair<uint, ImmutableList<QuestId>> kvp) => ((ReadOnlySpan<uint>)territoryRanges).Contains(kvp.Key)).SelectMany((KeyValuePair<uint, ImmutableList<QuestId>> kvp) => kvp.Value).Cast<ElementId>()
.ToList();
}
@ -613,9 +613,9 @@ internal sealed class PresetBuilderComponent
int num = 1;
List<ElementId> list15 = new List<ElementId>(num);
CollectionsMarshal.SetCount(list15, num);
Span<ElementId> span = CollectionsMarshal.AsSpan(list15);
Span<ElementId> span15 = CollectionsMarshal.AsSpan(list15);
int index = 0;
span[index] = new AethernetId(1);
span15[index] = new AethernetId(1);
return list15;
}
case "Gridania":
@ -623,9 +623,9 @@ internal sealed class PresetBuilderComponent
int index = 1;
List<ElementId> list14 = new List<ElementId>(index);
CollectionsMarshal.SetCount(list14, index);
Span<ElementId> span = CollectionsMarshal.AsSpan(list14);
Span<ElementId> span14 = CollectionsMarshal.AsSpan(list14);
int num = 0;
span[num] = new AethernetId(2);
span14[num] = new AethernetId(2);
return list14;
}
case "Uldah":
@ -633,9 +633,9 @@ internal sealed class PresetBuilderComponent
int num = 1;
List<ElementId> list13 = new List<ElementId>(num);
CollectionsMarshal.SetCount(list13, num);
Span<ElementId> span = CollectionsMarshal.AsSpan(list13);
Span<ElementId> span13 = CollectionsMarshal.AsSpan(list13);
int index = 0;
span[index] = new AethernetId(3);
span13[index] = new AethernetId(3);
return list13;
}
case "GoldSaucer":
@ -643,9 +643,9 @@ internal sealed class PresetBuilderComponent
int index = 1;
List<ElementId> list12 = new List<ElementId>(index);
CollectionsMarshal.SetCount(list12, index);
Span<ElementId> span = CollectionsMarshal.AsSpan(list12);
Span<ElementId> span12 = CollectionsMarshal.AsSpan(list12);
int num = 0;
span[num] = new AethernetId(4);
span12[num] = new AethernetId(4);
return list12;
}
case "Ishgard":
@ -653,9 +653,9 @@ internal sealed class PresetBuilderComponent
int num = 1;
List<ElementId> list11 = new List<ElementId>(num);
CollectionsMarshal.SetCount(list11, num);
Span<ElementId> span = CollectionsMarshal.AsSpan(list11);
Span<ElementId> span11 = CollectionsMarshal.AsSpan(list11);
int index = 0;
span[index] = new AethernetId(5);
span11[index] = new AethernetId(5);
return list11;
}
case "Idyllshire":
@ -663,9 +663,9 @@ internal sealed class PresetBuilderComponent
int index = 1;
List<ElementId> list10 = new List<ElementId>(index);
CollectionsMarshal.SetCount(list10, index);
Span<ElementId> span = CollectionsMarshal.AsSpan(list10);
Span<ElementId> span10 = CollectionsMarshal.AsSpan(list10);
int num = 0;
span[num] = new AethernetId(6);
span10[num] = new AethernetId(6);
return list10;
}
case "Rhalgr's Reach":
@ -673,9 +673,9 @@ internal sealed class PresetBuilderComponent
int num = 1;
List<ElementId> list9 = new List<ElementId>(num);
CollectionsMarshal.SetCount(list9, num);
Span<ElementId> span = CollectionsMarshal.AsSpan(list9);
Span<ElementId> span9 = CollectionsMarshal.AsSpan(list9);
int index = 0;
span[index] = new AethernetId(7);
span9[index] = new AethernetId(7);
return list9;
}
case "Kugane":
@ -683,9 +683,9 @@ internal sealed class PresetBuilderComponent
int index = 1;
List<ElementId> list8 = new List<ElementId>(index);
CollectionsMarshal.SetCount(list8, index);
Span<ElementId> span = CollectionsMarshal.AsSpan(list8);
Span<ElementId> span8 = CollectionsMarshal.AsSpan(list8);
int num = 0;
span[num] = new AethernetId(8);
span8[num] = new AethernetId(8);
return list8;
}
case "Doman Enclave":
@ -693,9 +693,9 @@ internal sealed class PresetBuilderComponent
int num = 1;
List<ElementId> list7 = new List<ElementId>(num);
CollectionsMarshal.SetCount(list7, num);
Span<ElementId> span = CollectionsMarshal.AsSpan(list7);
Span<ElementId> span7 = CollectionsMarshal.AsSpan(list7);
int index = 0;
span[index] = new AethernetId(9);
span7[index] = new AethernetId(9);
return list7;
}
case "The Crystarium":
@ -703,9 +703,9 @@ internal sealed class PresetBuilderComponent
int index = 1;
List<ElementId> list6 = new List<ElementId>(index);
CollectionsMarshal.SetCount(list6, index);
Span<ElementId> span = CollectionsMarshal.AsSpan(list6);
Span<ElementId> span6 = CollectionsMarshal.AsSpan(list6);
int num = 0;
span[num] = new AethernetId(10);
span6[num] = new AethernetId(10);
return list6;
}
case "Eulmore":
@ -713,9 +713,9 @@ internal sealed class PresetBuilderComponent
int num = 1;
List<ElementId> list5 = new List<ElementId>(num);
CollectionsMarshal.SetCount(list5, num);
Span<ElementId> span = CollectionsMarshal.AsSpan(list5);
Span<ElementId> span5 = CollectionsMarshal.AsSpan(list5);
int index = 0;
span[index] = new AethernetId(11);
span5[index] = new AethernetId(11);
return list5;
}
case "Old Sharlayan":
@ -723,9 +723,9 @@ internal sealed class PresetBuilderComponent
int index = 1;
List<ElementId> list4 = new List<ElementId>(index);
CollectionsMarshal.SetCount(list4, index);
Span<ElementId> span = CollectionsMarshal.AsSpan(list4);
Span<ElementId> span4 = CollectionsMarshal.AsSpan(list4);
int num = 0;
span[num] = new AethernetId(12);
span4[num] = new AethernetId(12);
return list4;
}
case "Radz-at-Han":
@ -733,9 +733,9 @@ internal sealed class PresetBuilderComponent
int num = 1;
List<ElementId> list3 = new List<ElementId>(num);
CollectionsMarshal.SetCount(list3, num);
Span<ElementId> span = CollectionsMarshal.AsSpan(list3);
Span<ElementId> span3 = CollectionsMarshal.AsSpan(list3);
int index = 0;
span[index] = new AethernetId(13);
span3[index] = new AethernetId(13);
return list3;
}
case "Tuliyollal":
@ -743,9 +743,9 @@ internal sealed class PresetBuilderComponent
int index = 1;
List<ElementId> list2 = new List<ElementId>(index);
CollectionsMarshal.SetCount(list2, index);
Span<ElementId> span = CollectionsMarshal.AsSpan(list2);
Span<ElementId> span2 = CollectionsMarshal.AsSpan(list2);
int num = 0;
span[num] = new AethernetId(14);
span2[num] = new AethernetId(14);
return list2;
}
case "Solution Nine":

View file

@ -238,10 +238,10 @@ internal sealed class QuestSequenceComponent
float num3 = (float)ImGui.GetTime();
float num4 = 0.85f + MathF.Sin(num3 * 3f) * 0.15f;
col = new Vector4(0.5f * num4, 1f * num4, 0.6f * num4, 1f);
text = new ImU8String(17, 1);
text.AppendLiteral("Active: Sequence ");
text.AppendFormatted(currentSequence.Value);
ImGui.TextColored(in col, text);
ImU8String text2 = new ImU8String(17, 1);
text2.AppendLiteral("Active: Sequence ");
text2.AppendFormatted(currentSequence.Value);
ImGui.TextColored(in col, text2);
}
ImGui.SetCursorPosY(cursorScreenPos.Y + num - ImGui.GetCursorScreenPos().Y + ImGui.GetCursorPosY());
ImGui.Spacing();
@ -343,21 +343,21 @@ internal sealed class QuestSequenceComponent
ImGui.TextColored(in col, text);
ImGui.SameLine();
col = new Vector4(0.7f, 0.9f, 1f, 1f);
text = new ImU8String(0, 1);
text.AppendFormatted(totalSequences);
ImGui.TextColored(in col, text);
ImU8String text2 = new ImU8String(0, 1);
text2.AppendFormatted(totalSequences);
ImGui.TextColored(in col, text2);
ImGui.Spacing();
col = new Vector4(0.9f, 0.9f, 0.98f, 1f);
text = new ImU8String(6, 0);
text.AppendLiteral("Range:");
ImGui.TextColored(in col, text);
ImU8String text3 = new ImU8String(6, 0);
text3.AppendLiteral("Range:");
ImGui.TextColored(in col, text3);
ImGui.SameLine();
col = new Vector4(0.7f, 0.9f, 1f, 1f);
text = new ImU8String(9, 1);
text.AppendLiteral("0 → ");
text.AppendFormatted(maxSeq);
text.AppendLiteral(", 255");
ImGui.TextColored(in col, text);
ImU8String text4 = new ImU8String(9, 1);
text4.AppendLiteral("0 → ");
text4.AppendFormatted(maxSeq);
text4.AppendLiteral(", 255");
ImGui.TextColored(in col, text4);
ImGui.Unindent(10f);
});
ImGui.TableNextColumn();
@ -376,16 +376,16 @@ internal sealed class QuestSequenceComponent
ImGui.TextColored(new Vector4(0.7f, 0.7f, 0.8f, 1f), "/");
ImGui.SameLine();
Vector4 col2 = new Vector4(0.9f, 0.9f, 0.98f, 1f);
text = new ImU8String(0, 1);
text.AppendFormatted(expectedCount);
ImGui.TextColored(in col2, text);
ImU8String text2 = new ImU8String(0, 1);
text2.AppendFormatted(expectedCount);
ImGui.TextColored(in col2, text2);
ImGui.SameLine();
ref Vector4 col3 = ref coverageColor;
text = new ImU8String(3, 1);
text.AppendLiteral("(");
text.AppendFormatted(coverage, "F0");
text.AppendLiteral("%)");
ImGui.TextColored(in col3, text);
ImU8String text3 = new ImU8String(3, 1);
text3.AppendLiteral("(");
text3.AppendFormatted(coverage, "F0");
text3.AppendLiteral("%)");
ImGui.TextColored(in col3, text3);
ImGui.Spacing();
Vector2 cursorScreenPos = ImGui.GetCursorScreenPos();
float x = ImGui.GetContentRegionAvail().X - 10f;
@ -536,10 +536,10 @@ internal sealed class QuestSequenceComponent
{
using (ImRaii.PushColor(ImGuiCol.Text, new Vector4(0.98f, 0.98f, 1f, 1f)))
{
strId = new ImU8String(9, 1);
strId.AppendLiteral("Sequence ");
strId.AppendFormatted(sequenceId);
ImGui.Text(strId);
ImU8String text2 = new ImU8String(9, 1);
text2.AppendLiteral("Sequence ");
text2.AppendFormatted(sequenceId);
ImGui.Text(text2);
}
ImGui.Separator();
if (flag2 && sequenceDetails.TryGetValue(sequenceId, out (int, string) value))
@ -551,14 +551,14 @@ internal sealed class QuestSequenceComponent
ImGui.TextColored(new Vector4(0.5f, 1f, 0.6f, 1f), "Implemented");
ImGui.Spacing();
Vector4 col = new Vector4(0.9f, 0.9f, 0.98f, 1f);
strId = new ImU8String(6, 0);
strId.AppendLiteral("Steps:");
ImGui.TextColored(in col, strId);
ImU8String text3 = new ImU8String(6, 0);
text3.AppendLiteral("Steps:");
ImGui.TextColored(in col, text3);
ImGui.SameLine();
col = new Vector4(0.7f, 0.9f, 1f, 1f);
strId = new ImU8String(0, 1);
strId.AppendFormatted(value.Item1);
ImGui.TextColored(in col, strId);
ImU8String text4 = new ImU8String(0, 1);
text4.AppendFormatted(value.Item1);
ImGui.TextColored(in col, text4);
if (!string.IsNullOrEmpty(value.Item2))
{
ImGui.Separator();

View file

@ -78,17 +78,17 @@ internal sealed class QuestTooltipComponent
}
if (quest.Root.Author.Count == 1)
{
text = new ImU8String(8, 1);
text.AppendLiteral("Author: ");
text.AppendFormatted(quest.Root.Author[0]);
ImGui.Text(text);
ImU8String text3 = new ImU8String(8, 1);
text3.AppendLiteral("Author: ");
text3.AppendFormatted(quest.Root.Author[0]);
ImGui.Text(text3);
}
else
{
text = new ImU8String(9, 1);
text.AppendLiteral("Authors: ");
text.AppendFormatted(string.Join(", ", quest.Root.Author));
ImGui.Text(text);
ImU8String text4 = new ImU8String(9, 1);
text4.AppendLiteral("Authors: ");
text4.AppendFormatted(string.Join(", ", quest.Root.Author));
ImGui.Text(text4);
}
}
else

View file

@ -57,10 +57,10 @@ internal sealed class QuestValidationComponent
ImGui.SameLine();
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed))
{
text = new ImU8String(7, 1);
text.AppendFormatted(errorCount);
text.AppendLiteral(" errors");
ImGui.Text(text);
ImU8String text2 = new ImU8String(7, 1);
text2.AppendFormatted(errorCount);
text2.AppendLiteral(" errors");
ImGui.Text(text2);
}
}
if (num > 0)
@ -70,11 +70,11 @@ internal sealed class QuestValidationComponent
ImGui.SameLine();
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudOrange))
{
text = new ImU8String(12, 1);
text.AppendLiteral(", ");
text.AppendFormatted(num);
text.AppendLiteral(" warnings)");
ImGui.Text(text);
ImU8String text3 = new ImU8String(12, 1);
text3.AppendLiteral(", ");
text3.AppendFormatted(num);
text3.AppendLiteral(" warnings)");
ImGui.Text(text3);
return;
}
}
@ -83,10 +83,10 @@ internal sealed class QuestValidationComponent
ImGui.SameLine();
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudOrange))
{
text = new ImU8String(10, 1);
text.AppendFormatted(num);
text.AppendLiteral(" warnings)");
ImGui.Text(text);
ImU8String text4 = new ImU8String(10, 1);
text4.AppendFormatted(num);
text4.AppendLiteral(" warnings)");
ImGui.Text(text4);
return;
}
}

View file

@ -133,33 +133,33 @@ internal sealed class ValidationDetailsRenderer
if (issue.ElementId != null)
{
IQuestInfo questInfo = _questData.GetQuestInfo(issue.ElementId);
ImU8String text = new ImU8String(10, 2);
text.AppendLiteral("Quest: ");
text.AppendFormatted(issue.ElementId);
text.AppendLiteral(" - ");
text.AppendFormatted(questInfo.Name);
ImGui.Text(text);
ImU8String text2 = new ImU8String(10, 2);
text2.AppendLiteral("Quest: ");
text2.AppendFormatted(issue.ElementId);
text2.AppendLiteral(" - ");
text2.AppendFormatted(questInfo.Name);
ImGui.Text(text2);
}
else if (issue.AlliedSociety != EAlliedSociety.None)
{
ImU8String text = new ImU8String(16, 1);
text.AppendLiteral("Allied Society: ");
text.AppendFormatted(issue.AlliedSociety);
ImGui.Text(text);
ImU8String text3 = new ImU8String(16, 1);
text3.AppendLiteral("Allied Society: ");
text3.AppendFormatted(issue.AlliedSociety);
ImGui.Text(text3);
}
if (issue.Sequence.HasValue)
{
ImU8String text = new ImU8String(10, 1);
text.AppendLiteral("Sequence: ");
text.AppendFormatted(issue.Sequence);
ImGui.Text(text);
ImU8String text4 = new ImU8String(10, 1);
text4.AppendLiteral("Sequence: ");
text4.AppendFormatted(issue.Sequence);
ImGui.Text(text4);
}
if (issue.Step.HasValue)
{
ImU8String text = new ImU8String(6, 1);
text.AppendLiteral("Step: ");
text.AppendFormatted(issue.Step);
ImGui.Text(text);
ImU8String text5 = new ImU8String(6, 1);
text5.AppendLiteral("Step: ");
text5.AppendFormatted(issue.Step);
ImGui.Text(text5);
}
ImGui.Separator();
ImGui.Text("Description:");
@ -270,19 +270,19 @@ internal sealed class ValidationDetailsRenderer
}
catch
{
ImU8String text = new ImU8String(18, 1);
text.AppendLiteral("\ufffd ");
text.AppendFormatted(value);
text.AppendLiteral(" (unknown quest)");
ImGui.TextWrapped(text);
ImU8String text2 = new ImU8String(18, 1);
text2.AppendLiteral("\ufffd ");
text2.AppendFormatted(value);
text2.AppendLiteral(" (unknown quest)");
ImGui.TextWrapped(text2);
}
}
else
{
ImU8String text = new ImU8String(2, 1);
text.AppendLiteral("\ufffd ");
text.AppendFormatted(value);
ImGui.TextWrapped(text);
ImU8String text3 = new ImU8String(2, 1);
text3.AppendLiteral("\ufffd ");
text3.AppendFormatted(value);
ImGui.TextWrapped(text3);
}
}
}
@ -351,10 +351,10 @@ internal sealed class ValidationDetailsRenderer
{
text2 = "JSON schema validation failed - check that all properties match the expected format and values";
}
ImU8String text = new ImU8String(2, 1);
text.AppendLiteral("\ufffd ");
text.AppendFormatted(text2);
ImGui.TextWrapped(text);
ImU8String text3 = new ImU8String(2, 1);
text3.AppendLiteral("\ufffd ");
text3.AppendFormatted(text2);
ImGui.TextWrapped(text3);
ImGui.Unindent(12f);
}
}

View file

@ -189,6 +189,6 @@ internal sealed class QuestWindow : LWindow, IPersistableWindowConfig
_framework.RunOnTick(delegate
{
_interactionUiController.HandleCurrentDialogueChoices();
}, TimeSpan.FromMilliseconds(200L, 0L));
}, TimeSpan.FromMilliseconds(200L));
}
}

View file

@ -3,7 +3,7 @@
<PropertyGroup>
<AssemblyName>Questionable</AssemblyName>
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
<TargetFramework>netcoreapp9.0</TargetFramework>
<TargetFramework>netcoreapp1.0</TargetFramework>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<PropertyGroup>
@ -38,6 +38,9 @@
<Reference Include="Microsoft.Extensions.Logging.Abstractions">
<HintPath>..\..\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Serilog">
<HintPath>..\..\..\..\..\ffxiv\alyssile-xivl\addon\Hooks\dev\Serilog.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.DependencyInjection">
<HintPath>..\..\Microsoft.Extensions.DependencyInjection.dll</HintPath>
</Reference>
@ -59,9 +62,6 @@
<Reference Include="InteropGenerator.Runtime">
<HintPath>..\..\..\..\..\ffxiv\alyssile-xivl\addon\Hooks\dev\InteropGenerator.Runtime.dll</HintPath>
</Reference>
<Reference Include="NotificationMasterAPI">
<HintPath>..\..\NotificationMasterAPI.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.Logging">
<HintPath>..\..\Microsoft.Extensions.Logging.dll</HintPath>
</Reference>
@ -71,9 +71,6 @@
<Reference Include="GatheringPaths">
<HintPath>..\..\GatheringPaths.dll</HintPath>
</Reference>
<Reference Include="Dalamud.Extensions.MicrosoftLogging">
<HintPath>..\..\Dalamud.Extensions.MicrosoftLogging.dll</HintPath>
</Reference>
<Reference Include="JsonPointer.Net">
<HintPath>..\..\JsonPointer.Net.dll</HintPath>
</Reference>

View file

@ -98,10 +98,6 @@ internal sealed class Configuration : IPluginConfiguration
public bool Enabled { get; set; } = true;
public XivChatType ChatType { get; set; } = XivChatType.Debug;
public bool ShowTrayMessage { get; set; }
public bool FlashTaskbar { get; set; }
}
internal sealed class AdvancedConfiguration

View file

@ -0,0 +1,130 @@
using System;
using System.Collections.Generic;
using System.Text;
using Dalamud.Plugin.Services;
using Microsoft.Extensions.Logging;
using Serilog.Events;
namespace Questionable;
internal sealed class DalamudLoggerProvider : ILoggerProvider, IDisposable, ISupportExternalScope
{
private sealed class DalamudLogger : ILogger
{
private sealed class NullScope : IDisposable
{
public static NullScope Instance { get; } = new NullScope();
private NullScope()
{
}
public void Dispose()
{
}
}
private readonly string? _name;
private readonly IExternalScopeProvider? _scopeProvider;
private readonly IPluginLog _pluginLog;
public DalamudLogger(string? name, IExternalScopeProvider? scopeProvider, IPluginLog pluginLog)
{
_name = name;
_scopeProvider = scopeProvider;
_pluginLog = pluginLog;
}
public IDisposable BeginScope<TState>(TState state) where TState : notnull
{
return _scopeProvider?.Push(state) ?? NullScope.Instance;
}
public bool IsEnabled(LogLevel logLevel)
{
if (logLevel == LogLevel.None)
{
return false;
}
return ToSerilogLevel(logLevel) >= _pluginLog.MinimumLogLevel;
}
public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
{
if (!IsEnabled(logLevel))
{
return;
}
ArgumentNullException.ThrowIfNull(formatter, "formatter");
LogEventLevel level = ToSerilogLevel(logLevel);
StringBuilder stringBuilder = new StringBuilder();
_scopeProvider?.ForEachScope(delegate(object? scope, StringBuilder builder)
{
if (scope is IEnumerable<KeyValuePair<string, object>> enumerable)
{
{
foreach (KeyValuePair<string, object> item in enumerable)
{
builder.Append('<').Append(item.Key).Append('=')
.Append(item.Value)
.Append("> ");
}
return;
}
}
if (scope != null)
{
builder.Append('<').Append(scope).Append("> ");
}
}, stringBuilder);
if (!string.IsNullOrEmpty(_name))
{
stringBuilder.Append(_name).Append(": ");
}
stringBuilder.Append(formatter(state, null));
_pluginLog.Write(level, exception, stringBuilder.ToString());
}
private static LogEventLevel ToSerilogLevel(LogLevel logLevel)
{
return logLevel switch
{
LogLevel.Trace => LogEventLevel.Verbose,
LogLevel.Debug => LogEventLevel.Debug,
LogLevel.Information => LogEventLevel.Information,
LogLevel.Warning => LogEventLevel.Warning,
LogLevel.Error => LogEventLevel.Error,
LogLevel.Critical => LogEventLevel.Fatal,
_ => throw new ArgumentOutOfRangeException("logLevel", logLevel, null),
};
}
}
private readonly IPluginLog _pluginLog;
private readonly Func<string, string?> _categoryNameFormatter;
private IExternalScopeProvider? _scopeProvider;
public DalamudLoggerProvider(IPluginLog pluginLog, Func<string, string?>? categoryNameFormatter = null)
{
_pluginLog = pluginLog;
_categoryNameFormatter = categoryNameFormatter ?? ((Func<string, string>)((string t) => t));
}
public ILogger CreateLogger(string categoryName)
{
return new DalamudLogger(_categoryNameFormatter(categoryName), _scopeProvider, _pluginLog);
}
public void SetScopeProvider(IExternalScopeProvider scopeProvider)
{
_scopeProvider = scopeProvider;
}
public void Dispose()
{
}
}

View file

@ -1,6 +1,5 @@
using System;
using System.Linq;
using Dalamud.Extensions.MicrosoftLogging;
using Dalamud.Game;
using Dalamud.Game.ClientState.Objects;
using Dalamud.Interface.Windowing;
@ -47,11 +46,15 @@ public sealed class QuestionablePlugin : IDalamudPlugin, IDisposable
ServiceCollection serviceCollection = new ServiceCollection();
serviceCollection.AddLogging(delegate(ILoggingBuilder builder)
{
builder.SetMinimumLevel(LogLevel.Trace).ClearProviders().AddDalamudLogger(pluginLog, delegate(string t)
builder.SetMinimumLevel(LogLevel.Trace).ClearProviders().AddProvider(new DalamudLoggerProvider(pluginLog, delegate(string t)
{
if (t == null)
{
return (string?)null;
}
int num = t.LastIndexOf('.') + 1;
return t.Substring(num, t.Length - num);
});
}));
});
((IServiceCollection)serviceCollection).AddSingleton((IDalamudPlugin)this);
serviceCollection.AddSingleton(pluginInterface);
@ -113,7 +116,6 @@ public sealed class QuestionablePlugin : IDalamudPlugin, IDisposable
serviceCollection.AddSingleton<ArtisanIpc>();
serviceCollection.AddSingleton<QuestionableIpc>();
serviceCollection.AddSingleton<TextAdvanceIpc>();
serviceCollection.AddSingleton<NotificationMasterIpc>();
serviceCollection.AddSingleton<AutomatonIpc>();
serviceCollection.AddSingleton<AutoDutyIpc>();
serviceCollection.AddSingleton<BossModIpc>();

View file

@ -3,7 +3,7 @@ using System.Runtime.CompilerServices;
namespace System.Text.RegularExpressions.Generated;
[GeneratedCode("System.Text.RegularExpressions.Generator", "9.0.13.1716")]
[GeneratedCode("System.Text.RegularExpressions.Generator", "10.0.13.7005")]
[SkipLocalsInit]
internal sealed class _003CRegexGenerator_g_003EFBB8301322196CF81C64F1652C2FA6E1D6BF3907141F781E9D97ABED51BF056C4__MultipleWhitespaceRegex_0 : Regex
{

View file

@ -3,12 +3,12 @@ using System.CodeDom.Compiler;
namespace System.Text.RegularExpressions.Generated;
[GeneratedCode("System.Text.RegularExpressions.Generator", "9.0.13.1716")]
[GeneratedCode("System.Text.RegularExpressions.Generator", "10.0.13.7005")]
internal static class _003CRegexGenerator_g_003EFBB8301322196CF81C64F1652C2FA6E1D6BF3907141F781E9D97ABED51BF056C4__Utilities
{
internal static readonly TimeSpan s_defaultTimeout = ((AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeSpan) ? timeSpan : Regex.InfiniteMatchTimeout);
internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
internal static readonly SearchValues<char> s_whitespace = SearchValues.Create("\t\n\v\f\r \u0085\u00a0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000");
internal static readonly SearchValues<char> s_whitespace = SearchValues.Create("\t\n\v\f\r \u0085\u00a0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000".AsSpan());
}