Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions lua/autorun/gprofiler_load.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
GProfiler = GProfiler or { Config = {}, Access = {} }
GProfiler = GProfiler or { Config = {}, Access = {}, Utils = {} }

local logLevels = {
[1] = {"DEBUG", Color(0, 255, 0)},
Expand All @@ -25,16 +25,17 @@ local incFuncs = {

local function incFile(f)
(incFuncs[string.GetFileFromFilename(f):sub(1,2)] or incFuncs.sh)(f)
GProfiler.Log(string.format("Loading file %s", f), 5)
GProfiler.Log(string.format("Loaded file %s", f), 5)
end

local function incFolder(folder, fileOnly)
local function incFolder(folder, subFileOnly, fileOnly)
GProfiler.Log(string.format("Loading folder %s", folder), 5)

local files, folders = file.Find(folder.."/*", "LUA")
for _, f in ipairs(files) do incFile(string.format("%s/%s", folder, f)) end

if fileOnly then return end
for _, f in ipairs(folders) do incFolder(folder.."/"..f, true) end
for _, f in ipairs(folders) do incFolder(folder.."/"..f, nil, subFileOnly) end
end

incFile("gprofiler/sv_init.lua")
Expand All @@ -43,6 +44,8 @@ incFile("gprofiler/sh_utils.lua")
incFile("gprofiler/cl_language.lua")
incFile("gprofiler/cl_menu.lua")
incFile("gprofiler/sh_access.lua")
incFolder("gprofiler/profilers")
incFolder("gprofiler/modules")
incFolder("gprofiler/profilers", true)

hook.Run("GProfiler.Loaded")
GProfiler.Ready = true
3 changes: 2 additions & 1 deletion lua/gprofiler/cl_language.lua
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@ GProfiler.Language:AddLanguage("english", function(Lang)
Lang:AddPhrase("profiler_no_profile", "No profile data available! (More than 100 queries?)")

-- Tab Names
Lang:AddPhrase("tab_overview", "Overview")
Lang:AddPhrase("tab_hooks", "Hooks")
Lang:AddPhrase("tab_networking", "Networking")
Lang:AddPhrase("tab_networking", "Network")
Lang:AddPhrase("tab_functions", "Functions")
Lang:AddPhrase("tab_commands", "Commands")
Lang:AddPhrase("tab_timers", "Timers")
Expand Down
Loading