diff --git a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_ActionPanel/oUF_ActionPanel.lua b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_ActionPanel/oUF_ActionPanel.lua index 5fd290f..152be6c 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_ActionPanel/oUF_ActionPanel.lua +++ b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_ActionPanel/oUF_ActionPanel.lua @@ -74,6 +74,7 @@ local Enable = function(self, unit) local status = self.StatusPanel if(status and status.texture) then self:RegisterEvent('UNIT_FLAGS', Path) + self:RegisterEvent('UNIT_FACTION', Path) end self:RegisterEvent("UNIT_TARGET", Path, true) self:RegisterEvent("PLAYER_TARGET_CHANGED", Path, true) @@ -89,6 +90,9 @@ local Disable = function(self) if(self:IsEventRegistered("UNIT_FLAGS")) then self:UnregisterEvent("UNIT_FLAGS", Path) end + if(self:IsEventRegistered("UNIT_FACTION")) then + self:UnregisterEvent("UNIT_FACTION", Path) + end end if(self:IsEventRegistered("PLAYER_TARGET_CHANGED")) then self:UnregisterEvent("PLAYER_TARGET_CHANGED", Path) diff --git a/Interface/AddOns/SVUI/packages/actionbar/SVBar.lua b/Interface/AddOns/SVUI/packages/actionbar/SVBar.lua index 426c3a1..8a3d56e 100644 --- a/Interface/AddOns/SVUI/packages/actionbar/SVBar.lua +++ b/Interface/AddOns/SVUI/packages/actionbar/SVBar.lua @@ -981,7 +981,7 @@ do end function MOD:RefreshActionBars() - if InCombatLockdown() then return end + if(InCombatLockdown()) then self:RegisterEvent("PLAYER_REGEN_ENABLED"); return end self:UpdateBarPagingDefaults() for button, _ in pairs(self.Storage.Cache)do if button then @@ -1002,7 +1002,7 @@ function MOD:RefreshActionBars() self:RefreshBar("Stance") self:UpdateBarBindings(true, true) for barID, stored in pairs(self.Storage)do - if barID ~= "Pet" and barID ~= "Stance" then + if(barID ~= "Pet" and barID ~= "Stance" and barID ~= "Cache") then self:SetBarConfigData(barID) end end @@ -1620,7 +1620,12 @@ local function RemoveDefaults() else hooksecurefunc("TalentFrame_LoadUI", function() PlayerTalentFrame:UnregisterEvent("ACTIVE_TALENT_GROUP_CHANGED") end) end -end +end + +function MOD:PLAYER_REGEN_ENABLED() + self:UnregisterEvent("PLAYER_REGEN_ENABLED") + self:RefreshActionBars() +end --[[ ########################################################## BUILD FUNCTION / UPDATE @@ -1633,10 +1638,11 @@ function MOD:ReLoad() end function MOD:Load() - if not SuperVillain.db.SVBar.enable then return end + if not self.db.enable then return end RemoveDefaults(); - self:Protect("RefreshActionBars"); - self:UpdateBarPagingDefaults(); + + self:UpdateBarPagingDefaults() + CreateActionBars(self) CreateStanceBar(self) CreatePetBar(self) @@ -1659,7 +1665,8 @@ function MOD:Load() NewHook("ActionButton_ShowOverlayGlow", SVUIButton_ShowOverlayGlow) if not GetCVarBool("lockActionBars") then SetCVar("lockActionBars", 1) end SetSpellFlyoutHook() - MOD.IsLoaded = true + + self.IsLoaded = true end SuperVillain.Registry:NewPackage(MOD, "SVBar") \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/bag/SVBag.lua b/Interface/AddOns/SVUI/packages/bag/SVBag.lua index 4a7f4bc..e3efd4b 100644 --- a/Interface/AddOns/SVUI/packages/bag/SVBag.lua +++ b/Interface/AddOns/SVUI/packages/bag/SVBag.lua @@ -1332,7 +1332,6 @@ function MOD:Load() self:ModifyBags() self:Layout(false) self:DisableBlizzard() - self:Protect("BreakStuffLoader"); SuperVillain:ExecuteTimer(MOD.BreakStuffLoader, 5) self:RegisterEvent("INVENTORY_SEARCH_UPDATE") self:RegisterEvent("PLAYER_MONEY", "UpdateGoldText") diff --git a/Interface/AddOns/SVUI/packages/bag/common/breakstuff.lua b/Interface/AddOns/SVUI/packages/bag/common/breakstuff.lua index 2f48f1e..af612af 100644 --- a/Interface/AddOns/SVUI/packages/bag/common/breakstuff.lua +++ b/Interface/AddOns/SVUI/packages/bag/common/breakstuff.lua @@ -210,7 +210,13 @@ function BreakStuffHandler:PLAYER_REGEN_ENABLED() BreakStuff_OnModifier(self) end +function MOD:PLAYER_REGEN_ENABLED() + self:UnregisterEvent('PLAYER_REGEN_ENABLED') + self:BreakStuffLoader() +end + function MOD:BreakStuffLoader() + if(InCombatLockdown()) then self:RegisterEvent("PLAYER_REGEN_ENABLED"); return end local allowed, spellListing, spellName, _ = false, {}; if(IsSpellKnown(51005)) then diff --git a/Interface/AddOns/SVUI/packages/dock/SVDock.lua b/Interface/AddOns/SVUI/packages/dock/SVDock.lua index b51ba26..cedd5c6 100644 --- a/Interface/AddOns/SVUI/packages/dock/SVDock.lua +++ b/Interface/AddOns/SVUI/packages/dock/SVDock.lua @@ -709,6 +709,7 @@ do function MOD:LoadToolBarProfessions() if(MOD.ToolBarLoaded) then return end + if(InCombatLockdown()) then self:RegisterEvent("PLAYER_REGEN_ENABLED"); return end local size = SuperDockMacroBar.currentSize local hearth = CreateFrame("Button", "RightSuperDockHearthButton", SuperDockMacroBar, "SecureActionButtonTemplate") hearth:Size(size, size) @@ -996,6 +997,11 @@ function MOD:TopPanelVisibility() end end +function MOD:PLAYER_REGEN_ENABLED() + self:UnregisterEvent('PLAYER_REGEN_ENABLED') + self:LoadToolBarProfessions() +end + function MOD:ReLoad() self:UpdateSuperDock(); end @@ -1038,9 +1044,7 @@ function MOD:Load() SuperDockletExtra:SetScript('OnShow', DockletFrame_OnShow) SuperVillain:ReloadDocklets(true) - - self:Protect("LoadToolBarProfessions") - SuperVillain:ExecuteTimer(MOD.LoadToolBarProfessions, 5) + SuperVillain:ExecuteTimer(self.LoadToolBarProfessions, 5) end SuperVillain.Registry:NewPackage(MOD, "SVDock") \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua b/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua index 2f9e1ca..22fb375 100644 --- a/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua +++ b/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua @@ -949,4 +949,4 @@ function MOD:Load() end end -SuperVillain.Registry:NewPackage(MOD, "SVHenchmen", "post") \ No newline at end of file +SuperVillain.Registry:NewPackage(MOD, "SVHenchmen") \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/laborer/SVLaborer.lua b/Interface/AddOns/SVUI/packages/laborer/SVLaborer.lua index 0791a22..bf6335c 100644 --- a/Interface/AddOns/SVUI/packages/laborer/SVLaborer.lua +++ b/Interface/AddOns/SVUI/packages/laborer/SVLaborer.lua @@ -133,6 +133,7 @@ function MOD:LaborerReset() self.TitleWindow:AddMessage("Laborer Modes", 1, 1, 0); self.LogWindow:AddMessage("Select a Tool to Begin", 1, 1, 1); self.LogWindow:AddMessage(" ", 0, 1, 1); + collectgarbage("collect") end function MOD:ModeLootLoader(mode, msg, info) @@ -347,6 +348,10 @@ local ModeAlert_OnLeave = function(self) end local ModeAlert_OnHide = function() + if InCombatLockdown() then + SuperVillain:AddonMessage(ERR_NOT_IN_COMBAT); + return; + end SuperDockAlertRight:Deactivate() end diff --git a/Interface/AddOns/SVUI/packages/laborer/common/farming.lua b/Interface/AddOns/SVUI/packages/laborer/common/farming.lua index 5293188..7569b7d 100644 --- a/Interface/AddOns/SVUI/packages/laborer/common/farming.lua +++ b/Interface/AddOns/SVUI/packages/laborer/common/farming.lua @@ -159,7 +159,7 @@ do end end; - function InventoryUpdate() + InventoryUpdate = function() if InCombatLockdown() then FarmEventHandler:RegisterEvent("PLAYER_REGEN_ENABLED", InventoryUpdate) return @@ -181,12 +181,12 @@ do MOD:RefreshFarmingTools() end - function EnableListener() + EnableListener = function() FarmEventHandler:RegisterEvent("ZONE_CHANGED") FarmEventHandler:SetScript("OnEvent", Farm_OnEvent) end - function DisableListener() + DisableListener = function() FarmEventHandler:UnregisterAllEvents() FarmEventHandler:SetScript("OnEvent", nil) end @@ -287,7 +287,7 @@ do if select(2, GetItemInfo(k)) == nil then itemError = true end end if InCombatLockdown() or itemError then - SuperVillain:ExecuteTimer(LoadFarmingModeTools, 1) + SuperVillain:ExecuteTimer(LoadFarmingModeTools, 5) else local horizontal = MOD.db.farming.toolbardirection == 'HORIZONTAL' @@ -334,7 +334,7 @@ do end MOD.Farming.Loaded = true - MOD.Farming:Enable() + SuperVillain:ExecuteTimer(MOD.Farming.Enable, 1.5) end end end @@ -354,19 +354,19 @@ function MOD.Farming:Enable() MOD.TitleWindow:Clear() if(not MOD.Farming.Loaded) then - MOD.TitleWindow:AddMessage("|cff22ff11Farming Mode|r") + MOD.TitleWindow:AddMessage("|cffffff11Loading Farm Tools...|r") LoadFarmingModeTools() return else if not MOD.Farming.ToolsLoaded then - if not FarmModeFrame:IsShown() then FarmModeFrame:Show() end - if(not SVUI_ModesDockFrame:IsShown()) then DockButton:Click() end PlaySoundFile("Sound\\Effects\\DeathImpacts\\mDeathImpactColossalDirtA.wav") - MOD.TitleWindow:AddMessage("|cffffff11Loading Farm Tools...|r") + MOD.TitleWindow:AddMessage("|cff22ff11Farming Mode|r") MOD.ModeAlert:Show() - SuperVillain:ExecuteTimer(InventoryUpdate, 1) + InventoryUpdate() MOD.Farming.ToolsLoaded = true EnableListener() + if not FarmModeFrame:IsShown() then FarmModeFrame:Show() end + if(not SVUI_ModesDockFrame:IsShown()) then DockButton:Click() end end end end diff --git a/Interface/AddOns/SVUI/packages/map/SVMap.lua b/Interface/AddOns/SVUI/packages/map/SVMap.lua index e9d8f95..8337b6d 100644 --- a/Interface/AddOns/SVUI/packages/map/SVMap.lua +++ b/Interface/AddOns/SVUI/packages/map/SVMap.lua @@ -431,6 +431,7 @@ local ResetDropDownList_Hook = function(self) end local WorldMapFrameOnShow_Hook = function() + MOD:RegisterEvent("PLAYER_REGEN_DISABLED"); if InCombatLockdown()then return end if(not SuperVillain.db.SVMap.tinyWorldMap and not Initialized) then WorldMap_ToggleSizeUp() @@ -438,6 +439,10 @@ local WorldMapFrameOnShow_Hook = function() end AdjustMapLevel() end + +local WorldMapFrameOnHide_Hook = function() + MOD:UnregisterEvent("PLAYER_REGEN_DISABLED") +end --[[ ########################################################## CORE FUNCTIONS @@ -561,6 +566,10 @@ local function UpdateSizing() end; function MOD:RefreshMiniMap() + if(InCombatLockdown()) then + self.CombatLocked = true + return + end UpdateSizing() if(SVUI_MinimapFrame and SVUI_MinimapFrame:IsShown()) then --local minimapRotationEnabled = GetCVar("rotateMinimap") ~= "0" @@ -645,7 +654,10 @@ local function CreateMiniMapElements() border.bottom:SetPoint("BOTTOMRIGHT") border.bottom:SetHeight(1) - MOD:RefreshMiniMap() + -- MOD:RefreshMiniMap() + if TimeManagerClockButton then + TimeManagerClockButton:MUNG() + end Minimap:SetQuestBlobRingAlpha(0) Minimap:SetArchBlobRingAlpha(0) @@ -737,6 +749,8 @@ local function CreateMiniMapElements() end PetJournalParent:SetAttribute("UIPanelLayout-defined", true); SuperVillain:SetSVMovable(SVUI_MinimapFrame, L["Minimap"]) + + MOD:RefreshMiniMap() end local function LoadWorldMap() @@ -753,11 +767,9 @@ local function LoadWorldMap() WorldMapDetailFrame:SetFrameLevel(6) WorldMapFrame:HookScript('OnShow', WorldMapFrameOnShow_Hook) + WorldMapFrame:HookScript('OnHide', WorldMapFrameOnHide_Hook) WorldMapZoneDropDownButton:HookScript('OnClick', ResetDropDownList_Hook) - MOD:RegisterEvent('PLAYER_REGEN_ENABLED') - MOD:RegisterEvent('PLAYER_REGEN_DISABLED') - local CoordsHolder = CreateFrame('Frame', 'SVUI_WorldMapCoords', WorldMapFrame) CoordsHolder:SetFrameLevel(WorldMapDetailFrame:GetFrameLevel()+1) CoordsHolder:SetFrameStrata(WorldMapDetailFrame:GetFrameStrata()) @@ -795,9 +807,14 @@ function MOD:ADDON_LOADED(event, addon) end function MOD:PLAYER_REGEN_ENABLED() - self:UnregisterEvent('PLAYER_REGEN_ENABLED') - WorldMapFrameSizeDownButton:Enable() - WorldMapFrameSizeUpButton:Enable() + if(WorldMapFrame:IsShown()) then + WorldMapFrameSizeDownButton:Enable() + WorldMapFrameSizeUpButton:Enable() + end + if(self.CombatLocked) then + self:RefreshMiniMap() + self.CombatLocked = nil + end end function MOD:PLAYER_REGEN_DISABLED() @@ -819,11 +836,12 @@ function MOD:Load() Minimap:SetMaskTexture('Textures\\MinimapMask') return end - self:Protect("RefreshMiniMap") CreateMiniMapElements() self:RegisterEvent("PLAYER_ENTERING_WORLD", UpdateMinimapLocation) + self:RegisterEvent('PLAYER_REGEN_ENABLED') + self:RegisterEvent('PLAYER_REGEN_DISABLED') self:RegisterEvent("ZONE_CHANGED_NEW_AREA", UpdateMinimapLocation) self:RegisterEvent("ZONE_CHANGED", UpdateMinimapLocation) self:RegisterEvent("ZONE_CHANGED_INDOORS", UpdateMinimapLocation) diff --git a/Interface/AddOns/SVUI/packages/unit/SVUnit.lua b/Interface/AddOns/SVUI/packages/unit/SVUnit.lua index 2359bcf..5905ef2 100644 --- a/Interface/AddOns/SVUI/packages/unit/SVUnit.lua +++ b/Interface/AddOns/SVUI/packages/unit/SVUnit.lua @@ -319,7 +319,8 @@ function MOD:RefreshAllUnitMedia() end function MOD:RefreshUnitFrames() - if SuperVillain.db['SVUnit'].enable~=true then return end + if(InCombatLockdown()) then self:RegisterEvent("PLAYER_REGEN_ENABLED", "RefreshUnitFrames"); return end + if(not self.db.enable) then return end self:RefreshUnitColors() for unit,frame in pairs(self.Units)do if self.db[frame.___key].enable then @@ -349,6 +350,7 @@ function MOD:RefreshUnitFrames() oUF_SuperVillain:DisableBlizzard('party') end collectgarbage("collect") + self:UnregisterEvent("PLAYER_REGEN_ENABLED"); end function MOD:RefreshUnitMedia(unitName) @@ -1240,7 +1242,6 @@ function MOD:FrameForge() self:SetEnemyFrames("arena", 5) LoadedUnitFrames = true; end - if not LoadedGroupHeaders then self:SetGroupFrame("raid10") self:SetGroupFrame("raid25") @@ -1251,12 +1252,10 @@ function MOD:FrameForge() self:SetGroupFrame("assist", "MAINASSIST", "SVUI_UNITTARGET") LoadedGroupHeaders = true end - - self:UnProtect("FrameForge"); - self:Protect("RefreshUnitFrames"); end function MOD:KillBlizzardRaidFrames() + if InCombatLockdown()then return end CompactRaidFrameManager:MUNG() CompactRaidFrameContainer:MUNG() CompactUnitFrameProfiles:MUNG() @@ -1280,6 +1279,11 @@ function MOD:PLAYER_REGEN_DISABLED() end end +function MOD:PLAYER_REGEN_ENABLED() + self:RefreshUnitFrames() + self:UnregisterEvent("PLAYER_REGEN_ENABLED"); +end + function MOD:ADDON_LOADED(event, addon) if addon ~= 'Blizzard_ArenaUI' then return end oUF_SuperVillain:DisableBlizzard('arena') @@ -1310,12 +1314,12 @@ function MOD:Load() local SVUI_UnitFrameParent = CreateFrame("Frame", "SVUI_UnitFrameParent", SuperVillain.UIParent, "SecureHandlerStateTemplate") RegisterStateDriver(SVUI_UnitFrameParent, "visibility", "[petbattle] hide; show") - self:Protect("FrameForge", true) + self:FrameForge() self:RegisterEvent("PLAYER_ENTERING_WORLD") self:RegisterEvent("PLAYER_REGEN_DISABLED") if(self.db.disableBlizzard) then - self:Protect("KillBlizzardRaidFrames", true); + self:KillBlizzardRaidFrames() NewHook("CompactUnitFrame_RegisterEvents", CompactUnitFrame_UnregisterEvents) NewHook("UnitFrameThreatIndicator_Initialize", UnitFrameThreatIndicator_Hook) diff --git a/Interface/AddOns/SVUI/packages/unit/class/druid.lua b/Interface/AddOns/SVUI/packages/unit/class/druid.lua index c33147b..7730d2c 100644 --- a/Interface/AddOns/SVUI/packages/unit/class/druid.lua +++ b/Interface/AddOns/SVUI/packages/unit/class/druid.lua @@ -71,8 +71,9 @@ end local function CreateAltMana(playerFrame, eclipse) local bar = CreateFrame("Frame", nil, playerFrame) bar:SetFrameStrata("LOW") - bar:SetPoint("TOPLEFT", eclipse, "TOPLEFT", 38, 0) - bar:SetPoint("BOTTOMRIGHT", eclipse, "BOTTOMRIGHT", 0, 0) + bar:SetPoint("TOPLEFT", eclipse, "TOPLEFT", 38, -2) + bar:SetPoint("TOPRIGHT", eclipse, "TOPRIGHT", 0, -2) + bar:SetHeight(18) bar:SetFixedPanelTemplate("Default") bar:SetFrameLevel(bar:GetFrameLevel() + 1) bar.colorPower = true; diff --git a/Interface/AddOns/SVUI/packages/unit/frames/groups.lua b/Interface/AddOns/SVUI/packages/unit/frames/groups.lua index fdbfd8a..0401e95 100644 --- a/Interface/AddOns/SVUI/packages/unit/frames/groups.lua +++ b/Interface/AddOns/SVUI/packages/unit/frames/groups.lua @@ -135,7 +135,7 @@ local UpdateTargetGlow = function(self) if(UnitIsPlayer(unit)) then local _, class = UnitClass(unit) if class then - local colors = SVUI_CLASS_COLORS[class] + local colors = RAID_CLASS_COLORS[class] self.TargetGlow:SetBackdropBorderColor(colors.r, colors.g, colors.b) else self.TargetGlow:SetBackdropBorderColor(1, 1, 1) @@ -1078,6 +1078,7 @@ LOAD/UPDATE METHOD ########################################################## ]]-- function MOD:SetGroupFrame(key, filter, template1, forceUpdate, template2) + if(InCombatLockdown()) then self:RegisterEvent("PLAYER_REGEN_ENABLED"); return end if not self.db[key] then return end local db = self.db[key] local realName = key:gsub("(.)", upper, 1) diff --git a/Interface/AddOns/SVUI/packages/unit/frames/units.lua b/Interface/AddOns/SVUI/packages/unit/frames/units.lua index 11c73be..8e1d87d 100644 --- a/Interface/AddOns/SVUI/packages/unit/frames/units.lua +++ b/Interface/AddOns/SVUI/packages/unit/frames/units.lua @@ -55,7 +55,7 @@ local UpdateTargetGlow = function(self) if(UnitIsPlayer(unit)) then local _, class = UnitClass(unit) if class then - local colors = SVUI_CLASS_COLORS[class] + local colors = RAID_CLASS_COLORS[class] self.TargetGlow:SetBackdropBorderColor(colors.r, colors.g, colors.b) else self.TargetGlow:SetBackdropBorderColor(1, 1, 1) @@ -954,7 +954,7 @@ LOAD/UPDATE METHOD ########################################################## ]]-- function MOD:SetUnitFrame(key) - if InCombatLockdown() then self:FrameForge() return end + if(InCombatLockdown()) then self:RegisterEvent("PLAYER_REGEN_ENABLED"); return end local unit = key local realName = unit:gsub("(.)", upper, 1) realName = realName:gsub("t(arget)", "T%1") @@ -980,7 +980,7 @@ function MOD:SetUnitFrame(key) end function MOD:SetEnemyFrames(key, maxCount) - if InCombatLockdown() then self:FrameForge() return end + if(InCombatLockdown()) then self:RegisterEvent("PLAYER_REGEN_ENABLED"); return end for i = 1, maxCount do local unit = key..i local realName = unit:gsub("(.)", upper, 1) diff --git a/Interface/AddOns/SVUI/scripts/_load.xml b/Interface/AddOns/SVUI/scripts/_load.xml index 5cc2910..8effc80 100644 --- a/Interface/AddOns/SVUI/scripts/_load.xml +++ b/Interface/AddOns/SVUI/scripts/_load.xml @@ -8,5 +8,5 @@ <Script file='totems.lua'/> <Script file='raid.lua'/> <Script file='reactions.lua'/> - <!-- <Script file='pvp.lua'/> --> + <Script file='pvp.lua'/> </Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI/system/_load.xml b/Interface/AddOns/SVUI/system/_load.xml index da8971d..c7fa5b7 100644 --- a/Interface/AddOns/SVUI/system/_load.xml +++ b/Interface/AddOns/SVUI/system/_load.xml @@ -2,6 +2,7 @@ <Script file='system.lua'/> <Include file='classes\_load.xml'/> <Script file='screen.lua'/> + <Script file='visibility.lua'/> <Script file='utilities.lua'/> <Script file='templates.lua'/> <Script file='timers.lua'/> diff --git a/Interface/AddOns/SVUI/system/classes/Animate.lua b/Interface/AddOns/SVUI/system/classes/Animate.lua index 0bd04a9..dd25352 100644 --- a/Interface/AddOns/SVUI/system/classes/Animate.lua +++ b/Interface/AddOns/SVUI/system/classes/Animate.lua @@ -19,7 +19,7 @@ local SuperVillain, L = unpack(select(2, ...)); ANIMATION CLASS ########################################################## ]]-- -SuperVillain.Animate = {}; +Animate = {}; local random = math.random; local FlickerAlpha = {0.2,0.15,0.1,0.15,0.2,0.15,0.1,0.15}; --[[ @@ -31,11 +31,11 @@ local Anim_OnShow = function(self) if not self.anim:IsPlaying() then self.anim:Play() end -end; +end local Anim_OnHide = function(self) self.anim:Finish() -end; +end local Anim_OnPlay = function(self) local parent = self.parent @@ -43,7 +43,7 @@ local Anim_OnPlay = function(self) if self.hideOnFinished and not parent:IsShown() then parent:Show() end -end; +end local Anim_OnStop = function(self) local parent = self.parent @@ -59,12 +59,12 @@ local Anim_OnStop = function(self) parent:SetScale(1) parent:SetFrameLevel(self.savedFrameLevel) end -end; +end local Anim_OnFinished = function(self) local parent = self.parent self:Stop() -end; +end local Sprite_OnUpdate = function(self) local order = self:GetOrder() @@ -81,7 +81,7 @@ local Sprite_OnUpdate = function(self) parent.overlay:SetTexCoord(left,right,0,1) parent.overlay:SetVertexColor(1,1,1,FlickerAlpha[order]) end -end; +end local SmallSprite_OnUpdate = function(self) local order = self:GetOrder() @@ -98,7 +98,7 @@ local SmallSprite_OnUpdate = function(self) parent.overlay:SetTexCoord(left,right,0,1) parent.overlay:SetVertexColor(1,1,1,FlickerAlpha[order]) end -end; +end local PulseIn_OnUpdate = function(self) local parent = self.parent @@ -107,7 +107,7 @@ local PulseIn_OnUpdate = function(self) parent:SetFrameLevel(128) end parent:SetScale(1 + (1.05 * step)) -end; +end local PulseOut_OnUpdate = function(self) local parent = self.parent @@ -116,28 +116,28 @@ local PulseOut_OnUpdate = function(self) parent:SetFrameLevel(128) end parent:SetScale(1 + (1.05 * (1 - step))) -end; +end local Slide_OnUpdate = function(self) local parent = self.parent local step = self:GetProgress() parent:SetScale(1 + (1.05 * step)) -end; +end local Slide_OnPlay = function(self) local parent = self.parent parent:SetScale(0.01) parent:SetAlpha(1) -end; +end local Slide_FadeStart = function(self) local parent = self.parent UIFrameFadeOut(parent, 0.3, 1, 0) -end; +end local Slide_FadeStop = function(self) self.parent:SetAlpha(0) -end; +end --[[ ########################################################## HELPER FUNCTION @@ -153,8 +153,8 @@ end ANIMATION CLASS METHODS ########################################################## ]]-- -function SuperVillain.Animate:SetTemplate(frame, animType, hideOnFinished, speed, special, scriptToParent) - if not animType then return end; +function Animate:SetTemplate(frame, animType, hideOnFinished, speed, special, scriptToParent) + if not animType then return end frame.anim = frame:CreateAnimationGroup(animType) frame.anim.parent = frame; @@ -179,7 +179,7 @@ function SuperVillain.Animate:SetTemplate(frame, animType, hideOnFinished, speed if animType == 'Flash'then frame.anim.fadeOnFinished = true - if not speed then speed = 0.33 end; + if not speed then speed = 0.33 end frame.anim[1] = SetNewAnimation(frame.anim, "ALPHA", "FadeIn") frame.anim[1]:SetChange(1) @@ -200,7 +200,7 @@ function SuperVillain.Animate:SetTemplate(frame, animType, hideOnFinished, speed frame.anim[1]:SetDegrees(-360) else frame.anim[1]:SetDegrees(360) - end; + end frame.anim[1]:SetDuration(speed) frame.anim:Play() frame.anim:SetLooping("REPEAT") @@ -231,7 +231,7 @@ function SuperVillain.Animate:SetTemplate(frame, animType, hideOnFinished, speed frame.anim[5]:SetDuration(special) frame.anim[5].isFadeFrame = true; frame.anim[5]:SetScript("OnUpdate", Sprite_OnUpdate) - end; + end frame.anim:SetLooping("REPEAT") elseif animType == 'SmallSprite' then @@ -281,7 +281,7 @@ function SuperVillain.Animate:SetTemplate(frame, animType, hideOnFinished, speed frame.anim[9]:SetDuration(special) frame.anim[9].isFadeFrame = true; frame.anim[9]:SetScript("OnUpdate", Sprite_OnUpdate) - end; + end frame.anim:SetLooping("REPEAT") elseif animType == 'Pulse' then @@ -298,69 +298,69 @@ function SuperVillain.Animate:SetTemplate(frame, animType, hideOnFinished, speed frame.anim[2]:SetOrder(2) frame.anim[2]:SetScript("OnUpdate", PulseOut_OnUpdate) end -end; +end --[[ ########################################################## ROTATE AND WOBBLE (kinda like twerking i guess...) ########################################################## ]]-- -function SuperVillain.Animate:Orbit(frame, speed, reversed, hideOnFinished) - if not frame then return end; - if not speed then speed = 1 end; - SuperVillain.Animate:SetTemplate(frame, 'Orbit', hideOnFinished, speed, reversed) -end; - -function SuperVillain.Animate:Pulse(frame, hideOnFinished) - if not frame then return end; - SuperVillain.Animate:SetTemplate(frame, 'Pulse', hideOnFinished) -end; +function Animate:Orbit(frame, speed, reversed, hideOnFinished) + if not frame then return end + if not speed then speed = 1 end + self:SetTemplate(frame, 'Orbit', hideOnFinished, speed, reversed) +end + +function Animate:Pulse(frame, hideOnFinished) + if not frame then return end + self:SetTemplate(frame, 'Pulse', hideOnFinished) +end --[[ ########################################################## ANIMATED SPRITES ########################################################## ]]-- -function SuperVillain.Animate:Sprite(frame, speed, fadeTime, scriptToParent) - if not frame then return end; +function Animate:Sprite(frame, speed, fadeTime, scriptToParent) + if not frame then return end speed = speed or 0.08; - SuperVillain.Animate:SetTemplate(frame, 'Sprite', false, speed, fadeTime, scriptToParent) -end; + self:SetTemplate(frame, 'Sprite', false, speed, fadeTime, scriptToParent) +end -function SuperVillain.Animate:SmallSprite(frame, speed, fadeTime, scriptToParent) - if not frame then return end; +function Animate:SmallSprite(frame, speed, fadeTime, scriptToParent) + if not frame then return end speed = speed or 0.08; - SuperVillain.Animate:SetTemplate(frame, 'SmallSprite', false, speed, fadeTime, scriptToParent) -end; + self:SetTemplate(frame, 'SmallSprite', false, speed, fadeTime, scriptToParent) +end -function SuperVillain.Animate:StopSprite(frame) - if not frame then return end; +function Animate:StopSprite(frame) + if not frame then return end frame.anim:Finish() -end; +end --[[ ########################################################## FLASHING ########################################################## ]]-- -function SuperVillain.Animate:Flash(frame, speed, looped) +function Animate:Flash(frame, speed, looped) if not frame.anim then - SuperVillain.Animate:SetTemplate(frame, 'Flash', false, speed, looped) + Animate:SetTemplate(frame, 'Flash', false, speed, looped) end if not frame.anim:IsPlaying() then frame.anim:Play() end -end; +end -function SuperVillain.Animate:StopFlash(frame) +function Animate:StopFlash(frame) if not frame.anim then return end frame.anim:Finish() frame.anim:Stop() -end; +end --[[ ########################################################## SLIDING ########################################################## ]]-- -function SuperVillain.Animate:Slide(frame, xDirection, yDirection, bounce) - if(not frame or (frame and frame.anim)) then return end; +function Animate:Slide(frame, xDirection, yDirection, bounce) + if(not frame or (frame and frame.anim)) then return end frame.anim = frame:CreateAnimationGroup("Slide") frame.anim.hideOnFinished = true; @@ -389,15 +389,15 @@ function SuperVillain.Animate:Slide(frame, xDirection, yDirection, bounce) frame.anim[4]:SetSmoothing("IN") frame.anim[4]:SetOffset(xDirection, yDirection) end -end; +end -function SuperVillain.Animate:RandomSlide(frame, raised) - if not frame then return end; +function Animate:RandomSlide(frame, raised) + if not frame then return end if raised then frame:SetFrameLevel(30) else frame:SetFrameLevel(20) - end; + end frame:SetPoint("CENTER", SuperVillain.UIParent, "CENTER", 0, -150) frame.anim = frame:CreateAnimationGroup("RandomSlide") @@ -420,16 +420,18 @@ function SuperVillain.Animate:RandomSlide(frame, raised) frame.anim[3]:SetScript("OnStop", Slide_FadeStop) frame.anim:SetScript("OnFinished", Slide_FadeStop) -end; +end -function SuperVillain.Animate:SlideIn(frame) - if not frame.anim then return end; +function Animate:SlideIn(frame) + if not frame.anim then return end frame:Show() frame.anim:Play() -end; +end -function SuperVillain.Animate:SlideOut(frame) - if not frame.anim then return end; +function Animate:SlideOut(frame) + if not frame.anim then return end frame.anim:Finish() frame.anim:Stop() -end; \ No newline at end of file +end + +SuperVillain.Animate = Animate; \ No newline at end of file diff --git a/Interface/AddOns/SVUI/system/classes/Database.lua b/Interface/AddOns/SVUI/system/classes/Database.lua index 2642b9f..40577be 100644 --- a/Interface/AddOns/SVUI/system/classes/Database.lua +++ b/Interface/AddOns/SVUI/system/classes/Database.lua @@ -3452,7 +3452,7 @@ local function initializedata(t) end local function SanitizeDatabase() - local db = SuperVillain.db.profile + local db = _G["SVUI_Profile"] local src = DatabaseDefaults for k,v in pairs(db) do if(k ~= "SAFEDATA" and src[k]) then diff --git a/Interface/AddOns/SVUI/system/classes/Registry.lua b/Interface/AddOns/SVUI/system/classes/Registry.lua index ef96b78..3cb33b2 100644 --- a/Interface/AddOns/SVUI/system/classes/Registry.lua +++ b/Interface/AddOns/SVUI/system/classes/Registry.lua @@ -40,6 +40,7 @@ GET ADDON DATA ########################################################## ]]-- local SuperVillain, L = unpack(select(2, ...)); +local Registry = {}; local MAJOR = "SuperVillain Plugins"; local MINOR = GetAddOnMetadata(..., "Version"); @@ -56,267 +57,283 @@ if GetLocale() == "ruRU" then INFO_NAME = "Плагины"; INFO_HEADER = "SuperVillain UI (устарела %.3f): Плагины"; end +--[[ +########################################################## +REGISTRY MASTER METATABLE +########################################################## +]]-- +local PreLoadQueue = {}; +local InitQueue = {}; +local PostLoadQueue = {}; -local function SetPrototype(obj) - obj.db = {} - obj._loaded = false - obj.CombatLocked = false - obj.ChangeDBVar = function(obj, value, key, sub1, sub2, sub3) - if((sub1 and sub2 and sub3) and (obj.db[sub1] and obj.db[sub1][sub2] and obj.db[sub1][sub2][sub3])) then - obj.db[sub1][sub2][sub3][key] = value; - SuperVillain.db[obj._name][sub1][sub2][sub3][key] = value; - elseif((sub1 and sub2) and (obj.db[sub1] and obj.db[sub1][sub2])) then - obj.db[sub1][sub2][key] = value; - SuperVillain.db[obj._name][sub1][sub2][key] = value; - elseif(sub1 and obj.db[sub1]) then - obj.db[sub1][key] = value; - SuperVillain.db[obj._name][sub1][key] = value; - else - obj.db[key] = value; - SuperVillain.db[obj._name][key] = value; - end +local metaPackage = { + __index = function(self, key) + return SuperVillain.db[self.dbKey][key] end - obj.Protect = function(obj, fnKey, autorun) - SuperVillain.Security:Register(obj, fnKey, autorun); +} + +local metaPackageDB = function(name) + return setmetatable( {dbKey = name}, metaPackage ) +end + +local addontostring = function(self) + return self.PackageName +end + +local changeDBVar = function(self, value, key, sub1, sub2, sub3) + if((sub1 and sub2 and sub3) and (self.db[sub1] and self.db[sub1][sub2] and self.db[sub1][sub2][sub3])) then + self.db[sub1][sub2][sub3][key] = value; + SuperVillain.db[self.PackageName][sub1][sub2][sub3][key] = value; + elseif((sub1 and sub2) and (self.db[sub1] and self.db[sub1][sub2])) then + self.db[sub1][sub2][key] = value; + SuperVillain.db[self.PackageName][sub1][sub2][key] = value; + elseif(sub1 and self.db[sub1]) then + self.db[sub1][key] = value; + SuperVillain.db[self.PackageName][sub1][key] = value; + else + self.db[key] = value; + SuperVillain.db[self.PackageName][key] = value; end - obj.UnProtect = function(obj, fnKey) - SuperVillain.Security:UnRegister(obj, fnKey); +end + +local innerOnEvent = function(self, event, ...) + local obj = self.__owner + if self[event] and type(self[event]) == "function" then + self[event](obj, event, ...) end - obj.RegisterEvent = function(obj, eventname, eventfunc) - if not obj.___eventframe then - obj.___eventframe = CreateFrame("Frame", nil) - obj.___eventframe:SetScript("OnEvent", function(self, event, ...) - if self[event] and type(self[event]) == "function" then - self[event](obj, event, ...) - end - end) - end - local fn = eventfunc - if type(eventfunc) == "string" then - fn = obj[eventfunc] - elseif(not fn and obj[eventname]) then - fn = obj[eventname] - end - obj.___eventframe[eventname] = fn - obj.___eventframe:RegisterEvent(eventname) +end + +local registerEvent = function(self, eventname, eventfunc) + if not self.___eventframe then + self.___eventframe = CreateFrame("Frame", nil) + self.___eventframe.__owner = self + self.___eventframe:SetScript("OnEvent", innerOnEvent) end - obj.UnregisterEvent = function(obj, event, func) - if(obj.___eventframe) then - obj.___eventframe:UnregisterEvent(event) - end + local fn = eventfunc + if type(eventfunc) == "string" then + fn = self[eventfunc] + elseif(not fn and self[eventname]) then + fn = self[eventname] end + self.___eventframe[eventname] = fn + self.___eventframe:RegisterEvent(eventname) +end + +local unregisterEvent = function(self, event, ...) + if(self.___eventframe) then + self.___eventframe:UnregisterEvent(event) + end +end + +local function SetPrototype(obj) + local addonmeta = {} + local oldmeta = getmetatable(obj) + if oldmeta then + for k, v in pairs(oldmeta) do addonmeta[k] = v end + end + addonmeta.__tostring = addontostring + setmetatable( obj, addonmeta ) + obj.initialized = false + obj.CombatLocked = false + obj.ChangeDBVar = changeDBVar + obj.RegisterEvent = registerEvent + obj.UnregisterEvent = unregisterEvent return obj end ---[[ -########################################################## -REGISTRY MASTER METATABLE -########################################################## -]]-- -local metapackage = { - __index = function(t, k) - return SuperVillain.db[t.dbKey][k] - end, -} -local addontostring = function(t) - return t._name + +Registry.Model = {Package = {}, Plugin = {}, Callback = {}} + +function Registry:Expose(name) + return self.Model.Package[name] or false end -local _queue = {{},{},{},{}} -local METAREGISTRY = function() - local methods = { - _model = {plugin = {}, callback = {}}, - _loadDB = function(_, name) - return setmetatable( {dbKey = name}, metapackage ) - end, - _loadPkg = function(_, priority) - if not _queue[priority] then return end; - local pkgList = _queue[priority] - for i=1,#pkgList do - local name = pkgList[i] - local obj = _._model[name] - if obj and not obj._loaded then - if SuperVillain.db[name] then - obj.db = _:_loadDB(name) - end - if obj.Load then - obj:Load() - obj.Load = nil - end - obj._loaded = true; - end - end - end, - Expose = function(_, name) - return _._model[name] or false - end, - SetCallback = function(_, fn) - if(fn and type(fn) == "function") then - _._model.callback[#_._model.callback + 1] = fn - end - end, - NewScript = function(_, fn) - if(fn and type(fn) == "function") then - local i = #_queue[4] - _queue[4][i + 1] = fn - end - end, - NewPackage = function(_, obj, name, priority) - if _._model[name] then return end - obj._name = name - if(priority == "pre") then - tinsert(_queue[1], name) - elseif(priority == "post") then - tinsert(_queue[3], name) - else - tinsert(_queue[2], name) - end - local addonmeta = {} - local oldmeta = getmetatable(obj) - if oldmeta then - for k, v in pairs(oldmeta) do addonmeta[k] = v end - end - addonmeta.__tostring = addontostring +function Registry:SetCallback(fn) + if(fn and type(fn) == "function") then + self.Model.Callback[#self.Model.Callback+1] = fn + end +end + +function Registry:NewScript(fn) + if(fn and type(fn) == "function") then + PostLoadQueue[#PostLoadQueue+1] = fn + end +end - setmetatable( obj, addonmeta ) - _._model[name] = SetPrototype(obj) +function Registry:NewPackage(obj, name, priority) + if self.Model.Package[name] then return end + obj.PackageName = name + if(priority == "pre") then + PreLoadQueue[#PreLoadQueue+1] = name + else + InitQueue[#InitQueue+1] = name + end - if(SuperVillain.CoreEnabled) then - if(_._model[name].Load) then - _._model[name]:Load() - end + self.Model.Package[name] = SetPrototype(obj) + + if(SuperVillain.CoreEnabled) then + if(self.Model.Package[name].Load) then + self.Model.Package[name]:Load() + end + end +end + +function Registry:FetchPlugins() + local list = ""; + for _, plugin in pairs(self.Model.Plugin) do + if plugin.name ~= MAJOR then + local author = GetAddOnMetadata(plugin.name, "Author") + local Pname = GetAddOnMetadata(plugin.name, "Title") or plugin.name + local color = plugin.old and SuperVillain:HexColor(1,0,0) or SuperVillain:HexColor(0,1,0) + list = list .. Pname + if author then + list = INFO_BY:format(list, author) end - end, - FetchPlugins = function(_) - local list = ""; - for _, plugin in pairs(_._model.plugin) do - if plugin.name ~= MAJOR then - local author = GetAddOnMetadata(plugin.name, "Author") - local Pname = GetAddOnMetadata(plugin.name, "Title") or plugin.name - local color = plugin.old and SuperVillain:HexColor(1,0,0) or SuperVillain:HexColor(0,1,0) - list = list .. Pname - if author then - list = INFO_BY:format(list, author) - end - list = INFO_VERSION:format(list, color, plugin.version) - if plugin.old then - list = INFO_NEW:format(list, plugin.newversion) - end - list = ("%s|r\n"):format(list) - end + list = INFO_VERSION:format(list, color, plugin.version) + if plugin.old then + list = INFO_NEW:format(list, plugin.newversion) end - return list - end, - NewPlugin = function(_, name, func) - local plugin = _._model.plugin[name] or {} - plugin.name = name - plugin.version = name == MAJOR and MINOR or GetAddOnMetadata(name, "Version") - plugin.callback = func - local enable, loadable = select(4,GetAddOnInfo("SVUI_ConfigOMatic")) - local loaded = IsAddOnLoaded("SVUI_ConfigOMatic") - if(enable and loadable and not loaded) then - if not plugin.PluginTempFrame then - local tempframe = CreateFrame("Frame") - tempframe:RegisterEvent("ADDON_LOADED") - tempframe:SetScript("OnEvent", function(self, event, addon) - if addon == "SVUI_ConfigOMatic" then - for i, plugin in pairs(_._model.plugin) do - if(plugin.callback) then - plugin.callback() - end - end + list = ("%s|r\n"):format(list) + end + end + return list +end + +function Registry:NewPlugin(name, func) + local plugin = self.Model.Plugin[name] or {} + plugin.name = name + plugin.version = name == MAJOR and MINOR or GetAddOnMetadata(name, "Version") + plugin.callback = func + local enable, loadable = select(4,GetAddOnInfo("SVUI_ConfigOMatic")) + local loaded = IsAddOnLoaded("SVUI_ConfigOMatic") + if(enable and loadable and not loaded) then + if not plugin.PluginTempFrame then + local tempframe = CreateFrame("Frame") + tempframe:RegisterEvent("ADDON_LOADED") + tempframe:SetScript("OnEvent", function(self, event, addon) + if addon == "SVUI_ConfigOMatic" then + for i, plugin in pairs(SuperVillain.Registry.Model.Plugin) do + if(plugin.callback) then + plugin.callback() end - end) - plugin.PluginTempFrame = tempframe - end - elseif(enable and loadable) then - if name ~= MAJOR then - SuperVillain.Options.args.plugins.args.pluginlist.name = _:FetchPlugins() - end - if(func) then - func() + end end + end) + plugin.PluginTempFrame = tempframe + end + elseif(enable and loadable) then + if name ~= MAJOR then + SuperVillain.Options.args.plugins.args.pluginlist.name = self:FetchPlugins() + end + if(func) then + func() + end + end + self.Model.Plugin[name] = plugin +end + +function Registry:RunCallbacks() + for i=1, #self.Model.Callback do + local fn = self.Model.Callback[i] + if(fn and type(fn) == "function") then + fn() + end + end +end + +function Registry:Update(name, dataOnly) + local obj = self.Model.Package[name] + if obj then + if obj.ReLoad and not dataOnly then + obj:ReLoad() + end + end +end + +function Registry:UpdateAll() + local list = self.Model.Package + for _,obj in pairs(list) do + if obj and obj.ReLoad then + obj:ReLoad() + end + end +end + +function Registry:Lights() + if not PreLoadQueue then return end + for i=1,#PreLoadQueue do + local name = PreLoadQueue[i] + local obj = self.Model.Package[name] + if obj and not obj.initialized then + if SuperVillain.db[name] then + obj.db = metaPackageDB(name) end - _._model.plugin[name] = plugin - end, - RunCallbacks = function(_) - for i=1, #_._model.callback do - local fn = _._model.callback[i] - if(fn and type(fn) == "function") then - fn() - end + if obj.Load then + obj:Load() + obj.Load = nil end - end, - Update = function(_, name, dataOnly) - local obj = _._model[name] - if obj then - if obj.ReLoad and not dataOnly then - obj:ReLoad() - end + obj.initialized = true; + end + end + PreLoadQueue = nil +end + +function Registry:Camera() + if not InitQueue then return end; + for i=1,#InitQueue do + local name = InitQueue[i] + local obj = self.Model.Package[name] + if obj and not obj.initialized then + if SuperVillain.db[name] then + obj.db = metaPackageDB(name) end - end, - UpdateAll = function(_) - local pkgList = _._model - for name,obj in pairs(pkgList) do - local name = obj._name - if obj and obj.ReLoad then - obj:ReLoad() - end + if obj.Load then + obj:Load() + obj.Load = nil end - end, + obj.initialized = true; + end + end + InitQueue = nil +end - --construct stored classes - - Lights = function(_) - _:_loadPkg(1) - end, - Camera = function(_) - _:_loadPkg(2) - _:_loadPkg(3) - end, - Action = function(_) - local count = #_queue[4] - for i=1, count do - local fn = _queue[4][i] - if(fn and type(fn) == "function") then - fn() - end - end - _queue = nil - end, - }; - local mt = { - __tostring = function(t) return "SuperVillain.Registry >>> ACCESS DENIED" end, - }; - setmetatable(methods, mt) - return methods -end; -do - SuperVillain.Registry = METAREGISTRY(); -end; +function Registry:Action() + if not PostLoadQueue then return end; + for i=1, #PostLoadQueue do + local fn = PostLoadQueue[i] + if(fn and type(fn) == "function") then + fn() + end + end + PostLoadQueue = nil +end --[[ ########################################################## LIB FUNCTIONS ########################################################## ]]-- -local GetOptions = function() - SuperVillain.Options.args.plugins = { - order = -10, - type = "group", - name = INFO_NAME, - guiInline = false, - args = { - pluginheader = { - order = 1, - type = "header", - name = format(INFO_HEADER, MINOR), - }, - pluginlist = { - order = 2, - type = "description", - name = SuperVillain.Registry:FetchPlugins(), - }, +do + SuperVillain.Registry = Registry; + + local GetOptions = function() + SuperVillain.Options.args.plugins = { + order = -10, + type = "group", + name = INFO_NAME, + guiInline = false, + args = { + pluginheader = { + order = 1, + type = "header", + name = format(INFO_HEADER, MINOR), + }, + pluginlist = { + order = 2, + type = "description", + name = SuperVillain.Registry:FetchPlugins(), + }, + } } - } -end; + end -SuperVillain.Registry:NewPlugin("SuperVillain Plugins", GetOptions) \ No newline at end of file + SuperVillain.Registry:NewPlugin("SuperVillain Plugins", GetOptions) +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/system/classes/Security.lua b/Interface/AddOns/SVUI/system/classes/Security.lua deleted file mode 100644 index 3c31762..0000000 --- a/Interface/AddOns/SVUI/system/classes/Security.lua +++ /dev/null @@ -1,128 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local pairs = _G.pairs; -local type = _G.type; -local pcall = _G.pcall; -local rawset = _G.rawset; -local rawget = _G.rawget; ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = enforce; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SuperVillain, L = unpack(select(2, ...)); ---[[ -########################################################## -SECURITY MASTER METATABLE -########################################################## -]]-- -local METASECURITY = function() - local _db = {l = {},q = {},s = {}}; - local _rc = 0; - local _lc = 0; - local methods = { - Register = function(_, ns, f, a) - local name = ns._name; - local func = ns[f]; - assert(type(func) == "function", "Can only Register a valid function. " .. f .. "!") - if not _db.q[name] then _db.q[name] = {} end; - if not _db.s[name] then _db.s[name] = {} end; - _db.s[name][f] = func; - local handler = _G[name.."SecurityHandler"] or CreateFrame("Frame", name.."SecurityHandler", UIParent); - local new_function = function(this,...) - _rc = _rc + 1 - _db.q[name][_rc] = {...} - if(InCombatLockdown()) then - if not handler:IsEventRegistered('PLAYER_REGEN_ENABLED') then - handler:RegisterEvent('PLAYER_REGEN_ENABLED') - end; - return - else - for k in pairs(_db.q[name]) do - local _, catch = pcall(func, this, _db.q[name][k]) - if catch then - _lc = _lc + 1 - _db.l[_lc] = catch - end - end - end - end; - ns[f] = new_function; - handler.callback = ns[f]; - handler:SetScript("OnEvent", function(this,event,...) - if(InCombatLockdown()) then - ns.CombatLocked = true; - elseif event == 'PLAYER_REGEN_ENABLED' then - ns.CombatLocked = false; - this:UnregisterEvent('PLAYER_REGEN_ENABLED') - this:callback() - end - end) - if a then new_function(ns) end; - end, - UnRegister = function(_, ns, f) - local name = ns._name; - local handler = _G[name.."SecurityHandler"]; - if not handler then return end; - handler.callback = nil; - handler:SetScript("OnEvent", nil); - if _db.s[name][f] then - ns[f] = _db.s[name][f] - _db.s[name][f] = nil - end - end, - ErrorLogs = function(t) print("SuperVillain.Security >>> [" .. tdump(_db.l) .. "]") end, - }; - local mt ={ - __index = function(t, k) - v=rawget(_db.q, k) - if v then return v end - end, - __newindex = function(t, k, v) - if rawget(_db.q, k) then rawset(_db.q, k, v) return end - end, - __metatable = {}, - __pairs = function(t, k, v) return next, _db.q, nil end, - __ipairs = function() - local function iter(a, i) - i = i + 1 - local v = a[i] - if v then return i, v end - end - return iter, _db.q, 0 - end, - __len = function(t) - local count = 0 - for _ in pairs(_db.q) do count = count + 1 end - return count - end, - __tostring = function(t) return "SuperVillain.Security >>> [" .. tdump(_db.q) .. "]" end, - }; - setmetatable(methods, mt) - return methods -end; -do - SuperVillain.Security = METASECURITY(); -end; diff --git a/Interface/AddOns/SVUI/system/classes/Visibility.lua b/Interface/AddOns/SVUI/system/classes/Visibility.lua deleted file mode 100644 index 1ee44d0..0000000 --- a/Interface/AddOns/SVUI/system/classes/Visibility.lua +++ /dev/null @@ -1,195 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local pairs = _G.pairs; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SuperVillain, L = unpack(select(2, ...)); ---[[ -########################################################## -LOCALS -########################################################## -]]-- -local DisplayEventHandler = CreateFrame("Frame"); -local SecureFadeManager = CreateFrame("Frame"); -local SecureFadeFrames = {}; ---[[ -########################################################## -FRAME VISIBILITY MANAGEMENT -########################################################## -]]-- -function SuperVillain:AddToDisplayAudit(frame) - if frame.IsVisible and frame:GetName() then - self.DisplayAudit[frame:GetName()] = true - end -end; - -function SuperVillain:FlushDisplayAudit() - if InCombatLockdown() then return end; - for frame,_ in pairs(self.DisplayAudit)do - if _G[frame] then - _G[frame]:SetParent(SuperVillain.Cloaked) - end - end; - DisplayEventHandler:RegisterEvent("PLAYER_REGEN_DISABLED") -end; - -function SuperVillain:PushDisplayAudit() - if InCombatLockdown() then return end; - for frame,_ in pairs(self.DisplayAudit)do - if _G[frame] then - _G[frame]:SetParent(UIParent) - end - end; - DisplayEventHandler:UnregisterEvent("PLAYER_REGEN_DISABLED") -end; - -local DisplayAudit_OnEvent = function(self, event, arg, ...) - SuperVillain:PushDisplayAudit() -end - -DisplayEventHandler:SetScript("OnEvent", DisplayAudit_OnEvent) - -local function SafeFrameRemoval(table, item) - local index = 1; - while table[index] do - if ( item == table[index] ) then - tremove(table, index); - else - index = index + 1; - end - end -end - -local function SecureFadeRemoveFrame(frame) - SafeFrameRemoval(SecureFadeFrames, frame); -end - -function SuperVillain:SecureFade_OnUpdate(value) - local i = 1; - local this, safeFadeState; - while SecureFadeFrames[i] do - this = SecureFadeFrames[i] - safeFadeState = this._secureFade; - safeFadeState.fadeTimer = (safeFadeState.fadeTimer or 0) + value; - safeFadeState.fadeTimer = safeFadeState.fadeTimer + value; - if safeFadeState.fadeTimer < safeFadeState.timeToFade then - if safeFadeState.mode == "IN" then - this:SetAlpha(safeFadeState.fadeTimer / safeFadeState.timeToFade * safeFadeState.endAlpha - safeFadeState.startAlpha + safeFadeState.startAlpha) - elseif safeFadeState.mode == "OUT" then - this:SetAlpha((safeFadeState.timeToFade - safeFadeState.fadeTimer) / safeFadeState.timeToFade * safeFadeState.startAlpha - safeFadeState.endAlpha + safeFadeState.endAlpha) - end - else - this:SetAlpha(safeFadeState.endAlpha) - SecureFadeRemoveFrame(this) - if not this:IsProtected() and safeFadeState.hideOnFinished and this:IsShown() then - this:Hide() - end - if (safeFadeState.finishedFunc) then - safeFadeState.finishedFunc(safeFadeState.finishedArg1, safeFadeState.finishedArg2, safeFadeState.finishedArg3, safeFadeState.finishedArg4) - safeFadeState.finishedFunc = nil - end - end - i = i + 1 - end - if #SecureFadeFrames == 0 then - SecureFadeManager:SetScript("OnUpdate", nil) - end -end; - -function SuperVillain:SecureFade(this, safeFadeState) - if not this then return end; - local safeFadeState = this._secureFade - if not safeFadeState.mode then - safeFadeState.mode = "IN" - end; - - if safeFadeState.mode == "IN" then - if not this:IsProtected() and not this:IsShown() then this:Show() end - if not safeFadeState.startAlpha then - safeFadeState.startAlpha = 0 - end - if not safeFadeState.endAlpha then - safeFadeState.endAlpha = 1.0 - end - elseif safeFadeState.mode == "OUT" then - if not safeFadeState.startAlpha then - safeFadeState.startAlpha = 1.0 - end - if not safeFadeState.endAlpha then - safeFadeState.endAlpha = 0 - end - end; - - this:SetAlpha(safeFadeState.startAlpha) - - local i=1; - while SecureFadeFrames[i] do - if SecureFadeFrames[i]==this then - return - end; - i = i + 1; - end; - SecureFadeFrames[#SecureFadeFrames + 1] = this; - SecureFadeManager:SetScript("OnUpdate", SuperVillain.SecureFade_OnUpdate) -end; - -function SuperVillain:SecureFadeIn(this, duration, startAlpha, endAlpha) - if(not this._secureFade) then - this._secureFade = {} - end - this._secureFade.mode = "IN" - this._secureFade.timeToFade = duration; - this._secureFade.startAlpha = startAlpha or 0; - this._secureFade.endAlpha = endAlpha or 1; - this._secureFade.hideOnFinished = false; - this._secureFade.finishedFunc = nil - SuperVillain:SecureFade(this) -end; - -function SuperVillain:SecureFadeOut(this, duration, startAlpha, endAlpha, hideOnFinished) - if(not this._secureFade) then - this._secureFade = {} - end - this._secureFade.mode = "OUT" - this._secureFade.timeToFade = duration; - this._secureFade.startAlpha = startAlpha or 1; - this._secureFade.endAlpha = endAlpha or 0; - this._secureFade.hideOnFinished = hideOnFinished; - this._secureFade.finishedFunc = nil - SuperVillain:SecureFade(this) -end; - -function SuperVillain:SecureFadeRemoval(this) - local i = 1; - while SecureFadeFrames[i] do - if this == SecureFadeFrames[i] then - tremove(SecureFadeFrames, i) - break - else - i = i + 1; - end - end -end; \ No newline at end of file diff --git a/Interface/AddOns/SVUI/system/classes/_load.xml b/Interface/AddOns/SVUI/system/classes/_load.xml index 2a20957..88dbd20 100644 --- a/Interface/AddOns/SVUI/system/classes/_load.xml +++ b/Interface/AddOns/SVUI/system/classes/_load.xml @@ -1,8 +1,6 @@ <Ui xmlns="http://www.blizzard.com/wow/ui/"> <Script file='Database.lua'/> <Script file='Filters.lua'/> - <Script file='Security.lua'/> <Script file='Registry.lua'/> - <Script file='Visibility.lua'/> <Script file='Animate.lua'/> </Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI/system/slash.lua b/Interface/AddOns/SVUI/system/slash.lua index 004b989..4d22d60 100644 --- a/Interface/AddOns/SVUI/system/slash.lua +++ b/Interface/AddOns/SVUI/system/slash.lua @@ -159,15 +159,15 @@ do PullCountdownHandler:SetScript("OnUpdate", pull) end end - - SlashCmdList.PULLCOUNTDOWN = function(msg) + + SLASH_PULLCOUNTDOWN1 = "/jenkins" + SlashCmdList["PULLCOUNTDOWN"] = function(msg) if tonumber(msg) ~= nil then PullCountdown.Pull(msg) else PullCountdown.Pull() end end - SLASH_PULLCOUNTDOWN1 = "/pc" end --[[ ########################################################## diff --git a/Interface/AddOns/SVUI/system/system.lua b/Interface/AddOns/SVUI/system/system.lua index dd0358a..2b41e50 100644 --- a/Interface/AddOns/SVUI/system/system.lua +++ b/Interface/AddOns/SVUI/system/system.lua @@ -118,16 +118,16 @@ SuperVillain.snaps[#SuperVillain.snaps + 1] = SuperVillain.UIParent; THE CLEANING LADY ########################################################## ]]-- -local LemonPledge = 0; -local Consuela = CreateFrame("Frame") -Consuela:RegisterAllEvents() -Consuela:SetScript("OnEvent", function(self, event) - LemonPledge = LemonPledge + 1 - if (InCombatLockdown() and LemonPledge > 25000) or (not InCombatLockdown() and LemonPledge > 10000) then - collectgarbage("collect") - LemonPledge = 0; - end -end) +-- local LemonPledge = 0; +-- local Consuela = CreateFrame("Frame") +-- Consuela:RegisterAllEvents() +-- Consuela:SetScript("OnEvent", function(self, event) +-- LemonPledge = LemonPledge + 1 +-- if (InCombatLockdown() and LemonPledge > 25000) or (not InCombatLockdown() and LemonPledge > 10000) then +-- collectgarbage("collect") +-- LemonPledge = 0; +-- end +-- end) --[[ ########################################################## DISPEL MECHANICS @@ -293,7 +293,7 @@ end function SuperVillain:TaintHandler(taint, sourceName, sourceFunc) if GetCVarBool('scriptErrors') ~= 1 then return end - ScriptErrorsFrame_OnError(L["%s: %s has lost it's damn mind and is destroying '%s'."]:format(taint, sourceName or "<name>", sourceFunc or "<func>"),false) + ScriptErrorsFrame_OnError(L["%s: %s has lost it's damn mind and is destroying '%s'."]:format(taint, sourceName or "elements", sourceFunc or "functions"),false) end --[[ ########################################################## @@ -382,9 +382,9 @@ local function PreLoad(self) self:UIScale(); self:RefreshSystemFonts(); - SVUISystemEventHandler:RegisterEvent('PLAYER_REGEN_DISABLED'); self:LoadSystemAlerts(); self.Registry:Lights(); + SVUISystemEventHandler:RegisterEvent('PLAYER_REGEN_DISABLED'); end local function FullLoad(self) diff --git a/Interface/AddOns/SVUI/system/timers.lua b/Interface/AddOns/SVUI/system/timers.lua index 28e1bd5..119ce78 100644 --- a/Interface/AddOns/SVUI/system/timers.lua +++ b/Interface/AddOns/SVUI/system/timers.lua @@ -50,12 +50,12 @@ GLOBAL TIMEOUT QUEUE ExecuteTimer: Create a timer that runs once and CANNOT be stopped ExecuteLoop: Create a timer that loops continuously and CAN be removed ]]-- -local QueuedForExeTimer = 0; +SuperVillain.TimerCount = 0; local ExeTimerQueue = {}; local ExeTimerManager = CreateFrame("Frame"); local ExeTimerManager_OnUpdate = function(self, elapsed) - if(QueuedForExeTimer > 0) then + if(SuperVillain.TimerCount > 0) then for id,_ in pairs(ExeTimerQueue) do local callback = ExeTimerQueue[id] if(callback.f) then @@ -68,21 +68,14 @@ local ExeTimerManager_OnUpdate = function(self, elapsed) ExeTimerQueue[id].t = callback.x else ExeTimerQueue[id] = nil - QueuedForExeTimer = QueuedForExeTimer - 1; + SuperVillain.TimerCount = SuperVillain.TimerCount - 1; end end end end end end - -local function ValidateTimer() - if(QueuedForExeTimer > 0 and (not ExeTimerManager:GetScript("OnUpdate"))) then - ExeTimerManager:SetScript("OnUpdate", ExeTimerManager_OnUpdate) - elseif(ExeTimerManager:GetScript("OnUpdate")) then - ExeTimerManager:SetScript("OnUpdate", nil) - end -end +ExeTimerManager:SetScript("OnUpdate", ExeTimerManager_OnUpdate) function SuperVillain:ExecuteTimer(timeOutFunction, duration, idCheck) if(type(duration) == "number" and type(timeOutFunction) == "function") then @@ -90,10 +83,9 @@ function SuperVillain:ExecuteTimer(timeOutFunction, duration, idCheck) ExeTimerQueue[idCheck].t = duration return idCheck else - QueuedForExeTimer = QueuedForExeTimer + 1 - local id = "LOOP" .. QueuedForExeTimer; + self.TimerCount = self.TimerCount + 1 + local id = "LOOP" .. self.TimerCount; ExeTimerQueue[id] = {t = duration, f = timeOutFunction} - ValidateTimer() return id end end @@ -107,10 +99,9 @@ function SuperVillain:ExecuteLoop(timeOutFunction, duration, idCheck) ExeTimerQueue[idCheck].t = duration return idCheck else - QueuedForExeTimer = QueuedForExeTimer + 1 - local id = "LOOP" .. QueuedForExeTimer; + self.TimerCount = self.TimerCount + 1 + local id = "LOOP" .. self.TimerCount; ExeTimerQueue[id] = {x = duration, t = duration, f = timeOutFunction} - ValidateTimer() return id end end @@ -120,8 +111,7 @@ end function SuperVillain:RemoveLoop(id) if(ExeTimerQueue[id]) then ExeTimerQueue[id] = nil - QueuedForExeTimer = QueuedForExeTimer - 1; - ValidateTimer() + self.TimerCount = self.TimerCount - 1; end end --[[ diff --git a/Interface/AddOns/SVUI/system/visibility.lua b/Interface/AddOns/SVUI/system/visibility.lua new file mode 100644 index 0000000..1ee44d0 --- /dev/null +++ b/Interface/AddOns/SVUI/system/visibility.lua @@ -0,0 +1,195 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local pairs = _G.pairs; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SuperVillain, L = unpack(select(2, ...)); +--[[ +########################################################## +LOCALS +########################################################## +]]-- +local DisplayEventHandler = CreateFrame("Frame"); +local SecureFadeManager = CreateFrame("Frame"); +local SecureFadeFrames = {}; +--[[ +########################################################## +FRAME VISIBILITY MANAGEMENT +########################################################## +]]-- +function SuperVillain:AddToDisplayAudit(frame) + if frame.IsVisible and frame:GetName() then + self.DisplayAudit[frame:GetName()] = true + end +end; + +function SuperVillain:FlushDisplayAudit() + if InCombatLockdown() then return end; + for frame,_ in pairs(self.DisplayAudit)do + if _G[frame] then + _G[frame]:SetParent(SuperVillain.Cloaked) + end + end; + DisplayEventHandler:RegisterEvent("PLAYER_REGEN_DISABLED") +end; + +function SuperVillain:PushDisplayAudit() + if InCombatLockdown() then return end; + for frame,_ in pairs(self.DisplayAudit)do + if _G[frame] then + _G[frame]:SetParent(UIParent) + end + end; + DisplayEventHandler:UnregisterEvent("PLAYER_REGEN_DISABLED") +end; + +local DisplayAudit_OnEvent = function(self, event, arg, ...) + SuperVillain:PushDisplayAudit() +end + +DisplayEventHandler:SetScript("OnEvent", DisplayAudit_OnEvent) + +local function SafeFrameRemoval(table, item) + local index = 1; + while table[index] do + if ( item == table[index] ) then + tremove(table, index); + else + index = index + 1; + end + end +end + +local function SecureFadeRemoveFrame(frame) + SafeFrameRemoval(SecureFadeFrames, frame); +end + +function SuperVillain:SecureFade_OnUpdate(value) + local i = 1; + local this, safeFadeState; + while SecureFadeFrames[i] do + this = SecureFadeFrames[i] + safeFadeState = this._secureFade; + safeFadeState.fadeTimer = (safeFadeState.fadeTimer or 0) + value; + safeFadeState.fadeTimer = safeFadeState.fadeTimer + value; + if safeFadeState.fadeTimer < safeFadeState.timeToFade then + if safeFadeState.mode == "IN" then + this:SetAlpha(safeFadeState.fadeTimer / safeFadeState.timeToFade * safeFadeState.endAlpha - safeFadeState.startAlpha + safeFadeState.startAlpha) + elseif safeFadeState.mode == "OUT" then + this:SetAlpha((safeFadeState.timeToFade - safeFadeState.fadeTimer) / safeFadeState.timeToFade * safeFadeState.startAlpha - safeFadeState.endAlpha + safeFadeState.endAlpha) + end + else + this:SetAlpha(safeFadeState.endAlpha) + SecureFadeRemoveFrame(this) + if not this:IsProtected() and safeFadeState.hideOnFinished and this:IsShown() then + this:Hide() + end + if (safeFadeState.finishedFunc) then + safeFadeState.finishedFunc(safeFadeState.finishedArg1, safeFadeState.finishedArg2, safeFadeState.finishedArg3, safeFadeState.finishedArg4) + safeFadeState.finishedFunc = nil + end + end + i = i + 1 + end + if #SecureFadeFrames == 0 then + SecureFadeManager:SetScript("OnUpdate", nil) + end +end; + +function SuperVillain:SecureFade(this, safeFadeState) + if not this then return end; + local safeFadeState = this._secureFade + if not safeFadeState.mode then + safeFadeState.mode = "IN" + end; + + if safeFadeState.mode == "IN" then + if not this:IsProtected() and not this:IsShown() then this:Show() end + if not safeFadeState.startAlpha then + safeFadeState.startAlpha = 0 + end + if not safeFadeState.endAlpha then + safeFadeState.endAlpha = 1.0 + end + elseif safeFadeState.mode == "OUT" then + if not safeFadeState.startAlpha then + safeFadeState.startAlpha = 1.0 + end + if not safeFadeState.endAlpha then + safeFadeState.endAlpha = 0 + end + end; + + this:SetAlpha(safeFadeState.startAlpha) + + local i=1; + while SecureFadeFrames[i] do + if SecureFadeFrames[i]==this then + return + end; + i = i + 1; + end; + SecureFadeFrames[#SecureFadeFrames + 1] = this; + SecureFadeManager:SetScript("OnUpdate", SuperVillain.SecureFade_OnUpdate) +end; + +function SuperVillain:SecureFadeIn(this, duration, startAlpha, endAlpha) + if(not this._secureFade) then + this._secureFade = {} + end + this._secureFade.mode = "IN" + this._secureFade.timeToFade = duration; + this._secureFade.startAlpha = startAlpha or 0; + this._secureFade.endAlpha = endAlpha or 1; + this._secureFade.hideOnFinished = false; + this._secureFade.finishedFunc = nil + SuperVillain:SecureFade(this) +end; + +function SuperVillain:SecureFadeOut(this, duration, startAlpha, endAlpha, hideOnFinished) + if(not this._secureFade) then + this._secureFade = {} + end + this._secureFade.mode = "OUT" + this._secureFade.timeToFade = duration; + this._secureFade.startAlpha = startAlpha or 1; + this._secureFade.endAlpha = endAlpha or 0; + this._secureFade.hideOnFinished = hideOnFinished; + this._secureFade.finishedFunc = nil + SuperVillain:SecureFade(this) +end; + +function SuperVillain:SecureFadeRemoval(this) + local i = 1; + while SecureFadeFrames[i] do + if this == SecureFadeFrames[i] then + tremove(SecureFadeFrames, i) + break + else + i = i + 1; + end + end +end; \ No newline at end of file diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/petbattle.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/petbattle.lua index f3265aa..73c8ebf 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/petbattle.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/petbattle.lua @@ -352,7 +352,8 @@ local function PetBattleStyle() local lastActionButton = self.BottomFrame.abilityButtons[i - 1] actionButton:SetPoint("LEFT", lastActionButton, "RIGHT", 10, 0) end - end; + end + self.BottomFrame.SwitchPetButton:SetParent(PetBattleActionBar) self.BottomFrame.SwitchPetButton:ClearAllPoints() self.BottomFrame.SwitchPetButton:SetPoint("LEFT", self.BottomFrame.abilityButtons[3], "RIGHT", 10, 0) PetBattleButtonHelper(self.BottomFrame.SwitchPetButton)