Skip to content
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

New extension: Javascript Events #1080

Closed
3 tasks done
RebornOfc opened this issue Nov 12, 2023 · 1 comment
Closed
3 tasks done

New extension: Javascript Events #1080

RebornOfc opened this issue Nov 12, 2023 · 1 comment
Labels
✨ New extension A new extension

Comments

@RebornOfc
Copy link

Description

Adds conditions, actions and expressions to compare the return value of or run a javascript code.

How to use the extension

Adds conditions, actions and expressions to compare the return value of or run a javascript code.

How to use:

  • Use the condition "Javascript code number" to compare the evaluated number out of a javascript code.
  • Use the condition "Javascript code string" to compare the evaluated string out of a javascript code.
  • Use the condition "Javascript code boolean" to compare the evaluated boolean value out of a javascript code.
  • Use the action "Run javascript code" to run a javascript code.
  • Use the expression Number to return a number out of a javascript code.
  • Use the expression String to return a string out of a javascript code.

How to evaluate the return value (of conditions and expressions):

"eventsFunctionContext.returnValue = Your return value here;"

By default, the return value is 0 or false.

Tip: use single quotes if you need to type a string:

"eventsFunctionContext.returnValue = 'myStringReturnValue'"

Checklist

  • I've followed all of the best practices.
  • I confirm that this extension can be integrated to this GitHub repository, distributed and MIT licensed.
  • I am aware that the extension may be updated by anyone, and do not need my explicit consent to do so.

What tier of review do you aim for your extension?

Community (Unreviewed)

Example file

JavascriptEventsExample.zip

Extension file

JavascriptEvents.json.zip

@RebornOfc RebornOfc added the ✨ New extension A new extension label Nov 12, 2023
Copy link
Contributor

Hi @RebornOfc! 👋 This submission has passed all required tests, and has been moved to a PR as part of our submission pipeline. You can see the progress of your submission on this page. Community submissions are not reviewed by default, so your extension should be added once we've checked that your submission doesn't contain malicious code without further intervention on your part. If you wish for your extension to be reviewed (and thereby moved to the list of reviewed extensions), please follow the instructions written on the README. Thanks again for your contribution to GDevelop!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ New extension A new extension
Projects
None yet
Development

No branches or pull requests

1 participant