Skip to content

Commit

Permalink
13.55
Browse files Browse the repository at this point in the history
  • Loading branch information
kodewdle committed Jan 16, 2024
2 parents 19808de + e96da96 commit 15976bf
Show file tree
Hide file tree
Showing 71 changed files with 835 additions and 254 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ local tonumber, floor, strsub = tonumber, floor, strsub
local CreateFrame = CreateFrame
local IsControlKeyDown = IsControlKeyDown
local IsModifierKeyDown = IsModifierKeyDown

local ColorPickerFrame = ColorPickerFrame

local CALENDAR_COPY_EVENT, CALENDAR_PASTE_EVENT = CALENDAR_COPY_EVENT, CALENDAR_PASTE_EVENT
local CLASS, DEFAULT = CLASS, DEFAULT

Expand Down Expand Up @@ -62,7 +65,7 @@ end

local function UpdateColorTexts(r, g, b, box)
if not (r and g and b) then
r, g, b = _G.ColorPickerFrame:GetColorRGB()
r, g, b = ColorPickerFrame:GetColorRGB()

if box then
if box == _G.ColorPPBoxH then
Expand Down Expand Up @@ -93,7 +96,7 @@ end

local function UpdateColor()
local r, g, b = GetHexColor(_G.ColorPPBoxH)
_G.ColorPickerFrame:SetColorRGB(r, g, b)
ColorPickerFrame:SetColorRGB(r, g, b)
_G.ColorSwatch:SetColorTexture(r, g, b)
end

Expand Down Expand Up @@ -129,7 +132,7 @@ local function onColorSelect(frame, r, g, b)
if not frame:IsVisible() then
delayCall()
elseif not delayFunc then
delayFunc = _G.ColorPickerFrame.func
delayFunc = ColorPickerFrame.func
E:Delay(delayWait, delayCall)
end
end
Expand All @@ -144,10 +147,10 @@ local function onValueChanged(_, value)

UpdateAlphaText(alpha)

if not _G.ColorPickerFrame:IsVisible() then
if not ColorPickerFrame:IsVisible() then
delayCall()
else
local opacityFunc = _G.ColorPickerFrame.opacityFunc
local opacityFunc = ColorPickerFrame.opacityFunc
if delayFunc and (delayFunc ~= opacityFunc) then
delayFunc = opacityFunc
elseif not delayFunc then
Expand All @@ -160,22 +163,20 @@ end
function BL:EnhanceColorPicker()
if E:IsAddOnEnabled('ColorPickerPlus') then return end

local Picker = _G.ColorPickerFrame

if E.Retail then
Picker.Border:Hide()
ColorPickerFrame.Border:Hide()
end

local Header = Picker.Header or _G.ColorPickerFrameHeader
local Header = ColorPickerFrame.Header or _G.ColorPickerFrameHeader
Header:StripTextures()
Header:ClearAllPoints()
Header:Point('TOP', Picker, 0, 5)
Header:Point('TOP', ColorPickerFrame, 0, 5)

_G.ColorPickerCancelButton:ClearAllPoints()
_G.ColorPickerOkayButton:ClearAllPoints()
_G.ColorPickerCancelButton:Point('BOTTOMRIGHT', Picker, 'BOTTOMRIGHT', -6, 6)
_G.ColorPickerCancelButton:Point('BOTTOMLEFT', Picker, 'BOTTOM', 0, 6)
_G.ColorPickerOkayButton:Point('BOTTOMLEFT', Picker,'BOTTOMLEFT', 6,6)
_G.ColorPickerCancelButton:Point('BOTTOMRIGHT', ColorPickerFrame, 'BOTTOMRIGHT', -6, 6)
_G.ColorPickerCancelButton:Point('BOTTOMLEFT', ColorPickerFrame, 'BOTTOM', 0, 6)
_G.ColorPickerOkayButton:Point('BOTTOMLEFT', ColorPickerFrame,'BOTTOMLEFT', 6,6)
_G.ColorPickerOkayButton:Point('RIGHT', _G.ColorPickerCancelButton,'LEFT', -4,0)
S:HandleSliderFrame(_G.OpacitySliderFrame)
S:HandleButton(_G.ColorPickerOkayButton)
Expand All @@ -186,9 +187,9 @@ function BL:EnhanceColorPicker()
_G.OpacitySliderFrame:SetScript('OnValueChanged', onValueChanged)

-- Keep the colors updated
Picker:SetScript('OnColorSelect', onColorSelect)
ColorPickerFrame:SetScript('OnColorSelect', onColorSelect)

Picker:HookScript('OnShow', function(frame)
ColorPickerFrame:HookScript('OnShow', function(frame)
-- get color that will be replaced
local r, g, b = frame:GetColorRGB()
_G.ColorPPOldColorSwatch:SetColorTexture(r,g,b)
Expand All @@ -213,25 +214,25 @@ function BL:EnhanceColorPicker()

-- move the Color Swatch
_G.ColorSwatch:ClearAllPoints()
_G.ColorSwatch:Point('TOPLEFT', Picker, 'TOPLEFT', 215, -45)
_G.ColorSwatch:Point('TOPLEFT', ColorPickerFrame, 'TOPLEFT', 215, -45)
local swatchWidth, swatchHeight = _G.ColorSwatch:GetSize()

-- add Color Swatch for original color
local originalColor = Picker:CreateTexture('ColorPPOldColorSwatch')
local originalColor = ColorPickerFrame:CreateTexture('ColorPPOldColorSwatch')
originalColor:Size(swatchWidth*0.75, swatchHeight*0.75)
originalColor:SetColorTexture(0,0,0)
-- OldColorSwatch to appear beneath ColorSwatch
originalColor:SetDrawLayer('BORDER')
originalColor:Point('BOTTOMLEFT', 'ColorSwatch', 'TOPRIGHT', -(swatchWidth*0.5), -(swatchHeight/3))

-- add Color Swatch for the copied color
local copiedColor = Picker:CreateTexture('ColorPPCopyColorSwatch')
local copiedColor = ColorPickerFrame:CreateTexture('ColorPPCopyColorSwatch')
copiedColor:SetColorTexture(0,0,0)
copiedColor:Size(swatchWidth, swatchHeight)
copiedColor:Hide()

-- add copy button to the ColorPickerFrame
local copyButton = CreateFrame('Button', 'ColorPPCopy', Picker, 'UIPanelButtonTemplate')
local copyButton = CreateFrame('Button', 'ColorPPCopy', ColorPickerFrame, 'UIPanelButtonTemplate')
copyButton:SetText(CALENDAR_COPY_EVENT)
copyButton:Size(60, 22)
copyButton:Point('TOPLEFT', 'ColorSwatch', 'BOTTOMLEFT', 0, -5)
Expand All @@ -240,34 +241,34 @@ function BL:EnhanceColorPicker()
-- copy color into buffer on button click
copyButton:SetScript('OnClick', function()
-- copy current dialog colors into buffer
colorBuffer.r, colorBuffer.g, colorBuffer.b = Picker:GetColorRGB()
colorBuffer.r, colorBuffer.g, colorBuffer.b = ColorPickerFrame:GetColorRGB()

-- enable Paste button and display copied color into swatch
_G.ColorPPPaste:Enable()
_G.ColorPPCopyColorSwatch:SetColorTexture(colorBuffer.r, colorBuffer.g, colorBuffer.b)
_G.ColorPPCopyColorSwatch:Show()

colorBuffer.a = (Picker.hasOpacity and _G.OpacitySliderFrame:GetValue()) or nil
colorBuffer.a = (ColorPickerFrame.hasOpacity and _G.OpacitySliderFrame:GetValue()) or nil
end)

-- class color button
local classButton = CreateFrame('Button', 'ColorPPClass', Picker, 'UIPanelButtonTemplate')
local classButton = CreateFrame('Button', 'ColorPPClass', ColorPickerFrame, 'UIPanelButtonTemplate')
classButton:SetText(CLASS)
classButton:Size(80, 22)
classButton:Point('TOP', 'ColorPPCopy', 'BOTTOMRIGHT', 0, -7)
S:HandleButton(classButton)

classButton:SetScript('OnClick', function()
local color = E:ClassColor(E.myclass, true)
Picker:SetColorRGB(color.r, color.g, color.b)
ColorPickerFrame:SetColorRGB(color.r, color.g, color.b)
_G.ColorSwatch:SetColorTexture(color.r, color.g, color.b)
if Picker.hasOpacity then
if ColorPickerFrame.hasOpacity then
_G.OpacitySliderFrame:SetValue(0)
end
end)

-- add paste button to the ColorPickerFrame
local pasteButton = CreateFrame('Button', 'ColorPPPaste', Picker, 'UIPanelButtonTemplate')
local pasteButton = CreateFrame('Button', 'ColorPPPaste', ColorPickerFrame, 'UIPanelButtonTemplate')
pasteButton:SetText(CALENDAR_PASTE_EVENT)
pasteButton:Size(60, 22)
pasteButton:Point('TOPLEFT', 'ColorPPCopy', 'TOPRIGHT', 2, 0)
Expand All @@ -276,17 +277,17 @@ function BL:EnhanceColorPicker()

-- paste color on button click, updating frame components
pasteButton:SetScript('OnClick', function()
Picker:SetColorRGB(colorBuffer.r, colorBuffer.g, colorBuffer.b)
ColorPickerFrame:SetColorRGB(colorBuffer.r, colorBuffer.g, colorBuffer.b)
_G.ColorSwatch:SetColorTexture(colorBuffer.r, colorBuffer.g, colorBuffer.b)
if Picker.hasOpacity then
if ColorPickerFrame.hasOpacity then
if colorBuffer.a then --color copied had an alpha value
_G.OpacitySliderFrame:SetValue(colorBuffer.a)
end
end
end)

-- add defaults button to the ColorPickerFrame
local defaultButton = CreateFrame('Button', 'ColorPPDefault', Picker, 'UIPanelButtonTemplate')
local defaultButton = CreateFrame('Button', 'ColorPPDefault', ColorPickerFrame, 'UIPanelButtonTemplate')
defaultButton:SetText(DEFAULT)
defaultButton:Size(80, 22)
defaultButton:Point('TOPLEFT', 'ColorPPClass', 'BOTTOMLEFT', 0, -7)
Expand All @@ -298,9 +299,9 @@ function BL:EnhanceColorPicker()
-- paste color on button click, updating frame components
defaultButton:SetScript('OnClick', function(btn)
local colors = btn.colors
Picker:SetColorRGB(colors.r, colors.g, colors.b)
ColorPickerFrame:SetColorRGB(colors.r, colors.g, colors.b)
_G.ColorSwatch:SetColorTexture(colors.r, colors.g, colors.b)
if Picker.hasOpacity then
if ColorPickerFrame.hasOpacity then
if colors.a then
_G.OpacitySliderFrame:SetValue(colors.a)
end
Expand All @@ -317,7 +318,7 @@ function BL:EnhanceColorPicker()

-- set up edit box frames and interior label and text areas
for i, rgb in next, { 'R', 'G', 'B', 'H', 'A' } do
local box = CreateFrame('EditBox', 'ColorPPBox'..rgb, Picker, 'InputBoxTemplate')
local box = CreateFrame('EditBox', 'ColorPPBox'..rgb, ColorPickerFrame, 'InputBoxTemplate')
box:Point('TOP', 'ColorPickerWheel', 'BOTTOM', 0, -15)
box:SetFrameStrata('DIALOG')
box:SetAutoFocus(false)
Expand Down Expand Up @@ -390,20 +391,20 @@ function BL:EnhanceColorPicker()
_G.ColorPPBoxB:SetScript('OnTabPressed', function() _G.ColorPPBoxH:SetFocus() end)
_G.ColorPPBoxA:SetScript('OnTabPressed', function() _G.ColorPPBoxR:SetFocus() end)

-- make the color picker movable.
local mover = CreateFrame('Frame', nil, Picker)
mover:Point('TOPLEFT', Picker, 'TOP', -60, 0)
mover:Point('BOTTOMRIGHT', Picker, 'TOP', 60, -15)
mover:SetScript('OnMouseDown', function() Picker:StartMoving() end)
mover:SetScript('OnMouseUp', function() Picker:StopMovingOrSizing() end)
-- make the color ColorPickerFrame movable.
local mover = CreateFrame('Frame', nil, ColorPickerFrame)
mover:Point('TOPLEFT', ColorPickerFrame, 'TOP', -60, 0)
mover:Point('BOTTOMRIGHT', ColorPickerFrame, 'TOP', 60, -15)
mover:SetScript('OnMouseDown', function() ColorPickerFrame:StartMoving() end)
mover:SetScript('OnMouseUp', function() ColorPickerFrame:StopMovingOrSizing() end)
mover:EnableMouse(true)

-- make the frame a bit taller, to make room for edit boxes
Picker:Height(Picker:GetHeight() + 40)
ColorPickerFrame:Height(ColorPickerFrame:GetHeight() + 40)

-- skin the frame
Picker:SetTemplate('Transparent')
Picker:SetClampedToScreen(true)
Picker:SetUserPlaced(true)
Picker:EnableKeyboard(false)
ColorPickerFrame:SetTemplate('Transparent')
ColorPickerFrame:SetClampedToScreen(true)
ColorPickerFrame:SetUserPlaced(true)
ColorPickerFrame:EnableKeyboard(false)
end
1 change: 1 addition & 0 deletions ElvUI/Classic/Modules/Blizzard/Load_Blizzard.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<Ui xmlns='http://www.blizzard.com/wow/ui/'>
<Script file='ColorPicker.lua'/>
<Script file='..\..\..\Core\Modules\Blizzard\QuestWatch.lua'/>
</Ui>
5 changes: 5 additions & 0 deletions ElvUI/Classic/Modules/Skins/Misc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ function S:BlizzardMiscFrames()
_G.ReadyCheckFrameText:ClearAllPoints()
_G.ReadyCheckFrameText:Point('TOP', 0, -15)

_G.PVPReadyDialog:StripTextures()
_G.PVPReadyDialog:SetTemplate('Transparent')
S:HandleButton(_G.PVPReadyDialogEnterBattleButton)
S:HandleButton(_G.PVPReadyDialogHideButton)

_G.ReadyCheckListenerFrame:SetAlpha(0)
ReadyCheckFrame:HookScript('OnShow', FixReadyCheckFrame)

Expand Down
19 changes: 15 additions & 4 deletions ElvUI/Core/General/API.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ local IsXPUserDisabled = IsXPUserDisabled
local RequestBattlefieldScoreData = RequestBattlefieldScoreData
local UIParent = UIParent
local UIParentLoadAddOn = UIParentLoadAddOn
local UnitAura = UnitAura
local UnitFactionGroup = UnitFactionGroup
local UnitGroupRolesAssigned = UnitGroupRolesAssigned
local UnitHasVehicleUI = UnitHasVehicleUI
Expand All @@ -41,6 +40,10 @@ local UnitIsMercenary = UnitIsMercenary
local UnitIsPlayer = UnitIsPlayer
local UnitIsUnit = UnitIsUnit

local GetAuraDataByIndex = C_UnitAuras and C_UnitAuras.GetAuraDataByIndex
local UnpackAuraData = AuraUtil and AuraUtil.UnpackAuraData
local UnitAura = UnitAura

local GetSpecialization = (E.Classic or E.Wrath) and LCS.GetSpecialization or GetSpecialization
local GetSpecializationInfo = (E.Classic or E.Wrath) and LCS.GetSpecializationInfo or GetSpecializationInfo

Expand Down Expand Up @@ -275,6 +278,14 @@ do
end

do
function E:GetAuraData(unitToken, index, filter)
if E.Retail then
return UnpackAuraData(GetAuraDataByIndex(unitToken, index, filter))
else
return UnitAura(unitToken, index, filter)
end
end

local function FindAura(key, value, unit, index, filter, ...)
local name, _, _, _, _, _, _, _, _, spellID = ...

Expand All @@ -286,16 +297,16 @@ do
return ...
else
index = index + 1
return FindAura(key, value, unit, index, filter, UnitAura(unit, index, filter))
return FindAura(key, value, unit, index, filter, E:GetAuraData(unit, index, filter))
end
end

function E:GetAuraByID(unit, spellID, filter)
return FindAura('spellID', spellID, unit, 1, filter, UnitAura(unit, 1, filter))
return FindAura('spellID', spellID, unit, 1, filter, E:GetAuraData(unit, 1, filter))
end

function E:GetAuraByName(unit, name, filter)
return FindAura('name', name, unit, 1, filter, UnitAura(unit, 1, filter))
return FindAura('name', name, unit, 1, filter, E:GetAuraData(unit, 1, filter))
end
end

Expand Down
15 changes: 13 additions & 2 deletions ElvUI/Core/General/Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,22 @@ function E:GrabColorPickerValues(r, g, b)
local oldR, oldG, oldB = _G.ColorPickerFrame:GetColorRGB()

-- set and define the new values
_G.ColorPickerFrame:SetColorRGB(r or 1, g or 1, b or 1)
if E.Retail then
_G.ColorPickerFrame.Content.ColorPicker:SetColorRGB(r or 1, g or 1, b or 1)
else
_G.ColorPickerFrame:SetColorRGB(r or 1, g or 1, b or 1)
end

r, g, b = _G.ColorPickerFrame:GetColorRGB()

-- swap back to the old values
if oldR then _G.ColorPickerFrame:SetColorRGB(oldR, oldG, oldB) end
if oldR then
if E.Retail then
_G.ColorPickerFrame.Content.ColorPicker:SetColorRGB(oldR, oldG, oldB)
else
_G.ColorPickerFrame:SetColorRGB(oldR, oldG, oldB)
end
end

-- free it up..
_G.ColorPickerFrame.noColorCallback = nil
Expand Down
1 change: 1 addition & 0 deletions ElvUI/Core/General/Fonts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ function E:UpdateBlizzardFonts()
E:SetFont(_G.QuestFont_Larger, NORMAL, (blizz and 16) or unscale or big) -- Wrath
E:SetFont(_G.SystemFont_Large, NORMAL, (blizz and 16) or unscale or big)
E:SetFont(_G.SystemFont_Shadow_Large, NORMAL, (blizz and 16) or unscale or big, 'SHADOW')
E:SetFont(_G.SystemFont16_Shadow_ThickOutline, NORMAL, (blizz and 16) or unscale or big, outline) -- Talent & Profession SpendText
E:SetFont(_G.Game18Font, NORMAL, (blizz and 18) or unscale or big) -- MissionUI Bonus Chance
E:SetFont(_G.GameFontNormalLarge2, NORMAL, (blizz and 18) or unscale or big, 'SHADOW') -- Garrison Follower Names
E:SetFont(_G.QuestFont_Huge, NORMAL, (blizz and 18) or unscale or big) -- Quest rewards title, Rewards
Expand Down
7 changes: 4 additions & 3 deletions ElvUI/Core/General/Tags.lua
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ local UnitPVPRank = UnitPVPRank
local UnitReaction = UnitReaction
local UnitSex = UnitSex
local UnitStagger = UnitStagger
local UnitInPartyIsAI = UnitInPartyIsAI

local GetUnitPowerBarTextureInfo = GetUnitPowerBarTextureInfo
local C_PetJournal_GetPetTeamAverageLevel = C_PetJournal and C_PetJournal.GetPetTeamAverageLevel
Expand Down Expand Up @@ -556,7 +557,7 @@ E:AddTag('selectioncolor', 'UNIT_NAME_UPDATE UNIT_FACTION INSTANCE_ENCOUNTER_ENG
end)

E:AddTag('classcolor', 'UNIT_NAME_UPDATE UNIT_FACTION INSTANCE_ENCOUNTER_ENGAGE_UNIT', function(unit)
if UnitIsPlayer(unit) then
if UnitIsPlayer(unit) or (E.Retail and UnitInPartyIsAI(unit)) then
local _, unitClass = UnitClass(unit)
local cs = ElvUF.colors.class[unitClass]
return (cs and Hex(cs.r, cs.g, cs.b)) or '|cFFcccccc'
Expand Down Expand Up @@ -787,7 +788,7 @@ E:AddTag('arena:number', 'UNIT_NAME_UPDATE', function(unit)
end)

E:AddTag('class', 'UNIT_NAME_UPDATE', function(unit)
if not UnitIsPlayer(unit) then return end
if not (UnitIsPlayer(unit) or (E.Retail and UnitInPartyIsAI(unit))) then return end

local _, classToken = UnitClass(unit)
if UnitSex(unit) == 3 then
Expand Down Expand Up @@ -1237,7 +1238,7 @@ do
}

E:AddTag('class:icon', 'PLAYER_TARGET_CHANGED', function(unit)
if not UnitIsPlayer(unit) then return end
if not (UnitIsPlayer(unit) or (E.Retail and UnitInPartyIsAI(unit))) then return end

local _, class = UnitClass(unit)
local icon = classIcons[class]
Expand Down
4 changes: 2 additions & 2 deletions ElvUI/Core/General/Toolkit.lua
Original file line number Diff line number Diff line change
Expand Up @@ -535,14 +535,14 @@ local function addapi(object)
if mk.SetTexCoord then hooksecurefunc(mk, 'SetTexCoord', DisablePixelSnap) end
if mk.SetTexture then hooksecurefunc(mk, 'SetTexture', DisablePixelSnap) end

if E.Wrath and mk.SetStatusBarTexture then
if not E.Classic and mk.SetStatusBarTexture then
hooksecurefunc(mk, 'SetStatusBarTexture', DisablePixelSnap)
end

mk.DisabledPixelSnap = true
end

if not E.Wrath and not object.fixTheStatusBarsPlease and mk.SetStatusBarTexture then
if E.Classic and not object.fixTheStatusBarsPlease and mk.SetStatusBarTexture then
hooksecurefunc(mk, 'SetValue', FixMinCurDuringValue)
hooksecurefunc(mk, 'SetStatusBarTexture', FixMinCurDuringTexture)

Expand Down
Loading

0 comments on commit 15976bf

Please sign in to comment.