/trunk/VFL/Viewers
local FormatMicro = VFLT.FormatMicro; |
--local strformat = string.format; |
local profw = VFLUI.Window:new(VFLFULLSCREEN_DIALOG); |
local profw = VFLUI.Window:new(VFLFULLSCREEN); |
VFLUI.Window.SetDefaultFraming(profw, 24); |
profw:SetText("VFL Profiler"); |
profw:SetTitleColor(0,0,.6); |
else |
toggle:SetText("Start Profiling"); |
toggle:SetScript("OnClick", function() |
VFLUI.MessageBox("Confirm", "Start profiling and reload the UI? |cFFFF0000WARNING: Profiling uses up a lot of UI resources and can cause significant slowdowns and 'jerky' behavior.", nil, "Yes", function() |
VFLUI.MessageBox("Confirm", "Start profiling? |cFFFF0000WARNING: Profiling uses up a lot of UI resources and can cause significant slowdowns and 'jerky' behavior. You must quit the game and relaunch it! Reload UI is not sufficient.", nil, "Yes", function() |
SetCVar("scriptProfile", 1); ReloadUI(); |
end, "No", VFL.Noop, profw); |
end); |
end |
local reset = VFLUI.Button:new(ca); |
reset:SetPoint("TOPLEFT", toggle, "TOPRIGHT"); |
reset:SetWidth(100); reset:SetHeight(25); reset:Show(); |
reset:SetText("Reset CPU"); |
reset:SetScript("OnClick", function() VFLP.ResetCPU(); end); |
--------------------------------------------------------------- |
-- DATA LIST |
-- paint = function(cell, data) cell:SetText(data.nbPicCPU); end; }; |
{ title = "CPU/frame"; width = 55; r=.75; g=.35; b=.35; jh="RIGHT"; |
paint = function(cell, data) cell:SetText(FormatMicro(data.raCPU / VFLP.GetFramesPerSummaryUpdate())); end; }; |
{ title = "CPU time"; width = 55; r=.95;g=.5;b=.5; jh="RIGHT"; |
paint = function(cell, data) cell:SetText(FormatMicro(data.CPU)); end; }; |
{ title = "FPS impact"; width = 65; r=0;g=.7;b=0; jh="RIGHT"; |
paint = function(cell, data) |
local timePerFrame = data.raCPU / VFLP.GetFramesPerSummaryUpdate(); |
paint = function(cell, data) cell:SetText(FormatMicro(data.raCPU / VFLP.GetFramesPerObjectUpdate())); end; }; |
{ title = "CPU%"; width = 45; r=1;g=1;b=1; jh="RIGHT"; |
paint = function(cell, data) cell:SetFormattedText("%0.2f%%", data.raCPU * 100 / VFLP.GetObjectUpdateInterval()); end; }; |
{ title = "sec"; width = 55; r=.95;g=.5;b=.5; jh="RIGHT"; |
{ title = "CPU time"; width = 55; r=.95;g=.5;b=.5; jh="RIGHT"; |
paint = function(cell, data) cell:SetText(FormatMicro(data.CPU)); end; }; |
}; |
local UpdateMode; |
local mb1 = VFLUI.Button:new(ca); |
mb1:SetPoint("LEFT", toggle, "RIGHT", 15, 0); |
mb1:SetPoint("LEFT", reset, "RIGHT", 15, 0); |
mb1:SetWidth(60); mb1:SetHeight(25); mb1:Show(); |
mb1:SetText("Addons"); |
mb1:SetScript("OnClick", function() UpdateMode(1); end); |