muffin v7.38.6
This commit is contained in:
parent
ac85eea230
commit
317800fb39
4 changed files with 894 additions and 609 deletions
|
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using Dalamud.Game.Text;
|
||||
using Dalamud.Interface;
|
||||
using Dalamud.Interface.Colors;
|
||||
using Dalamud.Interface.Components;
|
||||
|
|
@ -21,7 +22,7 @@ namespace Questionable.Windows.JournalComponents;
|
|||
|
||||
internal sealed class AlliedSocietyJournalComponent
|
||||
{
|
||||
private static readonly string[] RankNames = new string[8] { "Neutral", "Recognized", "Friendly", "Trusted", "Respected", "Honored", "Sworn", "Allied" };
|
||||
private static readonly string[] RankNames = new string[9] { "Neutral", "Recognized", "Friendly", "Trusted", "Respected", "Honored", "Sworn", "Bloodsworn", "Allied" };
|
||||
|
||||
private const int DefaultDailyQuestLimit = 3;
|
||||
|
||||
|
|
@ -114,12 +115,11 @@ internal sealed class AlliedSocietyJournalComponent
|
|||
if (ImGui.IsItemHovered())
|
||||
{
|
||||
ImGui.BeginTooltip();
|
||||
ImGui.TextUnformatted("Shared across ALL allied societies (all expansions)");
|
||||
ImGui.TextUnformatted("Shared across all allied societies");
|
||||
text = new ImU8String(12, 1);
|
||||
text.AppendLiteral("Used today: ");
|
||||
text.AppendFormatted(value);
|
||||
ImGui.TextUnformatted(text);
|
||||
ImGui.TextUnformatted("Each allied society has a limit of 3 quests per day");
|
||||
ImGui.Spacing();
|
||||
ImGui.Separator();
|
||||
ImGui.Spacing();
|
||||
|
|
@ -174,15 +174,15 @@ internal sealed class AlliedSocietyJournalComponent
|
|||
|
||||
private void DrawQuestList(EAlliedSociety alliedSociety, List<QuestInfo> quests)
|
||||
{
|
||||
if ((int)alliedSociety <= 5)
|
||||
if ((int)alliedSociety <= 4)
|
||||
{
|
||||
byte rank = 1;
|
||||
while (rank <= 8)
|
||||
while (rank <= 4)
|
||||
{
|
||||
List<QuestInfo> list = quests.Where((QuestInfo x) => x.AlliedSocietyRank == rank).ToList();
|
||||
if (list.Count != 0)
|
||||
{
|
||||
ImGui.Text(RankNames[rank - 1]);
|
||||
ImGui.Text(RankNames[rank]);
|
||||
foreach (QuestInfo item in list)
|
||||
{
|
||||
DrawQuest(item);
|
||||
|
|
@ -191,11 +191,46 @@ internal sealed class AlliedSocietyJournalComponent
|
|||
byte b = (byte)(rank + 1);
|
||||
rank = b;
|
||||
}
|
||||
return;
|
||||
}
|
||||
foreach (QuestInfo quest in quests)
|
||||
else if (alliedSociety == EAlliedSociety.Ixal)
|
||||
{
|
||||
DrawQuest(quest);
|
||||
byte rank2 = 1;
|
||||
while (rank2 <= 8)
|
||||
{
|
||||
List<QuestInfo> list2 = quests.Where((QuestInfo x) => x.AlliedSocietyRank == rank2).ToList();
|
||||
if (list2.Count != 0)
|
||||
{
|
||||
ImGui.Text(RankNames[rank2]);
|
||||
foreach (QuestInfo item2 in list2)
|
||||
{
|
||||
DrawQuest(item2);
|
||||
}
|
||||
}
|
||||
byte b = (byte)(rank2 + 1);
|
||||
rank2 = b;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((int)alliedSociety < 6)
|
||||
{
|
||||
return;
|
||||
}
|
||||
byte rank3 = 1;
|
||||
while (rank3 <= 9)
|
||||
{
|
||||
List<QuestInfo> list3 = quests.Where((QuestInfo x) => x.AlliedSocietyRank == rank3).ToList();
|
||||
if (list3.Count != 0)
|
||||
{
|
||||
ImGui.Text(RankNames[rank3]);
|
||||
foreach (QuestInfo item3 in list3)
|
||||
{
|
||||
DrawQuest(item3);
|
||||
}
|
||||
}
|
||||
byte b = (byte)(rank3 + 1);
|
||||
rank3 = b;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -214,7 +249,7 @@ internal sealed class AlliedSocietyJournalComponent
|
|||
{
|
||||
DrawDisabledAddButton();
|
||||
}
|
||||
else if (flag && list.Count > 3)
|
||||
else if (flag)
|
||||
{
|
||||
DrawArrSocietyButtons(alliedSociety, list, dailyLimit, remainingAllowances);
|
||||
}
|
||||
|
|
@ -251,8 +286,13 @@ internal sealed class AlliedSocietyJournalComponent
|
|||
int num = Math.Min(Math.Min(dailyLimit, remainingAllowances), availableQuests.Count);
|
||||
using (ImRaii.Disabled(remainingAllowances == 0))
|
||||
{
|
||||
string text = ((num == remainingAllowances) ? $"Add {num} (Today's Remaining)" : $"Add {num} (Recommended)");
|
||||
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Plus, text))
|
||||
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Plus, num switch
|
||||
{
|
||||
1 => "Add 1 Quest (Optimal)",
|
||||
2 => "Add 2 Quests (Optimal)",
|
||||
3 => "Add 3 Quests (Optimal)",
|
||||
_ => (num != remainingAllowances) ? $"Add {num} (Optimal)" : $"Add {num} (Today's Remaining)",
|
||||
}))
|
||||
{
|
||||
AddQuestsToPriority(alliedSociety, availableQuests.Take(num).ToList());
|
||||
}
|
||||
|
|
@ -262,7 +302,7 @@ internal sealed class AlliedSocietyJournalComponent
|
|||
DrawRecommendedButtonTooltip(num, remainingAllowances, dailyLimit, alliedSociety, availableQuests.Count);
|
||||
}
|
||||
ImGui.SameLine();
|
||||
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.ListOl, $"Add All {availableQuests.Count} (Ignore Limit)"))
|
||||
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.ListOl, $"Add All {availableQuests.Count} Available"))
|
||||
{
|
||||
AddQuestsToPriority(alliedSociety, availableQuests);
|
||||
}
|
||||
|
|
@ -277,50 +317,122 @@ internal sealed class AlliedSocietyJournalComponent
|
|||
ImGui.BeginTooltip();
|
||||
if (remainingAllowances == 0)
|
||||
{
|
||||
ImGui.TextUnformatted("No daily allowances remaining");
|
||||
ImU8String text;
|
||||
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed))
|
||||
{
|
||||
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;
|
||||
ImU8String text = new ImU8String(44, 1);
|
||||
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);
|
||||
}
|
||||
else if (questsToAddCount == remainingAllowances)
|
||||
else if (questsToAddCount == remainingAllowances && questsToAddCount < availableCount)
|
||||
{
|
||||
ImU8String text = new ImU8String(47, 1);
|
||||
text.AppendLiteral("Add ");
|
||||
text.AppendFormatted(questsToAddCount);
|
||||
text.AppendLiteral(" quests - matches your remaining allowances");
|
||||
ImGui.TextUnformatted(text);
|
||||
Vector4 col = ImGuiColors.ParsedGreen;
|
||||
text = new ImU8String(50, 1);
|
||||
ImU8String text;
|
||||
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGreen))
|
||||
{
|
||||
text = new ImU8String(0, 1);
|
||||
text.AppendFormatted(SeIconChar.QuestSync.ToIconString());
|
||||
ImGui.Text(text);
|
||||
ImGui.SameLine();
|
||||
text = new ImU8String(5, 2);
|
||||
text.AppendLiteral("Add ");
|
||||
text.AppendFormatted(questsToAddCount);
|
||||
text.AppendLiteral(" ");
|
||||
text.AppendFormatted((questsToAddCount == 1) ? "quest" : "quests");
|
||||
ImGui.TextUnformatted(text);
|
||||
}
|
||||
Vector4 col = ImGuiColors.DalamudGrey3;
|
||||
text = new ImU8String(44, 2);
|
||||
text.AppendLiteral("You can complete ");
|
||||
text.AppendFormatted(remainingAllowances);
|
||||
text.AppendLiteral(" more allied society quests today");
|
||||
text.AppendLiteral(" more allied society ");
|
||||
text.AppendFormatted((remainingAllowances == 1) ? "quest" : "quests");
|
||||
text.AppendLiteral(" today");
|
||||
ImGui.TextColored(in col, text);
|
||||
ImGui.Spacing();
|
||||
ImGui.TextColored(ImGuiColors.DalamudGrey3, "Prioritises highest rank quests first");
|
||||
}
|
||||
else if (questsToAddCount == dailyLimit)
|
||||
{
|
||||
ImU8String text = new ImU8String(41, 1);
|
||||
text.AppendLiteral("Add ");
|
||||
ImU8String text;
|
||||
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGreen))
|
||||
{
|
||||
text = new ImU8String(0, 1);
|
||||
text.AppendFormatted(SeIconChar.QuestSync.ToIconString());
|
||||
ImGui.Text(text);
|
||||
ImGui.SameLine();
|
||||
text = new ImU8String(11, 1);
|
||||
text.AppendLiteral("Add ");
|
||||
text.AppendFormatted(dailyLimit);
|
||||
text.AppendLiteral(" quests");
|
||||
ImGui.TextUnformatted(text);
|
||||
}
|
||||
Vector4 col = ImGuiColors.DalamudGrey3;
|
||||
text = new ImU8String(51, 2);
|
||||
text.AppendLiteral("This will use ");
|
||||
text.AppendFormatted(dailyLimit);
|
||||
text.AppendLiteral(" quests - using all shared allowances");
|
||||
ImGui.TextUnformatted(text);
|
||||
ImGui.TextColored(ImGuiColors.DalamudGrey3, "This will use all 12 shared allowances");
|
||||
text.AppendLiteral(" of your ");
|
||||
text.AppendFormatted(remainingAllowances);
|
||||
text.AppendLiteral(" remaining shared allowances");
|
||||
ImGui.TextColored(in col, text);
|
||||
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);
|
||||
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);
|
||||
}
|
||||
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);
|
||||
ImGui.Spacing();
|
||||
ImGui.TextColored(ImGuiColors.DalamudGrey3, "Prioritises highest rank quests first");
|
||||
}
|
||||
else
|
||||
{
|
||||
ImU8String text = new ImU8String(12, 2);
|
||||
text.AppendLiteral("Add ");
|
||||
text.AppendFormatted(questsToAddCount);
|
||||
text.AppendLiteral(" ");
|
||||
text.AppendFormatted(alliedSociety);
|
||||
text.AppendLiteral(" quests");
|
||||
ImGui.TextUnformatted(text);
|
||||
ImU8String text;
|
||||
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudYellow))
|
||||
{
|
||||
text = new ImU8String(0, 1);
|
||||
text.AppendFormatted(SeIconChar.BoxedLetterQ.ToIconString());
|
||||
ImGui.Text(text);
|
||||
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);
|
||||
}
|
||||
Vector4 col = ImGuiColors.DalamudGrey3;
|
||||
text = new ImU8String(55, 2);
|
||||
text.AppendLiteral("Limited by available quests (");
|
||||
|
|
@ -340,57 +452,90 @@ internal sealed class AlliedSocietyJournalComponent
|
|||
ImGui.BeginTooltip();
|
||||
if (availableCount > remainingAllowances)
|
||||
{
|
||||
ImU8String text;
|
||||
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudOrange))
|
||||
{
|
||||
ImGuiComponents.IconButtonWithText(FontAwesomeIcon.ExclamationTriangle, "Warning: Exceeds shared allowances");
|
||||
text = new ImU8String(0, 1);
|
||||
text.AppendFormatted(SeIconChar.Cross.ToIconString());
|
||||
ImGui.Text(text);
|
||||
ImGui.SameLine();
|
||||
ImGui.TextUnformatted("Warning: Exceeds remaining allowances");
|
||||
}
|
||||
ImGui.Spacing();
|
||||
ImU8String text = new ImU8String(54, 1);
|
||||
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(47, 1);
|
||||
text = new ImU8String(37, 2);
|
||||
text.AppendLiteral("but you only have ");
|
||||
text.AppendFormatted(remainingAllowances);
|
||||
text.AppendLiteral(" shared allowances remaining.");
|
||||
text.AppendLiteral(" shared ");
|
||||
text.AppendFormatted((remainingAllowances == 1) ? "allowance" : "allowances");
|
||||
text.AppendLiteral(" remaining.");
|
||||
ImGui.TextUnformatted(text);
|
||||
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))
|
||||
{
|
||||
ImGuiComponents.IconButtonWithText(FontAwesomeIcon.ExclamationTriangle, "Warning: Exceeds shared allowances");
|
||||
text = new ImU8String(0, 1);
|
||||
text.AppendFormatted(SeIconChar.Cross.ToIconString());
|
||||
ImGui.Text(text);
|
||||
ImGui.SameLine();
|
||||
ImGui.TextUnformatted("Warning: Exceeds daily optimal amount");
|
||||
}
|
||||
ImGui.Spacing();
|
||||
ImU8String text = new ImU8String(32, 1);
|
||||
text = new ImU8String(32, 1);
|
||||
text.AppendLiteral("This adds all ");
|
||||
text.AppendFormatted(availableCount);
|
||||
text.AppendLiteral(" available quests,");
|
||||
ImGui.TextUnformatted(text);
|
||||
text = new ImU8String(57, 1);
|
||||
text.AppendLiteral("but you can only complete ");
|
||||
text.AppendFormatted(12);
|
||||
text.AppendLiteral(" allied society quests per day.");
|
||||
text = new ImU8String(48, 1);
|
||||
text.AppendLiteral("using more than the typical ");
|
||||
text.AppendFormatted(3);
|
||||
text.AppendLiteral(" quests per society.");
|
||||
ImGui.TextUnformatted(text);
|
||||
ImGui.Spacing();
|
||||
ImGui.TextColored(ImGuiColors.DalamudGrey3, "You'll need multiple days to complete them all.");
|
||||
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);
|
||||
ImGui.TextColored(ImGuiColors.DalamudGrey3, "You may want to save allowances for other societies.");
|
||||
}
|
||||
else
|
||||
{
|
||||
ImU8String text = new ImU8String(26, 2);
|
||||
text.AppendLiteral("Add all ");
|
||||
text.AppendFormatted(availableCount);
|
||||
text.AppendLiteral(" available ");
|
||||
text.AppendFormatted(alliedSociety);
|
||||
text.AppendLiteral(" quests");
|
||||
ImGui.TextUnformatted(text);
|
||||
ImU8String text;
|
||||
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGreen))
|
||||
{
|
||||
ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Check, $"All can be completed today ({remainingAllowances} shared allowances remaining)");
|
||||
text = new ImU8String(0, 1);
|
||||
text.AppendFormatted(SeIconChar.QuestSync.ToIconString());
|
||||
ImGui.Text(text);
|
||||
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);
|
||||
}
|
||||
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);
|
||||
ImGui.TextColored(ImGuiColors.DalamudGrey3, "All can be completed today");
|
||||
}
|
||||
ImGui.EndTooltip();
|
||||
}
|
||||
|
|
@ -399,10 +544,10 @@ internal sealed class AlliedSocietyJournalComponent
|
|||
{
|
||||
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Plus, availableQuests.Count switch
|
||||
{
|
||||
1 => "Add Quest to Priority",
|
||||
2 => "Add Both Quests to Priority",
|
||||
3 => "Add All 3 Quests to Priority",
|
||||
_ => $"Add All {availableQuests.Count} Quests to Priority",
|
||||
1 => "Add 1 Quest",
|
||||
2 => "Add 2 Quests",
|
||||
3 => "Add 3 Quests",
|
||||
_ => $"Add All {availableQuests.Count} Quests",
|
||||
}))
|
||||
{
|
||||
AddQuestsToPriority(alliedSociety, availableQuests);
|
||||
|
|
@ -421,19 +566,41 @@ internal sealed class AlliedSocietyJournalComponent
|
|||
text.AppendFormatted((availableQuests.Count == 1) ? "quest" : "quests");
|
||||
text.AppendLiteral(" to priority");
|
||||
ImGui.TextUnformatted(text);
|
||||
ImGui.Spacing();
|
||||
if (availableQuests.Count <= remainingAllowances)
|
||||
{
|
||||
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGreen))
|
||||
{
|
||||
ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Check, $"Uses {availableQuests.Count} of {remainingAllowances} shared allowances");
|
||||
text = new ImU8String(0, 1);
|
||||
text.AppendFormatted(SeIconChar.QuestSync.ToIconString());
|
||||
ImGui.Text(text);
|
||||
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);
|
||||
}
|
||||
ImGui.TextColored(ImGuiColors.DalamudGrey3, "All can be completed today");
|
||||
}
|
||||
else
|
||||
{
|
||||
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudOrange))
|
||||
{
|
||||
ImGuiComponents.IconButtonWithText(FontAwesomeIcon.ExclamationTriangle, $"Exceeds remaining allowances ({remainingAllowances})");
|
||||
text = new ImU8String(0, 1);
|
||||
text.AppendFormatted(SeIconChar.Cross.ToIconString());
|
||||
ImGui.Text(text);
|
||||
ImGui.SameLine();
|
||||
text = new ImU8String(31, 1);
|
||||
text.AppendLiteral("Exceeds remaining allowances (");
|
||||
text.AppendFormatted(remainingAllowances);
|
||||
text.AppendLiteral(")");
|
||||
ImGui.TextUnformatted(text);
|
||||
}
|
||||
ImGui.TextColored(ImGuiColors.DalamudGrey3, "Some quests won't be completable until tomorrow");
|
||||
}
|
||||
ImGui.EndTooltip();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue