@@ -925,7 +925,7 @@ local function addDTreeNode(parentNode, nodeData, specialType, isRoot, varType,
925
925
return childNode
926
926
end
927
927
928
- local function buildDTree (luaState , parentPanel , rvarType )
928
+ local function buildDTree (luaState , parentPanel , rvarType , dataTableOverride )
929
929
local dTree = vgui .Create (" BP_DTree" , parentPanel )
930
930
dTree :Dock (FILL )
931
931
-- dTree:SetVisible(false)
@@ -939,7 +939,13 @@ local function buildDTree(luaState, parentPanel, rvarType)
939
939
varType = subModuleSplit [2 ] -- ew
940
940
end
941
941
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
943
949
944
950
if varType == " Globals" then -- TODO: make this shit modular
945
951
for key , value in pairs (dataTable ) do
@@ -965,41 +971,6 @@ local function buildDTree(luaState, parentPanel, rvarType)
965
971
blobsProfiler .Menu .TypeFolders [luaState ][nodeData .special ].nodeData = nodeData
966
972
end
967
973
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
1003
974
elseif rvarType == " SQLite.Schema" then
1004
975
if dataTable .Tables and dataTable .Indices then
1005
976
table.insert (rootNodes , {
@@ -1012,6 +983,13 @@ local function buildDTree(luaState, parentPanel, rvarType)
1012
983
value = blobsProfiler .TableSort .KeyAlphabetical (dataTable .Indices )
1013
984
})
1014
985
end
986
+ else
987
+ for k , v in pairs (dataTable ) do
988
+ table.insert (rootNodes , {
989
+ key = k ,
990
+ value = v
991
+ })
992
+ end
1015
993
end
1016
994
1017
995
if rvarType ~= " SQLite.Schema" then -- ewww
@@ -1033,11 +1011,11 @@ if blobsProfiler.Menu.MenuFrame && IsValid(blobsProfiler.Menu.MenuFrame) then
1033
1011
blobsProfiler .Menu .MenuFrame :Remove () -- kill on lua refresh
1034
1012
end
1035
1013
1036
- local function profileLog (realm , event )
1014
+ --[[ local function profileLog(realm, event)
1037
1015
local luaCallInfo = debug.getinfo(3, "fnS")
1038
1016
if not blobsProfiler.Client.Profile.Raw[luaCallInfo.func] then return end
1039
1017
print(event, luaCallInfo.name, luaCallInfo.func, luaCallInfo.source)
1040
- end
1018
+ end]]
1041
1019
1042
1020
blobsProfiler .Tabs = {}
1043
1021
blobsProfiler .Tabs .Client = {}
@@ -1106,7 +1084,7 @@ concommand.Add("blobsprofiler", function(ply, cmd, args, argStr)
1106
1084
local tabMenu = vgui .Create ( " DPropertySheet" , blobsProfiler .Menu .MenuFrame )
1107
1085
tabMenu :Dock ( FILL )
1108
1086
1109
- blobsProfiler .Menu .MenuFrame .ProfilerPanel = vgui .Create (" DPanel" , blobsProfiler .Menu .MenuFrame )
1087
+ --[[ blobsProfiler.Menu.MenuFrame.ProfilerPanel = vgui.Create("DPanel", blobsProfiler.Menu.MenuFrame)
1110
1088
local profilerPanel = blobsProfiler.Menu.MenuFrame.ProfilerPanel
1111
1089
profilerPanel:Dock(RIGHT)
1112
1090
profilerPanel:DockMargin(5, 10, 0, 0)
@@ -1126,7 +1104,7 @@ concommand.Add("blobsprofiler", function(ply, cmd, args, argStr)
1126
1104
startProfiling:SetTall(30)
1127
1105
startProfiling.DoClick = function()
1128
1106
debug.sethook(function(e) profileLog("Client", e) end, "cr")
1129
- end
1107
+ end]]
1130
1108
1131
1109
local tabClient = vgui .Create (" DPropertySheet" , tabMenu )
1132
1110
tabMenu :AddSheet (" Client" , tabClient , " icon16/application.png" )
@@ -1253,10 +1231,16 @@ concommand.Add("blobsprofiler", function(ply, cmd, args, argStr)
1253
1231
1254
1232
moduleTab .OnActiveTabChanged = function (s , pnlOld , pnlNew )
1255
1233
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 )
1257
1241
end
1258
1242
1259
- if not blobsProfiler [luaState ][moduleName ][pnlNew :GetText ()] then
1243
+ if not blobsProfiler [luaState ][moduleName ] or not blobsProfiler [ luaState ][ moduleName ] [pnlNew :GetText ()] then
1260
1244
if blobsProfiler .Modules [moduleName ].SubModules [pnlNew :GetText ()].UpdateRealmData then
1261
1245
blobsProfiler .Modules [moduleName ].SubModules [pnlNew :GetText ()]:UpdateRealmData (luaState )
1262
1246
if luaState == " Server" then
@@ -1324,7 +1308,7 @@ concommand.Add("blobsprofiler", function(ply, cmd, args, argStr)
1324
1308
1325
1309
if pnlNew :GetText () == " Server" and blobsProfiler .Modules [subActiveTab :GetText ()] and firstSubModule [subActiveTab :GetText ()] then
1326
1310
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 )
1328
1312
end
1329
1313
1330
1314
if firstSubModule [subActiveTab :GetText ()].data .UpdateRealmData then
@@ -1344,7 +1328,7 @@ concommand.Add("blobsprofiler", function(ply, cmd, args, argStr)
1344
1328
end
1345
1329
1346
1330
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 )
1348
1332
end
1349
1333
end
1350
1334
@@ -1358,12 +1342,12 @@ concommand.Add("blobsprofiler", function(ply, cmd, args, argStr)
1358
1342
end
1359
1343
1360
1344
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 )
1362
1346
end
1363
1347
1364
1348
if blobsProfiler .Modules [pnlNew :GetText ()] and firstSubModule [pnlNew :GetText ()] then
1365
1349
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 )
1367
1351
end
1368
1352
if firstSubModule [pnlNew :GetText ()].data .UpdateRealmData then
1369
1353
if blobsProfiler .Server [pnlNew :GetText ()][firstSubModule [pnlNew :GetText ()].name ] then return end
0 commit comments