Make message customizable

This commit is contained in:
2024-12-21 00:59:16 +01:00
parent 06fcb7b2db
commit fab50babc6
2 changed files with 9 additions and 1 deletions

View File

@@ -6,6 +6,7 @@ local addonname, shared = ...
if not Dechickenator_Data then Dechickenator_Data = {} 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 cleuFrame = CreateFrame("Frame")
cleuFrame:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
@@ -17,7 +18,7 @@ local function init()
local spellName = CLEUParser.GetSpellName(...)
if not Dechickenator_Data.blacklistedBuffs[spellName] then return end
local source = CLEUParser.GetSourceName(...)
local msg = string.format("Индивидуум %s хочет поделиться своим истинным обликом", tostring(source))
local msg = string.format(Dechickenator_Data.message, tostring(source))
CancelUnitBuff("player", spellName)
SendChatMessage(msg, "EMOTE")
DoEmote("spit", source)
@@ -45,3 +46,10 @@ SlashCmdList["DECHICKENATOR_TOGGLE_BLACKLISTED_BUFF"] = function(input)
print(Dechickenator_Data.blacklistedBuffs[input])
end
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.