ScalarVector1 / DragonLens

Modern, customizable, and community-driven debugging and cheat mod for TModLoader
24 stars 14 forks source link

[Suggestion] Allow Buffs and Debuffs to be cleared Seperately #84

Open Setnour6 opened 1 year ago

Setnour6 commented 1 year ago

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. image 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.