muffin v7.5.0

This commit is contained in:
alydev 2026-05-01 05:17:35 +10:00
parent afafd5e377
commit a6481e7b9a
67 changed files with 4281 additions and 2372 deletions

View file

@ -106,285 +106,398 @@ internal sealed class DutyConfigComponent : ConfigComponent
public override void DrawTab()
{
using ImRaii.IEndObject endObject = ImRaii.TabItem("Duties###Duties");
if (!endObject)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0260: Unknown result type (might be due to invalid IL or missing references)
//IL_0265: Unknown result type (might be due to invalid IL or missing references)
//IL_0267: Unknown result type (might be due to invalid IL or missing references)
//IL_027d: Unknown result type (might be due to invalid IL or missing references)
//IL_0282: Unknown result type (might be due to invalid IL or missing references)
//IL_0284: Unknown result type (might be due to invalid IL or missing references)
//IL_02ae: Unknown result type (might be due to invalid IL or missing references)
//IL_02b3: Unknown result type (might be due to invalid IL or missing references)
//IL_02b5: Unknown result type (might be due to invalid IL or missing references)
//IL_02df: Unknown result type (might be due to invalid IL or missing references)
//IL_02e4: Unknown result type (might be due to invalid IL or missing references)
//IL_02e6: Unknown result type (might be due to invalid IL or missing references)
//IL_0310: Unknown result type (might be due to invalid IL or missing references)
//IL_0315: Unknown result type (might be due to invalid IL or missing references)
//IL_0317: Unknown result type (might be due to invalid IL or missing references)
TabItemDisposable val = ImRaii.TabItem((ImU8String)"Duties###Duties");
try
{
return;
}
bool v = base.Configuration.Duties.RunInstancedContentWithAutoDuty;
if (ImGui.Checkbox("Run instanced content with AutoDuty and BossMod", ref v))
{
base.Configuration.Duties.RunInstancedContentWithAutoDuty = v;
Save();
}
ImGui.SameLine();
ImGuiComponents.HelpMarker("The combat module used for this is configured by AutoDuty, ignoring whichever selection you've made in Questionable's \"General\" configuration.");
using (ImRaii.Disabled(!v))
{
using (ImRaii.PushIndent(ImGui.GetFrameHeight() + ImGui.GetStyle().ItemInnerSpacing.X))
if (!val)
{
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed))
return;
}
bool v = base.Configuration.Duties.RunInstancedContentWithAutoDuty;
if (ImGui.Checkbox("Run instanced content with AutoDuty and BossMod", ref v))
{
base.Configuration.Duties.RunInstancedContentWithAutoDuty = v;
Save();
}
ImGui.SameLine();
ImGuiComponents.HelpMarker("The combat module used for this is configured by AutoDuty, ignoring whichever selection you've made in Questionable's \"General\" configuration.");
DisabledDisposable val2 = ImRaii.Disabled(!v);
try
{
IndentDisposable val3 = ImRaii.PushIndent(ImGui.GetFrameHeight() + ImGui.GetStyle().ItemInnerSpacing.X, true, true);
try
{
ImGui.TextUnformatted("Work in Progress:");
ImGui.BulletText("Duty Support mode is limited.");
ImGui.BulletText("Unsynced modes require being significantly overleveled or having a high-level party member.");
ImGui.BulletText("Most players will need to use Duty Support mode when progressing normally through the game.");
ColorDisposable val4 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed, true);
try
{
ImGui.TextUnformatted("Work in Progress:");
ImGui.BulletText("Duty Support mode is limited.");
ImGui.BulletText("Unsynced modes require being significantly overleveled or having a high-level party member.");
ImGui.BulletText("Most players will need to use Duty Support mode when progressing normally through the game.");
}
finally
{
((IDisposable)val4)?.Dispose();
}
}
finally
{
((IDisposable)val3)?.Dispose();
}
ImGui.Spacing();
bool v2 = base.Configuration.Duties.RunLevelingModeWhenUnderleveled;
if (ImGui.Checkbox("Run AutoDuty Leveling mode when underleveled for MSQ", ref v2))
{
base.Configuration.Duties.RunLevelingModeWhenUnderleveled = v2;
Save();
}
ImGui.SameLine();
ImGuiComponents.HelpMarker("When enabled, Questionable will automatically run AutoDuty's Leveling mode when your character is underleveled for the next Main Scenario Quest.\n\nLeveling mode runs the highest available dungeon for your level to gain XP.\n\nThis is useful for characters without the Road to 90 XP buff who may not have enough XP to continue the MSQ.");
ImGui.Spacing();
ImGui.Text("Default duty mode:");
ImGui.SameLine();
int currentItem = (int)base.Configuration.Duties.DefaultDutyMode;
ImGui.SetNextItemWidth(200f);
if (ImGui.Combo((ImU8String)"##DefaultDutyMode", ref currentItem, (ReadOnlySpan<string>)DutyModeLabels, DutyModeLabels.Length))
{
base.Configuration.Duties.DefaultDutyMode = (EDutyMode)currentItem;
Save();
}
ImGui.SameLine();
ImGuiComponents.HelpMarker("\ufffd Duty Support: Run with NPC party members (level synced)\n\ufffd Unsync (Solo): Run alone at your current level (unsynced)\n\ufffd Unsync (Party): Run with your party at current level (unsynced)\n\nYou can override this setting for individual duties below.");
}
ImGui.Spacing();
bool v2 = base.Configuration.Duties.RunLevelingModeWhenUnderleveled;
if (ImGui.Checkbox("Run AutoDuty Leveling mode when underleveled for MSQ", ref v2))
finally
{
base.Configuration.Duties.RunLevelingModeWhenUnderleveled = v2;
Save();
}
ImGui.SameLine();
ImGuiComponents.HelpMarker("When enabled, Questionable will automatically run AutoDuty's Leveling mode when your character is underleveled for the next Main Scenario Quest.\n\nLeveling mode runs the highest available dungeon for your level to gain XP.\n\nThis is useful for characters without the Road to 90 XP buff who may not have enough XP to continue the MSQ.");
ImGui.Spacing();
ImGui.Text("Default duty mode:");
ImGui.SameLine();
int currentItem = (int)base.Configuration.Duties.DefaultDutyMode;
ImGui.SetNextItemWidth(200f);
if (ImGui.Combo((ImU8String)"##DefaultDutyMode", ref currentItem, (ReadOnlySpan<string>)DutyModeLabels, DutyModeLabels.Length))
{
base.Configuration.Duties.DefaultDutyMode = (EDutyMode)currentItem;
Save();
}
ImGui.SameLine();
ImGuiComponents.HelpMarker("\ufffd Duty Support: Run with NPC party members (level synced)\n\ufffd Unsync (Solo): Run alone at your current level (unsynced)\n\ufffd Unsync (Party): Run with your party at current level (unsynced)\n\nYou can override this setting for individual duties below.");
}
ImGui.Separator();
using (ImRaii.Disabled(!v))
{
ImGui.Text("Questionable includes a default list of duties that work if AutoDuty and BossMod are installed.");
ImGui.Text("The included list of duties can change with each update, and is based on the following spreadsheet:");
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.GlobeEurope, "Open AutoDuty spreadsheet"))
{
Util.OpenLink("https://docs.google.com/spreadsheets/d/151RlpqRcCpiD_VbQn6Duf-u-S71EP7d0mx3j1PDNoNA/edit?pli=1#gid=0");
((IDisposable)val2)?.Dispose();
}
ImGui.Separator();
ImGui.Text("You can override the settings for each individual duty:");
using ImRaii.IEndObject endObject2 = ImRaii.TabBar("DutyTypeTabs");
if (endObject2)
val2 = ImRaii.Disabled(!v);
try
{
using (ImRaii.IEndObject endObject3 = ImRaii.TabItem("Dungeons"))
ImGui.Text("Questionable includes a default list of duties that work if AutoDuty and BossMod are installed.");
ImGui.Text("The included list of duties can change with each update, and is based on the following spreadsheet:");
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.GlobeEurope, "Open AutoDuty spreadsheet"))
{
if (endObject3)
{
DrawConfigTable(v, _contentFinderConditionNames);
}
Util.OpenLink("https://docs.google.com/spreadsheets/d/151RlpqRcCpiD_VbQn6Duf-u-S71EP7d0mx3j1PDNoNA/edit?pli=1#gid=0");
}
using (ImRaii.IEndObject endObject4 = ImRaii.TabItem("Trials"))
ImGui.Separator();
ImGui.Text("You can override the settings for each individual duty:");
TabBarDisposable val5 = ImRaii.TabBar((ImU8String)"DutyTypeTabs");
try
{
if (endObject4)
if (TabBarDisposable.op_Implicit(val5))
{
DrawConfigTable(v, _allTrialNames);
TabItemDisposable val6 = ImRaii.TabItem((ImU8String)"Dungeons");
try
{
if (TabItemDisposable.op_Implicit(val6))
{
DrawConfigTable(v, _contentFinderConditionNames);
}
}
finally
{
((TabItemDisposable)(ref val6)).Dispose();
}
TabItemDisposable val7 = ImRaii.TabItem((ImU8String)"Trials");
try
{
if (TabItemDisposable.op_Implicit(val7))
{
DrawConfigTable(v, _allTrialNames);
}
}
finally
{
((TabItemDisposable)(ref val7)).Dispose();
}
TabItemDisposable val8 = ImRaii.TabItem((ImU8String)"Normal Raids");
try
{
if (TabItemDisposable.op_Implicit(val8))
{
DrawConfigTable(v, _allNormalRaidNames);
}
}
finally
{
((TabItemDisposable)(ref val8)).Dispose();
}
TabItemDisposable val9 = ImRaii.TabItem((ImU8String)"Alliance Raids");
try
{
if (TabItemDisposable.op_Implicit(val9))
{
DrawConfigTable(v, _allAllianceRaidNames);
}
}
finally
{
((TabItemDisposable)(ref val9)).Dispose();
}
}
DrawEnableAllButton();
ImGui.SameLine();
DrawClipboardButtons();
ImGui.SameLine();
DrawResetButton();
}
using (ImRaii.IEndObject endObject5 = ImRaii.TabItem("Normal Raids"))
finally
{
if (endObject5)
{
DrawConfigTable(v, _allNormalRaidNames);
}
}
using ImRaii.IEndObject endObject6 = ImRaii.TabItem("Alliance Raids");
if (endObject6)
{
DrawConfigTable(v, _allAllianceRaidNames);
((TabBarDisposable)(ref val5)).Dispose();
}
}
DrawEnableAllButton();
ImGui.SameLine();
DrawClipboardButtons();
ImGui.SameLine();
DrawResetButton();
finally
{
((IDisposable)val2)?.Dispose();
}
}
finally
{
((TabItemDisposable)(ref val)).Dispose();
}
}
private void DrawConfigTable(bool runInstancedContentWithAutoDuty, Dictionary<EExpansionVersion, List<DutyInfo>> contentByExpansion)
{
using ImRaii.IEndObject endObject = ImRaii.Child("DutyConfiguration", new Vector2(725f, 400f), border: true);
if (!endObject)
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_014f: Unknown result type (might be due to invalid IL or missing references)
//IL_0154: Unknown result type (might be due to invalid IL or missing references)
//IL_0156: Unknown result type (might be due to invalid IL or missing references)
//IL_02bc: Unknown result type (might be due to invalid IL or missing references)
//IL_02c1: Unknown result type (might be due to invalid IL or missing references)
ChildDisposable val = ImRaii.Child((ImU8String)"DutyConfiguration", new Vector2(725f, 400f), true);
try
{
return;
}
EExpansionVersion[] values = Enum.GetValues<EExpansionVersion>();
for (int i = 0; i < values.Length; i++)
{
EExpansionVersion eExpansionVersion = values[i];
(int enabledCount, int totalCount) dutyCountsForExpansion = GetDutyCountsForExpansion(eExpansionVersion, contentByExpansion);
int item = dutyCountsForExpansion.enabledCount;
int item2 = dutyCountsForExpansion.totalCount;
string obj = ((item2 > 0) ? $"{eExpansionVersion.ToFriendlyString()} ({item}/{item2})" : eExpansionVersion.ToFriendlyString());
string key = eExpansionVersion.ToString();
ImGui.SetNextItemOpen(base.Configuration.Duties.ExpansionHeaderStates.GetValueOrDefault(key, defaultValue: false), ImGuiCond.Always);
if (ImGui.CollapsingHeader(obj))
if (!val)
{
if (!base.Configuration.Duties.ExpansionHeaderStates.GetValueOrDefault(key, defaultValue: false))
return;
}
EExpansionVersion[] values = Enum.GetValues<EExpansionVersion>();
for (int i = 0; i < values.Length; i++)
{
EExpansionVersion eExpansionVersion = values[i];
(int enabledCount, int totalCount) dutyCountsForExpansion = GetDutyCountsForExpansion(eExpansionVersion, contentByExpansion);
int item = dutyCountsForExpansion.enabledCount;
int item2 = dutyCountsForExpansion.totalCount;
string obj = ((item2 > 0) ? $"{eExpansionVersion.ToFriendlyString()} ({item}/{item2})" : eExpansionVersion.ToFriendlyString());
string key = eExpansionVersion.ToString();
ImGui.SetNextItemOpen(base.Configuration.Duties.ExpansionHeaderStates.GetValueOrDefault(key, defaultValue: false), ImGuiCond.Always);
if (ImGui.CollapsingHeader(obj))
{
base.Configuration.Duties.ExpansionHeaderStates[key] = true;
Save();
}
ImU8String table = new ImU8String(6, 1);
table.AppendLiteral("Duties");
table.AppendFormatted(eExpansionVersion);
using ImRaii.IEndObject endObject2 = ImRaii.Table(table, 3, ImGuiTableFlags.SizingFixedFit);
if (!ImRaii.IEndObject.op_True(endObject2))
{
continue;
}
ImGui.TableSetupColumn("Name", ImGuiTableColumnFlags.WidthStretch);
ImGui.TableSetupColumn("Enabled", ImGuiTableColumnFlags.WidthFixed, 200f);
ImGui.TableSetupColumn("Mode", ImGuiTableColumnFlags.WidthFixed, 150f);
if (!contentByExpansion.TryGetValue(eExpansionVersion, out List<DutyInfo> value))
{
continue;
}
foreach (DutyInfo item3 in value)
{
item3.Deconstruct(out uint CfcId, out uint TerritoryId, out string Name);
uint num = CfcId;
uint value2 = TerritoryId;
string text = Name;
DutyOptions dutyOptions;
bool flag = _questRegistry.TryGetDutyByContentFinderConditionId(num, out dutyOptions);
ImGui.TableNextRow();
string[] array;
int currentItem;
if (flag)
if (!base.Configuration.Duties.ExpansionHeaderStates.GetValueOrDefault(key, defaultValue: false))
{
array = (dutyOptions.Enabled ? SupportedCfcOptions : UnsupportedCfcOptions);
currentItem = 0;
if (base.Configuration.Duties.WhitelistedDutyCfcIds.Contains(num))
{
currentItem = 1;
}
if (base.Configuration.Duties.BlacklistedDutyCfcIds.Contains(num))
{
currentItem = 2;
}
base.Configuration.Duties.ExpansionHeaderStates[key] = true;
Save();
}
else
ImU8String imU8String = new ImU8String(6, 1);
imU8String.AppendLiteral("Duties");
imU8String.AppendFormatted(eExpansionVersion);
TableDisposable val2 = ImRaii.Table(imU8String, 3, ImGuiTableFlags.SizingFixedFit);
try
{
array = new string[2] { "Disabled", "Enabled" };
currentItem = (base.Configuration.Duties.WhitelistedDutyCfcIds.Contains(num) ? 1 : 0);
}
if (ImGui.TableNextColumn())
{
ImGui.AlignTextToFramePadding();
ImGui.TextUnformatted(text);
if (ImGui.IsItemHovered() && base.Configuration.Advanced.AdditionalStatusInformation)
if (!TableDisposable.op_Implicit(val2))
{
using ImRaii.IEndObject endObject3 = ImRaii.Tooltip();
if (endObject3)
continue;
}
ImGui.TableSetupColumn("Name", ImGuiTableColumnFlags.WidthStretch);
ImGui.TableSetupColumn("Enabled", ImGuiTableColumnFlags.WidthFixed, 200f);
ImGui.TableSetupColumn("Mode", ImGuiTableColumnFlags.WidthFixed, 150f);
if (!contentByExpansion.TryGetValue(eExpansionVersion, out List<DutyInfo> value))
{
continue;
}
foreach (DutyInfo item3 in value)
{
item3.Deconstruct(out uint CfcId, out uint TerritoryId, out string Name);
uint num = CfcId;
uint value2 = TerritoryId;
string text = Name;
DutyOptions dutyOptions;
bool flag = _questRegistry.TryGetDutyByContentFinderConditionId(num, out dutyOptions);
ImGui.TableNextRow();
string[] array;
int currentItem;
if (flag)
{
ImGui.TextUnformatted(text);
ImGui.Separator();
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)
array = (dutyOptions.Enabled ? SupportedCfcOptions : UnsupportedCfcOptions);
currentItem = 0;
if (base.Configuration.Duties.WhitelistedDutyCfcIds.Contains(num))
{
ImGui.BulletText("Duty Support: Available");
currentItem = 1;
}
}
}
if (runInstancedContentWithAutoDuty && !_autoDutyIpc.HasPath(num))
{
ImGuiComponents.HelpMarker("This duty is not supported by AutoDuty", FontAwesomeIcon.Times, ImGuiColors.DalamudRed);
}
else if (flag && dutyOptions.Notes.Count > 0)
{
ConfigComponent.DrawNotes(dutyOptions.Enabled, dutyOptions.Notes);
}
}
if (ImGui.TableNextColumn())
{
ImU8String id = new ImU8String(16, 1);
id.AppendLiteral("##DungeonEnabled");
id.AppendFormatted(num);
using (ImRaii.PushId(id))
{
ImGui.SetNextItemWidth(200f);
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);
if (flag)
if (base.Configuration.Duties.BlacklistedDutyCfcIds.Contains(num))
{
switch (currentItem)
{
case 1:
base.Configuration.Duties.WhitelistedDutyCfcIds.Add(num);
break;
case 2:
base.Configuration.Duties.BlacklistedDutyCfcIds.Add(num);
break;
}
currentItem = 2;
}
else if (currentItem == 1)
{
base.Configuration.Duties.WhitelistedDutyCfcIds.Add(num);
}
Save();
}
}
}
if (!ImGui.TableNextColumn())
{
continue;
}
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);
EDutyMode num2 = (flag2 ? value3 : ((EDutyMode)(-1)));
Name = "Use Default";
string[] dutyModeLabels = DutyModeLabels;
int num3 = 0;
string[] array2 = new string[1 + dutyModeLabels.Length];
array2[num3] = Name;
num3++;
ReadOnlySpan<string> readOnlySpan = new ReadOnlySpan<string>(dutyModeLabels);
readOnlySpan.CopyTo(new Span<string>(array2).Slice(num3, readOnlySpan.Length));
num3 += readOnlySpan.Length;
string[] array3 = array2;
int currentItem2 = (int)(num2 + 1);
ImGui.SetNextItemWidth(150f);
if (ImGui.Combo((ImU8String)string.Empty, ref currentItem2, (ReadOnlySpan<string>)array3, array3.Length))
{
if (currentItem2 == 0)
{
base.Configuration.Duties.DutyModeOverrides.Remove(num);
}
else
{
base.Configuration.Duties.DutyModeOverrides[num] = (EDutyMode)(currentItem2 - 1);
array = new string[2] { "Disabled", "Enabled" };
currentItem = (base.Configuration.Duties.WhitelistedDutyCfcIds.Contains(num) ? 1 : 0);
}
if (ImGui.TableNextColumn())
{
ImGui.AlignTextToFramePadding();
ImGui.TextUnformatted(text);
if (ImGui.IsItemHovered() && base.Configuration.Advanced.AdditionalStatusInformation)
{
TooltipDisposable val3 = ImRaii.Tooltip();
try
{
if (((TooltipDisposable)(ref val3)).Alive)
{
ImGui.TextUnformatted(text);
ImGui.Separator();
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");
}
}
}
finally
{
((TooltipDisposable)(ref val3)).Dispose();
}
}
if (runInstancedContentWithAutoDuty && !_autoDutyIpc.HasPath(num))
{
ImGuiComponents.HelpMarker("This duty is not supported by AutoDuty", FontAwesomeIcon.Times, (Vector4?)ImGuiColors.DalamudRed);
}
else if (flag && dutyOptions.Notes.Count > 0)
{
ConfigComponent.DrawNotes(dutyOptions.Enabled, dutyOptions.Notes);
}
}
if (ImGui.TableNextColumn())
{
ImU8String imU8String2 = new ImU8String(16, 1);
imU8String2.AppendLiteral("##DungeonEnabled");
imU8String2.AppendFormatted(num);
IdDisposable val4 = ImRaii.PushId(imU8String2, true);
try
{
ImGui.SetNextItemWidth(200f);
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);
if (flag)
{
switch (currentItem)
{
case 1:
base.Configuration.Duties.WhitelistedDutyCfcIds.Add(num);
break;
case 2:
base.Configuration.Duties.BlacklistedDutyCfcIds.Add(num);
break;
}
}
else if (currentItem == 1)
{
base.Configuration.Duties.WhitelistedDutyCfcIds.Add(num);
}
Save();
}
}
finally
{
((IDisposable)val4)?.Dispose();
}
}
if (!ImGui.TableNextColumn())
{
continue;
}
ImU8String imU8String3 = new ImU8String(13, 1);
imU8String3.AppendLiteral("##DungeonMode");
imU8String3.AppendFormatted(num);
IdDisposable val5 = ImRaii.PushId(imU8String3, true);
try
{
EDutyMode value3;
bool flag2 = base.Configuration.Duties.DutyModeOverrides.TryGetValue(num, out value3);
EDutyMode num2 = (flag2 ? value3 : ((EDutyMode)(-1)));
Name = "Use Default";
string[] dutyModeLabels = DutyModeLabels;
int num3 = 0;
string[] array2 = new string[1 + dutyModeLabels.Length];
array2[num3] = Name;
num3++;
ReadOnlySpan<string> readOnlySpan = new ReadOnlySpan<string>(dutyModeLabels);
readOnlySpan.CopyTo(new Span<string>(array2).Slice(num3, readOnlySpan.Length));
num3 += readOnlySpan.Length;
string[] array3 = array2;
int currentItem2 = (int)(num2 + 1);
ImGui.SetNextItemWidth(150f);
if (ImGui.Combo((ImU8String)string.Empty, ref currentItem2, (ReadOnlySpan<string>)array3, array3.Length))
{
if (currentItem2 == 0)
{
base.Configuration.Duties.DutyModeOverrides.Remove(num);
}
else
{
base.Configuration.Duties.DutyModeOverrides[num] = (EDutyMode)(currentItem2 - 1);
}
Save();
}
if (ImGui.IsItemHovered())
{
EDutyMode eDutyMode = (flag2 ? value3 : base.Configuration.Duties.DefaultDutyMode);
ImGui.SetTooltip(flag2 ? ("Override: " + DutyModeLabels[(int)eDutyMode]) : ("Using default: " + DutyModeLabels[(int)eDutyMode]));
}
}
finally
{
((IDisposable)val5)?.Dispose();
}
Save();
}
if (ImGui.IsItemHovered())
{
EDutyMode eDutyMode = (flag2 ? value3 : base.Configuration.Duties.DefaultDutyMode);
ImGui.SetTooltip(flag2 ? ("Override: " + DutyModeLabels[(int)eDutyMode]) : ("Using default: " + DutyModeLabels[(int)eDutyMode]));
}
}
finally
{
((TableDisposable)(ref val2)).Dispose();
}
}
else if (base.Configuration.Duties.ExpansionHeaderStates.GetValueOrDefault(key, defaultValue: false))
{
base.Configuration.Duties.ExpansionHeaderStates[key] = false;
Save();
}
}
else if (base.Configuration.Duties.ExpansionHeaderStates.GetValueOrDefault(key, defaultValue: false))
{
base.Configuration.Duties.ExpansionHeaderStates[key] = false;
Save();
}
}
finally
{
((ChildDisposable)(ref val)).Dispose();
}
}
@ -441,7 +554,8 @@ internal sealed class DutyConfigComponent : ConfigComponent
private void DrawClipboardButtons()
{
using (ImRaii.Disabled(base.Configuration.Duties.WhitelistedDutyCfcIds.Count + base.Configuration.Duties.BlacklistedDutyCfcIds.Count + base.Configuration.Duties.DutyModeOverrides.Count == 0))
DisabledDisposable val = ImRaii.Disabled(base.Configuration.Duties.WhitelistedDutyCfcIds.Count + base.Configuration.Duties.BlacklistedDutyCfcIds.Count + base.Configuration.Duties.DutyModeOverrides.Count == 0);
try
{
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Copy, "Export to clipboard"))
{
@ -451,9 +565,14 @@ internal sealed class DutyConfigComponent : ConfigComponent
ImGui.SetClipboardText("qst:duty:" + Convert.ToBase64String(Encoding.UTF8.GetBytes(string.Join(";", first.Concat(second).Concat(second2)))));
}
}
finally
{
((IDisposable)val)?.Dispose();
}
ImGui.SameLine();
string text = ImGui.GetClipboardText().Trim();
using (ImRaii.Disabled(string.IsNullOrEmpty(text) || !text.StartsWith("qst:duty:", StringComparison.InvariantCulture)))
val = ImRaii.Disabled(string.IsNullOrEmpty(text) || !text.StartsWith("qst:duty:", StringComparison.InvariantCulture));
try
{
if (!ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Paste, "Import from Clipboard"))
{
@ -492,11 +611,16 @@ internal sealed class DutyConfigComponent : ConfigComponent
}
Save();
}
finally
{
((IDisposable)val)?.Dispose();
}
}
private void DrawResetButton()
{
using (ImRaii.Disabled(!ImGui.IsKeyDown(ImGuiKey.ModCtrl)))
DisabledDisposable val = ImRaii.Disabled(!ImGui.IsKeyDown(ImGuiKey.ModCtrl));
try
{
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Undo, "Reset to default"))
{
@ -507,6 +631,10 @@ internal sealed class DutyConfigComponent : ConfigComponent
Save();
}
}
finally
{
((IDisposable)val)?.Dispose();
}
if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
{
ImGui.SetTooltip("Hold CTRL to enable this button.");