Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- This can be found at garrysmod\gamemodes\sandbox\gamemode\spawnmenu
- include( "spawnmenu/spawnmenu.lua" )
- --[[---------------------------------------------------------
- If false is returned then the spawn menu is never created.
- This saves load times if your mod doesn't actually use the
- spawn menu for any reason.
- -----------------------------------------------------------]]
- function GM:SpawnMenuEnabled()
- return true
- end
- --[[---------------------------------------------------------
- Called when spawnmenu is trying to be opened.
- Return false to dissallow it.
- -----------------------------------------------------------]]
- function GM:SpawnMenuOpen()
- GAMEMODE:SuppressHint( "OpeningMenu" )
- GAMEMODE:AddHint( "OpeningContext", 20 )
- return true
- end
- --[[---------------------------------------------------------
- Called when context menu is trying to be opened.
- Return false to dissallow it.
- -----------------------------------------------------------]]
- function GM:ContextMenuOpen()
- GAMEMODE:SuppressHint( "OpeningContext" )
- GAMEMODE:AddHint( "ContextClick", 20 )
- return true
- end
- --[[---------------------------------------------------------
- Backwards compatibility. Do Not Use!!!
- -----------------------------------------------------------]]
- function GM:GetSpawnmenuTools( name )
- return spawnmenu.GetToolMenu( name )
- end
- --[[---------------------------------------------------------
- Backwards compatibility. Do Not Use!!!
- -----------------------------------------------------------]]
- function GM:AddSTOOL( category, itemname, text, command, controls, cpanelfunction )
- self:AddToolmenuOption( "Main", category, itemname, text, command, controls, cpanelfunction )
- end
- --[[---------------------------------------------------------
- Don't hook or override this function.
- Hook AddToolMenuTabs instead!
- -----------------------------------------------------------]]
- function GM:AddGamemodeToolMenuTabs()
- -- This is named like this to force it to be the first tab
- spawnmenu.AddToolTab( "Main", "#spawnmenu.tools_tab", "icon16/wrench.png" )
- spawnmenu.AddToolTab( "Utilities", "#spawnmenu.utilities_tab", "icon16/page_white_wrench.png" )
- end
- --[[---------------------------------------------------------
- Add your custom tabs here.
- -----------------------------------------------------------]]
- function GM:AddToolMenuTabs()
- -- Hook me!
- end
- --[[---------------------------------------------------------
- Add categories to your tabs. FROM ME THE GUY WHO BUT DIS IN DA PASTEBIN: I don't suppose you have these categories.
- -----------------------------------------------------------]]
- function GM:AddGamemodeToolMenuCategories()
- spawnmenu.AddToolCategory( "Main", "Constraints", "#spawnmenu.tools.constraints" )
- spawnmenu.AddToolCategory( "Main", "Construction", "#spawnmenu.tools.construction" )
- spawnmenu.AddToolCategory( "Main", "Poser", "#spawnmenu.tools.posing" )
- spawnmenu.AddToolCategory( "Main", "Render", "#spawnmenu.tools.render" )
- end
- --[[---------------------------------------------------------
- Add categories to your tabs
- -----------------------------------------------------------]]
- function GM:AddToolMenuCategories()
- -- Hook this function to add custom stuff
- end
- --[[---------------------------------------------------------
- Add categories to your tabs
- -----------------------------------------------------------]]
- function GM:PopulatePropMenu()
- -- This function makes the engine load the spawn menu text files.
- -- We call it here so that any gamemodes not using the default
- -- spawn menu can totally not call it.
- spawnmenu.PopulateFromEngineTextFiles()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement