Skip to content

Commit 723f359

Browse files
committed
remove clickable Lura runes and add a button that creates the correct 5 macros instead
1 parent 8afd98c commit 723f359

2 files changed

Lines changed: 18 additions & 166 deletions

File tree

EncounterAlerts/MidnightS1/MidnightFalls.lua

Lines changed: 0 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -105,92 +105,6 @@ NSI.EncounterAlertStart[encID] = function(self, id, preview) -- on ENCOUNTER_STA
105105
}
106106
self:AddRemindersFromTable(Alert, timers[id])
107107
end
108-
if NSRT.EncounterAlerts[encID] and NSRT.EncounterAlerts[encID].ClickableRunes and (realpull or preview) then
109-
self.LuraClicks = self.LuraClicks or {}
110-
self.LuraBackground = self.LuraBackground or {}
111-
local numbers = {2, 3, 4, 6, 7}
112-
113-
local function createHighlightTexture(self)
114-
local texture = self:CreateTexture(nil, "OVERLAY")
115-
self.highlight = texture
116-
texture:SetTexture([[Interface\QuestFrame\UI-QuestLogTitleHighlight]])
117-
texture:SetBlendMode("ADD")
118-
texture:SetAllPoints(self)
119-
texture:SetAlpha(.4)
120-
return texture
121-
end
122-
123-
local function onButtonEnter(self)
124-
if not self.highlight then
125-
createHighlightTexture(self)
126-
end
127-
self.highlight:Show()
128-
self:SetBackdropBorderColor(1, 1, 1)
129-
end
130-
local function onButtonLeave(self)
131-
if self.highlight then
132-
self.highlight:Hide()
133-
end
134-
self:SetBackdropBorderColor(0, 0, 0)
135-
end
136-
local count = 0
137-
local path = {
138-
[2] = [[Interface\AddOns\NorthernSkyRaidTools\Media\EncounterPics\Circle.blp]],
139-
[3] = [[Interface\AddOns\NorthernSkyRaidTools\Media\EncounterPics\Diamond.blp]],
140-
[4] = [[Interface\AddOns\NorthernSkyRaidTools\Media\EncounterPics\Triangle.blp]],
141-
[6] = [[Interface\AddOns\NorthernSkyRaidTools\Media\EncounterPics\T.blp]],
142-
[7] = [[Interface\AddOns\NorthernSkyRaidTools\Media\EncounterPics\Cross.blp]],
143-
}
144-
local chatmsgs = {
145-
[2] = "134635", -- Circle
146-
[3] = "340528", -- Diamond
147-
[4] = "351033", -- Triangle
148-
[6] = "7242384", -- T
149-
[7] = "236903", -- Cross
150-
}
151-
for _, num in ipairs(numbers) do
152-
count = count+1
153-
if not self.LuraBackground[num] then
154-
self.LuraBackground[num] = CreateFrame("Frame", nil, self.NSRTFrame, "BackdropTemplate")
155-
self.LuraBackground[num]:SetBackdrop({bgFile = [[Interface\Buttons\WHITE8X8]], edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1})
156-
self.LuraBackground[num]:SetBackdropColor(0.5, 0.5, 0.5, 1)
157-
self.LuraBackground[num]:SetBackdropBorderColor(0, 0, 0, 0.5)
158-
self.LuraBackground[num].texture = self.LuraBackground[num]:CreateTexture(nil, "OVERLAY")
159-
self.LuraBackground[num].texture:SetTexture(path[num])
160-
self.LuraBackground[num].texture:SetAllPoints(self.LuraBackground[num])
161-
self.LuraBackground[num]:SetWidth(NSRT.Settings.LuraSize or 75)
162-
self.LuraBackground[num]:SetHeight(NSRT.Settings.LuraSize or 75)
163-
local spacing = NSRT.Settings.LuraSize or 75
164-
local offset = count*(spacing+5)
165-
local xOffset = NSRT.Settings.LuraOffsetX or 200
166-
local yOffset = NSRT.Settings.LuraOffsetY or -100
167-
self.LuraBackground[num]:ClearAllPoints()
168-
self.LuraBackground[num]:SetPoint(NSRT.Settings.LuraAnchor or "LEFT", self.NSRTFrame, NSRT.Settings.LuraRelativePoint or "LEFT", xOffset+offset, yOffset)
169-
end
170-
if not self.LuraClicks[num] then
171-
self.LuraClicks[num] = CreateFrame("Button", "LuraRuneButton"..num, self.NSRTFrame, "SecureActionButtonTemplate,BackdropTemplate")
172-
self.LuraClicks[num]:SetAllPoints(self.LuraBackground[num])
173-
self.LuraClicks[num]:SetAttribute("type1", "macro")
174-
self.LuraClicks[num]:SetAttribute("macrotext1", "/raid "..chatmsgs[num])
175-
self.LuraClicks[num]:SetAttribute("useOnKeyDown", false)
176-
self.LuraClicks[num]:RegisterForClicks("AnyUp", "AnyDown")
177-
self.LuraClicks[num]:SetScript("OnEnter", onButtonEnter)
178-
self.LuraClicks[num]:SetScript("OnLeave", onButtonLeave)
179-
end
180-
if preview then
181-
self.LuraBackground[num]:SetWidth(NSRT.Settings.LuraSize or 75)
182-
self.LuraBackground[num]:SetHeight(NSRT.Settings.LuraSize or 75)
183-
local spacing = NSRT.Settings.LuraSize or 75
184-
local offset = count*(spacing+5)
185-
local xOffset = NSRT.Settings.LuraOffsetX or 200
186-
local yOffset = NSRT.Settings.LuraOffsetY or -100
187-
self.LuraBackground[num]:ClearAllPoints()
188-
self.LuraBackground[num]:SetPoint(NSRT.Settings.LuraAnchor or "LEFT", self.NSRTFrame, NSRT.Settings.LuraRelativePoint or "LEFT", xOffset+offset, yOffset)
189-
end
190-
self.LuraBackground[num]:Show()
191-
self.LuraClicks[num]:Show()
192-
end
193-
end
194108
if NSRT.EncounterAlerts[encID] and NSRT.EncounterAlerts[encID].RunesDisplay and (realpull or preview) then
195109
self.LuraRunesFrame = self.LuraRunesFrame or CreateFrame("Frame", "nil", self.NSRTFrame, "BackdropTemplate")
196110
self.LuraRunesFrame:ClearAllPoints()
@@ -318,17 +232,6 @@ NSI.EncounterAlertStart[encID] = function(self, id, preview) -- on ENCOUNTER_STA
318232
end
319233

320234
NSI.EncounterAlertStop[encID] = function(self) -- on ENCOUNTER_END
321-
if NSRT.EncounterAlerts[encID] and NSRT.EncounterAlerts[encID].ClickableRunes then
322-
local numbers = {2, 3, 4, 6, 7}
323-
for _, num in ipairs(numbers) do
324-
if self.LuraClicks and self.LuraClicks[num] then
325-
self.LuraClicks[num]:Hide()
326-
end
327-
if self.LuraBackground and self.LuraBackground[num] then
328-
self.LuraBackground[num]:Hide()
329-
end
330-
end
331-
end
332235
if self.LuraRunesFrame then
333236
self.LuraRunesFrame:UnregisterAllEvents()
334237
self.LuraRunesFrame:Hide()

UI/Options/EncounterAlerts.lua

Lines changed: 18 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -377,75 +377,8 @@ local function BuildEncounterAlertsOptions()
377377
},
378378
{
379379
type = "label",
380-
get = function() return "In Mythic you will want your Tank to be raidlead and click for Runes 1&4.\nHealers need to dynamically decide who is clicking, their presses will be registered for Runes 2, 3 & 5" end,
380+
get = function() return "Settings changes will take into effect when you toggle the preview off & on again." end,
381381
text_template = DF:GetTemplate("font", "ORANGE_FONT_TEMPLATE"),
382-
spacement = true,
383-
},
384-
{
385-
type = "toggle",
386-
boxfirst = true,
387-
name = "Clickable Runes",
388-
desc = "Enables Clickable Runes for Midnight Falls. In Mythic, your tank should be the raidleader for this to function properly.",
389-
get = function() return NSRT.EncounterAlerts[3183] and NSRT.EncounterAlerts[3183].ClickableRunes end,
390-
set = function(self, fixedparam, value)
391-
NSRT.EncounterAlerts[3183] = NSRT.EncounterAlerts[3183] or {}
392-
NSRT.EncounterAlerts[3183].ClickableRunes = value
393-
end,
394-
nocombat = true,
395-
icontexture = 7448204,
396-
iconsize = {16, 16},
397-
},
398-
{
399-
type = "select",
400-
name = "Anchor of Clickable Runes",
401-
desc = "Defines the Anchor of the Clickable Runes. They will grow right from there.",
402-
get = function() return NSRT.Settings.LuraAnchor or "LEFT" end,
403-
values = function() return build_anchor_options("LuraAnchor") end,
404-
nocombat = true,
405-
},
406-
{
407-
type = "select",
408-
name = "Relative Point of Clickable Runes",
409-
desc = "Defines the Relative Point of the Clickable Runes. They will grow right from there.",
410-
get = function() return NSRT.Settings.LuraRelativePoint or "LEFT" end,
411-
values = function() return build_anchor_options("LuraRelativePoint") end,
412-
nocombat = true,
413-
},
414-
{
415-
type = "range",
416-
name = "X-Offset of Clickable Runes",
417-
desc = "X-Offset of the Clickable Runes",
418-
get = function() return NSRT.Settings.LuraOffsetX or 300 end,
419-
set = function(self, fixedparam, value)
420-
NSRT.Settings.LuraOffsetX = value
421-
end,
422-
min = -2000,
423-
max = 2000,
424-
nocombat = true,
425-
},
426-
{
427-
type = "range",
428-
name = "Y-Offset of Clickable Runes",
429-
desc = "Y-Offset of the Clickable Runes",
430-
get = function() return NSRT.Settings.LuraOffsetY or 0 end,
431-
set = function(self, fixedparam, value)
432-
NSRT.Settings.LuraOffsetY = value
433-
end,
434-
min = -2000,
435-
max = 2000,
436-
nocombat = true,
437-
},
438-
{
439-
type = "range",
440-
name = "Width & Height of the Clickable Runes",
441-
desc = "Width & Height of the Clickable Runes",
442-
get = function() return NSRT.Settings.LuraSize or 100 end,
443-
set = function(self, fixedparam, value)
444-
NSRT.Settings.LuraSize = value
445-
end,
446-
min = 30,
447-
max = 200,
448-
nocombat = true,
449382
},
450383
{
451384
type = "button",
@@ -461,10 +394,26 @@ local function BuildEncounterAlertsOptions()
461394
end,
462395
nocombat = true
463396
},
397+
{
398+
type = "button",
399+
name = "Create Rune-Macros",
400+
desc = "This will create the macros you need for the 5 different runes, automatically using the correct icons as well. Clickable Buttons have been removed as they caused too many issues.",
401+
func = function(self)
402+
local iconIDs = {"134635", "340528", "351033", "7242384", "236903"}
403+
for i=1, 5 do
404+
local macroName = "NSRT_LURA_RUNE_"..i
405+
if not GetMacroInfo(macroName) then
406+
CreateMacro(macroName, iconIDs[i], "/raid "..iconIDs[i])
407+
end
408+
end
409+
end,
410+
nocombat = true
411+
},
464412
{
465413
type = "label",
466-
get = function() return "Settings changes will take into effect when you toggle the preview off & on again." end,
414+
get = function() return "In Mythic you will want your Tank to be raidlead and click for Runes 1&4.\nHealers need to dynamically decide who is clicking, their presses will be registered for Runes 2, 3 & 5" end,
467415
text_template = DF:GetTemplate("font", "ORANGE_FONT_TEMPLATE"),
416+
spacement = true,
468417
},
469418
{
470419
type = "breakline"

0 commit comments

Comments
 (0)