fix(ui): select and examine favorite spells like retail

This commit is contained in:
Erik 2026-07-24 06:47:54 +02:00
parent 043ab10b3c
commit 3e31b0ac70
23 changed files with 974 additions and 34 deletions

View file

@ -75,6 +75,31 @@ public sealed class SpellComponentRequirementService
/// (0x00567D50): an infused school or a directly carried school focus uses
/// the scarab-only formula; otherwise the account-customized formula wins.
/// </summary>
public IReadOnlyList<uint> GetAppropriateFormula(uint spellId)
{
if (!_formulas.TryGetValue(spellId, out SpellFormulaDefinition? formula))
return [];
uint playerGuid = _playerGuid();
return GetAppropriateFormula(
formula,
_objects.Get(playerGuid),
playerGuid);
}
/// <summary>
/// Whether the component tracker would leave a formula icon unghosted.
/// The input is a retail spell-component id (SCID), not a weenie class id.
/// </summary>
public bool IsComponentOwned(uint spellComponentId)
{
if (!_wcidByScid.TryGetValue(spellComponentId, out uint weenieClassId))
return false;
uint playerGuid = _playerGuid();
return _objects.Objects.Any(item =>
item.WeenieClassId == weenieClassId
&& IsOwnedByPlayer(item, playerGuid));
}
private IReadOnlyList<uint> GetAppropriateFormula(
SpellFormulaDefinition formula,
ClientObject? player,