I just updated BuffManager so you can use that to tell if you have a certain buff or not, but it must be visible in the UI to work. Keep in mind some buffs might not be the same power SNO ID as the actual skill. I also updated UXIcon so that can be used to tell if a skill is disabled (not having enough resources, warping, cinematic, CCed etc.). Regarding skill casts there might be something in PlayerInput, but you will have to try to figure that one out yourself.
Code:
Func<int, string> cooldownToString = (ticks) =>{
if (ticks == -1)
return "N/A";
return ((double)(ticks - Storage.Instance.GetGameTick()) / 60d).ToString("0.00s");
};
Func<int, bool> canUseSkillSlot = (index) =>
{
switch (index)
{
case 0:
return UXControl.Get<UXIcon>("Root.NormalLayer.game_dialog_backgroundScreenPC.game_activeSkillLeft").x1568_IsDisabled == 0;
case 1:
return UXControl.Get<UXIcon>("Root.NormalLayer.game_dialog_backgroundScreenPC.game_activeSkillRight").x1568_IsDisabled == 0;
case 2:
case 3:
case 4:
case 5:
return UXControl.Get<UXIcon>("Root.NormalLayer.game_dialog_backgroundScreenPC.game_skill_hotbar_" + (index - 1)).x1568_IsDisabled == 0; // hotbar_1 .. 4
default:
return false;
}
};
AddView("PlayerSkills", new PollTextView(() => PlayerData.Local.GetActivePowerSnoIds().Concat(PlayerData.Local.GetPassivePowerSnoIds()).Select((powerSnoId, index) => string.Join("\t",
powerSnoId,
cooldownToString(Attributes.PowerCooldown.GetValue(ActorCommonData.Local, powerSnoId)),
Attributes.PowerCooldownStart.GetValue(ActorCommonData.Local, powerSnoId),
Attributes.PowerDisabled.GetValue(ActorCommonData.Local, powerSnoId),
Attributes.PowerCooldown.GetValue(ActorCommonData.Local, powerSnoId),
canUseSkillSlot(index),
BuffManager.IsBuffActive(powerSnoId),
SnoHelper.GetSlug(SnoGroupId.Power, powerSnoId)
))));