0
@@ -30,39 +30,70 @@ frame:SetScript("OnShow", function()
0
mpbutt:SetScript("OnClick", OnClick)
0
- local macrolabel = frame:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall")
0
- macrolabel:SetText("Macro")
0
- macrolabel:SetPoint("TOPLEFT", hpbutt, "BOTTOMLEFT", 5, -GAP)
0
+ local hpmacrolabel = frame:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall")
0
+ hpmacrolabel:SetText("HP Macro")
0
+ hpmacrolabel:SetPoint("TOPLEFT", hpbutt, "BOTTOMLEFT", 5, -GAP)
0
- local editbox = CreateFrame("EditBox", nil, frame)
0
- editbox:SetPoint("TOP", macrolabel, "BOTTOM", 0, -5)
0
- editbox:SetPoint("LEFT", EDGEGAP/3, 0)
0
- editbox:SetPoint("BOTTOMRIGHT", -EDGEGAP/3, EDGEGAP/3)
0
- editbox:SetFontObject(GameFontHighlight)
0
- editbox:SetTextInsets(8,8,8,8)
0
- bgFile = "Interface\\ChatFrame\\ChatFrameBackground",
0
- edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
0
- insets = {left = 4, right = 4, top = 4, bottom = 4}
0
- editbox:SetBackdropColor(.1,.1,.1,.3)
0
- editbox:SetMultiLine(true)
0
- editbox:SetAutoFocus(false)
0
- editbox:SetText(Buffet.db.macro)
0
- editbox:SetScript("OnEditFocusLost", function()
0
- local newmacro = editbox:GetText()
0
+ local YOFFSET = (hpmacrolabel:GetTop() - frame:GetBottom() - EDGEGAP/3)/2
0
+ bgFile = "Interface\\ChatFrame\\ChatFrameBackground", insets = {left = 4, right = 4, top = 4, bottom = 4},
0
+ edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border", edgeSize = 16
0
+ local hpeditbox = CreateFrame("EditBox", nil, frame)
0
+ hpeditbox:SetPoint("TOP", hpmacrolabel, "BOTTOM", 0, -5)
0
+ hpeditbox:SetPoint("LEFT", EDGEGAP/3, 0)
0
+ hpeditbox:SetPoint("BOTTOMRIGHT", -EDGEGAP/3, YOFFSET + EDGEGAP/3)
0
+ hpeditbox:SetFontObject(GameFontHighlight)
0
+ hpeditbox:SetTextInsets(8,8,8,8)
0
+ hpeditbox:SetBackdrop(backdrop)
0
+ hpeditbox:SetBackdropColor(.1,.1,.1,.3)
0
+ hpeditbox:SetMultiLine(true)
0
+ hpeditbox:SetAutoFocus(false)
0
+ hpeditbox:SetText(Buffet.db.macroHP)
0
+ hpeditbox:SetScript("OnEditFocusLost", function()
0
+ local newmacro = hpeditbox:GetText()
0
+ if not newmacro:find("%%MACRO%%") then
0
+ Buffet:Print('Macro text must contain the string "%MACRO%".')
0
+ Buffet.db.macroHP = newmacro
0
+ hpeditbox:SetScript("OnEscapePressed", hpeditbox.ClearFocus)
0
+ hpeditbox.tiptext = 'Customize the macro text. Must include the string "%MACRO%", which is replaced with the items to be used. This setting is saved on a per-char basis.'
0
+ hpeditbox:SetScript("OnEnter", mpbutt:GetScript("OnEnter"))
0
+ hpeditbox:SetScript("OnLeave", mpbutt:GetScript("OnLeave"))
0
+ local mpmacrolabel = frame:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall")
0
+ mpmacrolabel:SetText("MP Macro")
0
+ mpmacrolabel:SetPoint("TOP", hpeditbox, "BOTTOM", 0, -GAP)
0
+ mpmacrolabel:SetPoint("LEFT", hpmacrolabel, "LEFT")
0
+ local mpeditbox = CreateFrame("EditBox", nil, frame)
0
+ mpeditbox:SetPoint("TOP", mpmacrolabel, "BOTTOM", 0, -5)
0
+ mpeditbox:SetPoint("LEFT", EDGEGAP/3, 0)
0
+ mpeditbox:SetPoint("BOTTOMRIGHT", -EDGEGAP/3, EDGEGAP/3)
0
+ mpeditbox:SetFontObject(GameFontHighlight)
0
+ mpeditbox:SetTextInsets(8,8,8,8)
0
+ mpeditbox:SetBackdrop(backdrop)
0
+ mpeditbox:SetBackdropColor(.1,.1,.1,.3)
0
+ mpeditbox:SetMultiLine(true)
0
+ mpeditbox:SetAutoFocus(false)
0
+ mpeditbox:SetText(Buffet.db.macroMP)
0
+ mpeditbox:SetScript("OnEditFocusLost", function()
0
+ local newmacro = mpeditbox:GetText()
0
if not newmacro:find("%%MACRO%%") then
0
Buffet:Print('Macro text must contain the string "%MACRO%".')
0
- Buffet.db.macro
= newmacro
0
+ Buffet.db.macro
MP = newmacro
0
- editbox:SetScript("OnEscapePressed", editbox.ClearFocus)
0
- editbox.tiptext = 'Customize the macro text. Must include the string "%MACRO%", which is replaced with the items to be used. This setting is saved on a per-char basis.'
0
- editbox:SetScript("OnEnter", mpbutt:GetScript("OnEnter"))
0
- editbox:SetScript("OnLeave", mpbutt:GetScript("OnLeave"))
0
+ mpeditbox:SetScript("OnEscapePressed", mpeditbox.ClearFocus)
0
+ mpeditbox.tiptext = hpeditbox.tiptext
0
+ mpeditbox:SetScript("OnEnter", mpbutt:GetScript("OnEnter"))
0
+ mpeditbox:SetScript("OnLeave", mpbutt:GetScript("OnLeave"))
0
local function Refresh(self)
0
if GetMacroIndexByName("AutoHP") == 0 then hpbutt:Enable() else hpbutt:Disable() end
Comments
No one has commented yet.