Make message customizable
This commit is contained in:
@@ -6,6 +6,7 @@ local addonname, shared = ...
|
|||||||
|
|
||||||
if not Dechickenator_Data then Dechickenator_Data = {} end
|
if not Dechickenator_Data then Dechickenator_Data = {} end
|
||||||
if not Dechickenator_Data.blacklistedBuffs then Dechickenator_Data.blacklistedBuffs = {} end
|
if not Dechickenator_Data.blacklistedBuffs then Dechickenator_Data.blacklistedBuffs = {} end
|
||||||
|
if not Dechickenator_Data.message then Dechickenator_Data.message = "Индивидуум %s хочет поделиться своим истинным обликом" end
|
||||||
local function init()
|
local function init()
|
||||||
local cleuFrame = CreateFrame("Frame")
|
local cleuFrame = CreateFrame("Frame")
|
||||||
cleuFrame:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
|
cleuFrame:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
|
||||||
@@ -17,7 +18,7 @@ local function init()
|
|||||||
local spellName = CLEUParser.GetSpellName(...)
|
local spellName = CLEUParser.GetSpellName(...)
|
||||||
if not Dechickenator_Data.blacklistedBuffs[spellName] then return end
|
if not Dechickenator_Data.blacklistedBuffs[spellName] then return end
|
||||||
local source = CLEUParser.GetSourceName(...)
|
local source = CLEUParser.GetSourceName(...)
|
||||||
local msg = string.format("Индивидуум %s хочет поделиться своим истинным обликом", tostring(source))
|
local msg = string.format(Dechickenator_Data.message, tostring(source))
|
||||||
CancelUnitBuff("player", spellName)
|
CancelUnitBuff("player", spellName)
|
||||||
SendChatMessage(msg, "EMOTE")
|
SendChatMessage(msg, "EMOTE")
|
||||||
DoEmote("spit", source)
|
DoEmote("spit", source)
|
||||||
@@ -45,3 +46,10 @@ SlashCmdList["DECHICKENATOR_TOGGLE_BLACKLISTED_BUFF"] = function(input)
|
|||||||
print(Dechickenator_Data.blacklistedBuffs[input])
|
print(Dechickenator_Data.blacklistedBuffs[input])
|
||||||
end
|
end
|
||||||
SLASH_DECHICKENATOR_TOGGLE_BLACKLISTED_BUFF1 = "/dechicken"
|
SLASH_DECHICKENATOR_TOGGLE_BLACKLISTED_BUFF1 = "/dechicken"
|
||||||
|
|
||||||
|
SlashCmdList["DECHICKENATOR_SET_MESSAGE"] = function(input)
|
||||||
|
print("Setting message: " .. tostring(input))
|
||||||
|
Dechickenator_Data.message = input
|
||||||
|
print(Dechickenator_Data.message)
|
||||||
|
end
|
||||||
|
SLASH_DECHICKENATOR_SET_MESSAGE1 = "/dechicken_message"
|
Binary file not shown.
Reference in New Issue
Block a user