diff --git a/2/3/4/5/6/7/ElvUI/Core/commands.lua b/2/3/4/5/6/7/ElvUI/Core/commands.lua index 96bfe15..2274a32 100644 --- a/2/3/4/5/6/7/ElvUI/Core/commands.lua +++ b/2/3/4/5/6/7/ElvUI/Core/commands.lua @@ -4,7 +4,7 @@ local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, Profi --Lua functions local _G = _G local tonumber, type = tonumber, type -local format, lower = string.format, string.lower +local format, lower, match = string.format, string.lower, string.match --WoW API / Variables local InCombatLockdown = InCombatLockdown local UIFrameFadeOut, UIFrameFadeIn = UIFrameFadeOut, UIFrameFadeIn diff --git a/2/3/4/5/6/7/ElvUI/Core/core.lua b/2/3/4/5/6/7/ElvUI/Core/core.lua index 349e486..65d5e3c 100644 --- a/2/3/4/5/6/7/ElvUI/Core/core.lua +++ b/2/3/4/5/6/7/ElvUI/Core/core.lua @@ -812,7 +812,7 @@ function E:UpdateAll(ignoreInstall) self:SetMoversPositions() self:UpdateMedia() - self:UpdateCooldownSettings() + -- self:UpdateCooldownSettings() local UF = self:GetModule("UnitFrames") UF.db = self.db.unitframe @@ -827,13 +827,13 @@ function E:UpdateAll(ignoreInstall) local AB = self:GetModule("ActionBars") AB.db = self.db.actionbar AB:UpdateButtonSettings() - AB:UpdateMicroPositionDimensions() + -- AB:UpdateMicroPositionDimensions() local bags = E:GetModule("Bags") bags.db = self.db.bags bags:Layout() bags:Layout(true) - bags:SizeAndPositionBagBar() + -- bags:SizeAndPositionBagBar() bags:UpdateItemLevelDisplay() bags:UpdateCountDisplay() @@ -886,60 +886,6 @@ function E:UpdateAll(ignoreInstall) --self:GetModule("Blizzard"):SetWatchFrameHeight() end -function E:EnterVehicleHideFrames(_, unit) - if(unit ~= "player") then return end - - for object in pairs(E.VehicleLocks) do - object:SetParent(E.HiddenFrame) - end -end - -function E:ExitVehicleShowFrames(_, unit) - if(unit ~= "player") then return end - - for object, originalParent in pairs(E.VehicleLocks) do - object:SetParent(originalParent) - end -end - -function E:RegisterObjectForVehicleLock(object, originalParent) - if(not object or not originalParent) then - E:Print("Error. Usage: RegisterObjectForVehicleLock(object, originalParent)") - return - end - - object = _G[object] or object - if(object.IsProtected and object:IsProtected()) then - E:Print("Error. Object is protected and cannot be changed in combat.") - return - end - - if(UnitHasVehicleUI("player")) then - object:SetParent(E.HiddenFrame) - end - - E.VehicleLocks[object] = originalParent -end - -function E:UnregisterObjectForVehicleLock(object) - if(not object) then - E:Print("Error. Usage: UnregisterObjectForVehicleLock(object)") - return - end - - object = _G[object] or object - if(not E.VehicleLocks[object]) then - return - end - - local originalParent = E.VehicleLocks[object] - if(originalParent) then - object:SetParent(originalParent) - end - - E.VehicleLocks[object] = nil -end - function E:ResetAllUI() self:ResetMovers() @@ -1169,7 +1115,7 @@ function E:Initialize() self.initialized = true if(self.private.install_complete == nil) then - -- self:Install() + self:Install() end if(not find(date(), "04/01/")) then diff --git a/2/3/4/5/6/7/ElvUI/Core/install.lua b/2/3/4/5/6/7/ElvUI/Core/install.lua index b1c2675..d863946 100644 --- a/2/3/4/5/6/7/ElvUI/Core/install.lua +++ b/2/3/4/5/6/7/ElvUI/Core/install.lua @@ -42,7 +42,7 @@ local function SetupChat() FCF_DockFrame(ChatFrame2) FCF_SetLocked(ChatFrame2, 1) - FCF_OpenNewWindow(LOOT) + -- FCF_OpenNewWindow(LOOT) FCF_UnDockFrame(ChatFrame3) FCF_SetLocked(ChatFrame3, 1) ChatFrame3:Show() diff --git a/2/3/4/5/6/7/ElvUI/Core/staticpopups.lua b/2/3/4/5/6/7/ElvUI/Core/staticpopups.lua index c615a16..eb7a862 100644 --- a/2/3/4/5/6/7/ElvUI/Core/staticpopups.lua +++ b/2/3/4/5/6/7/ElvUI/Core/staticpopups.lua @@ -2,130 +2,125 @@ local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, Profi --Cache global variables --Lua functions -local _G = _G; -local pairs, type, unpack, assert = pairs, type, unpack, assert; -local tremove, tContains, tinsert, wipe = tremove, tContains, tinsert, table.wipe; -local lower = string.lower; +local _G = _G +local pairs, type, unpack, assert = pairs, type, unpack, assert +local getn, tremove, tContains, tinsert, wipe = table.getnumber, tremove, tContains, tinsert, table.wipe +local lower = string.lower --WoW API / Variables -local CreateFrame = CreateFrame; -local UnitIsDeadOrGhost, InCinematic = UnitIsDeadOrGhost, InCinematic; -local GetBindingFromClick, RunBinding = GetBindingFromClick, RunBinding; -local PurchaseSlot, GetBankSlotCost = PurchaseSlot, GetBankSlotCost; -local MoneyFrame_Update = MoneyFrame_Update; -local SetCVar, DisableAddOn = SetCVar, DisableAddOn; -local ReloadUI, PlaySound, StopMusic = ReloadUI, PlaySound, StopMusic; -local StaticPopup_Resize = StaticPopup_Resize; -local AutoCompleteEditBox_OnEnterPressed = AutoCompleteEditBox_OnEnterPressed; -local AutoCompleteEditBox_OnTextChanged = AutoCompleteEditBox_OnTextChanged; -local ChatEdit_FocusActiveWindow = ChatEdit_FocusActiveWindow; -local STATICPOPUP_TEXTURE_ALERT = STATICPOPUP_TEXTURE_ALERT; -local STATICPOPUP_TEXTURE_ALERTGEAR = STATICPOPUP_TEXTURE_ALERTGEAR; +local CreateFrame = CreateFrame +local UnitIsDeadOrGhost, InCinematic = UnitIsDeadOrGhost, InCinematic +local GetBindingFromClick, RunBinding = GetBindingFromClick, RunBinding +local PurchaseSlot, GetBankSlotCost = PurchaseSlot, GetBankSlotCost +local MoneyFrame_Update = MoneyFrame_Update +local SetCVar, DisableAddOn = SetCVar, DisableAddOn +local ReloadUI, PlaySound, StopMusic = ReloadUI, PlaySound, StopMusic +local StaticPopup_Resize = StaticPopup_Resize -E.PopupDialogs = {}; -E.StaticPopup_DisplayedFrames = {}; +E.PopupDialogs = {} +E.StaticPopup_DisplayedFrames = {} E.PopupDialogs["ELVUI_UPDATE_AVAILABLE"] = { text = L["ElvUI is five or more revisions out of date. You can download the newest version from https://github.com/ElvUI-Vanilla/ElvUI/"], hasEditBox = 1, OnShow = function(self) - self.editBox:SetAutoFocus(false); - self.editBox.width = self.editBox:GetWidth(); - self.editBox:SetWidth(220); - self.editBox:SetText("https://github.com/ElvUI-Vanilla/ElvUI"); - self.editBox:HighlightText(); - ChatEdit_FocusActiveWindow(); + self.editBox:SetAutoFocus(false) + self.editBox.width = self.editBox:GetWidth() + self.editBox:SetWidth(220) + self.editBox:SetText("https://github.com/ElvUI-Vanilla/ElvUI") + self.editBox:HighlightText() + -- ChatEdit_FocusActiveWindow() end, OnHide = function(self) - self.editBox:SetWidth(self.editBox.width or 50); - self.editBox.width = nil; + self.editBox:SetWidth(self.editBox.width or 50) + self.editBox.width = nil end, hideOnEscape = 1, button1 = OKAY, OnAccept = E.noop, EditBoxOnEnterPressed = function(self) - ChatEdit_FocusActiveWindow(); - self:GetParent():Hide(); + ChatEdit_FocusActiveWindow() + self:GetParent():Hide() end, EditBoxOnEscapePressed = function(self) - ChatEdit_FocusActiveWindow(); - self:GetParent():Hide(); + ChatEdit_FocusActiveWindow() + self:GetParent():Hide() end, EditBoxOnTextChanged = function(self) if(self:GetText() ~= "https://github.com/ElvUI-Vanilla/ElvUI") then - self:SetText("https://github.com/ElvUI-Vanilla/ElvUI"); + self:SetText("https://github.com/ElvUI-Vanilla/ElvUI") end - self:HighlightText(); - self:ClearFocus(); - ChatEdit_FocusActiveWindow(); + self:HighlightText() + self:ClearFocus() + ChatEdit_FocusActiveWindow() end, OnEditFocusGained = function(self) - self:HighlightText(); + self:HighlightText() end, showAlert = 1 -}; +} E.PopupDialogs["CLIQUE_ADVERT"] = { text = L["Using the healer layout it is highly recommended you download the addon Clique if you wish to have the click-to-heal function."], button1 = YES, OnAccept = E.noop, showAlert = 1 -}; +} E.PopupDialogs["CONFIRM_LOSE_BINDING_CHANGES"] = { text = CONFIRM_LOSE_BINDING_CHANGES, button1 = OKAY, button2 = CANCEL, OnAccept = function() - E:GetModule("ActionBars"):ChangeBindingProfile(); - E:GetModule("ActionBars").bindingsChanged = nil; + E:GetModule("ActionBars"):ChangeBindingProfile() + E:GetModule("ActionBars").bindingsChanged = nil end, OnCancel = function() if(ElvUIBindPopupWindowCheckButton:GetChecked()) then - ElvUIBindPopupWindowCheckButton:SetChecked(); + ElvUIBindPopupWindowCheckButton:SetChecked() else - ElvUIBindPopupWindowCheckButton:SetChecked(1); + ElvUIBindPopupWindowCheckButton:SetChecked(1) end end, timeout = 0, whileDead = 1, showAlert = 1 -}; +} E.PopupDialogs["TUKUI_ELVUI_INCOMPATIBLE"] = { text = L["Oh lord, you have got ElvUI and Tukui both enabled at the same time. Select an addon to disable."], - OnAccept = function() DisableAddOn("ElvUI"); ReloadUI(); end, - OnCancel = function() DisableAddOn("Tukui"); ReloadUI(); end, + OnAccept = function() DisableAddOn("ElvUI") ReloadUI() end, + OnCancel = function() DisableAddOn("Tukui") ReloadUI() end, button1 = "ElvUI", button2 = "Tukui", timeout = 0, whileDead = 1, hideOnEscape = false -}; +} E.PopupDialogs["DISABLE_INCOMPATIBLE_ADDON"] = { text = L["Do you swear not to post in technical support about something not working without first disabling the addon/module combination first?"], - OnAccept = function() E.global.ignoreIncompatible = true; end, - OnCancel = function() E:StaticPopup_Hide("DISABLE_INCOMPATIBLE_ADDON"); E:StaticPopup_Show("INCOMPATIBLE_ADDON", E.PopupDialogs["INCOMPATIBLE_ADDON"].addon, E.PopupDialogs["INCOMPATIBLE_ADDON"].module); end, + OnAccept = function() E.global.ignoreIncompatible = true end, + OnCancel = function() E:StaticPopup_Hide("DISABLE_INCOMPATIBLE_ADDON") E:StaticPopup_Show("INCOMPATIBLE_ADDON", E.PopupDialogs["INCOMPATIBLE_ADDON"].addon, E.PopupDialogs["INCOMPATIBLE_ADDON"].module) end, button1 = L["I Swear"], button2 = DECLINE, timeout = 0, whileDead = 1, hideOnEscape = false -}; +} E.PopupDialogs["INCOMPATIBLE_ADDON"] = { text = L["INCOMPATIBLE_ADDON"], - OnAccept = function() DisableAddOn(E.PopupDialogs["INCOMPATIBLE_ADDON"].addon); ReloadUI(); end, - OnCancel = function() E.private[lower(E.PopupDialogs["INCOMPATIBLE_ADDON"].module)].enable = false; ReloadUI(); end, + OnAccept = function() DisableAddOn(E.PopupDialogs["INCOMPATIBLE_ADDON"].addon) ReloadUI() end, + OnCancel = function() E.private[lower(E.PopupDialogs["INCOMPATIBLE_ADDON"].module)].enable = false ReloadUI() end, button3 = L["Disable Warning"], OnAlt = function () - E:StaticPopup_Hide("INCOMPATIBLE_ADDON"); - E:StaticPopup_Show("DISABLE_INCOMPATIBLE_ADDON"); + E:StaticPopup_Hide("INCOMPATIBLE_ADDON") + E:StaticPopup_Show("DISABLE_INCOMPATIBLE_ADDON") end, timeout = 0, whileDead = 1, hideOnEscape = false -}; +} E.PopupDialogs["PIXELPERFECT_CHANGED"] = { text = L["You have changed the Thin Border Theme option. You will have to complete the installation process to remove any graphical bugs."], @@ -134,7 +129,7 @@ E.PopupDialogs["PIXELPERFECT_CHANGED"] = { timeout = 0, whileDead = 1, hideOnEscape = false -}; +} E.PopupDialogs["CONFIGAURA_SET"] = { text = L["Because of the mass confusion caused by the new aura system I've implemented a new step to the installation process. This is optional. If you like how your auras are setup go to the last step and click finished to not be prompted again. If for some reason you are prompted repeatedly please restart your game."], @@ -143,27 +138,27 @@ E.PopupDialogs["CONFIGAURA_SET"] = { timeout = 0, whileDead = 1, hideOnEscape = false -}; +} E.PopupDialogs["QUEUE_TAINT"] = { text = L["You have changed your UIScale, however you still have the AutoScale option enabled in ElvUI. Press accept if you would like to disable the Auto Scale option."], button1 = ACCEPT, button2 = CANCEL, - OnAccept = function() ReloadUI(); end, + OnAccept = ReloadUI, timeout = 0, whileDead = 1, hideOnEscape = false -}; +} E.PopupDialogs["FAILED_UISCALE"] = { text = L["You have changed your UIScale, however you still have the AutoScale option enabled in ElvUI. Press accept if you would like to disable the Auto Scale option."], button1 = ACCEPT, button2 = CANCEL, - OnAccept = function() E.global.general.autoScale = false; ReloadUI(); end, + OnAccept = function() E.global.general.autoScale = false ReloadUI() end, timeout = 0, whileDead = 1, hideOnEscape = false -}; +} E.PopupDialogs["CONFIG_RL"] = { text = L["One or more of the changes you have made require a ReloadUI."], @@ -173,7 +168,7 @@ E.PopupDialogs["CONFIG_RL"] = { timeout = 0, whileDead = 1, hideOnEscape = false -}; +} E.PopupDialogs["GLOBAL_RL"] = { text = L["One or more of the changes you have made will effect all characters using this addon. You will have to reload the user interface to see the changes you have made."], @@ -183,7 +178,7 @@ E.PopupDialogs["GLOBAL_RL"] = { timeout = 0, whileDead = 1, hideOnEscape = false -}; +} E.PopupDialogs["PRIVATE_RL"] = { text = L["A setting you have changed will change an option for this character only. This setting that you have changed will be uneffected by changing user profiles. Changing this setting requires that you reload your User Interface."], @@ -193,73 +188,32 @@ E.PopupDialogs["PRIVATE_RL"] = { timeout = 0, whileDead = 1, hideOnEscape = false -}; - -E.PopupDialogs["RESET_UF_AF"] = { - text = L["Accepting this will reset your Filter Priority lists for all auras on UnitFrames. Are you sure?"], - button1 = ACCEPT, - button2 = CANCEL, - OnAccept = function() - for unitName, content in pairs(E.db.unitframe.units) do - if content.buffs then - content.buffs.priority = P.unitframe.units[unitName].buffs.priority - end - if content.debuffs then - content.debuffs.priority = P.unitframe.units[unitName].debuffs.priority - end - if content.aurabar then - content.aurabar.priority = P.unitframe.units[unitName].aurabar.priority - end - end - end, - timeout = 0, - whileDead = 1, - hideOnEscape = false, -} - -E.PopupDialogs["RESET_NP_AF"] = { - text = L["Accepting this will reset your Filter Priority lists for all auras on NamePlates. Are you sure?"], - button1 = ACCEPT, - button2 = CANCEL, - OnAccept = function() - for unitType, content in pairs(E.db.nameplates.units) do - if content.buffs and content.buffs.filters then - content.buffs.filters.priority = P.nameplates.units[unitType].buffs.filters.priority - end - if content.debuffs and content.debuffs.filters then - content.debuffs.filters.priority = P.nameplates.units[unitType].debuffs.filters.priority - end - end - end, - timeout = 0, - whileDead = 1, - hideOnEscape = false, } E.PopupDialogs["KEYBIND_MODE"] = { text = L["Hover your mouse over any actionbutton or spellbook button to bind it. Press the escape key or right click to clear the current actionbutton's keybinding."], button1 = L["Save"], button2 = L["Discard"], - OnAccept = function() E:GetModule("ActionBars"):DeactivateBindMode(true); end, - OnCancel = function() E:GetModule("ActionBars"):DeactivateBindMode(false); end, + OnAccept = function() E:GetModule("ActionBars"):DeactivateBindMode(true) end, + OnCancel = function() E:GetModule("ActionBars"):DeactivateBindMode(false) end, timeout = 0, whileDead = 1, hideOnEscape = false -}; +} E.PopupDialogs["DELETE_GRAYS"] = { text = L["Are you sure you want to delete all your gray items?"], button1 = YES, button2 = NO, - OnAccept = function() E:GetModule("Bags"):VendorGrays(true); end, + OnAccept = function() E:GetModule("Bags"):VendorGrays(true) end, OnShow = function(self) - MoneyFrame_Update(self.moneyFrame, E.PopupDialogs["DELETE_GRAYS"].Money); + MoneyFrame_Update(self:GetName().."MoneyFrame", E.PopupDialogs["DELETE_GRAYS"].Money) end, timeout = 0, whileDead = 1, hideOnEscape = false, hasMoneyFrame = 1 -}; +} E.PopupDialogs["BUY_BANK_SLOT"] = { text = CONFIRM_BUY_BANK_SLOT, @@ -267,88 +221,88 @@ E.PopupDialogs["BUY_BANK_SLOT"] = { button2 = NO, OnAccept = PurchaseSlot, OnShow = function(self) - MoneyFrame_Update(self.moneyFrame, GetBankSlotCost()); + MoneyFrame_Update(self:GetName().."MoneyFrame", GetBankSlotCost()) end, hasMoneyFrame = 1, timeout = 0, hideOnEscape = 1 -}; +} E.PopupDialogs["CANNOT_BUY_BANK_SLOT"] = { text = L["Can't buy anymore slots!"], button1 = ACCEPT, timeout = 0, whileDead = 1 -}; +} E.PopupDialogs["NO_BANK_BAGS"] = { text = L["You must purchase a bank slot first!"], button1 = ACCEPT, timeout = 0, whileDead = 1 -}; +} E.PopupDialogs["RESETUI_CHECK"] = { text = L["Are you sure you want to reset every mover back to it's default position?"], button1 = ACCEPT, button2 = CANCEL, OnAccept = function() - E:ResetAllUI(); + E:ResetAllUI() end, timeout = 0, whileDead = 1 -}; +} E.PopupDialogs["HARLEM_SHAKE"] = { text = L["ElvUI needs to perform database optimizations please be patient."], button1 = OKAY, OnAccept = function() if(E.isMassiveShaking) then - E:StopHarlemShake(); + E:StopHarlemShake() else - E:BeginHarlemShake(); - return true; + E:BeginHarlemShake() + return true end end, timeout = 0, whileDead = 1 -}; +} E.PopupDialogs["HELLO_KITTY"] = { text = L["ElvUI needs to perform database optimizations please be patient."], button1 = OKAY, OnAccept = function() - E:SetupHelloKitty(); + E:SetupHelloKitty() end, timeout = 0, whileDead = 1 -}; +} E.PopupDialogs["HELLO_KITTY_END"] = { text = L["Do you enjoy the new ElvUI?"], button1 = L["Yes, Keep Changes!"], button2 = L["No, Revert Changes!"], OnAccept = function() - E:Print(L["Type /hellokitty to revert to old settings."]); - StopMusic(); - SetCVar("Sound_EnableAllSound", E.oldEnableAllSound); - SetCVar("Sound_EnableMusic", E.oldEnableMusic); + E:Print(L["Type /hellokitty to revert to old settings."]) + StopMusic() + SetCVar("Sound_EnableAllSound", E.oldEnableAllSound) + SetCVar("Sound_EnableMusic", E.oldEnableMusic) end, OnCancel = function() - E:RestoreHelloKitty(); - StopMusic(); - SetCVar("Sound_EnableAllSound", E.oldEnableAllSound); - SetCVar("Sound_EnableMusic", E.oldEnableMusic); + E:RestoreHelloKitty() + StopMusic() + SetCVar("Sound_EnableAllSound", E.oldEnableAllSound) + SetCVar("Sound_EnableMusic", E.oldEnableMusic) end, timeout = 0, whileDead = 1 -}; +} E.PopupDialogs["DISBAND_RAID"] = { text = L["Are you sure you want to disband the group?"], button1 = ACCEPT, button2 = CANCEL, - OnAccept = function() E:GetModule("Misc"):DisbandRaidGroup(); end, + OnAccept = function() E:GetModule("Misc"):DisbandRaidGroup() end, timeout = 0, whileDead = 1 } @@ -359,7 +313,7 @@ E.PopupDialogs["CONFIRM_LOOT_DISTRIBUTION"] = { button2 = NO, timeout = 0, hideOnEscape = 1 -}; +} E.PopupDialogs["RESET_PROFILE_PROMPT"] = { text = L["Are you sure you want to reset all the settings on this profile?"], @@ -367,169 +321,169 @@ E.PopupDialogs["RESET_PROFILE_PROMPT"] = { button2 = NO, timeout = 0, hideOnEscape = 1, - OnAccept = function() E:ResetProfile(); end -}; + OnAccept = function() E:ResetProfile() end +} E.PopupDialogs["APPLY_FONT_WARNING"] = { text = L["Are you sure you want to apply this font to all ElvUI elements?"], OnAccept = function() - local font = E.db.general.font; - local fontSize = E.db.general.fontSize; + local font = E.db.general.font + local fontSize = E.db.general.fontSize - E.db.bags.itemLevelFont = font; - E.db.bags.itemLevelFontSize = fontSize; - E.db.bags.countFont = font; - E.db.bags.countFontSize = fontSize; - E.db.nameplates.font = font; - --E.db.nameplates.fontSize = fontSize; + E.db.bags.itemLevelFont = font + E.db.bags.itemLevelFontSize = fontSize + E.db.bags.countFont = font + E.db.bags.countFontSize = fontSize + E.db.nameplates.font = font + --E.db.nameplates.fontSize = fontSize E.db.actionbar.font = font --E.db.actionbar.fontSize = fontSize - E.db.auras.font = font; - E.db.auras.fontSize = fontSize; - E.db.general.reminder.font = font; - --E.db.general.reminder.fontSize = fontSize; - E.db.chat.font = font; - E.db.chat.fontSize = fontSize; - E.db.chat.tabFont = font; - E.db.chat.tapFontSize = fontSize; - E.db.datatexts.font = font; - E.db.datatexts.fontSize = fontSize; - E.db.tooltip.font = font; - E.db.tooltip.fontSize = fontSize; - E.db.tooltip.headerFontSize = fontSize; - E.db.tooltip.textFontSize = fontSize; - E.db.tooltip.smallTextFontSize = fontSize; - E.db.tooltip.healthBar.font = font; - --E.db.tooltip.healthbar.fontSize = fontSize; - E.db.unitframe.font = font; - --E.db.unitframe.fontSize = fontSize; - --E.db.unitframe.units.party.rdebuffs.font = font; - E.db.unitframe.units.raid.rdebuffs.font = font; - E.db.unitframe.units.raid40.rdebuffs.font = font; + E.db.auras.font = font + E.db.auras.fontSize = fontSize + E.db.general.reminder.font = font + --E.db.general.reminder.fontSize = fontSize + E.db.chat.font = font + E.db.chat.fontSize = fontSize + E.db.chat.tabFont = font + E.db.chat.tapFontSize = fontSize + E.db.datatexts.font = font + E.db.datatexts.fontSize = fontSize + E.db.tooltip.font = font + E.db.tooltip.fontSize = fontSize + E.db.tooltip.headerFontSize = fontSize + E.db.tooltip.textFontSize = fontSize + E.db.tooltip.smallTextFontSize = fontSize + E.db.tooltip.healthBar.font = font + --E.db.tooltip.healthbar.fontSize = fontSize + E.db.unitframe.font = font + --E.db.unitframe.fontSize = fontSize + --E.db.unitframe.units.party.rdebuffs.font = font + E.db.unitframe.units.raid.rdebuffs.font = font + E.db.unitframe.units.raid40.rdebuffs.font = font - E:UpdateAll(true); + E:UpdateAll(true) end, - OnCancel = function() E:StaticPopup_Hide("APPLY_FONT_WARNING"); end, + OnCancel = function() E:StaticPopup_Hide("APPLY_FONT_WARNING") end, button1 = YES, button2 = CANCEL, timeout = 0, whileDead = 1, hideOnEscape = false -}; +} -local MAX_STATIC_POPUPS = 4; +local MAX_STATIC_POPUPS = 4 function E:StaticPopup_OnShow() - PlaySound("igMainMenuOpen"); + PlaySound("igMainMenuOpen") - local dialog = E.PopupDialogs[self.which]; - local OnShow = dialog.OnShow; + local dialog = E.PopupDialogs[self.which] + local OnShow = dialog.OnShow if(OnShow) then - OnShow(self, self.data); + OnShow(self, self.data) end if(dialog.hasMoneyInputFrame) then - _G[self:GetName() .. "MoneyInputFrameGold"]:SetFocus(); + _G[self:GetName() .. "MoneyInputFrameGold"]:SetFocus() end if(dialog.enterClicksFirstButton) then - self:SetScript("OnKeyDown", E.StaticPopup_OnKeyDown); + self:SetScript("OnKeyDown", E.StaticPopup_OnKeyDown) end end function E:StaticPopup_EscapePressed() - local closed = nil; + local closed = nil for _, frame in pairs(E.StaticPopup_DisplayedFrames) do if(frame:IsShown() and frame.hideOnEscape) then - local standardDialog = E.PopupDialogs[frame.which]; + local standardDialog = E.PopupDialogs[frame.which] if(standardDialog) then - local OnCancel = standardDialog.OnCancel; - local noCancelOnEscape = standardDialog.noCancelOnEscape; + local OnCancel = standardDialog.OnCancel + local noCancelOnEscape = standardDialog.noCancelOnEscape if(OnCancel and not noCancelOnEscape) then - OnCancel(frame, frame.data, "clicked"); + OnCancel(frame, frame.data, "clicked") end - frame:Hide(); + frame:Hide() else - E:StaticPopupSpecial_Hide(frame); + E:StaticPopupSpecial_Hide(frame) end - closed = 1; + closed = 1 end end - return closed; + return closed end function E:StaticPopupSpecial_Hide(frame) - frame:Hide(); - E:StaticPopup_CollapseTable(); + frame:Hide() + E:StaticPopup_CollapseTable() end function E:StaticPopup_CollapseTable() - local displayedFrames = E.StaticPopup_DisplayedFrames; - local index = getn(displayedFrames); + local displayedFrames = E.StaticPopup_DisplayedFrames + local index = getn(displayedFrames) while((index >= 1) and (not displayedFrames[index]:IsShown())) do - tremove(displayedFrames, index); - index = index - 1; + tremove(displayedFrames, index) + index = index - 1 end end function E:StaticPopup_SetUpPosition(dialog) if(not tContains(E.StaticPopup_DisplayedFrames, dialog)) then - local lastFrame = E.StaticPopup_DisplayedFrames[getn(E.StaticPopup_DisplayedFrames)]; + local lastFrame = E.StaticPopup_DisplayedFrames[getn(E.StaticPopup_DisplayedFrames)] if(lastFrame) then - dialog:SetPoint("TOP", lastFrame, "BOTTOM", 0, -4); + dialog:SetPoint("TOP", lastFrame, "BOTTOM", 0, -4) else - dialog:SetPoint("TOP", E.UIParent, "TOP", 0, -100); + dialog:SetPoint("TOP", E.UIParent, "TOP", 0, -100) end - tinsert(E.StaticPopup_DisplayedFrames, dialog); + tinsert(E.StaticPopup_DisplayedFrames, dialog) end end function E:StaticPopupSpecial_Show(frame) if(frame.exclusive) then - E:StaticPopup_HideExclusive(); + E:StaticPopup_HideExclusive() end - E:StaticPopup_SetUpPosition(frame); - frame:Show(); + -- E:StaticPopup_SetUpPosition(frame) + frame:Show() end function E:StaticPopupSpecial_Hide(frame) - frame:Hide(); - E:StaticPopup_CollapseTable(); + frame:Hide() + E:StaticPopup_CollapseTable() end function E:StaticPopup_IsLastDisplayedFrame(frame) for i = getn(E.StaticPopup_DisplayedFrames), 1, -1 do - local popup = E.StaticPopup_DisplayedFrames[i]; + local popup = E.StaticPopup_DisplayedFrames[i] if(popup:IsShown()) then - return frame == popup; + return frame == popup end end - return false; + return false end function E:StaticPopup_OnKeyDown(key) if(GetBindingFromClick(key) == "TOGGLEGAMEMENU") then - return E:StaticPopup_EscapePressed(); + return E:StaticPopup_EscapePressed() elseif(GetBindingFromClick(key) == "SCREENSHOT") then - RunBinding("SCREENSHOT"); - return; + RunBinding("SCREENSHOT") + return end - local dialog = E.PopupDialogs[self.which]; + local dialog = E.PopupDialogs[self.which] if(dialog) then if(key == "ENTER" and dialog.enterClicksFirstButton) then - local frameName = self:GetName(); - local button; - local i = 1; + local frameName = self:GetName() + local button + local i = 1 while(true) do - button = _G[frameName.."Button"..i]; + button = _G[frameName.."Button"..i] if(button) then if(button:IsShown()) then - E:StaticPopup_OnClick(self, i); - return; + E:StaticPopup_OnClick(self, i) + return end - i = i + 1; + i = i + 1 else - break; + break end end end @@ -537,521 +491,501 @@ function E:StaticPopup_OnKeyDown(key) end function E:StaticPopup_OnHide() - PlaySound("igMainMenuClose"); + PlaySound("igMainMenuClose") - E:StaticPopup_CollapseTable(); + E:StaticPopup_CollapseTable() - local dialog = E.PopupDialogs[self.which]; - local OnHide = dialog.OnHide; + local dialog = E.PopupDialogs[self.which] + local OnHide = dialog.OnHide if(OnHide) then - OnHide(self, self.data); + OnHide(self, self.data) end - self.extraFrame:Hide(); if(dialog.enterClicksFirstButton) then - self:SetScript("OnKeyDown", nil); + self:SetScript("OnKeyDown", nil) end end function E:StaticPopup_OnUpdate(elapsed) if(self.timeleft and self.timeleft > 0) then - local which = self.which; - local timeleft = self.timeleft - elapsed; + local which = self.which + local timeleft = self.timeleft - elapsed if(timeleft <= 0) then if(not E.PopupDialogs[which].timeoutInformationalOnly) then - self.timeleft = 0; - local OnCancel = E.PopupDialogs[which].OnCancel; + self.timeleft = 0 + local OnCancel = E.PopupDialogs[which].OnCancel if(OnCancel) then - OnCancel(self, self.data, "timeout"); + OnCancel(self, self.data, "timeout") end - self:Hide(); + self:Hide() end - return; + return end - self.timeleft = timeleft; + self.timeleft = timeleft end if(self.startDelay) then - local which = self.which; - local timeleft = self.startDelay - elapsed; + local which = self.which + local timeleft = self.startDelay - elapsed if(timeleft <= 0) then - self.startDelay = nil; - local text = _G[self:GetName() .. "Text"]; - text:SetFormattedText(E.PopupDialogs[which].text, text.text_arg1, text.text_arg2); - local button1 = _G[self:GetName() .. "Button1"]; - button1:Enable(); - StaticPopup_Resize(self, which); - return; + self.startDelay = nil + local text = _G[self:GetName() .. "Text"] + text:SetFormattedText(E.PopupDialogs[which].text, text.text_arg1, text.text_arg2) + local button1 = _G[self:GetName() .. "Button1"] + button1:Enable() + StaticPopup_Resize(self, which) + return end - self.startDelay = timeleft; + self.startDelay = timeleft end - local onUpdate = E.PopupDialogs[self.which].OnUpdate; + local onUpdate = E.PopupDialogs[self.which].OnUpdate if(onUpdate) then - onUpdate(self, elapsed); + onUpdate(self, elapsed) end end function E:StaticPopup_OnClick(index) if(not self:IsShown()) then - return; + return end - local which = self.which; - local info = E.PopupDialogs[which]; + local which = self.which + local info = E.PopupDialogs[which] if(not info) then - return nil; + return nil end - local hide = true; + local hide = true if(index == 1) then - local OnAccept = info.OnAccept; + local OnAccept = info.OnAccept if(OnAccept) then - hide = not OnAccept(self, self.data, self.data2); + hide = not OnAccept(self, self.data, self.data2) end elseif(index == 3) then - local OnAlt = info.OnAlt; + local OnAlt = info.OnAlt if(OnAlt) then - OnAlt(self, self.data, "clicked"); + OnAlt(self, self.data, "clicked") end else - local OnCancel = info.OnCancel; + local OnCancel = info.OnCancel if(OnCancel) then - hide = not OnCancel(self, self.data, "clicked"); + hide = not OnCancel(self, self.data, "clicked") end end if(hide and (which == self.which) and (index ~= 3 or not info.noCloseOnAlt)) then - self:Hide(); + self:Hide() end end function E:StaticPopup_EditBoxOnEnterPressed() - local EditBoxOnEnterPressed, which, dialog; - local parent = self:GetParent(); + local EditBoxOnEnterPressed, which, dialog + local parent = self:GetParent() if(parent.which) then - which = parent.which; - dialog = parent; + which = parent.which + dialog = parent elseif(parent:GetParent().which) then - which = parent:GetParent().which; - dialog = parent:GetParent(); + which = parent:GetParent().which + dialog = parent:GetParent() end - if(not self.autoCompleteParams or not AutoCompleteEditBox_OnEnterPressed(self)) then - EditBoxOnEnterPressed = E.PopupDialogs[which].EditBoxOnEnterPressed; - if(EditBoxOnEnterPressed) then - EditBoxOnEnterPressed(self, dialog.data); - end + EditBoxOnEnterPressed = E.PopupDialogs[which].EditBoxOnEnterPressed + if(EditBoxOnEnterPressed) then + EditBoxOnEnterPressed(self, dialog.data) end end function E:StaticPopup_EditBoxOnEscapePressed() - local EditBoxOnEscapePressed = E.PopupDialogs[self:GetParent().which].EditBoxOnEscapePressed; + local EditBoxOnEscapePressed = E.PopupDialogs[self:GetParent().which].EditBoxOnEscapePressed if(EditBoxOnEscapePressed) then - EditBoxOnEscapePressed(self, self:GetParent().data); + EditBoxOnEscapePressed(self, self:GetParent().data) end end function E:StaticPopup_EditBoxOnTextChanged(userInput) - if(not self.autoCompleteParams or not AutoCompleteEditBox_OnTextChanged(self, userInput)) then - local EditBoxOnTextChanged = E.PopupDialogs[self:GetParent().which].EditBoxOnTextChanged; - if(EditBoxOnTextChanged) then - EditBoxOnTextChanged(self, self:GetParent().data); - end + local EditBoxOnTextChanged = E.PopupDialogs[self:GetParent().which].EditBoxOnTextChanged + if(EditBoxOnTextChanged) then + EditBoxOnTextChanged(self, self:GetParent().data) end end function E:StaticPopup_FindVisible(which, data) - local info = E.PopupDialogs[which]; + local info = E.PopupDialogs[which] if(not info) then - return nil; + return nil end for index = 1, MAX_STATIC_POPUPS, 1 do - local frame = _G["ElvUI_StaticPopup" .. index]; + local frame = _G["ElvUI_StaticPopup" .. index] if(frame:IsShown() and (frame.which == which) and (not info.multiple or (frame.data == data))) then - return frame; + return frame end end - return nil; + return nil end function E:StaticPopup_Resize(dialog, which) - local info = E.PopupDialogs[which]; + local info = E.PopupDialogs[which] if(not info) then - return nil; + return nil end - local name = dialog:GetName(); - local text = _G[name .. "Text"]; - local editBox = _G[name .. "EditBox"]; - local button1 = _G[name .. "Button1"]; + local name = dialog:GetName() + local text = _G[name .. "Text"] + local editBox = _G[name .. "EditBox"] + local button1 = _G[name .. "Button1"] - local maxHeightSoFar, maxWidthSoFar = (dialog.maxHeightSoFar or 0), (dialog.maxWidthSoFar or 0); - local width = 320; + local maxHeightSoFar, maxWidthSoFar = (dialog.maxHeightSoFar or 0), (dialog.maxWidthSoFar or 0) + local width = 320 if(dialog.numButtons == 3) then - width = 440; + width = 440 elseif(info.showAlert or info.showAlertGear or info.closeButton) then - width = 420; + width = 420 elseif(info.editBoxWidth and info.editBoxWidth > 260) then - width = width + (info.editBoxWidth - 260); + width = width + (info.editBoxWidth - 260) end if(width > maxWidthSoFar) then - dialog:SetWidth(width); - dialog.maxWidthSoFar = width; + dialog:SetWidth(width) + dialog.maxWidthSoFar = width end - local height = 32 + text:GetHeight() + 8 + button1:GetHeight(); + local height = 32 + text:GetHeight() + 8 + button1:GetHeight() if(info.hasEditBox) then - height = height + 8 + editBox:GetHeight(); + height = height + 8 + editBox:GetHeight() elseif(info.hasMoneyFrame) then - height = height + 16; + height = height + 16 elseif(info.hasMoneyInputFrame) then - height = height + 22; + height = height + 22 end if(info.hasItemFrame) then - height = height + 64; + height = height + 64 end if(height > maxHeightSoFar) then - dialog:SetHeight(height); - dialog.maxHeightSoFar = height; + dialog:SetHeight(height) + dialog.maxHeightSoFar = height end end function E:StaticPopup_OnEvent() - self.maxHeightSoFar = 0; - E:StaticPopup_Resize(self, self.which); + self.maxHeightSoFar = 0 + E:StaticPopup_Resize(self, self.which) end -local tempButtonLocs = {}; +local tempButtonLocs = {} function E:StaticPopup_Show(which, text_arg1, text_arg2, data) - local info = E.PopupDialogs[which]; + local info = E.PopupDialogs[which] if(not info) then - return nil; + return nil end if(UnitIsDeadOrGhost("player") and not info.whileDead) then if(info.OnCancel) then - info.OnCancel(); + info.OnCancel() end - return nil; + return nil end if(InCinematic() and not info.interruptCinematic) then if(info.OnCancel) then - info.OnCancel(); + info.OnCancel() end - return nil; + return nil end if(info.cancels) then for index = 1, MAX_STATIC_POPUPS, 1 do - local frame = _G["ElvUI_StaticPopup" .. index]; + local frame = _G["ElvUI_StaticPopup" .. index] if(frame:IsShown() and (frame.which == info.cancels)) then - frame:Hide(); - local OnCancel = E.PopupDialogs[frame.which].OnCancel; + frame:Hide() + local OnCancel = E.PopupDialogs[frame.which].OnCancel if(OnCancel) then - OnCancel(frame, frame.data, "override"); + OnCancel(frame, frame.data, "override") end end end end - local dialog = nil; - dialog = E:StaticPopup_FindVisible(which, data); + local dialog = nil + dialog = E:StaticPopup_FindVisible(which, data) if(dialog) then if(not info.noCancelOnReuse) then - local OnCancel = info.OnCancel; + local OnCancel = info.OnCancel if(OnCancel) then - OnCancel(dialog, dialog.data, "override"); + OnCancel(dialog, dialog.data, "override") end end - dialog:Hide(); + dialog:Hide() end if(not dialog) then - local index = 1; + local index = 1 if(info.preferredIndex) then - index = info.preferredIndex; + index = info.preferredIndex end for i = index, MAX_STATIC_POPUPS do - local frame = _G["ElvUI_StaticPopup" .. i]; + local frame = _G["ElvUI_StaticPopup" .. i] if(not frame:IsShown()) then - dialog = frame; - break; + dialog = frame + break end end if(not dialog and info.preferredIndex) then for i = 1, info.preferredIndex do - local frame = _G["ElvUI_StaticPopup" .. i]; + local frame = _G["ElvUI_StaticPopup" .. i] if(not frame:IsShown()) then - dialog = frame; - break; + dialog = frame + break end end end end if(not dialog) then if(info.OnCancel) then - info.OnCancel(); + info.OnCancel() end - return nil; + return nil end - dialog.maxHeightSoFar, dialog.maxWidthSoFar = 0, 0; + dialog.maxHeightSoFar, dialog.maxWidthSoFar = 0, 0 - local name = dialog:GetName(); - local text = _G[name .. "Text"]; - text:SetFormattedText(info.text, text_arg1, text_arg2); + local name = dialog:GetName() + local text = _G[name .. "Text"] + text:SetFormattedText(info.text, text_arg1, text_arg2) if(info.closeButton) then - local closeButton = _G[name .. "CloseButton"]; + local closeButton = _G[name .. "CloseButton"] if(info.closeButtonIsHide) then - closeButton:SetNormalTexture("Interface\\Buttons\\UI-Panel-HideButton-Up"); - closeButton:SetPushedTexture("Interface\\Buttons\\UI-Panel-HideButton-Down"); + closeButton:SetNormalTexture("Interface\\Buttons\\UI-Panel-HideButton-Up") + closeButton:SetPushedTexture("Interface\\Buttons\\UI-Panel-HideButton-Down") else - closeButton:SetNormalTexture("Interface\\Buttons\\UI-Panel-MinimizeButton-Up"); - closeButton:SetPushedTexture("Interface\\Buttons\\UI-Panel-MinimizeButton-Down"); + closeButton:SetNormalTexture("Interface\\Buttons\\UI-Panel-MinimizeButton-Up") + closeButton:SetPushedTexture("Interface\\Buttons\\UI-Panel-MinimizeButton-Down") end - closeButton:Show(); + closeButton:Show() else - _G[name .. "CloseButton"]:Hide(); + _G[name .. "CloseButton"]:Hide() end - local editBox = _G[name .. "EditBox"]; + local editBox = _G[name .. "EditBox"] if(info.hasEditBox) then - editBox:Show(); + editBox:Show() if(info.maxLetters) then - editBox:SetMaxLetters(info.maxLetters); - editBox:SetCountInvisibleLetters(info.countInvisibleLetters); + editBox:SetMaxLetters(info.maxLetters) end if(info.maxBytes) then - editBox:SetMaxBytes(info.maxBytes); + editBox:SetMaxBytes(info.maxBytes) end - editBox:SetText(""); + editBox:SetText("") if(info.editBoxWidth) then - editBox:SetWidth(info.editBoxWidth); + editBox:SetWidth(info.editBoxWidth) else - editBox:SetWidth(130); + editBox:SetWidth(130) end else - editBox:Hide(); + editBox:Hide() end if(info.hasMoneyFrame) then - _G[name .. "MoneyFrame"]:Show(); - _G[name .. "MoneyInputFrame"]:Hide(); + _G[name .. "MoneyFrame"]:Show() + _G[name .. "MoneyInputFrame"]:Hide() elseif(info.hasMoneyInputFrame) then - local moneyInputFrame = _G[name .. "MoneyInputFrame"]; - moneyInputFrame:Show(); - _G[name .. "MoneyFrame"]:Hide(); + local moneyInputFrame = _G[name .. "MoneyInputFrame"] + moneyInputFrame:Show() + _G[name .. "MoneyFrame"]:Hide() if(info.EditBoxOnEnterPressed) then - moneyInputFrame.gold:SetScript("OnEnterPressed", E.StaticPopup_EditBoxOnEnterPressed); - moneyInputFrame.silver:SetScript("OnEnterPressed", E.StaticPopup_EditBoxOnEnterPressed); - moneyInputFrame.copper:SetScript("OnEnterPressed", E.StaticPopup_EditBoxOnEnterPressed); + moneyInputFrame.gold:SetScript("OnEnterPressed", E.StaticPopup_EditBoxOnEnterPressed) + moneyInputFrame.silver:SetScript("OnEnterPressed", E.StaticPopup_EditBoxOnEnterPressed) + moneyInputFrame.copper:SetScript("OnEnterPressed", E.StaticPopup_EditBoxOnEnterPressed) else - moneyInputFrame.gold:SetScript("OnEnterPressed", nil); - moneyInputFrame.silver:SetScript("OnEnterPressed", nil); - moneyInputFrame.copper:SetScript("OnEnterPressed", nil); + moneyInputFrame.gold:SetScript("OnEnterPressed", nil) + moneyInputFrame.silver:SetScript("OnEnterPressed", nil) + moneyInputFrame.copper:SetScript("OnEnterPressed", nil) end else - _G[name .. "MoneyFrame"]:Hide(); - _G[name .. "MoneyInputFrame"]:Hide(); + _G[name .. "MoneyFrame"]:Hide() + _G[name .. "MoneyInputFrame"]:Hide() end if(info.hasItemFrame) then - _G[name .. "ItemFrame"]:Show(); + _G[name .. "ItemFrame"]:Show() if(data and type(data) == "table") then - _G[name .. "ItemFrame"].link = data.link; - _G[name .. "ItemFrameIconTexture"]:SetTexture(data.texture); - local nameText = _G[name .. "ItemFrameText"]; - nameText:SetTextColor(unpack(data.color or {1, 1, 1, 1})); - nameText:SetText(data.name); + _G[name .. "ItemFrame"].link = data.link + _G[name .. "ItemFrameIconTexture"]:SetTexture(data.texture) + local nameText = _G[name .. "ItemFrameText"] + nameText:SetTextColor(unpack(data.color or {1, 1, 1, 1})) + nameText:SetText(data.name) if(data.count and data.count > 1) then - _G[name .. "ItemFrameCount"]:SetText(data.count); - _G[name .. "ItemFrameCount"]:Show(); + _G[name .. "ItemFrameCount"]:SetText(data.count) + _G[name .. "ItemFrameCount"]:Show() else - _G[name .. "ItemFrameCount"]:Hide(); + _G[name .. "ItemFrameCount"]:Hide() end end else - _G[name .. "ItemFrame"]:Hide(); + _G[name .. "ItemFrame"]:Hide() end - dialog.which = which; - dialog.timeleft = info.timeout; - dialog.hideOnEscape = info.hideOnEscape; - dialog.exclusive = info.exclusive; - dialog.enterClicksFirstButton = info.enterClicksFirstButton; - dialog.data = data; + dialog.which = which + dialog.timeleft = info.timeout + dialog.hideOnEscape = info.hideOnEscape + dialog.exclusive = info.exclusive + dialog.enterClicksFirstButton = info.enterClicksFirstButton + dialog.data = data - local button1 = _G[name .. "Button1"]; - local button2 = _G[name .. "Button2"]; - local button3 = _G[name .. "Button3"]; + local button1 = _G[name .. "Button1"] + local button2 = _G[name .. "Button2"] + local button3 = _G[name .. "Button3"] do - assert(getn(tempButtonLocs) == 0); + assert(getn(tempButtonLocs == 0)) - tinsert(tempButtonLocs, button1); - tinsert(tempButtonLocs, button2); - tinsert(tempButtonLocs, button3); + tinsert(tempButtonLocs, button1) + tinsert(tempButtonLocs, button2) + tinsert(tempButtonLocs, button3) for i = getn(tempButtonLocs), 1, -1 do - tempButtonLocs[i]:SetText(info["button"..i]); - tempButtonLocs[i]:Hide(); - tempButtonLocs[i]:ClearAllPoints(); + tempButtonLocs[i]:SetText(info["button"..i]) + tempButtonLocs[i]:Hide() + tempButtonLocs[i]:ClearAllPoints() if(not (info["button"..i] and ( not info["DisplayButton"..i] or info["DisplayButton"..i](dialog)))) then - tremove(tempButtonLocs, i); + tremove(tempButtonLocs, i) end end - local numButtons = getn(tempButtonLocs); - dialog.numButtons = numButtons; + local numButtons = getn(tempButtonLocs) + dialog.numButtons = numButtons if(numButtons == 3) then - tempButtonLocs[1]:SetPoint("BOTTOMRIGHT", dialog, "BOTTOM", -72, 16); + tempButtonLocs[1]:SetPoint("BOTTOMRIGHT", dialog, "BOTTOM", -72, 16) elseif(numButtons == 2) then - tempButtonLocs[1]:SetPoint("BOTTOMRIGHT", dialog, "BOTTOM", -6, 16); + tempButtonLocs[1]:SetPoint("BOTTOMRIGHT", dialog, "BOTTOM", -6, 16) elseif(numButtons == 1) then - tempButtonLocs[1]:SetPoint("BOTTOM", dialog, "BOTTOM", 0, 16); + tempButtonLocs[1]:SetPoint("BOTTOM", dialog, "BOTTOM", 0, 16) end for i = 1, numButtons do if(i > 1) then - tempButtonLocs[i]:SetPoint("LEFT", tempButtonLocs[i-1], "RIGHT", 13, 0); + tempButtonLocs[i]:SetPoint("LEFT", tempButtonLocs[i-1], "RIGHT", 13, 0) end - local width = tempButtonLocs[i]:GetTextWidth(); + local width = tempButtonLocs[i]:GetTextWidth() if(width > 110) then - tempButtonLocs[i]:SetWidth(width + 20); + tempButtonLocs[i]:SetWidth(width + 20) else - tempButtonLocs[i]:SetWidth(120); + tempButtonLocs[i]:SetWidth(120) end - tempButtonLocs[i]:Enable(); - tempButtonLocs[i]:Show(); + tempButtonLocs[i]:Enable() + tempButtonLocs[i]:Show() end - wipe(tempButtonLocs); + wipe(tempButtonLocs) end - local alertIcon = _G[name .. "AlertIcon"]; + local alertIcon = _G[name .. "AlertIcon"] if(info.showAlert) then - alertIcon:SetTexture(STATICPOPUP_TEXTURE_ALERT); + alertIcon:SetTexture("Interface\\DialogFrame\\DialogAlertIcon") if(button3:IsShown())then - alertIcon:SetPoint("LEFT", 24, 10); + alertIcon:SetPoint("LEFT", 24, 10) else - alertIcon:SetPoint("LEFT", 24, 0); + alertIcon:SetPoint("LEFT", 24, 0) end - alertIcon:Show(); + alertIcon:Show() elseif(info.showAlertGear) then - alertIcon:SetTexture(STATICPOPUP_TEXTURE_ALERTGEAR); + alertIcon:SetTexture("Interface\\DialogFrame\\DialogAlertIcon") if(button3:IsShown())then - alertIcon:SetPoint("LEFT", 24, 0); + alertIcon:SetPoint("LEFT", 24, 0) else - alertIcon:SetPoint("LEFT", 24, 0); + alertIcon:SetPoint("LEFT", 24, 0) end - alertIcon:Show(); + alertIcon:Show() else - alertIcon:SetTexture(); - alertIcon:Hide(); + alertIcon:SetTexture() + alertIcon:Hide() end if(info.StartDelay) then - dialog.startDelay = info.StartDelay(); - button1:Disable(); + dialog.startDelay = info.StartDelay() + button1:Disable() else - dialog.startDelay = nil; - button1:Enable(); + dialog.startDelay = nil + button1:Enable() end - editBox.autoCompleteParams = info.autoCompleteParams; - editBox.autoCompleteRegex = info.autoCompleteRegex; - editBox.autoCompleteFormatRegex = info.autoCompleteFormatRegex; + -- E:StaticPopup_SetUpPosition(dialog) + dialog:Show() - editBox.addHighlightedText = true; - - E:StaticPopup_SetUpPosition(dialog); - dialog:Show(); - - E:StaticPopup_Resize(dialog, which); + E:StaticPopup_Resize(dialog, which) if(info.sound) then - PlaySound(info.sound); + PlaySound(info.sound) end - return dialog; + return dialog end function E:StaticPopup_Hide(which, data) for index = 1, MAX_STATIC_POPUPS, 1 do - local dialog = _G["ElvUI_StaticPopup" .. index]; + local dialog = _G["ElvUI_StaticPopup" .. index] if((dialog.which == which) and (not data or (data == dialog.data))) then - dialog:Hide(); + dialog:Hide() end end end -function E:StaticPopup_CombineTables() - if(not tContains(E.StaticPopup_DisplayedFrames, dialog)) then - local lastFrame = E.StaticPopup_DisplayedFrames[getn(StaticPopup_DisplayedFrames)]; - if(lastFrame) then - dialog:SetPoint("TOP", lastFrame, "BOTTOM", 0, -4); - else - dialog:SetPoint("TOP", E.UIParent, "TOP", 0, -135); - end - tinsert(E.StaticPopup_DisplayedFrames, dialog); - end -end - function E:Contruct_StaticPopups() - E.StaticPopupFrames = {}; + E.StaticPopupFrames = {} - local S = self:GetModule("Skins"); + local S = self:GetModule("Skins") for index = 1, MAX_STATIC_POPUPS do - E.StaticPopupFrames[index] = CreateFrame("Frame", "ElvUI_StaticPopup" .. index, E.UIParent, "StaticPopupTemplate"); - E.StaticPopupFrames[index]:SetID(index); + E.StaticPopupFrames[index] = CreateFrame("Frame", "ElvUI_StaticPopup" .. index, E.UIParent, "StaticPopupTemplate") + E.StaticPopupFrames[index]:SetID(index) - E.StaticPopupFrames[index]:SetScript("OnShow", E.StaticPopup_OnShow); - E.StaticPopupFrames[index]:SetScript("OnHide", E.StaticPopup_OnHide); - E.StaticPopupFrames[index]:SetScript("OnUpdate", E.StaticPopup_OnUpdate); - E.StaticPopupFrames[index]:SetScript("OnEvent", E.StaticPopup_OnEvent); + E.StaticPopupFrames[index]:SetScript("OnShow", E.StaticPopup_OnShow) + E.StaticPopupFrames[index]:SetScript("OnHide", E.StaticPopup_OnHide) + E.StaticPopupFrames[index]:SetScript("OnUpdate", E.StaticPopup_OnUpdate) + E.StaticPopupFrames[index]:SetScript("OnEvent", E.StaticPopup_OnEvent) - local name = E.StaticPopupFrames[index]:GetName(); - for i = 1, 2 do + local name = E.StaticPopupFrames[index]:GetName() + for i = 1, 3 do _G[name .. "Button" .. i]:SetScript("OnClick", function(self) - E.StaticPopup_OnClick(self:GetParent(), self:GetID()); - end); + E.StaticPopup_OnClick(self:GetParent(), self:GetID()) + end) end - _G[name .. "EditBox"]:SetScript("OnEnterPressed", E.StaticPopup_EditBoxOnEnterPressed); - _G[name .. "EditBox"]:SetScript("OnEscapePressed", E.StaticPopup_EditBoxOnEscapePressed); - _G[name .. "EditBox"]:SetScript("OnTextChanged", E.StaticPopup_EditBoxOnTextChanged); + _G[name .. "EditBox"]:SetScript("OnEnterPressed", E.StaticPopup_EditBoxOnEnterPressed) + _G[name .. "EditBox"]:SetScript("OnEscapePressed", E.StaticPopup_EditBoxOnEscapePressed) + _G[name .. "EditBox"]:SetScript("OnTextChanged", E.StaticPopup_EditBoxOnTextChanged) - E:SetTemplate(E.StaticPopupFrames[index], "Transparent"); + E:SetTemplate(E.StaticPopupFrames[index], "Transparent") - for i = 1, 2 do - S:HandleButton(_G[name .. "Button" .. i]); + E.StaticPopupFrames[index].text = _G[name .. "Text"] + E.StaticPopupFrames[index].editBox = _G[name .. "EditBox"] + + for i = 1, 3 do + E.StaticPopupFrames[index]["button"..i] = _G[name .. "Button" .. i] + S:HandleButton(_G[name .. "Button" .. i]) end - S:HandleEditBox(_G[name .. "EditBox"]); + S:HandleEditBox(_G[name .. "EditBox"]) for k = 1, _G[name .. "EditBox"]:GetNumRegions() do - --local region = select(k, _G[name .. "EditBox"]:GetRegions()) - --if(region and region:IsObjectType("Texture")) then - -- if(region:GetTexture() == "Interface\\ChatFrame\\UI-ChatInputBorder-Left" or region:GetTexture() == "Interface\\ChatFrame\\UI-ChatInputBorder-Right") then - -- region:Kill(); - -- end - --end + local region = select(k, _G[name .. "EditBox"]:GetRegions()) + if(region and region:IsObjectType("Texture")) then + if(region:GetTexture() == "Interface\\ChatFrame\\UI-ChatInputBorder-Left" or region:GetTexture() == "Interface\\ChatFrame\\UI-ChatInputBorder-Right") then + E:kill(region) + end + end end - S:HandleEditBox(_G[name .. "MoneyInputFrameGold"]); - S:HandleEditBox(_G[name .. "MoneyInputFrameSilver"]); - S:HandleEditBox(_G[name .. "MoneyInputFrameCopper"]); - _G[name .. "EditBox"].backdrop:Point("TOPLEFT", -2, -4); - _G[name .. "EditBox"].backdrop:Point("BOTTOMRIGHT", 2, 4); - _G[name .. "ItemFrameNameFrame"]:Kill(); - _G[name .. "ItemFrame"]:GetNormalTexture():Kill(); - E:SetTemplate(_G[name .. "ItemFrame"], "Default"); - _G[name .. "ItemFrame"]:StyleButton(); - _G[name .. "ItemFrameIconTexture"]:SetTexCoord(unpack(E.TexCoords)); - _G[name .. "ItemFrameIconTexture"]:SetInside(); + S:HandleEditBox(_G[name .. "MoneyInputFrameGold"]) + S:HandleEditBox(_G[name .. "MoneyInputFrameSilver"]) + S:HandleEditBox(_G[name .. "MoneyInputFrameCopper"]) + _G[name .. "EditBox"].backdrop:SetPoint("TOPLEFT", -2, -4) + _G[name .. "EditBox"].backdrop:SetPoint("BOTTOMRIGHT", 2, 4) + E:Kill(_G[name .. "ItemFrameNameFrame"]) + E:Kill(_G[name .. "ItemFrame"]:GetNormalTexture()) + E:SetTemplate(_G[name .. "ItemFrame"], "Default") + E:StyleButton(_G[name .. "ItemFrame"]) + _G[name .. "ItemFrameIconTexture"]:SetTexCoord(unpack(E.TexCoords)) + E:SetInside(_G[name .. "ItemFrameIconTexture"]) end - E:SecureHook("StaticPopup_SetUpPosition"); - E:SecureHook("StaticPopup_CollapseTable"); + E:SecureHook("StaticPopup_Resize", "StaticPopup_SetUpPosition") + E:SecureHook("StaticPopup_OnHide", "StaticPopup_CollapseTable") end \ No newline at end of file diff --git a/2/3/4/5/6/7/ElvUI/Libraries/AceCore-3.0/AceCore-3.0.lua b/2/3/4/5/6/7/ElvUI/Libraries/AceCore-3.0/AceCore-3.0.lua index e8bf464..7a605e2 100644 --- a/2/3/4/5/6/7/ElvUI/Libraries/AceCore-3.0/AceCore-3.0.lua +++ b/2/3/4/5/6/7/ElvUI/Libraries/AceCore-3.0/AceCore-3.0.lua @@ -3,7 +3,7 @@ local AceCore, oldminor = LibStub:NewLibrary(ACECORE_MAJOR, ACECORE_MINOR) if not AceCore then return end -- No upgrade needed -AceCore._G = AceCore._G or getfenv() +AceCore._G = AceCore._G or _G local _G = AceCore._G local strsub, strgsub, strfind = string.sub, string.gsub, string.find local tremove, tconcat = table.remove, table.concat diff --git a/2/3/4/5/6/7/ElvUI/Libraries/LibUIDropDownMenu/LibEasyMenu.lua b/2/3/4/5/6/7/ElvUI/Libraries/LibUIDropDownMenu/LibEasyMenu.lua index 7978eff..7bad616 100644 --- a/2/3/4/5/6/7/ElvUI/Libraries/LibUIDropDownMenu/LibEasyMenu.lua +++ b/2/3/4/5/6/7/ElvUI/Libraries/LibUIDropDownMenu/LibEasyMenu.lua @@ -17,7 +17,7 @@ -- ---------------------------------------------------------------------------- -- Localized Lua globals. -- ---------------------------------------------------------------------------- -local _G = getfenv(0) +local _G = _G -- ---------------------------------------------------------------------------- local MAJOR_VERSION = "LibEasyMenu-1.04.7030024484" local MINOR_VERSION = 90000 + 19 diff --git a/2/3/4/5/6/7/ElvUI/Libraries/oUF/elements/castbar.lua b/2/3/4/5/6/7/ElvUI/Libraries/oUF/elements/castbar.lua index a16c575..538e62f 100644 --- a/2/3/4/5/6/7/ElvUI/Libraries/oUF/elements/castbar.lua +++ b/2/3/4/5/6/7/ElvUI/Libraries/oUF/elements/castbar.lua @@ -432,13 +432,13 @@ local function onUpdate(self, elapsed) if(self.CustomDelayText) then self:CustomDelayText(duration) else - self.Time:SetFormattedText('%.1f|cffff0000-%.1f|r', duration, self.delay) + self.Time:SetText(format('%.1f|cffff0000-%.1f|r', duration, self.delay)) end else if(self.CustomTimeText) then self:CustomTimeText(duration) else - self.Time:SetFormattedText('%.1f', duration) + self.Time:SetText(format('%.1f', duration)) end end end @@ -465,13 +465,13 @@ local function onUpdate(self, elapsed) if(self.CustomDelayText) then self:CustomDelayText(duration) else - self.Time:SetFormattedText('%.1f|cffff0000-%.1f|r', duration, self.delay) + self.Time:SetText(format('%.1f|cffff0000-%.1f|r', duration, self.delay)) end else if(self.CustomTimeText) then self:CustomTimeText(duration) else - self.Time:SetFormattedText('%.1f', duration) + self.Time:SetText(format('%.1f', duration)) end end end diff --git a/2/3/4/5/6/7/ElvUI/Modules/DataTexts/DataTexts.lua b/2/3/4/5/6/7/ElvUI/Modules/DataTexts/DataTexts.lua index 5c1fe15..450068d 100644 --- a/2/3/4/5/6/7/ElvUI/Modules/DataTexts/DataTexts.lua +++ b/2/3/4/5/6/7/ElvUI/Modules/DataTexts/DataTexts.lua @@ -79,7 +79,7 @@ function DT:SetupObjectLDB(name, obj) if value == nil or (len(value) >= 3) or value == "n/a" or name == value then curFrame.text:SetText(value ~= "n/a" and value or name) else - curFrame.text:SetFormattedText("%s: %s%s|r", name, hex, value) + curFrame.text:SetText(format("%s: %s%s|r", name, hex, value)) end end diff --git a/2/3/4/5/6/7/ElvUI/Modules/DataTexts/Friends.lua b/2/3/4/5/6/7/ElvUI/Modules/DataTexts/Friends.lua index ecc964c..c3a47a9 100644 --- a/2/3/4/5/6/7/ElvUI/Modules/DataTexts/Friends.lua +++ b/2/3/4/5/6/7/ElvUI/Modules/DataTexts/Friends.lua @@ -44,14 +44,14 @@ end local menuFrame = CreateFrame("Frame", "FriendDatatextRightClickMenu", E.UIParent, "L_UIDropDownMenuTemplate") local menuList = { - {text = "OPTIONS_MENU", isTitle = true, notCheckable = true}, - {text = "INVITE", hasArrow = true, notCheckable = true}, - {text = "CHAT_MSG_WHISPER_INFORM", hasArrow = true, notCheckable= true}, - {text = "PLAYER_STATUS", hasArrow = true, notCheckable = true, + {text = OPTIONS_MENU, isTitle = true, notCheckable = true}, + {text = INVITE, hasArrow = true, notCheckable = true}, + {text = CHAT_MSG_WHISPER_INFORM, hasArrow = true, notCheckable = true}, + {text = PLAYER_STATUS, hasArrow = true, notCheckable = true, menuList = { - {text = "|cff2BC226" .. "AVAILABLE" .. "|r", notCheckable = true, func = function() end}, - {text = "|cffE7E716" .. "AFK" .. "|r", notCheckable = true, func = function() end}, - {text = "|cffFF0000" .. "DND" .. "|r", notCheckable = true, func = function() end} + {text = "|cff2BC226" .. AVAILABLE .. "|r", notCheckable = true, func = function() end}, + {text = "|cffE7E716" .. CHAT_MSG_AFK .. "|r", notCheckable = true, func = function() end}, + {text = "|cffFF0000" .. CHAT_MSG_DND .. "|r", notCheckable = true, func = function() end} } } } @@ -95,9 +95,9 @@ local function BuildFriendTable(total) for i = 1, total do name, level, class, area, connected, status, note = GetFriendInfo(i) - if status == "<" .. "AFK" .. ">" then + if status == CHAT_FLAG_AFK then status = "|cffFFFFFF[|r|cffFF0000" .. L["AFK"] .. "|r|cffFFFFFF]|r" - elseif status == "<" .. "DND" .. ">" then + elseif status == CHAT_FLAG_DND then status = "|cffFFFFFF[|r|cffFF0000" .. L["DND"] .. "|r|cffFFFFFF]|r" end diff --git a/2/3/4/5/6/7/ElvUI/Modules/DataTexts/Guild.lua b/2/3/4/5/6/7/ElvUI/Modules/DataTexts/Guild.lua index 808e24d..6ed392c 100644 --- a/2/3/4/5/6/7/ElvUI/Modules/DataTexts/Guild.lua +++ b/2/3/4/5/6/7/ElvUI/Modules/DataTexts/Guild.lua @@ -118,10 +118,10 @@ local function OnEvent(self, event, ...) end end -local menuFrame = CreateFrame("Frame", "GuildDatatTextRightClickMenu", E.UIParent, "UIDropDownMenuTemplate") +local menuFrame = CreateFrame("Frame", "GuildDatatTextRightClickMenu", E.UIParent, "L_UIDropDownMenuTemplate") local menuList = { - { text = OPTIONS_MENU, isTitle = true, notCheckable=true}, - { text = INVITE, hasArrow = true, notCheckable=true,}, + { text = OPTIONS_MENU, isTitle = true, notCheckable = true}, + { text = INVITE, hasArrow = true, notCheckable = true,}, { text = CHAT_MSG_WHISPER_INFORM, hasArrow = true, notCheckable=true,} }