Wanna port friend addon to BC for track some spells and stuff.
Code:
Lua Code:
Dimonkiy = {};
Dimonkiy.version = GetAddOnMetadata("Dimonkiy", "Version")
Dimonkiy.point = "CENTER";
Dimonkiy.relativePoint = "CENTER";
Dimonkiy.x = -160;
Dimonkiy.y = -220;
local uiScale = GetCVar("uiScale") or 1;
local backdrop = {
bgFile = "Interface/Tooltips/UI-Tooltip-Background",
insets = { left = -5, right = -5, top = -5, bottom = -5 }
};
Dimonkiy.Frame = CreateFrame("ScrollingMessageFrame", nil);
local frame = Dimonkiy.Frame
frame:ClearAllPoints();
frame:SetMovable(true);
frame:EnableMouse(true);
frame:SetFrameStrata("HIGH");
frame:RegisterForDrag("LeftButton");
frame:SetScript("OnDragStart", frame.StartMoving);
frame:SetScript("OnDragStop", frame.StopMovingOrSizing);
frame:SetWidth(350);
frame:SetHeight(100);
frame:SetBackdrop(backdrop); -- comment this if you wan't frame
frame:SetPoint(Dimonkiy.point, nil, Dimonkiy.relativePoint, Dimonkiy.x, Dimonkiy.y);
frame:SetBackdropColor(0,0,0,1);
frame:SetFontObject("CombatLogFont")
frame:SetTimeVisible(10);
frame:SetFadeDuration(5);
frame:SetMaxLines(7)
frame:SetFading(false)
frame:SetAlpha(1);
frame:Show();
frame:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
frame:SetScript("OnEvent", function(self, event, ...)
local GetSpellInfo = GetSpellInfo;
local playerGUID = UnitGUID("player");
local useTime = date("%H:%M:%S");
local spellList = {
[GetSpellInfo(57993)] = true,
[GetSpellInfo(47471)] = true,
[GetSpellInfo(47475)] = true,
[GetSpellInfo(5938)] = true,
}
local arg = {...};
if arg[2] == "SPELL_CAST_SUCCESS"
and arg[3] == playerGUID
and arg[7] ~= nil
and arg[9] ~= 47632
and arg[9] ~= 47633
and arg[9] ~= 49560
and arg[9] ~= 45470
and arg[9] ~= "nil" then
local _, _, icon = GetSpellInfo(arg[9])
frame:AddMessage(""..useTime.." \124T"..icon.. ":15:15\124t "..arg[10].." - \124cffFFF423"..arg[7].."\124r")
end
if arg[2] == "SPELL_CAST_SUCCESS"
and arg[3] == playerGUID
and arg[7] == nil
and arg[9] ~= 47632
and arg[9] ~= 47633
and arg[9] ~= 49560
and arg[9] ~= 45470
and arg[9] ~= "nil" then
local _, _, icon = GetSpellInfo(arg[9])
frame:AddMessage(""..useTime.." \124T"..icon.. ":15:15\124t "..arg[10].."")
end
if (arg[2] == "SPELL_CAST_SUCCESS" or arg[2] == "SPELL_DAMAGE") then
if (arg[3] == playerGUID
and spellList[arg[10]]) then
local _, _, icon = GetSpellInfo(arg[9])
frame:AddMessage(""..useTime.." \124T"..icon.. ":15:15\124t "..arg[10].."")
end
end
if arg[2] == "UNIT_SPELLCAST_SUCCEEDED"
and arg[3] == playerGUID
and arg[7] == nil
and arg[9] ~= 47632
and arg[9] ~= 47633
and arg[9] ~= 49560
and arg[9] ~= 45470
and arg[9] ~= "nil" then
local _, _, icon = GetSpellInfo(arg[9])
frame:AddMessage(""..useTime.." \124T"..icon.. ":15:15\124t "..arg[10].."")
end
if arg[2] == "SPELL_CAST_START"
and arg[3] == playerGUID
and arg[9] ~= "nil" then
local _, _, icon = GetSpellInfo(arg[9])
frame:AddMessage(""..useTime.." \124T"..icon.. ":15:15\124t "..arg[10].."")
end
if arg[2] == "SPELL_CAST_FAILED"
and arg[3] == playerGUID
and arg[9] ~= "nil" then
local _, _, icon = GetSpellInfo(arg[9])
frame:AddMessage(""..useTime.." \124T"..icon.. ":15:15\124t \124cFFFF0000"..arg[10].."",255,0,0)
end
end)
Problems:
1. I can't make it to save position when i move it by mouse;
2. When open map. Its show on top layer;