diff --git a/Leatrix_Plus.lua b/Leatrix_Plus.lua index 6eee154..5a93846 100644 --- a/Leatrix_Plus.lua +++ b/Leatrix_Plus.lua @@ -9,7 +9,6 @@ -- Leatrix Plus ---------------------------------------------------------------------- - LibCompat = LibStub:GetLibrary("LibCompat-1.0") -- Create global table _G.LeaPlusDB = _G.LeaPlusDB or {} @@ -31,7 +30,7 @@ local gameversion, gamebuild, gamedate, gametocversion = GetBuildInfo() if gametocversion and gametocversion < 30000 or gametocversion > 39999 then -- Game client is not Wow Classic - LibCompat.After(2, function() + C_Timer.After(2, function() print(L["LEATRIX PLUS: WRONG VERSION INSTALLED!"]) end) return @@ -126,7 +125,7 @@ -- Add background color eFrame.t = eFrame:CreateTexture(nil, "BACKGROUND") eFrame.t:SetAllPoints() - -- eFrame.t:SetColorTexture(0.05, 0.05, 0.05, 0.9) + eFrame.t:SetColorTexture(0.05, 0.05, 0.05, 0.9) -- Add copy title eFrame.f = eFrame:CreateFontString(nil, 'ARTWORK', 'GameFontNormalLarge') eFrame.f:SetPoint("TOPLEFT", x, y) @@ -164,7 +163,7 @@ eFrame.b:SetAutoFocus(true) eFrame.b:SetAltArrowKeyMode(true) -- Editbox texture - eFrame.t = CreateFrame("FRAME", nil, eFrame.b) + eFrame.t = CreateFrame("FRAME", nil, eFrame.b, "BackdropTemplate") eFrame.t:SetBackdrop({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border", tile = false, tileSize = 16, edgeSize = 16, insets = { left = 5, right = 5, top = 5, bottom = 5 }}) eFrame.t:SetPoint("LEFT", -6, 0) eFrame.t:SetWidth(eFrame.b:GetWidth() + 6) @@ -173,7 +172,7 @@ -- Handler eFrame.b:SetScript("OnKeyDown", function(void, key) if key == "C" and IsControlKeyDown() then - LibCompat.After(0.1, function() + C_Timer.After(0.1, function() eFrame:Hide() ActionStatus_DisplayMessage(L["Copied to clipboard."], true) if LeaPlusLC.FactoryEditBoxFocusChat then @@ -1179,9 +1178,9 @@ end) -- Unmute sounds when logging in - -- for void, soundID in pairs(muteLogoutTable) do - -- UnmuteSoundFile(soundID) - -- end + for void, soundID in pairs(muteLogoutTable) do + UnmuteSoundFile(soundID) + end end @@ -1424,7 +1423,7 @@ mEB.t = mEB:CreateTexture(nil, "BACKGROUND") mEB.t:SetPoint(mEB:GetPoint()) mEB.t:SetSize(mEB:GetSize()) - -- mEB.t:SetColorTexture(0.05, 0.05, 0.05, 1.0) + mEB.t:SetColorTexture(0.05, 0.05, 0.05, 1.0) -- Create hidden font string (used for setting width of editbox) mEB.z = mEB:CreateFontString(nil, 'ARTWORK', 'GameFontNormal') @@ -1484,7 +1483,7 @@ -- ElvUI fix to move Wowhead link inside the quest log frame if LeaPlusLC.ElvUI then - LibCompat.After(0.1, function() + C_Timer.After(0.1, function() QuestLogTitleText:ClearAllPoints() QuestLogTitleText:SetPoint("TOPLEFT", QuestLogFrame, "TOPLEFT", 32, -18) if QuestLogTitleText:GetStringWidth() > 200 then @@ -2271,7 +2270,7 @@ StartMsg.s = StartMsg:CreateTexture(nil, "BACKGROUND") StartMsg.s:SetAllPoints() - -- StartMsg.s:SetColorTexture(0.1, 0.1, 0.1, 1.0) + StartMsg.s:SetColorTexture(0.1, 0.1, 0.1, 1.0) StartMsg.f = StartMsg:CreateFontString(nil, "ARTWORK", "GameFontNormalLarge") StartMsg.f:SetAllPoints(); @@ -2294,12 +2293,12 @@ ticker._remainingIterations = ticker._remainingIterations - 1 end if (not ticker._remainingIterations or ticker._remainingIterations > 0) then - LibCompat.After(duration, ticker._callback) + C_Timer.After(duration, ticker._callback) end end end end - LibCompat.After(duration, ticker._callback) + C_Timer.After(duration, ticker._callback) return ticker end @@ -2359,7 +2358,7 @@ -- Show help button for exclusions LeaPlusLC:CreateHelpButton("SellJunkExcludeHelpButton", SellJunkFrame, titleTX, "Enter item IDs separated by commas. Item IDs can be found in item tooltips while this panel is showing.|n|nJunk items entered here will not be sold automatically.|n|nWhite items entered here will be sold automatically.|n|nThe editbox tooltip will show you more information about the items you have entered.") - local eb = CreateFrame("Frame", nil, SellJunkFrame) + local eb = CreateFrame("Frame", nil, SellJunkFrame, "BackdropTemplate") eb:SetSize(200, 180) eb:SetPoint("TOPLEFT", 350, -92) eb:SetBackdrop({ @@ -2370,7 +2369,7 @@ }) eb:SetBackdropBorderColor(1.0, 0.85, 0.0, 0.5) - eb.scroll = CreateFrame("ScrollFrame", nil, eb) + eb.scroll = CreateFrame("ScrollFrame", nil, eb, "UIPanelScrollFrameTemplate") eb.scroll:SetPoint("TOPLEFT", eb, 12, -10) eb.scroll:SetPoint("BOTTOMRIGHT", eb, -30, 10) @@ -2520,7 +2519,7 @@ eb.Text:HookScript("OnTextChanged", MakeTooltipString) eb.Text:HookScript("OnTextChanged", function() - LibCompat.After(0.1, function() + C_Timer.After(0.1, function() MakeTooltipString() end) end) @@ -2761,7 +2760,7 @@ end) else -- If combat log is undocked, do nothing but show warning - LibCompat.After(1, function() + C_Timer.After(1, function() LeaPlusLC:Print("Combat log cannot be hidden while undocked.") end) end @@ -2849,7 +2848,7 @@ if CompactRaidFrameManagerDisplayFrameHiddenModeToggle then -- Create a border for the button - local cBackdrop = CreateFrame("Frame", nil, CompactRaidFrameManagerDisplayFrameHiddenModeToggle) + local cBackdrop = CreateFrame("Frame", nil, CompactRaidFrameManagerDisplayFrameHiddenModeToggle, "BackdropTemplate") cBackdrop:SetAllPoints() cBackdrop.backdropInfo = {edgeFile = "Interface/Tooltips/UI-Tooltip-Border", tile = false, tileSize = 0, edgeSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}} cBackdrop:ApplyBackdrop() @@ -3289,7 +3288,7 @@ DeathDura:SetScript("OnEvent", function(self, event) ShowDuraStats("status") DeathDura:UnregisterEvent("PLAYER_DEAD") - LibCompat.After(2, function() + C_Timer.After(2, function() DeathDura:RegisterEvent("PLAYER_DEAD") end) end) @@ -3465,7 +3464,7 @@ LeaPlusLC:CreateHelpButton("MuteGameSoundsCustomHelpButton", MuteCustomPanel, titleTX, "Enter sound file IDs separated by comma then click the Mute button.|n|nIf you wish, you can enter a brief note for each file ID but do not include numbers in your notes.|n|nFor example, you can enter 'DevAura 569679, RetAura 568744' to mute the Devotion Aura and Retribution Aura spells.|n|nUse Leatrix Sounds to find, test and play sound file IDs.") -- Add large editbox - local eb = CreateFrame("Frame", nil, MuteCustomPanel) + local eb = CreateFrame("Frame", nil, MuteCustomPanel, "BackdropTemplate") eb:SetSize(548, 180) eb:SetPoint("TOPLEFT", 10, -92) eb:SetBackdrop({ @@ -3476,7 +3475,7 @@ }) eb:SetBackdropBorderColor(1.0, 0.85, 0.0, 0.5) - eb.scroll = CreateFrame("ScrollFrame", nil, eb) + eb.scroll = CreateFrame("ScrollFrame", nil, eb, "UIPanelScrollFrameTemplate") eb.scroll:SetPoint("TOPLEFT", eb, 12, -10) eb.scroll:SetPoint("BOTTOMRIGHT", eb, -30, 10) @@ -3681,7 +3680,7 @@ VehicleSeatIndicator:SetScale(LeaPlusLC["VehicleScale"]) -- Create drag frame - local dragframe = CreateFrame("FRAME", nil, nil) + local dragframe = CreateFrame("FRAME", nil, nil, "BackdropTemplate") dragframe:SetPoint("CENTER", vehicleHolder, "CENTER", 0, 1) dragframe:SetBackdropColor(0.0, 0.5, 1.0) dragframe:SetBackdrop({edgeFile = "Interface/Tooltips/UI-Tooltip-Border", tile = false, tileSize = 0, edgeSize = 16, insets = { left = 0, right = 0, top = 0, bottom = 0}}) @@ -3691,7 +3690,7 @@ dragframe.t = dragframe:CreateTexture() dragframe.t:SetAllPoints() - -- dragframe.t:SetColorTexture(0.0, 1.0, 0.0, 0.5) + dragframe.t:SetColorTexture(0.0, 1.0, 0.0, 0.5) dragframe.t:SetAlpha(0.5) dragframe.f = dragframe:CreateFontString(nil, 'ARTWORK', 'GameFontNormalLarge') @@ -4091,7 +4090,7 @@ end) -- Add large editbox - local eb = CreateFrame("Frame", nil, ExcludedButtonsPanel) + local eb = CreateFrame("Frame", nil, ExcludedButtonsPanel, "BackdropTemplate") eb:SetSize(548, 180) eb:SetPoint("TOPLEFT", 10, -92) eb:SetBackdrop({ @@ -4102,7 +4101,7 @@ }) eb:SetBackdropBorderColor(1.0, 0.85, 0.0, 0.5) - eb.scroll = CreateFrame("ScrollFrame", nil, eb) + eb.scroll = CreateFrame("ScrollFrame", nil, eb, "UIPanelScrollFrameTemplate") eb.scroll:SetPoint("TOPLEFT", eb, 12, -10) eb.scroll:SetPoint("BOTTOMRIGHT", eb, -30, 10) @@ -4217,7 +4216,7 @@ do -- Create frame - local pFrame = CreateFrame("FRAME", nil, Minimap) + local pFrame = CreateFrame("FRAME", nil, Minimap, "BackdropTemplate") pFrame:SetSize(100, 20) -- Set position @@ -4269,7 +4268,7 @@ -- Hide frame after 5 seconds pFrame:Show() pingTime = GetTime() - LibCompat.After(5, function() + C_Timer.After(5, function() if GetTime() - pingTime >= 5 then pFrame:Hide() end @@ -4360,7 +4359,7 @@ LeaPlusCB["HideMiniAddonButtons"].tiptext = LeaPlusCB["HideMiniAddonButtons"].tiptext .. "|n|n|cff00AAFF" .. L["Cannot be used with Combine addon buttons."] -- Create button frame (parenting to cluster ensures bFrame scales correctly) - local bFrame = CreateFrame("FRAME", nil, MinimapCluster) + local bFrame = CreateFrame("FRAME", nil, MinimapCluster, "BackdropTemplate") bFrame:ClearAllPoints() bFrame:SetPoint("TOPLEFT", Minimap, "TOPRIGHT", 4, 4) bFrame:Hide() @@ -4373,7 +4372,7 @@ local ButtonFrameTicker bFrame:HookScript("OnShow", function() if ButtonFrameTicker then ButtonFrameTicker:Cancel() end - ButtonFrameTicker = LibCompat.NewTicker(2, function() + ButtonFrameTicker = C_Timer.NewTicker(2, function() if ItemRackMenuFrame and ItemRackMenuFrame:IsShown() and ItemRackMenuFrame:IsMouseOver() then return end if not bFrame:IsMouseOver() and not Minimap:IsMouseOver() then bFrame:Hide() @@ -4530,7 +4529,7 @@ _G.GetMinimapShape = function() return "SQUARE" end -- Create black border around map - local miniBorder = CreateFrame("Frame", nil, Minimap) + local miniBorder = CreateFrame("Frame", nil, Minimap, "BackdropTemplate") miniBorder:SetPoint("TOPLEFT", -3, 3) miniBorder:SetPoint("BOTTOMRIGHT", 3, -3) miniBorder:SetAlpha(0.8) @@ -4595,7 +4594,7 @@ -- Debug buttons local LeaPlusMiniMapDebug = nil if LeaPlusMiniMapDebug then - LibCompat.After(2, function() + C_Timer.After(2, function() MiniMapMailFrame:Show() MiniMapBattlefieldFrame:Show() MiniMapWorldMapButton:Show() @@ -4617,7 +4616,7 @@ end -- Refresh buttons - LibCompat.After(0.1, SetButtonRad) + C_Timer.After(0.1, SetButtonRad) else @@ -4733,8 +4732,8 @@ end -- Run the function a few times on startup - LibCompat.NewTicker(2, MakeButtons, 3) - LibCompat.After(0.1, MakeButtons) + C_Timer.NewTicker(2, MakeButtons, 3) + C_Timer.After(0.1, MakeButtons) end @@ -4870,7 +4869,7 @@ MinimapBorderTop:SetPoint("TOP", MinimapBackdrop, "TOP", 0, 20) -- Refresh buttons - LibCompat.After(0.1, SetButtonRad) + C_Timer.After(0.1, SetButtonRad) -- Function to set zone text bar local function SetZoneTextBar() @@ -5137,7 +5136,7 @@ -- Combine addon buttons: Hide new LibDBIcon icons if LeaPlusLC["CombineAddonButtons"] == "On" then - --LibCompat.After(0.1, function() -- Removed for now + --C_Timer.After(0.1, function() -- Removed for now local buttonName = strlower(name) if not strfind(strlower(LeaPlusDB["MiniExcludeList"]), buttonName) then if button.db and not button.db.hide then @@ -5234,7 +5233,7 @@ DurabilityFrame:SetScale(LeaPlusLC["DurabilityScale"]) -- Create drag frame - local dragframe = CreateFrame("FRAME", nil, nil) + local dragframe = CreateFrame("FRAME", nil, nil, "BackdropTemplate") dragframe:SetPoint("CENTER", durabilityHolder, "CENTER", 0, 1) dragframe:SetBackdropColor(0.0, 0.5, 1.0) dragframe:SetBackdrop({edgeFile = "Interface/Tooltips/UI-Tooltip-Border", tile = false, tileSize = 0, edgeSize = 16, insets = { left = 0, right = 0, top = 0, bottom = 0}}) @@ -5244,7 +5243,7 @@ dragframe.t = dragframe:CreateTexture() dragframe.t:SetAllPoints() - -- dragframe.t:SetColorTexture(0.0, 1.0, 0.0, 0.5) + dragframe.t:SetColorTexture(0.0, 1.0, 0.0, 0.5) dragframe.t:SetAlpha(0.5) dragframe.f = dragframe:CreateFontString(nil, 'ARTWORK', 'GameFontNormalLarge') @@ -5409,7 +5408,7 @@ MirrorTimer1:SetScale(LeaPlusLC["TimerScale"]) -- Create drag frame - local dragframe = CreateFrame("FRAME", nil, nil) + local dragframe = CreateFrame("FRAME", nil, nil, "BackdropTemplate") dragframe:SetPoint("TOPRIGHT", MirrorTimer1, "TOPRIGHT", 0, 2.5) dragframe:SetBackdropColor(0.0, 0.5, 1.0) dragframe:SetBackdrop({edgeFile = "Interface/Tooltips/UI-Tooltip-Border", tile = false, tileSize = 0, edgeSize = 16, insets = { left = 0, right = 0, top = 0, bottom = 0 }}) @@ -5419,7 +5418,7 @@ dragframe.t = dragframe:CreateTexture() dragframe.t:SetAllPoints() - -- dragframe.t:SetColorTexture(0.0, 1.0, 0.0, 0.5) + dragframe.t:SetColorTexture(0.0, 1.0, 0.0, 0.5) dragframe.t:SetAlpha(0.5) dragframe.f = dragframe:CreateFontString(nil, 'ARTWORK', 'GameFontNormalLarge') @@ -5647,7 +5646,7 @@ end) -- Debug - -- LibCompat.After(2, function() PVPReadyDialog_Display(self, 1, "Warsong Gulch", 0, "BATTLEGROUND", "", "DAMAGER"); bar:Show() end) + -- C_Timer.After(2, function() PVPReadyDialog_Display(self, 1, "Warsong Gulch", 0, "BATTLEGROUND", "", "DAMAGER"); bar:Show() end) end @@ -5682,7 +5681,7 @@ -- Add background color editFrame.t = editFrame:CreateTexture(nil, "BACKGROUND") editFrame.t:SetAllPoints() - -- editFrame.t:SetColorTexture(0.00, 0.00, 0.0, 0.6) + editFrame.t:SetColorTexture(0.00, 0.00, 0.0, 0.6) -- Set textures editFrame.LeftTex:SetTexture(editFrame.RightTex:GetTexture()); editFrame.LeftTex:SetTexCoord(1, 0, 0, 1) @@ -5702,7 +5701,7 @@ titleFrame.CharCount:Hide() titleFrame.t = titleFrame:CreateTexture(nil, "BACKGROUND") titleFrame.t:SetAllPoints() - -- titleFrame.t:SetColorTexture(0.00, 0.00, 0.0, 0.6) + titleFrame.t:SetColorTexture(0.00, 0.00, 0.0, 0.6) titleFrame.LeftTex:SetTexture(titleFrame.RightTex:GetTexture()); titleFrame.LeftTex:SetTexCoord(1, 0, 0, 1) titleFrame.BottomTex:SetTexture(titleFrame.TopTex:GetTexture()); titleFrame.BottomTex:SetTexCoord(0, 1, 1, 0) titleFrame.BottomRightTex:SetTexture(titleFrame.TopRightTex:GetTexture()); titleFrame.BottomRightTex:SetTexCoord(0, 1, 1, 0) @@ -5855,7 +5854,7 @@ -- Handle flight time not correct or flight does not exist in database local timeStart = GetTime() - LibCompat.After(1, function() + C_Timer.After(1, function() if UnitOnTaxi("player") then -- Player is on a taxi so register when taxi lands flightFrame:RegisterEvent("PLAYER_CONTROL_GAINED") @@ -5925,7 +5924,7 @@ local speed = -2 if LeaPlusLC["FlightBarSpeech"] == "On" then - LibCompat.After(1, function() + C_Timer.After(1, function() C_VoiceChat.SpeakText(0, L["Flight commenced."], destination, speed, GetCVar("Sound_MasterVolume") * 100) end) mybar:AddUpdateFunction(function(bar) @@ -6586,7 +6585,7 @@ local resTimer = GetCorpseRecoveryDelay() if resTimer and resTimer > 0 then -- Resurrect has a delay so wait before resurrecting - LibCompat.After(resTimer + 1, function() + C_Timer.After(resTimer + 1, function() if not UnitAffectingCombat(arg1) or LeaPlusLC["AutoResNoCombat"] == "Off" then if LeaPlusLC["AutoAcceptRes"] == "On" then if not DoNotAcceptResurrect() then @@ -6754,7 +6753,7 @@ LeaPlusCB["ShowHelm"]:HookScript("OnClick", function() LeaPlusCB["ShowHelm"]:Disable() LeaPlusCB["ShowHelm"]:SetAlpha(1.0) - LibCompat.After(0.5, function() + C_Timer.After(0.5, function() if ShowingHelm() then ShowHelm(false) else @@ -6771,7 +6770,7 @@ LeaPlusCB["ShowCloak"]:HookScript("OnClick", function() LeaPlusCB["ShowCloak"]:Disable() LeaPlusCB["ShowCloak"]:SetAlpha(1.0) - LibCompat.After(0.5, function() + C_Timer.After(0.5, function() if ShowingCloak() then ShowCloak(false) else @@ -7043,7 +7042,7 @@ playerActor:SetUnit("player") -- Set animation playerActor:SetAnimation(0) - LibCompat.After(0.1,function() + C_Timer.After(0.1,function() playerActor:SetAnimation(animTable[math.floor(LeaPlusCB["DressupAnim"]:GetValue() + 0.5)], 0, 1, 1) end) end) @@ -7057,7 +7056,7 @@ if UnitIsPlayer("target") then DressUpFrame.DressUpModel:SetUnit("target") DressUpFrame.DressUpModel:Undress() - LibCompat.After(0.01, function() + C_Timer.After(0.01, function() for i = 1, 19 do local itemName = GetInventoryItemID("player", i) if itemName then @@ -7080,7 +7079,7 @@ playerActor:SetUnit("target") -- Set animation playerActor:SetAnimation(0) - LibCompat.After(0.1,function() + C_Timer.After(0.1,function() playerActor:SetAnimation(animTable[math.floor(LeaPlusCB["DressupAnim"]:GetValue() + 0.5)], 0, 1, 1) end) end @@ -7114,10 +7113,10 @@ LeaPlusCB["DressUpTargetSelfBtn"]:SetScript("OnEvent", function() DressUpFrame.DressUpModel:SetUnit("player") DressUpFrame.DressUpModel:Undress() - LibCompat.After(0.01, function() + C_Timer.After(0.01, function() for i = 1, 19 do local itemName = GetInventoryItemID("target", i) - LibCompat.After(0.01, function() + C_Timer.After(0.01, function() if itemName then DressUpFrame.DressUpModel:TryOn("item:" .. itemName) end @@ -7202,7 +7201,7 @@ -- CharacterStatsTBC is installed RunScript('CSC_HideStatsPanel()') if startup then - LibCompat.After(0.1, function() + C_Timer.After(0.1, function() CharacterModelFrame:ClearAllPoints() CharacterModelFrame:SetPoint("TOPLEFT", PaperDollFrame, 66, -76) CharacterModelFrame:SetPoint("BOTTOMRIGHT", PaperDollFrame, -86, 134) @@ -7227,7 +7226,7 @@ -- CharacterStatsTBC is installed RunScript('CSC_ShowStatsPanel()') if startup then - LibCompat.After(0.1, function() + C_Timer.After(0.1, function() CharacterModelFrame:ClearAllPoints() CharacterModelFrame:SetPoint("TOPLEFT", PaperDollFrame, 66, -76) CharacterModelFrame:SetPoint("BOTTOMRIGHT", PaperDollFrame, -86, 243) @@ -7452,7 +7451,7 @@ end -- Release automatically local delay = LeaPlusLC["AutoReleaseDelay"] / 1000 - LibCompat.After(delay, function() + C_Timer.After(delay, function() local dialog = StaticPopup_Visible("DEATH") if dialog then if IsShiftKeyDown() then @@ -7802,13 +7801,13 @@ if setting and LeaPlusLC["SetWeatherDensity"] == "On" then if setting == "graphicsParticleDensity" then if GetCVar("WeatherDensity") ~= LeaPlusLC["WeatherLevel"] then - LibCompat.After(0.1, function() + C_Timer.After(0.1, function() SetCVar("WeatherDensity", LeaPlusLC["WeatherLevel"]) end) end elseif setting == "raidGraphicsParticleDensity" then if GetCVar("RAIDweatherDensity") ~= LeaPlusLC["WeatherLevel"] then - LibCompat.After(0.1, function() + C_Timer.After(0.1, function() SetCVar("RAIDweatherDensity", LeaPlusLC["WeatherLevel"]) end) end @@ -8488,7 +8487,7 @@ SetCVar("chatClassColorOverride", "0") - LibCompat.After(0.1, function() + C_Timer.After(0.1, function() -- Set local channel colors and lock checkboxes for i = 1, 18 do @@ -8661,10 +8660,14 @@ if arg1 == "RightButton" then -- No modifier key toggles the options panel - -- if LeaPlusLC:IsPlusShowing() then -ReloadUI() - -- end - -- LeaPlusLC["Page" .. LeaPlusLC["LeaStartPage"]]:Show() + if LeaPlusLC:IsPlusShowing() then + LeaPlusLC:HideFrames() + LeaPlusLC:HideConfigPanels() + else + LeaPlusLC:HideFrames() + LeaPlusLC["PageF"]:Show() + end + LeaPlusLC["Page" .. LeaPlusLC["LeaStartPage"]]:Show() end @@ -9018,7 +9021,7 @@ ReloadUI() end) -- Create drag frame - local dragframe = CreateFrame("FRAME", nil, nil) + local dragframe = CreateFrame("FRAME", nil, nil, "BackdropTemplate") dragframe:SetPoint("TOPRIGHT", BuffFrame, "TOPRIGHT", 0, 2.5) dragframe:SetBackdropColor(0.0, 0.5, 1.0) dragframe:SetBackdrop({edgeFile = "Interface/Tooltips/UI-Tooltip-Border", tile = false, tileSize = 0, edgeSize = 16, insets = { left = 0, right = 0, top = 0, bottom = 0 }}) @@ -9028,7 +9031,7 @@ ReloadUI() dragframe.t = dragframe:CreateTexture() dragframe.t:SetAllPoints() - -- dragframe.t:SetColorTexture(0.0, 1.0, 0.0, 0.5) + dragframe.t:SetColorTexture(0.0, 1.0, 0.0, 0.5) dragframe.t:SetAlpha(0.5) dragframe.f = dragframe:CreateFontString(nil, 'ARTWORK', 'GameFontNormalLarge') @@ -9268,7 +9271,7 @@ ReloadUI() if not currentframe then -- No frame selected so select the player frame currentframe = PlayerFrame:GetName() - -- LeaPlusLC["DragPlayerFrame"].t:SetColorTexture(0.0, 1.0, 0.0,0.5) + LeaPlusLC["DragPlayerFrame"].t:SetColorTexture(0.0, 1.0, 0.0,0.5) end -- Set the scale slider value to the selected frame LeaPlusCB["FrameScale"]:SetValue(LeaPlusDB["Frames"][currentframe]["Scale"]) @@ -9382,7 +9385,7 @@ ReloadUI() -- Create drag frames local function LeaPlusMakeDrag(dragframe,realframe) - local dragframe = CreateFrame("Frame", nil, nil) + local dragframe = CreateFrame("Frame", nil, nil, "BackdropTemplate") LeaPlusLC[dragframe] = dragframe dragframe:SetSize(realframe:GetSize()) dragframe:SetPoint("TOP", realframe, "TOP", 0, 2.5) @@ -9412,9 +9415,9 @@ ReloadUI() -- Set all drag frames to blue then tint the selected frame to green for k,v in pairs(FrameTable) do - -- LeaPlusLC[k].t:SetColorTexture(0.0, 0.5, 1.0, 0.5) + LeaPlusLC[k].t:SetColorTexture(0.0, 0.5, 1.0, 0.5) end - -- dragframe.t:SetColorTexture(0.0, 1.0, 0.0, 0.5) + dragframe.t:SetColorTexture(0.0, 1.0, 0.0, 0.5) -- Set currentframe variable to selected frame and set the scale slider value currentframe = realframe:GetName() @@ -9429,7 +9432,7 @@ ReloadUI() dragframe.t = dragframe:CreateTexture() dragframe.t:SetAllPoints() - -- dragframe.t:SetColorTexture(0.0, 0.5, 1.0, 0.5) + dragframe.t:SetColorTexture(0.0, 0.5, 1.0, 0.5) dragframe.t:SetAlpha(0.5) dragframe.f = dragframe:CreateFontString(nil, 'ARTWORK', 'GameFontNormalLarge') @@ -9580,7 +9583,7 @@ ReloadUI() UIWidgetTopCenterContainerFrame:SetScale(LeaPlusLC["WidgetScale"]) -- Create drag frame - local dragframe = CreateFrame("FRAME", nil, nil) + local dragframe = CreateFrame("FRAME", nil, nil, "BackdropTemplate") dragframe:SetPoint("CENTER", topCenterHolder, "CENTER", 0, 1) dragframe:SetBackdropColor(0.0, 0.5, 1.0) dragframe:SetBackdrop({edgeFile = "Interface/Tooltips/UI-Tooltip-Border", tile = false, tileSize = 0, edgeSize = 16, insets = { left = 0, right = 0, top = 0, bottom = 0}}) @@ -9590,7 +9593,7 @@ ReloadUI() dragframe.t = dragframe:CreateTexture() dragframe.t:SetAllPoints() - -- dragframe.t:SetColorTexture(0.0, 1.0, 0.0, 0.5) + dragframe.t:SetColorTexture(0.0, 1.0, 0.0, 0.5) dragframe.t:SetAlpha(0.5) dragframe.f = dragframe:CreateFontString(nil, 'ARTWORK', 'GameFontNormalLarge') @@ -9784,7 +9787,7 @@ ReloadUI() FocusFrame:SetScale(LeaPlusLC["FocusScale"]) -- Create drag frame - local dragframe = CreateFrame("FRAME", nil, nil) + local dragframe = CreateFrame("FRAME", nil, nil, "BackdropTemplate") dragframe:SetBackdropColor(0.0, 0.5, 1.0) dragframe:SetBackdrop({edgeFile = "Interface/Tooltips/UI-Tooltip-Border", tile = false, tileSize = 0, edgeSize = 16, insets = { left = 0, right = 0, top = 0, bottom = 0}}) dragframe:SetToplevel(true) @@ -9793,7 +9796,7 @@ ReloadUI() dragframe.t = dragframe:CreateTexture() dragframe.t:SetAllPoints() - -- dragframe.t:SetColorTexture(0.0, 1.0, 0.0, 0.5) + dragframe.t:SetColorTexture(0.0, 1.0, 0.0, 0.5) dragframe.t:SetAlpha(0.5) dragframe.f = dragframe:CreateFontString(nil, 'ARTWORK', 'GameFontNormalLarge') @@ -10124,7 +10127,7 @@ ReloadUI() -- Add background color editFrame.t = editFrame:CreateTexture(nil, "BACKGROUND") editFrame.t:SetAllPoints() - -- editFrame.t:SetColorTexture(0.00, 0.00, 0.0, 0.6) + editFrame.t:SetColorTexture(0.00, 0.00, 0.0, 0.6) -- Set textures editFrame.LeftTex:SetTexture(editFrame.RightTex:GetTexture()); editFrame.LeftTex:SetTexCoord(1, 0, 0, 1) @@ -10144,7 +10147,7 @@ ReloadUI() titleFrame.CharCount:Hide() titleFrame.t = titleFrame:CreateTexture(nil, "BACKGROUND") titleFrame.t:SetAllPoints() - -- titleFrame.t:SetColorTexture(0.00, 0.00, 0.0, 0.6) + titleFrame.t:SetColorTexture(0.00, 0.00, 0.0, 0.6) titleFrame.LeftTex:SetTexture(titleFrame.RightTex:GetTexture()); titleFrame.LeftTex:SetTexCoord(1, 0, 0, 1) titleFrame.BottomTex:SetTexture(titleFrame.TopTex:GetTexture()); titleFrame.BottomTex:SetTexCoord(0, 1, 1, 0) titleFrame.BottomRightTex:SetTexture(titleFrame.TopRightTex:GetTexture()); titleFrame.BottomRightTex:SetTexCoord(0, 1, 1, 0) @@ -10292,7 +10295,7 @@ ReloadUI() end titleFrame.m:SetText(L["Messages"] .. ": " .. totalMsgCount) editFrame:SetVerticalScroll(0) - LibCompat.After(0.1, function() editFrame.ScrollBar.ScrollDownButton:Click() end) + C_Timer.After(0.1, function() editFrame.ScrollBar.ScrollDownButton:Click() end) editFrame:Show() editBox:ClearFocus() end @@ -10737,7 +10740,7 @@ ReloadUI() LT["ColorBlind"] = GetCVar("colorblindMode") -- Create drag frame - local TipDrag = CreateFrame("Frame", nil, UIParent) + local TipDrag = CreateFrame("Frame", nil, UIParent, "BackdropTemplate") TipDrag:SetToplevel(true); TipDrag:SetClampedToScreen(false); TipDrag:SetSize(130, 64); @@ -10758,7 +10761,7 @@ ReloadUI() -- Create texture TipDrag.t = TipDrag:CreateTexture(); TipDrag.t:SetAllPoints(); - -- TipDrag.t:SetColorTexture(0.0, 0.5, 1.0, 0.5); + TipDrag.t:SetColorTexture(0.0, 0.5, 1.0, 0.5); TipDrag.t:SetAlpha(0.5); --------------------------------------------------------------------------------------------------------- @@ -11468,18 +11471,10 @@ ReloadUI() if LeaPlusLC["ViewPortEnable"] == "On" then -- Create border textures - local BordTop = WorldFrame:CreateTexture(nil, "ARTWORK"); - -- BordTop:SetColorTexture(0, 0, 0, 1); - BordTop:SetPoint("TOPLEFT", UIParent, "TOPLEFT", 0, 0); BordTop:SetPoint("TOPRIGHT", UIParent, "TOPRIGHT", 0, 0) - local BordBot = WorldFrame:CreateTexture(nil, "ARTWORK"); - -- BordBot:SetColorTexture(0, 0, 0, 1); - BordBot:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", 0, 0); BordBot:SetPoint("BOTTOMRIGHT", UIParent, "BOTTOMRIGHT", 0, 0) - local BordLeft = WorldFrame:CreateTexture(nil, "ARTWORK"); - -- BordLeft:SetColorTexture(0, 0, 0, 1); - BordLeft:SetPoint("TOPLEFT", UIParent, "TOPLEFT", 0, 0); BordLeft:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", 0, 0) - local BordRight = WorldFrame:CreateTexture(nil, "ARTWORK"); - -- BordRight:SetColorTexture(0, 0, 0, 1); - BordRight:SetPoint("TOPRIGHT", UIParent, "TOPRIGHT", 0, 0); BordRight:SetPoint("BOTTOMRIGHT", UIParent, "BOTTOMRIGHT", 0, 0) + local BordTop = WorldFrame:CreateTexture(nil, "ARTWORK"); BordTop:SetColorTexture(0, 0, 0, 1); BordTop:SetPoint("TOPLEFT", UIParent, "TOPLEFT", 0, 0); BordTop:SetPoint("TOPRIGHT", UIParent, "TOPRIGHT", 0, 0) + local BordBot = WorldFrame:CreateTexture(nil, "ARTWORK"); BordBot:SetColorTexture(0, 0, 0, 1); BordBot:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", 0, 0); BordBot:SetPoint("BOTTOMRIGHT", UIParent, "BOTTOMRIGHT", 0, 0) + local BordLeft = WorldFrame:CreateTexture(nil, "ARTWORK"); BordLeft:SetColorTexture(0, 0, 0, 1); BordLeft:SetPoint("TOPLEFT", UIParent, "TOPLEFT", 0, 0); BordLeft:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", 0, 0) + local BordRight = WorldFrame:CreateTexture(nil, "ARTWORK"); BordRight:SetColorTexture(0, 0, 0, 1); BordRight:SetPoint("TOPRIGHT", UIParent, "TOPRIGHT", 0, 0); BordRight:SetPoint("BOTTOMRIGHT", UIParent, "BOTTOMRIGHT", 0, 0) -- Create viewport configuration panel local SideViewport = LeaPlusLC:CreatePanel("Enable viewport", "SideViewport") @@ -11718,7 +11713,7 @@ ReloadUI() -- Show first run message if not LeaPlusDB["FirstRunMessageSeen"] then - LibCompat.After(1, function() + C_Timer.After(1, function() LeaPlusLC:Print(L["Enter"] .. " |cff00ff00" .. "/run leaplus()" .. "|r " .. L["or click the minimap button to open Leatrix Plus."]) LeaPlusDB["FirstRunMessageSeen"] = true end) @@ -11786,14 +11781,14 @@ ReloadUI() -- Plot vertical lines for i = 0, wline do local t = LeaPlusLC.grid:CreateTexture(nil, 'BACKGROUND') - -- if i == wline / 2 then t:SetColorTexture(1, 0, 0, 0.5) else t:SetColorTexture(0, 0, 0, 0.5) end + if i == wline / 2 then t:SetColorTexture(1, 0, 0, 0.5) else t:SetColorTexture(0, 0, 0, 0.5) end t:SetPoint('TOPLEFT', grid, 'TOPLEFT', i * w / wline - 1, 0) t:SetPoint('BOTTOMRIGHT', grid, 'BOTTOMLEFT', i * w / wline + 1, 0) end -- Plot horizontal lines for i = 0, hline do local t = LeaPlusLC.grid:CreateTexture(nil, 'BACKGROUND') - -- if i == hline / 2 then t:SetColorTexture(1, 0, 0, 0.5) else t:SetColorTexture(0, 0, 0, 0.5) end + if i == hline / 2 then t:SetColorTexture(1, 0, 0, 0.5) else t:SetColorTexture(0, 0, 0, 0.5) end t:SetPoint('TOPLEFT', grid, 'TOPLEFT', 0, -i * h / hline + 1) t:SetPoint('BOTTOMRIGHT', grid, 'TOPRIGHT', 0, -i * h / hline - 1) end @@ -11901,14 +11896,14 @@ ReloadUI() -- Create hover texture mbtn.t = mbtn:CreateTexture(nil, "BACKGROUND") - -- mbtn.t:SetColorTexture(0.3, 0.3, 0.00, 0.8) + mbtn.t:SetColorTexture(0.3, 0.3, 0.00, 0.8) mbtn.t:SetAlpha(0.7) mbtn.t:SetAllPoints() mbtn.t:Hide() -- Create highlight texture mbtn.s = mbtn:CreateTexture(nil, "BACKGROUND") - -- mbtn.s:SetColorTexture(0.3, 0.3, 0.00, 0.8) + mbtn.s:SetColorTexture(0.3, 0.3, 0.00, 0.8) mbtn.s:SetAlpha(1.0) mbtn.s:SetAllPoints() mbtn.s:Hide() @@ -12051,7 +12046,7 @@ ReloadUI() if strfind(playlist[tracknumber], "#") then if strfind(playlist[tracknumber], ".mp3") then -- Track is a sound file with track time so create track timer - LeaPlusLC.TrackTimer = LibCompat.NewTimer(trackTime + 1, function() + LeaPlusLC.TrackTimer = C_Timer.NewTimer(trackTime + 1, function() if musicHandle then StopSound(musicHandle) end if tracknumber == #playlist then -- Playlist is at the end, restart from first track @@ -12264,7 +12259,7 @@ ReloadUI() button.t:SetPoint("TOPLEFT", button, 0, 0) button.t:SetSize(516, 16) - -- button.t:SetColorTexture(0.3, 0.3, 0.0, 0.8) + button.t:SetColorTexture(0.3, 0.3, 0.0, 0.8) button.t:SetAlpha(0.7) button.t:Hide() @@ -12273,7 +12268,7 @@ ReloadUI() button.s:SetPoint("TOPLEFT", button, 0, 0) button.s:SetSize(516, 16) - -- button.s:SetColorTexture(0.3, 0.4, 0.00, 0.6) + button.s:SetColorTexture(0.3, 0.4, 0.00, 0.6) button.s:Hide() button:SetScript("OnEnter", function() @@ -12302,7 +12297,7 @@ ReloadUI() -- Restart player if it stopped between tracks during loading screen if playlist and tracknumber and playlist[tracknumber] and not willPlay and not musicHandle then tracknumber = tracknumber - 1 - LibCompat.After(0.1, PlayTrack) + C_Timer.After(0.1, PlayTrack) end end end) @@ -12528,7 +12523,7 @@ ReloadUI() local id, player = BNGetFriendInviteInfo(i) if id and player then BNDeclineFriendInvite(id) - LibCompat.After(0.1, function() + C_Timer.After(0.1, function() LeaPlusLC:Print(L["A friend request from"] .. " " .. player .. " " .. L["was automatically declined."]) end) end @@ -12715,7 +12710,7 @@ ReloadUI() local sName = C_SummonInfo.GetSummonConfirmSummoner() local sLocation = C_SummonInfo.GetSummonConfirmAreaName() LeaPlusLC:Print(L["The summon from"] .. " " .. sName .. " (" .. sLocation .. ") " .. L["will be automatically accepted in 10 seconds unless cancelled."]) - LibCompat.After(10, function() + C_Timer.After(10, function() local sNameNew = C_SummonInfo.GetSummonConfirmSummoner() local sLocationNew = C_SummonInfo.GetSummonConfirmAreaName() if sName == sNameNew and sLocation == sLocationNew then @@ -13639,7 +13634,7 @@ ReloadUI() -- Set the background color Side.t = Side:CreateTexture(nil, "BACKGROUND") Side.t:SetAllPoints() - -- Side.t:SetColorTexture(0.05, 0.05, 0.05, 0.9) + Side.t:SetColorTexture(0.05, 0.05, 0.05, 0.9) -- Add a close Button Side.c = CreateFrame("Button", nil, Side, "UIPanelCloseButton") @@ -13893,7 +13888,7 @@ ReloadUI() eb:SetScript("OnEnterPressed", eb.ClearFocus) -- Add editbox border and backdrop - eb.f = CreateFrame("FRAME", nil, eb) + eb.f = CreateFrame("FRAME", nil, eb, "BackdropTemplate") eb.f:SetBackdrop({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border", tile = false, tileSize = 16, edgeSize = 16, insets = { left = 5, right = 5, top = 5, bottom = 5 }}) eb.f:SetPoint("LEFT", -6, 0) eb.f:SetWidth(eb:GetWidth()+6) @@ -13951,11 +13946,11 @@ ReloadUI() mbtn:GetHighlightTexture():SetTexCoord(0, 0.125, 0.4375, 0.5) -- Hide the default textures - -- mbtn:HookScript("OnShow", function() mbtn.Left:Hide(); mbtn.Middle:Hide(); mbtn.Right:Hide() end) - -- mbtn:HookScript("OnEnable", function() mbtn.Left:Hide(); mbtn.Middle:Hide(); mbtn.Right:Hide() end) - -- mbtn:HookScript("OnDisable", function() mbtn.Left:Hide(); mbtn.Middle:Hide(); mbtn.Right:Hide() end) - -- mbtn:HookScript("OnMouseDown", function() mbtn.Left:Hide(); mbtn.Middle:Hide(); mbtn.Right:Hide() end) - -- mbtn:HookScript("OnMouseUp", function() mbtn.Left:Hide(); mbtn.Middle:Hide(); mbtn.Right:Hide() end) + mbtn:HookScript("OnShow", function() mbtn.Left:Hide(); mbtn.Middle:Hide(); mbtn.Right:Hide() end) + mbtn:HookScript("OnEnable", function() mbtn.Left:Hide(); mbtn.Middle:Hide(); mbtn.Right:Hide() end) + mbtn:HookScript("OnDisable", function() mbtn.Left:Hide(); mbtn.Middle:Hide(); mbtn.Right:Hide() end) + mbtn:HookScript("OnMouseDown", function() mbtn.Left:Hide(); mbtn.Middle:Hide(); mbtn.Right:Hide() end) + mbtn:HookScript("OnMouseUp", function() mbtn.Left:Hide(); mbtn.Middle:Hide(); mbtn.Right:Hide() end) end @@ -13998,7 +13993,7 @@ ReloadUI() dbtn:SetScript("OnLeave", GameTooltip_Hide) -- Create dropdown list - local ddlist = CreateFrame("Frame",nil,frame) + local ddlist = CreateFrame("Frame",nil,frame, "BackdropTemplate") LeaPlusCB["ListFrame"..ddname] = ddlist ddlist:SetPoint("TOP",0,-42) ddlist:SetWidth(frame:GetWidth()) @@ -14036,7 +14031,7 @@ ReloadUI() dditem.t = dditem:CreateTexture(nil, "BACKGROUND") dditem.t:SetAllPoints() - -- dditem.t:SetColorTexture(0.3, 0.3, 0.00, 0.8) + dditem.t:SetColorTexture(0.3, 0.3, 0.00, 0.8) dditem.t:Hide(); dditem:SetScript("OnEnter", function() dditem.t:Show() end) @@ -14106,7 +14101,7 @@ ReloadUI() -- Add background color PageF.t = PageF:CreateTexture(nil, "BACKGROUND") PageF.t:SetAllPoints() - -- PageF.t:SetColorTexture(0.05, 0.05, 0.05, 0.9) + PageF.t:SetColorTexture(0.05, 0.05, 0.05, 0.9) -- Add textures LeaPlusLC:CreateBar("FootTexture", PageF, 570, 48, "BOTTOM", 0.5, 0.5, 0.5, 1.0, "Interface\\ACHIEVEMENTFRAME\\UI-GuildAchievement-Parchment-Horizontal-Desaturated.png") @@ -14248,7 +14243,7 @@ ReloadUI() if tonumber(arg1) and tonumber(arg1) < 999999999 then local questCompleted = C_QuestLog.IsQuestFlaggedCompleted(arg1) local questTitle = C_QuestLog.GetQuestInfo(arg1) or L["Unknown"] - LibCompat.After(0.5, function() + C_Timer.After(0.5, function() local questTitle = C_QuestLog.GetQuestInfo(arg1) or L["Unknown"] if questCompleted then LeaPlusLC:Print(questTitle .. " (" .. arg1 .. "):" .. "|cffffffff " .. L["Completed."]) @@ -14803,8 +14798,7 @@ ReloadUI() if not LeaPlusLC.HelpFrame then local frame = CreateFrame("FRAME", nil, UIParent) frame:SetSize(570, 340); frame:SetFrameStrata("FULLSCREEN_DIALOG"); frame:SetFrameLevel(100) - frame.tex = frame:CreateTexture(nil, "BACKGROUND"); frame.tex:SetAllPoints(); - -- frame.tex:SetColorTexture(0.05, 0.05, 0.05, 0.9) + frame.tex = frame:CreateTexture(nil, "BACKGROUND"); frame.tex:SetAllPoints(); frame.tex:SetColorTexture(0.05, 0.05, 0.05, 0.9) frame.close = CreateFrame("Button", nil, frame, "UIPanelCloseButton"); frame.close:SetSize(30, 30); frame.close:SetPoint("TOPRIGHT", 0, 0); frame.close:SetScript("OnClick", function() frame:Hide() end) frame:ClearAllPoints(); frame:SetPoint("CENTER", UIParent, "CENTER", 0, 0) frame:SetClampedToScreen(true) @@ -15130,7 +15124,7 @@ ReloadUI() end end -- Reinvite - LibCompat.After(0.1, function() + C_Timer.After(0.1, function() for k, v in pairs(groupNames) do C_PartyInfo.InviteUnit(v) end @@ -15148,8 +15142,7 @@ ReloadUI() -- Panel frame local frame = CreateFrame("FRAME", nil, UIParent) frame:SetSize(294, 86); frame:SetFrameStrata("FULLSCREEN_DIALOG"); frame:SetFrameLevel(100); frame:SetScale(2) - frame.tex = frame:CreateTexture(nil, "BACKGROUND"); frame.tex:SetAllPoints(); - -- frame.tex:SetColorTexture(0.05, 0.05, 0.05, 0.9) + frame.tex = frame:CreateTexture(nil, "BACKGROUND"); frame.tex:SetAllPoints(); frame.tex:SetColorTexture(0.05, 0.05, 0.05, 0.9) frame.close = CreateFrame("Button", nil, frame, "UIPanelCloseButton"); frame.close:SetSize(30, 30); frame.close:SetPoint("TOPRIGHT", 0, 0); frame.close:SetScript("OnClick", function() frame:Hide() end) frame:ClearAllPoints(); frame:SetPoint("CENTER", UIParent, "CENTER", 0, 0) frame:SetClampedToScreen(true) @@ -15184,7 +15177,7 @@ ReloadUI() if endSound then if endSound > 3000000 then endSound = 3000000 endBox:SetText(endSound) end frame.btn:SetText("WAIT") - LibCompat.After(0.1, function() + C_Timer.After(0.1, function() for i = 1, 3000000 do MuteSoundFile(i) end @@ -15197,7 +15190,7 @@ ReloadUI() else frame.btn:SetText("INVALID") frame.btn:EnableMouse(false) - LibCompat.After(2, function() + C_Timer.After(2, function() frame.btn:SetText("SET LIMIT") frame.btn:EnableMouse(true) end) @@ -15210,7 +15203,7 @@ ReloadUI() frame.MuteAllBtn:SetPoint("TOPLEFT", frame.btn, "TOPRIGHT", 20, 0) frame.MuteAllBtn:SetScript("OnClick", function() frame.MuteAllBtn:SetText("WAIT") - LibCompat.After(0.1, function() + C_Timer.After(0.1, function() for i = 1, 3000000 do MuteSoundFile(i) end @@ -15226,7 +15219,7 @@ ReloadUI() frame.UnmuteAllBtn:SetPoint("TOPLEFT", frame.MuteAllBtn, "BOTTOMLEFT", 0, -10) frame.UnmuteAllBtn:SetScript("OnClick", function() frame.UnmuteAllBtn:SetText("WAIT") - LibCompat.After(0.1, function() + C_Timer.After(0.1, function() for i = 1, 3000000 do UnmuteSoundFile(i) end @@ -15702,13 +15695,13 @@ ReloadUI() mbtn.t = mbtn:CreateTexture(nil, "BACKGROUND") mbtn.t:SetAllPoints() - -- mbtn.t:SetColorTexture(0.3, 0.3, 0.00, 0.8) + mbtn.t:SetColorTexture(0.3, 0.3, 0.00, 0.8) mbtn.t:SetAlpha(0.7) mbtn.t:Hide() mbtn.s = mbtn:CreateTexture(nil, "BACKGROUND") mbtn.s:SetAllPoints() - -- mbtn.s:SetColorTexture(0.3, 0.3, 0.00, 0.8) + mbtn.s:SetColorTexture(0.3, 0.3, 0.00, 0.8) mbtn.s:Hide() mbtn.f = mbtn:CreateFontString(nil, 'ARTWORK', 'GameFontNormal') diff --git a/Leatrix_Plus.toc b/Leatrix_Plus.toc index d8f4058..ee3936f 100644 --- a/Leatrix_Plus.toc +++ b/Leatrix_Plus.toc @@ -1,4 +1,4 @@ -## Interface: 30300 +## Interface: 30401 ## Title: Leatrix Plus ## Title-zhCN: Leatrix Plus [|cffeda55f功能百宝箱|r] @@ -16,13 +16,6 @@ ## X-Curse-Project-ID: 463863 -libs\LibStub\LibStub.lua -libs\LibCompat-1.0\lib.xml -Libs\CallbackHandler-1.0\CallbackHandler-1.0.lua -Libs\LibDataBroker-1.1\LibDataBroker-1.1.lua -Libs\LibDBIcon-1.0\LibDBIcon-1.0.lua - - Leatrix_Plus_Library.lua Leatrix_Plus_Locale.lua Leatrix_Plus_Media.lua diff --git a/Leatrix_Plus_Library.lua b/Leatrix_Plus_Library.lua index 2831d5d..c6c8a5c 100644 --- a/Leatrix_Plus_Library.lua +++ b/Leatrix_Plus_Library.lua @@ -622,9 +622,9 @@ local function createButton(name, object, db) button.dataObject = object button.db = db button:SetFrameStrata("MEDIUM") - -- button:SetFixedFrameStrata(true) + button:SetFixedFrameStrata(true) button:SetFrameLevel(8) - -- button:SetFixedFrameLevel(true) + button:SetFixedFrameLevel(true) button:SetSize(31, 31) button:RegisterForClicks("anyUp") button:RegisterForDrag("LeftButton") @@ -678,12 +678,12 @@ local function createButton(name, object, db) button.fadeOut = button:CreateAnimationGroup() local animOut = button.fadeOut:CreateAnimation("Alpha") - -- animOut:SetOrder(1) - -- animOut:SetDuration(0.2) - -- animOut:SetFromAlpha(1) - -- animOut:SetToAlpha(0) - -- animOut:SetStartDelay(1) - -- button.fadeOut:SetToFinalAlpha(true) + animOut:SetOrder(1) + animOut:SetDuration(0.2) + animOut:SetFromAlpha(1) + animOut:SetToAlpha(0) + animOut:SetStartDelay(1) + button.fadeOut:SetToFinalAlpha(true) lib.objects[name] = button @@ -893,7 +893,7 @@ lib:SetButtonRadius(lib.radius) -- Upgrade to 40 -- LibDBIconEnd end --- LeaLibDBIcon() -- disabled in 3.3.5, was causing red things +LeaLibDBIcon() ---------------------------------------------------------------------- diff --git a/Leatrix_Plus_Wrath.toc b/Leatrix_Plus_Wrath.toc index d8f4058..ee3936f 100644 --- a/Leatrix_Plus_Wrath.toc +++ b/Leatrix_Plus_Wrath.toc @@ -1,4 +1,4 @@ -## Interface: 30300 +## Interface: 30401 ## Title: Leatrix Plus ## Title-zhCN: Leatrix Plus [|cffeda55f功能百宝箱|r] @@ -16,13 +16,6 @@ ## X-Curse-Project-ID: 463863 -libs\LibStub\LibStub.lua -libs\LibCompat-1.0\lib.xml -Libs\CallbackHandler-1.0\CallbackHandler-1.0.lua -Libs\LibDataBroker-1.1\LibDataBroker-1.1.lua -Libs\LibDBIcon-1.0\LibDBIcon-1.0.lua - - Leatrix_Plus_Library.lua Leatrix_Plus_Locale.lua Leatrix_Plus_Media.lua diff --git a/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua b/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua deleted file mode 100644 index 712bf7e..0000000 --- a/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua +++ /dev/null @@ -1,240 +0,0 @@ ---[[ $Id: CallbackHandler-1.0.lua 895 2009-12-06 16:28:55Z nevcairiel $ ]] -local MAJOR, MINOR = "CallbackHandler-1.0", 5 -local CallbackHandler = LibStub:NewLibrary(MAJOR, MINOR) - -if not CallbackHandler then return end -- No upgrade needed - -local meta = {__index = function(tbl, key) tbl[key] = {} return tbl[key] end} - --- Lua APIs -local tconcat = table.concat -local assert, error, loadstring = assert, error, loadstring -local setmetatable, rawset, rawget = setmetatable, rawset, rawget -local next, select, pairs, type, tostring = next, select, pairs, type, tostring - --- Global vars/functions that we don't upvalue since they might get hooked, or upgraded --- List them here for Mikk's FindGlobals script --- GLOBALS: geterrorhandler - -local xpcall = xpcall - -local function errorhandler(err) - return geterrorhandler()(err) -end - -local function CreateDispatcher(argCount) - local code = [[ - local next, xpcall, eh = ... - - local method, ARGS - local function call() method(ARGS) end - - local function dispatch(handlers, ...) - local index - index, method = next(handlers) - if not method then return end - local OLD_ARGS = ARGS - ARGS = ... - repeat - xpcall(call, eh) - index, method = next(handlers, index) - until not method - ARGS = OLD_ARGS - end - - return dispatch - ]] - - local ARGS, OLD_ARGS = {}, {} - for i = 1, argCount do ARGS[i], OLD_ARGS[i] = "arg"..i, "old_arg"..i end - code = code:gsub("OLD_ARGS", tconcat(OLD_ARGS, ", ")):gsub("ARGS", tconcat(ARGS, ", ")) - return assert(loadstring(code, "safecall Dispatcher["..argCount.."]"))(next, xpcall, errorhandler) -end - -local Dispatchers = setmetatable({}, {__index=function(self, argCount) - local dispatcher = CreateDispatcher(argCount) - rawset(self, argCount, dispatcher) - return dispatcher -end}) - --------------------------------------------------------------------------- --- CallbackHandler:New --- --- target - target object to embed public APIs in --- RegisterName - name of the callback registration API, default "RegisterCallback" --- UnregisterName - name of the callback unregistration API, default "UnregisterCallback" --- UnregisterAllName - name of the API to unregister all callbacks, default "UnregisterAllCallbacks". false == don't publish this API. - -function CallbackHandler:New(target, RegisterName, UnregisterName, UnregisterAllName, OnUsed, OnUnused) - -- TODO: Remove this after beta has gone out - assert(not OnUsed and not OnUnused, "ACE-80: OnUsed/OnUnused are deprecated. Callbacks are now done to registry.OnUsed and registry.OnUnused") - - RegisterName = RegisterName or "RegisterCallback" - UnregisterName = UnregisterName or "UnregisterCallback" - if UnregisterAllName==nil then -- false is used to indicate "don't want this method" - UnregisterAllName = "UnregisterAllCallbacks" - end - - -- we declare all objects and exported APIs inside this closure to quickly gain access - -- to e.g. function names, the "target" parameter, etc - - - -- Create the registry object - local events = setmetatable({}, meta) - local registry = { recurse=0, events=events } - - -- registry:Fire() - fires the given event/message into the registry - function registry:Fire(eventname, ...) - if not rawget(events, eventname) or not next(events[eventname]) then return end - local oldrecurse = registry.recurse - registry.recurse = oldrecurse + 1 - - Dispatchers[select('#', ...) + 1](events[eventname], eventname, ...) - - registry.recurse = oldrecurse - - if registry.insertQueue and oldrecurse==0 then - -- Something in one of our callbacks wanted to register more callbacks; they got queued - for eventname,callbacks in pairs(registry.insertQueue) do - local first = not rawget(events, eventname) or not next(events[eventname]) -- test for empty before. not test for one member after. that one member may have been overwritten. - for self,func in pairs(callbacks) do - events[eventname][self] = func - -- fire OnUsed callback? - if first and registry.OnUsed then - registry.OnUsed(registry, target, eventname) - first = nil - end - end - end - registry.insertQueue = nil - end - end - - -- Registration of a callback, handles: - -- self["method"], leads to self["method"](self, ...) - -- self with function ref, leads to functionref(...) - -- "addonId" (instead of self) with function ref, leads to functionref(...) - -- all with an optional arg, which, if present, gets passed as first argument (after self if present) - target[RegisterName] = function(self, eventname, method, ... --[[actually just a single arg]]) - if type(eventname) ~= "string" then - error("Usage: "..RegisterName.."(eventname, method[, arg]): 'eventname' - string expected.", 2) - end - - method = method or eventname - - local first = not rawget(events, eventname) or not next(events[eventname]) -- test for empty before. not test for one member after. that one member may have been overwritten. - - if type(method) ~= "string" and type(method) ~= "function" then - error("Usage: "..RegisterName.."(\"eventname\", \"methodname\"): 'methodname' - string or function expected.", 2) - end - - local regfunc - - if type(method) == "string" then - -- self["method"] calling style - if type(self) ~= "table" then - error("Usage: "..RegisterName.."(\"eventname\", \"methodname\"): self was not a table?", 2) - elseif self==target then - error("Usage: "..RegisterName.."(\"eventname\", \"methodname\"): do not use Library:"..RegisterName.."(), use your own 'self'", 2) - elseif type(self[method]) ~= "function" then - error("Usage: "..RegisterName.."(\"eventname\", \"methodname\"): 'methodname' - method '"..tostring(method).."' not found on self.", 2) - end - - if select("#",...)>=1 then -- this is not the same as testing for arg==nil! - local arg=select(1,...) - regfunc = function(...) self[method](self,arg,...) end - else - regfunc = function(...) self[method](self,...) end - end - else - -- function ref with self=object or self="addonId" - if type(self)~="table" and type(self)~="string" then - error("Usage: "..RegisterName.."(self or \"addonId\", eventname, method): 'self or addonId': table or string expected.", 2) - end - - if select("#",...)>=1 then -- this is not the same as testing for arg==nil! - local arg=select(1,...) - regfunc = function(...) method(arg,...) end - else - regfunc = method - end - end - - - if events[eventname][self] or registry.recurse<1 then - -- if registry.recurse<1 then - -- we're overwriting an existing entry, or not currently recursing. just set it. - events[eventname][self] = regfunc - -- fire OnUsed callback? - if registry.OnUsed and first then - registry.OnUsed(registry, target, eventname) - end - else - -- we're currently processing a callback in this registry, so delay the registration of this new entry! - -- yes, we're a bit wasteful on garbage, but this is a fringe case, so we're picking low implementation overhead over garbage efficiency - registry.insertQueue = registry.insertQueue or setmetatable({},meta) - registry.insertQueue[eventname][self] = regfunc - end - end - - -- Unregister a callback - target[UnregisterName] = function(self, eventname) - if not self or self==target then - error("Usage: "..UnregisterName.."(eventname): bad 'self'", 2) - end - if type(eventname) ~= "string" then - error("Usage: "..UnregisterName.."(eventname): 'eventname' - string expected.", 2) - end - if rawget(events, eventname) and events[eventname][self] then - events[eventname][self] = nil - -- Fire OnUnused callback? - if registry.OnUnused and not next(events[eventname]) then - registry.OnUnused(registry, target, eventname) - end - end - if registry.insertQueue and rawget(registry.insertQueue, eventname) and registry.insertQueue[eventname][self] then - registry.insertQueue[eventname][self] = nil - end - end - - -- OPTIONAL: Unregister all callbacks for given selfs/addonIds - if UnregisterAllName then - target[UnregisterAllName] = function(...) - if select("#",...)<1 then - error("Usage: "..UnregisterAllName.."([whatFor]): missing 'self' or \"addonId\" to unregister events for.", 2) - end - if select("#",...)==1 and ...==target then - error("Usage: "..UnregisterAllName.."([whatFor]): supply a meaningful 'self' or \"addonId\"", 2) - end - - - for i=1,select("#",...) do - local self = select(i,...) - if registry.insertQueue then - for eventname, callbacks in pairs(registry.insertQueue) do - if callbacks[self] then - callbacks[self] = nil - end - end - end - for eventname, callbacks in pairs(events) do - if callbacks[self] then - callbacks[self] = nil - -- Fire OnUnused callback? - if registry.OnUnused and not next(callbacks) then - registry.OnUnused(registry, target, eventname) - end - end - end - end - end - end - - return registry -end - - --- CallbackHandler purposefully does NOT do explicit embedding. Nor does it --- try to upgrade old implicit embeds since the system is selfcontained and --- relies on closures to work. - diff --git a/libs/CallbackHandler-1.0/CallbackHandler-1.0.xml b/libs/CallbackHandler-1.0/CallbackHandler-1.0.xml deleted file mode 100644 index 876df83..0000000 --- a/libs/CallbackHandler-1.0/CallbackHandler-1.0.xml +++ /dev/null @@ -1,4 +0,0 @@ - -