Skip to content

Commit

Permalink
Classic: TOC Update
Browse files Browse the repository at this point in the history
Classic: Added Naxxramas Raid Debuffs
Retail:  Added Shadowlands dungeon&raid debuffs
Some improvements in raiddebuffs code, now spires of ascension dungeon is detected correctly.
Heal Status: Added UNIT_CONNECTION event trying to fix ticket #907.
Fixing shadowlands bug, when entering Maw zone layout was not visible (ticket #901)
Fixing options crash with some debuffs due to a tooltip parsing bug (ticket #900).
Shadowlands TOC Update
Added RaidDebuffsModule for Shadowlands (only instances and bosses, not debuffs yet).
Fixing a bug in icons indicator font change option (Ticket #893)
Added an option to Hide Player when in group in layout editor (ticket #890)
Added an option to display squares in icons indicators (ticket #888)
Refactored RightClickPopupMenu Code, now the focus can be set using Grid2 RightClickMenu.
Added maxhealth event to death status.
Added some new exceptions to indicators names blacklist, see ticket (#882)
Now Clean Database Profile button renames indicators with an invalid name.
Retail TOC Update
Disabled animations for square indicator (a shape indicator can be used instead).
Minor bugs fixes.
Removed animation options for text indicators.
Added shape indicator to morph list.
Updated shape icon.
Optimizations and fixing some bugs in the new blink/animation code.
Shape indicator bug fixes.
IndicatorIcons and IndicatorMultibar fix of ancient bug.
Refactored blink and zoom in/out animations code.
Added textures for the new shape indicator.
Added a new "Shape" Indicator: this indicator displays simple shapes (not only squares) like circles, triangles, etc.
Some reactoring of the frames backdrops creation code in indicators.
Refactored colors management code in options.
Fixing some unlocalized strings (ticket #870).
Classic: AOE heals status: removed raid cooldowns, and a lot of invalid aoe heals (ticket #869).
Fixing some unlocalized strings (ticket #868)
ReadCheck status: Some refactoring.
Icons Indicator: added sanity check to color alpha component (ticket #866).
Icon Indicator: Now cooldown background in flat textures are darker.
Role Status: GetColor now always returns a valid color.
  • Loading branch information
michaelnpsp committed Dec 5, 2020
1 parent 5bb645a commit bd721ac
Show file tree
Hide file tree
Showing 61 changed files with 1,514 additions and 701 deletions.
2 changes: 2 additions & 0 deletions .pkgmeta-classic
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ externals:
Options/Libs/AceSerializer-3.0: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceSerializer-3.0
Options/Libs/LibCompress: svn://svn.wowace.com/wow/libcompress/mainline/trunk
LDB/Libs/LibDBIcon-1.0: svn://svn.wowace.com/wow/libdbicon-1-0/mainline/trunk/LibDBIcon-1.0/
LDB/Libs/LibDataBroker-1.1: https://github.com/tekkub/libdatabroker-1-1

ignore:
- GridDefaultsRetail.lua
Expand All @@ -29,6 +30,7 @@ ignore:
- modules/StatusPhased.lua
- RaidDebuffsOptions/RaidDebuffsBfA.lua
- RaidDebuffsOptions/RaidDebuffsLegion.lua
- RaidDebuffsOptions/RaidDebuffsShadowlands.lua

move-folders:
Grid2/Options: Grid2Options
Expand Down
1 change: 1 addition & 0 deletions .pkgmeta-retail
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ externals:
Options/Libs/AceSerializer-3.0: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceSerializer-3.0
Options/Libs/LibCompress: svn://svn.wowace.com/wow/libcompress/mainline/trunk
LDB/Libs/LibDBIcon-1.0: svn://svn.wowace.com/wow/libdbicon-1-0/mainline/trunk/LibDBIcon-1.0/
LDB/Libs/LibDataBroker-1.1: https://github.com/tekkub/libdatabroker-1-1

ignore:
- GridDefaultsClassic.lua
Expand Down
6 changes: 4 additions & 2 deletions Grid2.toc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#@retail@
## Interface: 80300
## Interface: 90002
## X-WoW-Project: retail
#@end-retail@
#@non-retail@
# ## Interface: 11305
# ## Interface: 11306
## X-WoW-Project: classic
#@end-non-retail@
## Title: Grid2
Expand Down Expand Up @@ -47,6 +47,7 @@ GridFrame.lua
GridLayout.lua
GridLayoutLayouts.lua
GridIndicator.lua
GridIndicatorEffects.lua
GridStatus.lua
GridSetup.lua
GridDefaults.lua
Expand All @@ -69,6 +70,7 @@ modules\IndicatorIcons.lua
modules\IndicatorSquare.lua
modules\IndicatorTooltip.lua
modules\IndicatorPortrait.lua
modules\IndicatorShape.lua

# Statuses
modules\StatusHealth.lua
Expand Down
67 changes: 0 additions & 67 deletions GridFrame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,29 +30,6 @@ function Grid2:GetUnitFrames(unit)
end
--}}}

--{{{ Dropdown menu management
local ToggleUnitMenu
do
local frame, unit = CreateFrame("Frame","Grid2_UnitFrame_DropDown",UIParent,"UIDropDownMenuTemplate")
UIDropDownMenu_Initialize(frame, function()
if unit then
local menu,raid
if UnitIsUnit(unit, "player") then menu = "SELF"
elseif UnitIsUnit(unit, "pet") then menu = "PET"
elseif Grid2:UnitIsPet(unit) then menu = "RAID_TARGET_ICON"
elseif Grid2:UnitIsParty(unit) then menu = "PARTY"
elseif Grid2:UnitIsRaid(unit) then menu,raid = "RAID_PLAYER", UnitInRaid(unit)
else return end
UnitPopup_ShowMenu(frame, menu, unit, nil, raid)
end
end, "MENU")
ToggleUnitMenu = function(self)
unit = self.unit
ToggleDropDownMenu(1, nil, frame, "cursor")
end
end
--}}}

-- {{ Precalculated backdrop table, shared by all frames
local frameBackdrop
-- }}
Expand Down Expand Up @@ -226,8 +203,6 @@ function Grid2Frame:OnModuleEnable()
end
self:RegisterEvent("PLAYER_ENTERING_WORLD", "UpdateFrameUnits")
self:RegisterMessage("Grid_UnitUpdate")
self:UpdateMenu()
self:UpdateBlink()
self:CreateIndicators()
self:RefreshIndicators()
self:LayoutFrames()
Expand All @@ -245,8 +220,6 @@ function Grid2Frame:OnModuleDisable()
end

function Grid2Frame:OnModuleUpdate()
self:UpdateMenu()
self:UpdateBlink()
self:CreateIndicators()
self:RefreshTheme()
end
Expand Down Expand Up @@ -344,46 +317,6 @@ do
end
end

-- Frames blink animations management
do
local blinkDuration
function Grid2Frame:SetBlinkEffect(frame, enabled)
local anim = frame.blinkAnim
if enabled then
if not anim then
anim = frame:CreateAnimationGroup()
local alpha = anim:CreateAnimation("Alpha")
alpha:SetOrder(1)
alpha:SetFromAlpha(1)
alpha:SetToAlpha(0.1)
anim:SetLooping("REPEAT")
anim.alpha = alpha
frame.blinkAnim = anim
end
if not anim:IsPlaying() then
anim.alpha:SetDuration(blinkDuration)
anim:Play()
end
elseif anim then
anim:Stop()
end
end
function Grid2Frame:UpdateBlink()
local indicator = Grid2.indicatorPrototype
indicator.Update = self.db.shared.blinkType~="None" and indicator.UpdateBlink or indicator.UpdateNoBlink
blinkDuration = 1/self.db.shared.blinkFrequency
end
end

-- Right Click Menu & Click Options
function Grid2Frame:UpdateMenu()
local menu = not self.db.profile.menuDisabled and ToggleUnitMenu or nil
if menu~=self.RightClickUnitMenu then
self.RightClickUnitMenu = menu
self:WithAllFrames( function(f) f.menu = menu end )
end
end

-- Alow other modules to hook unit frames OnEnter, OnExit events
function Grid2Frame:SetEventHook( event, func, enabled )
eventHooks[event][func] = enabled or nil
Expand Down
32 changes: 14 additions & 18 deletions GridIndicator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,29 @@ function indicator:new(name)
e.priorities = p
e.name = name
e.statuses = {}
e.prototype = self
return e
end

function indicator:CreateFrame(type, parent)
function indicator:CreateFrame(type, parent, template)
local f = parent[self.name]
if not (f and f:GetObjectType()==type) then
f = CreateFrame(type, nil, parent, (isWoW90 and type=='Frame') and "BackdropTemplate" or nil )
if not (f and f:GetObjectType()==type and f.__template == template) then
f = CreateFrame(type, nil, parent, (isWoW90 or template~="BackdropTemplate") and template or nil)
f.__template = template
parent[self.name] = f
end
f:Hide()
return f
end

function indicator:Update(parent, unit)
self:OnUpdate(parent, unit, self:GetCurrentStatus(unit) )
end

function indicator:UpdateDB()
if self.LoadDB then self:LoadDB() end
end

function indicator:RegisterStatus(status, priority)
if self.priorities[status] then return end
self.statuses[#self.statuses + 1] = status
Expand Down Expand Up @@ -90,21 +100,6 @@ function indicator:GetCurrentStatus(unit)
end
end

--{{ Update functions
function indicator:UpdateBlink(parent, unit)
local status, state = self:GetCurrentStatus(unit)
local func = self.GetBlinkFrame
if func then Grid2Frame:SetBlinkEffect( func(self,parent) , state=="blink" ) end
self:OnUpdate(parent, unit, status)
end

function indicator:UpdateNoBlink(parent, unit)
self:OnUpdate(parent, unit, self:GetCurrentStatus(unit) )
end

indicator.Update = indicator.UpdateBlink
--}}

function Grid2:WakeUpIndicator(indicator)
local statuses = indicator.statuses
for i=1,#statuses do
Expand Down Expand Up @@ -160,6 +155,7 @@ function Grid2:RegisterIndicator(indicator, types)
end
t[name] = indicator
end
indicator:UpdateDB()
end

function Grid2:UnregisterIndicator(indicator)
Expand Down
93 changes: 93 additions & 0 deletions GridIndicatorEffects.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
-- Implements blink and zoom in/out effects for indicators.

local indicatorPrototype = Grid2.indicatorPrototype

-- Zoom in/out effect, not using animation BOUNCE looping method because is bugged (generate glitches)
local function CreateScaleAnimation(frame, dbx)
local scale = dbx.animScale or 1.5
local durat = (dbx.animDuration or 0.7) / 2
local origin = dbx.animOrigin or 'CENTER'
local group = frame:CreateAnimationGroup()
local grow = group:CreateAnimation("Scale")
local shrink = group:CreateAnimation("Scale")
grow:SetOrder(1)
grow:SetOrigin(origin,0,0)
grow:SetScale(scale,scale)
grow:SetDuration(durat)
shrink:SetOrder(2)
shrink:SetOrigin(origin,0,0)
shrink:SetScale(1/scale,1/scale)
shrink:SetDuration(durat)
frame.scaleAnim, group.grow, group.shrink = group, grow, shrink
return group
end

local function SetScaleEffect(indicator, frame, status)
local anim = frame.scaleAnim
if status then
if not (anim and anim:IsPlaying()) and not (indicator.dbx.animOnEnabled and frame:IsVisible()) then
(anim or CreateScaleAnimation(frame, indicator.dbx)):Play()
end
elseif anim then
anim:Stop()
end
end

-- Blink effect
local function CreateBlinkAnimation(frame, dbx)
local anim = frame:CreateAnimationGroup()
local alpha = anim:CreateAnimation("Alpha")
anim:SetLooping("REPEAT")
alpha:SetOrder(1)
alpha:SetFromAlpha(1)
alpha:SetToAlpha(0.1)
alpha:SetDuration(1/dbx.blinkFrequency)
frame.blinkAnim = anim
return anim
end

local function SetBlinkEffect(indicator, frame, enabled)
local anim = frame.blinkAnim
if enabled then
(anim or CreateBlinkAnimation(frame,Grid2Frame.db.shared)):Play()
elseif anim then
anim:Stop()
end
end

-- Indicator Update functions
local function UpdateBlinkScale(self, parent, unit)
local status, state = self:GetCurrentStatus(unit)
local frame = self.GetBlinkFrame(self,parent)
SetBlinkEffect( self, frame, state=="blink" )
SetScaleEffect( self, frame, status )
self:OnUpdate(parent, unit, status)
end

local function UpdateScale(self, parent, unit)
local status, state = self:GetCurrentStatus(unit)
SetScaleEffect( self, self.GetBlinkFrame(self,parent), status )
self:OnUpdate(parent, unit, status)
end

local function UpdateBlink(self, parent, unit)
local status, state = self:GetCurrentStatus(unit)
SetBlinkEffect( self, self.GetBlinkFrame(self,parent), state=="blink" )
self:OnUpdate(parent, unit, status)
end

-- Public method (overwriting the original UpdateDB defined in GridIndicator.lua)
function indicatorPrototype:UpdateDB()
if self.LoadDB then
self:LoadDB()
end
if self.GetBlinkFrame then
if Grid2Frame.db.shared.blinkType~="None" then
self.Update = self.dbx.animEnabled and UpdateBlinkScale or UpdateBlink
else
self.Update = self.dbx.animEnabled and UpdateScale or indicatorPrototype.Update
end
elseif not rawget(self, "Update") then
self.Update = indicatorPrototype.Update -- speed optimization
end
end
Loading

0 comments on commit bd721ac

Please sign in to comment.