1
0
Fork 0
forked from aly/qstbak

muffin v7.5.1

This commit is contained in:
alydev 2026-05-01 08:59:48 +10:00
parent a6481e7b9a
commit 965a736f84
59 changed files with 4112 additions and 5059 deletions

View file

@ -43,7 +43,6 @@ internal sealed class SeasonalDutySelectionWindow : LWindow
public SeasonalDutySelectionWindow(SeasonalDutyController seasonalDutyController, SeasonalDutyDefinitionRegistry seasonalDutyDefinitionRegistry, QuestController questController, FateController fateController, MovementController movementController, QuestFunctions questFunctions, QuestData questData, TerritoryData territoryData)
: base("Seasonal Duty Farming###QuestionableSeasonalDutyFarming")
{
//IL_009f: Unknown result type (might be due to invalid IL or missing references)
_seasonalDutyController = seasonalDutyController;
_seasonalDutyDefinitionRegistry = seasonalDutyDefinitionRegistry;
_questController = questController;
@ -54,11 +53,11 @@ internal sealed class SeasonalDutySelectionWindow : LWindow
_territoryData = territoryData;
base.Size = new Vector2(600f, 400f);
base.SizeCondition = ImGuiCond.FirstUseEver;
WindowSizeConstraints value = default(WindowSizeConstraints);
((WindowSizeConstraints)(ref value))._002Ector();
((WindowSizeConstraints)(ref value)).MinimumSize = new Vector2(500f, 300f);
((WindowSizeConstraints)(ref value)).MaximumSize = new Vector2(900f, 700f);
((Window)this).SizeConstraints = value;
base.SizeConstraints = new WindowSizeConstraints
{
MinimumSize = new Vector2(500f, 300f),
MaximumSize = new Vector2(900f, 700f)
};
}
public override void DrawContent()
@ -94,26 +93,18 @@ internal sealed class SeasonalDutySelectionWindow : LWindow
float num2 = (float)ImGui.GetTime();
float num3 = 0.85f + MathF.Sin(num2 * 3f) * 0.15f;
Vector4 col = new Vector4(0f, 1f * num3, 0.3f * num3, 1f);
FontDisposable val = ImRaii.PushFont(UiBuilder.IconFont, true);
try
using (ImRaii.PushFont(UiBuilder.IconFont))
{
ImGui.TextColored(in col, FontAwesomeIcon.Leaf.ToIconString());
}
finally
{
((IDisposable)val)?.Dispose();
}
ImGui.SameLine();
ImGui.TextColored(ImGuiColors.ParsedGreen, _seasonalDutyController.CurrentDuty.Name);
ImGui.SameLine(x - 35f);
ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.Button, Vector4.Zero, true);
try
using (ImRaii.PushColor(ImGuiCol.Button, Vector4.Zero))
{
ColorDisposable val3 = ImRaii.PushColor(ImGuiCol.ButtonHovered, new Vector4(0.8f, 0.3f, 0.3f, 0.4f), true);
try
using (ImRaii.PushColor(ImGuiCol.ButtonHovered, new Vector4(0.8f, 0.3f, 0.3f, 0.4f)))
{
ColorDisposable val4 = ImRaii.PushColor(ImGuiCol.ButtonActive, new Vector4(0.9f, 0.2f, 0.2f, 0.6f), true);
try
using (ImRaii.PushColor(ImGuiCol.ButtonActive, new Vector4(0.9f, 0.2f, 0.2f, 0.6f)))
{
if (ImGuiComponents.IconButton(FontAwesomeIcon.Stop))
{
@ -121,19 +112,7 @@ internal sealed class SeasonalDutySelectionWindow : LWindow
_movementController.Stop();
}
}
finally
{
((IDisposable)val4)?.Dispose();
}
}
finally
{
((IDisposable)val3)?.Dispose();
}
}
finally
{
((IDisposable)val2)?.Dispose();
}
ImGui.SetCursorPosX(ImGui.GetCursorPosX() + 8f);
string value = (_seasonalDutyController.CycleLimit.HasValue ? $"Cycle {_seasonalDutyController.CompletedCycles + 1} / {_seasonalDutyController.CycleLimit}" : $"Cycle {_seasonalDutyController.CompletedCycles + 1}");
@ -161,8 +140,7 @@ internal sealed class SeasonalDutySelectionWindow : LWindow
ImGui.TextColored(in col2, text3);
}
ImGui.SetCursorPosX(ImGui.GetCursorPosX() + 8f);
DisabledDisposable val5 = ImRaii.Disabled(true);
try
using (ImRaii.Disabled(disabled: true))
{
ImGui.AlignTextToFramePadding();
ImGui.TextUnformatted("Cycles:");
@ -170,18 +148,13 @@ internal sealed class SeasonalDutySelectionWindow : LWindow
ImGui.SetNextItemWidth(100f);
ImGui.InputInt("##CycleLimitRunning", ref _cycleLimit, 1, 5);
}
finally
{
((IDisposable)val5)?.Dispose();
}
ImGui.SetCursorPosY(cursorScreenPos.Y + num - ImGui.GetCursorScreenPos().Y + ImGui.GetCursorPosY() + 4f);
ImGui.Spacing();
}
private void DrawControlsStrip()
{
DisabledDisposable val = ImRaii.Disabled(_seasonalDutyController.IsRunning);
try
using (ImRaii.Disabled(_seasonalDutyController.IsRunning))
{
ImGui.AlignTextToFramePadding();
ImGui.TextUnformatted("Cycles:");
@ -195,10 +168,6 @@ internal sealed class SeasonalDutySelectionWindow : LWindow
ImGui.SameLine();
ImGui.TextColored(ImGuiColors.DalamudGrey, (_cycleLimit == 0) ? "(unlimited)" : "");
}
finally
{
((IDisposable)val)?.Dispose();
}
ImGui.Spacing();
}
@ -240,9 +209,6 @@ internal sealed class SeasonalDutySelectionWindow : LWindow
private void DrawDutyTable()
{
//IL_0097: Unknown result type (might be due to invalid IL or missing references)
//IL_009c: Unknown result type (might be due to invalid IL or missing references)
//IL_009d: Unknown result type (might be due to invalid IL or missing references)
List<SeasonalDutyDefinition> list = _seasonalDutyDefinitionRegistry.Definitions.Values.OrderBy(delegate(SeasonalDutyDefinition d)
{
DateTime? eventExpiry = d.EventExpiry;
@ -270,49 +236,40 @@ internal sealed class SeasonalDutySelectionWindow : LWindow
return double.MaxValue;
}).ThenBy<SeasonalDutyDefinition, string>((SeasonalDutyDefinition d) => d.Name, StringComparer.OrdinalIgnoreCase)
.ToList();
TableDisposable val = ImRaii.Table((ImU8String)"SeasonalDutyTable", 4, ImGuiTableFlags.SizingStretchProp | ImGuiTableFlags.RowBg | ImGuiTableFlags.BordersInnerH | ImGuiTableFlags.ScrollY);
try
using ImRaii.TableDisposable tableDisposable = ImRaii.Table("SeasonalDutyTable", 4, ImGuiTableFlags.SizingStretchProp | ImGuiTableFlags.RowBg | ImGuiTableFlags.BordersInnerH | ImGuiTableFlags.ScrollY);
if (!tableDisposable)
{
if (!val)
{
return;
}
ImGui.TableSetupColumn("Name", ImGuiTableColumnFlags.None, 3f);
ImGui.TableSetupColumn("Zone", ImGuiTableColumnFlags.None, 2f);
ImGui.TableSetupColumn("Expiry", ImGuiTableColumnFlags.WidthFixed, 80f);
ImGui.TableSetupColumn("##Actions", ImGuiTableColumnFlags.WidthFixed, 30f);
ImGui.TableHeadersRow();
foreach (SeasonalDutyDefinition item in list)
{
ImGui.TableNextRow();
bool flag = _seasonalDutyController.IsRunning && _seasonalDutyController.CurrentDuty == item;
if (flag)
{
float num = (float)ImGui.GetTime();
float w = 0.1f + MathF.Sin(num * 2.5f) * 0.05f;
ImGui.TableSetBgColor(ImGuiTableBgTarget.RowBg1, ImGui.GetColorU32(new Vector4(0f, 0.85f, 0.3f, w)));
}
ImGui.TableNextColumn();
DrawDutyRowName(item, flag);
ImGui.TableNextColumn();
ImGui.TextUnformatted(_territoryData.GetName(item.TerritoryId) ?? item.Name);
ImGui.TableNextColumn();
DrawDutyRowExpiry(item);
ImGui.TableNextColumn();
bool disabled = _seasonalDutyController.IsRunning || _fateController.IsRunning || _questController.AutomationType != QuestController.EAutomationType.Manual;
DrawDutyRowActions(item, disabled);
}
return;
}
finally
ImGui.TableSetupColumn("Name", ImGuiTableColumnFlags.None, 3f);
ImGui.TableSetupColumn("Zone", ImGuiTableColumnFlags.None, 2f);
ImGui.TableSetupColumn("Expiry", ImGuiTableColumnFlags.WidthFixed, 80f);
ImGui.TableSetupColumn("##Actions", ImGuiTableColumnFlags.WidthFixed, 30f);
ImGui.TableHeadersRow();
foreach (SeasonalDutyDefinition item in list)
{
((TableDisposable)(ref val)).Dispose();
ImGui.TableNextRow();
bool flag = _seasonalDutyController.IsRunning && _seasonalDutyController.CurrentDuty == item;
if (flag)
{
float num = (float)ImGui.GetTime();
float w = 0.1f + MathF.Sin(num * 2.5f) * 0.05f;
ImGui.TableSetBgColor(ImGuiTableBgTarget.RowBg1, ImGui.GetColorU32(new Vector4(0f, 0.85f, 0.3f, w)));
}
ImGui.TableNextColumn();
DrawDutyRowName(item, flag);
ImGui.TableNextColumn();
ImGui.TextUnformatted(_territoryData.GetName(item.TerritoryId) ?? item.Name);
ImGui.TableNextColumn();
DrawDutyRowExpiry(item);
ImGui.TableNextColumn();
bool disabled = _seasonalDutyController.IsRunning || _fateController.IsRunning || _questController.AutomationType != QuestController.EAutomationType.Manual;
DrawDutyRowActions(item, disabled);
}
}
private void DrawDutyRowName(SeasonalDutyDefinition duty, bool isActive)
{
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
//IL_0074: Unknown result type (might be due to invalid IL or missing references)
if (isActive)
{
float num = (float)ImGui.GetTime();
@ -327,8 +284,7 @@ internal sealed class SeasonalDutySelectionWindow : LWindow
{
return;
}
TooltipDisposable val = ImRaii.Tooltip();
try
using (ImRaii.Tooltip())
{
ImGui.TextColored(ImGuiColors.DalamudWhite, duty.Name);
ImGui.Separator();
@ -351,10 +307,6 @@ internal sealed class SeasonalDutySelectionWindow : LWindow
}
}
}
finally
{
((TooltipDisposable)(ref val)).Dispose();
}
}
private static void DrawDutyRowExpiry(SeasonalDutyDefinition duty)
@ -383,23 +335,17 @@ internal sealed class SeasonalDutySelectionWindow : LWindow
private void DrawDutyRowActions(SeasonalDutyDefinition duty, bool disabled)
{
bool flag = duty.RequiredQuestId.HasValue && !_questFunctions.IsQuestComplete(new QuestId(duty.RequiredQuestId.Value));
ImU8String imU8String = new ImU8String(5, 1);
imU8String.AppendLiteral("duty_");
imU8String.AppendFormatted(duty.Name);
IdDisposable val = ImRaii.PushId(imU8String, true);
try
ImU8String id = new ImU8String(5, 1);
id.AppendLiteral("duty_");
id.AppendFormatted(duty.Name);
using (ImRaii.PushId(id))
{
if (flag)
{
FontDisposable val2 = ImRaii.PushFont(UiBuilder.IconFont, true);
try
using (ImRaii.PushFont(UiBuilder.IconFont))
{
ImGui.TextColored(ImGuiColors.DalamudRed, FontAwesomeIcon.Times.ToIconString());
}
finally
{
((IDisposable)val2)?.Dispose();
}
if (ImGui.IsItemHovered())
{
IQuestInfo questInfo;
@ -412,8 +358,7 @@ internal sealed class SeasonalDutySelectionWindow : LWindow
}
return;
}
DisabledDisposable val3 = ImRaii.Disabled(disabled);
try
using (ImRaii.Disabled(disabled))
{
if (ImGuiComponents.IconButton(FontAwesomeIcon.Play))
{
@ -424,10 +369,6 @@ internal sealed class SeasonalDutySelectionWindow : LWindow
_seasonalDutyController.Start(duty, cycleLimit);
}
}
finally
{
((IDisposable)val3)?.Dispose();
}
if (disabled && ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
{
if (_seasonalDutyController.IsRunning)
@ -444,10 +385,6 @@ internal sealed class SeasonalDutySelectionWindow : LWindow
}
}
}
finally
{
((IDisposable)val)?.Dispose();
}
}
private static string FormatElapsed(TimeSpan elapsed)