mirror of
				https://github.com/Mestima/GodotHook.git
				synced 2025-10-30 17:02:34 +00:00 
			
		
		
		
	Revert "README updated according lowercase naming convention"
This reverts commit dd24f3fd45.
			
			
This commit is contained in:
		
							
								
								
									
										26
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										26
									
								
								README.md
									
									
									
									
									
								
							| @ -16,14 +16,14 @@ Example compilation `Windows` command: `scons p=windows tools=yes -j4` | |||||||
|  |  | ||||||
| ## Methods | ## Methods | ||||||
| ```gdscript | ```gdscript | ||||||
| hook.getTable() | hook.GetTable() | ||||||
| hook.add(event: String, uid: String, function: Callable) | hook.Add(event: String, uid: String, function: Callable) | ||||||
| hook.call(event: String, args: Array = [], defer: bool = false) | hook.Call(event: String, args: Array = [], defer: bool = false) | ||||||
| hook.remove(event: String, uid: String) | hook.Remove(event: String, uid: String) | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| ## Usage | ## Usage | ||||||
| `hook.add` creates a new listening event and `hook.call` executes all listening events of the same type, for example: | `hook.Add` creates a new listening event and `hook.Call` executes all listening events of the same type, for example: | ||||||
|  |  | ||||||
| ```gdscript | ```gdscript | ||||||
| # autorun.gd | # autorun.gd | ||||||
| @ -36,31 +36,31 @@ func printHookOutput1(a: String, b: String): | |||||||
| func printHookOutput2(a: String, b: String): | func printHookOutput2(a: String, b: String): | ||||||
|     print(a, " ", b) |     print(a, " ", b) | ||||||
|  |  | ||||||
| hook.add("OnReady", "UniqueName1", Callable(self, "printHookOutput1")) | hook.Add("OnReady", "UniqueName1", Callable(self, "printHookOutput1")) | ||||||
| hook.add("OnReady", "UniqueName2", Callable(self, "printHookOutput2")) | hook.Add("OnReady", "UniqueName2", Callable(self, "printHookOutput2")) | ||||||
| ``` | ``` | ||||||
| ```gdscript | ```gdscript | ||||||
| # any node script | # any node script | ||||||
|  |  | ||||||
| func _ready(): | func _ready(): | ||||||
|     hook.call("OnReady", ["Hey!", "It's OnReady hook!"]) |     hook.Call("OnReady", ["Hey!", "It's OnReady hook!"]) | ||||||
|     hook.call("OnReady", ["Hey!", "It's OnReady hook, but deferred!"], true) |     hook.Call("OnReady", ["Hey!", "It's OnReady hook, but deferred!"], true) | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| `hook.remove` removes any listening event by its name and type: | `hook.Remove` removes any listening event by its name and type: | ||||||
|  |  | ||||||
| ```gdscript | ```gdscript | ||||||
| # can be executed at any place | # can be executed at any place | ||||||
|  |  | ||||||
| hook.remove("OnReady", "UniqueName") | hook.Remove("OnReady", "UniqueName") | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| `hook.getTable` returns a `Dictionary` with all added listening events | `hook.GetTable` returns a `Dictionary` with all added listening events | ||||||
|  |  | ||||||
| ```gdscript | ```gdscript | ||||||
| # can be executed at any place | # can be executed at any place | ||||||
|  |  | ||||||
| var hookTable: Dictionary = hook.getTable() | var hookTable: Dictionary = hook.GetTable() | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| ## Star History | ## Star History | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user