This commit is contained in:
Andrew6810
2022-10-21 07:09:01 -07:00
parent cbdabfbcca
commit 60ef8a38af
614 changed files with 138573 additions and 2 deletions
+138
View File
@@ -0,0 +1,138 @@
local E, L = unpack(select(2, ...)); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local B = E:GetModule("Blizzard")
local Misc = E:GetModule("Misc")
--Lua functions
local _G = _G
local pairs = pairs
--WoW API / Variables
local NUM_GROUP_LOOT_FRAMES = NUM_GROUP_LOOT_FRAMES
local POSITION, ANCHOR_POINT, YOFFSET = "TOP", "BOTTOM", -10
function E:PostAlertMove()
local _, y = AlertFrameMover:GetCenter()
local screenHeight = E.UIParent:GetTop()
if y > (screenHeight / 2) then
POSITION = "TOP"
ANCHOR_POINT = "BOTTOM"
YOFFSET = -10
AlertFrameMover:SetText(AlertFrameMover.textString.." [Grow Down]")
else
POSITION = "BOTTOM"
ANCHOR_POINT = "TOP"
YOFFSET = 10
AlertFrameMover:SetText(AlertFrameMover.textString.." [Grow Up]")
end
if E.private.general.lootRoll then
local lastframe, lastShownFrame
for i, frame in pairs(Misc.RollBars) do
frame:ClearAllPoints()
if i ~= 1 then
if POSITION == "TOP" then
frame:Point("TOP", lastframe, "BOTTOM", 0, -4)
else
frame:Point("BOTTOM", lastframe, "TOP", 0, 4)
end
else
if POSITION == "TOP" then
frame:Point("TOP", AlertFrameHolder, "BOTTOM", 0, -4)
else
frame:Point("BOTTOM", AlertFrameHolder, "TOP", 0, 4)
end
end
lastframe = frame
if frame:IsShown() then
lastShownFrame = frame
end
end
AlertFrame:ClearAllPoints()
if lastShownFrame then
AlertFrame:SetAllPoints(lastShownFrame)
else
AlertFrame:SetAllPoints(AlertFrameHolder)
end
elseif E.private.skins.blizzard.enable and E.private.skins.blizzard.lootRoll then
local lastframe, lastShownFrame
for i = 1, NUM_GROUP_LOOT_FRAMES do
local frame = _G["GroupLootFrame"..i]
if frame then
frame:ClearAllPoints()
if i ~= 1 then
if POSITION == "TOP" then
frame:Point("TOP", lastframe, "BOTTOM", 0, -4)
else
frame:Point("BOTTOM", lastframe, "TOP", 0, 4)
end
else
if POSITION == "TOP" then
frame:Point("TOP", AlertFrameHolder, "BOTTOM", 0, -4)
else
frame:Point("BOTTOM", AlertFrameHolder, "TOP", 0, 4)
end
end
lastframe = frame
if frame:IsShown() then
lastShownFrame = frame
end
end
end
AlertFrame:ClearAllPoints()
if lastShownFrame then
AlertFrame:SetAllPoints(lastShownFrame)
else
AlertFrame:SetAllPoints(AlertFrameHolder)
end
else
AlertFrame:ClearAllPoints()
AlertFrame:SetAllPoints(AlertFrameHolder)
end
end
function B:AchievementAlertFrame_FixAnchors()
local alertAnchor
for i = 1, MAX_ACHIEVEMENT_ALERTS do
local frame = _G["AchievementAlertFrame"..i]
if frame then
frame:ClearAllPoints()
if alertAnchor and alertAnchor:IsShown() then
frame:Point(POSITION, alertAnchor, ANCHOR_POINT, 0, YOFFSET)
else
frame:Point(POSITION, AlertFrame, ANCHOR_POINT)
end
alertAnchor = frame
end
end
end
function B:DungeonCompletionAlertFrame_FixAnchors()
for i = MAX_ACHIEVEMENT_ALERTS, 1, -1 do
local frame = _G["AchievementAlertFrame"..i]
if frame and frame:IsShown() then
DungeonCompletionAlertFrame1:ClearAllPoints()
DungeonCompletionAlertFrame1:Point(POSITION, frame, ANCHOR_POINT, 0, YOFFSET)
return
end
DungeonCompletionAlertFrame1:ClearAllPoints()
DungeonCompletionAlertFrame1:Point(POSITION, AlertFrame, ANCHOR_POINT)
end
end
function B:AlertMovers()
local AlertFrameHolder = CreateFrame("Frame", "AlertFrameHolder", E.UIParent)
AlertFrameHolder:Size(250, 20)
AlertFrameHolder:Point("TOP", E.UIParent, "TOP", 0, -18)
self:SecureHook("AlertFrame_FixAnchors", E.PostAlertMove)
self:SecureHook("AchievementAlertFrame_FixAnchors")
self:SecureHook("DungeonCompletionAlertFrame_FixAnchors")
E:CreateMover(AlertFrameHolder, "AlertFrameMover", L["Loot / Alert Frames"], nil, nil, E.PostAlertMove, nil, nil, "general,blizzUIImprovements")
end
+109
View File
@@ -0,0 +1,109 @@
local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local B = E:GetModule("Blizzard")
--Lua functions
--WoW API / Variables
local ChatEdit_ChooseBoxForSend = ChatEdit_ChooseBoxForSend
local GetTradeSkillListLink = GetTradeSkillListLink
local Minimap_SetPing = Minimap_SetPing
local UnitIsUnit = UnitIsUnit
local MINIMAPPING_FADE_TIMER = MINIMAPPING_FADE_TIMER
function B:ADDON_LOADED(_, addon)
if addon == "Blizzard_TradeSkillUI" then
TradeSkillLinkButton:SetScript("OnClick", function()
local ChatFrameEditBox = ChatEdit_ChooseBoxForSend()
if not ChatFrameEditBox:IsShown() then
ChatEdit_ActivateChat(ChatFrameEditBox)
end
ChatFrameEditBox:Insert(GetTradeSkillListLink())
end)
self:UnregisterEvent("ADDON_LOADED")
end
end
function B:Initialize()
self.Initialized = true
self:AlertMovers()
self:EnhanceColorPicker()
self:KillBlizzard()
self:PositionCaptureBar()
self:PositionDurabilityFrame()
self:PositionGMFrames()
self:PositionVehicleFrame()
self:MoveWatchFrame()
self:RegisterEvent("ADDON_LOADED")
self:RegisterEvent("ZONE_CHANGED_NEW_AREA", SetMapToCurrentZone)
KBArticle_BeginLoading = E.noop
KBSetup_BeginLoading = E.noop
KnowledgeBaseFrame_OnEvent(nil, "KNOWLEDGE_BASE_SETUP_LOAD_FAILURE")
if GetLocale() == "deDE" then
DAY_ONELETTER_ABBR = "%d d"
MINUTE_ONELETTER_ABBR = "%d m"
end
CreateFrame("Frame"):SetScript("OnUpdate", function()
if LFRBrowseFrame.timeToClear then
LFRBrowseFrame.timeToClear = nil
end
end)
MinimapPing:HookScript("OnUpdate", function(self)
if self.fadeOut or self.timer > MINIMAPPING_FADE_TIMER then
Minimap_SetPing(Minimap:GetPingPosition())
end
end)
QuestLogFrame:HookScript("OnShow", function()
local questFrame = QuestLogFrame:GetFrameLevel()
local controlPanel = QuestLogControlPanel:GetFrameLevel()
local scrollFrame = QuestLogDetailScrollFrame:GetFrameLevel()
if questFrame >= controlPanel then
QuestLogControlPanel:SetFrameLevel(questFrame + 1)
end
if questFrame >= scrollFrame then
QuestLogDetailScrollFrame:SetFrameLevel(questFrame + 1)
end
end)
ReadyCheckFrame:HookScript("OnShow", function(self)
if UnitIsUnit("player", self.initiator) then
self:Hide()
end
end)
-- WORLDMAP_POI_FRAMELEVEL = 300
-- WorldMapFrame:SetToplevel(true)
do
local originalFunc = LFDQueueFrameRandomCooldownFrame_OnEvent
local originalScript = LFDQueueFrameCooldownFrame:GetScript("OnEvent")
LFDQueueFrameRandomCooldownFrame_OnEvent = function(self, event, unit, ...)
if event == "UNIT_AURA" and not unit then return end
originalFunc(self, event, unit, ...)
end
if originalFunc == originalScript then
LFDQueueFrameCooldownFrame:SetScript("OnEvent", LFDQueueFrameRandomCooldownFrame_OnEvent)
else
LFDQueueFrameCooldownFrame:SetScript("OnEvent", function(self, event, unit, ...)
if event == "UNIT_AURA" and not unit then return end
originalScript(self, event, unit, ...)
end)
end
end
end
local function InitializeCallback()
B:Initialize()
end
E:RegisterModule(B:GetName(), InitializeCallback)
+63
View File
@@ -0,0 +1,63 @@
local E, L = unpack(select(2, ...)); --Import: Engine, Locales
local B = E:GetModule("Blizzard")
--Lua functions
local _G = _G
--WoW API / Variables
local numAlwaysUpFrames = 0
local pvpHolder = CreateFrame("Frame", "ElvUI_PvPHolder", E.UIParent)
local function styleAlwaysUpFrame(id)
local frame = _G["AlwaysUpFrame"..id]
local text = _G["AlwaysUpFrame"..id.."Text"]
local icon = _G["AlwaysUpFrame"..id.."Icon"]
local dynamic = _G["AlwaysUpFrame"..id.."DynamicIconButton"]
text:ClearAllPoints()
text:Point("CENTER", frame, "CENTER", 0, 0)
icon:ClearAllPoints()
icon:Point("CENTER", text, "LEFT", -10, -9)
dynamic:ClearAllPoints()
dynamic:Point("LEFT", text, "RIGHT", 5, 0)
if id == 1 then
frame:ClearAllPoints()
frame:Point("CENTER", pvpHolder, "CENTER", 0, 5)
frame.SetPoint = E.noop
end
end
local function repositionCaptureBar(id)
local bar = _G["WorldStateCaptureBar"..id]
bar:ClearAllPoints()
bar:Point("TOP", pvpHolder, "BOTTOM", 0, -75)
bar.SetPoint = E.noop
end
function B:WorldStateAlwaysUpFrame_Update()
if numAlwaysUpFrames < NUM_ALWAYS_UP_UI_FRAMES then
for id = numAlwaysUpFrames + 1, NUM_ALWAYS_UP_UI_FRAMES do
styleAlwaysUpFrame(id)
numAlwaysUpFrames = id
end
end
end
function B:PositionCaptureBar()
pvpHolder:Size(30, 70)
pvpHolder:Point("TOP", E.UIParent, "TOP", 0, -4)
hooksecurefunc("WorldStateAlwaysUpFrame_Update", B.WorldStateAlwaysUpFrame_Update)
hooksecurefunc(ExtendedUI["CAPTUREPOINT"], "create", repositionCaptureBar)
if NUM_EXTENDED_UI_FRAMES > 0 then
for id = 1, NUM_EXTENDED_UI_FRAMES do
repositionCaptureBar(id)
end
end
E:CreateMover(pvpHolder, "PvPMover", L["PvP"], nil, nil, nil, "ALL")
end
+388
View File
@@ -0,0 +1,388 @@
--[[
Credit to Jaslm, most of this code is his from the addon ColorPickerPlus
]]
local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local B = E:GetModule("Blizzard")
local S = E:GetModule("Skins")
--Lua functions
local strlen, strjoin, gsub = strlen, strjoin, gsub
local tonumber, floor, strsub, wipe = tonumber, floor, strsub, wipe
--WoW API / Variables
local CreateFrame = CreateFrame
local IsAddOnLoaded = IsAddOnLoaded
local CALENDAR_COPY_EVENT, CALENDAR_PASTE_EVENT = CALENDAR_COPY_EVENT, CALENDAR_PASTE_EVENT
local CLASS, DEFAULT = CLASS, DEFAULT
local colorBuffer = {}
local function alphaValue(num)
return num and floor(((1 - num) * 100) + .05) or 0
end
local function UpdateAlphaText(alpha)
if not alpha then alpha = alphaValue(OpacitySliderFrame:GetValue()) end
ColorPPBoxA:SetText(alpha)
end
local function UpdateAlpha(tbox)
local num = tbox:GetNumber()
if num > 100 then
tbox:SetText(100)
num = 100
end
OpacitySliderFrame:SetValue(1 - (num / 100))
end
local function expandFromThree(r, g, b)
return strjoin("",r,r,g,g,b,b)
end
local function extendToSix(str)
for _=1, 6-strlen(str) do str=str..0 end
return str
end
local function GetHexColor(box)
local rgb, rgbSize = box:GetText(), box:GetNumLetters()
if rgbSize == 3 then
rgb = gsub(rgb, "(%x)(%x)(%x)$", expandFromThree)
elseif rgbSize < 6 then
rgb = gsub(rgb, "(.+)$", extendToSix)
end
local r, g, b = tonumber(strsub(rgb,0,2),16) or 0, tonumber(strsub(rgb,3,4),16) or 0, tonumber(strsub(rgb,5,6),16) or 0
return r/255, g/255, b/255
end
local function UpdateColorTexts(r, g, b, box)
if not (r and g and b) then
r, g, b = ColorPickerFrame:GetColorRGB()
if box then
if box == ColorPPBoxH then
r, g, b = GetHexColor(box)
else
local num = box:GetNumber()
if num > 255 then num = 255 end
local c = num/255
if box == ColorPPBoxR then
r = c
elseif box == ColorPPBoxG then
g = c
elseif box == ColorPPBoxB then
b = c
end
end
end
end
-- we want those /255 values
r, g, b = r*255, g*255, b*255
ColorPPBoxH:SetText(string.format("%.2x%.2x%.2x", r, g, b))
ColorPPBoxR:SetText(r)
ColorPPBoxG:SetText(g)
ColorPPBoxB:SetText(b)
end
local function UpdateColor(box)
if box:GetID() == 4 and box:GetNumLetters() ~= 6 then return else UpdateColorTexts(nil, nil, nil, box) end
local r, g, b = GetHexColor(ColorPPBoxH)
ColorPickerFrame:SetColorRGB(r, g, b)
ColorSwatch:SetTexture(r, g, b)
end
local function ColorPPBoxA_SetFocus()
ColorPPBoxA:SetFocus()
end
local function ColorPPBoxR_SetFocus()
ColorPPBoxR:SetFocus()
end
local delayWait, delayFunc = 0.15
local function delayCall()
if delayFunc then
delayFunc()
delayFunc = nil
end
end
local function onColorSelect(frame, r, g, b)
if frame.noColorCallback then return end
ColorSwatch:SetTexture(r, g, b)
UpdateColorTexts(r, g, b)
if not frame:IsVisible() then
delayCall()
elseif not delayFunc then
delayFunc = ColorPickerFrame.func
E:Delay(delayWait, delayCall)
end
end
local function onValueChanged(frame, value)
local alpha = alphaValue(value)
if frame.lastAlpha ~= alpha then
frame.lastAlpha = alpha
UpdateAlphaText(alpha)
if not ColorPickerFrame:IsVisible() then
delayCall()
else
local opacityFunc = ColorPickerFrame.opacityFunc
if delayFunc and (delayFunc ~= opacityFunc) then
delayFunc = opacityFunc
elseif not delayFunc then
delayFunc = opacityFunc
E:Delay(delayWait, delayCall)
end
end
end
end
function B:EnhanceColorPicker()
if IsAddOnLoaded("ColorPickerPlus") then return end
--Skin the default frame, move default buttons into place
ColorPickerFrame:SetClampedToScreen(true)
ColorPickerFrame:SetTemplate("Transparent")
ColorPickerFrameHeader:SetTexture()
ColorPickerFrameHeader:ClearAllPoints()
ColorPickerFrameHeader:Point("TOP", ColorPickerFrame, 0, 0)
ColorPickerCancelButton:ClearAllPoints()
ColorPickerOkayButton:ClearAllPoints()
ColorPickerCancelButton:Point("BOTTOMRIGHT", ColorPickerFrame, "BOTTOMRIGHT", -6, 6)
ColorPickerCancelButton:Point("BOTTOMLEFT", ColorPickerFrame, "BOTTOM", 0, 6)
ColorPickerOkayButton:Point("BOTTOMLEFT", ColorPickerFrame,"BOTTOMLEFT", 6,6)
ColorPickerOkayButton:Point("RIGHT", ColorPickerCancelButton,"LEFT", -4,0)
S:HandleSliderFrame(OpacitySliderFrame)
S:HandleButton(ColorPickerOkayButton)
S:HandleButton(ColorPickerCancelButton)
ColorPickerFrame:HookScript("OnShow", function(frame)
-- get color that will be replaced
local r, g, b = frame:GetColorRGB()
ColorPPOldColorSwatch:SetTexture(r,g,b)
-- show/hide the alpha box
if frame.hasOpacity then
ColorPPBoxA:Show()
ColorPPBoxLabelA:Show()
ColorPPBoxH:SetScript("OnTabPressed", ColorPPBoxA_SetFocus)
UpdateAlphaText()
UpdateColorTexts()
frame:Width(405)
else
ColorPPBoxA:Hide()
ColorPPBoxLabelA:Hide()
ColorPPBoxH:SetScript("OnTabPressed", ColorPPBoxR_SetFocus)
UpdateColorTexts()
frame:Width(345)
end
-- Memory Fix, Colorpicker will call the self.func() 100x per second, causing fps/memory issues,
-- We overwrite these two scripts and set a limit on how often we allow a call their update functions
OpacitySliderFrame:SetScript("OnValueChanged", onValueChanged)
frame:SetScript("OnColorSelect", onColorSelect)
end)
-- make the Color Picker dialog a bit taller, to make room for edit boxes
ColorPickerFrame:Height(ColorPickerFrame:GetHeight() + 40)
-- move the Color Swatch
ColorSwatch:ClearAllPoints()
ColorSwatch:Point("TOPLEFT", ColorPickerFrame, "TOPLEFT", 215, -45)
-- add Color Swatch for original color
local t = ColorPickerFrame:CreateTexture("ColorPPOldColorSwatch")
local w, h = ColorSwatch:GetSize()
t:Size(w*0.75,h*0.75)
t:SetTexture(0,0,0)
-- OldColorSwatch to appear beneath ColorSwatch
t:SetDrawLayer("BORDER")
t:Point("BOTTOMLEFT", ColorSwatch, "TOPRIGHT", -(w/2), -(h/3))
-- add Color Swatch for the copied color
t = ColorPickerFrame:CreateTexture("ColorPPCopyColorSwatch")
t:SetTexture(0,0,0)
t:Size(w,h)
t:Hide()
-- add copy button to the ColorPickerFrame
local b = CreateFrame("Button", "ColorPPCopy", ColorPickerFrame, "UIPanelButtonTemplate")
S:HandleButton(b)
b:SetText(CALENDAR_COPY_EVENT)
b:Width(60)
b:Height(22)
b:Point("TOPLEFT", ColorSwatch, "BOTTOMLEFT", 0, -5)
-- copy color into buffer on button click
b:SetScript("OnClick", function()
-- copy current dialog colors into buffer
colorBuffer.r, colorBuffer.g, colorBuffer.b = ColorPickerFrame:GetColorRGB()
-- enable Paste button and display copied color into swatch
ColorPPPaste:Enable()
ColorPPCopyColorSwatch:SetTexture(colorBuffer.r, colorBuffer.g, colorBuffer.b)
ColorPPCopyColorSwatch:Show()
colorBuffer.a = (ColorPickerFrame.hasOpacity and OpacitySliderFrame:GetValue()) or nil
end)
--class color button
b = CreateFrame("Button", "ColorPPClass", ColorPickerFrame, "UIPanelButtonTemplate")
b:SetText(CLASS)
S:HandleButton(b)
b:Width(80)
b:Height(22)
b:Point("TOP", ColorPPCopy, "BOTTOMRIGHT", 0, -7)
b:SetScript("OnClick", function()
local color = E.media.herocolor
ColorPickerFrame:SetColorRGB(color.r, color.g, color.b)
ColorSwatch:SetTexture(color.r, color.g, color.b)
if ColorPickerFrame.hasOpacity then
OpacitySliderFrame:SetValue(0)
end
end)
-- add paste button to the ColorPickerFrame
b = CreateFrame("Button", "ColorPPPaste", ColorPickerFrame, "UIPanelButtonTemplate")
b:SetText(CALENDAR_PASTE_EVENT)
S:HandleButton(b)
b:Width(60)
b:Height(22)
b:Point("TOPLEFT", ColorPPCopy, "TOPRIGHT", 2, 0)
b:Disable() -- enable when something has been copied
-- paste color on button click, updating frame components
b:SetScript("OnClick", function()
ColorPickerFrame:SetColorRGB(colorBuffer.r, colorBuffer.g, colorBuffer.b)
ColorSwatch:SetTexture(colorBuffer.r, colorBuffer.g, colorBuffer.b)
if ColorPickerFrame.hasOpacity then
if colorBuffer.a then --color copied had an alpha value
OpacitySliderFrame:SetValue(colorBuffer.a)
end
end
end)
-- add defaults button to the ColorPickerFrame
b = CreateFrame("Button", "ColorPPDefault", ColorPickerFrame, "UIPanelButtonTemplate")
b:SetText(DEFAULT)
S:HandleButton(b)
b:Width(80)
b:Height(22)
b:Point("TOPLEFT", ColorPPClass, "BOTTOMLEFT", 0, -7)
b:Disable() -- enable when something has been copied
b:SetScript("OnHide", function(btn)
if btn.colors then
wipe(btn.colors)
end
end)
b:SetScript("OnShow", function(btn)
if btn.colors then
btn:Enable()
else
btn:Disable()
end
end)
-- paste color on button click, updating frame components
b:SetScript("OnClick", function(btn)
local colors = btn.colors
ColorPickerFrame:SetColorRGB(colors.r, colors.g, colors.b)
ColorSwatch:SetTexture(colors.r, colors.g, colors.b)
if ColorPickerFrame.hasOpacity then
if colors.a then
OpacitySliderFrame:SetValue(colors.a)
end
end
end)
-- position Color Swatch for copy color
ColorPPCopyColorSwatch:Point("BOTTOM", ColorPPPaste, "TOP", 0, 10)
-- move the Opacity Slider Frame to align with bottom of Copy ColorSwatch
OpacitySliderFrame:ClearAllPoints()
OpacitySliderFrame:Point("BOTTOM", ColorPPDefault, "BOTTOM", 0, 0)
OpacitySliderFrame:Point("RIGHT", ColorPickerFrame, "RIGHT", -35, 18)
-- set up edit box frames and interior label and text areas
local boxes = {"R", "G", "B", "H", "A"}
for i = 1, #boxes do
local rgb = boxes[i]
local box = CreateFrame("EditBox", "ColorPPBox"..rgb, ColorPickerFrame, "InputBoxTemplate")
box:Point("TOP", ColorPickerWheel, "BOTTOM", 0, -15)
box:SetFrameStrata("DIALOG")
box:SetAutoFocus(false)
box:SetTextInsets(0,7,0,0)
box:SetJustifyH("RIGHT")
box:Height(24)
box:SetID(i)
S:HandleEditBox(box)
-- hex entry box
if i == 4 then
box:SetMaxLetters(6)
box:Width(56)
box:SetNumeric(false)
else
box:SetMaxLetters(3)
box:Width(40)
box:SetNumeric(true)
end
-- label
local label = box:CreateFontString("ColorPPBoxLabel"..rgb, "ARTWORK", "GameFontNormalSmall")
label:Point("RIGHT", box, "LEFT", -5, 0)
label:SetText(i == 4 and "#" or rgb)
label:SetTextColor(1, 1, 1)
-- set up scripts to handle event appropriately
if i == 5 then
box:SetScript("OnEscapePressed", function(self) self:ClearFocus() UpdateAlphaText() end)
box:SetScript("OnEnterPressed", function(self) self:ClearFocus() UpdateAlphaText() end)
box:SetScript("OnTextChanged", UpdateAlpha)
else
box:SetScript("OnEscapePressed", function(self) self:ClearFocus() UpdateColorTexts() end)
box:SetScript("OnEnterPressed", function(self) self:ClearFocus() UpdateColorTexts() end)
box:SetScript("OnTextChanged", UpdateColor)
end
box:SetScript("OnEditFocusGained", function(eb) eb:SetCursorPosition(0) eb:HighlightText() end)
box:SetScript("OnEditFocusLost", function(eb) eb:HighlightText(0,0) end)
box:SetScript("OnTextSet", box.ClearFocus)
box:Show()
end
-- finish up with placement
ColorPPBoxA:Point("RIGHT", OpacitySliderFrame, "RIGHT", 10, 0)
ColorPPBoxH:Point("RIGHT", ColorPPDefault, "RIGHT", -10, 0)
ColorPPBoxB:Point("RIGHT", ColorPPDefault, "LEFT", -40, 0)
ColorPPBoxG:Point("RIGHT", ColorPPBoxB, "LEFT", -25, 0)
ColorPPBoxR:Point("RIGHT", ColorPPBoxG, "LEFT", -25, 0)
-- define the order of tab cursor movement
ColorPPBoxR:SetScript("OnTabPressed", function() ColorPPBoxG:SetFocus() end)
ColorPPBoxG:SetScript("OnTabPressed", function() ColorPPBoxB:SetFocus() end)
ColorPPBoxB:SetScript("OnTabPressed", function() ColorPPBoxH:SetFocus() end)
ColorPPBoxA:SetScript("OnTabPressed", function() ColorPPBoxR:SetFocus() end)
-- make the color picker 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)
ColorPickerFrame:SetUserPlaced(true)
ColorPickerFrame:EnableKeyboard(false)
end
+27
View File
@@ -0,0 +1,27 @@
local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales
local B = E:GetModule("Blizzard")
--Lua functions
--WoW API / Variables
function B:PositionDurabilityFrame()
DurabilityFrame:SetFrameStrata("HIGH")
DurabilityFrame:SetScale(0.6)
DurabilityWeapon:Point("RIGHT", DurabilityWrists, "LEFT", 6, 0)
DurabilityShield:Point("LEFT", DurabilityWrists, "RIGHT", -6, 10)
DurabilityOffWeapon:Point("LEFT", DurabilityWrists, "RIGHT", -6, 0)
DurabilityRanged:Point("TOP", DurabilityShield, "BOTTOM", -1, 0)
hooksecurefunc(DurabilityFrame, "SetPoint", function(self, _, point)
if point ~= Minimap then
self:ClearAllPoints()
if DurabilityShield:IsShown() or DurabilityOffWeapon:IsShown() or DurabilityRanged:IsShown() then
self:Point("RIGHT", Minimap, "RIGHT", -7, 0)
else
self:Point("RIGHT", Minimap, "RIGHT", 8, 0)
end
end
end)
end
+12
View File
@@ -0,0 +1,12 @@
local E, L = unpack(select(2, ...)); --Import: Engine, Locales
local B = E:GetModule("Blizzard")
--Lua functions
--WoW API / Variables
function B:PositionGMFrames()
TicketStatusFrame:ClearAllPoints()
TicketStatusFrame:SetPoint("TOPLEFT", E.UIParent, "TOPLEFT", 250, -5)
E:CreateMover(TicketStatusFrame, "GMMover", L["GM Ticket Frame"])
end
+10
View File
@@ -0,0 +1,10 @@
local E, L = unpack(select(2, ...)); --Import: Engine, Locales
local B = E:GetModule("Blizzard")
--Lua functions
--WoW API / Variables
function B:KillBlizzard()
VideoOptionsResolutionPanelUseUIScale:Kill()
VideoOptionsResolutionPanelUIScaleSlider:Kill()
end
+11
View File
@@ -0,0 +1,11 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/">
<Script file="Blizzard.lua"/>
<Script file="AlertFrame.lua"/>
<Script file="ColorPicker.lua"/>
<Script file="Kill.lua"/>
<Script file="WatchFrame.lua"/>
<Script file="Vehicle.lua"/>
<Script file="GM.lua"/>
<Script file="Durability.lua"/>
<Script file="CaptureBar.lua"/>
</Ui>
+50
View File
@@ -0,0 +1,50 @@
local E, L = unpack(select(2, ...)); --Import: Engine, Locales
local B = E:GetModule("Blizzard")
--Lua functions
local _G = _G
--WoW API / Variables
local GetVehicleUIIndicator = GetVehicleUIIndicator
local GetVehicleUIIndicatorSeat = GetVehicleUIIndicatorSeat
local function VehicleSeatIndicator_SetPosition(self, _, point)
if point ~= VehicleSeatMover then
self:ClearAllPoints()
self:Point("TOPLEFT", VehicleSeatMover, "TOPLEFT", 0, 0)
end
end
local function VehicleSetUp(vehicleID)
if vehicleID == 0 or vehicleID == VehicleSeatIndicator.currSkin then return end
local _, numSeatIndicators = GetVehicleUIIndicator(vehicleID)
local size = E.db.general.vehicleSeatIndicatorSize
VehicleSeatIndicator:Size(size)
for i = 1, numSeatIndicators do
local _, xOffset, yOffset = GetVehicleUIIndicatorSeat(vehicleID, i)
local button = _G["VehicleSeatIndicatorButton"..i]
button:Size(size / 4)
button:Point("CENTER", button:GetParent(), "TOPLEFT", xOffset * size, -yOffset * size)
end
end
function B:UpdateVehicleFrame()
if VehicleSeatIndicator.currSkin then
VehicleSetUp(VehicleSeatIndicator.currSkin)
end
end
function B:PositionVehicleFrame()
if not self.vehicleFrameHooked then
hooksecurefunc(VehicleSeatIndicator, "SetPoint", VehicleSeatIndicator_SetPosition)
hooksecurefunc("VehicleSeatIndicator_SetUpVehicle", VehicleSetUp)
E:CreateMover(VehicleSeatIndicator, "VehicleSeatMover", L["Vehicle Seat Frame"], nil, nil, nil, nil, nil, "general,blizzUIImprovements")
self.vehicleFrameHooked = true
end
VehicleSeatIndicator:Size(E.db.general.vehicleSeatIndicatorSize)
self:UpdateVehicleFrame()
end
+50
View File
@@ -0,0 +1,50 @@
local E, L = unpack(select(2, ...)); --Import: Engine, Locales
local B = E:GetModule("Blizzard")
--Lua functions
local min = math.min
--WoW API / Variables
local GetScreenHeight = GetScreenHeight
local hideRule = "[@arena1,exists][@arena2,exists][@arena3,exists][@arena4,exists][@arena5,exists][@boss1,exists][@boss2,exists][@boss3,exists][@boss4,exists]"
function B:SetObjectiveFrameAutoHide()
if E.db.general.watchFrameAutoHide then
RegisterStateDriver(WatchFrame, "visibility", hideRule)
else
UnregisterStateDriver(WatchFrame, "visibility")
end
end
function B:SetWatchFrameHeight()
local top = WatchFrame:GetTop() or 0
local screenHeight = GetScreenHeight()
local gapFromTop = screenHeight - top
local maxHeight = screenHeight - gapFromTop
local watchFrameHeight = min(maxHeight, E.db.general.watchFrameHeight)
WatchFrame:Height(watchFrameHeight)
end
function B:MoveWatchFrame()
local WatchFrameHolder = CreateFrame("Frame", "WatchFrameHolder", E.UIParent)
WatchFrameHolder:Size(207, 22)
WatchFrameHolder:Point("TOPRIGHT", E.UIParent, "TOPRIGHT", -135, -300)
E:CreateMover(WatchFrameHolder, "WatchFrameMover", L["Objective Frame"], nil, nil, nil, nil, nil, "general,objectiveFrameGroup")
WatchFrameHolder:SetAllPoints(WatchFrameMover)
WatchFrame:ClearAllPoints()
WatchFrame:SetPoint("TOP", WatchFrameHolder, "TOP")
B:SetWatchFrameHeight()
WatchFrame:SetClampedToScreen(false)
hooksecurefunc(WatchFrame, "SetPoint", function(_, _, parent)
if parent ~= WatchFrameHolder then
WatchFrame:ClearAllPoints()
WatchFrame:SetPoint("TOP", WatchFrameHolder, "TOP")
end
end)
self:SetObjectiveFrameAutoHide()
end