From: Aleksi Blinnikka Date: Tue, 13 Oct 2020 12:10:31 +0000 (+0300) Subject: Tirna helper, Xanesh line, Visions gift tracker X-Git-Url: https://www.aleksib.fi/git/wowui.git/commitdiff_plain/61f22e20f0d3f6dfc9d46d47575bb14ba6e1f987 Tirna helper, Xanesh line, Visions gift tracker --- diff --git a/OmaTMW/GiftTracker.lua b/OmaTMW/GiftTracker.lua new file mode 100644 index 0000000..724fd1a --- /dev/null +++ b/OmaTMW/GiftTracker.lua @@ -0,0 +1,56 @@ +-- GiftTracker.lua +local _; +local GetTime = GetTime; +local frame = CreateFrame("Cooldown", "OmaGiftCD", UIParent, "CooldownFrameTemplate"); +local line = CreateFrame("Frame", "OmaLine", UIParent); +local playerGuid = nil; + +local function clog(ts, event, _, source, _, _, _, 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 gift() + frame:SetPoint("TOPLEFT", UIParent, "TOPLEFT", 500, -400); + frame:SetPoint("BOTTOMRIGHT", UIParent, "TOPLEFT", 580, -480); + frame.base = frame:CreateTexture(nil, "BACKGROUND"); + frame.base:SetAllPoints(); + frame.base:SetColorTexture(0, 0, 0, 0.5); + frame.stone = frame:CreateTexture(nil, "BORDER"); + frame.stone:SetPoint("TOPLEFT", frame.base, "TOPLEFT", 1, -1); + frame.stone:SetPoint("BOTTOMRIGHT", frame.base, "BOTTOMRIGHT", -1, 1); + frame.stone:SetTexCoord(0.07, 0.93, 0.07, 0.93); + frame.stone:SetTexture(2000853); -- Gift Texture + frame:Hide(); + + playerGuid = UnitGUID("player"); + frame:UnregisterAllEvents(); + frame:SetScript("OnEvent", function() + return clog(CombatLogGetCurrentEventInfo()); + end); + frame:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED"); +end + +frame:SetScript("OnEvent", gift); +frame:RegisterEvent("PLAYER_LOGIN"); + +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(); + 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"); diff --git a/OmaTMW/OmaTMW.toc b/OmaTMW/OmaTMW.toc index 1f9cb1b..f78d5d4 100644 --- a/OmaTMW/OmaTMW.toc +++ b/OmaTMW/OmaTMW.toc @@ -5,5 +5,6 @@ ## Notes: My TellMeWhen Healthstone.lua -XaneshLine.lua +GiftTracker.lua TellMeWhen.lua +TirnaHelper.lua diff --git a/OmaTMW/TirnaHelper.lua b/OmaTMW/TirnaHelper.lua new file mode 100644 index 0000000..dc5192f --- /dev/null +++ b/OmaTMW/TirnaHelper.lua @@ -0,0 +1,39 @@ +-- TirnaHelper.lua +local _; +local frame = CreateFrame("Frame", "OmaTirna", UIParent); + +local function init() + frame:UnregisterAllEvents(); + frame:SetPoint("TOP", UIParent, "TOP", -300, -250); + frame:SetWidth(1); + frame:SetHeight(1); + for i = 0,2 do + for j = 0,3 do + local button = CreateFrame("CheckButton", "OmaTirna"..i..j, frame); + button:SetPoint("TOPLEFT", frame, "TOPLEFT", i*52, j*42); + button:SetWidth(50); + button:SetHeight(40); + button.normal = button:CreateTexture(nil, "BACKGROUND"); + button.normal:SetAllPoints(); + button.normal:SetColorTexture(0.4, 0.4, 0.4); + button:SetNormalTexture(button.normal); + button.check = button:CreateTexture(nil, "BACKGROUND"); + button.check:SetAllPoints(); + button.check:SetColorTexture(0.9, 0.9, 0.9); + button:SetCheckedTexture(button.check); + end + end + frame:Hide(); +end + +frame:SetScript("OnEvent", init); +frame:RegisterEvent("PLAYER_LOGIN"); + +SLASH_OMATIRNA1 = "/tirna"; +function SlashCmdList.OMATIRNA() + if frame:IsShown() then + frame:Hide(); + else + frame:Show(); + end +end