i found the solution I think.
The problem I think it was I was setting a global value.
I set it in an container to load at player login and the lags are gone, also no spikes and CPU cycles are more then low >0,001 in an 40min dungeon.
The Code is:
Code:
local EventFrame = CreateFrame("frame", "EventFrame")
EventFrame:RegisterEvent("PLAYER_ENTERING_WORLD")
EventFrame:SetScript("OnEvent", function(self, event, ...)
if(event == "PLAYER_ENTERING_WORLD") then
ZoneAbilityFrame:SetScale(1.3);
ZoneAbilityFrame.Style:SetAlpha(0);
ZoneAbilityFrame.Style:Hide();
DurabilityFrame:Hide();
BuffFrame:SetScale(1.5);
TemporaryEnchantFrame:SetScale(1.5);
ObjectiveTrackerFrame:SetScale(1.1);
ObjectiveTrackerFrame:SetSize(260,750);
end
end)
local cap = ZoneAbilityFrame.ClearAllPoints
local sp = ZoneAbilityFrame.SetPoint
hooksecurefunc(ZoneAbilityFrame, "SetPoint", function(self)
cap(self)
sp(self, "BOTTOM", UIParent, "BOTTOM", 0, 90)
end)
local cap = VehicleSeatIndicator.ClearAllPoints
local sp = VehicleSeatIndicator.SetPoint
hooksecurefunc(VehicleSeatIndicator, "SetPoint", function(self)
cap(self)
sp(self, "TOPRIGHT", Minimap, "BOTTOMLEFT", -30, -10)
end)
local cap = ObjectiveTrackerFrame.ClearAllPoints
local sp = ObjectiveTrackerFrame.SetPoint
hooksecurefunc(ObjectiveTrackerFrame, "SetPoint", function(self)
cap(self)
sp(self, "TOPLEFT", 40, -10)
end)
-- Slash Command List
SlashCmdList['RELOADUI'] = function() ReloadUI() end
SLASH_RELOADUI1 = '/rl'
SlashCmdList["READYCHECK"] = function() DoReadyCheck() end
SLASH_READYCHECK1 = '/rc'
SlashCmdList["CHECKROLE"] = function() InitiateRolePoll() end
SLASH_CHECKROLE1 = '/cr'
The problem I encountered was when playing at uwqhd or 4k some elements like the bufframe were way too small and changing the UI scales just made other elements way too big.
Then I just repositioned some other stuff like objective tracker, zone ability frame, vehicle seat indicator and durability frame because I wanted to have them at an different postion.
Also whilst my research I found some code and varibles which might be useful for someone who is looking for something similar.
Code:
--[[SetCVar("autoLootDefault", 1)
SetCVar("Sound_EnableErrorSpeech", 0)
SetCVar("enableFloatingCombatText", 1)
SetCVar("cameraDistanceMaxZoomFactor", 2.6)
SetCVar("SkyCloudLOD", 3)
SetCVar("autoDismount", 1)
SetCVar("autoDismoduntFlying", 1)
SetCVar("rawMouseEnable", 1) --raw mouse
SetCVar("rawMouseAccelerationEnable", 0) --acceleration
SetCVar("screenshotQuality", 10)]]--
--[[
hooksecurefunc("BuffFrame_UpdateAllBuffAnchors", function()
BuffFrame:ClearAllPoints()
BuffFrame:SetPoint("TOPRIGHT", Minimap, "TOPLEFT", -40, 0)
end)
--BuffFrame:ClearAllPoints();
--BuffFrame:SetPoint("TOPRIGHT", Minimap, "TOPLEFT", -60, 0);
BuffFrame:SetScale(1.5);
TemporaryEnchantFrame:SetScale(1.5);]]--
--local cap = TalkingHeadFrame.ClearAllPoints
--local sp = TalkingHeadFrame.SetPoint
--[[hooksecurefunc("TalkingHeadFrame_PlayCurrent", function()
TalkingHeadFrame:Hide()
TalkingHeadFrame_CloseImmediately()
end)]]--
--[[
local cap = GroupLootContainer.ClearAllPoints
local sp = GroupLootContainer.SetPoint
hooksecurefunc(GroupLootContainer, "SetPoint", function(self)
cap(self)
sp(self, "TOPLEFT", 400, -100)
end)
GroupLootContainer:SetScale(1.1);
GroupLootContainer:SetSize(260,750);]]--
--CompactRaidFrame1HealthBarBackground:Hide()
--CompactRaidFrame1HealthBarBackground:SetAlpha(0)
--RAID_CLASS_COLORS['PALADIN']["r"] = 0.83
--RAID_CLASS_COLORS['PALADIN']["g"] = 0.69
--RAID_CLASS_COLORS['PALADIN']["b"] = 0.22
--RAID_CLASS_COLORS['PALADIN']["colorStr"] = "d4af37"
This is what it looks like