forked from aly/qstbak
muffin v7.5.0
This commit is contained in:
parent
afafd5e377
commit
a6481e7b9a
67 changed files with 4281 additions and 2372 deletions
|
|
@ -43,6 +43,7 @@ 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;
|
||||
|
|
@ -53,11 +54,11 @@ internal sealed class SeasonalDutySelectionWindow : LWindow
|
|||
_territoryData = territoryData;
|
||||
base.Size = new Vector2(600f, 400f);
|
||||
base.SizeCondition = ImGuiCond.FirstUseEver;
|
||||
base.SizeConstraints = new WindowSizeConstraints
|
||||
{
|
||||
MinimumSize = new Vector2(500f, 300f),
|
||||
MaximumSize = new Vector2(900f, 700f)
|
||||
};
|
||||
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;
|
||||
}
|
||||
|
||||
public override void DrawContent()
|
||||
|
|
@ -93,18 +94,26 @@ 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);
|
||||
using (ImRaii.PushFont(UiBuilder.IconFont))
|
||||
FontDisposable val = ImRaii.PushFont(UiBuilder.IconFont, true);
|
||||
try
|
||||
{
|
||||
ImGui.TextColored(in col, FontAwesomeIcon.Leaf.ToIconString());
|
||||
}
|
||||
finally
|
||||
{
|
||||
((IDisposable)val)?.Dispose();
|
||||
}
|
||||
ImGui.SameLine();
|
||||
ImGui.TextColored(ImGuiColors.ParsedGreen, _seasonalDutyController.CurrentDuty.Name);
|
||||
ImGui.SameLine(x - 35f);
|
||||
using (ImRaii.PushColor(ImGuiCol.Button, Vector4.Zero))
|
||||
ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.Button, Vector4.Zero, true);
|
||||
try
|
||||
{
|
||||
using (ImRaii.PushColor(ImGuiCol.ButtonHovered, new Vector4(0.8f, 0.3f, 0.3f, 0.4f)))
|
||||
ColorDisposable val3 = ImRaii.PushColor(ImGuiCol.ButtonHovered, new Vector4(0.8f, 0.3f, 0.3f, 0.4f), true);
|
||||
try
|
||||
{
|
||||
using (ImRaii.PushColor(ImGuiCol.ButtonActive, new Vector4(0.9f, 0.2f, 0.2f, 0.6f)))
|
||||
ColorDisposable val4 = ImRaii.PushColor(ImGuiCol.ButtonActive, new Vector4(0.9f, 0.2f, 0.2f, 0.6f), true);
|
||||
try
|
||||
{
|
||||
if (ImGuiComponents.IconButton(FontAwesomeIcon.Stop))
|
||||
{
|
||||
|
|
@ -112,7 +121,19 @@ 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}");
|
||||
|
|
@ -140,7 +161,8 @@ internal sealed class SeasonalDutySelectionWindow : LWindow
|
|||
ImGui.TextColored(in col2, text3);
|
||||
}
|
||||
ImGui.SetCursorPosX(ImGui.GetCursorPosX() + 8f);
|
||||
using (ImRaii.Disabled(disabled: true))
|
||||
DisabledDisposable val5 = ImRaii.Disabled(true);
|
||||
try
|
||||
{
|
||||
ImGui.AlignTextToFramePadding();
|
||||
ImGui.TextUnformatted("Cycles:");
|
||||
|
|
@ -148,13 +170,18 @@ 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()
|
||||
{
|
||||
using (ImRaii.Disabled(_seasonalDutyController.IsRunning))
|
||||
DisabledDisposable val = ImRaii.Disabled(_seasonalDutyController.IsRunning);
|
||||
try
|
||||
{
|
||||
ImGui.AlignTextToFramePadding();
|
||||
ImGui.TextUnformatted("Cycles:");
|
||||
|
|
@ -168,6 +195,10 @@ internal sealed class SeasonalDutySelectionWindow : LWindow
|
|||
ImGui.SameLine();
|
||||
ImGui.TextColored(ImGuiColors.DalamudGrey, (_cycleLimit == 0) ? "(unlimited)" : "");
|
||||
}
|
||||
finally
|
||||
{
|
||||
((IDisposable)val)?.Dispose();
|
||||
}
|
||||
ImGui.Spacing();
|
||||
}
|
||||
|
||||
|
|
@ -209,6 +240,9 @@ 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;
|
||||
|
|
@ -236,40 +270,49 @@ internal sealed class SeasonalDutySelectionWindow : LWindow
|
|||
return double.MaxValue;
|
||||
}).ThenBy<SeasonalDutyDefinition, string>((SeasonalDutyDefinition d) => d.Name, StringComparer.OrdinalIgnoreCase)
|
||||
.ToList();
|
||||
using ImRaii.IEndObject endObject = ImRaii.Table("SeasonalDutyTable", 4, ImGuiTableFlags.SizingStretchProp | ImGuiTableFlags.RowBg | ImGuiTableFlags.BordersInnerH | ImGuiTableFlags.ScrollY);
|
||||
if (!endObject)
|
||||
TableDisposable val = ImRaii.Table((ImU8String)"SeasonalDutyTable", 4, ImGuiTableFlags.SizingStretchProp | ImGuiTableFlags.RowBg | ImGuiTableFlags.BordersInnerH | ImGuiTableFlags.ScrollY);
|
||||
try
|
||||
{
|
||||
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)
|
||||
if (!val)
|
||||
{
|
||||
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)));
|
||||
return;
|
||||
}
|
||||
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);
|
||||
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);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
((TableDisposable)(ref val)).Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
|
|
@ -284,7 +327,8 @@ internal sealed class SeasonalDutySelectionWindow : LWindow
|
|||
{
|
||||
return;
|
||||
}
|
||||
using (ImRaii.Tooltip())
|
||||
TooltipDisposable val = ImRaii.Tooltip();
|
||||
try
|
||||
{
|
||||
ImGui.TextColored(ImGuiColors.DalamudWhite, duty.Name);
|
||||
ImGui.Separator();
|
||||
|
|
@ -307,6 +351,10 @@ internal sealed class SeasonalDutySelectionWindow : LWindow
|
|||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
((TooltipDisposable)(ref val)).Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
private static void DrawDutyRowExpiry(SeasonalDutyDefinition duty)
|
||||
|
|
@ -335,17 +383,23 @@ 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 id = new ImU8String(5, 1);
|
||||
id.AppendLiteral("duty_");
|
||||
id.AppendFormatted(duty.Name);
|
||||
using (ImRaii.PushId(id))
|
||||
ImU8String imU8String = new ImU8String(5, 1);
|
||||
imU8String.AppendLiteral("duty_");
|
||||
imU8String.AppendFormatted(duty.Name);
|
||||
IdDisposable val = ImRaii.PushId(imU8String, true);
|
||||
try
|
||||
{
|
||||
if (flag)
|
||||
{
|
||||
using (ImRaii.PushFont(UiBuilder.IconFont))
|
||||
FontDisposable val2 = ImRaii.PushFont(UiBuilder.IconFont, true);
|
||||
try
|
||||
{
|
||||
ImGui.TextColored(ImGuiColors.DalamudRed, FontAwesomeIcon.Times.ToIconString());
|
||||
}
|
||||
finally
|
||||
{
|
||||
((IDisposable)val2)?.Dispose();
|
||||
}
|
||||
if (ImGui.IsItemHovered())
|
||||
{
|
||||
IQuestInfo questInfo;
|
||||
|
|
@ -358,7 +412,8 @@ internal sealed class SeasonalDutySelectionWindow : LWindow
|
|||
}
|
||||
return;
|
||||
}
|
||||
using (ImRaii.Disabled(disabled))
|
||||
DisabledDisposable val3 = ImRaii.Disabled(disabled);
|
||||
try
|
||||
{
|
||||
if (ImGuiComponents.IconButton(FontAwesomeIcon.Play))
|
||||
{
|
||||
|
|
@ -369,6 +424,10 @@ internal sealed class SeasonalDutySelectionWindow : LWindow
|
|||
_seasonalDutyController.Start(duty, cycleLimit);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
((IDisposable)val3)?.Dispose();
|
||||
}
|
||||
if (disabled && ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
|
||||
{
|
||||
if (_seasonalDutyController.IsRunning)
|
||||
|
|
@ -385,6 +444,10 @@ internal sealed class SeasonalDutySelectionWindow : LWindow
|
|||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
((IDisposable)val)?.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
private static string FormatElapsed(TimeSpan elapsed)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue