Compare commits

..

No commits in common. "master" and "v5.8" have entirely different histories.
master ... v5.8

10 changed files with 137 additions and 149 deletions

View File

@ -1,6 +1,6 @@
<Project Sdk="Dalamud.NET.Sdk/11.0.0"> <Project Sdk="Dalamud.NET.Sdk/9.0.2">
<PropertyGroup> <PropertyGroup>
<Version>6.0</Version> <Version>5.8</Version>
<OutputPath>dist</OutputPath> <OutputPath>dist</OutputPath>
</PropertyGroup> </PropertyGroup>

View File

@ -109,10 +109,9 @@ partial class AutoRetainerControlPlugin
save = true; save = true;
} }
int displayOrder = offlineCharacterData.RetainerData.IndexOf(retainerData); if (retainer.DisplayOrder != retainerData.DisplayOrder)
if (retainer.DisplayOrder != displayOrder)
{ {
retainer.DisplayOrder = displayOrder; retainer.DisplayOrder = retainerData.DisplayOrder;
save = true; save = true;
} }

View File

@ -1,7 +1,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Dalamud.Plugin.Services; using Dalamud.Plugin.Services;
using Lumina.Excel.Sheets; using Lumina.Excel.GeneratedSheets;
namespace ARControl.GameData; namespace ARControl.GameData;
@ -9,27 +9,27 @@ internal sealed class GameCache
{ {
public GameCache(IDataManager dataManager) public GameCache(IDataManager dataManager)
{ {
Jobs = dataManager.GetExcelSheet<ClassJob>().ToDictionary(x => x.RowId, x => x.Abbreviation.ToString()); Jobs = dataManager.GetExcelSheet<ClassJob>()!.ToDictionary(x => x.RowId, x => x.Abbreviation.ToString());
Ventures = dataManager.GetExcelSheet<RetainerTask>() Ventures = dataManager.GetExcelSheet<RetainerTask>()!
.Where(x => x.RowId > 0 && !x.IsRandom && x.Task.RowId != 0) .Where(x => x.RowId > 0 && !x.IsRandom && x.Task != 0)
.Select(x => new Venture(dataManager, x)) .Select(x => new Venture(dataManager, x))
.ToList() .ToList()
.AsReadOnly(); .AsReadOnly();
ItemsToGather = dataManager.GetExcelSheet<GatheringItem>() ItemsToGather = dataManager.GetExcelSheet<GatheringItem>()!
.Where(x => x.RowId > 0 && x.RowId < 10_000 && x.Item.RowId != 0) .Where(x => x.RowId > 0 && x.RowId < 10_000 && x.Item != 0 && x.Quest.Row == 0)
.Where(x => Ventures.Any(y => y.ItemId == x.Item.RowId)) .Where(x => Ventures.Any(y => y.ItemId == x.Item))
.Select(x => new ItemToGather(x)) .Select(x => new ItemToGather(dataManager, x))
.OrderBy(x => x.Name) .OrderBy(x => x.Name)
.ToList() .ToList()
.AsReadOnly(); .AsReadOnly();
FolkloreBooks = dataManager.GetExcelSheet<GatheringSubCategory>() FolkloreBooks = dataManager.GetExcelSheet<GatheringSubCategory>()!
.Where(x => x.RowId > 0) .Where(x => x.RowId > 0)
.Where(x => x.Item.RowId != 0) .Where(x => x.Item.Row != 0)
.Select(x => new .Select(x => new
{ {
x.RowId, x.RowId,
ItemId = x.Item.RowId, ItemId = x.Item.Row,
ItemName = x.Item.Value.Name.ToString() ItemName = x.Item.Value!.Name.ToString()
}) })
.GroupBy(x => (x.ItemId, x.ItemName)) .GroupBy(x => (x.ItemId, x.ItemName))
.Select(x => .Select(x =>
@ -41,23 +41,23 @@ internal sealed class GameCache
}) })
.ToDictionary(x => x.ItemId, x => x); .ToDictionary(x => x.ItemId, x => x);
var gatheringNodes = dataManager.GetExcelSheet<GatheringPointBase>() var gatheringNodes = dataManager.GetExcelSheet<GatheringPointBase>()!
.Where(x => x.RowId > 0 && x.GatheringType.RowId <= 3) .Where(x => x.RowId > 0 && x.GatheringType.Row <= 3)
.Select(x => .Select(x =>
new new
{ {
GatheringPointBaseId = x.RowId, GatheringPointBaseId = x.RowId,
GatheringPoint = GatheringPoint =
dataManager.GetExcelSheet<GatheringPoint>().Cast<GatheringPoint?>().FirstOrDefault(y => dataManager.GetExcelSheet<GatheringPoint>()!.FirstOrDefault(y =>
y!.Value.GatheringPointBase.RowId == x.RowId), y.GatheringPointBase.Row == x.RowId),
Items = x.Item.Where(y => y.RowId > 0).ToList() Items = x.Item.Where(y => y > 0).ToList()
}) })
.Where(x => x.GatheringPoint != null) .Where(x => x.GatheringPoint != null)
.Select(x => .Select(x =>
new new
{ {
x.GatheringPointBaseId, x.GatheringPointBaseId,
CategoryId = (ushort)x.GatheringPoint!.Value.GatheringSubCategory.RowId, CategoryId = (ushort)x.GatheringPoint!.GatheringSubCategory.Row,
x.Items, x.Items,
}) })
.ToList(); .ToList();
@ -73,13 +73,13 @@ internal sealed class GameCache
new new
{ {
x.CategoryId, x.CategoryId,
ItemId = y.RowId ItemId = (uint)y
})) }))
.GroupBy(x => x.CategoryId) .GroupBy(x => x.CategoryId)
.ToDictionary(x => x.Key, x => x.Select(y => y.ItemId).ToList()); .ToDictionary(x => x.Key, x => x.Select(y => y.ItemId).ToList());
foreach (var book in FolkloreBooks.Values) foreach (var book in FolkloreBooks.Values)
{ {
book.TomeId = dataManager.GetExcelSheet<Item>().GetRow(book.ItemId).ItemAction.Value.Data[0]; book.TomeId = dataManager.GetExcelSheet<Item>()!.GetRow(book.ItemId)!.ItemAction.Value!.Data[0];
foreach (var category in book.GatheringSubCategories) foreach (var category in book.GatheringSubCategories)
{ {
if (itemsWithTomes.TryGetValue(category, out var itemsInCategory)) if (itemsWithTomes.TryGetValue(category, out var itemsInCategory))

View File

@ -1,20 +1,19 @@
using Lumina.Excel.Sheets; using Dalamud.Plugin.Services;
using Lumina.Excel.GeneratedSheets;
namespace ARControl.GameData; namespace ARControl.GameData;
internal sealed class ItemToGather internal sealed class ItemToGather
{ {
public ItemToGather(GatheringItem item) public ItemToGather(IDataManager dataManager, GatheringItem item)
{ {
GatheredItemId = item.RowId; GatheredItemId = item.RowId;
ItemId = item.Item;
var itemRef = item.Item.GetValueOrDefault<Item>()!.Value; Name = dataManager.GetExcelSheet<Item>()!.GetRow((uint)item.Item)!.Name.ToString();
ItemId = itemRef.RowId;
Name = itemRef.Name.ToString();
} }
public uint GatheredItemId { get; } public uint GatheredItemId { get; }
public uint ItemId { get; } public int ItemId { get; }
public string Name { get; } public string Name { get; }
} }

View File

@ -1,6 +1,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using Dalamud.Plugin.Services; using Dalamud.Plugin.Services;
using Lumina.Excel.Sheets; using Lumina.Excel.GeneratedSheets;
namespace ARControl.GameData; namespace ARControl.GameData;
@ -9,14 +9,13 @@ internal sealed class Venture
public Venture(IDataManager dataManager, RetainerTask retainerTask) public Venture(IDataManager dataManager, RetainerTask retainerTask)
{ {
RowId = retainerTask.RowId; RowId = retainerTask.RowId;
Category = retainerTask.ClassJobCategory.Value; Category = retainerTask.ClassJobCategory.Value!;
RetainerTaskNormal taskDetails = var taskDetails = dataManager.GetExcelSheet<RetainerTaskNormal>()!.GetRow(retainerTask.Task)!;
dataManager.GetExcelSheet<RetainerTaskNormal>().GetRow(retainerTask.Task.RowId); var taskParameters = retainerTask.RetainerTaskParameter.Value!;
RetainerTaskParameter taskParameters = retainerTask.RetainerTaskParameter.Value; ItemId = taskDetails.Item.Row;
ItemId = taskDetails.Item.RowId; IconId = taskDetails.Item.Value!.Icon;
IconId = taskDetails.Item.Value.Icon; Name = taskDetails.Item.Value!.Name.ToString();
Name = taskDetails.Item.Value.Name.ToString();
Level = retainerTask.RetainerLevel; Level = retainerTask.RetainerLevel;
ItemLevelCombat = retainerTask.RequiredItemLevel; ItemLevelCombat = retainerTask.RequiredItemLevel;
RequiredGathering = retainerTask.RequiredGathering; RequiredGathering = retainerTask.RequiredGathering;

View File

@ -84,123 +84,114 @@ internal sealed class LockedItemsTab : ITab
.ToList(); .ToList();
if (checkPerCharacter) if (checkPerCharacter)
DrawPerCharacter(charactersToCheck, itemsToCheck, onlyShowMissing);
else
DrawPerItem(charactersToCheck, itemsToCheck, onlyShowMissing);
}
private void DrawPerCharacter(List<CheckedCharacter> charactersToCheck, List<CheckedItem> itemsToCheck,
bool onlyShowMissing)
{
foreach (var ch in charactersToCheck.Where(x => x.ToCheck(onlyShowMissing).Count != 0))
{ {
bool currentCharacter = _clientState.LocalContentId == ch.Character.LocalContentId; foreach (var ch in charactersToCheck.Where(x => x.ToCheck(onlyShowMissing).Count != 0))
ImGui.BeginDisabled(currentCharacter);
if (ImGuiComponents.IconButton($"SwitchCharacters{ch.Character.LocalContentId}",
FontAwesomeIcon.DoorOpen))
{ {
_commandManager.ProcessCommand( bool currentCharacter = _clientState.LocalContentId == ch.Character.LocalContentId;
$"/ays relog {ch.Character.CharacterName}@{ch.Character.WorldName}"); ImGui.BeginDisabled(currentCharacter);
} if (ImGuiComponents.IconButton($"SwitchCharacters{ch.Character.LocalContentId}",
FontAwesomeIcon.DoorOpen))
ImGui.EndDisabled();
ImGui.SameLine();
if (currentCharacter)
ImGui.PushStyleColor(ImGuiCol.Text, ImGuiColors.HealerGreen);
bool expanded = ImGui.CollapsingHeader($"{ch.Character}###GatheredCh{ch.Character.LocalContentId}");
if (currentCharacter)
ImGui.PopStyleColor();
if (expanded)
{
ImGui.Indent(_configWindow.MainIndentSize + ImGui.GetStyle().FramePadding.X);
foreach (var item in itemsToCheck.Where(x =>
ch.ToCheck(onlyShowMissing).ContainsKey(x.ItemId)))
{ {
var color = ch.Items[item.ItemId]; _commandManager.ProcessCommand(
if (color != ColorGrey) $"/ays relog {ch.Character.CharacterName}@{ch.Character.WorldName}");
{
string itemName = item.GatheredItem.Name;
var folkloreBook = _gameCache.FolkloreBooks.Values.FirstOrDefault(x =>
x.GatheringItemIds.Contains(item.GatheredItem.GatheredItemId));
if (folkloreBook != null && !ch.Character.UnlockedFolkloreBooks.Contains(folkloreBook.ItemId))
itemName += $" ({SeIconChar.Prohibited.ToIconString()} {folkloreBook.Name})";
ImGui.PushStyleColor(ImGuiCol.Text, color);
if (currentCharacter && color == ColorRed)
{
ImGui.Selectable(itemName);
if (ImGui.IsItemClicked(ImGuiMouseButton.Left))
{
uint classJob = _clientState.LocalPlayer!.ClassJob.RowId;
if (classJob == 16)
_commandManager.ProcessCommand($"/gathermin {item.GatheredItem.Name}");
else if (classJob == 17)
_commandManager.ProcessCommand($"/gatherbtn {item.GatheredItem.Name}");
else if (classJob == 18)
_commandManager.ProcessCommand($"/gatherfish {item.GatheredItem.Name}");
else
_commandManager.ProcessCommand($"/gather {item.GatheredItem.Name}");
}
}
else
{
ImGui.Text(itemName);
}
ImGui.PopStyleColor();
}
} }
ImGui.Unindent(_configWindow.MainIndentSize + ImGui.GetStyle().FramePadding.X); ImGui.EndDisabled();
ImGui.SameLine();
if (currentCharacter)
ImGui.PushStyleColor(ImGuiCol.Text, ImGuiColors.HealerGreen);
bool expanded = ImGui.CollapsingHeader($"{ch.Character}###GatheredCh{ch.Character.LocalContentId}");
if (currentCharacter)
ImGui.PopStyleColor();
if (expanded)
{
ImGui.Indent(_configWindow.MainIndentSize + ImGui.GetStyle().FramePadding.X);
foreach (var item in itemsToCheck.Where(x =>
ch.ToCheck(onlyShowMissing).ContainsKey(x.ItemId)))
{
var color = ch.Items[item.ItemId];
if (color != ColorGrey)
{
string itemName = item.GatheredItem.Name;
var folkloreBook = _gameCache.FolkloreBooks.Values.FirstOrDefault(x =>
x.GatheringItemIds.Contains(item.GatheredItem.GatheredItemId));
if (folkloreBook != null && !ch.Character.UnlockedFolkloreBooks.Contains(folkloreBook.ItemId))
itemName += $" ({SeIconChar.Prohibited.ToIconString()} {folkloreBook.Name})";
ImGui.PushStyleColor(ImGuiCol.Text, color);
if (currentCharacter && color == ColorRed)
{
ImGui.Selectable(itemName);
if (ImGui.IsItemClicked(ImGuiMouseButton.Left))
{
uint classJob = _clientState.LocalPlayer!.ClassJob.Id;
if (classJob == 16)
_commandManager.ProcessCommand($"/gathermin {item.GatheredItem.Name}");
else if (classJob == 17)
_commandManager.ProcessCommand($"/gatherbtn {item.GatheredItem.Name}");
else if (classJob == 18)
_commandManager.ProcessCommand($"/gatherfish {item.GatheredItem.Name}");
else
_commandManager.ProcessCommand($"/gather {item.GatheredItem.Name}");
}
}
else
{
ImGui.Text(itemName);
}
ImGui.PopStyleColor();
}
}
ImGui.Unindent(_configWindow.MainIndentSize + ImGui.GetStyle().FramePadding.X);
}
} }
} }
} else
private void DrawPerItem(List<CheckedCharacter> charactersToCheck, List<CheckedItem> itemsToCheck,
bool onlyShowMissing)
{
foreach (var item in itemsToCheck.Where(x =>
charactersToCheck.Any(y => y.ToCheck(onlyShowMissing).ContainsKey(x.ItemId))))
{ {
var folkloreBook = _gameCache.FolkloreBooks.Values.FirstOrDefault(x => foreach (var item in itemsToCheck.Where(x =>
x.GatheringItemIds.Contains(item.GatheredItem.GatheredItemId)); charactersToCheck.Any(y => y.ToCheck(onlyShowMissing).ContainsKey(x.ItemId))))
if (ImGui.CollapsingHeader($"{item.GatheredItem.Name}##Gathered{item.GatheredItem.ItemId}"))
{ {
ImGui.Indent(_configWindow.MainIndentSize + ImGui.GetStyle().FramePadding.X); var folkloreBook = _gameCache.FolkloreBooks.Values.FirstOrDefault(x =>
foreach (var ch in charactersToCheck) x.GatheringItemIds.Contains(item.GatheredItem.GatheredItemId));
if (ImGui.CollapsingHeader($"{item.GatheredItem.Name}##Gathered{item.GatheredItem.ItemId}"))
{ {
var color = ch.Items[item.ItemId]; ImGui.Indent(_configWindow.MainIndentSize + ImGui.GetStyle().FramePadding.X);
if (color == ColorRed || (color == ColorGreen && !onlyShowMissing)) foreach (var ch in charactersToCheck)
{ {
bool currentCharacter = _clientState.LocalContentId == ch.Character.LocalContentId; var color = ch.Items[item.ItemId];
if (currentCharacter) if (color == ColorRed || (color == ColorGreen && !onlyShowMissing))
{ {
ImGui.PushFont(UiBuilder.IconFont); bool currentCharacter = _clientState.LocalContentId == ch.Character.LocalContentId;
var pos = ImGui.GetCursorPos(); if (currentCharacter)
ImGui.SetCursorPos(pos with
{ {
X = pos.X - ImGui.CalcTextSize(CurrentCharPrefix).X - 5 ImGui.PushFont(UiBuilder.IconFont);
}); var pos = ImGui.GetCursorPos();
ImGui.TextUnformatted(CurrentCharPrefix); ImGui.SetCursorPos(pos with
ImGui.SetCursorPos(pos); {
ImGui.PopFont(); X = pos.X - ImGui.CalcTextSize(CurrentCharPrefix).X - 5
});
ImGui.TextUnformatted(CurrentCharPrefix);
ImGui.SetCursorPos(pos);
ImGui.PopFont();
}
string characterName = ch.Character.ToString();
if (folkloreBook != null && !ch.Character.UnlockedFolkloreBooks.Contains(folkloreBook.ItemId))
characterName += $" ({SeIconChar.Prohibited.ToIconString()} {folkloreBook.Name})";
ImGui.PushStyleColor(ImGuiCol.Text, color);
ImGui.TextUnformatted(characterName);
ImGui.PopStyleColor();
} }
string characterName = ch.Character.ToString();
if (folkloreBook != null &&
!ch.Character.UnlockedFolkloreBooks.Contains(folkloreBook.ItemId))
characterName += $" ({SeIconChar.Prohibited.ToIconString()} {folkloreBook.Name})";
ImGui.PushStyleColor(ImGuiCol.Text, color);
ImGui.TextUnformatted(characterName);
ImGui.PopStyleColor();
} }
}
ImGui.Unindent(_configWindow.MainIndentSize + ImGui.GetStyle().FramePadding.X); ImGui.Unindent(_configWindow.MainIndentSize + ImGui.GetStyle().FramePadding.X);
}
} }
} }
} }

View File

@ -4,9 +4,9 @@
"net8.0-windows7.0": { "net8.0-windows7.0": {
"DalamudPackager": { "DalamudPackager": {
"type": "Direct", "type": "Direct",
"requested": "[11.0.0, )", "requested": "[2.1.13, )",
"resolved": "11.0.0", "resolved": "2.1.13",
"contentHash": "bjT7XUlhIJSmsE/O76b7weUX+evvGQctbQB8aKXt94o+oPWxHpCepxAGMs7Thow3AzCyqWs7cOpp9/2wcgRRQA==" "contentHash": "rMN1omGe8536f4xLMvx9NwfvpAc9YFFfeXJ1t4P4PE6Gu8WCIoFliR1sh07hM+bfODmesk/dvMbji7vNI+B/pQ=="
}, },
"DotNet.ReproducibleBuilds": { "DotNet.ReproducibleBuilds": {
"type": "Direct", "type": "Direct",
@ -79,7 +79,7 @@
"autoretainerapi": { "autoretainerapi": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"ECommons": "[2.2.0.2, )" "ECommons": "[2.1.0.7, )"
} }
}, },
"ecommons": { "ecommons": {
@ -88,7 +88,7 @@
"llib": { "llib": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"DalamudPackager": "[11.0.0, )" "DalamudPackager": "[2.1.13, )"
} }
} }
} }

@ -1 +1 @@
Subproject commit 069cf988b5da8657bc13ade73bfcbc2675601023 Subproject commit a63c8e7154e272374ffa03d5c801736d4229e38a

@ -1 +1 @@
Subproject commit b99ba7a861300164b9b293b2bbbd510af0cda8a2 Subproject commit 677e28c0696eb13351d90d13ff27adb667b2c862

2
LLib

@ -1 +1 @@
Subproject commit 4033a1c78aec5bc2a187268e8f2615779dcc2b72 Subproject commit fa3d19dde18bfd00237e66ea1eb48a60caa01b8a