{"id":13525852,"url":"https://github.com/Mestima/GodotHook","last_synced_at":"2025-04-01T06:30:40.456Z","repository":{"id":40302650,"uuid":"492094218","full_name":"Mestima/GodotHook","owner":"Mestima","description":"A simple custom event system for Godot Engine","archived":false,"fork":false,"pushed_at":"2024-03-31T12:16:54.000Z","size":21,"stargazers_count":48,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-02T10:34:04.250Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Mestima.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-05-14T02:39:10.000Z","updated_at":"2024-10-27T22:12:45.000Z","dependencies_parsed_at":"2024-03-11T18:58:41.353Z","dependency_job_id":null,"html_url":"https://github.com/Mestima/GodotHook","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mestima%2FGodotHook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mestima%2FGodotHook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mestima%2FGodotHook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mestima%2FGodotHook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mestima","download_url":"https://codeload.github.com/Mestima/GodotHook/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246596556,"owners_count":20802844,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T06:01:22.868Z","updated_at":"2025-04-01T06:30:40.191Z","avatar_url":"https://github.com/Mestima.png","language":"C++","readme":"# GodotHook\n A lite custom event system for Godot Engine\n \n## Supported versions\n| Godot version | Supported | Branch |\n| - | - | - |\n| 3.x | yes | 3.x |\n| 4.x | yes | main |\n\n## Compilation\n- Download GodotHook and place it to the Godot `modules` folder.\n- Rename `GodotHook-master` to `GodotHook`\n- Compile Godot like usual using one of [these guides](https://docs.godotengine.org/en/stable/development/compiling/index.html).\n\nExample compilation `Windows` command: `scons p=windows tools=yes -j4`\n\n## Methods\n```gdscript\nhook.GetTable()\nhook.Add(event: String, uid: String, function: Callable)\nhook.Call(event: String, args: Array = [], defer: bool = false)\nhook.Remove(event: String, uid: String)\n```\n\n## Usage\n`hook.Add` creates a new listening event and `hook.Call` executes all listening events of the same type, for example:\n\n```gdscript\n# autorun.gd\n\n@onready var hook: Hook = Hook.new()\n\nfunc printHookOutput1(a: String, b: String):\n    print(a, \" \", b)\n    \nfunc printHookOutput2(a: String, b: String):\n    print(a, \" \", b)\n\nhook.Add(\"OnReady\", \"UniqueName1\", Callable(self, \"printHookOutput1\"))\nhook.Add(\"OnReady\", \"UniqueName2\", Callable(self, \"printHookOutput2\"))\n```\n```gdscript\n# any node script\n\nfunc _ready():\n    hook.Call(\"OnReady\", [\"Hey!\", \"It's OnReady hook!\"])\n    hook.Call(\"OnReady\", [\"Hey!\", \"It's OnReady hook, but deferred!\"], true)\n```\n\n`hook.Remove` removes any listening event by its name and type:\n\n```gdscript\n# can be executed at any place\n\nhook.Remove(\"OnReady\", \"UniqueName\")\n```\n\n`hook.GetTable` returns a `Dictionary` with all added listening events\n\n```gdscript\n# can be executed at any place\n\nvar hookTable: Dictionary = hook.GetTable()\n```\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=Mestima/GodotHook\u0026type=Date)](https://star-history.com/#Mestima/GodotHook\u0026Date)\n","funding_links":[],"categories":["Modules"],"sub_categories":["3D"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMestima%2FGodotHook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMestima%2FGodotHook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMestima%2FGodotHook/lists"}