Added played class time to /played, also added a command to disable it
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
|
||||
|
||||
local dversion = 401
|
||||
local dversion = 402
|
||||
local major, minor = "DetailsFramework-1.0", dversion
|
||||
local DF, oldminor = LibStub:NewLibrary(major, minor)
|
||||
|
||||
|
||||
+18
-14
@@ -6018,13 +6018,15 @@ function detailsFramework:OpenLoadConditionsPanel(optionsTable, callback, frameO
|
||||
if IS_WOW_PROJECT_MAINLINE then
|
||||
local talentList = {}
|
||||
for _, talentTable in ipairs(detailsFramework:GetCharacterTalents()) do
|
||||
tinsert(talentList, {
|
||||
name = talentTable.Name,
|
||||
set = loadConditionsFrame.OnRadioCheckboxClick,
|
||||
param = talentTable.ID,
|
||||
get = function() return loadConditionsFrame.OptionsTable.talent [talentTable.ID] or loadConditionsFrame.OptionsTable.talent [talentTable.ID .. ""] end,
|
||||
texture = talentTable.Texture,
|
||||
})
|
||||
if talentTable.ID then
|
||||
tinsert(talentList, {
|
||||
name = talentTable.Name,
|
||||
set = loadConditionsFrame.OnRadioCheckboxClick,
|
||||
param = talentTable.ID,
|
||||
get = function() return loadConditionsFrame.OptionsTable.talent [talentTable.ID] or loadConditionsFrame.OptionsTable.talent [talentTable.ID .. ""] end,
|
||||
texture = talentTable.Texture,
|
||||
})
|
||||
end
|
||||
end
|
||||
local talentGroup = detailsFramework:CreateCheckboxGroup (loadConditionsFrame, talentList, name, {width = 200, height = 200, title = "Characer Talents"}, {offset_x = 150, amount_per_line = 3})
|
||||
talentGroup:SetPoint("topleft", loadConditionsFrame, "topleft", anchorPositions.talent [1], anchorPositions.talent [2])
|
||||
@@ -6321,13 +6323,15 @@ function detailsFramework:OpenLoadConditionsPanel(optionsTable, callback, frameO
|
||||
--update the talents (might have changed if the player changed its specialization)
|
||||
local talentList = {}
|
||||
for _, talentTable in ipairs(detailsFramework:GetCharacterTalents()) do
|
||||
tinsert(talentList, {
|
||||
name = talentTable.Name,
|
||||
set = DetailsFrameworkLoadConditionsPanel.OnRadioCheckboxClick,
|
||||
param = talentTable.ID,
|
||||
get = function() return DetailsFrameworkLoadConditionsPanel.OptionsTable.talent [talentTable.ID] or DetailsFrameworkLoadConditionsPanel.OptionsTable.talent [talentTable.ID .. ""] end,
|
||||
texture = talentTable.Texture,
|
||||
})
|
||||
if talentTable.ID then
|
||||
tinsert(talentList, {
|
||||
name = talentTable.Name,
|
||||
set = DetailsFrameworkLoadConditionsPanel.OnRadioCheckboxClick,
|
||||
param = talentTable.ID,
|
||||
get = function() return DetailsFrameworkLoadConditionsPanel.OptionsTable.talent [talentTable.ID] or DetailsFrameworkLoadConditionsPanel.OptionsTable.talent [talentTable.ID .. ""] end,
|
||||
texture = talentTable.Texture,
|
||||
})
|
||||
end
|
||||
end
|
||||
DetailsFrameworkLoadConditionsPanel.TalentGroup:SetOptions (talentList)
|
||||
end
|
||||
|
||||
+4
-3
@@ -3127,7 +3127,9 @@ function Details.GetPlayTimeOnClassString()
|
||||
end
|
||||
|
||||
hooksecurefunc("ChatFrame_DisplayTimePlayed", function()
|
||||
print(Details.GetPlayTimeOnClassString())
|
||||
if (Details.played_class_time) then
|
||||
print(Details.GetPlayTimeOnClassString() .. " (/details playedclass)")
|
||||
end
|
||||
end)
|
||||
|
||||
--game freeze prevention, there are people calling UpdateAddOnMemoryUsage() making the game client on the end user to freeze, this is bad, really bad.
|
||||
@@ -3137,8 +3139,7 @@ local bigStutterCounter = 0
|
||||
local UpdateAddOnMemoryUsage_Original = _G.UpdateAddOnMemoryUsage
|
||||
Details.UpdateAddOnMemoryUsage_Original = _G.UpdateAddOnMemoryUsage
|
||||
|
||||
--to ignore this, use /run _G["UpdateAddOnMemoryUsage"] = Details.UpdateAddOnMemoryUsage_Original or add to any script that run on login
|
||||
_G["UpdateAddOnMemoryUsage"] = function()
|
||||
Details.UpdateAddOnMemoryUsage_Custom = function()
|
||||
local currentTime = debugprofilestop()
|
||||
UpdateAddOnMemoryUsage_Original()
|
||||
local deltaTime = debugprofilestop() - currentTime
|
||||
|
||||
@@ -1367,6 +1367,9 @@ local default_global_data = {
|
||||
merge_pet_abilities = false,
|
||||
merge_player_abilities = false,
|
||||
|
||||
played_class_time = true,
|
||||
check_stuttering = true,
|
||||
|
||||
--spell category feedback
|
||||
spell_category_savedtable = {},
|
||||
spell_category_latest_query = 0,
|
||||
|
||||
@@ -70,6 +70,19 @@ function SlashCmdList.DETAILS (msg, editbox)
|
||||
_detalhes:ShutDownAllInstances()
|
||||
end
|
||||
|
||||
elseif (command == "classtime" or command == "playedclass") then
|
||||
Details.played_class_time = not Details.played_class_time
|
||||
Details:Msg("played class:", Details.played_class_time and "enabled" or "disabled")
|
||||
|
||||
elseif (command == "stopperfcheck") then
|
||||
Details.check_stuttering = not Details.check_stuttering
|
||||
Details:Msg("stuttering/freeze checker:", Details.check_stuttering and "enabled" or "disabled")
|
||||
if (Details.check_stuttering) then
|
||||
_G["UpdateAddOnMemoryUsage"] = Details.UpdateAddOnMemoryUsage_Custom
|
||||
else
|
||||
_G["UpdateAddOnMemoryUsage"] = Details.UpdateAddOnMemoryUsage_Original
|
||||
end
|
||||
|
||||
elseif (command == "perf") then
|
||||
local performanceData = Details.performanceData
|
||||
local framesLost = ceil(performanceData.deltaTime / 60)
|
||||
|
||||
@@ -586,6 +586,12 @@ function Details:StartMeUp() --I'll never stop!
|
||||
end
|
||||
end)
|
||||
|
||||
--to ignore this, use /run _G["UpdateAddOnMemoryUsage"] = Details.UpdateAddOnMemoryUsage_Original or add to any script that run on login
|
||||
--also the slash command "/details stopperfcheck" stop it as well
|
||||
if (Details.check_stuttering) then
|
||||
_G["UpdateAddOnMemoryUsage"] = Details.UpdateAddOnMemoryUsage_Custom
|
||||
end
|
||||
|
||||
function Details:InstallOkey()
|
||||
return true
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user