Skip to content

NickHatBoecker/nhb_functions_on_the_fly

Repository files navigation

NHB Functions On The Fly for Godot 4.4+

Powered by Godot Report Issue Support me on Ko-fi

Easily create missing functions or getter/setters for variables in Godot on the fly.
You can install it via the Asset Library or downloading a copy from GitHub.

✨ Even function arguments and return types are considered, for both native and custom methods. ✨

Shortcuts are configurable in the Editor settings. Under "Plugin > NHB Functions On The Fly"

Create function Ctrl + [ Create getter/setter variable Ctrl + '
Screenshot: Create function Screenshot: Create getter/setter variable

❓ How to use

Create function

  1. Write my_button.pressed.connect(on_button_pressed)
  2. Select on_button_pressed or put cursor on it
  3. Now you can either
    • Right click > "Create function"
    • Ctrl + [
    • ⌘ Command + [ (Mac)
  4. Function arguments and return type (if any, based on variable/signal signature) will be considered.

Create getter/setter for variable

  1. Write var my_var or var my_var: String or var my_var: String = "Hello world"
  2. Select my_var or put cursor on it
  3. Now you can either
    • Right click > "Create get/set variable"
    • Ctrl + '
    • ⌘ Command + ' (Mac)
  4. Return type (if any) will be considered

🤖 Development

  1. Clone git repository
  2. Copy .env.dist to .env and update path to Godot executable
  3. You need node v20 in order to pass unit tests on commit
  4. Execute yarn

Please make sure to write/update unit tests in test directory for any new features.

Unit tests

You can run tests in Godot or via command line.

$ yarn test:unit

⭐ Contributors

Pleae feel free to create a pull request!

About

A Godot addon to easily create functions and getter/setter for variables while typing

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •