c3dac76 - Line for Xanesh football
authorAleksi Blinnikka <aleksi.blinnikka@gmail.com>
Tue, 5 May 2020 20:35:07 +0000
committerAleksi Blinnikka <aleksi.blinnikka@gmail.com>
Tue, 5 May 2020 20:35:07 +0000
OmaTMW/OmaTMW.toc
OmaTMW/XaneshLine.lua [new file with mode: 0644]

index b9ea864..1f9cb1b 100644 (file)
@@ -5,4 +5,5 @@
 ## Notes: My TellMeWhen
 
 Healthstone.lua
+XaneshLine.lua
 TellMeWhen.lua
diff --git a/OmaTMW/XaneshLine.lua b/OmaTMW/XaneshLine.lua
new file mode 100644 (file)
index 0000000..7210eb4
--- /dev/null
@@ -0,0 +1,32 @@
+-- XaneshLine.lua
+local _;
+local line = CreateFrame("Frame", "OmaLine", UIParent);
+local playerGuid = nil;
+
+local function clog(ts, event, _, _, _, _, _, dest, _, _, _, spellid, ...)
+    if event == "SPELL_AURA_APPLIED" and spellid == 312406 and dest == playerGuid then
+        line:Show();
+    elseif event == "SPELL_AURA_REMOVED" and spellid == 312406 and dest == playerGuid then
+        line:Hide();
+    end
+end
+
+local function lineConf()
+    line:SetPoint("CENTER", UIParent, "CENTER", 0, 100);
+    line:SetHeight(350);
+    line:SetWidth(5);
+    line.base = line:CreateTexture(nil, "BACKGROUND");
+    line.base:SetAllPoints();
+    line.base:SetColorTexture(1, 1, 1, 0.85);
+    line:Hide();
+
+    playerGuid = UnitGUID("player");
+    line:UnregisterAllEvents();
+    line:SetScript("OnEvent", function()
+        return clog(CombatLogGetCurrentEventInfo());
+    end);
+    line:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED");
+end
+
+line:SetScript("OnEvent", lineConf);
+line:RegisterEvent("PLAYER_LOGIN");