@@ -925,7 +925,7 @@ local function addDTreeNode(parentNode, nodeData, specialType, isRoot, varType,
925925 return childNode
926926end
927927
928- local function buildDTree (luaState , parentPanel , rvarType )
928+ local function buildDTree (luaState , parentPanel , rvarType , dataTableOverride )
929929 local dTree = vgui .Create (" BP_DTree" , parentPanel )
930930 dTree :Dock (FILL )
931931 -- dTree:SetVisible(false)
@@ -939,7 +939,13 @@ local function buildDTree(luaState, parentPanel, rvarType)
939939 varType = subModuleSplit [2 ] -- ew
940940 end
941941
942- local dataTable = blobsProfiler .GetDataTableForRealm (luaState , rvarType ) or {}
942+ local dataTable
943+
944+ if dataTableOverride then
945+ dataTable = dataTableOverride
946+ else
947+ dataTable = blobsProfiler .GetDataTableForRealm (luaState , rvarType ) or {}
948+ end
943949
944950 if varType == " Globals" then -- TODO: make this shit modular
945951 for key , value in pairs (dataTable ) do
@@ -965,41 +971,6 @@ local function buildDTree(luaState, parentPanel, rvarType)
965971 blobsProfiler .Menu .TypeFolders [luaState ][nodeData .special ].nodeData = nodeData
966972 end
967973 end
968- elseif varType == " Hooks" then
969- for k , v in pairs (dataTable ) do
970- table.insert (rootNodes , {
971- key = k ,
972- value = v
973- })
974- end
975- elseif varType == " ConCommands" then
976- for k , v in pairs (dataTable ) do
977- table.insert (rootNodes , {
978- key = k ,
979- value = v
980- })
981- end
982- elseif varType == " Files" then
983- for k , v in pairs (dataTable ) do
984- table.insert (rootNodes , {
985- key = k ,
986- value = v
987- })
988- end
989- elseif varType == " Network" then
990- for k , v in pairs (dataTable ) do
991- table.insert (rootNodes , {
992- key = k ,
993- value = v
994- })
995- end
996- elseif varType == " Timers" then
997- for k , v in pairs (dataTable ) do
998- table.insert (rootNodes , {
999- key = k ,
1000- value = v
1001- })
1002- end
1003974 elseif rvarType == " SQLite.Schema" then
1004975 if dataTable .Tables and dataTable .Indices then
1005976 table.insert (rootNodes , {
@@ -1012,6 +983,13 @@ local function buildDTree(luaState, parentPanel, rvarType)
1012983 value = blobsProfiler .TableSort .KeyAlphabetical (dataTable .Indices )
1013984 })
1014985 end
986+ else
987+ for k , v in pairs (dataTable ) do
988+ table.insert (rootNodes , {
989+ key = k ,
990+ value = v
991+ })
992+ end
1015993 end
1016994
1017995 if rvarType ~= " SQLite.Schema" then -- ewww
@@ -1033,11 +1011,11 @@ if blobsProfiler.Menu.MenuFrame && IsValid(blobsProfiler.Menu.MenuFrame) then
10331011 blobsProfiler .Menu .MenuFrame :Remove () -- kill on lua refresh
10341012end
10351013
1036- local function profileLog (realm , event )
1014+ --[[ local function profileLog(realm, event)
10371015 local luaCallInfo = debug.getinfo(3, "fnS")
10381016 if not blobsProfiler.Client.Profile.Raw[luaCallInfo.func] then return end
10391017 print(event, luaCallInfo.name, luaCallInfo.func, luaCallInfo.source)
1040- end
1018+ end]]
10411019
10421020blobsProfiler .Tabs = {}
10431021blobsProfiler .Tabs .Client = {}
@@ -1106,7 +1084,7 @@ concommand.Add("blobsprofiler", function(ply, cmd, args, argStr)
11061084 local tabMenu = vgui .Create ( " DPropertySheet" , blobsProfiler .Menu .MenuFrame )
11071085 tabMenu :Dock ( FILL )
11081086
1109- blobsProfiler .Menu .MenuFrame .ProfilerPanel = vgui .Create (" DPanel" , blobsProfiler .Menu .MenuFrame )
1087+ --[[ blobsProfiler.Menu.MenuFrame.ProfilerPanel = vgui.Create("DPanel", blobsProfiler.Menu.MenuFrame)
11101088 local profilerPanel = blobsProfiler.Menu.MenuFrame.ProfilerPanel
11111089 profilerPanel:Dock(RIGHT)
11121090 profilerPanel:DockMargin(5, 10, 0, 0)
@@ -1126,7 +1104,7 @@ concommand.Add("blobsprofiler", function(ply, cmd, args, argStr)
11261104 startProfiling:SetTall(30)
11271105 startProfiling.DoClick = function()
11281106 debug.sethook(function(e) profileLog("Client", e) end, "cr")
1129- end
1107+ end]]
11301108
11311109 local tabClient = vgui .Create (" DPropertySheet" , tabMenu )
11321110 tabMenu :AddSheet (" Client" , tabClient , " icon16/application.png" )
@@ -1253,10 +1231,16 @@ concommand.Add("blobsprofiler", function(ply, cmd, args, argStr)
12531231
12541232 moduleTab .OnActiveTabChanged = function (s , pnlOld , pnlNew )
12551233 if blobsProfiler .Modules [moduleName ].SubModules [pnlNew :GetText ()].OnOpen then
1256- blobsProfiler .Modules [moduleName ].SubModules [pnlNew :GetText ()].OnOpen (luaState )
1234+ local useTab
1235+ if luaState == " Client" then
1236+ useTab = blobsProfiler .Modules [moduleName ].SubModules [pnlNew :GetText ()].ClientTab
1237+ else
1238+ useTab = blobsProfiler .Modules [moduleName ].SubModules [pnlNew :GetText ()].ServerTab
1239+ end
1240+ blobsProfiler .Modules [moduleName ].SubModules [pnlNew :GetText ()].OnOpen (luaState , useTab )
12571241 end
12581242
1259- if not blobsProfiler [luaState ][moduleName ][pnlNew :GetText ()] then
1243+ if not blobsProfiler [luaState ][moduleName ] or not blobsProfiler [ luaState ][ moduleName ] [pnlNew :GetText ()] then
12601244 if blobsProfiler .Modules [moduleName ].SubModules [pnlNew :GetText ()].UpdateRealmData then
12611245 blobsProfiler .Modules [moduleName ].SubModules [pnlNew :GetText ()]:UpdateRealmData (luaState )
12621246 if luaState == " Server" then
@@ -1324,7 +1308,7 @@ concommand.Add("blobsprofiler", function(ply, cmd, args, argStr)
13241308
13251309 if pnlNew :GetText () == " Server" and blobsProfiler .Modules [subActiveTab :GetText ()] and firstSubModule [subActiveTab :GetText ()] then
13261310 if firstSubModule [subActiveTab :GetText ()].data .OnOpen then
1327- firstSubModule [subActiveTab :GetText ()].data .OnOpen (" Server" )
1311+ firstSubModule [subActiveTab :GetText ()].data .OnOpen (" Server" , firstSubModule [ subActiveTab : GetText ()]. data . ServerTab )
13281312 end
13291313
13301314 if firstSubModule [subActiveTab :GetText ()].data .UpdateRealmData then
@@ -1344,7 +1328,7 @@ concommand.Add("blobsprofiler", function(ply, cmd, args, argStr)
13441328 end
13451329
13461330 if blobsProfiler .Modules [pnlNew :GetText ()].OnOpen then
1347- blobsProfiler .Modules [pnlNew :GetText ()].OnOpen (" Client" )
1331+ blobsProfiler .Modules [pnlNew :GetText ()].OnOpen (" Client" , blobsProfiler . Modules [ pnlNew : GetText ()]. ClientTab )
13481332 end
13491333 end
13501334
@@ -1358,12 +1342,12 @@ concommand.Add("blobsprofiler", function(ply, cmd, args, argStr)
13581342 end
13591343
13601344 if blobsProfiler .Modules [pnlNew :GetText ()].OnOpen then
1361- blobsProfiler .Modules [pnlNew :GetText ()].OnOpen (" Server" )
1345+ blobsProfiler .Modules [pnlNew :GetText ()].OnOpen (" Server" , blobsProfiler . Modules [ pnlNew : GetText ()]. ServerTab )
13621346 end
13631347
13641348 if blobsProfiler .Modules [pnlNew :GetText ()] and firstSubModule [pnlNew :GetText ()] then
13651349 if firstSubModule [pnlNew :GetText ()].data .OnOpen then
1366- firstSubModule [pnlNew :GetText ()].data .OnOpen (" Server" )
1350+ firstSubModule [pnlNew :GetText ()].data .OnOpen (" Server" , firstSubModule [ pnlNew : GetText ()]. data . ServerTab )
13671351 end
13681352 if firstSubModule [pnlNew :GetText ()].data .UpdateRealmData then
13691353 if blobsProfiler .Server [pnlNew :GetText ()][firstSubModule [pnlNew :GetText ()].name ] then return end
0 commit comments