rebel1324 / NutScript

A free role-play framework for Garry's Mod.
http://nutscript.net
MIT License
65 stars 31 forks source link

Move intro to plugin + UI tweaks #228

Closed brianhang closed 6 years ago

brianhang commented 6 years ago

This PR moves the NS introduction into a plugin.

Since the intro was previously tied to the character menu, a new hook is added called CharacterListLoaded. This hook is called after all the character list is loaded for the character menu. This hook is then used to call the NutScriptLoaded hook, which is ran once the local player entity is valid and other NS data is loaded. The NutScriptLoaded then calls the CreateIntroduction hook, which returns a panel for the intro. If a panel is returned, the character menu only shows after the panel is removed. Otherwise, if no panel is returned, then the character menu is shown.

The plugin uses the CreateIntroduction to create the current intro panel.