Probably we all have some little tweaks and fixes for the addons we are using. Sometimes one line of lua can change a totally unusable cr*p into a beauty you cannot live without.
I would like to suggest we share such modifications - if you put effort in fixing something, why not let others benefit?

And by sharing you might learn there is a better/easier way to do the same (I, for one, do hope to learn this

).
So to start: here is my little tweak to
Class swap helper. The problem I had with this addon is that there is no easy way to turn it off. It was great in the olden days when we had just two leveled classes, but now it's a nonsense to be limited this way - you do need access to your other classes. Still, in for me in 90% of cases I still just want to swap (e.g. when doing dailies on a sub-class), so I don't really like the ClassExchangeHelper - it is one click more, and you need to choose from a cumbersome list of all combinations.
So I still use Class swap helper, but I've added to ClassSwap.lua:
at the beginning
|
Source code
|
1
|
local is_active = true;
|
at the end
|
Source code
|
1
2
3
4
5
6
7
8
9
10
|
SLASH_ClassSwap1 = "/cswp"
SLASH_ClassSwap2 = "/classswap"
SlashCmdList["ClassSwap"] = function(editBox, msg)
is_active = not is_active;
if (is_active) then
DEFAULT_CHAT_FRAME:AddMessage("ClassSwap is now active");
else
DEFAULT_CHAT_FRAME:AddMessage("ClassSwap is now NOT active");
end;
end
|
and at the beginning of "function ClassSwap_OnEvent(this, event)"
|
Source code
|
1
2
3
|
if ( not is_active ) then
return
end
|
The effect is that:
* by default ClassSwap is active, when you talk to a housemaid to change classes it will simply swap for you the two active classes
* but if you say /classswap it will get turned off and you can choose new classes manually
* if you say /classswap again, it will again start swapping the two new classes for you whenever you choose the class-swap option when talking to a house maid.
Well - works for me.