General > Developers Corner
Weapon Organization In Spawn Menu
JamminR:
I've no idea what to use as your menu hook though for spawn menu.
Did you find one?
Or are you editing typical loadout hook?
All my examples are just how it could be done, IF the right spawn menu hook was found.
Reaper_007_:
I was thinking about just editing the already there spawn menu. Would make it much easier. This is the path to the spawn menu if you want to take a look at it if it helps.
D:\Steam\steamapps\common\GarrysMod\garrysmod\gamemodes\sandbox\gamemode\spawnmenu\creationmenu\content\contenttypes\weapons.lua
JamminR:
Though you can learn alot by looking at source, I'd never edit original code.
That's why Gmod is quite extensible, with hooks, and functions that can be used to overwrite original results.
That file you found even includes your answer of a possible hook to use in it's first line.
Good source reference also - https://github.com/Facepunch/garrysmod/blob/master/garrysmod/gamemodes/sandbox/gamemode/spawnmenu/creationmenu/content/contenttypes/weapons.lua
hook.Add( "PopulateWeapons")
It's not documented in the Wiki, but perhaps you could tinker, even test disrupting it by returning false in a function that hooks into it.
Navigation
[0] Message Index
[*] Previous page
Go to full version