garrysmod-requests icon indicating copy to clipboard operation
garrysmod-requests copied to clipboard

Ability to remove default tools from the spawnmenu

Open fruitwasp opened this issue 10 years ago • 6 comments

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.

fruitwasp avatar Dec 17 '15 23:12 fruitwasp

A better fix would be checking if said convar is enabled before adding them to the spawnmenu tool list

bmwalters avatar Dec 17 '15 23:12 bmwalters

None of your "solutions" play well with editing the convar or whatever live.

robotboy655 avatar Dec 18 '15 00:12 robotboy655

@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.

Jvs34 avatar Dec 18 '15 10:12 Jvs34

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 toolmode_allow*. is changed.

Jvs34 avatar Dec 18 '15 10:12 Jvs34

Replicated cvars are fixed now, so @Jvs34's solution should work, right?

fruitwasp avatar Feb 17 '16 23:02 fruitwasp

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?)

NanoAi avatar Mar 29 '16 05:03 NanoAi