Open fruitwasp opened 8 years ago
A better fix would be checking if said convar is enabled before adding them to the spawnmenu tool list
None of your "solutions" play well with editing the convar or whatever live.
@robotboy655 If you fix Lua replicated convars ( https://github.com/Facepunch/garrysmod-issues/issues/1234 ) then maybe we can have them back in ToolObj:CreateConVars(), so then you can hide them in https://github.com/garrynewman/garrysmod/blob/master/garrysmod/gamemodes/sandbox/gamemode/spawnmenu/toolmenu.lua 's PerformLayout or something when their cvar is disabled.
Of course I know it's not as simple as "hurr just fix it", but it'd kill two birds with one stone.
If replicated cvars are out of the question for being too annoying to fix, we could rely on global networkvars ( I know, bad as long as they're using garry's implementation until we replace them with _Kilburn's ) and do the syncing when the cvar callback of toolmodeallow*. is changed.
Replicated cvars are fixed now, so @Jvs34's solution should work, right?
Why not have the tools menu work sort of like a table where you can put objects in and take objects out. In theory this would also allow people to have their own categories and their own custom tool menu order for easier access. (The rest of the Spawn Menu can already be edited so why can't the tool menu?)
I would like to remove specific tools from the spawnmenu. I think it's cleaner to not show blocked/restricted tools at all. Right now one can only disable them with
toolmode_allow_...
, which still shows them in the list.Maybe write a function like
spawnmenu.RemoveTool(toolmode : string)
and remove them whenever disabled with the cvar? The function could be used to hide tools per usergroup.