[Suggestion] Allow Buffs and Debuffs to be cleared Seperately
Opened this issue · 0 comments
Setnour6 commented
This proposal allows for the buff despawner button via left click to clear buffs only, but have the right click function clear debuffs only.
In other words, Only let left clicking the buff despawner clears all buffs that aren't considered debuffs, and add a right click function to the button to clear only debuffs.
I tried to do it myself like this:
public override bool HasRightClick => true;
public override void OnActivate()
{
for (int k = 0; k < Player.MaxBuffs; k++)
{
if (Main.debuff[Main.LocalPlayer.buffType[k]])
continue;
Main.LocalPlayer.buffTime[k] = 0;
Main.LocalPlayer.buffType[k] = 0;
}
}
public override void OnRightClick()
{
for (int k = 0; k < Player.MaxBuffs; k++)
{
if (!Main.debuff[Main.LocalPlayer.buffType[k]])
continue;
Main.LocalPlayer.buffTime[k] = 0;
Main.LocalPlayer.buffType[k] = 0;
}
}
The problem is that when I have buffs come first and then debuffs, clearing only the buffs does not move the debuffs.
The same goes for debuffs first.
I don't want to take the entire logic from Cheat Sheet, so this is where I am leaving it for now.