Commit 649226e3 authored by Simpy's avatar Simpy 🐹

12.04

parents 2f104c04 75051b19
## Interface: 90001
## Author: Elv, Simpy
## Version: 12.03
## Version: 12.04
## Title: |cff1784d1ElvUI|r
## Notes: User Interface replacement AddOn for World of Warcraft.
## SavedVariables: ElvDB, ElvPrivateDB
......
......@@ -2,7 +2,7 @@ local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, Private
local AB = E:GetModule('ActionBars')
local _G = _G
local unpack, next, tremove = unpack, next, tremove
local unpack = unpack
local ipairs, pairs, select, strmatch = ipairs, pairs, select, strmatch
local format, gsub, strsplit, strfind = format, gsub, strsplit, strfind
......@@ -864,7 +864,7 @@ function AB:ButtonEventsRegisterFrame(added)
local wasAdded = frame == added
if not added or wasAdded then
if not strmatch(frame:GetName(), 'ExtraActionButton%d') then
tremove(_G.ActionBarButtonEventsFrame.frames, index)
_G.ActionBarButtonEventsFrame.frames[index] = nil
end
if wasAdded then
......
......@@ -13,8 +13,6 @@ local IsPlayerAtEffectiveMaxLevel = IsPlayerAtEffectiveMaxLevel
local C_QuestLog_GetNumQuestLogEntries = C_QuestLog.GetNumQuestLogEntries
local C_QuestLog_GetQuestIDForLogIndex = C_QuestLog.GetQuestIDForLogIndex
local C_QuestLog_ReadyForTurnIn = C_QuestLog.ReadyForTurnIn
local C_QuestLog_SetSelectedQuest = C_QuestLog.SetSelectedQuest
local C_QuestLog_ShouldShowQuestRewards = C_QuestLog.ShouldShowQuestRewards
local C_QuestLog_GetQuestsOnMap = C_QuestLog.GetQuestsOnMap
local UnitXP, UnitXPMax = UnitXP, UnitXPMax
......@@ -25,13 +23,9 @@ local QuestLogXP = 0
function DB:ExperienceBar_CheckQuests(questID, completedOnly)
if not questID then return end
C_QuestLog_SetSelectedQuest(questID)
if C_QuestLog_ShouldShowQuestRewards(questID) then
local isCompleted = C_QuestLog_ReadyForTurnIn(questID)
if not completedOnly or isCompleted then
QuestLogXP = QuestLogXP + GetQuestLogRewardXP()
end
local isCompleted = C_QuestLog_ReadyForTurnIn(questID)
if not completedOnly or isCompleted then
QuestLogXP = QuestLogXP + GetQuestLogRewardXP(questID)
end
end
......
......@@ -5,15 +5,19 @@ local _G = _G
local unpack, select = unpack, select
local pairs, ipairs, type = pairs, ipairs, type
local EquipmentManager_GetItemInfoByLocation = EquipmentManager_GetItemInfoByLocation
local FauxScrollFrame_GetOffset = FauxScrollFrame_GetOffset
local GetFactionInfo = GetFactionInfo
local GetNumFactions = GetNumFactions
local hooksecurefunc = hooksecurefunc
local IsAddOnLoaded = IsAddOnLoaded
local ITEM_QUALITY_COLORS = ITEM_QUALITY_COLORS
local LOCATION_PLACEINBAGS = 0xFFFFFFFF
local LOCATION_IGNORESLOT = 0xFFFFFFFE
local LOCATION_UNIGNORESLOT = 0xFFFFFFFD
local FLYOUT_LOCATIONS = {
[0xFFFFFFFF] = 'PLACEINBAGS',
[0xFFFFFFFE] = 'IGNORESLOT',
[0xFFFFFFFD] = 'UNIGNORESLOT'
}
local function UpdateAzeriteItem(self)
if not self.styled then
......@@ -58,62 +62,56 @@ local function StatsPane(which)
CharacterStatsPane[which].backdrop:Size(150, 18)
end
local function SkinItemFlyouts()
local flyout = _G.EquipmentFlyoutFrame
local buttons = flyout.buttons
local buttonAnchor = flyout.buttonFrame
if not buttonAnchor.backdrop then
buttonAnchor:StripTextures()
buttonAnchor:CreateBackdrop('Transparent')
local function EquipmentUpdateItems()
local anchor = _G.EquipmentFlyoutFrame.buttonFrame
if not anchor.backdrop then
anchor:StripTextures()
anchor:CreateBackdrop('Transparent')
end
for i, button in ipairs(buttons) do
local bg = buttonAnchor['bg'..i]
if bg and bg:GetTexture() ~= nil then
bg:SetTexture()
end
local width, height = anchor:GetSize()
anchor:Size(width+3, height)
end
if not button.isHooked then
local oldTex = button.icon:GetTexture()
button:StripTextures()
button:StyleButton(false)
button:GetNormalTexture():SetTexture()
local function EquipmentDisplayButton(button)
local location, border = button.location, button.IconBorder
if not location or not border then return end
button.icon:SetInside()
button.icon:SetTexCoord(unpack(E.TexCoords))
button.icon:SetTexture(oldTex)
local id = button.id or button:GetID()
if not id then return end
if not button.backdrop then
button:SetFrameLevel(buttonAnchor:GetFrameLevel()+2)
button:CreateBackdrop()
button.backdrop:SetAllPoints()
if not button.isHooked then
local oldTex = button.icon:GetTexture()
button:StripTextures()
button:StyleButton(false)
button:GetNormalTexture():SetTexture()
S:HandleIconBorder(button.IconBorder)
button.icon:SetInside()
button.icon:SetTexCoord(unpack(E.TexCoords))
button.icon:SetTexture(oldTex)
local r, g, b, a = unpack(E.media.bordercolor)
if i == 1 then -- dont call this intially on placeInBags button
button.backdrop:SetBackdropBorderColor(r, g, b, a)
else
button.backdrop:SetBackdropBorderColor(button.IconBorder:GetVertexColor())
end
if not button.backdrop then
button:CreateBackdrop()
button.backdrop:SetAllPoints()
if i == 1 or i == 2 then
hooksecurefunc(button.icon, 'SetTexture', function(self)
local loc = self:GetParent().location
if loc == LOCATION_PLACEINBAGS or loc == LOCATION_IGNORESLOT or loc == LOCATION_UNIGNORESLOT then
self:GetParent().backdrop:SetBackdropBorderColor(r, g, b, a)
end
end)
end
end
button.isHooked = true
S:HandleIconBorder(button.IconBorder)
end
button.isHooked = true
end
local width, height = buttonAnchor:GetSize()
buttonAnchor:Size(width+3, height)
local r, g, b, a = unpack(E.media.bordercolor)
if FLYOUT_LOCATIONS[location] then -- special slots
button.backdrop:SetBackdropBorderColor(r, g, b, a)
else
local quality = select(13, EquipmentManager_GetItemInfoByLocation(location))
if not quality or quality == 0 then
button.backdrop:SetBackdropBorderColor(r, g, b, a)
else
local color = ITEM_QUALITY_COLORS[quality]
button.backdrop:SetBackdropBorderColor(color.r, color.g, color.b)
end
end
end
local function FixSidebarTabCoords()
......@@ -277,6 +275,7 @@ function S:CharacterFrame()
Slot:StripTextures()
Slot:CreateBackdrop()
Slot.backdrop:SetAllPoints()
Slot.backdrop:SetFrameLevel(Slot:GetFrameLevel())
Slot:StyleButton(Slot)
Slot.icon:SetInside()
Slot.ignoreTexture:SetTexture([[Interface\PaperDollInfoFrame\UI-GearManager-LeaveItem-Transparent]])
......@@ -377,18 +376,8 @@ function S:CharacterFrame()
S:HandleNextPrevButton(_G.EquipmentFlyoutFrame.NavigationFrame.NextButton)
--Swap item flyout frame (shown when holding alt over a slot)
hooksecurefunc('EquipmentFlyout_UpdateItems', SkinItemFlyouts)
hooksecurefunc('EquipmentFlyout_DisplayButton', function(button)
local location = button.location
local border = button.IconBorder
if not location or not border then return end
if location >= _G.EQUIPMENTFLYOUT_FIRST_SPECIAL_LOCATION then
border:Hide()
else
border:Show()
end
end)
hooksecurefunc('EquipmentFlyout_UpdateItems', EquipmentUpdateItems)
hooksecurefunc('EquipmentFlyout_DisplayButton', EquipmentDisplayButton)
--Icon in upper right corner of character frame
_G.CharacterFramePortrait:Kill()
......
......@@ -69,6 +69,7 @@ function S:Blizzard_GuildBankUI()
button:StripTextures()
button:StyleButton(true)
button:CreateBackdrop(nil, true)
button.backdrop:SetAllPoints()
texture:SetInside()
texture:SetTexCoord(unpack(E.TexCoords))
......
......@@ -123,6 +123,7 @@ function S:BlizzardMiscFrames()
if s and s.closeDialog and not s.closeDialog.template then
s.closeDialog:StripTextures()
s.closeDialog:CreateBackdrop('Transparent')
s.closeDialog.backdrop:SetFrameLevel(s.closeDialog:GetFrameLevel())
s:SetScale(_G.UIParent:GetScale())
local dialogName = s.closeDialog.GetName and s.closeDialog:GetName()
local closeButton = s.closeDialog.ConfirmButton or (dialogName and _G[dialogName..'ConfirmButton'])
......@@ -140,6 +141,7 @@ function S:BlizzardMiscFrames()
s:SetScale(_G.UIParent:GetScale())
s.CloseDialog:StripTextures()
s.CloseDialog:CreateBackdrop('Transparent')
s.CloseDialog.backdrop:SetFrameLevel(s.CloseDialog:GetFrameLevel())
S:HandleButton(s.CloseDialog.ConfirmButton)
S:HandleButton(s.CloseDialog.ResumeButton)
end
......
......@@ -84,7 +84,7 @@ local GameTooltip, GameTooltipStatusBar = _G.GameTooltip, _G.GameTooltipStatusBa
local targetList, TAPPED_COLOR, keybindFrame = {}, { r=0.6, g=0.6, b=0.6 }
local AFK_LABEL = ' |cffFFFFFF[|r|cffFF0000'..L["AFK"]..'|r|cffFFFFFF]|r'
local DND_LABEL = ' |cffFFFFFF[|r|cffFFFF00'..L["DND"]..'|r|cffFFFFFF]|r'
local genderTable = { ' '.._G.UNKNOWN, ' '.._G.MALE, ' '.._G.FEMALE }
local genderTable = { _G.UNKNOWN..' ', _G.MALE..' ', _G.FEMALE..' ' }
function TT:IsModKeyDown(db)
local k = db or TT.db.modifierID -- defaulted to 'HIDE' unless otherwise specified
......
......@@ -437,7 +437,6 @@ end]]
-------------------------------------------------------------
function UF:Construct_AdditionalPowerBar(frame)
local additionalPower = CreateFrame('StatusBar', '$parent_AdditionalPowerBar', frame)
additionalPower:SetFrameLevel(additionalPower:GetFrameLevel() + 1)
additionalPower.colorPower = true
additionalPower.frequentUpdates = true
additionalPower.PostUpdate = UF.PostUpdateAdditionalPower
......
......@@ -69,13 +69,14 @@ function UF:Configure_PowerPrediction(frame)
if altBar then
local altPower = frame.AdditionalPower
local altPowerBarTexture = altPower:GetStatusBarTexture()
local altPowerOrientation = altPower:GetOrientation()
altBar:ClearAllPoints()
altBar:SetReverseFill(true)
altBar:SetStatusBarTexture(UF.db.colors.transparentPower and E.media.blankTex or altPowerBarTexture:GetTexture())
altBar:SetOrientation((frame.db.classbar.verticalOrientation and 'VERTICAL') or 'HORIZONTAL')
if orientation == 'HORIZONTAL' then
if altPowerOrientation == 'HORIZONTAL' then
altBar:Point('TOP')
altBar:Point('BOTTOM')
altBar:Point('RIGHT', altPowerBarTexture, 'RIGHT')
......
......@@ -71,6 +71,8 @@ E.TotemBar = E:NewModule('Totems','AceEvent-3.0')
E.UnitFrames = E:NewModule('UnitFrames','AceTimer-3.0','AceEvent-3.0','AceHook-3.0')
E.WorldMap = E:NewModule('WorldMap','AceHook-3.0','AceEvent-3.0','AceTimer-3.0')
E.twoPixelsPlease = false -- changing this option is not supported! :P
-- Item Qualitiy stuff - used by MerathilisUI
E.QualityColors = {}
local qualityColors = BAG_ITEM_QUALITY_COLORS
......@@ -185,7 +187,6 @@ function E:OnInitialize()
end
end
E.twoPixelsPlease = false -- changing this option is not supported! :P
E.ScanTooltip = CreateFrame('GameTooltip', 'ElvUI_ScanTooltip', _G.UIParent, 'GameTooltipTemplate')
E.PixelMode = E.twoPixelsPlease or E.private.general.pixelPerfect -- keep this over `UIScale`
E.Border = (E.PixelMode and not E.twoPixelsPlease) and 1 or 2
......
......@@ -23,8 +23,8 @@ E.Options.args.bags = {
type = 'toggle',
name = L["Enable"],
desc = L["Enable/Disable the all-in-one bag."],
get = function(info) return E.private.bags.enable end,
set = function(info, value) E.private.bags.enable = value; E:StaticPopup_Show('PRIVATE_RL') end
get = function() return E.private.bags.enable end,
set = function(_, value) E.private.bags.enable = value; E:StaticPopup_Show('PRIVATE_RL') end
},
general = {
order = 3,
......@@ -189,8 +189,6 @@ E.Options.args.bags = {
LOW = 'LOW',
MEDIUM = 'MEDIUM',
HIGH = 'HIGH',
DIALOG = 'DIALOG',
TOOLTIP = 'TOOLTIP',
},
},
countGroup = {
......@@ -506,8 +504,8 @@ E.Options.args.bags = {
type = 'toggle',
name = L["Enable"],
desc = L["Enable/Disable the Bag-Bar."],
get = function(info) return E.private.bags.bagBar end,
set = function(info, value) E.private.bags.bagBar = value; E:StaticPopup_Show('PRIVATE_RL') end
get = function() return E.private.bags.bagBar end,
set = function(_, value) E.private.bags.bagBar = value; E:StaticPopup_Show('PRIVATE_RL') end
},
showBackdrop = {
order = 2,
......@@ -569,7 +567,7 @@ E.Options.args.bags = {
desc = L["This works like a macro, you can run different situations to get the actionbar to show/hide differently.\n Example: '[combat] show;hide'"],
width = 'full',
multiline = true,
set = function(info, value)
set = function(_, value)
if value and value:match('[\n\r]') then
value = value:gsub('[\n\r]','')
end
......@@ -609,8 +607,8 @@ E.Options.args.bags = {
order = 4,
type = 'multiselect',
name = L["Player"],
get = function(info, key) return E.db.bags.split[key] end,
set = function(info, key, value) E.db.bags.split[key] = value B:Layout() end,
get = function(_, key) return E.db.bags.split[key] end,
set = function(_, key, value) E.db.bags.split[key] = value B:Layout() end,
values = {
bag1 = L["Bag 1"],
bag2 = L["Bag 2"],
......@@ -623,8 +621,8 @@ E.Options.args.bags = {
order = 5,
type = 'multiselect',
name = L["Bank"],
get = function(info, key) return E.db.bags.split[key] end,
set = function(info, key, value) E.db.bags.split[key] = value B:Layout(true) end,
get = function(_, key) return E.db.bags.split[key] end,
set = function(_, key, value) E.db.bags.split[key] = value B:Layout(true) end,
sortByValue = true,
values = {
bag5 = L["Bank 1"],
......@@ -696,8 +694,8 @@ E.Options.args.bags = {
name = L["Profile"],
desc = L["Add an item or search syntax to the ignored list. Items matching the search syntax will be ignored."],
type = 'input',
get = function(info) return '' end,
set = function(info, value)
get = function() return '' end,
set = function(_, value)
if value == '' or gsub(value, '%s+', '') == '' then return; end --Don't allow empty entries
--Store by itemID if possible
......@@ -710,8 +708,8 @@ E.Options.args.bags = {
name = L["Global"],
desc = L["Add an item or search syntax to the ignored list. Items matching the search syntax will be ignored."],
type = 'input',
get = function(info) return '' end,
set = function(info, value)
get = function() return '' end,
set = function(_, value)
if value == '' or gsub(value, '%s+', '') == '' then return; end --Don't allow empty entries
--Store by itemID if possible
......@@ -731,8 +729,8 @@ E.Options.args.bags = {
type = 'multiselect',
name = L["Ignored Items and Search Syntax (Profile)"],
values = function() return E.db.bags.ignoredItems end,
get = function(info, value) return E.db.bags.ignoredItems[value] end,
set = function(info, value)
get = function(_, value) return E.db.bags.ignoredItems[value] end,
set = function(_, value)
E.db.bags.ignoredItems[value] = nil
GameTooltip:Hide()--Make sure tooltip is properly hidden
end,
......@@ -742,8 +740,8 @@ E.Options.args.bags = {
type = 'multiselect',
name = L["Ignored Items and Search Syntax (Global)"],
values = function() return E.global.bags.ignoredItems end,
get = function(info, value) return E.global.bags.ignoredItems[value] end,
set = function(info, value)
get = function(_, value) return E.global.bags.ignoredItems[value] end,
set = function(_, value)
E.global.bags.ignoredItems[value] = nil
GameTooltip:Hide()--Make sure tooltip is properly hidden
end,
......@@ -762,7 +760,7 @@ E.Options.args.bags = {
multiline = 26,
width = 'full',
name = '',
get = function(info) return L["SEARCH_SYNTAX_DESC"]; end,
get = function() return L["SEARCH_SYNTAX_DESC"]; end,
set = E.noop,
},
},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment