Verified Commit 70b3ed76 authored by Simpy's avatar Simpy 🐹

Merge branch 'development'

# Conflicts:
#	CHANGELOG.md
parents b9d02ea3 e7d27e17
......@@ -12,7 +12,7 @@ local _G = _G
local tonumber, pairs, ipairs, error, unpack, select, tostring = tonumber, pairs, ipairs, error, unpack, select, tostring
local assert, type, pcall, date = assert, type, pcall, date
local twipe, tinsert, tremove, next = wipe, tinsert, tremove, next
local floor, gsub, strmatch, strjoin = floor, gsub, match, strjoin
local gsub, strmatch, strjoin = gsub, match, strjoin
local format, find, strrep, len, sub = format, strfind, strrep, strlen, strsub
--WoW API / Variables
local CreateFrame = CreateFrame
......
......@@ -24,10 +24,10 @@ local function customSetBackdrop(frame, giveBorder, bgFile, edgeSize, insetLeft,
end
end
if not (giveBorder or bgFile) then return end
frame.pixelBorders.CENTER:SetTexture(bgFile)
if not (giveBorder or bgFile) then return end
if insetLeft or insetRight or insetTop or insetBottom then
frame.pixelBorders.CENTER:SetPoint('TOPLEFT', frame, 'TOPLEFT', -insetLeft or 0, insetTop or 0)
frame.pixelBorders.CENTER:SetPoint('BOTTOMRIGHT', frame, 'BOTTOMRIGHT', insetRight or 0, -insetBottom or 0)
......@@ -62,8 +62,7 @@ local function customBackdropBorderColor(frame, r, g, b, a)
end
local function buildPixelBorders(frame, noSecureHook)
if not frame then return end
if not frame.pixelBorders then
if frame and not frame.pixelBorders then
local borders = {}
for _, v in pairs(BackdropBorders) do
......@@ -93,12 +92,12 @@ local function buildPixelBorders(frame, noSecureHook)
borders.RIGHT:Point("TOPRIGHT", borders.TOPRIGHT, "BOTTOMRIGHT", 0, 0)
borders.RIGHT:Point("BOTTOMRIGHT", borders.BOTTOMRIGHT, "TOPRIGHT", 0, 0)
frame.pixelBorders = borders
end
if not noSecureHook then
hooksecurefunc(frame, "SetBackdropColor", customBackdropColor)
hooksecurefunc(frame, "SetBackdropBorderColor", customBackdropBorderColor)
end
if not noSecureHook then
hooksecurefunc(frame, "SetBackdropColor", customBackdropColor)
hooksecurefunc(frame, "SetBackdropBorderColor", customBackdropBorderColor)
frame.pixelBorders = borders
end
end
-- end backdrop replace code
......@@ -194,7 +193,7 @@ local function SetTemplate(f, t, glossTex, ignoreUpdates, forcePixelMode, isUnit
if t == 'Transparent' then
customBackdropColor(f, backdropr, backdropg, backdropb, backdropa)
else
customBackdropColor(f, backdropr, backdropg, backdropb)
customBackdropColor(f, backdropr, backdropg, backdropb, 1)
end
end
......
## Interface: 80100
## Author: Elv
## Version: 11.05
## Version: 11.06
## Title: |cfffe7b2cElvUI|r
## Notes: User Interface replacement AddOn for World of Warcraft.
## SavedVariables: ElvDB, ElvPrivateDB
......
......@@ -3,8 +3,6 @@ local M = E:NewModule('WorldMap', 'AceHook-3.0', 'AceEvent-3.0', 'AceTimer-3.0')
E.WorldMap = M
--Lua functions
local _G = _G
local pairs = pairs
local find = string.find
--WoW API / Variables
local CreateFrame = CreateFrame
......
......@@ -27,10 +27,11 @@ function NP:ClassPower_UpdateColor(powerType)
r, g, b = unpack(color)
end
local db = NP.db.units[self.__owner.frameType]
local ClassColor = db and db.classpower.classColor and (_G.CUSTOM_CLASS_COLORS and _G.CUSTOM_CLASS_COLORS[E.myclass] or RAID_CLASS_COLORS[E.myclass])
for i = 1, #self do
if powerType == 'COMBO_POINTS' then
r, g, b = NP.db.colors.classResources.comboPoints[i].r, NP.db.colors.classResources.comboPoints[i].g, NP.db.colors.classResources.comboPoints[i].b
end
local classColor = ClassColor or (powerType == 'COMBO_POINTS' and NP.db.colors.classResources.comboPoints[i])
if classColor then r, g, b = classColor.r, classColor.g, classColor.b end
self[i]:SetStatusBarColor(r, g, b)
end
......
......@@ -377,6 +377,51 @@ function NP:ConfigureAll()
NP:SetNamePlateClickThrough()
end
function NP:IsBlizzardPlateOccluded(nameplate)
local OccludedAlpha = GetCVar('nameplateMaxAlpha') * GetCVar('nameplateOccludedAlphaMult')
return E:Round(nameplate:GetParent():GetAlpha(), 2) == OccludedAlpha
end
function NP:GetNonTargetAlpha(nameplate, hasTarget)
local Alpha = NP.db.units.TARGET.nonTargetTransparency
if (nameplate.frameType == 'PLAYER') or nameplate.isTarget then
Alpha = 1
elseif (not nameplate.isTarget) and not nameplate.isUnitOcculed and NP:IsBlizzardPlateOccluded(nameplate) then
Alpha = Alpha * 0.5
elseif not hasTarget then
Alpha = 1
end
return Alpha
end
function NP:HandleTargetAlpha(nameplate, added)
if nameplate then
local hasTarget = UnitExists('target')
local newAlpha = (nameplate.isTarget and 1) or (hasTarget and NP.db.units.TARGET.nonTargetTransparency)
local alpha = newAlpha or NP:GetNonTargetAlpha(nameplate, hasTarget)
if added then
E:UIFrameFadeIn(nameplate, 1, 0, alpha)
else
nameplate:SetAlpha(alpha)
end
end
end
function NP:WatchOcculed(elapsed)
if self.elapsed and (self.elapsed > 0.1) then
local nameplate = self and self:GetParent()
if nameplate then
nameplate.isUnitOcculed = NP:IsBlizzardPlateOccluded(nameplate)
end
self.elapsed = 0
else
self.elapsed = (self.elapsed and self.elapsed + elapsed) or 0
end
end
function NP:NamePlateCallBack(nameplate, event, unit)
if event == 'NAME_PLATE_UNIT_ADDED' and nameplate then
NP:ClearStyledPlate(nameplate)
......@@ -415,42 +460,28 @@ function NP:NamePlateCallBack(nameplate, event, unit)
NP:Move_TargetClassPower(nameplate)
end
if nameplate:IsShown() then
E:UIFrameFadeIn(nameplate, 1, 0, (nameplate.isTarget and 1) or (UnitExists("target") and NP.db.nonTargetTransparency or 1))
end
NP.Plates[nameplate] = true
nameplate:UpdateTags()
if not nameplate.OcculedWatcher then
nameplate.OcculedWatcher = CreateFrame('Frame', nil, nameplate)
end
nameplate.OcculedWatcher:SetScript('OnUpdate', NP.WatchOcculed)
NP:HandleTargetAlpha(nameplate, true)
NP:StyleFilterUpdate(nameplate, event) -- keep this at the end
elseif event == 'NAME_PLATE_UNIT_REMOVED' then
NP:ClearStyledPlate(nameplate)
if nameplate.OcculedWatcher then
nameplate.OcculedWatcher:SetScript('OnUpdate', nil)
end
nameplate.isTargetingMe = nil
nameplate.isTarget = nil
elseif event == 'PLAYER_TARGET_CHANGED' then
NP:Move_TargetClassPower(nameplate)
if nameplate then
local OccludedAlpha = GetCVar('nameplateMaxAlpha') * GetCVar('nameplateOccludedAlphaMult')
local Alpha = NP.db.units.TARGET.nonTargetTransparency
for plate in pairs(NP.Plates) do
if plate:GetParent():GetAlpha() == OccludedAlpha then
Alpha = OccludedAlpha
end
if plate.frameType == 'PLAYER' then
Alpha = 1
end
plate:SetAlpha(Alpha)
end
nameplate:SetAlpha(1)
else
for plate in pairs(NP.Plates) do
plate:SetAlpha(1)
end
end
end
end
......@@ -462,6 +493,7 @@ end
NP.plateEvents = {
['PLAYER_TARGET_CHANGED'] = function(self)
self.isTarget = self.unit and UnitIsUnit(self.unit, 'target') or nil
NP:HandleTargetAlpha(self)
end,
['UNIT_TARGET'] = function(self, _, unit)
unit = unit or self.unit
......@@ -553,8 +585,7 @@ function NP:Initialize()
_G.ElvNP_TargetClassPower:Size(NP.db.clickableWidth, NP.db.clickableHeight)
_G.ElvNP_TargetClassPower.frameType = 'TARGET'
_G.ElvNP_TargetClassPower:SetAttribute('toggleForVehicle', true)
_G.ElvNP_TargetClassPower:SetAlpha(0)
_G.ElvNP_TargetClassPower:EnableMouse(false)
_G.ElvNP_TargetClassPower:Point('TOP', E.UIParent, 'BOTTOM', 0, -500)
local NamePlatesCVars = {
['nameplateClassResourceTopInset'] = GetCVarDefault('nameplateClassResourceTopInset'),
......
......@@ -4,7 +4,6 @@ local S = E:GetModule('Skins')
--Lua functions
local _G = _G
--WoW API / Variables
local unpack = unpack
local hooksecurefunc = hooksecurefunc
local FrameTexs = {
......
......@@ -140,6 +140,10 @@ local function LoadSkin()
_G.LFGDungeonReadyDialogRoleIconTexture:SetTexture("Interface\\LFGFrame\\UI-LFG-ICONS-ROLEBACKGROUNDS")
_G.LFGDungeonReadyDialogRoleIconTexture:SetAlpha(0.5)
hooksecurefunc(_G.LFGDungeonReadyDialog, "SetBackdrop", function(frame, backdrop)
if backdrop ~= nil then frame:SetBackdrop(nil) end
end)
hooksecurefunc("LFGDungeonReadyPopup_Update", function()
local _, _, _, _, _, _, role = GetLFGProposal()
if _G.LFGDungeonReadyDialogRoleIcon:IsShown() then
......
......@@ -24,7 +24,6 @@ local function LoadSkin()
-- Skin Blizzard Tooltips
local GameTooltip = _G.GameTooltip
local EmbeddedItemTooltip = _G.EmbeddedItemTooltip
local StoryTooltip = _G.QuestScrollFrame.StoryTooltip
StoryTooltip:SetFrameLevel(4)
......@@ -74,12 +73,12 @@ local function LoadSkin()
end
-- Skin GameTooltip Status Bar
GameTooltipStatusBar:SetStatusBarTexture(E.media.normTex)
E:RegisterStatusBar(GameTooltipStatusBar)
GameTooltipStatusBar:CreateBackdrop('Transparent')
GameTooltipStatusBar:ClearAllPoints()
GameTooltipStatusBar:Point("TOPLEFT", GameTooltip, "BOTTOMLEFT", E.Border, -(E.Spacing * 3))
GameTooltipStatusBar:Point("TOPRIGHT", GameTooltip, "BOTTOMRIGHT", -E.Border, -(E.Spacing * 3))
_G.GameTooltipStatusBar:SetStatusBarTexture(E.media.normTex)
E:RegisterStatusBar(_G.GameTooltipStatusBar)
_G.GameTooltipStatusBar:CreateBackdrop('Transparent')
_G.GameTooltipStatusBar:ClearAllPoints()
_G.GameTooltipStatusBar:Point("TOPLEFT", GameTooltip, "BOTTOMLEFT", E.Border, -(E.Spacing * 3))
_G.GameTooltipStatusBar:Point("TOPRIGHT", GameTooltip, "BOTTOMRIGHT", -E.Border, -(E.Spacing * 3))
TT:SecureHook('GameTooltip_ShowStatusBar') -- Skin Status Bars
TT:SecureHook('GameTooltip_ShowProgressBar') -- Skin Progress Bars
......
......@@ -3,7 +3,7 @@ local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, Private
--Global Settings
G.general = {
UIScale = 0.64,
version = 11.05,
version = 11.06,
eyefinity = false,
smallerWorldMap = true,
smallerWorldMapScale = 0.9,
......@@ -17,9 +17,7 @@ G.general = {
},
AceGUI = {
width = 1000,
height = 720,
left = nil,
top = nil
height = 720
},
disableTutorialButtons = true,
showMissingTalentAlert = false,
......
......@@ -1247,7 +1247,7 @@ P.nameplates = {
yOffset = 0,
},
questIcon = {
enable = false,
enable = true,
position = 'RIGHT',
size = 16,
xOffset = 0,
......@@ -1445,7 +1445,7 @@ P.nameplates = {
yOffset = 0,
},
questIcon = {
enable = false,
enable = true,
position = 'RIGHT',
size = 16,
xOffset = 0,
......
......@@ -28,6 +28,7 @@ local GetAddOnInfo = GetAddOnInfo
local GetAddOnMetadata = GetAddOnMetadata
local GetTime = GetTime
local HideUIPanel = HideUIPanel
local GetAddOnEnableState = GetAddOnEnableState
local InCombatLockdown = InCombatLockdown
local IsAddOnLoaded = IsAddOnLoaded
local LoadAddOn = LoadAddOn
......@@ -244,13 +245,13 @@ function AddOn:OnProfileReset()
self:StaticPopup_Show("RESET_PROFILE_PROMPT")
end
function AddOn:ResetConfigSettings()
AddOn.configSavedPositionTop, AddOn.configSavedPositionLeft = nil, nil
AddOn.global.general.AceGUI = AddOn:CopyTable({}, AddOn.DF.global.general.AceGUI)
end
function AddOn:GetConfigPosition()
return AddOn.global.general.AceGUI.top, AddOn.global.general.AceGUI.left
return AddOn.configSavedPositionTop, AddOn.configSavedPositionLeft
end
function AddOn:GetConfigSize()
......@@ -266,7 +267,7 @@ end
function AddOn:ConfigStopMovingOrSizing()
if self.obj and self.obj.status then
AddOn.global.general.AceGUI.top, AddOn.global.general.AceGUI.left = AddOn:Round(self:GetTop(), 2), AddOn:Round(self:GetLeft(), 2)
AddOn.configSavedPositionTop, AddOn.configSavedPositionLeft = AddOn:Round(self:GetTop(), 2), AddOn:Round(self:GetLeft(), 2)
AddOn.global.general.AceGUI.width, AddOn.global.general.AceGUI.height = AddOn:Round(self:GetWidth(), 2), AddOn:Round(self:GetHeight(), 2)
end
end
......@@ -363,7 +364,6 @@ function AddOn:ToggleConfig(msg)
_G.ElvUIGUIFrame = self.GUIFrame
local maxWidth, maxHeight = self.UIParent:GetSize()
frame:SetClampedToScreen(true)
frame:SetMinResize(600, 500)
frame:SetMaxResize(maxWidth-50, maxHeight-50)
......
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