/trunk
elseif ( event == "UNIT_SPELLCAST_SENT" ) then |
-- "player", spell, rank, target |
--Sea.io.printComma(newarg1, newarg2, newarg3, newarg4) |
if (newarg2 and newarg4) then |
if (PartyCastingBars.HostilityCache[newarg4]) then |
ChatThrottleLib:SendAddonMessage("ALERT", "PartyCastingBars", format(PartyCastingBars.COMM_FORMAT, newarg2, newarg4, "hostile"), "PARTY"); |
elseif ( event == "CHAT_MSG_ADDON" ) then |
-- prefix, msg, method, sender |
if (newarg1 == "PartyCastingBars") then |
--Sea.io.printComma(format("[%s]<%s>[%s]: %s", newarg3, newarg1, newarg4, newarg2)) |
local partyNum = PartyCastingBars.PartyMembers[newarg4] |
if (partyNum) then |
local _, _, spellName, targetName, relationship = strfind(newarg2, "^(.+),(.+),(.+)$") |
local typeString = castType; |
local niceType = Sea.string.capitalizeWords(castType); |
local colorChangeFeedback = function(state) |
return format(PCB_COLOR_CHANGED, colorToString(state.color), typeString ); |
return format(PCB_COLOR_CHANGED, Sea.string.colorToString(state.color), niceType ); |
end; |
local colorResetFeedback = function(state) |
return format(PCB_COLOR_RESET, colorToString(state.color), typeString ); |
return format(PCB_COLOR_RESET, Sea.string.colorToString(state.color), niceType ); |
end; |
table.insert( |
optionSet, |
{ |
id=reaction..typeString.."ColorSetter"; |
id=reaction..niceType.."ColorSetter"; |
text=getglobal("PCB_"..typeString.."COLOR_"..reaction.."_SET"); |
helptext=getglobal("PCB_"..typeString.."COLOR_SET_TIP"); |
difficulty=3; |
table.insert( |
optionSet, |
{ |
id=reaction.. typeString.."Reset"; |
id=reaction..niceType.."Reset"; |
text=getglobal("PCB_"..typeString.."COLOR_RESET"); |
helptext=getglobal("PCB_"..typeString.."COLOR_RESET_TIP"); |
difficulty=3; |
for i, castType in ipairs({"CAST","CHANNEL","SUCCESS","FAILURE"}) do |
local typeString = castType; |
local niceType = Sea.string.capitalizeWords(castType); |
local colorChangeFeedback = function(state) |
return format(PCB_COLOR_CHANGED, colorToString(state.color), typeString ); |
return format(PCB_COLOR_CHANGED, Sea.string.colorToString(state.color), niceType ); |
end; |
local colorResetFeedback = function(state) |
return format(PCB_COLOR_RESET, colorToString(state.color), typeString ); |
return format(PCB_COLOR_RESET, Sea.string.colorToString(state.color), niceType ); |
end; |
table.insert( |
optionSet, |
{ |
id=reaction..typeString.."ColorSetter"; |
id=reaction..niceType.."ColorSetter"; |
text=getglobal("PCB_"..typeString.."COLOR_"..reaction.."_SET"); |
helptext=getglobal("PCB_"..typeString.."COLOR_SET_TIP"); |
difficulty=3; |
table.insert( |
optionSet, |
{ |
id=reaction..typeString.."Reset"; |
id=reaction..niceType.."Reset"; |
text=getglobal("PCB_"..typeString.."COLOR_RESET"); |
helptext=getglobal("PCB_"..typeString.."COLOR_RESET_TIP"); |
difficulty=3; |