mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-26 14:00:48 +00:00
infight: modernize and add instant updates
This commit is contained in:
+1
-1
@@ -1451,7 +1451,7 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function ()
|
|||||||
CreateConfig(nil, T["Bags Border Size"], C.appearance.border, "bags", "dropdown", pfUI.gui.dropdowns.border)
|
CreateConfig(nil, T["Bags Border Size"], C.appearance.border, "bags", "dropdown", pfUI.gui.dropdowns.border)
|
||||||
CreateConfig(U["nameplates"], T["Nameplate Border Size"], C.appearance.border, "nameplates", "dropdown", pfUI.gui.dropdowns.border)
|
CreateConfig(U["nameplates"], T["Nameplate Border Size"], C.appearance.border, "nameplates", "dropdown", pfUI.gui.dropdowns.border)
|
||||||
CreateConfig(nil) -- spacer
|
CreateConfig(nil) -- spacer
|
||||||
CreateConfig(nil, T["Enable Combat Glow Effects On Screen Edges"], C.appearance.infight, "screen", "checkbox")
|
CreateConfig(U["infight"], T["Enable Combat Glow Effects On Screen Edges"], C.appearance.infight, "screen", "checkbox")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
CreateGUIEntry(T["Settings"], T["Cooldown"], function()
|
CreateGUIEntry(T["Settings"], T["Cooldown"], function()
|
||||||
|
|||||||
+35
-35
@@ -1,42 +1,42 @@
|
|||||||
pfUI:RegisterModule("infight", "vanilla:tbc", function ()
|
pfUI:RegisterModule("infight", "vanilla:tbc", function ()
|
||||||
-- build the frame
|
local function OnUpdate()
|
||||||
pfUI.infight = CreateFrame("Frame", "pfUICombat", UIParent)
|
if this.mode == 0 then return end
|
||||||
|
if ( this.tick or 1) > GetTime() then return else this.tick = GetTime() + .1 end
|
||||||
|
|
||||||
pfUI.infight.backdrop = {
|
if not this.fadeValue then this.fadeValue = 1 end
|
||||||
edgeFile = pfUI.media["img:glow"], edgeSize = 8,
|
if this.fadeValue >= 0.3 then
|
||||||
insets = {left = 0, right = 0, top = 0, bottom = 0},
|
this.fadeModifier = -0.1
|
||||||
}
|
end
|
||||||
|
if this.fadeValue <= 0 then
|
||||||
|
this.fadeModifier = 0.1
|
||||||
|
end
|
||||||
|
this.fadeValue = this.fadeValue + this.fadeModifier
|
||||||
|
|
||||||
pfUI.infight:SetScript("OnUpdate",function(s,e)
|
if C.appearance.infight.screen == "1" and this.screen then
|
||||||
if not pfUI.infight.clock then pfUI.infight.clock = GetTime() -0.1 end
|
if UnitAffectingCombat("player") then
|
||||||
if GetTime() >= pfUI.infight.clock + 0.1 then
|
this.screen:Show()
|
||||||
pfUI.infight.clock = GetTime()
|
this.screen:SetBackdropBorderColor(1,0.2+this.fadeValue, this.fadeValue, 1-this.fadeValue);
|
||||||
|
else
|
||||||
if not pfUI.infight.fadeValue then pfUI.infight.fadeValue = 1 end
|
this.screen:Hide()
|
||||||
if pfUI.infight.fadeValue >= 0.3 then
|
|
||||||
pfUI.infight.fadeModifier = -0.1
|
|
||||||
end
|
|
||||||
if pfUI.infight.fadeValue <= 0 then
|
|
||||||
pfUI.infight.fadeModifier = 0.1
|
|
||||||
end
|
|
||||||
pfUI.infight.fadeValue = pfUI.infight.fadeValue + pfUI.infight.fadeModifier
|
|
||||||
|
|
||||||
if C.appearance.infight.screen == "1" and pfUI.infight.screen then
|
|
||||||
if UnitAffectingCombat("player") then
|
|
||||||
pfUI.infight.screen:Show()
|
|
||||||
pfUI.infight.screen:SetBackdropBorderColor(1,0.2+pfUI.infight.fadeValue, pfUI.infight.fadeValue, 1-pfUI.infight.fadeValue);
|
|
||||||
else
|
|
||||||
pfUI.infight.screen:Hide()
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
|
||||||
|
|
||||||
if C.appearance.infight.screen == "1" then
|
|
||||||
pfUI.infight.screen = CreateFrame("Frame", "pfUICombatScreen", UIParent)
|
|
||||||
pfUI.infight.screen:SetFrameStrata("BACKGROUND")
|
|
||||||
pfUI.infight.screen:SetBackdrop(pfUI.infight.backdrop)
|
|
||||||
pfUI.infight.screen:SetAllPoints(WorldFrame)
|
|
||||||
pfUI.infight.screen:Hide()
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
pfUI.infight = CreateFrame("Frame", "pfUICombat", UIParent)
|
||||||
|
pfUI.infight:SetScript("OnUpdate", OnUpdate)
|
||||||
|
|
||||||
|
pfUI.infight.screen = CreateFrame("Frame", "pfUICombatScreen", UIParent)
|
||||||
|
pfUI.infight.screen:SetFrameStrata("BACKGROUND")
|
||||||
|
pfUI.infight.screen:SetAllPoints(WorldFrame)
|
||||||
|
pfUI.infight.screen:SetBackdrop({
|
||||||
|
edgeFile = pfUI.media["img:glow"], edgeSize = 8,
|
||||||
|
insets = {left = 0, right = 0, top = 0, bottom = 0},
|
||||||
|
})
|
||||||
|
pfUI.infight.screen:Hide()
|
||||||
|
|
||||||
|
pfUI.infight.UpdateConfig = function(self)
|
||||||
|
pfUI.infight.mode = tonumber(C.appearance.infight.screen)
|
||||||
|
end
|
||||||
|
|
||||||
|
pfUI.infight.UpdateConfig()
|
||||||
end)
|
end)
|
||||||
|
|||||||
Reference in New Issue
Block a user