-
Notifications
You must be signed in to change notification settings - Fork 758
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow local NPC functions to be public or private #2142
Conversation
and i think need add some tests to call local functions in CI |
@4144 yes, sure, I will do this after I write the docs |
@4144 I have added unit tests |
moving this to the next milestone I felt the function MyFunction { … } // implicitly private
private function MyFunction { … } // explicitly private
public function MyFunction { … } // explicitly public It's cleaner, and the |
ba66d8c
to
3e3c51d
Compare
b6f5cdd
to
62de272
Compare
I'll do some commit squashing once the review process is over |
I added two config flags for more flexibility:
- script @mycommand FAKE_NPC,{
public function OnInit {
bindatcmd("mycommand", "@mycommand::OnCall");
return;
}
private function doSomething {
dispbottom(getarg(0));
return;
}
public function OnCall {
doSomething(.@atcmd_parameters$[0]);
return;
}
} |
Furthermore your commits need some squashing. |
@Kenpachi2k13 as noted earlier, I do intend on squashing once the review process is done. |
This is my proposal to fix #2137:
On
public function ...
.this allows other scripts to call them as if they were part of their own script
"npc name"::MyFunction();