Commit 2bf772de authored by Simpy's avatar Simpy 🐹

Merge branch 'development'

parents 5d99ad9b fdbc4755
......@@ -3,8 +3,7 @@ local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, Private
--Lua functions
local _G = _G
local next, ipairs, pairs = next, ipairs, pairs
local floor = floor
local tinsert = tinsert
local floor, tinsert = floor, tinsert
--WoW API / Variables
local GetTime = GetTime
local CreateFrame = CreateFrame
......@@ -28,7 +27,7 @@ function E:Cooldown_OnUpdate(elapsed)
else
local remain = self.duration - (GetTime() - self.start)
if remain > 0.05 then
if self.fontScale and ((self.fontScale * self:GetEffectiveScale() / _G.UIParent:GetScale()) < MIN_SCALE) then
if (not self.staticSize) and self.fontScale and ((self.fontScale * self:GetEffectiveScale() / _G.UIParent:GetScale()) < MIN_SCALE) then
self.text:SetText('')
self.nextUpdate = 500
else
......@@ -52,22 +51,21 @@ function E:Cooldown_OnSizeChanged(cd, parent, width, force)
local fontScale = width and (floor(width + .5) / ICON_SIZE)
-- `CooldownFontSize` is used when we the cooldown button/icon does not use `SetSize` or `Size` for some reason
-- also it can be used to prevent the font size being based on scale, which can sometimes hide the cd text
if parent and parent.CooldownFontSize then
fontScale = (parent.CooldownFontSize / FONT_SIZE)
end
-- also it `staticSize` can be used to prevent the font size being based on scale, which can sometimes (when the icon is under 20px) hide the cd text
local staticSize = parent and parent.CooldownFontSize
if staticSize then fontScale = (parent.CooldownFontSize / FONT_SIZE) end
if fontScale and (fontScale == cd.fontScale) and (force ~= 'override') then return end
cd.fontScale = fontScale
cd.fontScale, cd.staticSize = fontScale, staticSize
if fontScale and (fontScale < MIN_SCALE) and not (parent and parent.CooldownFontSize) then
if (not staticSize) and fontScale and (fontScale < MIN_SCALE) then
cd:Hide()
else
local text = cd.text or cd.time
if text then
local useCustomFont = (cd.timerOptions and cd.timerOptions.fontOptions and cd.timerOptions.fontOptions.enable) and E.Libs.LSM:Fetch("font", cd.timerOptions.fontOptions.font)
if useCustomFont then
local customSize = (parent and parent.CooldownFontSize and cd.timerOptions.fontOptions.fontSize) or (fontScale * cd.timerOptions.fontOptions.fontSize)
local customSize = (staticSize and cd.timerOptions.fontOptions.fontSize) or (fontScale * cd.timerOptions.fontOptions.fontSize)
text:FontTemplate(useCustomFont, customSize, cd.timerOptions.fontOptions.fontOutline)
elseif fontScale and parent and parent.CooldownSettings then
text:FontTemplate(parent.CooldownSettings.font, parent.CooldownSettings.fontSize or (fontScale * FONT_SIZE), parent.CooldownSettings.fontOutline)
......@@ -95,7 +93,7 @@ end
function E:Cooldown_ForceUpdate(cd)
cd.nextUpdate = 0
if cd.fontScale and (cd.fontScale >= MIN_SCALE) then
if cd.staticSize or (cd.fontScale and (cd.fontScale >= MIN_SCALE)) then
cd:Show()
end
end
......@@ -186,7 +184,7 @@ function E:OnSetCooldown(start, duration)
timer.enabled = true
timer.nextUpdate = 0
if timer.fontScale and (timer.fontScale >= MIN_SCALE) then
if timer.staticSize or (timer.fontScale and (timer.fontScale >= MIN_SCALE)) then
timer:Show()
end
elseif self.timer then
......
......@@ -1314,7 +1314,7 @@ function E:StaticPopup_CreateSecureButton(popup, button, text, macro)
local t = btn:CreateFontString(nil, 'OVERLAY', btn)
t:Point('CENTER', 0, 1)
t:FontTemplate()
t:FontTemplate(nil, nil, 'NONE')
t:SetJustifyH('CENTER')
t:SetText(text)
btn.text = t
......
## Interface: 80100
## Author: Elv
## Version: 11.01
## Version: 11.02
## Title: |cfffe7b2cElvUI|r
## Notes: User Interface replacement AddOn for World of Warcraft.
## SavedVariables: ElvDB, ElvPrivateDB
......
......@@ -129,8 +129,9 @@ local channelButtons = {
function LO:ToggleChatTabPanels(rightOverride, leftOverride)
if E.private.chat.enable then
local attachToTab = (E.db.chat.panelBackdrop == "HIDEBOTH" or E.db.chat.panelBackdrop == "RIGHT") or E.db.chat.panelTabBackdrop
for _, button in pairs(channelButtons) do
button.Icon:SetParent(E.db.chat.panelTabBackdrop and _G.LeftChatTab or _G.LeftChatPanel)
button.Icon:SetParent((attachToTab and _G.LeftChatTab) or _G.LeftChatPanel)
end
end
......
......@@ -34,6 +34,7 @@ function AB:UpdatePet(event, unit)
for i=1, NUM_PET_ACTION_SLOTS, 1 do
local name, texture, isToken, isActive, autoCastAllowed, autoCastEnabled, spellID = GetPetActionInfo(i)
local buttonName = "PetActionButton"..i
local autoCast = _G[buttonName.."AutoCastable"];
local button = _G[buttonName]
button:SetAlpha(1);
......@@ -44,7 +45,12 @@ function AB:UpdatePet(event, unit)
button.ICON = button:CreateTexture(buttonName..'ICON')
button.ICON:SetTexCoord(unpack(E.TexCoords))
button.ICON:SetInside()
button.pushed:SetDrawLayer('ARTWORK', 1)
button.ICON:SetSnapToPixelGrid(false)
button.ICON:SetTexelSnappingBias(0)
if button.pushed then
button.pushed:SetDrawLayer('ARTWORK', 1)
end
end
if not isToken then
......@@ -77,9 +83,9 @@ function AB:UpdatePet(event, unit)
end
if autoCastAllowed then
button.AutoCastable:Show();
autoCast:Show();
else
button.AutoCastable:Hide();
autoCast:Hide();
end
if autoCastEnabled then
......@@ -193,14 +199,14 @@ function AB:PositionAndSizeBarPet()
lastButton = _G["PetActionButton"..i-1];
autoCast = _G["PetActionButton"..i..'AutoCastable'];
lastColumnButton = _G["PetActionButton"..i-buttonsPerRow];
button:SetParent(bar);
button:ClearAllPoints();
button:SetAttribute("showgrid", 1);
button:Size(size);
autoCast:SetOutside(button, autoCastSize, autoCastSize)
button:SetAttribute("showgrid", 1);
if i == 1 then
local x, y;
if point == "BOTTOMLEFT" then
......
......@@ -243,7 +243,7 @@ function B:SetSearch(query)
end
if ElvUIReagentBankFrameItem1 then
for slotID=1, 98 do
for slotID = 1, B.REAGENTBANK_SIZE do
local _, _, _, _, _, _, link = GetContainerItemInfo(REAGENTBANK_CONTAINER, slotID);
local button = _G["ElvUIReagentBankFrameItem"..slotID]
local success, result = pcall(method, Search, link, query)
......@@ -336,7 +336,7 @@ function B:UpdateCountDisplay()
--Reagent Bank
if self.BankFrame and self.BankFrame.reagentFrame then
for i = 1, 98 do
for i = 1, B.REAGENTBANK_SIZE do
local slot = self.BankFrame.reagentFrame.slots[i]
if slot then
slot.Count:FontTemplate(E.Libs.LSM:Fetch("font", E.db.bags.countFont), E.db.bags.countFontSize, E.db.bags.countFontOutline)
......@@ -648,7 +648,7 @@ end
function B:UpdateBagSlots(bagID)
if bagID == REAGENTBANK_CONTAINER then
for i=1, 98 do
for i=1, B.REAGENTBANK_SIZE do
self:UpdateReagentSlot(i);
end
else
......@@ -683,7 +683,7 @@ function B:UpdateCooldowns()
for _, bagID in ipairs(self.BagIDs) do
for slotID = 1, GetContainerNumSlots(bagID) do
local start, duration, enable = GetContainerItemCooldown(bagID, slotID)
--CooldownFrame_Set(self.Bags[bagID][slotID].cooldown, start, duration, enable, _, _)
CooldownFrame_Set(self.Bags[bagID][slotID].cooldown, start, duration, enable, _, _)
end
end
end
......@@ -931,9 +931,6 @@ function B:Layout(isBank)
local f = self:GetContainerFrame(isBank);
if not f then return end
local ButtonType = E.wowpatch == "8.1.0" and "CheckButton" or "ItemButton"
local buttonSize = isBank and self.db.bankSize or self.db.bagSize;
local buttonSpacing = E.Border*2;
local containerWidth = ((isBank and self.db.bankWidth) or self.db.bagWidth)
......@@ -968,7 +965,7 @@ function B:Layout(isBank)
if (not isBank) or (isBank and bagID ~= -1 and numContainerSlots >= 1 and not (i - 1 > numContainerSlots)) then
if not f.ContainerHolder[i] then
if isBank then
f.ContainerHolder[i] = CreateFrame(ButtonType, "ElvUIBankBag" .. (bagID-4), f.ContainerHolder, "BankItemButtonBagTemplate")
f.ContainerHolder[i] = CreateFrame("ItemButton", "ElvUIBankBag" .. (bagID-4), f.ContainerHolder, "BankItemButtonBagTemplate")
B:CreateFilterIcon(f.ContainerHolder[i])
f.ContainerHolder[i]:SetScript('OnClick', function(holder, button)
if button == "RightButton" and holder.id then
......@@ -981,7 +978,7 @@ function B:Layout(isBank)
end)
else
if bagID == 0 then --Backpack needs different setup
f.ContainerHolder[i] = CreateFrame(ButtonType, "ElvUIMainBagBackpack", f.ContainerHolder, "ItemAnimTemplate")
f.ContainerHolder[i] = CreateFrame("ItemButton", "ElvUIMainBagBackpack", f.ContainerHolder, "ItemAnimTemplate")
B:CreateFilterIcon(f.ContainerHolder[i])
f.ContainerHolder[i]:RegisterForClicks("LeftButtonUp", "RightButtonUp")
f.ContainerHolder[i]:SetScript('OnClick', function(holder, button)
......@@ -996,7 +993,7 @@ function B:Layout(isBank)
PutItemInBackpack();--Put bag on empty slot, or drop item in this bag
end)
else
f.ContainerHolder[i] = CreateFrame(ButtonType, "ElvUIMainBag" .. (bagID-1) .. "Slot", f.ContainerHolder, "BagSlotButtonTemplate")
f.ContainerHolder[i] = CreateFrame("ItemButton", "ElvUIMainBag" .. (bagID-1) .. "Slot", f.ContainerHolder, "BagSlotButtonTemplate")
B:CreateFilterIcon(f.ContainerHolder[i])
f.ContainerHolder[i]:SetScript('OnClick', function(holder, button)
if button == "RightButton" and holder.id then
......@@ -1012,7 +1009,7 @@ function B:Layout(isBank)
f.ContainerHolder[i]:SetTemplate(nil, true)
f.ContainerHolder[i]:StyleButton()
--f.ContainerHolder[i].IconBorder:SetAlpha(0)
f.ContainerHolder[i].IconBorder:SetAlpha(0)
f.ContainerHolder[i]:SetNormalTexture("")
f.ContainerHolder[i]:SetPushedTexture("")
f.ContainerHolder[i].id = bagID
......@@ -1026,13 +1023,11 @@ function B:Layout(isBank)
end
end
if _G[f.ContainerHolder[i]:GetName()..'IconTexture'] then
f.ContainerHolder[i].iconTexture = _G[f.ContainerHolder[i]:GetName()..'IconTexture'];
f.ContainerHolder[i].iconTexture:SetInside()
f.ContainerHolder[i].iconTexture:SetTexCoord(unpack(E.TexCoords))
if bagID == 0 then --backpack
f.ContainerHolder[i].iconTexture:SetTexture("Interface\\Buttons\\Button-Backpack-Up");
end
f.ContainerHolder[i].iconTexture = _G[f.ContainerHolder[i]:GetName()..'IconTexture'];
f.ContainerHolder[i].iconTexture:SetInside()
f.ContainerHolder[i].iconTexture:SetTexCoord(unpack(E.TexCoords))
if bagID == 0 then --backpack
f.ContainerHolder[i].iconTexture:SetTexture("Interface\\Buttons\\Button-Backpack-Up");
end
end
......@@ -1079,7 +1074,7 @@ function B:Layout(isBank)
for slotID = 1, numSlots do
f.totalSlots = f.totalSlots + 1;
if not f.Bags[bagID][slotID] then
f.Bags[bagID][slotID] = CreateFrame(ButtonType, f.Bags[bagID]:GetName()..'Slot'..slotID, f.Bags[bagID], bagID == -1 and 'BankItemButtonGenericTemplate' or 'ContainerFrameItemButtonTemplate');
f.Bags[bagID][slotID] = CreateFrame('ItemButton', f.Bags[bagID]:GetName()..'Slot'..slotID, f.Bags[bagID], bagID == -1 and 'BankItemButtonGenericTemplate' or 'ContainerFrameItemButtonTemplate');
f.Bags[bagID][slotID]:StyleButton();
f.Bags[bagID][slotID]:SetTemplate(nil, true);
f.Bags[bagID][slotID]:SetNormalTexture(nil);
......@@ -1241,11 +1236,11 @@ function B:Layout(isBank)
local totalSlots, lastReagentRowButton = 0
numContainerRows = 1
for i = 1, 98 do
for i = 1, B.REAGENTBANK_SIZE do
totalSlots = totalSlots + 1;
if(not f.reagentFrame.slots[i]) then
f.reagentFrame.slots[i] = CreateFrame(ButtonType, "ElvUIReagentBankFrameItem"..i, f.reagentFrame, "ReagentBankItemButtonGenericTemplate");
f.reagentFrame.slots[i] = CreateFrame("ItemButton", "ElvUIReagentBankFrameItem"..i, f.reagentFrame, "ReagentBankItemButtonGenericTemplate");
f.reagentFrame.slots[i]:SetID(i)
f.reagentFrame.slots[i]:StyleButton()
......@@ -1364,13 +1359,8 @@ function B:UpdateReagentSlot(slotID)
end
function B:UpdateAll()
if self.BagFrame then
self:Layout();
end
if self.BankFrame then
self:Layout(true);
end
if self.BagFrame then self:Layout() end
if self.BankFrame then self:Layout(true) end
end
function B:OnEvent(event, ...)
......@@ -1704,20 +1694,7 @@ function B:ContructContainerFrame(name, isBank)
f.reagentToggle:SetScript("OnLeave", self.Tooltip_Hide)
f.reagentToggle:SetScript("OnClick", function()
PlaySound(841) --IG_CHARACTER_INFO_TAB
if f.holderFrame:IsShown() then
_G.BankFrame.selectedTab = 2
f.holderFrame:Hide()
f.reagentFrame:Show()
f.editBox:Point('RIGHT', f.depositButton, 'LEFT', -5, 0);
f.bagText:SetText(L["Reagent Bank"])
else
_G.BankFrame.selectedTab = 1
f.reagentFrame:Hide()
f.holderFrame:Show()
f.editBox:Point('RIGHT', f.purchaseBagButton, 'LEFT', -5, 0);
f.bagText:SetText(L["Bank"])
end
B:ShowBankTab(f, f.holderFrame:IsShown())
self:Layout(true)
f:Show()
end)
......@@ -2060,11 +2037,30 @@ function B:CloseBags()
TooltipModule:GameTooltip_SetDefaultAnchor(_G.GameTooltip)
end
function B:ShowBankTab(f, showReagent)
if showReagent then
_G.BankFrame.selectedTab = 2
f.holderFrame:Hide()
f.reagentFrame:Show()
f.editBox:Point('RIGHT', f.depositButton, 'LEFT', -5, 0);
f.bagText:SetText(L["Reagent Bank"])
else
_G.BankFrame.selectedTab = 1
f.reagentFrame:Hide()
f.holderFrame:Show()
f.editBox:Point('RIGHT', f.purchaseBagButton, 'LEFT', -5, 0);
f.bagText:SetText(L["Bank"])
end
end
function B:OpenBank()
if not self.BankFrame then
self.BankFrame = self:ContructContainerFrame('ElvUI_BankContainerFrame', true);
end
--Allow opening reagent tab directly by holding Shift
B:ShowBankTab(self.BankFrame, IsShiftKeyDown())
--Call :Layout first so all elements are created before we update
self:Layout(true)
......@@ -2073,15 +2069,6 @@ function B:OpenBank()
self:OpenBags()
self:UpdateTokens()
--Allow opening reagent tab directly by holding Shift
if IsShiftKeyDown() then
_G.BankFrame.selectedTab = 2
self.BankFrame.holderFrame:Hide()
self.BankFrame.reagentFrame:Show()
self.BankFrame.editBox:Point('RIGHT', self.BankFrame.depositButton, 'LEFT', -5, 0);
self.BankFrame.bagText:SetText(L["Reagent Bank"])
end
end
function B:PLAYERBANKBAGSLOTS_CHANGED()
......@@ -2402,6 +2389,7 @@ function B:Initialize()
E.bags = self
self.db = E.db.bags
self.BagFrames = {}
self.REAGENTBANK_SIZE = 98 -- numRow (7) * numColumn (7) * numSubColumn (2) = size = 98
self.ProfessionColors = {
[0x0008] = { self.db.colors.profession.leatherworking.r, self.db.colors.profession.leatherworking.g, self.db.colors.profession.leatherworking.b },
......
......@@ -195,6 +195,19 @@ do --this can save some main file locals
["Tierone-Spirestone"] = "Dr. ", -- lol
["Tirain-Spirestone"] = MrHankey,
["Sinth-Spirestone"] = MrHankey,
--I will forever have the picture you accidently shared of the manikin wearing a strapon burned in my brain
["Misdîrect-Spirestone"] = ElvRainbow,
["Misoracle-Spirestone"] = ElvRainbow,
["MisLight-Spirestone"] = ElvRainbow,
["MisDivine-Spirestone"] = ElvRainbow,
["MisLust-Spirestone"] = ElvRainbow,
["MisMayhem-Spirestone"] = ElvRainbow,
["Mismonk-Spirestone"] = ElvRainbow,
["Misillidan-Spirestone"] = ElvRainbow,
["Mispel-Spirestone"] = ElvRainbow,
["Misdecay-Spirestone"] = ElvRainbow,
-- Whiro --
["Zistraeti-WyrmrestAccord"] = ElvPurple, -- Warlock
-- Merathilis Toons --
......@@ -2381,7 +2394,7 @@ function CH:HandleChatVoiceIcons(S)
hooksecurefunc(_G.GeneralDockManagerScrollFrame, 'SetPoint', function(frame, point, anchor, attachTo, x, y)
if anchor == _G.GeneralDockManagerOverflowButton and (x == 0 and y == 0) then
frame:Point(point, anchor, attachTo, -2, -6)
frame:Point(point, anchor, attachTo, -3, -6)
elseif point == "BOTTOMRIGHT" and anchor ~= channelButtons[3] and anchor ~= channelButtons[1] and not _G.GeneralDockManagerOverflowButton:IsShown() then
if channelButtons[3]:IsShown() then
frame:Point("BOTTOMRIGHT", channelButtons[3], "BOTTOMLEFT")
......
......@@ -186,12 +186,12 @@ function NP:CVarReset()
SetCVar('nameplateMaxAlphaDistance', 40)
SetCVar('nameplateMaxScale', 1)
SetCVar('nameplateMaxScaleDistance', 40)
SetCVar('nameplateMinAlpha', 1) -- if we set it back to 1, it will sometimes break the alpha
SetCVar('nameplateMinAlphaDistance', GetCVarDefault('nameplateMinAlphaDistance')) -- see above
SetCVar('nameplateMinAlpha', 1)
SetCVar('nameplateMinAlphaDistance', GetCVarDefault('nameplateMinAlphaDistance'))
SetCVar('nameplateMinScale', 1)
SetCVar('nameplateMinScaleDistance', 0)
SetCVar('nameplateMotionSpeed', GetCVarDefault('nameplateMotionSpeed'))
SetCVar('nameplateOccludedAlphaMult', GetCVarDefault('nameplateOccludedAlphaMult')) -- see above
SetCVar('nameplateOccludedAlphaMult', GetCVarDefault('nameplateOccludedAlphaMult'))
SetCVar('nameplateOtherAtBase', GetCVarDefault('nameplateOtherAtBase'))
SetCVar('nameplateOverlapH', GetCVarDefault('nameplateOverlapH'))
SetCVar('nameplateOverlapV', GetCVarDefault('nameplateOverlapV'))
......@@ -250,7 +250,10 @@ end
function NP:SetNamePlateSelfClickThrough()
C_NamePlate_SetNamePlateSelfClickThrough(NP.db.clickThrough.personal)
_G.ElvNP_Player:EnableMouse(not NP.db.clickThrough.personal)
if _G.ElvNP_Player then
_G.ElvNP_Player:EnableMouse(not NP.db.clickThrough.personal)
end
end
function NP:SetNamePlateFriendlyClickThrough()
......@@ -301,11 +304,13 @@ function NP:ConfigureAll()
NP:PLAYER_REGEN_ENABLED()
if NP.db.units.PLAYER.enable and NP.db.units.PLAYER.useStaticPosition then
_G.ElvNP_Player:Enable()
_G.ElvNP_Player:UpdateAllElements('OnShow')
else
_G.ElvNP_Player:Disable()
if _G.ElvNP_Player then
if NP.db.units.PLAYER.enable and NP.db.units.PLAYER.useStaticPosition then
_G.ElvNP_Player:Enable()
_G.ElvNP_Player:UpdateAllElements('OnShow')
else
_G.ElvNP_Player:Disable()
end
end
NP:NamePlateCallBack(_G.ElvNP_Player, 'NAME_PLATE_UNIT_ADDED')
......@@ -320,7 +325,7 @@ function NP:ConfigureAll()
end
function NP:NamePlateCallBack(nameplate, event, unit)
if event == 'NAME_PLATE_UNIT_ADDED' then
if event == 'NAME_PLATE_UNIT_ADDED' and nameplate then
NP:ClearStyledPlate(nameplate)
unit = unit or nameplate.unit
......@@ -340,9 +345,26 @@ function NP:NamePlateCallBack(nameplate, event, unit)
-- update player and test plate
if NP.db.units.PLAYER.enable and NP.db.units.PLAYER.useStaticPosition then
if not _G.ElvNP_Player then
ElvUF:Spawn('player', 'ElvNP_Player')
_G.ElvNP_Player:DisableElement('Castbar')
_G.ElvNP_Player.isNamePlate = true
_G.ElvNP_Player:RegisterForClicks('LeftButtonDown', 'RightButtonDown')
_G.ElvNP_Player:SetAttribute('*type1', 'target')
_G.ElvNP_Player:SetAttribute('*type2', 'togglemenu')
_G.ElvNP_Player:SetAttribute('toggleForVehicle', true)
_G.ElvNP_Player:Point('TOP', _G.UIParent, 'CENTER', 0, -150)
_G.ElvNP_Player:Size(NP.db.clickableWidth, NP.db.clickableHeight)
_G.ElvNP_Player:SetScale(1)
_G.ElvNP_Player:SetScript('OnEnter', _G.UnitFrame_OnEnter)
_G.ElvNP_Player:SetScript('OnLeave', _G.UnitFrame_OnLeave)
_G.ElvNP_Player.frameType = 'PLAYER'
E:CreateMover(_G.ElvNP_Player, 'ElvNP_PlayerMover', L['Player NamePlate'], nil, nil, nil, 'ALL,SOLO', nil, 'player,generalGroup')
end
NP:UpdatePlate(_G.ElvNP_Player)
end
if _G.ElvNP_Test:IsEnabled() then
if _G.ElvNP_Test and _G.ElvNP_Test:IsEnabled() then
NP:UpdatePlate(_G.ElvNP_Test)
end
......@@ -415,6 +437,24 @@ function NP:UpdatePlateEvents(nameplate)
NP:StyleFilterEventWatch(nameplate)
end
function NP:SpawnTestFrame()
if not _G.ElvNP_Test then
ElvUF:Spawn('player', 'ElvNP_Test')
_G.ElvNP_Test:DisableElement('Castbar')
_G.ElvNP_Test.isNamePlate = true
_G.ElvNP_Test:Point('BOTTOM', _G.UIParent, 'BOTTOM', 0, 250)
_G.ElvNP_Test:Size(NP.db.clickableWidth, NP.db.clickableHeight)
_G.ElvNP_Test:SetScale(1)
_G.ElvNP_Test:SetMovable(true)
_G.ElvNP_Test:RegisterForDrag("LeftButton", "RightButton")
_G.ElvNP_Test:SetScript("OnDragStart", function(self) _G.ElvNP_Test:StartMoving() end)
_G.ElvNP_Test:SetScript("OnDragStop", function() _G.ElvNP_Test:StopMovingOrSizing() end)
_G.ElvNP_Test.frameType = 'PLAYER'
NP:UpdatePlate(_G.ElvNP_Test)
_G.ElvNP_Test:Disable()
end
end
function NP:Initialize()
NP.db = E.db.nameplates
......@@ -447,32 +487,39 @@ function NP:Initialize()
NP.Tooltip = CreateFrame('GameTooltip', 'ElvUIQuestTooltip', nil, 'GameTooltipTemplate')
NP.Tooltip:SetOwner(_G.WorldFrame, 'ANCHOR_NONE')
ElvUF:Spawn('player', 'ElvNP_Player')
_G.ElvNP_Player.isNamePlate = true
_G.ElvNP_Player:RegisterForClicks('LeftButtonDown', 'RightButtonDown')
_G.ElvNP_Player:SetAttribute('*type1', 'target')
_G.ElvNP_Player:SetAttribute('*type2', 'togglemenu')
_G.ElvNP_Player:SetAttribute('toggleForVehicle', true)
_G.ElvNP_Player:Point('TOP', _G.UIParent, 'CENTER', 0, -150)
_G.ElvNP_Player:Size(NP.db.clickableWidth, NP.db.clickableHeight)
_G.ElvNP_Player:SetScale(1)
_G.ElvNP_Player:SetScript('OnEnter', _G.UnitFrame_OnEnter)
_G.ElvNP_Player:SetScript('OnLeave', _G.UnitFrame_OnLeave)
_G.ElvNP_Player.frameType = 'PLAYER'
ElvUF:Spawn('player', 'ElvNP_Test')
_G.ElvNP_Test:Point('BOTTOM', _G.UIParent, 'BOTTOM', 0, 250)
_G.ElvNP_Test:Size(NP.db.clickableWidth, NP.db.clickableHeight)
_G.ElvNP_Test:SetScale(1)
_G.ElvNP_Test.frameType = 'PLAYER'
NP:UpdatePlate(_G.ElvNP_Test)
_G.ElvNP_Test:Disable()
E:CreateMover(_G.ElvNP_Player, 'ElvNP_PlayerMover', L['Player NamePlate'], nil, nil, nil, 'ALL,SOLO', nil, 'player,generalGroup')
local NamePlatesCVars = {
['nameplateClassResourceTopInset'] = GetCVarDefault('nameplateClassResourceTopInset'),
['nameplateGlobalScale'] = 1,
['NamePlateHorizontalScale'] = 1,
['nameplateLargeBottomInset'] = GetCVarDefault('nameplateLargeBottomInset'),
['nameplateLargerScale'] = 1,
['nameplateLargeTopInset'] = GetCVarDefault('nameplateLargeTopInset'),
['nameplateMaxAlpha'] = 1,
['nameplateMaxAlphaDistance'] = 40,
['nameplateMaxScale'] = 1,
['nameplateMaxScaleDistance'] = 40,
['nameplateMinAlpha'] = 1,
['nameplateMinAlphaDistance'] = GetCVarDefault('nameplateMinAlphaDistance'),
['nameplateMinScale'] = 1,
['nameplateMinScaleDistance'] = 0,
['nameplateMotionSpeed'] = GetCVarDefault('nameplateMotionSpeed'),
['nameplateOccludedAlphaMult'] = GetCVarDefault('nameplateOccludedAlphaMult'),
['nameplateOtherAtBase'] = GetCVarDefault('nameplateOtherAtBase'),
['nameplateOverlapH'] = GetCVarDefault('nameplateOverlapH'),
['nameplateOverlapV'] = GetCVarDefault('nameplateOverlapV'),
['nameplateResourceOnTarget'] = GetCVarDefault('nameplateResourceOnTarget'),
['nameplateSelectedAlpha'] = 1,
['nameplateSelectedScale'] = 1,
['nameplateSelfAlpha'] = 1,
['nameplateSelfBottomInset'] = GetCVarDefault('nameplateSelfBottomInset'),
['nameplateSelfScale'] = 1,
['nameplateSelfTopInset'] = GetCVarDefault('nameplateSelfTopInset'),
['nameplateTargetBehindMaxDistance'] = 40,
}
ElvUF:SpawnNamePlates('ElvNP_', function(nameplate, event, unit)
NP:NamePlateCallBack(nameplate, event, unit)
end)
end, NamePlatesCVars)
NP:RegisterEvent('PLAYER_REGEN_ENABLED')
NP:RegisterEvent('PLAYER_REGEN_DISABLED')
......
......@@ -732,7 +732,7 @@ function mod:StyleFilterPass(frame, actions)
end
function mod:ClearStyledPlate(frame)
if frame.StyleChanged then
if frame and frame.StyleChanged then
self:StyleFilterClearChanges(frame, frame.HealthColorChanged, frame.PowerColorChanged, frame.BorderChanged, frame.FlashingHealth, frame.TextureChanged, frame.ScaleChanged, frame.AlphaChanged, frame.NameColorChanged, frame.PortraitShown, frame.NameOnlyChanged, frame.VisibilityChanged)
end
end
......
......@@ -28,19 +28,19 @@ local function LoadSkin()
local StoryTooltip = _G.QuestScrollFrame.StoryTooltip
StoryTooltip:SetFrameLevel(4)
--GameTooltip.ItemTooltip.Icon:SetTexCoord(unpack(E.TexCoords))
--GameTooltip.ItemTooltip.IconBorder:SetAlpha(0)
--GameTooltip.ItemTooltip:CreateBackdrop("Default")
--GameTooltip.ItemTooltip.backdrop:SetOutside(GameTooltip.ItemTooltip.Icon)
--GameTooltip.ItemTooltip.Count:ClearAllPoints()
--GameTooltip.ItemTooltip.Count:SetPoint('BOTTOMRIGHT', GameTooltip.ItemTooltip.Icon, 'BOTTOMRIGHT', 1, 0)
--hooksecurefunc(GameTooltip.ItemTooltip.IconBorder, 'SetVertexColor', function(self, r, g, b)
-- self:GetParent().backdrop:SetBackdropBorderColor(r, g, b)
-- self:SetTexture()
--end)
--hooksecurefunc(GameTooltip.ItemTooltip.IconBorder, 'Hide', function(self)
-- self:GetParent().backdrop:SetBackdropBorderColor(unpack(E.media.bordercolor))
--end)
GameTooltip.ItemTooltip.Icon:SetTexCoord(unpack(E.TexCoords))
GameTooltip.ItemTooltip.IconBorder:SetAlpha(0)
GameTooltip.ItemTooltip:CreateBackdrop("Default")
GameTooltip.ItemTooltip.backdrop:SetOutside(GameTooltip.ItemTooltip.Icon)
GameTooltip.ItemTooltip.Count:ClearAllPoints()
GameTooltip.ItemTooltip.Count:SetPoint('BOTTOMRIGHT', GameTooltip.ItemTooltip.Icon, 'BOTTOMRIGHT', 1, 0)
hooksecurefunc(GameTooltip.ItemTooltip.IconBorder, 'SetVertexColor', function(self, r, g, b)
self:GetParent().backdrop:SetBackdropBorderColor(r, g, b)
self:SetTexture()
end)
hooksecurefunc(GameTooltip.ItemTooltip.IconBorder, 'Hide', function(self)
self:GetParent().backdrop:SetBackdropBorderColor(unpack(E.media.bordercolor))
end)
local WarCampaignTooltip = _G.QuestScrollFrame.WarCampaignTooltip
local tooltips = {
......
......@@ -1152,6 +1152,7 @@ function ElvUF:DisableBlizzard(unit)
end
end
function UF:ADDON_LOADED(_, addon)
if addon ~= 'Blizzard_ArenaUI' then return; end
ElvUF:DisableBlizzard('arena')
......
......@@ -1846,6 +1846,7 @@ local function GetUnitSettings(unit, name)
name = L["Show/Hide Test Frame"],
type = "execute",
func = function(info)
NP:SpawnTestFrame()
if not _G.ElvNP_Test:IsEnabled() or _G.ElvNP_Test.frameType ~= unit then
_G.ElvNP_Test:Enable()
_G.ElvNP_Test.frameType = unit
......@@ -3335,7 +3336,6 @@ local function GetUnitSettings(unit, name)
PLAYER = L["Player Nameplate"],
TARGET = L["Targeted Nameplate"],
},
disabled = function() return true end, -- remove me
},
yOffset = {
order = 3,
......@@ -3964,7 +3964,7 @@ E.Options.args.nameplate = {
return t.r, t.g, t.b, t.a, d.r, d.g, d.b, d.a
end,
set = function(info, r, g, b, a)
local t = E.db.nameplates.colors[info[#info]]
local t = E.db.nameplates.colors.threat[info[#info]]
t.r, t.g, t.b, t.a = r, g, b, a
NP:ConfigureAll()
end,
......
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