Update README.md
This commit is contained in:
parent
bf1221578d
commit
cddb2ff6ad
19
README.md
19
README.md
|
@ -55,24 +55,9 @@ Config.Dev = false
|
||||||
Config.Nui = true -- will wait NUI trigger RegisterNUICallback('AppReady', ...) before init
|
Config.Nui = true -- will wait NUI trigger RegisterNUICallback('AppReady', ...) before init
|
||||||
```
|
```
|
||||||
|
|
||||||
# Hook method
|
# This boilerplate will export all method from all modules
|
||||||
|
|
||||||
```lua
|
|
||||||
impl:HookMethod(methodName, hookFunc) --hookFunc must return args from reciver
|
|
||||||
```
|
|
||||||
|
|
||||||
## example:
|
|
||||||
|
|
||||||
```lua
|
|
||||||
local hud = main:GetImpl("Hud")
|
|
||||||
hud:HookMethod("ShowHUD", function(this, ...)
|
|
||||||
main:LogInfo("ShowHud was called")
|
|
||||||
return(...)
|
|
||||||
end)
|
|
||||||
```
|
|
||||||
|
|
||||||
# Export all method from all modules
|
|
||||||
|
|
||||||
|
- To call method in module out side of script
|
||||||
```lua
|
```lua
|
||||||
exports['lr_addon']:ImplCall(name, func, ...) --Call a method in module external
|
exports['lr_addon']:ImplCall(name, func, ...) --Call a method in module external
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in New Issue
Block a user