Compare commits

...

176 Commits

Author SHA1 Message Date
Davy Hélard
e93e65e7e1 Review changes: alert and parallelism 2022-04-12 14:25:41 +02:00
Davy Hélard
b67e7035bc Rewording of the tip. 2022-04-12 14:25:41 +02:00
Davy Hélard
b0f824f889 Disable slugs fields and add a tip when the user doesn't have a username. 2022-04-12 14:25:41 +02:00
Davy Hélard
ee7065d52c Allow to verify and change the url slug right before publishing a game 2022-04-12 14:22:52 +02:00
Fannie Yan
13204e4b53 Add a button "Access public profile" in one's profile details (#3819)
Add a button in profile details that opens the user's public profile on Liluo.io
2022-04-11 14:41:08 +02:00
D8H
c6d6466d54 Fix the input checkboxes "Playable with [...]" randomly checked when publishing a game for the first time (#3818) 2022-04-08 11:45:20 +01:00
Clément Pasteau
6cf737ac70 Remove unused imports (#3809)
Do not show in changelog
2022-04-06 15:00:04 +02:00
Arthur Pacaud
5b8cdbbace Update the button label in the dialog of an extension to show if the extension will be updated or (re)installed (#3777) 2022-04-06 13:47:36 +01:00
Clément Pasteau
a7df37a0dc Bump version to 131 (#3807) 2022-04-06 14:47:20 +02:00
D8H
7721f56dde Allow to specify a slug to be used in liluo.io games URL
* From the Game Details Dashboard, you can now select a username and a game name to create a custom unique URL for your game on Liluo.io, which can look like this: liluo.io/your-username/your-game-name
2022-04-06 14:35:50 +02:00
github-actions[bot]
08ada4f595 Update translations [skip ci] (#3764) 2022-04-06 13:21:28 +01:00
D8H
caa46a2fb0 Allow to define a default value for a "string with options" property (#3803) 2022-04-06 09:49:50 +02:00
D8H
660cdd753c [TopDownMovement] Add a condition to check which key was used or simulated and actions to change the current velocity (#3800) 2022-04-05 19:32:31 +02:00
D8H
3b9a1354ee [TopDownMovement] Fix the velocity value that wasn't exactly 0 when moving horizontally or vertically (#3799) 2022-04-04 23:47:17 +02:00
D8H
02fce4132a Add a condition to check if the mouse is inside the window. (#3787) 2022-04-01 12:01:53 +02:00
D8H
41241d75e1 Fix the camera rounding to work when following objects with even dimensions and pixel perfect mode is enabled (#3789) 2022-04-01 12:00:47 +02:00
Clément Pasteau
fc3e73f360 Rework the Game publishing on Liluo
* Display a summary of the Game that will be published when pushing a new build
* Add a helper message to change the game thumbnail
* Add option to save project by default when publishing to Liluo.io
* Allow defining if your game should be discoverable on Liluo.io or not
2022-04-01 10:50:05 +02:00
Florian Rival
230493039c Display an icon for the Home tab (instead of the label "Home") (#3792) 2022-04-01 09:40:22 +01:00
Florian Rival
50326e4d21 Add missing Text Input to the web-app (#3785)
Don't show in changelog
2022-03-29 13:17:44 +02:00
Florian Rival
cec7960a7d Add slug to ExampleShortHeader and Example type
Don't show in changelog
2022-03-28 16:22:49 +02:00
Florian Rival
cec901d4c2 Fix npm not installing git:// dependencies (#3780)
Don't show in changelog
2022-03-28 14:55:01 +02:00
Florian Rival
29f0567140 Add Linux zip and deb target to the packaged desktop app (#3776)
Only show in developer changelog
2022-03-27 12:55:50 +02:00
Clément Pasteau
94af33c815 Switch game metrics from live ones to cached ones for performance
Do not show in changelog
2022-03-25 14:19:14 +01:00
Florian Rival
3ad7585f92 Add a linter rule to avoid importing prop-types
Don't show in changelog
2022-03-24 11:48:07 +01:00
AlexandreS
acb69c447d Improve events sheet search with new shortcuts and put back the "Edit variable" row in variable editor 2022-03-23 15:40:57 +01:00
Elairyx
fa928b35cb Add autocompletion for the "Simulate control" action of the Top Down movement behavior (#3767) 2022-03-21 23:15:02 +01:00
Florian Rival
67810b79ce Refactor some redundant code in Text Input tests (#3768)
Don't show in changelog
2022-03-21 23:08:54 +01:00
Clément Pasteau
0a77e0264d Bump version to 5.0.130 2022-03-21 11:53:52 +01:00
Clément Pasteau
4cc8d15f4b Fix invalid game thumbnail URL 2022-03-21 11:42:36 +01:00
Clément Pasteau
a2f0b3384e Bump newIDE version to 5.0.129 2022-03-17 14:57:32 +01:00
github-actions[bot]
432ffebf80 Update translations [skip ci] (#3695)
Co-authored-by: Bouh <Bouh@users.noreply.github.com>
2022-03-17 14:40:24 +01:00
Aurélien Vivet
165470d9c1 Add D as shortcut to toggle disabled event, also added in right click context menu in the event sheet (#3751) 2022-03-17 11:35:38 +01:00
D8H
53eab0ed62 Fix the "Is moving" condition of platformer characters by removing the 1 pixel per frame detection limit (#3730)
This can be important for games with low resolution.
2022-03-16 19:09:14 +01:00
Florian Rival
649a36ac30 Fix text input wrongly staying visible even if hidden or layer visibility turned off (#3755) 2022-03-16 18:56:11 +01:00
Aurélien Vivet
a3afd983ba Add OG meta tags to the web-app (#3756)
Don't show in changelog
2022-03-16 11:01:24 +01:00
D8H
f8c0417210 Allow game owners to share their ownership with other users (#3744) 2022-03-16 10:15:06 +01:00
D8H
8f5fe159d7 Fix rendering so that sprites no longer bounce by one pixel when the camera is moving and pixel perfect is activated (#3754) 2022-03-15 22:26:57 +01:00
D8H
3daebaeb05 Add an action to ensure the camera is inside specified boundaries (#3703) 2022-03-13 12:55:09 +00:00
Florian Rival
1ba1e8a2b7 Update name of project manager "Icons and thumbnail" item
Don't show in changelog
2022-03-11 23:11:18 +00:00
Fannie Yan
36679eb76b Add size actions and conditions for sprite and tiled sprite objects (#3748)
* Add condition on height and width for sprite objects
* Add action to set the size of sprite object
* Add action to set the size of tiled sprite object
2022-03-11 16:53:26 +01:00
Aurélien Vivet
c8132ba864 Fix typo (#3747)
Don't show in changelog
2022-03-11 12:49:52 +00:00
Fannie Yan
141a3d2b61 Allow users to reorder editor tabs (#3745)
Allow users to reorder editor tabs by dragging them (not available on touchscreens)
2022-03-11 10:55:42 +01:00
Florian Rival
dbe0343c67 Fix extensions scene lifecycle events launched more than once after a hot reloading (#3742) 2022-03-10 12:42:09 +00:00
Aurélien Vivet
0983ac59a8 Allow extensions to use the Audio category (#3741) 2022-03-10 12:38:10 +00:00
MyNameIsRinax
9710360180 Fix typo in firebase action
Do not show in changelog
2022-03-10 09:31:57 +01:00
D8H
43af1f34df Make Liluo.io thumbnail configurable in the icons dialog (#3732) 2022-03-09 15:16:07 +01:00
Fannie Yan
fd193e89fc Add possibility to use custom collision masks for draggable behavior (#3738)
* Added a toggle in draggable behavior parameters so that users can chose to use custom collision mask or not
2022-03-09 13:39:57 +01:00
Clément Pasteau
19dcaacafb Improve wording for builds dialog when game is not registered (#3737)
do not show in changelog
2022-03-08 11:18:38 +01:00
Fannie Yan
90721c4059 Add possibility to replace text in text events (Comments and Groups) (#3735)
* Add possibility to replace text in text events (Comments and Group names) with search and replace
2022-03-08 09:35:32 +01:00
Florian Rival
6c118eaa53 Make clearer that the publishing is an export (#3733)
Don't show in changelog
2022-03-07 15:27:58 +00:00
D8H
2b00c90356 Fix some missing translations in the Pathfinding behavior (#3728) 2022-03-07 08:57:25 +00:00
Florian Rival
efe37cc3bf Fix warning
Don't show in changelog
2022-03-04 15:52:14 +00:00
Fannie Yan
bcedbdc0c3 Fix resource list not updated when adding some with tab opened (#3723)
Refresh resource list in Resource tab when it becomes active
2022-03-04 15:50:08 +01:00
Clément Pasteau
f63a16161f Add Liluo Link on homepage (#3720) 2022-03-04 13:35:09 +01:00
Florian Rival
c215a8c6bf Fix spacing in the EmptyPlaceholder (#3722)
Don't show in changelog
2022-03-04 10:57:55 +00:00
Clément Pasteau
225884dfe4 Allow defining up to 4 genres for a game 2022-03-04 09:35:44 +01:00
Fannie Yan
5d42956669 Fix duplicated extension after rename (#3718)
Fix duplicated extension after rename
2022-03-03 17:23:27 +01:00
Clément Pasteau
977bbdde89 Fix a crash on Windows when the Documents folder is missing 2022-03-03 12:24:02 +01:00
D8H
73357c830d Add a "get started" button at the center of empty lists for variables, behaviors, effects and events (#3708) 2022-03-02 18:04:22 +01:00
AlexandreS
c619f94277 Make context menus in scene editor and in object list consistent 2022-03-02 12:08:10 +01:00
Clément Pasteau
c5dabf9b6e Optimise onboarding flow to show to all web users 2022-03-02 10:24:36 +01:00
Arthur Pacaud
cc4303e21e Fine tune search in instruction selector and stores to better handle short words in main field 2022-03-01 13:54:54 +01:00
Florian Rival
566aadafd9 Fix initial language setup when only a language match exists (#3713)
Don't show in changelog
2022-03-01 12:50:09 +00:00
Elairyx
9cd96461d7 Fix various typos (#3711) 2022-03-01 11:34:28 +00:00
AlexandreS
0395b73f4a Clarify separation between object and instance in instance properties panel 2022-03-01 12:10:05 +01:00
Clément Pasteau
bcc40d4728 Show warning when accessing builds for a game you don't own 2022-02-28 16:39:40 +01:00
Clément Pasteau
60088ebafd Bump newIDE version (#3694) 2022-02-25 16:44:52 +00:00
github-actions[bot]
35b654841c Update translations [skip ci] (#3586) 2022-02-25 17:41:25 +01:00
D8H
e7b8741c29 Let game creators define an orientation on mobile for Liluo.io 2022-02-25 17:34:46 +01:00
Florian Rival
9e10f4191b Add chosen language and browser language in the analytics to understand the user language repartition
Don't show in changelog
2022-02-25 10:17:24 +00:00
Aurélien Vivet
c573695853 Fix typo (#3692) 2022-02-24 22:09:56 +00:00
Florian Rival
7496093e63 Fix text input not properly removed when a scene stops or is paused (#3689)
Don't show in changelog
2022-02-24 16:13:08 +00:00
D8H
5f1787f1b5 Let game creators define if their game can be played with a keybord, a gamepad or a mobile (#3682) 2022-02-23 14:55:26 +01:00
Florian Rival
b988d55c8c Add data in analytics to know if a tutorial is running or not
Don't show in changelog
2022-02-22 15:14:38 +00:00
Florian Rival
942dc0a539 Add analytics events to know behaviors usage (#3683)
Don't show in changelog
2022-02-22 13:46:13 +00:00
Florian Rival
d8a241502e Update urls of cache purge for the web-app
Don't show in changelog
2022-02-22 11:38:37 +00:00
D8H
8bf8c3efff Add autocompletion for external layout fields (#3673) 2022-02-22 11:44:24 +01:00
D8H
527b2566b7 Fix the platformer extension to avoid characters to be pushed downward when colliding a jumpthru while landing on another platform at the exact same time (#3677) 2022-02-22 11:40:17 +01:00
AlexandreS
9b436f7f31 Add link to discussions in the Development Roadmap section of the readme
Do not show in changelog
2022-02-22 10:03:56 +01:00
Davy Hélard
0818d56d45 Send the application language to user service. 2022-02-21 10:54:11 +01:00
Clément Pasteau
567b9e24dd Fix displaying the "game update" link when the user is not the owner of the game (#3678) 2022-02-21 09:39:10 +00:00
AlexandreS
69d63649c3 Clarify actions in object removal dialog regarding references 2022-02-21 10:32:47 +01:00
D8H
5ef23c0c70 Fix usage of the legacy trajectory for platformer objects for old project files. (#3676) 2022-02-20 19:21:18 +00:00
Florian Rival
533c6d7fce Update the CNAME used for the web-app
Also update a comment

Don't show in changelog
2022-02-19 17:48:09 +00:00
AlexandreS
0438000543 Do not select sprite when using mouse middle click to pan in the scene editor (#3662)
* Also select the instance under the cursor when doing a right click in the scene editor
2022-02-18 18:28:51 +00:00
AlexandreS
bae8520405 Improve copy pasting objects on the scene
- When pasting objects, the pasted objects are selected
- Fix the possibility to undo/redo an object paste
2022-02-18 16:06:24 +01:00
Florian Rival
78559f439a Protect against crashes in case of a null author in a public game
Don't show in changelog
2022-02-17 22:04:32 +00:00
Florian Rival
ba2389a8eb Move the deprecated property of the platformer object behavior into a specific group (#3661) 2022-02-17 18:33:58 +00:00
AlexandreS
14f4da8fc3 Select parameter content when editing it form the event sheet 2022-02-17 12:08:08 +01:00
AlexandreS
342f06b024 Improve user experience with translation
* Disable auto translating in search results to prevent crashes due to conflicts between search results highlight and dom handling by translators
* Add language selector in Preferences dialog
* Automatically set gdevelop language on first use based on browser language
2022-02-17 09:19:42 +01:00
Clément Pasteau
4d7514c2bf Improve wording and design across the publishing flow to Liluo
+ display game consolidated analytics on the analytics page
2022-02-16 17:48:09 +01:00
AlexandreS
582e71e9d3 UI minor improvements and fixes
- Change help link for light object
- Set new object default name depending on its type
- Make object input sticky at the bottom in ObjectGroupEditor
- Force loss of focus on sliders when mouse is up
- Add possibility to close editor tabs with mouse middle click
- Use user preferred theme to set IDE loading screen background color
2022-02-16 17:38:54 +01:00
Florian Rival
f0822e38e1 Show a warning message and a warning underline in the events sheet when a variable name looks wrong (quotes, spaces, wrongly looking expression) (#3652) 2022-02-16 14:34:47 +01:00
Florian Rival
03a9d9f9c8 Add HTML id to various buttons and elements to allow for an in-app tutorial
Do not show in changelog
2022-02-16 10:34:59 +01:00
Nilay Majorwar
942a3117f9 Fix shortcuts removed by user still displayed, even if not working (#3618) 2022-02-14 14:40:09 +01:00
D8H
ca19076b01 Use the extension name as file name when saving it (#3622) 2022-02-13 23:11:42 +01:00
Florian Rival
267842d8e2 Fix various UI alignment issues
* Action/condition icon aligment
* Aligment of true/false or yes/no switches
* Fix scrollbars shown when the action/condition parameters editor is too tight
2022-02-13 18:55:45 +01:00
Florian Rival
71e3b65134 Add a new "Text input" object (#3508)
* This object displays a field where the player can type a text.
* The cursor can be moved and the text can be selected and entered like any other input field according to the platform. For example, you can use all the usual keyboard shortcuts or emoji pickers on desktop. On mobile, all the usual gestures are supported, emoji pickers, text selection, clipboard...
* You can choose between different input field types: text, text area, email, password, phone number... This allows the keyboards to be adapted on mobile devices. The password field will also hide what is entered by the user.
  * Because the object is way more convenient to use (and actually works on mobile devices) than the Text Entry object, it is recommended you use it almost always instead of the Text Entry object.
* This object has 2 limitations, because it's using the native capabilities of the platform to display a "native" input field: the Z order can't be changed (the object is *always* displayed on top of the game) and no effects can be displayed. Because it's handled by the operating system, it may also slightly differ on each platform.
  * It's recommended you avoid displaying the object outside of a menu or a static UI, as it may not always display exactly at a position synchronised with the rest of the rendering of the game, especially if used in a fast paced or moving scene.
2022-02-13 15:18:31 +01:00
Florian Rival
00393f50c8 Fix again broken instructions
Don't show in changelog
2022-02-11 20:16:51 +01:00
Clément Pasteau
a107ff4e17 Allow entering a project description for your project/game 2022-02-11 10:53:31 +01:00
Aurélien Vivet
0da59cc4e0 Typo fix (#3614) 2022-02-11 08:22:55 +00:00
AlexandreS
46a12e6758 When browsing search results in event sheet, start from currently selected event 2022-02-11 09:22:13 +01:00
Florian Rival
41c9753268 Fix compatibility with instructions broken in #3583 (#3611)
Don't show in changelog
2022-02-10 17:16:27 +01:00
Florian Rival
ab619bdd2a Rework slightly the true/false and yes/no fields to make clearer they are switches 2022-02-10 16:44:57 +01:00
D8H
7258da9927 [Tween] Fix the icon of the expression. (#3606)
Don't show in changelog
2022-02-09 18:23:01 +01:00
D8H
83a390089d Add an expression to use Tween easing functions (#3605)
* This is useful to do easing with other formulas rather than the classic "lerp".
2022-02-09 10:05:42 +01:00
Aurélien Vivet
f4c730f5fd Fix help buttons for some objects (#3601) 2022-02-07 19:49:42 +01:00
AlexandreS
67776108f9 Improve search and highlight results when searching for a condition/action/object/group 2022-02-04 18:31:07 +01:00
Florian Rival
9997e9246a Fix resources sometimes duplicated when scanning resources in the project folder on Windows (#3598)
Fix #3590
2022-02-04 18:04:48 +01:00
Florian Rival
2c4fa1d1c2 Switch the game engine documentation to TypeDoc (#3593)
* This adds link between types, a more readable rendering, a better search and, more generally, makes the [game engine documentation](https://docs.gdevelop-app.com/GDJS%20Runtime%20Documentation/index.html) much easier to browse.
2022-02-03 13:58:44 +01:00
Florian Rival
5d2e0786ee Sort actions/conditions in categories add icons to their groups (#3583)
* This should make it easier to identify and find actions/conditions. Categories give more clarity and icons help to identify what's available without reading everything.
2022-02-03 11:45:53 +01:00
AlexandreSi
8be39f1a3e Increase contrast of the buttons to add events 2022-02-02 11:26:30 +00:00
Clément Pasteau
7d8120d9ff Improve the web export to warn when the game is too big to be uploaded 2022-02-02 11:30:35 +01:00
D8H
1b417a4f27 [Light] Remove the dependency from LightRuntimeObjectPixiRenderer to BehaviorRBushAABB (#3580)
Only show in developer changelog
2022-02-02 09:02:00 +01:00
D8H
aabe249ffb [PathFinding] Remove the dependency from PathfindingRuntimeBehavior to BehaviorRBushAABB (#3579)
Only show in developer changelog
2022-02-02 08:59:58 +01:00
AlexandreS
fff09fdbd0 Fix search highlights that made disappear non exact matches (#3587)
Do not show in changelog
2022-02-01 13:15:41 +01:00
AlexandreS
04ff0620e6 Bump newIDE version
Do not show in changelog
2022-02-01 10:23:23 +01:00
github-actions[bot]
33d5130cd1 Update translations
Do not show in changelog
2022-02-01 10:19:02 +01:00
AlexandreS
9b21b78ae7 Allow the possibility to chose a start scene in the project manager 2022-02-01 10:02:05 +01:00
github-actions[bot]
b16497497d Update translations [skip ci] (#3489)
Co-authored-by: 4ian <4ian@users.noreply.github.com>
2022-01-31 17:08:52 +00:00
Florian Rival
53a2c2c4e9 Add a button to open events from the scene editor context menu (#3577) 2022-01-31 16:32:43 +00:00
Clément Pasteau
c5a709fee2 Fix builds timed out being correctly displayed
do not show in changelog
2022-01-31 17:05:00 +01:00
D8H
7d2ac0da38 Allow to set an empty color property value in custom behaviors (#3558)
* Also fix the color property condition in behaviors.
2022-01-31 12:43:08 +00:00
Florian Rival
920a808c8d Fix warnings
Don't show in changelog
2022-01-29 17:55:29 +00:00
Florian Rival
43d55112cc Display objects in categories when creating a new object (#3562)
Don't show in changelog
2022-01-29 16:02:34 +00:00
Florian Rival
8191fe0610 Use "Untitled Xxx" instead of "New Xxx" in the project manager for default names (#3561)
Make it clearer these are items to be renamed, rather than buttons

Don't show in changelog
2022-01-28 17:35:46 +00:00
Leo_Red
218faba473 Improve the display of the list of functions (and behavior methods) in an extension (#3501)
* Show an icon when a condition, action or expression is set to be private.
* Show icons according to the kind of function.
* Disable the button to make lifecycle functions private (this was not making sense).
2022-01-28 16:35:37 +00:00
Florian Rival
d55392bd74 Fix typo
Don't show in changelog
2022-01-27 20:09:35 +00:00
D8H
7d8b9190af Add an option for Platformer objects to automatically grab platform ledges (#3555)
* Platform ledges can be grabbed without having the left or right key pressed when this option is activated
2022-01-27 15:07:43 +00:00
Florian Rival
7f3289d5a1 Remove the popup at the startup of the web-app
Don't show in changelog
2022-01-27 11:58:46 +00:00
Florian Rival
c2fbd173e1 Rework titles and button styles in the home page
Don't show in changelog
2022-01-27 11:40:21 +00:00
D8H
88e307d6f0 Allow to set a default value for boolean parameters in extensions functions (or custom behavior methods) (#3557) 2022-01-27 11:11:27 +00:00
Clément Pasteau
e7a063ed2c Remove the ability to install extension via shortcut or click outside to prevent mistakes 2022-01-27 11:28:04 +01:00
AlexandreS
1777ed6c2d Improve search accuracy and speed for the Example & Extension Stores with text highlights 2022-01-27 10:56:34 +01:00
Clément Pasteau
1e73122633 Allow editing Game Public Info from Game Dashboard 2022-01-26 18:26:52 +01:00
D8H
22b117d2b3 Add an option to allow the platformer objects to go down from a jumpthru (#3546)
* When activated, you can press the Down key and the character will fall from the jumpthru.
2022-01-26 15:42:23 +00:00
D8H
22f66c3297 Add developer documentation about jump trajectory theory in the Platform extension (#3550)
Only show in developer changelog
2022-01-25 15:17:58 +00:00
D8H
bd2ff786e2 Add an action to change the current horizontal speed of a Platformer object (#3539) 2022-01-24 16:44:47 +00:00
D8H
55852f478b Always stop the character vertically when the jump is aborted (#3544)
* Also add a small test on abortJump.
* Also try to make descriptions more standard.

Don't show in changelog
2022-01-23 22:56:19 +00:00
D8H
f93ce55125 Add actions to abort a jump and change the fall speed immediately of a platformer object. (#3537)
* This is useful to allow to "dash" toward the ground.
2022-01-23 14:47:34 +00:00
D8H
1c18beb68f Add a parameter "try to preserve the current air speed" in the "max falling speed" action for Platformer object. (#3534)
* This is useful to allow "gliding" or reducing the fall speed (for wall sliding) without riskying the object to go back up in the air.
2022-01-23 13:19:50 +00:00
D8H
6da11cf0ed Fix jumping again disallowed when a platformer object is falling, even if jumping was allowed again at the beginning of the jump (#3495) 2022-01-23 12:29:17 +00:00
Nilay Majorwar
342a690fa6 Fix Physics2 behavior editor overflowing on small screens (#3540) 2022-01-23 11:51:06 +00:00
Florian Rival
7aa35495cb Fix typo [skip ci]
Don't show in changelog
2022-01-23 00:13:30 +00:00
Florian Rival
260246fe1b Fix README images [skip ci]
Don't show in changelog
2022-01-23 00:12:06 +00:00
Florian Rival
3b1a860d7b Update README with new designs [skip ci] 2022-01-23 00:08:42 +00:00
Florian Rival
d85ca66eed Fix tests 2022-01-22 23:15:45 +00:00
Florian Rival
62835a8465 Fix the "Animation" field not shown as a number field in the instance properties editor 2022-01-22 23:13:43 +00:00
AlexandreS
b6e9a472b2 Fix wrong values displayed in the "Animation" field in the instances properties editor (#3527) 2022-01-22 22:27:32 +00:00
Florian Rival
16b4c76d8e Remove duplicate "Angle" action and condition for Tiled Sprite objects
Fix #3522
2022-01-22 22:22:35 +00:00
Nilay Majorwar
a217565919 Fix buttons layout on mobile or small screens in the behaviors editor (#3538) 2022-01-22 21:08:21 +00:00
Florian Rival
e583556a4d Group fields inside some object editors to make it easier to find them and quickly understand their usage 2022-01-22 19:49:52 +00:00
Tristan Rhodes
95d78521d2 Update sentence of "Start (or reset) the timer" in the events sheet to make them clearer (#3526) 2022-01-21 09:45:20 +00:00
AlexandreS
d5955e0c67 [Network tools] Fix: Set error var to predefined value if web request couldn't be sent 2022-01-20 10:57:35 +01:00
AlexandreS
4393cc0820 Fix: Only move unlocked instances when using keyboard in the scene editor 2022-01-19 18:07:08 +01:00
Florian Rival
b28f738112 Simplify the description of the collision condition
It was outdated and confusing.
Also ran autoformatting on the file.

Don't show in changelog
2022-01-19 12:18:41 +00:00
AlexandreS
dd76abd9d4 Fix focus loss when editing the name or path of a new project 2022-01-19 12:08:50 +01:00
AlexandreS
a92b613435 Remove offending name from project name generator (#3511) 2022-01-18 12:27:15 +00:00
D8H
0fd9173069 Improve consistency of behavior descriptions by starting them with a verb. (#3484) 2022-01-17 17:05:37 +00:00
Florian Rival
2a214e0997 Add warnings that timers must be started using an action 2022-01-16 11:53:34 +00:00
D8H
d1a68aa0be Reorganise some platformer actions/conditions/expressions in different groups (#3491) 2022-01-15 11:41:14 +00:00
Clément Pasteau
d49d765ec0 Bump newIDE version (#3494) 2022-01-14 17:29:00 +00:00
D8H
d2f98deb63 Fix the new key pressed condition in the Platformer behavior (#3492) 2022-01-14 17:10:58 +00:00
AlexandreS
2e86f5d512 Display error for too many request error from firebase and translate errors
Do not show in changelog
2022-01-14 14:18:39 +01:00
Florian Rival
e5158bc8bb Revert the product name (#3488)
Working well on Windows (code signing is passing), so reverting this to avoid disrupting auto update out of caution.

Don't show in changelog
2022-01-14 10:00:58 +00:00
AlexandreS
d9af6d7316 Bump newIDE version 2022-01-13 14:23:56 +01:00
github-actions[bot]
7cf3f698cd Update translations
Do not show in changelog
2022-01-13 14:14:54 +01:00
AlexandreS
6e81058a80 Fix crash on web-app for users using automatic page translations 2022-01-13 12:15:52 +01:00
D8H
e0ab0d1f01 Improve the timer conditions to allow to check if the value of the timer is greater or less than a value (#3450) 2022-01-13 00:08:20 +00:00
Aurélien Vivet
4bd770a61e Fix some typo in the interface or codebase (#3483) 2022-01-12 21:39:37 +00:00
AlexandreS
518bb9a164 Add github action to complete update translation pr with coverage deltas
Do not show in changelog
2022-01-12 15:57:33 +01:00
Clément Pasteau
550687afec Change UX for Build and Games dialogs
Do not show in changelog
2022-01-12 15:44:28 +01:00
AlexandreS
95c785bb67 Open extension details first when clicking on a downloaded extension in the project manager 2022-01-12 11:55:33 +01:00
D8H
fa40299343 Remove an only in tests (#3474)
Don't show in changelog
2022-01-11 13:28:50 +00:00
Florian Rival
61d2c7e580 Fix issues with npm install and npm version on AppVeyor and Travis (#3473)
Don't show in changelog
2022-01-11 13:27:39 +00:00
Clément Pasteau
ab25f3b2cf Display timed out builds instead of infinite loader 2022-01-11 14:21:42 +01:00
566 changed files with 21329 additions and 7988 deletions

View File

@@ -3,7 +3,7 @@
# For Windows, see the appveyor.yml file. # For Windows, see the appveyor.yml file.
version: 2.1 version: 2.1
orbs: orbs:
aws-cli: circleci/aws-cli@2.0.6 aws-cli: circleci/aws-cli@2.0.6
jobs: jobs:
build-macos: build-macos:
@@ -33,7 +33,7 @@ jobs:
- gd-macos-nodejs-dependencies--- - gd-macos-nodejs-dependencies---
- run: - run:
name: Install GDevelop.js dependencies and build it name: Install GDevelop.js dependencies
command: cd GDevelop.js && npm install && cd .. command: cd GDevelop.js && npm install && cd ..
# Build GDevelop.js (and run tests to ensure it works) # Build GDevelop.js (and run tests to ensure it works)
@@ -91,7 +91,7 @@ jobs:
- run: - run:
name: Install dependencies for Emscripten name: Install dependencies for Emscripten
command: sudo apt-get update && sudo apt install cmake command: sudo apt-get update && sudo apt install cmake
- run: - run:
name: Install Python3 dependencies for Emscripten name: Install Python3 dependencies for Emscripten
command: sudo apt install python-is-python3 python3-distutils -y command: sudo apt install python-is-python3 python3-distutils -y
@@ -135,7 +135,7 @@ jobs:
# Build GDevelop IDE (seems like we need to allow Node.js to use more space than usual) # Build GDevelop IDE (seems like we need to allow Node.js to use more space than usual)
- run: - run:
name: Build GDevelop IDE name: Build GDevelop IDE
command: export NODE_OPTIONS="--max-old-space-size=7168" && cd newIDE/electron-app && npm run build -- --linux AppImage --publish=never command: export NODE_OPTIONS="--max-old-space-size=7168" && cd newIDE/electron-app && npm run build -- --linux AppImage zip deb --publish=never
- run: - run:
name: Clean dist folder to keep only installers/binaries. name: Clean dist folder to keep only installers/binaries.

View File

@@ -29,24 +29,15 @@ jobs:
message: "Hi @${issue.user.login}! 👋 This issue was automatically closed as this seems to be a known bug. It can be solved by **closing entirely the web-app and opening it again**. This will allow the web-app to auto-update and the problem should be gone." message: "Hi @${issue.user.login}! 👋 This issue was automatically closed as this seems to be a known bug. It can be solved by **closing entirely the web-app and opening it again**. This will allow the web-app to auto-update and the problem should be gone."
autocomment: autocomment:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: contains(github.event.issue.body, 'The node to be removed is not a child of this node')
steps: steps:
- name: Autocomment known 124 crash removing a node (new issue comment) - name: Autocomment indications on bug if it looks like #3453
if: contains(github.event.issue.body, 'The node to be removed is not a child of this node')
uses: peter-evans/create-or-update-comment@v1 uses: peter-evans/create-or-update-comment@v1
with: with:
issue-number: ${{ github.event.issue.number }} issue-number: ${{ github.event.issue.number }}
body: | body: |
Hi @${{ github.actor }}! Hi @${{ github.actor }}!
Thank you for taking the time to report this bug. Thank you for taking the time to open an issue.
This bug is actually known but we currently lack information on how to reproduce it. Could you please tell us more about how it happened in the issue #3453? The solved issue #3453 mentioned a similar error, maybe it could help fix this new issue.
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
- name: Autocomment known 124 crash removing a node (reference issue comment)
if: contains(github.event.issue.body, 'The node to be removed is not a child of this node')
uses: peter-evans/create-or-update-comment@v1
with:
issue-number: 3453
body: |
The issue #${{ github.event.issue.number }} reported by @${{ github.actor }} seems to relate to this bug.
token: ${{ secrets.GITHUB_TOKEN }}

29
.github/workflows/pull-requests.yml vendored Normal file
View File

@@ -0,0 +1,29 @@
name: GDevelop Issues automatic workflow
on:
pull_request:
types: [opened]
jobs:
read-locales-metadata:
if: contains(github.event.pull_request.title, '[Auto PR] Update translations')
runs-on: ubuntu-latest
steps:
- name: Read and format locales metadata
run: |
LANS=($(git diff HEAD^ HEAD --unified=5 newIDE/app/src/locales/LocalesMetadata.js | tail +6 | grep -E "^\s+\"languageName" | sed -E "s/^ *\"languageName\": \"//g" | sed -E "s/\",//g" | sed -E "s/ /_/g"))
ADDS=($(git diff HEAD^ HEAD --unified=0 newIDE/app/src/locales/LocalesMetadata.js | tail +6 | grep -E "^\+\s*\"translationRatio\"" | sed -E "s/^\+ *\"translationRatio\": //g"))
SUBS=($(git diff HEAD^ HEAD --unified=0 newIDE/app/src/locales/LocalesMetadata.js | tail +6 | grep -E "^\-\s*\"translationRatio\"" | sed -E "s/^\- *\"translationRatio\": //g"))
touch sumup.txt
for index in ${!ADDS[@]}; do
echo ${LANS[index]} | sed -E "s/_/ /g" >> sumup.txt
DELTA=$(bc <<< "scale=2;(${ADDS[index]}-${SUBS[index]})*100/1")
echo $DELTA % >> sumup.txt
done
- name: Store sumup in outputs
id: sumup
run: echo "::set-output name=sumupFileContent::$(cat sumup.txt)"
- name: Autocomment pull request with sumup
uses: peter-evans/create-or-update-comment@v1
with:
issue-number: ${{ github.event.number }}
body: ${{ steps.sumup.outputs.sumupFileContent}}
token: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -17,10 +17,6 @@ cache:
directories: directories:
- $HOME/.npm - $HOME/.npm
env:
global:
- GCC_VERSION="4.8"
services: services:
# Virtual Framebuffer 'fake' X server for SFML # Virtual Framebuffer 'fake' X server for SFML
- xvfb - xvfb
@@ -40,7 +36,6 @@ addons:
# Build dependencies: # Build dependencies:
- cmake - cmake
- p7zip-full - p7zip-full
- g++-4.8
# SFML dependencies: # SFML dependencies:
- libopenal-dev - libopenal-dev
- libjpeg-dev - libjpeg-dev
@@ -60,10 +55,8 @@ before_install:
- sudo dpkg --force-all -i libstdc++6 - sudo dpkg --force-all -i libstdc++6
install: install:
# Ensure we use a recent version of Node.js (and npm) # Ensure we use a recent version of Node.js (and npm).
- nvm install v16 && nvm use v16 - nvm install v16 && nvm use v16
#Get the correct version of gcc/g++
- if [ "$CXX" = "g++" ]; then export CXX="g++-${GCC_VERSION}" CC="gcc-${GCC_VERSION}"; fi
#Compile the tests only for GDCore #Compile the tests only for GDCore
- mkdir .build-tests - mkdir .build-tests
- cd .build-tests - cd .build-tests
@@ -72,21 +65,17 @@ install:
- cd .. - cd ..
# Install Emscripten (for GDevelop.js) # Install Emscripten (for GDevelop.js)
- git clone https://github.com/juj/emsdk.git - git clone https://github.com/juj/emsdk.git
- cd emsdk - cd emsdk && ./emsdk install 1.39.6 && ./emsdk activate 1.39.6 && cd ..
- ./emsdk install 1.39.6 # Install GDevelop.js dependencies
- ./emsdk activate 1.39.6 - cd GDevelop.js && npm install && cd ..
- source ./emsdk_env.sh # Build GDevelop.js
- cd .. # (in a subshell to avoid Emscripten polluting the Node.js and npm version for the rest of the build)
# Install GDevelop.js dependencies and compile it - (set -e; cd GDevelop.js && source ../emsdk/emsdk_env.sh && npm run build && cd ..)
- cd GDevelop.js # Install newIDE tests dependencies
- npm install -g grunt-cli - npm -v
- npm install
- npm run build
- cd ..
#Install newIDE tests dependencies
- cd newIDE/app && npm install - cd newIDE/app && npm install
- cd ../.. - cd ../..
#Install GDJS tests dependencies # Install GDJS tests dependencies
- cd GDJS && npm install && cd tests && npm install - cd GDJS && npm install && cd tests && npm install
- cd ../.. - cd ../..

View File

@@ -109,7 +109,8 @@
"xutility": "cpp", "xutility": "cpp",
"xlocbuf": "cpp", "xlocbuf": "cpp",
"xlocmes": "cpp", "xlocmes": "cpp",
"xmemory0": "cpp" "xmemory0": "cpp",
"memory_resource": "cpp"
}, },
"files.exclude": { "files.exclude": {
"Binaries/*build*": true, "Binaries/*build*": true,

View File

@@ -21,6 +21,12 @@ vector<gd::String> CommentEvent::GetAllSearchableStrings() const {
return allSearchableStrings; return allSearchableStrings;
} }
bool CommentEvent::ReplaceAllSearchableStrings(
std::vector<gd::String> newSearchableString) {
SetComment(newSearchableString[0]);
return newSearchableString[0] == com1;
}
void CommentEvent::SerializeTo(SerializerElement &element) const { void CommentEvent::SerializeTo(SerializerElement &element) const {
element.AddChild("color") element.AddChild("color")
.SetAttribute("r", r) .SetAttribute("r", r)

View File

@@ -47,6 +47,8 @@ class GD_CORE_API CommentEvent : public gd::BaseEvent {
void SetComment(const gd::String& comment) { com1 = comment; } void SetComment(const gd::String& comment) { com1 = comment; }
virtual std::vector<gd::String> GetAllSearchableStrings() const; virtual std::vector<gd::String> GetAllSearchableStrings() const;
virtual bool ReplaceAllSearchableStrings(
std::vector<gd::String> newSearchableString);
virtual void SerializeTo(SerializerElement& element) const; virtual void SerializeTo(SerializerElement& element) const;
virtual void UnserializeFrom(gd::Project& project, virtual void UnserializeFrom(gd::Project& project,

View File

@@ -27,6 +27,12 @@ vector<gd::String> GroupEvent::GetAllSearchableStrings() const {
return allSearchableStrings; return allSearchableStrings;
} }
bool GroupEvent::ReplaceAllSearchableStrings(
std::vector<gd::String> newSearchableString) {
SetName(newSearchableString[0]);
return newSearchableString[0] == name;
}
void GroupEvent::SerializeTo(SerializerElement& element) const { void GroupEvent::SerializeTo(SerializerElement& element) const {
element.SetAttribute("name", name); element.SetAttribute("name", name);
element.SetAttribute("source", source); element.SetAttribute("source", source);
@@ -69,5 +75,4 @@ void GroupEvent::SetBackgroundColor(unsigned int colorR_,
colorB = colorB_; colorB = colorB_;
} }
} // namespace gd } // namespace gd

View File

@@ -107,6 +107,8 @@ class GD_CORE_API GroupEvent : public gd::BaseEvent {
virtual gd::EventsList& GetSubEvents() { return events; }; virtual gd::EventsList& GetSubEvents() { return events; };
virtual std::vector<gd::String> GetAllSearchableStrings() const; virtual std::vector<gd::String> GetAllSearchableStrings() const;
virtual bool ReplaceAllSearchableStrings(
std::vector<gd::String> newSearchableString);
virtual void SerializeTo(SerializerElement& element) const; virtual void SerializeTo(SerializerElement& element) const;
virtual void UnserializeFrom(gd::Project& project, virtual void UnserializeFrom(gd::Project& project,

View File

@@ -315,31 +315,38 @@ gd::String EventsCodeGenerator::GenerateConditionCode(
if (instrInfos.IsObjectInstruction()) { if (instrInfos.IsObjectInstruction()) {
gd::String objectName = condition.GetParameter(0).GetPlainString(); gd::String objectName = condition.GetParameter(0).GetPlainString();
gd::String objectType = gd::GetTypeOfObject(
GetGlobalObjectsAndGroups(), GetObjectsAndGroups(), objectName);
if (!objectName.empty() && !instrInfos.parameters.empty()) { if (!objectName.empty() && !instrInfos.parameters.empty()) {
std::vector<gd::String> realObjects = std::vector<gd::String> realObjects =
ExpandObjectsName(objectName, context); ExpandObjectsName(objectName, context);
for (std::size_t i = 0; i < realObjects.size(); ++i) { for (std::size_t i = 0; i < realObjects.size(); ++i) {
// Set up the context // Set up the context
gd::String objectType = gd::GetTypeOfObject(
GetGlobalObjectsAndGroups(), GetObjectsAndGroups(), realObjects[i]);
const ObjectMetadata& objInfo = const ObjectMetadata& objInfo =
MetadataProvider::GetObjectMetadata(platform, objectType); MetadataProvider::GetObjectMetadata(platform, objectType);
AddIncludeFiles(objInfo.includeFiles);
context.SetCurrentObject(realObjects[i]);
context.ObjectsListNeeded(realObjects[i]);
// Prepare arguments and generate the condition whole code if (objInfo.IsUnsupportedBaseObjectCapability(
vector<gd::String> arguments = GenerateParametersCodes( instrInfos.GetRequiredBaseObjectCapability())) {
condition.GetParameters(), instrInfos.parameters, context); conditionCode +=
conditionCode += GenerateObjectCondition(realObjects[i], "/* Object with unsupported capability - skipped. */\n";
objInfo, } else {
arguments, AddIncludeFiles(objInfo.includeFiles);
instrInfos, context.SetCurrentObject(realObjects[i]);
returnBoolean, context.ObjectsListNeeded(realObjects[i]);
condition.IsInverted(),
context);
context.SetNoCurrentObject(); // Prepare arguments and generate the condition whole code
vector<gd::String> arguments = GenerateParametersCodes(
condition.GetParameters(), instrInfos.parameters, context);
conditionCode += GenerateObjectCondition(realObjects[i],
objInfo,
arguments,
instrInfos,
returnBoolean,
condition.IsInverted(),
context);
context.SetNoCurrentObject();
}
} }
} }
} else if (instrInfos.IsBehaviorInstruction()) { } else if (instrInfos.IsBehaviorInstruction()) {
@@ -489,27 +496,33 @@ gd::String EventsCodeGenerator::GenerateActionCode(
// Call free function first if available // Call free function first if available
if (instrInfos.IsObjectInstruction()) { if (instrInfos.IsObjectInstruction()) {
gd::String objectName = action.GetParameter(0).GetPlainString(); gd::String objectName = action.GetParameter(0).GetPlainString();
gd::String objectType = gd::GetTypeOfObject(
GetGlobalObjectsAndGroups(), GetObjectsAndGroups(), objectName);
if (!instrInfos.parameters.empty()) { if (!instrInfos.parameters.empty()) {
std::vector<gd::String> realObjects = std::vector<gd::String> realObjects =
ExpandObjectsName(objectName, context); ExpandObjectsName(objectName, context);
for (std::size_t i = 0; i < realObjects.size(); ++i) { for (std::size_t i = 0; i < realObjects.size(); ++i) {
// Setup context // Setup context
gd::String objectType = gd::GetTypeOfObject(
GetGlobalObjectsAndGroups(), GetObjectsAndGroups(), realObjects[i]);
const ObjectMetadata& objInfo = const ObjectMetadata& objInfo =
MetadataProvider::GetObjectMetadata(platform, objectType); MetadataProvider::GetObjectMetadata(platform, objectType);
AddIncludeFiles(objInfo.includeFiles);
context.SetCurrentObject(realObjects[i]);
context.ObjectsListNeeded(realObjects[i]);
// Prepare arguments and generate the whole action code if (objInfo.IsUnsupportedBaseObjectCapability(
vector<gd::String> arguments = GenerateParametersCodes( instrInfos.GetRequiredBaseObjectCapability())) {
action.GetParameters(), instrInfos.parameters, context); actionCode += "/* Object with unsupported capability - skipped. */\n";
actionCode += GenerateObjectAction( } else {
realObjects[i], objInfo, arguments, instrInfos, context); AddIncludeFiles(objInfo.includeFiles);
context.SetCurrentObject(realObjects[i]);
context.ObjectsListNeeded(realObjects[i]);
context.SetNoCurrentObject(); // Prepare arguments and generate the whole action code
vector<gd::String> arguments = GenerateParametersCodes(
action.GetParameters(), instrInfos.parameters, context);
actionCode += GenerateObjectAction(
realObjects[i], objInfo, arguments, instrInfos, context);
context.SetNoCurrentObject();
}
} }
} }
} else if (instrInfos.IsBehaviorInstruction()) { } else if (instrInfos.IsBehaviorInstruction()) {
@@ -621,14 +634,15 @@ gd::String EventsCodeGenerator::GenerateParameterCodes(
argOutput = GenerateGetBehaviorNameCode(parameter); argOutput = GenerateGetBehaviorNameCode(parameter);
} else if (metadata.type == "key") { } else if (metadata.type == "key") {
argOutput = "\"" + ConvertToString(parameter) + "\""; argOutput = "\"" + ConvertToString(parameter) + "\"";
} else if (metadata.type == "password" || // Deprecated } else if (metadata.type == "audioResource" ||
metadata.type ==
"musicfile" || // Should be renamed "largeAudioResource"
metadata.type ==
"soundfile" || // Should be renamed "audioResource"
metadata.type == "police" || // Should be renamed "fontResource"
metadata.type == "bitmapFontResource" || metadata.type == "bitmapFontResource" ||
metadata.type == "imageResource") { metadata.type == "fontResource" ||
metadata.type == "imageResource" ||
metadata.type == "jsonResource" ||
metadata.type == "videoResource" ||
// Deprecated, old parameter names:
metadata.type == "password" || metadata.type == "musicfile" ||
metadata.type == "soundfile" || metadata.type == "police") {
argOutput = "\"" + ConvertToString(parameter) + "\""; argOutput = "\"" + ConvertToString(parameter) + "\"";
} else if (metadata.type == "mouse") { } else if (metadata.type == "mouse") {
argOutput = "\"" + ConvertToString(parameter) + "\""; argOutput = "\"" + ConvertToString(parameter) + "\"";

View File

@@ -219,14 +219,20 @@ gd::String ExpressionCodeGenerator::GenerateObjectFunctionCode(
const ObjectMetadata& objInfo = MetadataProvider::GetObjectMetadata( const ObjectMetadata& objInfo = MetadataProvider::GetObjectMetadata(
codeGenerator.GetPlatform(), objectType); codeGenerator.GetPlatform(), objectType);
codeGenerator.AddIncludeFiles(objInfo.includeFiles); if (objInfo.IsUnsupportedBaseObjectCapability(
functionOutput = codeGenerator.GenerateObjectFunctionCall( expressionMetadata.GetRequiredBaseObjectCapability())) {
realObjects[i], // Do nothing, skipping objects not supporting the capability required by
objInfo, // this expression.
expressionMetadata.codeExtraInformation, } else {
parametersCode, codeGenerator.AddIncludeFiles(objInfo.includeFiles);
functionOutput, functionOutput = codeGenerator.GenerateObjectFunctionCall(
context); realObjects[i],
objInfo,
expressionMetadata.codeExtraInformation,
parametersCode,
functionOutput,
context);
}
} }
return functionOutput; return functionOutput;

View File

@@ -126,6 +126,11 @@ class GD_CORE_API BaseEvent {
return noSearchableStrings; return noSearchableStrings;
}; };
virtual bool ReplaceAllSearchableStrings(
std::vector<gd::String> newSearchableString) {
return false;
};
/** /**
* \brief Return a list of all expressions of the event, each with their associated metadata. * \brief Return a list of all expressions of the event, each with their associated metadata.
* \note Used to preprocess or search in the expressions of the event. * \note Used to preprocess or search in the expressions of the event.

View File

@@ -13,6 +13,7 @@
#include "ExpressionParser2Node.h" #include "ExpressionParser2Node.h"
#include "GDCore/Extensions/Metadata/ExpressionMetadata.h" #include "GDCore/Extensions/Metadata/ExpressionMetadata.h"
#include "GDCore/Extensions/Metadata/MetadataProvider.h" #include "GDCore/Extensions/Metadata/MetadataProvider.h"
#include "GDCore/Extensions/Metadata/ObjectMetadata.h"
#include "GDCore/Project/Layout.h" // For GetTypeOfObject and GetTypeOfBehavior #include "GDCore/Project/Layout.h" // For GetTypeOfObject and GetTypeOfBehavior
#include "GDCore/String.h" #include "GDCore/String.h"
#include "GDCore/Tools/Localization.h" #include "GDCore/Tools/Localization.h"
@@ -484,10 +485,25 @@ class GD_CORE_API ExpressionParser2 {
metadata, metadata,
objectFunctionOrBehaviorName); objectFunctionOrBehaviorName);
function->diagnostic = std::move(parametersNode.diagnostic); function->diagnostic = std::move(parametersNode.diagnostic);
if (!function->diagnostic) // TODO: reverse the order of diagnostic? if (!function->diagnostic) // TODO: reverse the order of diagnostic?
function->diagnostic = ValidateFunction( function->diagnostic = ValidateFunction(
type, *function, objectNameLocation.GetStartPosition()); type, *function, objectNameLocation.GetStartPosition());
// If the function needs a capability on the object that may not be covered
// by all objects, check it now.
if (!metadata.GetRequiredBaseObjectCapability().empty()) {
const gd::ObjectMetadata &objectMetadata =
MetadataProvider::GetObjectMetadata(platform, objectType);
if (objectMetadata.IsUnsupportedBaseObjectCapability(
metadata.GetRequiredBaseObjectCapability())) {
function->diagnostic = RaiseTypeError(
_("This expression exists, but it can't be used on this object."),
objectNameLocation.GetStartPosition());
}
}
function->location = ExpressionParserLocation( function->location = ExpressionParserLocation(
objectNameLocation.GetStartPosition(), GetCurrentPosition()); objectNameLocation.GetStartPosition(), GetCurrentPosition());
function->objectNameLocation = objectNameLocation; function->objectNameLocation = objectNameLocation;

View File

@@ -11,25 +11,16 @@ namespace gd {
void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAdvancedExtension( void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAdvancedExtension(
gd::PlatformExtension& extension) { gd::PlatformExtension& extension) {
extension.SetExtensionInformation(
"BuiltinAdvanced",
_("Advanced control features"),
_("Advanced control features to be used in events."),
"Florian Rival",
"Open source (MIT License)");
extension extension
.AddCondition("Toujours", .SetExtensionInformation(
_("Always"), "BuiltinAdvanced",
_("This condition always returns true (or always false, if " _("Event functions"),
"the condition is inverted)."), _("Advanced control features for functions made with events."),
_("Always"), "Florian Rival",
_("Other"), "Open source (MIT License)")
"res/conditions/toujours24.png", .SetCategory("Advanced");
"res/conditions/toujours.png") extension.AddInstructionOrExpressionGroupMetadata(_("Event functions"))
.SetHelpPath("/all-features/advanced-conditions") .SetIcon("res/function32.png");
.AddCodeOnlyParameter("conditionInverted", "")
.MarkAsAdvanced();
extension extension
.AddAction( .AddAction(
@@ -38,9 +29,9 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAdvancedExtension(
_("Set the return value of the events function to the specified " _("Set the return value of the events function to the specified "
"number (to be used with \"Expression\" functions)."), "number (to be used with \"Expression\" functions)."),
_("Set return value to number _PARAM0_"), _("Set return value to number _PARAM0_"),
_("Functions"), "",
"res/function24.png", "res/function32.png",
"res/function16.png") "res/function32.png")
.SetHelpPath("/events/functions/return") .SetHelpPath("/events/functions/return")
.AddParameter("expression", "The number to be returned") .AddParameter("expression", "The number to be returned")
.MarkAsAdvanced(); .MarkAsAdvanced();
@@ -52,9 +43,9 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAdvancedExtension(
_("Set the return value of the events function to the specified text " _("Set the return value of the events function to the specified text "
"(to be used with \"String Expression\" functions)."), "(to be used with \"String Expression\" functions)."),
_("Set return value to text _PARAM0_"), _("Set return value to text _PARAM0_"),
_("Functions"), "",
"res/function24.png", "res/function32.png",
"res/function16.png") "res/function32.png")
.SetHelpPath("/events/functions/return") .SetHelpPath("/events/functions/return")
.AddParameter("string", "The text to be returned") .AddParameter("string", "The text to be returned")
.MarkAsAdvanced(); .MarkAsAdvanced();
@@ -65,9 +56,9 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAdvancedExtension(
_("Set the return value of the Condition events function to " _("Set the return value of the Condition events function to "
"either true (condition will pass) or false."), "either true (condition will pass) or false."),
_("Set return value of the condition to _PARAM0_"), _("Set return value of the condition to _PARAM0_"),
_("Functions"), "",
"res/function24.png", "res/function32.png",
"res/function16.png") "res/function32.png")
.SetHelpPath("/events/functions/return") .SetHelpPath("/events/functions/return")
.AddParameter("trueorfalse", "Should the condition be true or false?") .AddParameter("trueorfalse", "Should the condition be true or false?")
.MarkAsAdvanced(); .MarkAsAdvanced();
@@ -80,9 +71,9 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAdvancedExtension(
"a string, an empty string is considered as \"false\". " "a string, an empty string is considered as \"false\". "
"If it's a number, 0 is considered as \"false\"."), "If it's a number, 0 is considered as \"false\"."),
_("Parameter _PARAM0_ is true"), _("Parameter _PARAM0_ is true"),
_("Functions"), "",
"res/function24.png", "res/function32.png",
"res/function16.png") "res/function32.png")
.AddParameter("functionParameterName", "Parameter name") .AddParameter("functionParameterName", "Parameter name")
.MarkAsAdvanced(); .MarkAsAdvanced();
@@ -91,7 +82,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAdvancedExtension(
"GetArgumentAsNumber", "GetArgumentAsNumber",
_("Get function parameter value"), _("Get function parameter value"),
_("Get function parameter (also called \"argument\") value"), _("Get function parameter (also called \"argument\") value"),
_("Functions"), "",
"res/function16.png") "res/function16.png")
.AddParameter("functionParameterName", "Parameter name"); .AddParameter("functionParameterName", "Parameter name");
@@ -100,7 +91,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAdvancedExtension(
"GetArgumentAsString", "GetArgumentAsString",
_("Get function parameter text"), _("Get function parameter text"),
_("Get function parameter (also called \"argument\") text "), _("Get function parameter (also called \"argument\") text "),
_("Functions"), "",
"res/function16.png") "res/function16.png")
.AddParameter("functionParameterName", "Parameter name"); .AddParameter("functionParameterName", "Parameter name");
} }

View File

@@ -15,8 +15,6 @@ namespace gd {
* so that it provides standards events, objects or instructions of an * so that it provides standards events, objects or instructions of an
* extension. * extension.
* *
* TOOD: Usage example.
*
* \ingroup BuiltinExtensions * \ingroup BuiltinExtensions
*/ */
class GD_CORE_API BuiltinExtensionsImplementer { class GD_CORE_API BuiltinExtensionsImplementer {

View File

@@ -14,12 +14,15 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
extension extension
.SetExtensionInformation( .SetExtensionInformation(
"BuiltinAudio", "BuiltinAudio",
_("Audio"), _("Sounds and musics"),
_("GDevelop provides several conditions and actions to play audio " _("GDevelop provides several conditions and actions to play audio "
"files. They can be either long musics or short sound effects."), "files. They can be either long musics or short sound effects."),
"Florian Rival", "Florian Rival",
"Open source (MIT License)") "Open source (MIT License)")
.SetExtensionHelpPath("/all-features/audio"); .SetExtensionHelpPath("/all-features/audio")
.SetCategory("Audio");
extension.AddInstructionOrExpressionGroupMetadata(_("Sounds and musics"))
.SetIcon("res/actions/music24.png");
extension extension
.AddAction("PlaySoundCanal", .AddAction("PlaySoundCanal",
@@ -28,7 +31,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
"you'll be able to manipulate it."), "you'll be able to manipulate it."),
_("Play the sound _PARAM1_ on the channel _PARAM2_, vol.: " _("Play the sound _PARAM1_ on the channel _PARAM2_, vol.: "
"_PARAM4_, loop: _PARAM3_"), "_PARAM4_, loop: _PARAM3_"),
_("Audio/Sounds on channels"), _("Sounds on channels"),
"res/actions/son24.png", "res/actions/son24.png",
"res/actions/son.png") "res/actions/son.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -49,7 +52,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
_("Stop the sound of a channel"), _("Stop the sound of a channel"),
_("Stop the sound on the specified channel."), _("Stop the sound on the specified channel."),
_("Stop the sound of channel _PARAM1_"), _("Stop the sound of channel _PARAM1_"),
_("Audio/Sounds on channels"), _("Sounds on channels"),
"res/actions/son24.png", "res/actions/son24.png",
"res/actions/son.png") "res/actions/son.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -61,7 +64,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
_("Pause the sound of a channel"), _("Pause the sound of a channel"),
_("Pause the sound played on the specified channel."), _("Pause the sound played on the specified channel."),
_("Pause the sound of channel _PARAM1_"), _("Pause the sound of channel _PARAM1_"),
_("Audio/Sounds on channels"), _("Sounds on channels"),
"res/actions/son24.png", "res/actions/son24.png",
"res/actions/son.png") "res/actions/son.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -73,7 +76,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
_("Play the sound of a channel"), _("Play the sound of a channel"),
_("Play the sound of the channel."), _("Play the sound of the channel."),
_("Play the sound of channel _PARAM1_"), _("Play the sound of channel _PARAM1_"),
_("Audio/Sounds on channels"), _("Sounds on channels"),
"res/actions/son24.png", "res/actions/son24.png",
"res/actions/son.png") "res/actions/son.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -87,7 +90,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
"able to interact with it later."), "able to interact with it later."),
_("Play the music _PARAM1_ on channel _PARAM2_, vol.: " _("Play the music _PARAM1_ on channel _PARAM2_, vol.: "
"_PARAM4_, loop: _PARAM3_"), "_PARAM4_, loop: _PARAM3_"),
_("Audio/Music on channels"), _("Music on channels"),
"res/actions/music24.png", "res/actions/music24.png",
"res/actions/music.png") "res/actions/music.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -108,7 +111,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
_("Stop the music on a channel"), _("Stop the music on a channel"),
_("Stop the music on the specified channel"), _("Stop the music on the specified channel"),
_("Stop the music of channel _PARAM1_"), _("Stop the music of channel _PARAM1_"),
_("Audio/Music on channels"), _("Music on channels"),
"res/actions/music24.png", "res/actions/music24.png",
"res/actions/music.png") "res/actions/music.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -120,7 +123,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
_("Pause the music of a channel"), _("Pause the music of a channel"),
_("Pause the music on the specified channel."), _("Pause the music on the specified channel."),
_("Pause the music of channel _PARAM1_"), _("Pause the music of channel _PARAM1_"),
_("Audio/Music on channels"), _("Music on channels"),
"res/actions/music24.png", "res/actions/music24.png",
"res/actions/music.png") "res/actions/music.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -132,7 +135,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
_("Play the music of a channel"), _("Play the music of a channel"),
_("Play the music of the channel."), _("Play the music of the channel."),
_("Play the music of channel _PARAM1_"), _("Play the music of channel _PARAM1_"),
_("Audio/Music on channels"), _("Music on channels"),
"res/actions/music24.png", "res/actions/music24.png",
"res/actions/music.png") "res/actions/music.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -145,7 +148,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
_("This action modifies the volume of the sound on the " _("This action modifies the volume of the sound on the "
"specified channel. The volume is between 0 and 100."), "specified channel. The volume is between 0 and 100."),
_("the volume of the sound on channel _PARAM1_"), _("the volume of the sound on channel _PARAM1_"),
_("Audio/Sounds on channels"), _("Sounds on channels"),
"res/actions/sonVolume24.png", "res/actions/sonVolume24.png",
"res/actions/sonVolume.png") "res/actions/sonVolume.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -159,7 +162,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
_("This action modifies the volume of the music on the " _("This action modifies the volume of the music on the "
"specified channel. The volume is between 0 and 100."), "specified channel. The volume is between 0 and 100."),
_("the volume of the music on channel _PARAM1_"), _("the volume of the music on channel _PARAM1_"),
_("Audio/Music on channels"), _("Music on channels"),
"res/actions/musicVolume24.png", "res/actions/musicVolume24.png",
"res/actions/musicVolume.png") "res/actions/musicVolume.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -173,7 +176,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
_("This action modifies the global volume of the game. The " _("This action modifies the global volume of the game. The "
"volume is between 0 and 100."), "volume is between 0 and 100."),
_("the global sound level"), _("the global sound level"),
_("Audio"), "",
"res/actions/volume24.png", "res/actions/volume24.png",
"res/actions/volume.png") "res/actions/volume.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -186,7 +189,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
_("This action modifies the pitch (speed) of the sound on a " _("This action modifies the pitch (speed) of the sound on a "
"channel.\n1 is the default pitch."), "channel.\n1 is the default pitch."),
_("the pitch of the sound on channel _PARAM1_"), _("the pitch of the sound on channel _PARAM1_"),
_("Audio/Sounds on channels"), _("Sounds on channels"),
"res/actions/son24.png", "res/actions/son24.png",
"res/actions/son.png") "res/actions/son.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -200,7 +203,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
_("This action modifies the pitch of the music on the " _("This action modifies the pitch of the music on the "
"specified channel. 1 is the default pitch"), "specified channel. 1 is the default pitch"),
_("the pitch of the music on channel _PARAM1_"), _("the pitch of the music on channel _PARAM1_"),
_("Audio/Music on channels"), _("Music on channels"),
"res/actions/music24.png", "res/actions/music24.png",
"res/actions/music.png") "res/actions/music.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -214,7 +217,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
_("This action modifies the playing offset of the sound on a " _("This action modifies the playing offset of the sound on a "
"channel"), "channel"),
_("the playing offset of the sound on channel _PARAM1_"), _("the playing offset of the sound on channel _PARAM1_"),
_("Audio/Sounds on channels"), _("Sounds on channels"),
"res/actions/son24.png", "res/actions/son24.png",
"res/actions/son.png") "res/actions/son.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -228,7 +231,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
_("This action modifies the playing offset of the music on " _("This action modifies the playing offset of the music on "
"the specified channel"), "the specified channel"),
_("the playing offset of the music on channel _PARAM1_"), _("the playing offset of the music on channel _PARAM1_"),
_("Audio/Music on channels"), _("Music on channels"),
"res/actions/music24.png", "res/actions/music24.png",
"res/actions/music.png") "res/actions/music.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -241,7 +244,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
_("Play a sound"), _("Play a sound"),
_("Play a sound."), _("Play a sound."),
_("Play the sound _PARAM1_, vol.: _PARAM3_, loop: _PARAM2_"), _("Play the sound _PARAM1_, vol.: _PARAM3_, loop: _PARAM2_"),
_("Audio"), "",
"res/actions/son24.png", "res/actions/son24.png",
"res/actions/son.png") "res/actions/son.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -261,7 +264,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
_("Play a music file"), _("Play a music file"),
_("Play a music file."), _("Play a music file."),
_("Play the music _PARAM1_, vol.: _PARAM3_, loop: _PARAM2_"), _("Play the music _PARAM1_, vol.: _PARAM3_, loop: _PARAM2_"),
_("Audio"), "",
"res/actions/music24.png", "res/actions/music24.png",
"res/actions/music.png") "res/actions/music.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -281,7 +284,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
_("Preload a music file"), _("Preload a music file"),
_("Preload a music file in memory."), _("Preload a music file in memory."),
_("Preload the music file _PARAM1_"), _("Preload the music file _PARAM1_"),
_("Audio/Loading"), _("Loading"),
"res/actions/music24.png", "res/actions/music24.png",
"res/actions/music.png") "res/actions/music.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -293,7 +296,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
_("Preload a sound file"), _("Preload a sound file"),
_("Preload a sound file in memory."), _("Preload a sound file in memory."),
_("Preload the sound file _PARAM1_"), _("Preload the sound file _PARAM1_"),
_("Audio/Loading"), _("Loading"),
"res/actions/son24.png", "res/actions/son24.png",
"res/actions/son.png") "res/actions/son.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -301,46 +304,43 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
.MarkAsComplex(); .MarkAsComplex();
extension extension
.AddAction("UnloadMusic", .AddAction(
_("Unload a music file"), "UnloadMusic",
_( _("Unload a music file"),
"Unload a music file from memory. " _("Unload a music file from memory. "
"Unloading a music file will cause any music playing it to stop." "Unloading a music file will cause any music playing it to stop."),
), _("Unload the music file _PARAM1_"),
_("Unload the music file _PARAM1_"), _("Loading"),
_("Audio/Loading"), "res/actions/music24.png",
"res/actions/music24.png", "res/actions/music.png")
"res/actions/music.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
.AddParameter("musicfile", _("Audio file (or audio resource name)")) .AddParameter("musicfile", _("Audio file (or audio resource name)"))
.MarkAsComplex(); .MarkAsComplex();
extension extension
.AddAction("UnloadSound", .AddAction(
_("Unload a sound file"), "UnloadSound",
_( _("Unload a sound file"),
"Unload a sound file from memory. " _("Unload a sound file from memory. "
"Unloading a sound file will cause any sounds playing it to stop." "Unloading a sound file will cause any sounds playing it to stop."),
), _("Unload the sound file _PARAM1_"),
_("Unload the sound file _PARAM1_"), _("Loading"),
_("Audio/Loading"), "res/actions/son24.png",
"res/actions/son24.png", "res/actions/son.png")
"res/actions/son.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
.AddParameter("soundfile", _("Sound file (or sound resource name)")) .AddParameter("soundfile", _("Sound file (or sound resource name)"))
.MarkAsComplex(); .MarkAsComplex();
extension extension
.AddAction("UnloadAllAudio", .AddAction(
_("Unload all audio"), "UnloadAllAudio",
_( _("Unload all audio"),
"Unload all the audio in memory. " _("Unload all the audio in memory. "
"This will cause every sound and music of the game to stop." "This will cause every sound and music of the game to stop."),
), _("Unload all audio files"),
_("Unload all audio files"), _("Loading"),
_("Audio/Loading"), "res/actions/music24.png",
"res/actions/music24.png", "res/actions/music.png")
"res/actions/music.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
.MarkAsComplex(); .MarkAsComplex();
@@ -349,7 +349,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
_("A music file is being played"), _("A music file is being played"),
_("Test if the music on a channel is being played"), _("Test if the music on a channel is being played"),
_("Music on channel _PARAM1_ is being played"), _("Music on channel _PARAM1_ is being played"),
_("Audio/Music on channels"), _("Music on channels"),
"res/conditions/musicplaying24.png", "res/conditions/musicplaying24.png",
"res/conditions/musicplaying.png") "res/conditions/musicplaying.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -361,7 +361,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
_("A music file is paused"), _("A music file is paused"),
_("Test if the music on the specified channel is paused."), _("Test if the music on the specified channel is paused."),
_("Music on channel _PARAM1_ is paused"), _("Music on channel _PARAM1_ is paused"),
_("Audio/Music on channels"), _("Music on channels"),
"res/conditions/musicpaused24.png", "res/conditions/musicpaused24.png",
"res/conditions/musicpaused.png") "res/conditions/musicpaused.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -373,7 +373,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
_("A music file is stopped"), _("A music file is stopped"),
_("Test if the music on the specified channel is stopped."), _("Test if the music on the specified channel is stopped."),
_("Music on channel _PARAM1_ is stopped"), _("Music on channel _PARAM1_ is stopped"),
_("Audio/Music on channels"), _("Music on channels"),
"res/conditions/musicstopped24.png", "res/conditions/musicstopped24.png",
"res/conditions/musicstopped.png") "res/conditions/musicstopped.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -385,7 +385,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
_("A sound is being played"), _("A sound is being played"),
_("Test if the sound on a channel is being played."), _("Test if the sound on a channel is being played."),
_("Sound on channel _PARAM1_ is being played"), _("Sound on channel _PARAM1_ is being played"),
_("Audio/Sounds on channels"), _("Sounds on channels"),
"res/conditions/sonplaying24.png", "res/conditions/sonplaying24.png",
"res/conditions/sonplaying.png") "res/conditions/sonplaying.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -397,7 +397,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
_("A sound is paused"), _("A sound is paused"),
_("Test if the sound on the specified channel is paused."), _("Test if the sound on the specified channel is paused."),
_("Sound on channel _PARAM1_ is paused"), _("Sound on channel _PARAM1_ is paused"),
_("Audio/Sounds on channels"), _("Sounds on channels"),
"res/conditions/sonpaused24.png", "res/conditions/sonpaused24.png",
"res/conditions/sonpaused.png") "res/conditions/sonpaused.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -409,7 +409,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
_("A sound is stopped"), _("A sound is stopped"),
_("Test if the sound on the specified channel is stopped."), _("Test if the sound on the specified channel is stopped."),
_("Sound on channel _PARAM1_ is stopped"), _("Sound on channel _PARAM1_ is stopped"),
_("Audio/Sounds on channels"), _("Sounds on channels"),
"res/conditions/sonstopped24.png", "res/conditions/sonstopped24.png",
"res/conditions/sonstopped.png") "res/conditions/sonstopped.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -423,7 +423,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
_("Test the volume of the sound on the specified channel. The volume " _("Test the volume of the sound on the specified channel. The volume "
"is between 0 and 100."), "is between 0 and 100."),
_("the volume of the sound on channel _PARAM1_"), _("the volume of the sound on channel _PARAM1_"),
_("Audio/Sounds on channels"), _("Sounds on channels"),
"res/conditions/sonVolume24.png", "res/conditions/sonVolume24.png",
"res/conditions/sonVolume.png") "res/conditions/sonVolume.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -438,7 +438,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
_("Test the volume of the music on a specified channel. The volume " _("Test the volume of the music on a specified channel. The volume "
"is between 0 and 100."), "is between 0 and 100."),
_("the volume of the music on channel _PARAM1_"), _("the volume of the music on channel _PARAM1_"),
_("Audio/Music on channels"), _("Music on channels"),
"res/conditions/musicVolume24.png", "res/conditions/musicVolume24.png",
"res/conditions/musicVolume.png") "res/conditions/musicVolume.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -452,7 +452,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
_("Global volume"), _("Global volume"),
_("Test the global sound level. The volume is between 0 and 100."), _("Test the global sound level. The volume is between 0 and 100."),
_("the global game volume"), _("the global game volume"),
_("Audio"), "",
"res/conditions/volume24.png", "res/conditions/volume24.png",
"res/conditions/volume.png") "res/conditions/volume.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -465,7 +465,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
_("Test the pitch of the sound on the specified channel. 1 is the " _("Test the pitch of the sound on the specified channel. 1 is the "
"default pitch."), "default pitch."),
_("the pitch of the sound on channel _PARAM1_"), _("the pitch of the sound on channel _PARAM1_"),
_("Audio/Sounds on channels"), _("Sounds on channels"),
"res/conditions/sonVolume24.png", "res/conditions/sonVolume24.png",
"res/conditions/sonVolume.png") "res/conditions/sonVolume.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -480,7 +480,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
_("Test the pitch (speed) of the music on a specified channel. 1 is " _("Test the pitch (speed) of the music on a specified channel. 1 is "
"the default pitch."), "the default pitch."),
_("the pitch of the music on channel _PARAM1_"), _("the pitch of the music on channel _PARAM1_"),
_("Audio/Music on channels"), _("Music on channels"),
"res/conditions/musicVolume24.png", "res/conditions/musicVolume24.png",
"res/conditions/musicVolume.png") "res/conditions/musicVolume.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -494,7 +494,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
_("Playing offset of the sound on a channel"), _("Playing offset of the sound on a channel"),
_("Test the playing offset of the sound on the specified channel."), _("Test the playing offset of the sound on the specified channel."),
_("the playing offset of the sound on channel _PARAM1_"), _("the playing offset of the sound on channel _PARAM1_"),
_("Audio/Sounds on channels"), _("Sounds on channels"),
"res/conditions/sonVolume24.png", "res/conditions/sonVolume24.png",
"res/conditions/sonVolume.png") "res/conditions/sonVolume.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -508,7 +508,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
_("Playing offset of the music on a channel"), _("Playing offset of the music on a channel"),
_("Test the playing offset of the music on the specified channel."), _("Test the playing offset of the music on the specified channel."),
_("the playing offset of the music on channel _PARAM1_"), _("the playing offset of the music on channel _PARAM1_"),
_("Audio/Music on channels"), _("Music on channels"),
"res/conditions/musicVolume24.png", "res/conditions/musicVolume24.png",
"res/conditions/musicVolume.png") "res/conditions/musicVolume.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -577,7 +577,6 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
_("Sound level"), _("Sound level"),
"res/conditions/volume.png") "res/conditions/volume.png")
.AddCodeOnlyParameter("currentScene", ""); .AddCodeOnlyParameter("currentScene", "");
} }
} // namespace gd } // namespace gd

View File

@@ -4,9 +4,9 @@
* reserved. This project is released under the MIT License. * reserved. This project is released under the MIT License.
*/ */
#include "AllBuiltinExtensions.h" #include "AllBuiltinExtensions.h"
#include "GDCore/Extensions/Metadata/MultipleInstructionMetadata.h"
#include "GDCore/Project/Object.h" #include "GDCore/Project/Object.h"
#include "GDCore/Tools/Localization.h" #include "GDCore/Tools/Localization.h"
#include "GDCore/Extensions/Metadata/MultipleInstructionMetadata.h"
using namespace std; using namespace std;
namespace gd { namespace gd {
@@ -16,11 +16,17 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
extension extension
.SetExtensionInformation( .SetExtensionInformation(
"BuiltinObject", "BuiltinObject",
_("Features for all objects"), _("Objects"),
_("Common features that can be used for all objects in GDevelop."), _("Common features that can be used for all objects in GDevelop."),
"Florian Rival", "Florian Rival",
"Open source (MIT License)") "Open source (MIT License)")
.SetExtensionHelpPath("/objects/base_object/events"); .SetExtensionHelpPath("/objects/base_object/events");
extension.AddInstructionOrExpressionGroupMetadata(_("Collision"))
.SetIcon("res/conditions/collision24.png");
extension.AddInstructionOrExpressionGroupMetadata(_("Objects"))
.SetIcon("res/actions/create24.png");
extension.AddInstructionOrExpressionGroupMetadata(_("Movement using forces"))
.SetIcon("res/actions/force24.png");
gd::ObjectMetadata& obj = extension.AddObject<gd::Object>( gd::ObjectMetadata& obj = extension.AddObject<gd::Object>(
"", _("Base object"), _("Base object"), "res/objeticon24.png"); "", _("Base object"), _("Base object"), "res/objeticon24.png");
@@ -92,7 +98,8 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
obj.AddAction("SetCenter", obj.AddAction("SetCenter",
_("Center position"), _("Center position"),
_("Change the position of an object, using its center."), _("Change the position of an object, using its center."),
_("Change the position of the center of _PARAM0_: _PARAM1_ _PARAM2_ (x " _("Change the position of the center of _PARAM0_: _PARAM1_ "
"_PARAM2_ (x "
"axis), _PARAM3_ _PARAM4_ (y axis)"), "axis), _PARAM3_ _PARAM4_ (y axis)"),
_("Position/Center"), _("Position/Center"),
"res/actions/position24.png", "res/actions/position24.png",
@@ -104,75 +111,91 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
.AddParameter("expression", _("Y position")) .AddParameter("expression", _("Y position"))
.MarkAsSimple(); .MarkAsSimple();
obj.AddExpressionAndConditionAndAction("number", "CenterX", obj.AddExpressionAndConditionAndAction(
_("Center X position"), "number",
_("the X position of the center of rotation"), "CenterX",
_("the X position of the center"), _("Center X position"),
_("Position/Center"), _("the X position of the center of rotation"),
"res/actions/position24.png") _("the X position of the center"),
_("Position/Center"),
"res/actions/position24.png")
.AddParameter("object", _("Object")) .AddParameter("object", _("Object"))
.UseStandardParameters("number"); .UseStandardParameters("number");
obj.AddExpressionAndConditionAndAction("number", "CenterY", obj.AddExpressionAndConditionAndAction(
_("Center Y position"), "number",
_("the Y position of the center of rotation"), "CenterY",
_("the Y position of the center"), _("Center Y position"),
_("Position/Center"), _("the Y position of the center of rotation"),
"res/actions/position24.png") _("the Y position of the center"),
_("Position/Center"),
"res/actions/position24.png")
.AddParameter("object", _("Object")) .AddParameter("object", _("Object"))
.UseStandardParameters("number"); .UseStandardParameters("number");
obj.AddExpressionAndCondition("number", "BoundingBoxLeft", obj.AddExpressionAndCondition("number",
_("Bounding box left position"), "BoundingBoxLeft",
_("the bounding box (the area encapsulating the object) left position"), _("Bounding box left position"),
_("the bounding box left position"), _("the bounding box (the area encapsulating "
_("Position/Bounding Box"), "the object) left position"),
"res/conditions/bounding-box-left.svg") _("the bounding box left position"),
_("Position/Bounding Box"),
"res/conditions/bounding-box-left.svg")
.AddParameter("object", _("Object")) .AddParameter("object", _("Object"))
.UseStandardParameters("number"); .UseStandardParameters("number");
obj.AddExpressionAndCondition("number", "BoundingBoxTop", obj.AddExpressionAndCondition(
_("Bounding box top position"), "number",
_("the bounding box (the area encapsulating the object) top position"), "BoundingBoxTop",
_("the bounding box top position"), _("Bounding box top position"),
_("Position/Bounding Box"), _("the bounding box (the area encapsulating the object) top position"),
"res/conditions/bounding-box-top.svg") _("the bounding box top position"),
_("Position/Bounding Box"),
"res/conditions/bounding-box-top.svg")
.AddParameter("object", _("Object")) .AddParameter("object", _("Object"))
.UseStandardParameters("number"); .UseStandardParameters("number");
obj.AddExpressionAndCondition("number", "BoundingBoxRight", obj.AddExpressionAndCondition("number",
_("Bounding box right position"), "BoundingBoxRight",
_("the bounding box (the area encapsulating the object) right position"), _("Bounding box right position"),
_("the bounding box right position"), _("the bounding box (the area encapsulating "
_("Position/Bounding Box"), "the object) right position"),
"res/conditions/bounding-box-right.svg") _("the bounding box right position"),
_("Position/Bounding Box"),
"res/conditions/bounding-box-right.svg")
.AddParameter("object", _("Object")) .AddParameter("object", _("Object"))
.UseStandardParameters("number"); .UseStandardParameters("number");
obj.AddExpressionAndCondition("number", "BoundingBoxBottom", obj.AddExpressionAndCondition("number",
_("Bounding box bottom position"), "BoundingBoxBottom",
_("the bounding box (the area encapsulating the object) bottom position"), _("Bounding box bottom position"),
_("the bounding box bottom position"), _("the bounding box (the area encapsulating "
_("Position/Bounding Box"), "the object) bottom position"),
"res/conditions/bounding-box-bottom.svg") _("the bounding box bottom position"),
_("Position/Bounding Box"),
"res/conditions/bounding-box-bottom.svg")
.AddParameter("object", _("Object")) .AddParameter("object", _("Object"))
.UseStandardParameters("number"); .UseStandardParameters("number");
obj.AddExpressionAndCondition("number", "BoundingBoxCenterX", obj.AddExpressionAndCondition("number",
_("Bounding box center X position"), "BoundingBoxCenterX",
_("the bounding box (the area encapsulating the object) center X position"), _("Bounding box center X position"),
_("the bounding box center X position"), _("the bounding box (the area encapsulating "
_("Position/Bounding Box"), "the object) center X position"),
"res/conditions/bounding-box-center.svg") _("the bounding box center X position"),
_("Position/Bounding Box"),
"res/conditions/bounding-box-center.svg")
.AddParameter("object", _("Object")) .AddParameter("object", _("Object"))
.UseStandardParameters("number"); .UseStandardParameters("number");
obj.AddExpressionAndCondition("number", "BoundingBoxCenterY", obj.AddExpressionAndCondition("number",
_("Bounding box center Y position"), "BoundingBoxCenterY",
_("the bounding box (the area encapsulating the object) center Y position"), _("Bounding box center Y position"),
_("the bounding box center Y position"), _("the bounding box (the area encapsulating "
_("Position/Bounding Box"), "the object) center Y position"),
"res/conditions/bounding-box-center.svg") _("the bounding box center Y position"),
_("Position/Bounding Box"),
"res/conditions/bounding-box-center.svg")
.AddParameter("object", _("Object")) .AddParameter("object", _("Object"))
.UseStandardParameters("number"); .UseStandardParameters("number");
@@ -289,7 +312,8 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
"AddForceVersPos", "AddForceVersPos",
_("Add a force to move toward a position"), _("Add a force to move toward a position"),
_("Add a force to an object to make it move toward a position."), _("Add a force to an object to make it move toward a position."),
_("Move _PARAM0_ toward _PARAM1_;_PARAM2_ with _PARAM4_ force of _PARAM3_ " _("Move _PARAM0_ toward _PARAM1_;_PARAM2_ with _PARAM4_ force of "
"_PARAM3_ "
"pixels"), "pixels"),
_("Movement using forces"), _("Movement using forces"),
"res/actions/force24.png", "res/actions/force24.png",
@@ -306,11 +330,11 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
"AddForceTournePos", "AddForceTournePos",
"Add a force to move around a position", "Add a force to move around a position",
"Add a force to an object to make it rotate around a " "Add a force to an object to make it rotate around a "
"position.\nNote that the movement is not precise, especially if " "position.\nNote that the movement is not precise, especially if "
"the speed is high.\nTo position an object around a position more " "the speed is high.\nTo position an object around a position more "
"precisely, use the actions in the category \"Position\".", "precisely, use the actions in the category \"Position\".",
"Rotate _PARAM0_ around _PARAM1_;_PARAM2_ at _PARAM3_ deg/sec and " "Rotate _PARAM0_ around _PARAM1_;_PARAM2_ at _PARAM3_ deg/sec and "
"_PARAM4_ pixels away", "_PARAM4_ pixels away",
_("Movement using forces"), _("Movement using forces"),
"res/actions/forceTourne24.png", "res/actions/forceTourne24.png",
"res/actions/forceTourne.png") "res/actions/forceTourne.png")
@@ -563,7 +587,8 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
obj.AddCondition("AngleOfDisplacement", obj.AddCondition("AngleOfDisplacement",
_("Angle of movement (using forces)"), _("Angle of movement (using forces)"),
_("Compare the angle of movement of an object according to the forces applied on it."), _("Compare the angle of movement of an object according to "
"the forces applied on it."),
_("Angle of movement of _PARAM0_ is _PARAM1_ (tolerance" _("Angle of movement of _PARAM0_ is _PARAM1_ (tolerance"
": _PARAM2_ degrees)"), ": _PARAM2_ degrees)"),
_("Movement using forces"), _("Movement using forces"),
@@ -719,14 +744,14 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
.AddParameter("yesorno", _("Activate?")) .AddParameter("yesorno", _("Activate?"))
.MarkAsAdvanced(); .MarkAsAdvanced();
obj.AddAction( obj.AddAction("AddForceVers",
"AddForceVers", _("Add a force to move toward an object"),
_("Add a force to move toward an object"), _("Add a force to an object to make it move toward another."),
_("Add a force to an object to make it move toward another."), _("Move _PARAM0_ toward _PARAM1_ with _PARAM3_ force of "
_("Move _PARAM0_ toward _PARAM1_ with _PARAM3_ force of _PARAM2_ pixels"), "_PARAM2_ pixels"),
_("Movement using forces"), _("Movement using forces"),
"res/actions/forceVers24.png", "res/actions/forceVers24.png",
"res/actions/forceVers.png") "res/actions/forceVers.png")
.AddParameter("object", _("Object")) .AddParameter("object", _("Object"))
.AddParameter("objectPtr", _("Target Object")) .AddParameter("objectPtr", _("Target Object"))
@@ -846,6 +871,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
.AddCodeOnlyParameter("conditionInverted", "") .AddCodeOnlyParameter("conditionInverted", "")
.MarkAsSimple(); .MarkAsSimple();
// Deprecated and replaced by CompareObjectTimer
obj.AddCondition( obj.AddCondition(
"ObjectTimer", "ObjectTimer",
_("Value of an object timer"), _("Value of an object timer"),
@@ -856,7 +882,23 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
"res/conditions/timer.png") "res/conditions/timer.png")
.AddParameter("object", _("Object")) .AddParameter("object", _("Object"))
.AddParameter("string", _("Timer's name")) .AddParameter("string", _("Timer's name"))
.AddParameter("expression", _("Time in seconds")); .AddParameter("expression", _("Time in seconds"))
.SetHidden();
obj.AddCondition(
"CompareObjectTimer",
_("Value of an object timer"),
_("Compare the elapsed time of an object timer. This condition "
"doesn't start the timer."),
_("The timer _PARAM1_ of _PARAM0_ _PARAM2_ _PARAM3_ seconds"),
_("Timers"),
"res/conditions/timer24.png",
"res/conditions/timer.png")
.AddParameter("object", _("Object"))
.AddParameter("string", _("Timer's name"))
.AddParameter("relationalOperator", _("Sign of the test"), "time")
.AddParameter("expression", _("Time in seconds"))
.SetManipulatedType("number");
obj.AddCondition("ObjectTimerPaused", obj.AddCondition("ObjectTimerPaused",
_("Object timer paused"), _("Object timer paused"),
@@ -869,14 +911,15 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
.AddParameter("string", _("Timer's name")) .AddParameter("string", _("Timer's name"))
.MarkAsAdvanced(); .MarkAsAdvanced();
obj.AddAction("ResetObjectTimer", obj.AddAction(
_("Start (or reset) an object timer"), "ResetObjectTimer",
_("Reset the specified object timer, if the timer doesn't exist " _("Start (or reset) an object timer"),
"it's created and started."), _("Reset the specified object timer, if the timer doesn't exist "
_("Reset the timer _PARAM1_ of _PARAM0_"), "it's created and started."),
_("Timers"), _("Start (or reset) the timer _PARAM1_ of _PARAM0_"),
"res/actions/timer24.png", _("Timers"),
"res/actions/timer.png") "res/actions/timer24.png",
"res/actions/timer.png")
.AddParameter("object", _("Object")) .AddParameter("object", _("Object"))
.AddParameter("string", _("Timer's name")); .AddParameter("string", _("Timer's name"));
@@ -1090,7 +1133,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
.AddParameter("object", _("Object")) .AddParameter("object", _("Object"))
.AddParameter("objectPtr", _("Object")); .AddParameter("objectPtr", _("Object"));
obj.AddExpression("XFromAngleAndDistance", obj.AddExpression("XFromAngleAndDistance",
_("X position from angle and distance"), _("X position from angle and distance"),
_("Compute the X position when given an angle and distance " _("Compute the X position when given an angle and distance "
"relative to the starting object. This is also known as " "relative to the starting object. This is also known as "
@@ -1102,7 +1145,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
.AddParameter("expression", _("Angle, in degrees")) .AddParameter("expression", _("Angle, in degrees"))
.AddParameter("expression", _("Distance")); .AddParameter("expression", _("Distance"));
obj.AddExpression("YFromAngleAndDistance", obj.AddExpression("YFromAngleAndDistance",
_("Y position from angle and distance"), _("Y position from angle and distance"),
_("Compute the Y position when given an angle and distance " _("Compute the Y position when given an angle and distance "
"relative to the starting object. This is also known as " "relative to the starting object. This is also known as "
@@ -1135,13 +1178,14 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
.AddParameter("object", _("Object")) .AddParameter("object", _("Object"))
.AddParameter("objectEffectName", _("Effect name")) .AddParameter("objectEffectName", _("Effect name"))
.AddParameter("yesorno", _("Enable?")) .AddParameter("yesorno", _("Enable?"))
.MarkAsSimple(); .MarkAsSimple()
.SetRequiresBaseObjectCapability("effect");
obj.AddAction("SetEffectDoubleParameter", obj.AddAction("SetEffectDoubleParameter",
_("Effect parameter (number)"), _("Effect parameter (number)"),
_("Change the value of a parameter of an effect.") + "\n" + _("Change the value of a parameter of an effect.") + "\n" +
_("You can find the parameter names (and change the effect " _("You can find the parameter names (and change the effect "
"names) in the effects window."), "names) in the effects window."),
_("Set _PARAM2_ to _PARAM3_ for effect _PARAM1_ of _PARAM0_"), _("Set _PARAM2_ to _PARAM3_ for effect _PARAM1_ of _PARAM0_"),
_("Effects"), _("Effects"),
"res/actions/effect24.png", "res/actions/effect24.png",
@@ -1150,13 +1194,15 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
.AddParameter("objectEffectName", _("Effect name")) .AddParameter("objectEffectName", _("Effect name"))
.AddParameter("objectEffectParameterName", _("Parameter name")) .AddParameter("objectEffectParameterName", _("Parameter name"))
.AddParameter("expression", _("New value")) .AddParameter("expression", _("New value"))
.MarkAsSimple(); .MarkAsSimple()
.SetRequiresBaseObjectCapability("effect");
obj.AddAction("SetEffectStringParameter", obj.AddAction("SetEffectStringParameter",
_("Effect parameter (string)"), _("Effect parameter (string)"),
_("Change the value (string) of a parameter of an effect.") + "\n" + _("Change the value (string) of a parameter of an effect.") +
_("You can find the parameter names (and change the effect " "\n" +
"names) in the effects window."), _("You can find the parameter names (and change the effect "
"names) in the effects window."),
_("Set _PARAM2_ to _PARAM3_ for effect _PARAM1_ of _PARAM0_"), _("Set _PARAM2_ to _PARAM3_ for effect _PARAM1_ of _PARAM0_"),
_("Effects"), _("Effects"),
"res/actions/effect24.png", "res/actions/effect24.png",
@@ -1165,13 +1211,14 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
.AddParameter("objectEffectName", _("Effect name")) .AddParameter("objectEffectName", _("Effect name"))
.AddParameter("objectEffectParameterName", _("Parameter name")) .AddParameter("objectEffectParameterName", _("Parameter name"))
.AddParameter("string", _("New value")) .AddParameter("string", _("New value"))
.MarkAsSimple(); .MarkAsSimple()
.SetRequiresBaseObjectCapability("effect");
obj.AddAction("SetEffectBooleanParameter", obj.AddAction("SetEffectBooleanParameter",
_("Effect parameter (enable or disable)"), _("Effect parameter (enable or disable)"),
_("Enable or disable a parameter of an effect.") + "\n" + _("Enable or disable a parameter of an effect.") + "\n" +
_("You can find the parameter names (and change the effect " _("You can find the parameter names (and change the effect "
"names) in the effects window."), "names) in the effects window."),
_("Enable _PARAM2_ for effect _PARAM1_ of _PARAM0_: _PARAM3_"), _("Enable _PARAM2_ for effect _PARAM1_ of _PARAM0_: _PARAM3_"),
_("Effects"), _("Effects"),
"res/actions/effect24.png", "res/actions/effect24.png",
@@ -1180,27 +1227,30 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
.AddParameter("objectEffectName", _("Effect name")) .AddParameter("objectEffectName", _("Effect name"))
.AddParameter("objectEffectParameterName", _("Parameter name")) .AddParameter("objectEffectParameterName", _("Parameter name"))
.AddParameter("yesorno", _("Enable?")) .AddParameter("yesorno", _("Enable?"))
.MarkAsSimple(); .MarkAsSimple()
.SetRequiresBaseObjectCapability("effect");
obj.AddCondition("IsEffectEnabled", obj.AddCondition("IsEffectEnabled",
_("Effect is enabled"), _("Effect is enabled"),
_("Check if the effect on an object is enabled."), _("Check if the effect on an object is enabled."),
_("Effect _PARAM1_ of _PARAM0_ is enabled"), _("Effect _PARAM1_ of _PARAM0_ is enabled"),
_("Effects"), _("Effects"),
"res/actions/effect24.png", "res/actions/effect24.png",
"res/actions/effect.png") "res/actions/effect.png")
.AddParameter("object", _("Object")) .AddParameter("object", _("Object"))
.AddParameter("objectEffectName", _("Effect name")) .AddParameter("objectEffectName", _("Effect name"))
.MarkAsSimple(); .MarkAsSimple()
.SetRequiresBaseObjectCapability("effect");
extension extension
.AddAction("Create", .AddAction("Create",
_("Create an object"), _("Create an object"),
_("Create an object at specified position"), _("Create an object at specified position"),
_("Create object _PARAM1_ at position _PARAM2_;_PARAM3_ (layer: _PARAM4_)"), _("Create object _PARAM1_ at position _PARAM2_;_PARAM3_ "
_("Objects"), "(layer: _PARAM4_)"),
"",
"res/actions/create24.png", "res/actions/create24.png",
"res/actions/create.png") "res/actions/create24.png")
.AddCodeOnlyParameter("objectsContext", "") .AddCodeOnlyParameter("objectsContext", "")
.AddParameter("objectListWithoutPicking", _("Object to create")) .AddParameter("objectListWithoutPicking", _("Object to create"))
.AddParameter("expression", _("X position")) .AddParameter("expression", _("X position"))
@@ -1216,9 +1266,9 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
"create the object with the specified name."), "create the object with the specified name."),
_("Among objects _PARAM1_, create object named _PARAM2_ at " _("Among objects _PARAM1_, create object named _PARAM2_ at "
"position _PARAM3_;_PARAM4_ (layer: _PARAM5_)"), "position _PARAM3_;_PARAM4_ (layer: _PARAM5_)"),
_("Objects"), "",
"res/actions/create24.png", "res/actions/create24.png",
"res/actions/create.png") "res/actions/create24.png")
.AddCodeOnlyParameter("objectsContext", "") .AddCodeOnlyParameter("objectsContext", "")
.AddParameter("objectListWithoutPicking", _("Group of potential objects")) .AddParameter("objectListWithoutPicking", _("Group of potential objects"))
.SetParameterLongDescription( .SetParameterLongDescription(
@@ -1372,13 +1422,10 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
extension extension
.AddCondition( .AddCondition(
"CollisionNP", //"CollisionNP" cames from an old condition to test "CollisionNP",
// collision between two sprites non precisely.
_("Collision"), _("Collision"),
_("Test the collision between two objects using their collision " _("Test the collision between two objects using their collision "
"masks.\nNote that some objects may not have collision " "masks."),
"masks.\nSome others, like Sprite objects, also provide more "
"precise collision conditions."),
_("_PARAM0_ is in collision with _PARAM1_"), _("_PARAM0_ is in collision with _PARAM1_"),
_("Collision"), _("Collision"),
"res/conditions/collision24.png", "res/conditions/collision24.png",
@@ -1422,7 +1469,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
_("Cast a ray from _PARAM1_;_PARAM2_, angle: _PARAM3_ and max " _("Cast a ray from _PARAM1_;_PARAM2_, angle: _PARAM3_ and max "
"distance: _PARAM4_px, against _PARAM0_, and save the " "distance: _PARAM4_px, against _PARAM0_, and save the "
"result in _PARAM5_, _PARAM6_"), "result in _PARAM5_, _PARAM6_"),
_("Collision"), "",
"res/conditions/raycast24.png", "res/conditions/raycast24.png",
"res/conditions/raycast.png") "res/conditions/raycast.png")
.AddParameter("objectList", _("Objects to test against the ray")) .AddParameter("objectList", _("Objects to test against the ray"))
@@ -1453,7 +1500,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
_("Cast a ray from from _PARAM1_;_PARAM2_ to _PARAM3_;_PARAM4_ " _("Cast a ray from from _PARAM1_;_PARAM2_ to _PARAM3_;_PARAM4_ "
"against _PARAM0_, and save the " "against _PARAM0_, and save the "
"result in _PARAM5_, _PARAM6_"), "result in _PARAM5_, _PARAM6_"),
_("Collision"), "",
"res/conditions/raycast24.png", "res/conditions/raycast24.png",
"res/conditions/raycast.png") "res/conditions/raycast.png")
.AddParameter("objectList", _("Objects to test against the ray")) .AddParameter("objectList", _("Objects to test against the ray"))
@@ -1477,21 +1524,21 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
_("Number of objects"), _("Number of objects"),
_("Count the number of the specified objects being " _("Count the number of the specified objects being "
"currently picked in the event"), "currently picked in the event"),
_("Objects"), "",
"res/conditions/nbObjet.png") "res/conditions/nbObjet.png")
.AddParameter("objectList", _("Object")); .AddParameter("objectList", _("Object"));
obj.AddStrExpression("ObjectName", obj.AddStrExpression("ObjectName",
_("Object name"), _("Object name"),
_("Return the name of the object"), _("Return the name of the object"),
_("Objects"), "",
"res/conditions/text.png") "res/conditions/text.png")
.AddParameter("object", _("Object")); .AddParameter("object", _("Object"));
obj.AddStrExpression("Layer", obj.AddStrExpression("Layer",
_("Object layer"), _("Object layer"),
_("Return the name of the layer the object is on"), _("Return the name of the layer the object is on"),
_("Objects"), "",
"res/actions/layer.png") "res/actions/layer.png")
.AddParameter("object", _("Object")); .AddParameter("object", _("Object"));
} }

View File

@@ -15,7 +15,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
extension extension
.SetExtensionInformation( .SetExtensionInformation(
"BuiltinCamera", "BuiltinCamera",
_("Cameras and layers features"), _("Layers and cameras"),
"Each scene can be composed of multiple layers. These conditions " "Each scene can be composed of multiple layers. These conditions "
"and actions allow to manipulate them during the game. In " "and actions allow to manipulate them during the game. In "
"particular, you can move the camera of a layer to center it on an " "particular, you can move the camera of a layer to center it on an "
@@ -23,6 +23,8 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
"Florian Rival", "Florian Rival",
"Open source (MIT License)") "Open source (MIT License)")
.SetExtensionHelpPath("/interface/scene-editor/layers-and-cameras"); .SetExtensionHelpPath("/interface/scene-editor/layers-and-cameras");
extension.AddInstructionOrExpressionGroupMetadata(_("Layers and cameras"))
.SetIcon("res/conditions/camera24.png");
extension extension
.AddExpressionAndConditionAndAction( .AddExpressionAndConditionAndAction(
@@ -31,7 +33,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
_("Camera center X position"), _("Camera center X position"),
_("the X position of the center of a camera"), _("the X position of the center of a camera"),
_("the X position of camera _PARAM4_ (layer: _PARAM3_)"), _("the X position of camera _PARAM4_ (layer: _PARAM3_)"),
_("Layers and cameras"), "",
"res/conditions/camera24.png") "res/conditions/camera24.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
.UseStandardParameters("number") .UseStandardParameters("number")
@@ -53,7 +55,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
_("Camera center Y position"), _("Camera center Y position"),
_("the Y position of the center of a camera"), _("the Y position of the center of a camera"),
_("the Y position of camera _PARAM4_ (layer: _PARAM3_)"), _("the Y position of camera _PARAM4_ (layer: _PARAM3_)"),
_("Layers and cameras"), "",
"res/conditions/camera24.png") "res/conditions/camera24.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
.UseStandardParameters("number") .UseStandardParameters("number")
@@ -75,7 +77,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
_("Width of a camera"), _("Width of a camera"),
_("the width of a camera of a layer"), _("the width of a camera of a layer"),
_("the width of camera _PARAM2_ of layer _PARAM1_"), _("the width of camera _PARAM2_ of layer _PARAM1_"),
_("Layers and cameras"), "",
"res/conditions/camera24.png") "res/conditions/camera24.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer (base layer if empty)")) .AddParameter("layer", _("Layer (base layer if empty)"))
@@ -91,7 +93,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
_("Height of a camera"), _("Height of a camera"),
_("the height of a camera of a layer"), _("the height of a camera of a layer"),
_("the height of camera _PARAM2_ of layer _PARAM1_"), _("the height of camera _PARAM2_ of layer _PARAM1_"),
_("Layers and cameras"), "",
"res/conditions/camera24.png") "res/conditions/camera24.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer (base layer if empty)")) .AddParameter("layer", _("Layer (base layer if empty)"))
@@ -107,7 +109,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
_("Angle of a camera of a layer"), _("Angle of a camera of a layer"),
_("the angle of rotation of a camera"), _("the angle of rotation of a camera"),
_("the angle of camera (layer: _PARAM3_, camera: _PARAM4_)"), _("the angle of camera (layer: _PARAM3_, camera: _PARAM4_)"),
_("Layers and cameras"), "",
"res/conditions/camera24.png") "res/conditions/camera24.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
.UseStandardParameters("number") .UseStandardParameters("number")
@@ -127,7 +129,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
_("Add a camera to a layer"), _("Add a camera to a layer"),
_("This action adds a camera to a layer"), _("This action adds a camera to a layer"),
_("Add a camera to layer _PARAM1_"), _("Add a camera to layer _PARAM1_"),
_("Layers and cameras"), "",
"res/actions/camera24.png", "res/actions/camera24.png",
"res/actions/camera.png") "res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -162,7 +164,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
_("Delete a camera of a layer"), _("Delete a camera of a layer"),
_("Remove the specified camera from a layer"), _("Remove the specified camera from a layer"),
_("Delete camera _PARAM2_ from layer _PARAM1_"), _("Delete camera _PARAM2_ from layer _PARAM1_"),
_("Layers and cameras"), "",
"res/actions/camera24.png", "res/actions/camera24.png",
"res/actions/camera.png") "res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -178,7 +180,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
"layer. The zoom will be reset."), "layer. The zoom will be reset."),
_("Change the size of camera _PARAM2_ of _PARAM1_ to " _("Change the size of camera _PARAM2_ of _PARAM1_ to "
"_PARAM3_*_PARAM4_"), "_PARAM3_*_PARAM4_"),
_("Layers and cameras"), "",
"res/actions/camera24.png", "res/actions/camera24.png",
"res/actions/camera.png") "res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -196,7 +198,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
"specified layer."), "specified layer."),
_("Set the render zone of camera _PARAM2_ from layer _PARAM1_ " _("Set the render zone of camera _PARAM2_ from layer _PARAM1_ "
"to _PARAM3_;_PARAM4_ _PARAM5_;_PARAM6_"), "to _PARAM3_;_PARAM4_ _PARAM5_;_PARAM6_"),
_("Layers and cameras"), "",
"res/actions/camera24.png", "res/actions/camera24.png",
"res/actions/camera.png") "res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -223,7 +225,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
_("Change camera zoom."), _("Change camera zoom."),
_("Change camera zoom to _PARAM1_ (layer: _PARAM2_, camera: " _("Change camera zoom to _PARAM1_ (layer: _PARAM2_, camera: "
"_PARAM3_)"), "_PARAM3_)"),
_("Layers and cameras"), "",
"res/actions/camera24.png", "res/actions/camera24.png",
"res/actions/camera.png") "res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -234,6 +236,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
.AddParameter("expression", _("Camera number (default : 0)"), "", true) .AddParameter("expression", _("Camera number (default : 0)"), "", true)
.SetDefaultValue("0"); .SetDefaultValue("0");
// TODO Deprecated: hide this action in a future release.
extension extension
.AddAction( .AddAction(
"FixCamera", "FixCamera",
@@ -242,7 +245,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
"specified limits."), "specified limits."),
_("Center the camera on _PARAM1_ (limit : from _PARAM2_;_PARAM3_ to " _("Center the camera on _PARAM1_ (limit : from _PARAM2_;_PARAM3_ to "
"_PARAM4_;_PARAM5_) (layer: _PARAM7_, camera: _PARAM8_)"), "_PARAM4_;_PARAM5_) (layer: _PARAM7_, camera: _PARAM8_)"),
_("Layers and cameras"), "",
"res/actions/camera24.png", "res/actions/camera24.png",
"res/actions/camera.png") "res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -266,13 +269,38 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
.SetDefaultValue("0") .SetDefaultValue("0")
.MarkAsAdvanced(); .MarkAsAdvanced();
extension
.AddAction(
"ClampCamera",
_("Enforce camera boundaries"),
_("Enforce camera boundaries by moving the camera back inside specified boundaries."),
_("Enforce camera boundaries (left: _PARAM1_, top: _PARAM2_ "
"right: _PARAM3_, bottom: _PARAM4_, layer: _PARAM5_)"),
"",
"res/actions/camera24.png",
"res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression",
_("Left bound X Position"))
.AddParameter("expression",
_("Top bound Y Position"))
.AddParameter("expression",
_("Right bound X Position"))
.AddParameter("expression",
_("Bottom bound Y Position"))
.AddParameter("layer", _("Layer (base layer if empty)"), "", true)
.SetDefaultValue("\"\"")
.AddParameter("expression", _("Camera number (default : 0)"), "", true)
.SetDefaultValue("0")
.MarkAsAdvanced();
extension extension
.AddAction( .AddAction(
"CentreCamera", "CentreCamera",
_("Center the camera on an object"), _("Center the camera on an object"),
_("Center the camera on the specified object."), _("Center the camera on the specified object."),
_("Center camera on _PARAM1_ (layer: _PARAM3_, camera: _PARAM4_)"), _("Center camera on _PARAM1_ (layer: _PARAM3_)"),
_("Layers and cameras"), "",
"res/actions/camera24.png", "res/actions/camera24.png",
"res/actions/camera.png") "res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -293,7 +321,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
_("Show a layer"), _("Show a layer"),
_("Show a layer."), _("Show a layer."),
_("Show layer _PARAM1_"), _("Show layer _PARAM1_"),
_("Layers and cameras"), "",
"res/actions/layer24.png", "res/actions/layer24.png",
"res/actions/layer.png") "res/actions/layer.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -306,7 +334,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
_("Hide a layer"), _("Hide a layer"),
_("Hide a layer."), _("Hide a layer."),
_("Hide layer _PARAM1_"), _("Hide layer _PARAM1_"),
_("Layers and cameras"), "",
"res/actions/layer24.png", "res/actions/layer24.png",
"res/actions/layer.png") "res/actions/layer.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -319,7 +347,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
_("Visibility of a layer"), _("Visibility of a layer"),
_("Test if a layer is set as visible."), _("Test if a layer is set as visible."),
_("Layer _PARAM1_ is visible"), _("Layer _PARAM1_ is visible"),
_("Layers and cameras"), "",
"res/conditions/layer24.png", "res/conditions/layer24.png",
"res/conditions/layer.png") "res/conditions/layer.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -335,7 +363,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
_("You can find the parameter names (and change the effect " _("You can find the parameter names (and change the effect "
"names) in the effects window."), "names) in the effects window."),
_("Set _PARAM3_ to _PARAM4_ for effect _PARAM2_ of layer _PARAM1_"), _("Set _PARAM3_ to _PARAM4_ for effect _PARAM2_ of layer _PARAM1_"),
_("Layers and cameras/Effects"), _("Effects"),
"res/conditions/camera24.png", "res/conditions/camera24.png",
"res/conditions/camera.png") "res/conditions/camera.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -354,7 +382,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
_("You can find the parameter names (and change the effect " _("You can find the parameter names (and change the effect "
"names) in the effects window."), "names) in the effects window."),
_("Set _PARAM3_ to _PARAM4_ for effect _PARAM2_ of layer _PARAM1_"), _("Set _PARAM3_ to _PARAM4_ for effect _PARAM2_ of layer _PARAM1_"),
_("Layers and cameras/Effects"), _("Effects"),
"res/conditions/camera24.png", "res/conditions/camera24.png",
"res/conditions/camera.png") "res/conditions/camera.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -373,7 +401,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
_("You can find the parameter names (and change the effect " _("You can find the parameter names (and change the effect "
"names) in the effects window."), "names) in the effects window."),
_("Enable _PARAM3_ for effect _PARAM2_ of layer _PARAM1_: _PARAM4_"), _("Enable _PARAM3_ for effect _PARAM2_ of layer _PARAM1_: _PARAM4_"),
_("Layers and cameras/Effects"), _("Effects"),
"res/conditions/camera24.png", "res/conditions/camera24.png",
"res/conditions/camera.png") "res/conditions/camera.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -389,7 +417,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
_("Layer effect is enabled"), _("Layer effect is enabled"),
_("The effect on a layer is enabled"), _("The effect on a layer is enabled"),
_("Effect _PARAM2_ on layer _PARAM1_ is enabled"), _("Effect _PARAM2_ on layer _PARAM1_ is enabled"),
_("Layers and cameras/Effects"), _("Effects"),
"res/conditions/camera24.png", "res/conditions/camera24.png",
"res/conditions/camera.png") "res/conditions/camera.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -403,7 +431,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
_("Enable layer effect"), _("Enable layer effect"),
_("Enable an effect on a layer"), _("Enable an effect on a layer"),
_("Enable effect _PARAM2_ on layer _PARAM1_: _PARAM3_"), _("Enable effect _PARAM2_ on layer _PARAM1_: _PARAM3_"),
_("Layers and cameras/Effects"), _("Effects"),
"res/conditions/camera24.png", "res/conditions/camera24.png",
"res/conditions/camera.png") "res/conditions/camera.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -419,7 +447,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
_("Layer time scale"), _("Layer time scale"),
_("Compare the time scale applied to the objects of the layer."), _("Compare the time scale applied to the objects of the layer."),
_("the time scale of layer _PARAM1_"), _("the time scale of layer _PARAM1_"),
_("Layers and cameras"), "",
"res/conditions/time24.png", "res/conditions/time24.png",
"res/conditions/time.png") "res/conditions/time.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -434,7 +462,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
_("Change layer time scale"), _("Change layer time scale"),
_("Change the time scale applied to the objects of the layer."), _("Change the time scale applied to the objects of the layer."),
_("Set the time scale of layer _PARAM1_ to _PARAM2_"), _("Set the time scale of layer _PARAM1_ to _PARAM2_"),
_("Layers and cameras"), "",
"res/actions/time24.png", "res/actions/time24.png",
"res/actions/time.png") "res/actions/time.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -449,7 +477,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
_("Compare the default Z order set to objects when they " _("Compare the default Z order set to objects when they "
"are created on a layer."), "are created on a layer."),
_("the default Z order of objects created on _PARAM1_"), _("the default Z order of objects created on _PARAM1_"),
_("Layers and cameras"), "",
"res/conditions/layer24.png", "res/conditions/layer24.png",
"res/conditions/layer.png") "res/conditions/layer.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -465,7 +493,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
"created on a layer."), "created on a layer."),
_("Set the default Z order of objects created on _PARAM1_ to " _("Set the default Z order of objects created on _PARAM1_ to "
"_PARAM2_"), "_PARAM2_"),
_("Layers and cameras"), "",
"res/actions/layer24.png", "res/actions/layer24.png",
"res/actions/layer.png") "res/actions/layer.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -480,7 +508,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
_("Set the ambient light color of the lighting layer in format " _("Set the ambient light color of the lighting layer in format "
"\"R;G;B\" string."), "\"R;G;B\" string."),
_("Set the ambient color of the lighting layer _PARAM1_ to _PARAM2_"), _("Set the ambient color of the lighting layer _PARAM1_ to _PARAM2_"),
_("Layers and cameras/Lighting"), _("Lighting"),
"res/actions/color24.png", "res/actions/color24.png",
"res/actions/color.png") "res/actions/color.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -494,7 +522,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
"CameraViewportLeft", "CameraViewportLeft",
_("X position of the top left side point of a render zone"), _("X position of the top left side point of a render zone"),
_("X position of the top left side point of a render zone"), _("X position of the top left side point of a render zone"),
_("Layers and cameras"), "",
"res/actions/camera.png") "res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer")) .AddParameter("layer", _("Layer"))
@@ -506,7 +534,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
"CameraViewportTop", "CameraViewportTop",
_("Y position of the top left side point of a render zone"), _("Y position of the top left side point of a render zone"),
_("Y position of the top left side point of a render zone"), _("Y position of the top left side point of a render zone"),
_("Layers and cameras"), "",
"res/actions/camera.png") "res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer")) .AddParameter("layer", _("Layer"))
@@ -518,7 +546,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
"CameraViewportRight", "CameraViewportRight",
_("X position of the bottom right side point of a render zone"), _("X position of the bottom right side point of a render zone"),
_("X position of the bottom right side point of a render zone"), _("X position of the bottom right side point of a render zone"),
_("Layers and cameras"), "",
"res/actions/camera.png") "res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer")) .AddParameter("layer", _("Layer"))
@@ -530,7 +558,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
"CameraViewportBottom", "CameraViewportBottom",
_("Y position of the bottom right side point of a render zone"), _("Y position of the bottom right side point of a render zone"),
_("Y position of the bottom right side point of a render zone"), _("Y position of the bottom right side point of a render zone"),
_("Layers and cameras"), "",
"res/actions/camera.png") "res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer")) .AddParameter("layer", _("Layer"))
@@ -541,7 +569,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
.AddExpression("CameraZoom", .AddExpression("CameraZoom",
_("Zoom of a camera of a layer"), _("Zoom of a camera of a layer"),
_("Zoom of a camera of a layer"), _("Zoom of a camera of a layer"),
_("Layers and cameras"), "",
"res/actions/camera.png") "res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer"), "", true) .AddParameter("layer", _("Layer"), "", true)
@@ -553,7 +581,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
.AddExpression("LayerTimeScale", .AddExpression("LayerTimeScale",
_("Layer time scale"), _("Layer time scale"),
_("Returns the time scale of the specified layer."), _("Returns the time scale of the specified layer."),
_("Layers and cameras"), "",
"res/actions/time.png") "res/actions/time.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer")); .AddParameter("layer", _("Layer"));
@@ -562,7 +590,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
.AddExpression("LayerDefaultZOrder", .AddExpression("LayerDefaultZOrder",
_("Default Z Order for a layer"), _("Default Z Order for a layer"),
_("Default Z Order for a layer"), _("Default Z Order for a layer"),
_("Layers and cameras"), "",
"res/actions/camera.png") "res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer")); .AddParameter("layer", _("Layer"));

View File

@@ -15,18 +15,19 @@ BuiltinExtensionsImplementer::ImplementsCommonConversionsExtension(
extension extension
.SetExtensionInformation( .SetExtensionInformation(
"BuiltinCommonConversions", "BuiltinCommonConversions",
_("Standard Conversions"), _("Conversion"),
"Expressions to convert number, texts and quantities.", "Expressions to convert number, texts and quantities.",
"Florian Rival", "Florian Rival",
"Open source (MIT License)") "Open source (MIT License)")
.SetExtensionHelpPath("/all-features/common-conversions"); .SetExtensionHelpPath("/all-features/common-conversions");
extension.AddInstructionOrExpressionGroupMetadata(_("Conversion"))
.SetIcon("res/conditions/toujours24.png");
extension extension
.AddExpression("ToNumber", .AddExpression("ToNumber",
_("Text > Number"), _("Text > Number"),
_("Convert the text to a number"), _("Convert the text to a number"),
_("Conversion"), "",
"res/conditions/toujours24.png") "res/conditions/toujours24.png")
.AddParameter("string", _("Text to convert to a number")); .AddParameter("string", _("Text to convert to a number"));
@@ -34,7 +35,7 @@ BuiltinExtensionsImplementer::ImplementsCommonConversionsExtension(
.AddStrExpression("ToString", .AddStrExpression("ToString",
_("Number > Text"), _("Number > Text"),
_("Convert the result of the expression to text"), _("Convert the result of the expression to text"),
_("Conversion"), "",
"res/conditions/toujours24.png") "res/conditions/toujours24.png")
.AddParameter("expression", _("Expression to be converted to text")); .AddParameter("expression", _("Expression to be converted to text"));
@@ -43,7 +44,7 @@ BuiltinExtensionsImplementer::ImplementsCommonConversionsExtension(
_("Number > Text ( without scientific notation )"), _("Number > Text ( without scientific notation )"),
_("Convert the result of the expression to text, " _("Convert the result of the expression to text, "
"without using the scientific notation"), "without using the scientific notation"),
_("Conversion"), "",
"res/conditions/toujours24.png") "res/conditions/toujours24.png")
.AddParameter("expression", _("Expression to be converted to text")); .AddParameter("expression", _("Expression to be converted to text"));
@@ -52,7 +53,7 @@ BuiltinExtensionsImplementer::ImplementsCommonConversionsExtension(
"ToRad", "ToRad",
_("Degrees > Radians"), _("Degrees > Radians"),
_("Converts the angle, expressed in degrees, into radians"), _("Converts the angle, expressed in degrees, into radians"),
_("Conversion"), "",
"res/conditions/toujours24.png") "res/conditions/toujours24.png")
.AddParameter("expression", _("Angle, in degrees")); .AddParameter("expression", _("Angle, in degrees"));
@@ -61,9 +62,76 @@ BuiltinExtensionsImplementer::ImplementsCommonConversionsExtension(
"ToDeg", "ToDeg",
_("Radians > Degrees"), _("Radians > Degrees"),
_("Converts the angle, expressed in radians, into degrees"), _("Converts the angle, expressed in radians, into degrees"),
_("Conversion"), "",
"res/conditions/toujours24.png") "res/conditions/toujours24.png")
.AddParameter("expression", _("Angle, in radians")); .AddParameter("expression", _("Angle, in radians"));
extension
.AddStrExpression("ToJSON",
_("Convert scene variable to JSON"),
_("Convert a scene variable to JSON"),
_("JSON"),
"res/conditions/toujours24.png")
.AddParameter("scenevar", _("Scene variable to be stringified"));
extension
.AddStrExpression("GlobalVarToJSON",
_("Convert global variable to JSON"),
_("Convert a global variable to JSON"),
_("JSON"),
"res/conditions/toujours24.png")
.AddParameter("globalvar", _("The global variable to be stringified"));
extension
.AddStrExpression("ObjectVarToJSON",
_("Convert object variable to JSON"),
_("Convert an object variable to JSON"),
_("JSON"),
"res/conditions/toujours24.png")
.AddParameter("objectPtr", _("The object with the variable"))
.AddParameter("objectvar", _("The object variable to be stringified"));
extension
.AddAction(
"JSONToVariableStructure",
_("Convert JSON to a scene variable"),
_("Parse a JSON object and store it into a scene variable"),
_("Parse JSON string _PARAM0_ and store it into variable _PARAM1_"),
"",
"res/actions/net24.png",
"res/actions/net.png")
.AddParameter("string", _("JSON string"))
.AddParameter("scenevar", _("Variable where store the JSON object"))
.MarkAsAdvanced();
extension
.AddAction("JSONToGlobalVariableStructure",
_("Convert JSON to global variable"),
_("Parse a JSON object and store it into a global variable"),
_("Parse JSON string _PARAM0_ and store it into global "
"variable _PARAM1_"),
"",
"res/actions/net24.png",
"res/actions/net.png")
.AddParameter("string", _("JSON string"))
.AddParameter("globalvar",
_("Global variable where store the JSON object"))
.MarkAsAdvanced();
extension
.AddAction("JSONToObjectVariableStructure",
_("Convert JSON to object variable"),
_("Parse a JSON object and store it into an object variable"),
_("Parse JSON string _PARAM0_ and store it into variable "
"_PARAM2_ of _PARAM1_"),
"",
"res/actions/net24.png",
"res/actions/net.png")
.AddParameter("string", _("JSON string"))
.AddParameter("objectPtr", _("Object"))
.AddParameter("objectvar",
_("Object variable where store the JSON object"))
.MarkAsAdvanced();
} }
} // namespace gd } // namespace gd

View File

@@ -4,7 +4,6 @@
* reserved. This project is released under the MIT License. * reserved. This project is released under the MIT License.
*/ */
#include "AllBuiltinExtensions.h" #include "AllBuiltinExtensions.h"
#include "GDCore/Tools/Localization.h"
#include "GDCore/Events/Builtin/CommentEvent.h" #include "GDCore/Events/Builtin/CommentEvent.h"
#include "GDCore/Events/Builtin/ForEachChildVariableEvent.h" #include "GDCore/Events/Builtin/ForEachChildVariableEvent.h"
#include "GDCore/Events/Builtin/ForEachEvent.h" #include "GDCore/Events/Builtin/ForEachEvent.h"
@@ -14,6 +13,7 @@
#include "GDCore/Events/Builtin/StandardEvent.h" #include "GDCore/Events/Builtin/StandardEvent.h"
#include "GDCore/Events/Builtin/WhileEvent.h" #include "GDCore/Events/Builtin/WhileEvent.h"
#include "GDCore/Events/Event.h" #include "GDCore/Events/Event.h"
#include "GDCore/Tools/Localization.h"
using namespace std; using namespace std;
namespace gd { namespace gd {
@@ -24,19 +24,43 @@ BuiltinExtensionsImplementer::ImplementsCommonInstructionsExtension(
extension extension
.SetExtensionInformation( .SetExtensionInformation(
"BuiltinCommonInstructions", "BuiltinCommonInstructions",
_("Builtin events"), _("Events and control flow"),
"GDevelop comes with a set of events and conditions that allow to " "GDevelop comes with a set of events and conditions that allow to "
"express the game logic and rules.", "express the game logic and rules.",
"Florian Rival", "Florian Rival",
"Open source (MIT License)") "Open source (MIT License)")
.SetCategory("Advanced")
.SetExtensionHelpPath("/all-features/advanced-conditions"); .SetExtensionHelpPath("/all-features/advanced-conditions");
extension
.AddInstructionOrExpressionGroupMetadata(_("Events and control flow"))
.SetIcon("res/conditions/toujours24.png");
extension
.AddCondition("Always",
_("Always"),
_("This condition always returns true (or always false, if "
"the condition is inverted)."),
_("Always"),
"",
"res/conditions/toujours24.png",
"res/conditions/toujours.png")
.SetHelpPath("/all-features/advanced-conditions")
.AddCodeOnlyParameter("conditionInverted", "")
.MarkAsAdvanced();
// Compatibility with GD <= 5.0.127
extension
.AddDuplicatedCondition(
"Toujours", "BuiltinCommonInstructions::Always", {.unscoped = true})
.SetHidden();
// end of compatibility code
extension extension
.AddCondition("Or", .AddCondition("Or",
_("Or"), _("Or"),
_("Check if one of the sub conditions is true"), _("Check if one of the sub conditions is true"),
_("If one of these conditions is true:"), _("If one of these conditions is true:"),
_("Advanced"), "",
"res/conditions/or24.png", "res/conditions/or24.png",
"res/conditions/or.png") "res/conditions/or.png")
.SetCanHaveSubInstructions() .SetCanHaveSubInstructions()
@@ -47,7 +71,7 @@ BuiltinExtensionsImplementer::ImplementsCommonInstructionsExtension(
_("And"), _("And"),
_("Check if all sub conditions are true"), _("Check if all sub conditions are true"),
_("If all of these conditions are true:"), _("If all of these conditions are true:"),
_("Advanced"), "",
"res/conditions/and24.png", "res/conditions/and24.png",
"res/conditions/and.png") "res/conditions/and.png")
.SetCanHaveSubInstructions() .SetCanHaveSubInstructions()
@@ -59,7 +83,7 @@ BuiltinExtensionsImplementer::ImplementsCommonInstructionsExtension(
_("Not"), _("Not"),
_("Return the contrary of the result of the sub conditions"), _("Return the contrary of the result of the sub conditions"),
_("Invert the logical result of these conditions:"), _("Invert the logical result of these conditions:"),
_("Advanced"), "",
"res/conditions/not24.png", "res/conditions/not24.png",
"res/conditions/not.png") "res/conditions/not.png")
.SetCanHaveSubInstructions() .SetCanHaveSubInstructions()
@@ -70,10 +94,52 @@ BuiltinExtensionsImplementer::ImplementsCommonInstructionsExtension(
_("Trigger once while true"), _("Trigger once while true"),
_("Run actions only once, for each time the conditions have been met."), _("Run actions only once, for each time the conditions have been met."),
_("Trigger once"), _("Trigger once"),
_("Advanced"), "",
"res/conditions/once24.png", "res/conditions/once24.png",
"res/conditions/once.png"); "res/conditions/once.png");
extension
.AddCondition("CompareNumbers",
_("Compare two numbers"),
_("Compare the two numbers."),
_("_PARAM0_ _PARAM1_ _PARAM2_"),
"",
"res/conditions/egal24.png",
"res/conditions/egal.png")
.SetHelpPath("/all-features/advanced-conditions")
.AddParameter("expression", _("First expression"))
.AddParameter("relationalOperator", _("Sign of the test"), "number")
.AddParameter("expression", _("Second expression"))
.MarkAsAdvanced();
// Compatibility with GD <= 5.0.127
extension
.AddDuplicatedCondition(
"Egal", "BuiltinCommonInstructions::CompareNumbers", {.unscoped = true})
.SetHidden();
// end of compatibility code
extension
.AddCondition("CompareStrings",
_("Compare two strings"),
_("Compare the two strings."),
_("_PARAM0_ _PARAM1_ _PARAM2_"),
"",
"res/conditions/egal24.png",
"res/conditions/egal.png")
.SetHelpPath("/all-features/advanced-conditions")
.AddParameter("string", _("First string expression"))
.AddParameter("relationalOperator", _("Sign of the test"), "string")
.AddParameter("string", _("Second string expression"))
.MarkAsAdvanced();
// Compatibility with GD <= 5.0.127
extension
.AddDuplicatedCondition(
"StrEqual", "BuiltinCommonInstructions::CompareStrings", {.unscoped = true})
.SetHidden();
// end of compatibility code
extension.AddEvent( extension.AddEvent(
"Standard", "Standard",
_("Standard event"), _("Standard event"),

View File

@@ -19,18 +19,21 @@ BuiltinExtensionsImplementer::ImplementsExternalLayoutsExtension(
"external layouts.", "external layouts.",
"Florian Rival", "Florian Rival",
"Open source (MIT License)") "Open source (MIT License)")
.SetExtensionHelpPath("/interface/scene-editor/external-layouts"); .SetExtensionHelpPath("/interface/scene-editor/external-layouts")
.SetCategory("Advanced");
extension.AddInstructionOrExpressionGroupMetadata(_("External layouts"))
.SetIcon("res/ribbon_default/externallayout32.png");
extension extension
.AddAction("CreateObjectsFromExternalLayout", .AddAction("CreateObjectsFromExternalLayout",
_("Create objects from an external layout"), _("Create objects from an external layout"),
_("Create objects from an external layout."), _("Create objects from an external layout."),
_("Create objects from the external layout named _PARAM1_"), _("Create objects from the external layout named _PARAM1_"),
_("External layouts"), "",
"res/conditions/fichier24.png", "res/ribbon_default/externallayout32.png",
"res/conditions/fichier.png") "res/ribbon_default/externallayout32.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
.AddParameter("string", _("Name of the external layout")) .AddParameter("externalLayoutName", _("Name of the external layout"))
.AddParameter("expression", _("X position of the origin"), "", true) .AddParameter("expression", _("X position of the origin"), "", true)
.SetDefaultValue("0") .SetDefaultValue("0")
.AddParameter("expression", _("Y position of the origin"), "", true) .AddParameter("expression", _("Y position of the origin"), "", true)

View File

@@ -20,7 +20,10 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsFileExtension(
"stored on the device and erased when the game is uninstalled.", "stored on the device and erased when the game is uninstalled.",
"Florian Rival", "Florian Rival",
"Open source (MIT License)") "Open source (MIT License)")
.SetExtensionHelpPath("/all-features/storage"); .SetExtensionHelpPath("/all-features/storage")
.SetCategory("Device");
extension.AddInstructionOrExpressionGroupMetadata(_("Storage"))
.SetIcon("res/conditions/fichier24.png");
extension extension
.AddCondition( .AddCondition(
@@ -29,7 +32,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsFileExtension(
_("Check if an element (example : PlayerState/CurrentLevel) exists " _("Check if an element (example : PlayerState/CurrentLevel) exists "
"in the stored data.\nSpaces are forbidden in element names."), "in the stored data.\nSpaces are forbidden in element names."),
_("_PARAM1_ exists in storage _PARAM0_"), _("_PARAM1_ exists in storage _PARAM0_"),
_("Storage"), "",
"res/conditions/fichier24.png", "res/conditions/fichier24.png",
"res/conditions/fichier.png") "res/conditions/fichier.png")
.AddParameter("string", _("Storage name")) .AddParameter("string", _("Storage name"))
@@ -45,7 +48,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsFileExtension(
"action, but it will be slower.\nIf you use this action, do not " "action, but it will be slower.\nIf you use this action, do not "
"forget to unload the storage from memory."), "forget to unload the storage from memory."),
_("Load storage _PARAM0_ in memory"), _("Load storage _PARAM0_ in memory"),
_("Storage"), "",
"res/actions/fichier24.png", "res/actions/fichier24.png",
"res/actions/fichier.png") "res/actions/fichier.png")
.AddParameter("string", _("Storage name")) .AddParameter("string", _("Storage name"))
@@ -57,7 +60,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsFileExtension(
_("This action closes the structured data previously loaded " _("This action closes the structured data previously loaded "
"in memory, saving all changes made."), "in memory, saving all changes made."),
_("Close structured data _PARAM0_"), _("Close structured data _PARAM0_"),
_("Storage"), "",
"res/actions/fichier24.png", "res/actions/fichier24.png",
"res/actions/fichier.png") "res/actions/fichier.png")
.AddParameter("string", _("Storage name")) .AddParameter("string", _("Storage name"))
@@ -72,7 +75,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsFileExtension(
"element using / (example : Root/Level/Current)\nSpaces are " "element using / (example : Root/Level/Current)\nSpaces are "
"forbidden in element names."), "forbidden in element names."),
_("Write _PARAM2_ in _PARAM1_ of storage _PARAM0_"), _("Write _PARAM2_ in _PARAM1_ of storage _PARAM0_"),
_("Storage"), "",
"res/actions/fichier24.png", "res/actions/fichier24.png",
"res/actions/fichier.png") "res/actions/fichier.png")
.AddParameter("string", _("Storage name")) .AddParameter("string", _("Storage name"))
@@ -88,7 +91,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsFileExtension(
"the structure leading to the element using / (example : " "the structure leading to the element using / (example : "
"Root/Level/Current)\nSpaces are forbidden in element names."), "Root/Level/Current)\nSpaces are forbidden in element names."),
_("Write _PARAM2_ in _PARAM1_ of storage _PARAM0_"), _("Write _PARAM2_ in _PARAM1_ of storage _PARAM0_"),
_("Storage"), "",
"res/actions/fichier24.png", "res/actions/fichier24.png",
"res/actions/fichier.png") "res/actions/fichier.png")
.AddParameter("string", _("Storage name")) .AddParameter("string", _("Storage name"))
@@ -105,7 +108,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsFileExtension(
"(example : Root/Level/Current)\nSpaces are forbidden in element " "(example : Root/Level/Current)\nSpaces are forbidden in element "
"names."), "names."),
_("Read _PARAM1_ from storage _PARAM0_ and store value in _PARAM3_"), _("Read _PARAM1_ from storage _PARAM0_ and store value in _PARAM3_"),
_("Storage"), "",
"res/actions/fichier24.png", "res/actions/fichier24.png",
"res/actions/fichier.png") "res/actions/fichier.png")
.AddParameter("string", _("Storage name")) .AddParameter("string", _("Storage name"))
@@ -124,7 +127,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsFileExtension(
"names."), "names."),
_("Read _PARAM1_ from storage _PARAM0_ and store as text in " _("Read _PARAM1_ from storage _PARAM0_ and store as text in "
"_PARAM3_"), "_PARAM3_"),
_("Storage"), "",
"res/actions/fichier24.png", "res/actions/fichier24.png",
"res/actions/fichier.png") "res/actions/fichier.png")
.AddParameter("string", _("Storage name")) .AddParameter("string", _("Storage name"))
@@ -140,7 +143,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsFileExtension(
"element using / (example : Root/Level/Current)\nSpaces are " "element using / (example : Root/Level/Current)\nSpaces are "
"forbidden in element names."), "forbidden in element names."),
_("Delete _PARAM1_ from storage _PARAM0_"), _("Delete _PARAM1_ from storage _PARAM0_"),
_("Storage"), "",
"res/actions/delete24.png", "res/actions/delete24.png",
"res/actions/delete.png") "res/actions/delete.png")
.AddParameter("string", _("Storage name")) .AddParameter("string", _("Storage name"))
@@ -153,7 +156,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsFileExtension(
_("Clear a storage"), _("Clear a storage"),
_("Clear the specified storage, removing all data saved in it."), _("Clear the specified storage, removing all data saved in it."),
_("Delete storage _PARAM0_"), _("Delete storage _PARAM0_"),
_("Storage"), "",
"res/actions/delete24.png", "res/actions/delete24.png",
"res/actions/delete.png") "res/actions/delete.png")
.AddParameter("string", _("Storage name")); .AddParameter("string", _("Storage name"));
@@ -163,32 +166,18 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsFileExtension(
_("A storage exists"), _("A storage exists"),
_("Test if the specified storage exists."), _("Test if the specified storage exists."),
_("Storage _PARAM0_ exists"), _("Storage _PARAM0_ exists"),
_("Storage"), "",
"res/conditions/fichier24.png", "res/conditions/fichier24.png",
"res/conditions/fichier.png") "res/conditions/fichier.png")
.AddParameter("string", _("Storage name")) .AddParameter("string", _("Storage name"))
.MarkAsAdvanced(); .MarkAsAdvanced();
extension
.AddAction("LaunchFile",
_("Open a URL or a file"),
_("This action launches the specified file or URL, in a "
"browser (or in a new tab if the game is using the Web "
"platform and is launched inside a browser)."),
_("Open URL (or file) _PARAM0_"),
_("Files"),
"res/actions/launchFile24.png",
"res/actions/launchFile.png")
.AddParameter("string", _("URL (or filename)"))
.AddCodeOnlyParameter("currentScene", "")
.MarkAsAdvanced();
extension extension
.AddAction("ExecuteCmd", .AddAction("ExecuteCmd",
_("Execute a command"), _("Execute a command"),
_("This action executes the specified command."), _("This action executes the specified command."),
_("Execute _PARAM0_"), _("Execute _PARAM0_"),
_("Files"), _("Network"),
"res/actions/launchFile24.png", "res/actions/launchFile24.png",
"res/actions/launchFile.png") "res/actions/launchFile.png")
.AddParameter("string", _("Command")) .AddParameter("string", _("Command"))

View File

@@ -14,21 +14,24 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsKeyboardExtension(
extension extension
.SetExtensionInformation( .SetExtensionInformation(
"BuiltinKeyboard", "BuiltinKeyboard",
_("Keyboard features"), _("Keyboard"),
_("Allows your game to respond to keyboard input. Note that this " _("Allows your game to respond to keyboard input. Note that this "
"does not work with on-screen keyboard on touch devices: use " "does not work with on-screen keyboard on touch devices: use "
"instead conditions related to touch when making a game for " "instead conditions related to touch when making a game for "
"mobile/touchscreen devices."), "mobile/touchscreen devices."),
"Florian Rival", "Florian Rival",
"Open source (MIT License)") "Open source (MIT License)")
.SetExtensionHelpPath("/all-features/keyboard"); .SetExtensionHelpPath("/all-features/keyboard")
.SetCategory("Input");
extension.AddInstructionOrExpressionGroupMetadata(_("Keyboard"))
.SetIcon("res/conditions/keyboard24.png");
extension extension
.AddCondition("KeyPressed", .AddCondition("KeyPressed",
_("Key pressed"), _("Key pressed"),
_("Check if a key is pressed"), _("Check if a key is pressed"),
_("_PARAM1_ key is pressed"), _("_PARAM1_ key is pressed"),
_("Keyboard"), "",
"res/conditions/keyboard24.png", "res/conditions/keyboard24.png",
"res/conditions/keyboard.png") "res/conditions/keyboard.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -39,7 +42,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsKeyboardExtension(
_("Key released"), _("Key released"),
_("Check if a key was just released"), _("Check if a key was just released"),
_("_PARAM1_ key is released"), _("_PARAM1_ key is released"),
_("Keyboard"), "",
"res/conditions/keyboard24.png", "res/conditions/keyboard24.png",
"res/conditions/keyboard.png") "res/conditions/keyboard.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -51,7 +54,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsKeyboardExtension(
_("Check if a key, retrieved from the result of the " _("Check if a key, retrieved from the result of the "
"expression, is pressed"), "expression, is pressed"),
_("_PARAM1_ key is pressed"), _("_PARAM1_ key is pressed"),
_("Keyboard"), "",
"res/conditions/keyboard24.png", "res/conditions/keyboard24.png",
"res/conditions/keyboard.png") "res/conditions/keyboard.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -64,7 +67,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsKeyboardExtension(
_("Check if a key, retrieved from the result of the " _("Check if a key, retrieved from the result of the "
"expression, was just released"), "expression, was just released"),
_("_PARAM1_ key is released"), _("_PARAM1_ key is released"),
_("Keyboard"), "",
"res/conditions/keyboard24.png", "res/conditions/keyboard24.png",
"res/conditions/keyboard.png") "res/conditions/keyboard.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -76,7 +79,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsKeyboardExtension(
_("Any key pressed"), _("Any key pressed"),
_("Check if any key is pressed"), _("Check if any key is pressed"),
_("Any key is pressed"), _("Any key is pressed"),
_("Keyboard"), "",
"res/conditions/keyboard24.png", "res/conditions/keyboard24.png",
"res/conditions/keyboard.png") "res/conditions/keyboard.png")
.AddCodeOnlyParameter("currentScene", ""); .AddCodeOnlyParameter("currentScene", "");
@@ -86,7 +89,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsKeyboardExtension(
_("Any key released"), _("Any key released"),
_("Check if any key is released"), _("Check if any key is released"),
_("Any key is released"), _("Any key is released"),
_("Keyboard"), "",
"res/conditions/keyboard24.png", "res/conditions/keyboard24.png",
"res/conditions/keyboard.png") "res/conditions/keyboard.png")
.AddCodeOnlyParameter("currentScene", ""); .AddCodeOnlyParameter("currentScene", "");
@@ -96,7 +99,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsKeyboardExtension(
"LastPressedKey", "LastPressedKey",
_("Last pressed key"), _("Last pressed key"),
_("Get the name of the latest key pressed on the keyboard"), _("Get the name of the latest key pressed on the keyboard"),
_("Keyboard"), "",
"res/conditions/keyboard.png") "res/conditions/keyboard.png")
.AddCodeOnlyParameter("currentScene", ""); .AddCodeOnlyParameter("currentScene", "");
} }

View File

@@ -18,13 +18,63 @@ BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
"A set of mathematical functions that can be used in expressions.", "A set of mathematical functions that can be used in expressions.",
"Florian Rival", "Florian Rival",
"Open source (MIT License)"); "Open source (MIT License)");
extension.AddInstructionOrExpressionGroupMetadata(_("Mathematical tools"))
.SetIcon("res/mathfunction.png");
extension
.AddExpression("Random",
_("Random integer"),
_("Random integer"),
"",
"res/dice-6.svg")
.SetHelpPath("/all-features/expressions")
.AddParameter("expression", _("Maximum value"));
extension
.AddExpression("RandomInRange",
_("Random integer in range"),
_("Random integer in range"),
"",
"res/dice-6.svg")
.SetHelpPath("/all-features/expressions")
.AddParameter("expression", _("Minimum value"))
.AddParameter("expression", _("Maximum value"));
extension
.AddExpression("RandomFloat",
_("Random float"),
_("Random float"),
"",
"res/dice-6.svg")
.SetHelpPath("/all-features/expressions")
.AddParameter("expression", _("Maximum value"));
extension
.AddExpression("RandomFloatInRange",
_("Random float in range"),
_("Random float in range"),
"",
"res/dice-6.svg")
.SetHelpPath("/all-features/expressions")
.AddParameter("expression", _("Minimum value"))
.AddParameter("expression", _("Maximum value"));
extension
.AddExpression("RandomWithStep",
_("Random value in steps"),
_("Random value in steps"),
"",
"res/dice-6.svg")
.SetHelpPath("/all-features/expressions")
.AddParameter("expression", _("Minimum value"))
.AddParameter("expression", _("Maximum value"))
.AddParameter("expression", _("Step"));
extension extension
.AddExpression("normalize", .AddExpression("normalize",
_("Normalize a value between `min` and `max` to a value between 0 and 1."), _("Normalize a value between `min` and `max` to a value between 0 and 1."),
_("Remap a value between 0 and 1."), _("Remap a value between 0 and 1."),
_("Mathematical tools"), "",
"res/mathfunction.png") "res/mathfunction.png")
.AddParameter("expression", _("Value")) .AddParameter("expression", _("Value"))
.AddParameter("expression", _("Min")) .AddParameter("expression", _("Min"))
@@ -34,7 +84,7 @@ BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
.AddExpression("clamp", .AddExpression("clamp",
_("Clamp (restrict a value to a given range)"), _("Clamp (restrict a value to a given range)"),
_("Restrict a value to a given range"), _("Restrict a value to a given range"),
_("Mathematical tools"), "",
"res/mathfunction.png") "res/mathfunction.png")
.AddParameter("expression", _("Value")) .AddParameter("expression", _("Value"))
.AddParameter("expression", _("Min")) .AddParameter("expression", _("Min"))
@@ -44,7 +94,7 @@ BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
.AddExpression("AngleDifference", .AddExpression("AngleDifference",
_("Difference between two angles"), _("Difference between two angles"),
_("Difference between two angles"), _("Difference between two angles"),
_("Mathematical tools"), "",
"res/mathfunction.png") "res/mathfunction.png")
.AddParameter("expression", _("First angle")) .AddParameter("expression", _("First angle"))
.AddParameter("expression", _("Second angle")); .AddParameter("expression", _("Second angle"));
@@ -53,7 +103,7 @@ BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
.AddExpression("AngleBetweenPositions", .AddExpression("AngleBetweenPositions",
_("Angle between two positions"), _("Angle between two positions"),
_("Compute the angle between two positions."), _("Compute the angle between two positions."),
_("Mathematical tools"), "",
"res/mathfunction.png") "res/mathfunction.png")
.AddParameter("expression", _("First point X position")) .AddParameter("expression", _("First point X position"))
.AddParameter("expression", _("First point Y position")) .AddParameter("expression", _("First point Y position"))
@@ -64,7 +114,7 @@ BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
.AddExpression("DistanceBetweenPositions", .AddExpression("DistanceBetweenPositions",
_("Distance between two positions"), _("Distance between two positions"),
_("Compute the distance between two positions."), _("Compute the distance between two positions."),
_("Mathematical tools"), "",
"res/mathfunction.png") "res/mathfunction.png")
.AddParameter("expression", _("First point X position")) .AddParameter("expression", _("First point X position"))
.AddParameter("expression", _("First point Y position")) .AddParameter("expression", _("First point Y position"))
@@ -75,7 +125,7 @@ BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
.AddExpression("mod", .AddExpression("mod",
_("Modulo"), _("Modulo"),
_("x mod y"), _("x mod y"),
_("Mathematical tools"), "",
"res/mathfunction.png") "res/mathfunction.png")
.AddParameter("expression", _("x (as in x mod y)")) .AddParameter("expression", _("x (as in x mod y)"))
.AddParameter("expression", _("y (as in x mod y)")); .AddParameter("expression", _("y (as in x mod y)"));
@@ -84,7 +134,7 @@ BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
.AddExpression("min", .AddExpression("min",
_("Minimum of two numbers"), _("Minimum of two numbers"),
_("Minimum of two numbers"), _("Minimum of two numbers"),
_("Mathematical tools"), "",
"res/mathfunction.png") "res/mathfunction.png")
.AddParameter("expression", _("First expression")) .AddParameter("expression", _("First expression"))
.AddParameter("expression", _("Second expression")); .AddParameter("expression", _("Second expression"));
@@ -93,7 +143,7 @@ BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
.AddExpression("max", .AddExpression("max",
_("Maximum of two numbers"), _("Maximum of two numbers"),
_("Maximum of two numbers"), _("Maximum of two numbers"),
_("Mathematical tools"), "",
"res/mathfunction.png") "res/mathfunction.png")
.AddParameter("expression", _("First expression")) .AddParameter("expression", _("First expression"))
.AddParameter("expression", _("Second expression")); .AddParameter("expression", _("Second expression"));
@@ -102,7 +152,7 @@ BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
.AddExpression("abs", .AddExpression("abs",
_("Absolute value"), _("Absolute value"),
_("Absolute value"), _("Absolute value"),
_("Mathematical tools"), "",
"res/mathfunction.png") "res/mathfunction.png")
.AddParameter("expression", _("Expression")); .AddParameter("expression", _("Expression"));
@@ -110,7 +160,7 @@ BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
.AddExpression("acos", .AddExpression("acos",
_("Arccosine"), _("Arccosine"),
_("Arccosine"), _("Arccosine"),
_("Mathematical tools"), "",
"res/mathfunction.png") "res/mathfunction.png")
.AddParameter("expression", _("Expression")); .AddParameter("expression", _("Expression"));
@@ -118,7 +168,7 @@ BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
.AddExpression("acosh", .AddExpression("acosh",
_("Hyperbolic arccosine"), _("Hyperbolic arccosine"),
_("Hyperbolic arccosine"), _("Hyperbolic arccosine"),
_("Mathematical tools"), "",
"res/mathfunction.png") "res/mathfunction.png")
.AddParameter("expression", _("Expression")); .AddParameter("expression", _("Expression"));
@@ -126,7 +176,7 @@ BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
.AddExpression("asin", .AddExpression("asin",
_("Arcsine"), _("Arcsine"),
_("Arcsine"), _("Arcsine"),
_("Mathematical tools"), "",
"res/mathfunction.png") "res/mathfunction.png")
.AddParameter("expression", _("Expression")); .AddParameter("expression", _("Expression"));
@@ -134,7 +184,7 @@ BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
.AddExpression("asinh", .AddExpression("asinh",
_("Arcsine"), _("Arcsine"),
_("Arcsine"), _("Arcsine"),
_("Mathematical tools"), "",
"res/mathfunction.png") "res/mathfunction.png")
.AddParameter("expression", _("Expression")); .AddParameter("expression", _("Expression"));
@@ -142,7 +192,7 @@ BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
.AddExpression("atan", .AddExpression("atan",
_("Arctangent"), _("Arctangent"),
_("Arctangent"), _("Arctangent"),
_("Mathematical tools"), "",
"res/mathfunction.png") "res/mathfunction.png")
.AddParameter("expression", _("Expression")); .AddParameter("expression", _("Expression"));
@@ -150,7 +200,7 @@ BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
.AddExpression("atan2", .AddExpression("atan2",
_("2 argument arctangent"), _("2 argument arctangent"),
_("2 argument arctangent (atan2)"), _("2 argument arctangent (atan2)"),
_("Mathematical tools"), "",
"res/mathfunction.png") "res/mathfunction.png")
.AddParameter("expression", _("Y")) .AddParameter("expression", _("Y"))
.AddParameter("expression", _("X")); .AddParameter("expression", _("X"));
@@ -159,7 +209,7 @@ BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
.AddExpression("atanh", .AddExpression("atanh",
_("Hyperbolic arctangent"), _("Hyperbolic arctangent"),
_("Hyperbolic arctangent"), _("Hyperbolic arctangent"),
_("Mathematical tools"), "",
"res/mathfunction.png") "res/mathfunction.png")
.AddParameter("expression", _("Expression")); .AddParameter("expression", _("Expression"));
@@ -167,7 +217,7 @@ BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
.AddExpression("cbrt", .AddExpression("cbrt",
_("Cube root"), _("Cube root"),
_("Cube root"), _("Cube root"),
_("Mathematical tools"), "",
"res/mathfunction.png") "res/mathfunction.png")
.AddParameter("expression", _("Expression")); .AddParameter("expression", _("Expression"));
@@ -175,7 +225,7 @@ BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
.AddExpression("ceil", .AddExpression("ceil",
_("Ceil (round up)"), _("Ceil (round up)"),
_("Round number up to an integer"), _("Round number up to an integer"),
_("Mathematical tools"), "",
"res/mathfunction.png") "res/mathfunction.png")
.AddParameter("expression", _("Expression")); .AddParameter("expression", _("Expression"));
@@ -183,7 +233,7 @@ BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
.AddExpression("floor", .AddExpression("floor",
_("Floor (round down)"), _("Floor (round down)"),
_("Round number down to an integer"), _("Round number down to an integer"),
_("Mathematical tools"), "",
"res/mathfunction.png") "res/mathfunction.png")
.AddParameter("expression", _("Expression")); .AddParameter("expression", _("Expression"));
@@ -191,7 +241,7 @@ BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
.AddExpression("cos", .AddExpression("cos",
_("Cosine"), _("Cosine"),
_("Cosine of a number"), _("Cosine of a number"),
_("Mathematical tools"), "",
"res/mathfunction.png") "res/mathfunction.png")
.AddParameter("expression", _("Expression")); .AddParameter("expression", _("Expression"));
@@ -199,7 +249,7 @@ BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
.AddExpression("cosh", .AddExpression("cosh",
_("Hyperbolic cosine"), _("Hyperbolic cosine"),
_("Hyperbolic cosine"), _("Hyperbolic cosine"),
_("Mathematical tools"), "",
"res/mathfunction.png") "res/mathfunction.png")
.AddParameter("expression", _("Expression")); .AddParameter("expression", _("Expression"));
@@ -207,7 +257,7 @@ BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
.AddExpression("cot", .AddExpression("cot",
_("Cotangent"), _("Cotangent"),
_("Cotangent of a number"), _("Cotangent of a number"),
_("Mathematical tools"), "",
"res/mathfunction.png") "res/mathfunction.png")
.AddParameter("expression", _("Expression")); .AddParameter("expression", _("Expression"));
@@ -215,7 +265,7 @@ BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
.AddExpression("csc", .AddExpression("csc",
_("Cosecant"), _("Cosecant"),
_("Cosecant of a number"), _("Cosecant of a number"),
_("Mathematical tools"), "",
"res/mathfunction.png") "res/mathfunction.png")
.AddParameter("expression", _("Expression")); .AddParameter("expression", _("Expression"));
@@ -223,7 +273,7 @@ BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
.AddExpression("int", .AddExpression("int",
_("Round"), _("Round"),
_("Round a number"), _("Round a number"),
_("Mathematical tools"), "",
"res/mathfunction.png") "res/mathfunction.png")
.SetHidden() .SetHidden()
.AddParameter("expression", _("Expression")); .AddParameter("expression", _("Expression"));
@@ -232,7 +282,7 @@ BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
.AddExpression("rint", .AddExpression("rint",
_("Round"), _("Round"),
_("Round a number"), _("Round a number"),
_("Mathematical tools"), "",
"res/mathfunction.png") "res/mathfunction.png")
.SetHidden() .SetHidden()
.AddParameter("expression", _("Expression")); .AddParameter("expression", _("Expression"));
@@ -241,7 +291,7 @@ BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
.AddExpression("round", .AddExpression("round",
_("Round"), _("Round"),
_("Round a number"), _("Round a number"),
_("Mathematical tools"), "",
"res/mathfunction.png") "res/mathfunction.png")
.AddParameter("expression", _("Expression")); .AddParameter("expression", _("Expression"));
@@ -249,7 +299,7 @@ BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
.AddExpression("exp", .AddExpression("exp",
_("Exponential"), _("Exponential"),
_("Exponential of a number"), _("Exponential of a number"),
_("Mathematical tools"), "",
"res/mathfunction.png") "res/mathfunction.png")
.AddParameter("expression", _("Expression")); .AddParameter("expression", _("Expression"));
@@ -257,7 +307,7 @@ BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
.AddExpression("log", .AddExpression("log",
_("Logarithm"), _("Logarithm"),
_("Logarithm"), _("Logarithm"),
_("Mathematical tools"), "",
"res/mathfunction.png") "res/mathfunction.png")
.AddParameter("expression", _("Expression")); .AddParameter("expression", _("Expression"));
@@ -265,7 +315,7 @@ BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
.AddExpression("ln", .AddExpression("ln",
_("Logarithm"), _("Logarithm"),
_("Logarithm"), _("Logarithm"),
_("Mathematical tools"), "",
"res/mathfunction.png") "res/mathfunction.png")
.SetHidden() .SetHidden()
.AddParameter("expression", _("Expression")); .AddParameter("expression", _("Expression"));
@@ -274,7 +324,7 @@ BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
.AddExpression("log2", .AddExpression("log2",
_("Base-2 logarithm"), _("Base-2 logarithm"),
_("Base 2 Logarithm"), _("Base 2 Logarithm"),
_("Mathematical tools"), "",
"res/mathfunction.png") "res/mathfunction.png")
.AddParameter("expression", _("Expression")); .AddParameter("expression", _("Expression"));
@@ -282,7 +332,7 @@ BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
.AddExpression("log10", .AddExpression("log10",
_("Base-10 logarithm"), _("Base-10 logarithm"),
_("Base-10 logarithm"), _("Base-10 logarithm"),
_("Mathematical tools"), "",
"res/mathfunction.png") "res/mathfunction.png")
.AddParameter("expression", _("Expression")); .AddParameter("expression", _("Expression"));
@@ -290,7 +340,7 @@ BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
.AddExpression("nthroot", .AddExpression("nthroot",
_("Nth root"), _("Nth root"),
_("Nth root of a number"), _("Nth root of a number"),
_("Mathematical tools"), "",
"res/mathfunction.png") "res/mathfunction.png")
.AddParameter("expression", _("Number")) .AddParameter("expression", _("Number"))
.AddParameter("expression", _("N")); .AddParameter("expression", _("N"));
@@ -299,7 +349,7 @@ BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
.AddExpression("pow", .AddExpression("pow",
_("Power"), _("Power"),
_("Raise a number to power n"), _("Raise a number to power n"),
_("Mathematical tools"), "",
"res/mathfunction.png") "res/mathfunction.png")
.AddParameter("expression", _("Number")) .AddParameter("expression", _("Number"))
.AddParameter("expression", _("The exponent (n in x^n)")); .AddParameter("expression", _("The exponent (n in x^n)"));
@@ -308,7 +358,7 @@ BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
.AddExpression("sec", .AddExpression("sec",
_("Secant"), _("Secant"),
_("Secant"), _("Secant"),
_("Mathematical tools"), "",
"res/mathfunction.png") "res/mathfunction.png")
.AddParameter("expression", _("Expression")); .AddParameter("expression", _("Expression"));
@@ -316,7 +366,7 @@ BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
.AddExpression("sign", .AddExpression("sign",
_("Sign of a number"), _("Sign of a number"),
_("Return the sign of a number (1,-1 or 0)"), _("Return the sign of a number (1,-1 or 0)"),
_("Mathematical tools"), "",
"res/mathfunction.png") "res/mathfunction.png")
.AddParameter("expression", _("Expression")); .AddParameter("expression", _("Expression"));
@@ -324,7 +374,7 @@ BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
.AddExpression("sin", .AddExpression("sin",
_("Sine"), _("Sine"),
_("Sine of a number"), _("Sine of a number"),
_("Mathematical tools"), "",
"res/mathfunction.png") "res/mathfunction.png")
.AddParameter("expression", _("Expression")); .AddParameter("expression", _("Expression"));
@@ -332,7 +382,7 @@ BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
.AddExpression("sinh", .AddExpression("sinh",
_("Hyperbolic sine"), _("Hyperbolic sine"),
_("Hyperbolic sine"), _("Hyperbolic sine"),
_("Mathematical tools"), "",
"res/mathfunction.png") "res/mathfunction.png")
.AddParameter("expression", _("Expression")); .AddParameter("expression", _("Expression"));
@@ -340,7 +390,7 @@ BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
.AddExpression("sqrt", .AddExpression("sqrt",
_("Square root"), _("Square root"),
_("Square root of a number"), _("Square root of a number"),
_("Mathematical tools"), "",
"res/mathfunction.png") "res/mathfunction.png")
.AddParameter("expression", _("Expression")); .AddParameter("expression", _("Expression"));
@@ -348,7 +398,7 @@ BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
.AddExpression("tan", .AddExpression("tan",
_("Tangent"), _("Tangent"),
_("Tangent of a number"), _("Tangent of a number"),
_("Mathematical tools"), "",
"res/mathfunction.png") "res/mathfunction.png")
.AddParameter("expression", _("Expression")); .AddParameter("expression", _("Expression"));
@@ -356,7 +406,7 @@ BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
.AddExpression("tanh", .AddExpression("tanh",
_("Hyperbolic tangent"), _("Hyperbolic tangent"),
_("Hyperbolic tangent"), _("Hyperbolic tangent"),
_("Mathematical tools"), "",
"res/mathfunction.png") "res/mathfunction.png")
.AddParameter("expression", _("Expression")); .AddParameter("expression", _("Expression"));
@@ -364,7 +414,7 @@ BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
.AddExpression("trunc", .AddExpression("trunc",
_("Truncation"), _("Truncation"),
_("Truncate a number"), _("Truncate a number"),
_("Mathematical tools"), "",
"res/mathfunction.png") "res/mathfunction.png")
.AddParameter("expression", _("Expression")); .AddParameter("expression", _("Expression"));
@@ -372,7 +422,7 @@ BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
.AddExpression("lerp", .AddExpression("lerp",
_("Lerp (Linear interpolation)"), _("Lerp (Linear interpolation)"),
_("Linearly interpolate a to b by x"), _("Linearly interpolate a to b by x"),
_("Mathematical tools"), "",
"res/mathfunction.png") "res/mathfunction.png")
.AddParameter("expression", _("a (in a+(b-a)*x)")) .AddParameter("expression", _("a (in a+(b-a)*x)"))
.AddParameter("expression", _("b (in a+(b-a)*x)")) .AddParameter("expression", _("b (in a+(b-a)*x)"))
@@ -385,7 +435,7 @@ BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
"relative to the origin (0;0). This is also known as " "relative to the origin (0;0). This is also known as "
"getting the cartesian coordinates of a 2D vector, using " "getting the cartesian coordinates of a 2D vector, using "
"its polar coordinates."), "its polar coordinates."),
_("Mathematical tools"), "",
"res/mathfunction.png") "res/mathfunction.png")
.AddParameter("expression", _("Angle, in degrees")) .AddParameter("expression", _("Angle, in degrees"))
.AddParameter("expression", _("Distance")); .AddParameter("expression", _("Distance"));
@@ -397,7 +447,7 @@ BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
"relative to the origin (0;0). This is also known as " "relative to the origin (0;0). This is also known as "
"getting the cartesian coordinates of a 2D vector, using " "getting the cartesian coordinates of a 2D vector, using "
"its polar coordinates."), "its polar coordinates."),
_("Mathematical tools"), "",
"res/mathfunction.png") "res/mathfunction.png")
.AddParameter("expression", _("Angle, in degrees")) .AddParameter("expression", _("Angle, in degrees"))
.AddParameter("expression", _("Distance")); .AddParameter("expression", _("Distance"));

View File

@@ -23,7 +23,10 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsMouseExtension(
"separately in different events.", "separately in different events.",
"Florian Rival", "Florian Rival",
"Open source (MIT License)") "Open source (MIT License)")
.SetExtensionHelpPath("/all-features/mouse-touch"); .SetExtensionHelpPath("/all-features/mouse-touch")
.SetCategory("Input");
extension.AddInstructionOrExpressionGroupMetadata(_("Mouse and touch"))
.SetIcon("res/actions/mouse24.png");
extension extension
.AddCondition( .AddCondition(
@@ -32,7 +35,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsMouseExtension(
_("Check if the mouse wheel is scrolling up. Use MouseWheelDelta " _("Check if the mouse wheel is scrolling up. Use MouseWheelDelta "
"expression if you want to know the amount that was scrolled."), "expression if you want to know the amount that was scrolled."),
_("The mouse wheel is scrolling up"), _("The mouse wheel is scrolling up"),
_("Mouse and touch"), "",
"res/actions/mouse24.png", "res/actions/mouse24.png",
"res/actions/mouse.png") "res/actions/mouse.png")
@@ -46,7 +49,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsMouseExtension(
_("Check if the mouse wheel is scrolling down. Use MouseWheelDelta " _("Check if the mouse wheel is scrolling down. Use MouseWheelDelta "
"expression if you want to know the amount that was scrolled."), "expression if you want to know the amount that was scrolled."),
_("The mouse wheel is scrolling down"), _("The mouse wheel is scrolling down"),
_("Mouse and touch"), "",
"res/actions/mouse24.png", "res/actions/mouse24.png",
"res/actions/mouse.png") "res/actions/mouse.png")
@@ -64,7 +67,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsMouseExtension(
"touchscreens. If you want to have multitouch and differentiate " "touchscreens. If you want to have multitouch and differentiate "
"mouse movement and touches, just deactivate it with this action."), "mouse movement and touches, just deactivate it with this action."),
_("Move mouse cursor when touching screen: _PARAM1_"), _("Move mouse cursor when touching screen: _PARAM1_"),
_("Mouse and touch"), "",
"res/conditions/touch24.png", "res/conditions/touch24.png",
"res/conditions/touch.png") "res/conditions/touch.png")
@@ -79,7 +82,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsMouseExtension(
_("Center cursor horizontally"), _("Center cursor horizontally"),
_("Put the cursor in the middle of the screen horizontally."), _("Put the cursor in the middle of the screen horizontally."),
_("Center cursor horizontally"), _("Center cursor horizontally"),
_("Mouse and touch"), "",
"res/actions/mouse24.png", "res/actions/mouse24.png",
"res/actions/mouse.png") "res/actions/mouse.png")
@@ -91,7 +94,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsMouseExtension(
_("Center cursor vertically"), _("Center cursor vertically"),
_("Put the cursor in the middle of the screen vertically."), _("Put the cursor in the middle of the screen vertically."),
_("Center cursor vertically"), _("Center cursor vertically"),
_("Mouse and touch"), "",
"res/actions/mouse24.png", "res/actions/mouse24.png",
"res/actions/mouse.png") "res/actions/mouse.png")
@@ -103,7 +106,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsMouseExtension(
_("Hide the cursor"), _("Hide the cursor"),
_("Hide the cursor."), _("Hide the cursor."),
_("Hide the cursor"), _("Hide the cursor"),
_("Mouse and touch"), "",
"res/actions/mouse24.png", "res/actions/mouse24.png",
"res/actions/mouse.png") "res/actions/mouse.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -114,7 +117,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsMouseExtension(
_("Show the cursor"), _("Show the cursor"),
_("Show the cursor."), _("Show the cursor."),
_("Show the cursor"), _("Show the cursor"),
_("Mouse and touch"), "",
"res/actions/mouse24.png", "res/actions/mouse24.png",
"res/actions/mouse.png") "res/actions/mouse.png")
@@ -126,7 +129,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsMouseExtension(
_("Position the cursor of the mouse"), _("Position the cursor of the mouse"),
_("Position the cursor at the given coordinates."), _("Position the cursor at the given coordinates."),
_("Position cursor at _PARAM1_;_PARAM2_"), _("Position cursor at _PARAM1_;_PARAM2_"),
_("Mouse and touch"), "",
"res/actions/mouse24.png", "res/actions/mouse24.png",
"res/actions/mouse.png") "res/actions/mouse.png")
@@ -140,7 +143,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsMouseExtension(
_("Center the cursor"), _("Center the cursor"),
_("Center the cursor on the screen."), _("Center the cursor on the screen."),
_("Center the cursor"), _("Center the cursor"),
_("Mouse and touch"), "",
"res/actions/mouse24.png", "res/actions/mouse24.png",
"res/actions/mouse.png") "res/actions/mouse.png")
@@ -154,7 +157,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsMouseExtension(
_("Cursor X position"), _("Cursor X position"),
_("the X position of the cursor or of a touch"), _("the X position of the cursor or of a touch"),
_("the cursor (or touch) X position"), _("the cursor (or touch) X position"),
_("Mouse and touch"), "",
"res/conditions/mouse24.png") "res/conditions/mouse24.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
.UseStandardParameters("number") .UseStandardParameters("number")
@@ -174,7 +177,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsMouseExtension(
_("Cursor Y position"), _("Cursor Y position"),
_("the Y position of the cursor or of a touch"), _("the Y position of the cursor or of a touch"),
_("the cursor (or touch) Y position"), _("the cursor (or touch) Y position"),
_("Mouse and touch"), "",
"res/conditions/mouse24.png") "res/conditions/mouse24.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
.UseStandardParameters("number") .UseStandardParameters("number")
@@ -187,13 +190,24 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsMouseExtension(
extension.AddDuplicatedCondition("SourisY", "MouseY").SetHidden(); extension.AddDuplicatedCondition("SourisY", "MouseY").SetHidden();
extension.AddDuplicatedExpression("SourisY", "MouseY").SetHidden(); extension.AddDuplicatedExpression("SourisY", "MouseY").SetHidden();
extension
.AddCondition("IsMouseInsideCanvas",
_("Mouse cursor is inside the window"),
_("Check if the mouse cursor is inside the window."),
_("The mouse cursor is inside the window"),
"",
"res/conditions/mouse24.png",
"res/conditions/mouse.png")
.AddCodeOnlyParameter("currentScene", "")
.MarkAsAdvanced();
extension extension
.AddCondition("MouseButtonPressed", .AddCondition("MouseButtonPressed",
_("Mouse button pressed or touch held"), _("Mouse button pressed or touch held"),
_("Check if the specified mouse button is pressed or " _("Check if the specified mouse button is pressed or "
"if a touch is in contact with the screen."), "if a touch is in contact with the screen."),
_("Touch or _PARAM1_ mouse button is down"), _("Touch or _PARAM1_ mouse button is down"),
_("Mouse and touch"), "",
"res/conditions/mouse24.png", "res/conditions/mouse24.png",
"res/conditions/mouse.png") "res/conditions/mouse.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -209,7 +223,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsMouseExtension(
_("Mouse button released"), _("Mouse button released"),
_("Check if the specified mouse button was released."), _("Check if the specified mouse button was released."),
_("_PARAM1_ mouse button was released"), _("_PARAM1_ mouse button was released"),
_("Mouse and touch"), "",
"res/conditions/mouse24.png", "res/conditions/mouse24.png",
"res/conditions/mouse.png") "res/conditions/mouse.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -223,7 +237,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsMouseExtension(
_("Check if a mouse button, retrieved from the result of the " _("Check if a mouse button, retrieved from the result of the "
"expression, is pressed."), "expression, is pressed."),
_("_PARAM1_ mouse button is pressed"), _("_PARAM1_ mouse button is pressed"),
_("Mouse and touch"), "",
"res/conditions/mouse24.png", "res/conditions/mouse24.png",
"res/conditions/mouse.png") "res/conditions/mouse.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -241,7 +255,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsMouseExtension(
_("Check if a mouse button, retrieved from the result of the " _("Check if a mouse button, retrieved from the result of the "
"expression, was just released."), "expression, was just released."),
_("_PARAM1_ mouse button is released"), _("_PARAM1_ mouse button is released"),
_("Mouse and touch"), "",
"res/conditions/mouse24.png", "res/conditions/mouse24.png",
"res/conditions/mouse.png") "res/conditions/mouse.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -258,7 +272,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsMouseExtension(
_("Touch X position"), _("Touch X position"),
_("the X position of a specific touch"), _("the X position of a specific touch"),
_("the touch #_PARAM1_ X position"), _("the touch #_PARAM1_ X position"),
_("Mouse and touch/Multitouch"), _("Multitouch"),
"res/conditions/touch24.png") "res/conditions/touch24.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Touch identifier")) .AddParameter("expression", _("Touch identifier"))
@@ -274,7 +288,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsMouseExtension(
_("Touch Y position"), _("Touch Y position"),
_("the Y position of a specific touch"), _("the Y position of a specific touch"),
_("the touch #_PARAM1_ Y position"), _("the touch #_PARAM1_ Y position"),
_("Mouse and touch/Multitouch"), _("Multitouch"),
"res/conditions/touch24.png") "res/conditions/touch24.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Touch identifier")) .AddParameter("expression", _("Touch identifier"))
@@ -294,7 +308,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsMouseExtension(
"next time you use it, it will be for a new touch, or it will " "next time you use it, it will be for a new touch, or it will "
"return false if no more touches have just started."), "return false if no more touches have just started."),
_("A new touch has started"), _("A new touch has started"),
_("Mouse and touch/Multitouch"), _("Multitouch"),
"res/conditions/touch24.png", "res/conditions/touch24.png",
"res/conditions/touch.png") "res/conditions/touch.png")
.AddCodeOnlyParameter("currentScene", ""); .AddCodeOnlyParameter("currentScene", "");
@@ -309,7 +323,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsMouseExtension(
"time you use it, it will be for a new touch, or it will return " "time you use it, it will be for a new touch, or it will return "
"false if no more touches have just ended."), "false if no more touches have just ended."),
_("A touch has ended"), _("A touch has ended"),
_("Mouse and touch/Multitouch"), _("Multitouch"),
"res/conditions/touch24.png", "res/conditions/touch24.png",
"res/conditions/touch.png") "res/conditions/touch.png")
.AddCodeOnlyParameter("currentScene", ""); .AddCodeOnlyParameter("currentScene", "");
@@ -326,7 +340,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsMouseExtension(
.AddExpression("LastTouchId", .AddExpression("LastTouchId",
_("Identifier of the last touch"), _("Identifier of the last touch"),
_("Identifier of the last touch"), _("Identifier of the last touch"),
_("Mouse and touch/Multitouch"), _("Multitouch"),
"res/conditions/touch.png") "res/conditions/touch.png")
.AddCodeOnlyParameter("currentScene", ""); .AddCodeOnlyParameter("currentScene", "");
@@ -334,7 +348,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsMouseExtension(
.AddExpression("LastEndedTouchId", .AddExpression("LastEndedTouchId",
_("Identifier of the last ended touch"), _("Identifier of the last ended touch"),
_("Identifier of the last ended touch"), _("Identifier of the last ended touch"),
_("Mouse and touch/Multitouch"), _("Multitouch"),
"res/conditions/touch.png") "res/conditions/touch.png")
.AddCodeOnlyParameter("currentScene", ""); .AddCodeOnlyParameter("currentScene", "");
} }

View File

@@ -14,12 +14,15 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsNetworkExtension(
extension extension
.SetExtensionInformation( .SetExtensionInformation(
"BuiltinNetwork", "BuiltinNetwork",
_("Basic internet features"), _("Network"),
_("Features to send web requests, communicate with external \"APIs\" " _("Features to send web requests, communicate with external \"APIs\" "
"and other network related tasks."), "and other network related tasks."),
"Florian Rival", "Florian Rival",
"Open source (MIT License)") "Open source (MIT License)")
.SetExtensionHelpPath("/all-features/network"); .SetExtensionHelpPath("/all-features/network")
.SetCategory("Network");
extension.AddInstructionOrExpressionGroupMetadata(_("Network"))
.SetIcon("res/actions/net24.png");
extension extension
.AddAction( .AddAction(
@@ -30,7 +33,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsNetworkExtension(
"as specified below, except if the server is configured to answer " "as specified below, except if the server is configured to answer "
"to all requests (cross-domain requests).", "to all requests (cross-domain requests).",
"Send _PARAM3_ request to _PARAM0__PARAM1_ with body: _PARAM2_", "Send _PARAM3_ request to _PARAM0__PARAM1_ with body: _PARAM2_",
_("Network"), "",
"res/actions/net24.png", "res/actions/net24.png",
"res/actions/net.png") "res/actions/net.png")
.AddParameter("string", "Host, with protocol") .AddParameter("string", "Host, with protocol")
@@ -65,7 +68,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsNetworkExtension(
"to all requests (cross-domain requests)."), "to all requests (cross-domain requests)."),
_("Send a _PARAM2_ request to _PARAM0_ with body: _PARAM1_, and " _("Send a _PARAM2_ request to _PARAM0_ with body: _PARAM1_, and "
"store the result in _PARAM4_ (or in _PARAM5_ in case of error)"), "store the result in _PARAM4_ (or in _PARAM5_ in case of error)"),
_("Network"), "",
"res/actions/net24.png", "res/actions/net24.png",
"res/actions/net.png") "res/actions/net.png")
.AddParameter("string", _("URL (API or web-page address)")) .AddParameter("string", _("URL (API or web-page address)"))
@@ -92,20 +95,37 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsNetworkExtension(
"explore the results with a *structure variable*.")) "explore the results with a *structure variable*."))
.AddParameter( .AddParameter(
"scenevar", _("Variable where to store the error message"), "", true) "scenevar", _("Variable where to store the error message"), "", true)
.SetParameterLongDescription( .SetParameterLongDescription(_(
_("Optional, only used if an error occurs. This will contain the " "Optional, only used if an error occurs. This will contain the "
"error message (if request could not be sent) or the [\"status " "[\"status "
"code\"](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes), " "code\"](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) "
"if the server returns a status >= 400.")) "if the server returns a status >= 400. If the request was not sent "
"at all (e.g. no internet or CORS issues), the variable will be set "
"to "
"\"REQUEST_NOT_SENT\"."))
.MarkAsComplex(); .MarkAsComplex();
extension
.AddAction("LaunchFile",
_("Open a URL (web page) or a file"),
_("This action launches the specified file or URL, in a "
"browser (or in a new tab if the game is using the Web "
"platform and is launched inside a browser)."),
_("Open URL _PARAM0_ in a browser (or new tab)"),
"",
"res/actions/net24.png",
"res/actions/net.png")
.AddParameter("string", _("URL (or filename)"))
.AddCodeOnlyParameter("currentScene", "")
.MarkAsAdvanced();
extension extension
.AddAction( .AddAction(
"DownloadFile", "DownloadFile",
_("Download a file"), _("Download a file"),
_("Download a file from a web site"), _("Download a file from a web site"),
_("Download file _PARAM1_ from _PARAM0_ under the name of _PARAM2_"), _("Download file _PARAM1_ from _PARAM0_ under the name of _PARAM2_"),
_("Network"), "",
"res/actions/net24.png", "res/actions/net24.png",
"res/actions/net.png") "res/actions/net.png")
.AddParameter("string", _("Host (for example : http://www.website.com)")) .AddParameter("string", _("Host (for example : http://www.website.com)"))
@@ -123,78 +143,11 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsNetworkExtension(
"terms of service of your game and if they player gave their " "terms of service of your game and if they player gave their "
"consent, depending on how your game/company handles this."), "consent, depending on how your game/company handles this."),
_("Enable analytics metrics: _PARAM1_"), _("Enable analytics metrics: _PARAM1_"),
_("Network"), "",
"res/actions/net24.png", "res/actions/net24.png",
"res/actions/net.png") "res/actions/net.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
.AddParameter("yesorno", _("Enable the metrics?")); .AddParameter("yesorno", _("Enable the metrics?"));
extension
.AddAction(
"JSONToVariableStructure",
_("Convert JSON to a scene variable"),
_("Parse a JSON object and store it into a scene variable"),
_("Parse JSON string _PARAM0_ and store it into variable _PARAM1_"),
_("Network"),
"res/actions/net24.png",
"res/actions/net.png")
.AddParameter("string", _("JSON string"))
.AddParameter("scenevar", _("Variable where store the JSON object"))
.MarkAsAdvanced();
extension
.AddAction("JSONToGlobalVariableStructure",
_("Convert JSON to global variable"),
_("Parse a JSON object and store it into a global variable"),
_("Parse JSON string _PARAM0_ and store it into global "
"variable _PARAM1_"),
_("Network"),
"res/actions/net24.png",
"res/actions/net.png")
.AddParameter("string", _("JSON string"))
.AddParameter("globalvar",
_("Global variable where store the JSON object"))
.MarkAsAdvanced();
extension
.AddAction("JSONToObjectVariableStructure",
_("Convert JSON to object variable"),
_("Parse a JSON object and store it into an object variable"),
_("Parse JSON string _PARAM0_ and store it into variable "
"_PARAM2_ of _PARAM1_"),
_("Network"),
"res/actions/net24.png",
"res/actions/net.png")
.AddParameter("string", _("JSON string"))
.AddParameter("objectPtr", _("Object"))
.AddParameter("objectvar",
_("Object variable where store the JSON object"))
.MarkAsAdvanced();
extension
.AddStrExpression("ToJSON",
_("Convert scene variable to JSON"),
_("Convert a scene variable to JSON"),
_("Conversion"),
"res/conditions/toujours24.png")
.AddParameter("scenevar", _("Scene variable to be stringified"));
extension
.AddStrExpression("GlobalVarToJSON",
_("Convert global variable to JSON"),
_("Convert a global variable to JSON"),
_("Conversion"),
"res/conditions/toujours24.png")
.AddParameter("globalvar", _("The global variable to be stringified"));
extension
.AddStrExpression("ObjectVarToJSON",
_("Convert object variable to JSON"),
_("Convert an object variable to JSON"),
_("Conversion"),
"res/conditions/toujours24.png")
.AddParameter("objectPtr", _("The object with the variable"))
.AddParameter("objectvar", _("The object variable to be stringified"));
} }
} // namespace gd } // namespace gd

View File

@@ -14,67 +14,19 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSceneExtension(
extension extension
.SetExtensionInformation( .SetExtensionInformation(
"BuiltinScene", "BuiltinScene",
_("Scene management features"), _("Scene"),
_("Actions and conditions to manipulate the scenes during the game."), _("Actions and conditions to manipulate the scenes during the game."),
"Florian Rival", "Florian Rival",
"Open source (MIT License)") "Open source (MIT License)")
.SetExtensionHelpPath("" /*TODO: Add a documentation page for this */); .SetExtensionHelpPath("" /*TODO: Add a documentation page for this */);
extension.AddInstructionOrExpressionGroupMetadata(_("Scene"))
.SetIcon("res/conditions/depart24.png");
extension
.AddExpression("Random",
_("Random integer"),
_("Random integer"),
_("Random"),
"res/actions/position.png")
.SetHelpPath("/all-features/expressions")
.AddParameter("expression", _("Maximum value"));
extension
.AddExpression("RandomInRange",
_("Random integer in range"),
_("Random integer in range"),
_("Random"),
"res/actions/position.png")
.SetHelpPath("/all-features/expressions")
.AddParameter("expression", _("Minimum value"))
.AddParameter("expression", _("Maximum value"));
extension
.AddExpression("RandomFloat",
_("Random float"),
_("Random float"),
_("Random"),
"res/actions/position.png")
.SetHelpPath("/all-features/expressions")
.AddParameter("expression", _("Maximum value"));
extension
.AddExpression("RandomFloatInRange",
_("Random float in range"),
_("Random float in range"),
_("Random"),
"res/actions/position.png")
.SetHelpPath("/all-features/expressions")
.AddParameter("expression", _("Minimum value"))
.AddParameter("expression", _("Maximum value"));
extension
.AddExpression("RandomWithStep",
_("Random value in steps"),
_("Random value in steps"),
_("Random"),
"res/actions/position.png")
.SetHelpPath("/all-features/expressions")
.AddParameter("expression", _("Minimum value"))
.AddParameter("expression", _("Maximum value"))
.AddParameter("expression", _("Step"));
extension extension
.AddStrExpression("CurrentSceneName", .AddStrExpression("CurrentSceneName",
_("Current scene name"), _("Current scene name"),
_("Name of the current scene"), _("Name of the current scene"),
_("Scene"), "",
"res/actions/texte.png") "res/actions/texte.png")
.AddCodeOnlyParameter("currentScene", ""); .AddCodeOnlyParameter("currentScene", "");
@@ -83,7 +35,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSceneExtension(
_("At the beginning of the scene"), _("At the beginning of the scene"),
_("Is true only when scene just begins."), _("Is true only when scene just begins."),
_("At the beginning of the scene"), _("At the beginning of the scene"),
_("Scene"), "",
"res/conditions/depart24.png", "res/conditions/depart24.png",
"res/conditions/depart.png") "res/conditions/depart.png")
.SetHelpPath("/interface/scene-editor/events") .SetHelpPath("/interface/scene-editor/events")
@@ -95,7 +47,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSceneExtension(
_("Scene just resumed"), _("Scene just resumed"),
_("The scene has just resumed after being paused."), _("The scene has just resumed after being paused."),
_("Scene just resumed"), _("Scene just resumed"),
_("Scene"), "",
"res/conditions/depart24.png", "res/conditions/depart24.png",
"res/conditions/depart.png") "res/conditions/depart.png")
.SetHelpPath("/interface/scene-editor/events") .SetHelpPath("/interface/scene-editor/events")
@@ -107,7 +59,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSceneExtension(
_("Change the scene"), _("Change the scene"),
_("Stop this scene and start the specified one instead."), _("Stop this scene and start the specified one instead."),
_("Change to scene _PARAM1_"), _("Change to scene _PARAM1_"),
_("Scene"), "",
"res/actions/replaceScene24.png", "res/actions/replaceScene24.png",
"res/actions/replaceScene.png") "res/actions/replaceScene.png")
.SetHelpPath("/interface/scene-editor/events") .SetHelpPath("/interface/scene-editor/events")
@@ -124,7 +76,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSceneExtension(
"can use the \"Stop and go back to previous scene\" action " "can use the \"Stop and go back to previous scene\" action "
"to go back to this scene."), "to go back to this scene."),
_("Pause the scene and start _PARAM1_"), _("Pause the scene and start _PARAM1_"),
_("Scene"), "",
"res/actions/pushScene24.png", "res/actions/pushScene24.png",
"res/actions/pushScene.png") "res/actions/pushScene.png")
.SetHelpPath("/interface/scene-editor/events") .SetHelpPath("/interface/scene-editor/events")
@@ -139,7 +91,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSceneExtension(
_("Stop this scene and go back to the previous paused one.\nTo pause " _("Stop this scene and go back to the previous paused one.\nTo pause "
"a scene, use the \"Pause and start a new scene\" action."), "a scene, use the \"Pause and start a new scene\" action."),
_("Stop the scene and go back to the previous paused one"), _("Stop the scene and go back to the previous paused one"),
_("Scene"), "",
"res/actions/popScene24.png", "res/actions/popScene24.png",
"res/actions/popScene.png") "res/actions/popScene.png")
.SetHelpPath("/interface/scene-editor/events") .SetHelpPath("/interface/scene-editor/events")
@@ -151,7 +103,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSceneExtension(
_("Quit the game"), _("Quit the game"),
_("Quit the game"), _("Quit the game"),
_("Quit the game"), _("Quit the game"),
_("Scene"), "",
"res/actions/quit24.png", "res/actions/quit24.png",
"res/actions/quit.png") "res/actions/quit.png")
.SetHelpPath("/interface/scene-editor/events") .SetHelpPath("/interface/scene-editor/events")
@@ -163,7 +115,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSceneExtension(
_("Change background color"), _("Change background color"),
_("Change the background color of the scene."), _("Change the background color of the scene."),
_("Set background color to _PARAM1_"), _("Set background color to _PARAM1_"),
_("Scene"), "",
"res/actions/background24.png", "res/actions/background24.png",
"res/actions/background.png") "res/actions/background.png")
.SetHelpPath("/interface/scene-editor/events") .SetHelpPath("/interface/scene-editor/events")
@@ -177,41 +129,13 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSceneExtension(
_("mouse buttons must be taken " _("mouse buttons must be taken "
"into account even\nif the window is not active."), "into account even\nif the window is not active."),
_("Disable input when focus is lost: _PARAM1_"), _("Disable input when focus is lost: _PARAM1_"),
_("Scene"), "",
"res/actions/window24.png", "res/actions/window24.png",
"res/actions/window.png") "res/actions/window.png")
.SetHelpPath("/interface/scene-editor/events") .SetHelpPath("/interface/scene-editor/events")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
.AddParameter("yesorno", _("Deactivate input when focus is lost")) .AddParameter("yesorno", _("Deactivate input when focus is lost"))
.MarkAsAdvanced(); .MarkAsAdvanced();
extension
.AddCondition("Egal",
_("Compare two numbers"),
_("Compare the two numbers."),
_("_PARAM0_ _PARAM1_ _PARAM2_"),
_("Other"),
"res/conditions/egal24.png",
"res/conditions/egal.png")
.SetHelpPath("/all-features/advanced-conditions")
.AddParameter("expression", _("First expression"))
.AddParameter("relationalOperator", _("Sign of the test"), "number")
.AddParameter("expression", _("Second expression"))
.MarkAsAdvanced();
extension
.AddCondition("StrEqual",
_("Compare two strings"),
_("Compare the two strings."),
_("_PARAM0_ _PARAM1_ _PARAM2_"),
_("Other"),
"res/conditions/egal24.png",
"res/conditions/egal.png")
.SetHelpPath("/all-features/advanced-conditions")
.AddParameter("string", _("First string expression"))
.AddParameter("relationalOperator", _("Sign of the test"), "string")
.AddParameter("string", _("Second string expression"))
.MarkAsAdvanced();
} }
} // namespace gd } // namespace gd

View File

@@ -23,11 +23,14 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSpriteExtension(
"Open source (MIT License)") "Open source (MIT License)")
.SetExtensionHelpPath("/objects/sprite"); .SetExtensionHelpPath("/objects/sprite");
gd::ObjectMetadata& obj = extension.AddObject<SpriteObject>( gd::ObjectMetadata& obj =
"Sprite", extension
_("Sprite"), .AddObject<SpriteObject>("Sprite",
_("Animated object which can be used for most elements of a game"), _("Sprite"),
"CppPlatform/Extensions/spriteicon.png"); _("Animated object which can be used for "
"most elements of a game"),
"CppPlatform/Extensions/spriteicon.png")
.SetCategoryFullName(_("General"));
obj.AddAction("Opacity", obj.AddAction("Opacity",
_("Change sprite opacity"), _("Change sprite opacity"),
@@ -78,7 +81,8 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSpriteExtension(
_("Direction"), _("Direction"),
"res/actions/direction24.png", "res/actions/direction24.png",
"res/actions/direction.png") "res/actions/direction.png")
.SetHidden() // Hide as 8 direction is not supported officially in the interface. .SetHidden() // Hide as 8 direction is not supported officially in the
// interface.
.AddParameter("object", _("Object"), "Sprite") .AddParameter("object", _("Object"), "Sprite")
.UseStandardOperatorParameters("number") .UseStandardOperatorParameters("number")
.MarkAsAdvanced(); .MarkAsAdvanced();
@@ -195,6 +199,18 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSpriteExtension(
.UseStandardOperatorParameters("number") .UseStandardOperatorParameters("number")
.MarkAsAdvanced(); .MarkAsAdvanced();
obj.AddCondition("Width",
_("Width"),
_("Compare the width of a Sprite object."),
_("the width"),
_("Size"),
"res/conditions/scaleWidth24.png",
"res/conditions/scaleWidth.png")
.AddParameter("object", _("Object"), "Sprite")
.UseStandardRelationalOperatorParameters("number")
.MarkAsAdvanced();
obj.AddAction("ChangeHeight", obj.AddAction("ChangeHeight",
_("Height"), _("Height"),
_("Change the height of a Sprite object."), _("Change the height of a Sprite object."),
@@ -207,6 +223,31 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSpriteExtension(
.UseStandardOperatorParameters("number") .UseStandardOperatorParameters("number")
.MarkAsAdvanced(); .MarkAsAdvanced();
obj.AddCondition("Height",
_("Height"),
_("Compare the height of a Sprite object."),
_("the height"),
_("Size"),
"res/conditions/scaleHeight24.png",
"res/conditions/scaleHeight.png")
.AddParameter("object", _("Object"), "Sprite")
.UseStandardRelationalOperatorParameters("number")
.MarkAsAdvanced();
obj.AddAction("SetSize",
_("Size"),
_("Change the size of an object."),
_("Change the size of _PARAM0_: set to _PARAM1_x_PARAM2_"),
_("Size"),
"res/actions/scale24.png",
"res/actions/scale.png")
.AddParameter("object", _("Object"))
.AddParameter("expression", _("Width"))
.AddParameter("expression", _("Height"))
.MarkAsAdvanced();
obj.AddCondition( obj.AddCondition(
"Animation", "Animation",
_("Current animation"), _("Current animation"),
@@ -242,7 +283,8 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSpriteExtension(
_("Direction"), _("Direction"),
"res/conditions/direction24.png", "res/conditions/direction24.png",
"res/conditions/direction.png") "res/conditions/direction.png")
.SetHidden() // Hide as 8 direction is not supported officially in the interface. .SetHidden() // Hide as 8 direction is not supported officially in the
// interface.
.AddParameter("object", _("Object"), "Sprite") .AddParameter("object", _("Object"), "Sprite")
.UseStandardRelationalOperatorParameters("number"); .UseStandardRelationalOperatorParameters("number");
@@ -464,7 +506,8 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSpriteExtension(
_("Direction of the object"), _("Direction of the object"),
_("Direction"), _("Direction"),
"res/actions/direction.png") "res/actions/direction.png")
.SetHidden() // Hide as 8 direction is not supported officially in the interface. .SetHidden() // Hide as 8 direction is not supported officially in the
// interface.
.AddParameter("object", _("Object"), "Sprite"); .AddParameter("object", _("Object"), "Sprite");
obj.AddExpression("Anim", obj.AddExpression("Anim",

View File

@@ -4,23 +4,24 @@
* reserved. This project is released under the MIT License. * reserved. This project is released under the MIT License.
*/ */
#include "GDCore/Extensions/Builtin/SpriteExtension/SpriteObject.h"
#include <SFML/Graphics.hpp>
#include <algorithm> #include <algorithm>
#include "GDCore/CommonTools.h" #include "GDCore/CommonTools.h"
#include "GDCore/Extensions/Builtin/SpriteExtension/Animation.h" #include "GDCore/Extensions/Builtin/SpriteExtension/Animation.h"
#include "GDCore/Extensions/Builtin/SpriteExtension/Direction.h" #include "GDCore/Extensions/Builtin/SpriteExtension/Direction.h"
#include "GDCore/Extensions/Builtin/SpriteExtension/Sprite.h" #include "GDCore/Extensions/Builtin/SpriteExtension/Sprite.h"
#include "GDCore/Extensions/Builtin/SpriteExtension/SpriteObject.h" #include "GDCore/IDE/Project/ArbitraryResourceWorker.h"
#include "GDCore/Project/InitialInstance.h" #include "GDCore/Project/InitialInstance.h"
#include "GDCore/Project/Layout.h" #include "GDCore/Project/Layout.h"
#include "GDCore/Project/Object.h" #include "GDCore/Project/Object.h"
#include "GDCore/Project/Project.h" #include "GDCore/Project/Project.h"
#include "GDCore/Project/PropertyDescriptor.h"
#include "GDCore/Serialization/SerializerElement.h" #include "GDCore/Serialization/SerializerElement.h"
#include "GDCore/Tools/Localization.h" #include "GDCore/Tools/Localization.h"
#include <SFML/Graphics.hpp>
#include "GDCore/Project/PropertyDescriptor.h"
#include "GDCore/IDE/Project/ArbitraryResourceWorker.h"
namespace gd { namespace gd {
Animation SpriteObject::badAnimation; Animation SpriteObject::badAnimation;
@@ -103,7 +104,8 @@ void SpriteObject::DoSerializeTo(gd::SerializerElement& element) const {
} }
} }
std::map<gd::String, gd::PropertyDescriptor> SpriteObject::GetProperties() const { std::map<gd::String, gd::PropertyDescriptor> SpriteObject::GetProperties()
const {
std::map<gd::String, gd::PropertyDescriptor> properties; std::map<gd::String, gd::PropertyDescriptor> properties;
properties[_("Animate even if hidden or far from the screen")] properties[_("Animate even if hidden or far from the screen")]
.SetValue(updateIfNotVisible ? "true" : "false") .SetValue(updateIfNotVisible ? "true" : "false")
@@ -135,22 +137,30 @@ void SpriteObject::ExposeResources(gd::ArbitraryResourceWorker& worker) {
} }
std::map<gd::String, gd::PropertyDescriptor> std::map<gd::String, gd::PropertyDescriptor>
SpriteObject::GetInitialInstanceProperties(const gd::InitialInstance& position, SpriteObject::GetInitialInstanceProperties(
gd::Project& project, const gd::InitialInstance& initialInstance,
gd::Layout& scene) { gd::Project& project,
gd::Layout& scene) {
std::map<gd::String, gd::PropertyDescriptor> properties; std::map<gd::String, gd::PropertyDescriptor> properties;
properties[_("Animation")] = gd::String::From(position.GetRawDoubleProperty("animation")); properties["animation"] =
gd::PropertyDescriptor(
gd::String::From(initialInstance.GetRawDoubleProperty("animation")))
.SetLabel(_("Animation"))
.SetType("number");
return properties; return properties;
} }
bool SpriteObject::UpdateInitialInstanceProperty(gd::InitialInstance& position, bool SpriteObject::UpdateInitialInstanceProperty(
const gd::String& name, gd::InitialInstance& initialInstance,
const gd::String& value, const gd::String& name,
gd::Project& project, const gd::String& value,
gd::Layout& scene) { gd::Project& project,
if (name == _("Animation")) gd::Layout& scene) {
position.SetRawDoubleProperty("animation", value.To<int>()); if (name == "animation") {
initialInstance.SetRawDoubleProperty(
"animation", std::max(0, value.empty() ? 0 : value.To<int>()));
}
return true; return true;
} }

View File

@@ -20,18 +20,20 @@ BuiltinExtensionsImplementer::ImplementsStringInstructionsExtension(
"Florian Rival", "Florian Rival",
"Open source (MIT License)") "Open source (MIT License)")
.SetExtensionHelpPath("" /*TODO: Add a documentation page for this */); .SetExtensionHelpPath("" /*TODO: Add a documentation page for this */);
extension.AddInstructionOrExpressionGroupMetadata(_("Text manipulation"))
.SetIcon("res/actions/text24.png");
extension.AddStrExpression("NewLine", extension.AddStrExpression("NewLine",
_("Insert a new line"), _("Insert a new line"),
_("Insert a new line"), _("Insert a new line"),
_("Manipulation of text"), "",
"res/conditions/toujours24.png"); "res/conditions/toujours24.png");
extension extension
.AddStrExpression("FromCodePoint", .AddStrExpression("FromCodePoint",
_("Get character from code point"), _("Get character from code point"),
_("Get character from code point"), _("Get character from code point"),
_("Manipulation of text"), "",
"res/conditions/toujours24.png") "res/conditions/toujours24.png")
.AddParameter("expression", _("Code point")); .AddParameter("expression", _("Code point"));
@@ -40,7 +42,7 @@ BuiltinExtensionsImplementer::ImplementsStringInstructionsExtension(
.AddStrExpression("ToUpperCase", .AddStrExpression("ToUpperCase",
_("Uppercase a text"), _("Uppercase a text"),
_("Uppercase a text"), _("Uppercase a text"),
_("Manipulation of text"), "",
"res/conditions/toujours24.png") "res/conditions/toujours24.png")
.AddParameter("string", _("Text")); .AddParameter("string", _("Text"));
@@ -49,7 +51,7 @@ BuiltinExtensionsImplementer::ImplementsStringInstructionsExtension(
.AddStrExpression("ToLowerCase", .AddStrExpression("ToLowerCase",
_("Lowercase a text"), _("Lowercase a text"),
_("Lowercase a text"), _("Lowercase a text"),
_("Manipulation of text"), "",
"res/conditions/toujours24.png") "res/conditions/toujours24.png")
.AddParameter("string", _("Text")); .AddParameter("string", _("Text"));
@@ -58,7 +60,7 @@ BuiltinExtensionsImplementer::ImplementsStringInstructionsExtension(
.AddStrExpression("SubStr", .AddStrExpression("SubStr",
_("Get a portion of a text"), _("Get a portion of a text"),
_("Get a portion of a text"), _("Get a portion of a text"),
_("Manipulation of text"), "",
"res/conditions/toujours24.png") "res/conditions/toujours24.png")
.AddParameter("string", _("Text")) .AddParameter("string", _("Text"))
@@ -71,7 +73,7 @@ BuiltinExtensionsImplementer::ImplementsStringInstructionsExtension(
.AddStrExpression("StrAt", .AddStrExpression("StrAt",
_("Get a character from a text"), _("Get a character from a text"),
_("Get a character from a text"), _("Get a character from a text"),
_("Manipulation of text"), "",
"res/conditions/toujours24.png") "res/conditions/toujours24.png")
.AddParameter("string", _("Text")) .AddParameter("string", _("Text"))
@@ -83,7 +85,7 @@ BuiltinExtensionsImplementer::ImplementsStringInstructionsExtension(
.AddStrExpression("StrRepeat", .AddStrExpression("StrRepeat",
_("Repeat a text"), _("Repeat a text"),
_("Repeat a text"), _("Repeat a text"),
_("Manipulation of text"), "",
"res/conditions/toujours24.png") "res/conditions/toujours24.png")
.AddParameter("string", _("Text to repeat")) .AddParameter("string", _("Text to repeat"))
@@ -93,7 +95,7 @@ BuiltinExtensionsImplementer::ImplementsStringInstructionsExtension(
.AddExpression("StrLength", .AddExpression("StrLength",
_("Length of a text"), _("Length of a text"),
_("Length of a text"), _("Length of a text"),
_("Manipulation of text"), "",
"res/conditions/toujours24.png") "res/conditions/toujours24.png")
.AddParameter("string", _("Text")); .AddParameter("string", _("Text"));
@@ -103,7 +105,7 @@ BuiltinExtensionsImplementer::ImplementsStringInstructionsExtension(
_("Search in a text"), _("Search in a text"),
_("Search in a text (return the position of the result or " _("Search in a text (return the position of the result or "
"-1 if not found)"), "-1 if not found)"),
_("Manipulation of text"), "",
"res/conditions/toujours24.png") "res/conditions/toujours24.png")
.AddParameter("string", _("Text")) .AddParameter("string", _("Text"))
@@ -114,7 +116,7 @@ BuiltinExtensionsImplementer::ImplementsStringInstructionsExtension(
"Search in a text from the end", "Search in a text from the end",
"Search in a text from the end (return the position of " "Search in a text from the end (return the position of "
"the result or -1 if not found)", "the result or -1 if not found)",
_("Manipulation of text"), "",
"res/conditions/toujours24.png") "res/conditions/toujours24.png")
.AddParameter("string", _("Text")) .AddParameter("string", _("Text"))
@@ -128,7 +130,7 @@ BuiltinExtensionsImplementer::ImplementsStringInstructionsExtension(
_("Search the last occurence in a string (return the position of " _("Search the last occurence in a string (return the position of "
"the result, from the beginning of the string, or -1 if not " "the result, from the beginning of the string, or -1 if not "
"found)"), "found)"),
_("Manipulation of text"), "",
"res/conditions/toujours24.png") "res/conditions/toujours24.png")
.AddParameter("string", _("Text")) .AddParameter("string", _("Text"))
@@ -139,7 +141,7 @@ BuiltinExtensionsImplementer::ImplementsStringInstructionsExtension(
_("Search in a text, starting from a position"), _("Search in a text, starting from a position"),
_("Search in a text, starting from a position (return the " _("Search in a text, starting from a position (return the "
"position of the result or -1 if not found)"), "position of the result or -1 if not found)"),
_("Manipulation of text"), "",
"res/conditions/toujours24.png") "res/conditions/toujours24.png")
.AddParameter("string", _("Text")) .AddParameter("string", _("Text"))
@@ -154,7 +156,7 @@ BuiltinExtensionsImplementer::ImplementsStringInstructionsExtension(
"Search in a text from the end, starting from a position", "Search in a text from the end, starting from a position",
"Search in a text from the end, starting from a position (return " "Search in a text from the end, starting from a position (return "
"the position of the result or -1 if not found)", "the position of the result or -1 if not found)",
_("Manipulation of text"), "",
"res/conditions/toujours24.png") "res/conditions/toujours24.png")
.AddParameter("string", _("Text")) .AddParameter("string", _("Text"))
@@ -172,7 +174,7 @@ BuiltinExtensionsImplementer::ImplementsStringInstructionsExtension(
"(return " "(return "
" the position of the result, from the beginning of the string, or " " the position of the result, from the beginning of the string, or "
"-1 if not found)"), "-1 if not found)"),
_("Manipulation of text"), "",
"res/conditions/toujours24.png") "res/conditions/toujours24.png")
.AddParameter("string", _("Text")) .AddParameter("string", _("Text"))

View File

@@ -14,33 +14,56 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsTimeExtension(
extension extension
.SetExtensionInformation( .SetExtensionInformation(
"BuiltinTime", "BuiltinTime",
_("Time"), _("Timers and time"),
"Actions and conditions to run timers, get the current time or " "Actions and conditions to run timers, get the current time or "
"modify the time scale (speed at which the game is running - useful " "modify the time scale (speed at which the game is running - useful "
"for slow motion effects).", "for slow motion effects).",
"Florian Rival", "Florian Rival",
"Open source (MIT License)") "Open source (MIT License)")
.SetExtensionHelpPath("/all-features/timers"); .SetExtensionHelpPath("/all-features/timers");
extension.AddInstructionOrExpressionGroupMetadata(
_("Timers and time")
)
.SetIcon("res/conditions/timer24.png");
// Deprecated and replaced by CompareTimer
extension extension
.AddCondition("Timer", .AddCondition("Timer",
_("Value of a scene timer"), _("Value of a scene timer"),
_("Test the elapsed time of a scene timer."), _("Test the elapsed time of a scene timer."),
_("The timer _PARAM2_ is greater than _PARAM1_ seconds"), _("The timer _PARAM2_ is greater than _PARAM1_ seconds"),
_("Timers and time"),
"",
"res/conditions/timer24.png", "res/conditions/timer24.png",
"res/conditions/timer.png") "res/conditions/timer.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Time in seconds")) .AddParameter("expression", _("Time in seconds"))
.AddParameter("string", _("Timer's name")); .AddParameter("string", _("Timer's name"))
.SetHidden();
extension
.AddCondition("CompareTimer",
_("Value of a scene timer"),
_("Compare the elapsed time of a scene timer. This "
"condition doesn't start the timer."),
_("The timer _PARAM1_ _PARAM2_ _PARAM3_ seconds"),
"",
"res/conditions/timer24.png",
"res/conditions/timer.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("string", _("Timer's name"))
.AddParameter("relationalOperator", _("Sign of the test"), "time")
.AddParameter("expression", _("Time in seconds"))
.SetManipulatedType("number");
extension extension
.AddCondition("TimeScale", .AddCondition("TimeScale",
_("Time scale"), _("Time scale"),
_("Compare the time scale of the scene."), _("Compare the time scale of the scene."),
_("the time scale of the scene"), _("the time scale of the scene"),
_("Timers and time"),
"",
"res/conditions/time24.png", "res/conditions/time24.png",
"res/conditions/time.png") "res/conditions/time.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -52,7 +75,8 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsTimeExtension(
_("Scene timer paused"), _("Scene timer paused"),
_("Test if the specified scene timer is paused."), _("Test if the specified scene timer is paused."),
_("The timer _PARAM1_ is paused"), _("The timer _PARAM1_ is paused"),
_("Timers and time"),
"",
"res/conditions/timerPaused24.png", "res/conditions/timerPaused24.png",
"res/conditions/timerPaused.png") "res/conditions/timerPaused.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -65,8 +89,9 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsTimeExtension(
_("Start (or reset) a scene timer"), _("Start (or reset) a scene timer"),
_("Reset the specified scene timer, if the timer doesn't exist " _("Reset the specified scene timer, if the timer doesn't exist "
"it's created and started."), "it's created and started."),
_("Reset the timer _PARAM1_"), _("Start (or reset) the timer _PARAM1_"),
_("Timers and time"),
"",
"res/actions/timer24.png", "res/actions/timer24.png",
"res/actions/timer.png") "res/actions/timer.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -77,7 +102,8 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsTimeExtension(
_("Pause a scene timer"), _("Pause a scene timer"),
_("Pause a scene timer."), _("Pause a scene timer."),
_("Pause timer _PARAM1_"), _("Pause timer _PARAM1_"),
_("Timers and time"),
"",
"res/actions/pauseTimer24.png", "res/actions/pauseTimer24.png",
"res/actions/pauseTimer.png") "res/actions/pauseTimer.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -89,7 +115,8 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsTimeExtension(
_("Unpause a scene timer"), _("Unpause a scene timer"),
_("Unpause a scene timer."), _("Unpause a scene timer."),
_("Unpause timer _PARAM1_"), _("Unpause timer _PARAM1_"),
_("Timers and time"),
"",
"res/actions/unPauseTimer24.png", "res/actions/unPauseTimer24.png",
"res/actions/unPauseTimer.png") "res/actions/unPauseTimer.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -101,7 +128,8 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsTimeExtension(
_("Delete a scene timer"), _("Delete a scene timer"),
_("Delete a scene timer from memory."), _("Delete a scene timer from memory."),
_("Delete timer _PARAM1_ from memory"), _("Delete timer _PARAM1_ from memory"),
_("Timers and time"),
"",
"res/actions/timer24.png", "res/actions/timer24.png",
"res/actions/timer.png") "res/actions/timer.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -113,7 +141,8 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsTimeExtension(
_("Change time scale"), _("Change time scale"),
_("Change the time scale of the scene."), _("Change the time scale of the scene."),
_("Set the time scale of the scene to _PARAM1_"), _("Set the time scale of the scene to _PARAM1_"),
_("Timers and time"),
"",
"res/actions/time24.png", "res/actions/time24.png",
"res/actions/time.png") "res/actions/time.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -124,7 +153,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsTimeExtension(
.AddExpression("TimeDelta", .AddExpression("TimeDelta",
_("Time elapsed since the last frame"), _("Time elapsed since the last frame"),
_("Time elapsed since the last frame rendered on screen"), _("Time elapsed since the last frame rendered on screen"),
_("Time"), "",
"res/actions/time.png") "res/actions/time.png")
.AddCodeOnlyParameter("currentScene", ""); .AddCodeOnlyParameter("currentScene", "");
@@ -132,7 +161,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsTimeExtension(
.AddExpression("TempsFrame", .AddExpression("TempsFrame",
_("Time elapsed since the last frame"), _("Time elapsed since the last frame"),
_("Time elapsed since the last frame rendered on screen"), _("Time elapsed since the last frame rendered on screen"),
_("Time"), "",
"res/actions/time.png") "res/actions/time.png")
.SetHidden() .SetHidden()
.AddCodeOnlyParameter("currentScene", ""); .AddCodeOnlyParameter("currentScene", "");
@@ -141,7 +170,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsTimeExtension(
.AddExpression("ElapsedTime", .AddExpression("ElapsedTime",
_("Time elapsed since the last frame"), _("Time elapsed since the last frame"),
_("Time elapsed since the last frame rendered on screen"), _("Time elapsed since the last frame rendered on screen"),
_("Time"), "",
"res/actions/time.png") "res/actions/time.png")
.SetHidden() .SetHidden()
.AddCodeOnlyParameter("currentScene", ""); .AddCodeOnlyParameter("currentScene", "");
@@ -150,7 +179,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsTimeExtension(
.AddExpression("TimerElapsedTime", .AddExpression("TimerElapsedTime",
_("Scene timer value"), _("Scene timer value"),
_("Value of a scene timer"), _("Value of a scene timer"),
_("Time"), "",
"res/actions/time.png") "res/actions/time.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
.AddParameter("string", _("Timer's name")); .AddParameter("string", _("Timer's name"));
@@ -159,7 +188,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsTimeExtension(
.AddExpression("TimeFromStart", .AddExpression("TimeFromStart",
_("Time elapsed since the beginning of the scene"), _("Time elapsed since the beginning of the scene"),
_("Time elapsed since the beginning of the scene"), _("Time elapsed since the beginning of the scene"),
_("Time"), "",
"res/actions/time.png") "res/actions/time.png")
.AddCodeOnlyParameter("currentScene", ""); .AddCodeOnlyParameter("currentScene", "");
@@ -167,7 +196,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsTimeExtension(
.AddExpression("TempsDebut", .AddExpression("TempsDebut",
_("Time elapsed since the beginning of the scene"), _("Time elapsed since the beginning of the scene"),
_("Time elapsed since the beginning of the scene"), _("Time elapsed since the beginning of the scene"),
_("Time"), "",
"res/actions/time.png") "res/actions/time.png")
.SetHidden() .SetHidden()
.AddCodeOnlyParameter("currentScene", ""); .AddCodeOnlyParameter("currentScene", "");
@@ -176,7 +205,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsTimeExtension(
.AddExpression("TimeScale", .AddExpression("TimeScale",
_("Time scale"), _("Time scale"),
_("Returns the time scale of the scene."), _("Returns the time scale of the scene."),
_("Time"), "",
"res/actions/time.png") "res/actions/time.png")
.AddCodeOnlyParameter("currentScene", ""); .AddCodeOnlyParameter("currentScene", "");
@@ -184,7 +213,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsTimeExtension(
.AddExpression("Time", .AddExpression("Time",
_("Current time"), _("Current time"),
_("Current time"), _("Current time"),
_("Time"), "",
"res/actions/time.png") "res/actions/time.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
.AddParameter( .AddParameter(
@@ -195,7 +224,6 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsTimeExtension(
"timestamp\""), "timestamp\""),
"[\"hour\", \"min\", \"sec\", \"mon\", \"year\", \"wday\", \"mday\", " "[\"hour\", \"min\", \"sec\", \"mon\", \"year\", \"wday\", \"mday\", "
"\"yday\", \"timestamp\"]"); "\"yday\", \"timestamp\"]");
} }
} // namespace gd } // namespace gd

View File

@@ -14,7 +14,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
extension extension
.SetExtensionInformation( .SetExtensionInformation(
"BuiltinVariables", "BuiltinVariables",
_("Variable features"), _("Variables"),
"Actions, conditions and expressions to handle variables, from " "Actions, conditions and expressions to handle variables, from "
"simple variables like the player score, the number of remaining " "simple variables like the player score, the number of remaining "
"lives to complex variables containing arbitrary data like an " "lives to complex variables containing arbitrary data like an "
@@ -22,13 +22,15 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
"Florian Rival", "Florian Rival",
"Open source (MIT License)") "Open source (MIT License)")
.SetExtensionHelpPath("/all-features/variables"); .SetExtensionHelpPath("/all-features/variables");
extension.AddInstructionOrExpressionGroupMetadata(_("Variables"))
.SetIcon("res/conditions/var24.png");
extension extension
.AddCondition("VarScene", .AddCondition("VarScene",
_("Value of a scene variable"), _("Value of a scene variable"),
_("Compare the value of a scene variable."), _("Compare the value of a scene variable."),
_("the scene variable _PARAM0_"), _("the scene variable _PARAM0_"),
_("Variables/Scene variables"), _("Scene variables"),
"res/conditions/var24.png", "res/conditions/var24.png",
"res/conditions/var.png") "res/conditions/var.png")
.AddParameter("scenevar", _("Variable")) .AddParameter("scenevar", _("Variable"))
@@ -39,7 +41,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
_("Text of a scene variable"), _("Text of a scene variable"),
_("Compare the text of a scene variable."), _("Compare the text of a scene variable."),
_("the text of scene variable _PARAM0_"), _("the text of scene variable _PARAM0_"),
_("Variables/Scene variables"), _("Scene variables"),
"res/conditions/var24.png", "res/conditions/var24.png",
"res/conditions/var.png") "res/conditions/var.png")
.AddParameter("scenevar", _("Variable")) .AddParameter("scenevar", _("Variable"))
@@ -51,7 +53,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
_("Boolean value of a scene variable"), _("Boolean value of a scene variable"),
_("Compare the boolean value of a scene variable."), _("Compare the boolean value of a scene variable."),
_("The boolean value of scene variable _PARAM0_ is _PARAM1_"), _("The boolean value of scene variable _PARAM0_ is _PARAM1_"),
_("Variables/Scene variables"), _("Scene variables"),
"res/conditions/var24.png", "res/conditions/var24.png",
"res/conditions/var.png") "res/conditions/var.png")
.AddParameter("scenevar", _("Variable")) .AddParameter("scenevar", _("Variable"))
@@ -64,7 +66,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
_("Child existence"), _("Child existence"),
_("Check if the specified child of the scene variable exists."), _("Check if the specified child of the scene variable exists."),
_("Child _PARAM1_ of scene variable _PARAM0_ exists"), _("Child _PARAM1_ of scene variable _PARAM0_ exists"),
_("Variables/Scene variables/Collections/Structures"), _("Scene variables/Collections/Structures"),
"res/conditions/var24.png", "res/conditions/var24.png",
"res/conditions/var.png") "res/conditions/var.png")
.AddParameter("scenevar", _("Variable")) .AddParameter("scenevar", _("Variable"))
@@ -77,7 +79,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
_("Check if the specified child of the global " _("Check if the specified child of the global "
"variable exists."), "variable exists."),
_("Child _PARAM1_ of global variable _PARAM0_ exists"), _("Child _PARAM1_ of global variable _PARAM0_ exists"),
_("Variables/Global variables/Collections/Structures"), _("Global variables/Collections/Structures"),
"res/conditions/var24.png", "res/conditions/var24.png",
"res/conditions/var.png") "res/conditions/var.png")
.AddParameter("globalvar", _("Variable")) .AddParameter("globalvar", _("Variable"))
@@ -89,7 +91,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
"Test if a scene variable is defined", "Test if a scene variable is defined",
"Test if the scene variable exists.", "Test if the scene variable exists.",
"Scene variable _PARAM0_ is defined", "Scene variable _PARAM0_ is defined",
_("Variables/Scene variables"), _("Scene variables"),
"res/conditions/var24.png", "res/conditions/var24.png",
"res/conditions/var.png") "res/conditions/var.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -101,7 +103,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
_("Value of a global variable"), _("Value of a global variable"),
_("Compare the value of a global variable."), _("Compare the value of a global variable."),
_("the global variable _PARAM0_"), _("the global variable _PARAM0_"),
_("Variables/Global variables"), _("Global variables"),
"res/conditions/var24.png", "res/conditions/var24.png",
"res/conditions/var.png") "res/conditions/var.png")
.AddParameter("globalvar", _("Variable")) .AddParameter("globalvar", _("Variable"))
@@ -113,7 +115,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
_("Text of a global variable"), _("Text of a global variable"),
_("Compare the text of a global variable."), _("Compare the text of a global variable."),
_("the text of the global variable _PARAM0_"), _("the text of the global variable _PARAM0_"),
_("Variables/Global variables"), _("Global variables"),
"res/conditions/var24.png", "res/conditions/var24.png",
"res/conditions/var.png") "res/conditions/var.png")
.AddParameter("globalvar", _("Variable")) .AddParameter("globalvar", _("Variable"))
@@ -126,7 +128,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
_("Boolean value of a global variable"), _("Boolean value of a global variable"),
_("Compare the boolean value of a global variable."), _("Compare the boolean value of a global variable."),
_("The boolean value of global variable _PARAM0_ is _PARAM1_"), _("The boolean value of global variable _PARAM0_ is _PARAM1_"),
_("Variables/Global variables"), _("Global variables"),
"res/conditions/var24.png", "res/conditions/var24.png",
"res/conditions/var.png") "res/conditions/var.png")
.AddParameter("globalvar", _("Variable")) .AddParameter("globalvar", _("Variable"))
@@ -138,7 +140,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
"Test if a global variable is defined", "Test if a global variable is defined",
"Test if a global variable exists", "Test if a global variable exists",
"Global variable _PARAM0_ is defined", "Global variable _PARAM0_ is defined",
_("Variables/Global variables"), _("Global variables"),
"res/conditions/var24.png", "res/conditions/var24.png",
"res/conditions/var.png") "res/conditions/var.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -151,7 +153,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
_("Value of a scene variable"), _("Value of a scene variable"),
_("Change the value of a scene variable."), _("Change the value of a scene variable."),
_("the scene variable _PARAM0_"), _("the scene variable _PARAM0_"),
_("Variables/Scene variables"), _("Scene variables"),
"res/actions/var24.png", "res/actions/var24.png",
"res/actions/var.png") "res/actions/var.png")
.AddParameter("scenevar", _("Variable")) .AddParameter("scenevar", _("Variable"))
@@ -162,7 +164,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
_("String of a scene variable"), _("String of a scene variable"),
_("Modify the text of a scene variable."), _("Modify the text of a scene variable."),
_("the text of scene variable _PARAM0_"), _("the text of scene variable _PARAM0_"),
_("Variables/Scene variables"), _("Scene variables"),
"res/actions/var24.png", "res/actions/var24.png",
"res/actions/var.png") "res/actions/var.png")
.AddParameter("scenevar", _("Variable")) .AddParameter("scenevar", _("Variable"))
@@ -174,7 +176,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
_("Boolean value of a scene variable"), _("Boolean value of a scene variable"),
_("Modify the boolean value of a scene variable."), _("Modify the boolean value of a scene variable."),
_("Set the boolean value of scene variable _PARAM0_ to _PARAM1_"), _("Set the boolean value of scene variable _PARAM0_ to _PARAM1_"),
_("Variables/Scene variables"), _("Scene variables"),
"res/conditions/var24.png", "res/conditions/var24.png",
"res/conditions/var.png") "res/conditions/var.png")
.AddParameter("scenevar", _("Variable")) .AddParameter("scenevar", _("Variable"))
@@ -187,7 +189,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
_("If it was true, it will become false, and if it was " _("If it was true, it will become false, and if it was "
"false it will become true."), "false it will become true."),
_("Toggle the boolean value of scene variable _PARAM0_"), _("Toggle the boolean value of scene variable _PARAM0_"),
_("Variables/Scene variables"), _("Scene variables"),
"res/conditions/var24.png", "res/conditions/var24.png",
"res/conditions/var.png") "res/conditions/var.png")
.AddParameter("scenevar", _("Variable")); .AddParameter("scenevar", _("Variable"));
@@ -197,7 +199,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
_("Value of a global variable"), _("Value of a global variable"),
_("Change the value of a global variable"), _("Change the value of a global variable"),
_("the global variable _PARAM0_"), _("the global variable _PARAM0_"),
_("Variables/Global variables"), _("Global variables"),
"res/actions/var24.png", "res/actions/var24.png",
"res/actions/var.png") "res/actions/var.png")
.AddParameter("globalvar", _("Variable")) .AddParameter("globalvar", _("Variable"))
@@ -209,7 +211,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
_("String of a global variable"), _("String of a global variable"),
_("Modify the text of a global variable."), _("Modify the text of a global variable."),
_("the text of global variable _PARAM0_"), _("the text of global variable _PARAM0_"),
_("Variables/Global variables"), _("Global variables"),
"res/actions/var24.png", "res/actions/var24.png",
"res/actions/var.png") "res/actions/var.png")
.AddParameter("globalvar", _("Variable")) .AddParameter("globalvar", _("Variable"))
@@ -222,7 +224,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
_("Boolean value of a global variable"), _("Boolean value of a global variable"),
_("Modify the boolean value of a global variable."), _("Modify the boolean value of a global variable."),
_("Set the boolean value of global variable _PARAM0_ to _PARAM1_"), _("Set the boolean value of global variable _PARAM0_ to _PARAM1_"),
_("Variables/Global variables"), _("Global variables"),
"res/conditions/var24.png", "res/conditions/var24.png",
"res/conditions/var.png") "res/conditions/var.png")
.AddParameter("globalvar", _("Variable")) .AddParameter("globalvar", _("Variable"))
@@ -235,7 +237,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
_("If it was true, it will become false, and if it was " _("If it was true, it will become false, and if it was "
"false it will become true."), "false it will become true."),
_("Toggle the boolean value of global variable _PARAM0_"), _("Toggle the boolean value of global variable _PARAM0_"),
_("Variables/Global variables"), _("Global variables"),
"res/conditions/var24.png", "res/conditions/var24.png",
"res/conditions/var.png") "res/conditions/var.png")
.AddParameter("globalvar", _("Variable")); .AddParameter("globalvar", _("Variable"));
@@ -245,7 +247,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
_("Remove a child"), _("Remove a child"),
_("Remove a child from a scene variable."), _("Remove a child from a scene variable."),
_("Remove child _PARAM1_ from scene variable _PARAM0_"), _("Remove child _PARAM1_ from scene variable _PARAM0_"),
_("Variables/Scene variables/Collections/Structures"), _("Scene variables/Collections/Structures"),
"res/actions/var24.png", "res/actions/var24.png",
"res/actions/var.png") "res/actions/var.png")
.AddParameter("scenevar", _("Variable")) .AddParameter("scenevar", _("Variable"))
@@ -257,7 +259,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
_("Remove a child"), _("Remove a child"),
_("Remove a child from a global variable."), _("Remove a child from a global variable."),
_("Remove child _PARAM1_ from global variable _PARAM0_"), _("Remove child _PARAM1_ from global variable _PARAM0_"),
_("Variables/Global variables/Collections/Structures"), _("Global variables/Collections/Structures"),
"res/actions/var24.png", "res/actions/var24.png",
"res/actions/var.png") "res/actions/var.png")
.AddParameter("globalvar", _("Variable")) .AddParameter("globalvar", _("Variable"))
@@ -269,7 +271,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
_("Clear scene variable"), _("Clear scene variable"),
_("Remove all the children from the scene variable."), _("Remove all the children from the scene variable."),
_("Clear children from scene variable _PARAM0_"), _("Clear children from scene variable _PARAM0_"),
_("Variables/Scene variables/Collections"), _("Scene variables/Collections"),
"res/actions/var24.png", "res/actions/var24.png",
"res/actions/var.png") "res/actions/var.png")
.AddParameter("scenevar", _("Variable")) .AddParameter("scenevar", _("Variable"))
@@ -280,7 +282,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
_("Clear global variable"), _("Clear global variable"),
_("Remove all the children from the global variable."), _("Remove all the children from the global variable."),
_("Clear children from global variable _PARAM0_"), _("Clear children from global variable _PARAM0_"),
_("Variables/Global variables/Collections"), _("Global variables/Collections"),
"res/actions/var24.png", "res/actions/var24.png",
"res/actions/var.png") "res/actions/var.png")
.AddParameter("globalvar", _("Variable")) .AddParameter("globalvar", _("Variable"))
@@ -291,7 +293,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
_("Append variable to a scene array"), _("Append variable to a scene array"),
_("Appends a variable at the end of a scene array variable."), _("Appends a variable at the end of a scene array variable."),
_("Append variable _PARAM1_ to array variable _PARAM0_"), _("Append variable _PARAM1_ to array variable _PARAM0_"),
_("Variables/Scene variables/Collections/Arrays"), _("Scene variables/Collections/Arrays"),
"res/actions/var24.png", "res/actions/var24.png",
"res/actions/var.png") "res/actions/var.png")
.AddParameter("scenevar", _("Array variable")) .AddParameter("scenevar", _("Array variable"))
@@ -304,7 +306,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
_("Append a string to a scene array"), _("Append a string to a scene array"),
_("Appends a string at the end of a scene array variable."), _("Appends a string at the end of a scene array variable."),
_("Append string _PARAM1_ to array variable _PARAM0_"), _("Append string _PARAM1_ to array variable _PARAM0_"),
_("Variables/Scene variables/Collections/Arrays"), _("Scene variables/Collections/Arrays"),
"res/actions/var24.png", "res/actions/var24.png",
"res/actions/var.png") "res/actions/var.png")
.AddParameter("scenevar", _("Array variable")) .AddParameter("scenevar", _("Array variable"))
@@ -316,7 +318,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
_("Append a number to a scene array"), _("Append a number to a scene array"),
_("Appends a number at the end of a scene array variable."), _("Appends a number at the end of a scene array variable."),
_("Append number _PARAM1_ to array variable _PARAM0_"), _("Append number _PARAM1_ to array variable _PARAM0_"),
_("Variables/Scene variables/Collections/Arrays"), _("Scene variables/Collections/Arrays"),
"res/actions/var24.png", "res/actions/var24.png",
"res/actions/var.png") "res/actions/var.png")
.AddParameter("scenevar", _("Array variable")) .AddParameter("scenevar", _("Array variable"))
@@ -328,7 +330,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
_("Append a boolean to a scene array"), _("Append a boolean to a scene array"),
_("Appends a boolean at the end of a scene array variable."), _("Appends a boolean at the end of a scene array variable."),
_("Append boolean _PARAM1_ to array variable _PARAM0_"), _("Append boolean _PARAM1_ to array variable _PARAM0_"),
_("Variables/Scene variables/Collections/Arrays"), _("Scene variables/Collections/Arrays"),
"res/actions/var24.png", "res/actions/var24.png",
"res/actions/var.png") "res/actions/var.png")
.AddParameter("scenevar", _("Array variable")) .AddParameter("scenevar", _("Array variable"))
@@ -341,7 +343,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
_("Remove variable from a scene array (by index)"), _("Remove variable from a scene array (by index)"),
_("Removes a variable at the specified index of a scene array variable."), _("Removes a variable at the specified index of a scene array variable."),
_("Remove variable at index _PARAM1_ from scene array variable _PARAM0_"), _("Remove variable at index _PARAM1_ from scene array variable _PARAM0_"),
_("Variables/Scene variables/Collections/Arrays"), _("Scene variables/Collections/Arrays"),
"res/actions/var24.png", "res/actions/var24.png",
"res/actions/var.png") "res/actions/var.png")
.AddParameter("scenevar", _("Variable")) .AddParameter("scenevar", _("Variable"))
@@ -353,7 +355,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
_("Append variable to a global array"), _("Append variable to a global array"),
_("Appends a variable at the end of a global array variable."), _("Appends a variable at the end of a global array variable."),
_("Append variable _PARAM1_ to array variable _PARAM0_"), _("Append variable _PARAM1_ to array variable _PARAM0_"),
_("Variables/Global variables/Collections/Arrays"), _("Global variables/Collections/Arrays"),
"res/actions/var24.png", "res/actions/var24.png",
"res/actions/var.png") "res/actions/var.png")
.AddParameter("globalvar", _("Array variable")) .AddParameter("globalvar", _("Array variable"))
@@ -367,7 +369,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
_("Remove variable from a global array (by index)"), _("Remove variable from a global array (by index)"),
_("Removes a variable at the specified index of a global array variable."), _("Removes a variable at the specified index of a global array variable."),
_("Remove variable at index _PARAM1_ from global array variable _PARAM0_"), _("Remove variable at index _PARAM1_ from global array variable _PARAM0_"),
_("Variables/Global variables/Collections/Arrays"), _("Global variables/Collections/Arrays"),
"res/actions/var24.png", "res/actions/var24.png",
"res/actions/var.png") "res/actions/var.png")
.AddParameter("globalvar", _("Variable")) .AddParameter("globalvar", _("Variable"))
@@ -379,7 +381,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
_("Append a string to a global array"), _("Append a string to a global array"),
_("Appends a string at the end of a global array variable."), _("Appends a string at the end of a global array variable."),
_("Append string _PARAM1_ to array variable _PARAM0_"), _("Append string _PARAM1_ to array variable _PARAM0_"),
_("Variables/Global variables/Collections/Arrays"), _("Global variables/Collections/Arrays"),
"res/actions/var24.png", "res/actions/var24.png",
"res/actions/var.png") "res/actions/var.png")
.AddParameter("globalvar", _("Array variable")) .AddParameter("globalvar", _("Array variable"))
@@ -391,7 +393,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
_("Append a number to a global array"), _("Append a number to a global array"),
_("Appends a number at the end of a global array variable."), _("Appends a number at the end of a global array variable."),
_("Append number _PARAM1_ to array variable _PARAM0_"), _("Append number _PARAM1_ to array variable _PARAM0_"),
_("Variables/Global variables/Collections/Arrays"), _("Global variables/Collections/Arrays"),
"res/actions/var24.png", "res/actions/var24.png",
"res/actions/var.png") "res/actions/var.png")
.AddParameter("globalvar", _("Array variable")) .AddParameter("globalvar", _("Array variable"))
@@ -403,7 +405,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
_("Append a boolean to a global array"), _("Append a boolean to a global array"),
_("Appends a boolean at the end of a global array variable."), _("Appends a boolean at the end of a global array variable."),
_("Append boolean _PARAM1_ to array variable _PARAM0_"), _("Append boolean _PARAM1_ to array variable _PARAM0_"),
_("Variables/Global variables/Collections/Arrays"), _("Global variables/Collections/Arrays"),
"res/actions/var24.png", "res/actions/var24.png",
"res/actions/var.png") "res/actions/var.png")
.AddParameter("globalvar", _("Array variable")) .AddParameter("globalvar", _("Array variable"))
@@ -414,7 +416,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
.AddExpression("GlobalVariableChildCount", .AddExpression("GlobalVariableChildCount",
_("Number of children of a global variable"), _("Number of children of a global variable"),
_("Number of children of a global variable"), _("Number of children of a global variable"),
_("Variables/Global variables"), _("Global variables"),
"res/actions/var.png") "res/actions/var.png")
.AddParameter("globalvar", _("Variable")); .AddParameter("globalvar", _("Variable"));
@@ -422,7 +424,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
.AddExpression("VariableChildCount", .AddExpression("VariableChildCount",
_("Number of children of a scene variable"), _("Number of children of a scene variable"),
_("Number of children of a scene variable"), _("Number of children of a scene variable"),
_("Variables/Scene variables"), _("Scene variables"),
"res/actions/var.png") "res/actions/var.png")
.AddParameter("scenevar", _("Variable")); .AddParameter("scenevar", _("Variable"));
@@ -430,7 +432,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
.AddExpression("Variable", .AddExpression("Variable",
_("Value of a scene variable"), _("Value of a scene variable"),
_("Value of a scene variable"), _("Value of a scene variable"),
_("Variables/Scene variables"), _("Scene variables"),
"res/actions/var.png") "res/actions/var.png")
.AddParameter("scenevar", _("Variable")); .AddParameter("scenevar", _("Variable"));
@@ -438,7 +440,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
.AddStrExpression("VariableString", .AddStrExpression("VariableString",
_("Text of a scene variable"), _("Text of a scene variable"),
_("Text of a scene variable"), _("Text of a scene variable"),
_("Variables/Scene variables"), _("Scene variables"),
"res/actions/var.png") "res/actions/var.png")
.AddParameter("scenevar", _("Variable")); .AddParameter("scenevar", _("Variable"));
@@ -446,7 +448,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
.AddExpression("GlobalVariable", .AddExpression("GlobalVariable",
_("Value of a global variable"), _("Value of a global variable"),
_("Value of a global variable"), _("Value of a global variable"),
_("Variables/Global variables"), _("Global variables"),
"res/actions/var.png") "res/actions/var.png")
.AddParameter("globalvar", _("Name of the global variable")); .AddParameter("globalvar", _("Name of the global variable"));
@@ -454,7 +456,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
.AddStrExpression("GlobalVariableString", .AddStrExpression("GlobalVariableString",
_("Text of a global variable"), _("Text of a global variable"),
_("Text of a global variable"), _("Text of a global variable"),
_("Variables/Global variables"), _("Global variables"),
"res/actions/var.png") "res/actions/var.png")
.AddParameter("globalvar", _("Variable")); .AddParameter("globalvar", _("Variable"));
} }

View File

@@ -14,13 +14,17 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsWindowExtension(
extension extension
.SetExtensionInformation( .SetExtensionInformation(
"BuiltinWindow", "BuiltinWindow",
_("Window features"), _("Game window and resolution"),
"Provides actions and conditions to manipulate the game window. " "Provides actions and conditions to manipulate the game window. "
"Depending on the platform on which the game is running, not all of " "Depending on the platform on which the game is running, not all of "
"these features can be applied.", "these features can be applied.",
"Florian Rival", "Florian Rival",
"Open source (MIT License)") "Open source (MIT License)")
.SetExtensionHelpPath("/all-features/window"); .SetExtensionHelpPath("/all-features/window");
extension
.AddInstructionOrExpressionGroupMetadata(
_("Game window and resolution"))
.SetIcon("res/actions/window24.png");
extension extension
.AddAction( .AddAction(
@@ -28,7 +32,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsWindowExtension(
_("De/activate fullscreen"), _("De/activate fullscreen"),
_("This action activates or deactivates fullscreen."), _("This action activates or deactivates fullscreen."),
_("Activate fullscreen: _PARAM1_ (keep aspect ratio: _PARAM2_)"), _("Activate fullscreen: _PARAM1_ (keep aspect ratio: _PARAM2_)"),
_("Game's window and resolution"), "",
"res/actions/fullscreen24.png", "res/actions/fullscreen24.png",
"res/actions/fullscreen.png") "res/actions/fullscreen.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -44,7 +48,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsWindowExtension(
_("Fullscreen activated?"), _("Fullscreen activated?"),
_("Check if the game is currently in fullscreen."), _("Check if the game is currently in fullscreen."),
_("The game is in fullscreen"), _("The game is in fullscreen"),
_("Game's window and resolution"), "",
"res/actions/fullscreen24.png", "res/actions/fullscreen24.png",
"res/actions/fullscreen.png") "res/actions/fullscreen.png")
.AddCodeOnlyParameter("currentScene", ""); .AddCodeOnlyParameter("currentScene", "");
@@ -56,7 +60,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsWindowExtension(
"game frame and the window borders."), "game frame and the window borders."),
_("Set margins of game window to " _("Set margins of game window to "
"_PARAM1_;_PARAM2_;_PARAM3_;_PARAM4_"), "_PARAM1_;_PARAM2_;_PARAM3_;_PARAM4_"),
_("Game's window and resolution"), "",
"res/actions/window24.png", "res/actions/window24.png",
"res/actions/window.png") "res/actions/window.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -72,7 +76,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsWindowExtension(
"the game area size. This won't change the size of the " "the game area size. This won't change the size of the "
"window in which the game is running."), "window in which the game is running."),
_("Set game resolution to _PARAM1_x_PARAM2_"), _("Set game resolution to _PARAM1_x_PARAM2_"),
_("Game's window and resolution"), "",
"res/actions/window24.png", "res/actions/window24.png",
"res/actions/window.png") "res/actions/window.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -89,7 +93,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsWindowExtension(
"window size. Game resolution can still be updated."), "window size. Game resolution can still be updated."),
_("Set game window size to _PARAM1_x_PARAM2_ (also update game " _("Set game window size to _PARAM1_x_PARAM2_ (also update game "
"resolution: _PARAM3_)"), "resolution: _PARAM3_)"),
_("Game's window and resolution"), "",
"res/actions/window24.png", "res/actions/window24.png",
"res/actions/window.png") "res/actions/window.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -106,7 +110,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsWindowExtension(
"only works on Windows, macOS and Linux (not when the game " "only works on Windows, macOS and Linux (not when the game "
"is executed in a web-browser or on iOS/Android)."), "is executed in a web-browser or on iOS/Android)."),
_("Center the game window"), _("Center the game window"),
_("Game's window and resolution"), "",
"res/actions/window24.png", "res/actions/window24.png",
"res/actions/window.png") "res/actions/window.png")
.AddCodeOnlyParameter("currentScene", ""); .AddCodeOnlyParameter("currentScene", "");
@@ -118,7 +122,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsWindowExtension(
"should be changed to fit the game window - or if the game " "should be changed to fit the game window - or if the game "
"resolution should not be updated automatically."), "resolution should not be updated automatically."),
_("Set game resolution resize mode to _PARAM1_"), _("Set game resolution resize mode to _PARAM1_"),
_("Game's window and resolution"), "",
"res/actions/window24.png", "res/actions/window24.png",
"res/actions/window.png") "res/actions/window.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -139,7 +143,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsWindowExtension(
"be the case if the game resolution resize mode is " "be the case if the game resolution resize mode is "
"configured to adapt the width or the height of the game."), "configured to adapt the width or the height of the game."),
_("Automatically adapt the game resolution: _PARAM1_"), _("Automatically adapt the game resolution: _PARAM1_"),
_("Game's window and resolution"), "",
"res/actions/window24.png", "res/actions/window24.png",
"res/actions/window.png") "res/actions/window.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -152,7 +156,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsWindowExtension(
_("Change the window's icon"), _("Change the window's icon"),
_("This action changes the icon of the game's window."), _("This action changes the icon of the game's window."),
_("Use _PARAM1_ as the icon for the game's window."), _("Use _PARAM1_ as the icon for the game's window."),
_("Game's window and resolution"), "",
"res/actions/window24.png", "res/actions/window24.png",
"res/actions/window.png") "res/actions/window.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -163,7 +167,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsWindowExtension(
_("Change the window's title"), _("Change the window's title"),
_("This action changes the title of the game's window."), _("This action changes the title of the game's window."),
_("Change window title to _PARAM1_"), _("Change window title to _PARAM1_"),
_("Game's window and resolution"), "",
"res/actions/window24.png", "res/actions/window24.png",
"res/actions/window.png") "res/actions/window.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
@@ -174,7 +178,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsWindowExtension(
"SceneWindowWidth", "SceneWindowWidth",
_("Width of the scene window"), _("Width of the scene window"),
_("Width of the scene window (or scene canvas for HTML5 games)"), _("Width of the scene window (or scene canvas for HTML5 games)"),
_("Screen"), "",
"res/window.png") "res/window.png")
.AddCodeOnlyParameter("currentScene", ""); .AddCodeOnlyParameter("currentScene", "");
@@ -183,7 +187,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsWindowExtension(
"SceneWindowHeight", "SceneWindowHeight",
_("Height of the scene window"), _("Height of the scene window"),
_("Height of the scene window (or scene canvas for HTML5 games)"), _("Height of the scene window (or scene canvas for HTML5 games)"),
_("Screen"), "",
"res/window.png") "res/window.png")
.AddCodeOnlyParameter("currentScene", ""); .AddCodeOnlyParameter("currentScene", "");
@@ -191,27 +195,27 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsWindowExtension(
"ScreenWidth", "ScreenWidth",
_("Width of the screen/page"), _("Width of the screen/page"),
_("Width of the screen (or the page for HTML5 games in browser)"), _("Width of the screen (or the page for HTML5 games in browser)"),
_("Screen"), "",
"res/display16.png"); "res/display16.png");
extension.AddExpression( extension.AddExpression(
"ScreenHeight", "ScreenHeight",
_("Height of the screen/page"), _("Height of the screen/page"),
_("Height of the screen (or the page for HTML5 games in browser)"), _("Height of the screen (or the page for HTML5 games in browser)"),
_("Screen"), "",
"res/display16.png"); "res/display16.png");
extension.AddExpression("ColorDepth", extension.AddExpression("ColorDepth",
_("Color depth"), _("Color depth"),
_("Color depth"), _("Color depth"),
_("Screen"), "",
"res/display16.png"); "res/display16.png");
extension extension
.AddStrExpression("WindowTitle", .AddStrExpression("WindowTitle",
_("Window's title"), _("Window's title"),
_("Window's title"), _("Window's title"),
_("Screen"), "",
"res/window.png") "res/window.png")
.AddCodeOnlyParameter("currentScene", ""); .AddCodeOnlyParameter("currentScene", "");
} }

View File

@@ -234,6 +234,40 @@ BehaviorMetadata::AddExpressionAndConditionAndAction(
const gd::String& sentenceName, const gd::String& sentenceName,
const gd::String& group, const gd::String& group,
const gd::String& icon) { const gd::String& icon) {
if (type != "number" && type != "string" && type != "boolean") {
gd::LogError(
"Unrecognised type passed to AddExpressionAndConditionAndAction: " +
type + ". Verify this type is valid and supported.");
}
gd::String conditionDescriptionTemplate =
type == "boolean" ? _("Check if <subject>.") : _("Compare <subject>.");
auto& condition =
AddScopedCondition(name,
fullname,
conditionDescriptionTemplate.FindAndReplace(
"<subject>", descriptionSubject),
sentenceName,
group,
icon,
icon);
gd::String actionDescriptionTemplate = type == "boolean"
? _("Set (or unset) if <subject>.")
: _("Change <subject>.");
auto& action = AddScopedAction(
"Set" + name,
fullname,
actionDescriptionTemplate.FindAndReplace("<subject>", descriptionSubject),
sentenceName,
group,
icon,
icon);
if (type == "boolean") {
return MultipleInstructionMetadata::WithConditionAndAction(condition, action);
}
gd::String expressionDescriptionTemplate = _("Return <subject>."); gd::String expressionDescriptionTemplate = _("Return <subject>.");
auto& expression = auto& expression =
type == "number" type == "number"
@@ -250,27 +284,6 @@ BehaviorMetadata::AddExpressionAndConditionAndAction(
group, group,
icon); icon);
gd::String conditionDescriptionTemplate = _("Compare <subject>.");
auto& condition =
AddScopedCondition(name,
fullname,
conditionDescriptionTemplate.FindAndReplace(
"<subject>", descriptionSubject),
sentenceName,
group,
icon,
icon);
gd::String actionDescriptionTemplate = _("Change <subject>.");
auto& action = AddScopedAction(
"Set" + name,
fullname,
actionDescriptionTemplate.FindAndReplace("<subject>", descriptionSubject),
sentenceName,
group,
icon,
icon);
return MultipleInstructionMetadata::WithExpressionAndConditionAndAction( return MultipleInstructionMetadata::WithExpressionAndConditionAndAction(
expression, condition, action); expression, condition, action);
} }

View File

@@ -250,6 +250,27 @@ class GD_CORE_API BehaviorMetadata {
return sharedDatasInstance.get(); return sharedDatasInstance.get();
} }
/**
* \brief Return a reference to a map containing the names of the actions
* (as keys) and the metadata associated with (as values).
*/
std::map<gd::String, gd::InstructionMetadata>& GetAllActions() { return actionsInfos; };
/**
* \see gd::PlatformExtension::GetAllActions
*/
std::map<gd::String, gd::InstructionMetadata>& GetAllConditions() { return conditionsInfos; };
/**
* \see gd::PlatformExtension::GetAllActions
*/
std::map<gd::String, gd::ExpressionMetadata>& GetAllExpressions() { return expressionsInfos; };
/**
* \see gd::PlatformExtension::GetAllActions
*/
std::map<gd::String, gd::ExpressionMetadata>& GetAllStrExpressions() { return strExpressionsInfos; };
#if defined(GD_IDE_ONLY) #if defined(GD_IDE_ONLY)
std::map<gd::String, gd::InstructionMetadata> conditionsInfos; std::map<gd::String, gd::InstructionMetadata> conditionsInfos;
std::map<gd::String, gd::InstructionMetadata> actionsInfos; std::map<gd::String, gd::InstructionMetadata> actionsInfos;

View File

@@ -72,4 +72,11 @@ gd::ExpressionMetadata& ExpressionMetadata::AddCodeOnlyParameter(
return *this; return *this;
} }
gd::ExpressionMetadata& ExpressionMetadata::SetRequiresBaseObjectCapability(
const gd::String& capability) {
requiredBaseObjectCapability = capability;
return *this;
}
} // namespace gd } // namespace gd

View File

@@ -222,6 +222,23 @@ class GD_CORE_API ExpressionMetadata {
return *this; return *this;
}; };
/**
* \brief Mark this (object) expression as requiring the specified capability,
* offered by the base object.
* This is useful for some objects that don't support this capability, so that
* the editor can hide the expression as it does not apply to them.
*/
ExpressionMetadata& SetRequiresBaseObjectCapability(
const gd::String& capability);
/**
* \brief Get the required specified capability for this (object) expression,
* or an empty string if there is nothing specific required.
*/
const gd::String& GetRequiredBaseObjectCapability() const {
return requiredBaseObjectCapability;
};
/** /**
* \brief Set the function that should be called when generating the source * \brief Set the function that should be called when generating the source
* code from events. * code from events.
@@ -273,6 +290,7 @@ class GD_CORE_API ExpressionMetadata {
gd::String smallIconFilename; gd::String smallIconFilename;
gd::String extensionNamespace; gd::String extensionNamespace;
bool isPrivate; bool isPrivate;
gd::String requiredBaseObjectCapability;
}; };
} // namespace gd } // namespace gd

View File

@@ -10,6 +10,7 @@
#include "GDCore/CommonTools.h" #include "GDCore/CommonTools.h"
#include "GDCore/Serialization/SerializerElement.h" #include "GDCore/Serialization/SerializerElement.h"
#include "GDCore/Tools/Localization.h" #include "GDCore/Tools/Localization.h"
#include "GDCore/Tools/Log.h"
#include "ParameterMetadata.h" #include "ParameterMetadata.h"
namespace gd { namespace gd {
@@ -66,8 +67,9 @@ InstructionMetadata& InstructionMetadata::AddParameter(
? (supplementaryInformation.empty() ? (supplementaryInformation.empty()
? "" ? ""
: extensionNamespace + : extensionNamespace +
supplementaryInformation //... so prefix it with the extension supplementaryInformation //... so prefix it with the
// namespace. // extension
// namespace.
) )
: supplementaryInformation; // Otherwise don't change anything : supplementaryInformation; // Otherwise don't change anything
@@ -93,32 +95,55 @@ InstructionMetadata& InstructionMetadata::UseStandardOperatorParameters(
const gd::String& type) { const gd::String& type) {
SetManipulatedType(type); SetManipulatedType(type);
AddParameter("operator", _("Modification's sign"), type); if (type == "boolean") {
AddParameter(type == "number" ? "expression" : type, _("Value")); AddParameter("yesorno", _("New value"));
size_t operatorParamIndex = parameters.size() - 2; size_t valueParamIndex = parameters.size() - 1;
size_t valueParamIndex = parameters.size() - 1;
if (isObjectInstruction || isBehaviorInstruction) { if (isObjectInstruction || isBehaviorInstruction) {
gd::String templateSentence = gd::String templateSentence = _("Set _PARAM0_ as <subject>: <value>");
_("Change <subject> of _PARAM0_: <operator> <value>");
sentence = sentence =
templateSentence.FindAndReplace("<subject>", sentence) templateSentence
.FindAndReplace( .FindAndReplace("<subject>", sentence)
"<operator>", .FindAndReplace("<value>",
"_PARAM" + gd::String::From(operatorParamIndex) + "_") "_PARAM" + gd::String::From(valueParamIndex) + "_");
.FindAndReplace("<value>", } else {
"_PARAM" + gd::String::From(valueParamIndex) + "_"); gd::String templateSentence = _("Change <subject>: <value>");
sentence =
templateSentence
.FindAndReplace("<subject>", sentence)
.FindAndReplace("<value>",
"_PARAM" + gd::String::From(valueParamIndex) + "_");
}
} else { } else {
gd::String templateSentence = _("Change <subject>: <operator> <value>"); AddParameter("operator", _("Modification's sign"), type);
AddParameter(type == "number" ? "expression" : type, _("Value"));
sentence = size_t operatorParamIndex = parameters.size() - 2;
templateSentence.FindAndReplace("<subject>", sentence) size_t valueParamIndex = parameters.size() - 1;
.FindAndReplace(
"<operator>", if (isObjectInstruction || isBehaviorInstruction) {
"_PARAM" + gd::String::From(operatorParamIndex) + "_") gd::String templateSentence = _("Change <subject> of _PARAM0_: <operator> <value>");
.FindAndReplace("<value>",
"_PARAM" + gd::String::From(valueParamIndex) + "_"); sentence =
templateSentence.FindAndReplace("<subject>", sentence)
.FindAndReplace(
"<operator>",
"_PARAM" + gd::String::From(operatorParamIndex) + "_")
.FindAndReplace("<value>",
"_PARAM" + gd::String::From(valueParamIndex) + "_");
} else {
gd::String templateSentence = _("Change <subject>: <operator> <value>");
sentence =
templateSentence.FindAndReplace("<subject>", sentence)
.FindAndReplace(
"<operator>",
"_PARAM" + gd::String::From(operatorParamIndex) + "_")
.FindAndReplace("<value>",
"_PARAM" + gd::String::From(valueParamIndex) + "_");
}
} }
return *this; return *this;
@@ -129,34 +154,62 @@ InstructionMetadata::UseStandardRelationalOperatorParameters(
const gd::String& type) { const gd::String& type) {
SetManipulatedType(type); SetManipulatedType(type);
AddParameter("relationalOperator", _("Sign of the test"), type); if (type == "boolean") {
AddParameter(type == "number" ? "expression" : type, _("Value to compare")); if (isObjectInstruction || isBehaviorInstruction) {
size_t operatorParamIndex = parameters.size() - 2; gd::String templateSentence = _("_PARAM0_ is <subject>");
size_t valueParamIndex = parameters.size() - 1;
if (isObjectInstruction || isBehaviorInstruction) { sentence =
gd::String templateSentence = _("<subject> of _PARAM0_ <operator> <value>"); templateSentence
.FindAndReplace("<subject>", sentence);
} else {
gd::String templateSentence = _("<subject>");
sentence = sentence =
templateSentence.FindAndReplace("<subject>", sentence) templateSentence.FindAndReplace("<subject>", sentence);
.FindAndReplace( }
"<operator>",
"_PARAM" + gd::String::From(operatorParamIndex) + "_")
.FindAndReplace("<value>",
"_PARAM" + gd::String::From(valueParamIndex) + "_");
} else { } else {
gd::String templateSentence = _("<subject> <operator> <value>"); AddParameter("relationalOperator", _("Sign of the test"), type);
AddParameter(type == "number" ? "expression" : type, _("Value to compare"));
size_t operatorParamIndex = parameters.size() - 2;
size_t valueParamIndex = parameters.size() - 1;
sentence = if (isObjectInstruction || isBehaviorInstruction) {
templateSentence.FindAndReplace("<subject>", sentence) gd::String templateSentence = _("<subject> of _PARAM0_ <operator> <value>");
.FindAndReplace(
"<operator>", sentence =
"_PARAM" + gd::String::From(operatorParamIndex) + "_") templateSentence.FindAndReplace("<subject>", sentence)
.FindAndReplace("<value>", .FindAndReplace(
"_PARAM" + gd::String::From(valueParamIndex) + "_"); "<operator>",
"_PARAM" + gd::String::From(operatorParamIndex) + "_")
.FindAndReplace("<value>",
"_PARAM" + gd::String::From(valueParamIndex) + "_");
} else {
gd::String templateSentence = _("<subject> <operator> <value>");
sentence =
templateSentence.FindAndReplace("<subject>", sentence)
.FindAndReplace(
"<operator>",
"_PARAM" + gd::String::From(operatorParamIndex) + "_")
.FindAndReplace("<value>",
"_PARAM" + gd::String::From(valueParamIndex) + "_");
}
} }
return *this; return *this;
} }
InstructionMetadata& InstructionMetadata::SetRequiresBaseObjectCapability(
const gd::String& capability) {
if (!IsObjectInstruction() && !IsBehaviorInstruction()) {
gd::LogError("Tried to add capability \"" + capability +
"\" to instruction named \"" + fullname +
"\", which is not an object or behavior instruction.");
return *this;
}
requiredBaseObjectCapability = capability;
return *this;
}
} // namespace gd } // namespace gd

View File

@@ -138,18 +138,19 @@ class GD_CORE_API InstructionMetadata {
* \param description Description for parameter * \param description Description for parameter
* \param supplementaryInformation Additional information that can be used for * \param supplementaryInformation Additional information that can be used for
* rendering or logic. For example: * rendering or logic. For example:
* - If type is "object", this argument will describe which objects are allowed. * - If type is "object", this argument will describe which objects are
* If this argument is empty, all objects are allowed. * allowed. If this argument is empty, all objects are allowed.
* - If type is "operator", this argument will be used to display only pertinent operators. * - If type is "operator", this argument will be used to display only
* \param parameterIsOptional true if the parameter must be optional, false * pertinent operators. \param parameterIsOptional true if the parameter must
* otherwise. * be optional, false otherwise.
* *
* \see EventsCodeGenerator::GenerateParametersCodes * \see EventsCodeGenerator::GenerateParametersCodes
*/ */
InstructionMetadata &AddParameter(const gd::String &type, InstructionMetadata &AddParameter(
const gd::String &label, const gd::String &type,
const gd::String &supplementaryInformation = "", const gd::String &label,
bool parameterIsOptional = false); const gd::String &supplementaryInformation = "",
bool parameterIsOptional = false);
/** /**
* \brief Add a parameter not displayed in editor. * \brief Add a parameter not displayed in editor.
@@ -197,8 +198,7 @@ class GD_CORE_API InstructionMetadata {
* \see AddParameter * \see AddParameter
*/ */
InstructionMetadata &SetParameterExtraInfo(const gd::String &extraInfo) { InstructionMetadata &SetParameterExtraInfo(const gd::String &extraInfo) {
if (!parameters.empty()) if (!parameters.empty()) parameters.back().SetExtraInfo(extraInfo);
parameters.back().SetExtraInfo(extraInfo);
return *this; return *this;
}; };
@@ -236,16 +236,29 @@ class GD_CORE_API InstructionMetadata {
/** /**
* \brief Check if the instruction is an object instruction. * \brief Check if the instruction is an object instruction.
*/ */
bool IsObjectInstruction() const { bool IsObjectInstruction() const { return isObjectInstruction; }
return isObjectInstruction;
}
/** /**
* \brief Check if the instruction is a behavior instruction. * \brief Check if the instruction is a behavior instruction.
*/ */
bool IsBehaviorInstruction() const { bool IsBehaviorInstruction() const { return isBehaviorInstruction; }
return isBehaviorInstruction;
} /**
* \brief Mark this (object) instruction as requiring the specified
* capability, offered by the base object. This is useful for some objects
* that don't support this capability, so that the editor can hide the
* instruction as it does not apply to them.
*/
InstructionMetadata &SetRequiresBaseObjectCapability(
const gd::String &capability);
/**
* \brief Get the required specified capability for this (object) instruction,
* or an empty string if there is nothing specific required.
*/
const gd::String &GetRequiredBaseObjectCapability() const {
return requiredBaseObjectCapability;
};
/** /**
* \brief Consider that the instruction is easy for a user to understand. * \brief Consider that the instruction is easy for a user to understand.
@@ -450,6 +463,7 @@ class GD_CORE_API InstructionMetadata {
bool isPrivate; bool isPrivate;
bool isObjectInstruction; bool isObjectInstruction;
bool isBehaviorInstruction; bool isBehaviorInstruction;
gd::String requiredBaseObjectCapability;
}; };
} // namespace gd } // namespace gd

View File

@@ -0,0 +1,31 @@
/*
* GDevelop Core
* Copyright 2008-2022 Florian Rival (Florian.Rival@gmail.com). All rights
* reserved. This project is released under the MIT License.
*/
#pragma once
#include "GDCore/String.h"
namespace gd {
/**
* \brief Contains information about how to display a group of instructions
* to the user.
*/
class GD_CORE_API InstructionOrExpressionGroupMetadata {
public:
InstructionOrExpressionGroupMetadata(){};
/**
* \brief Sets the icon shown to users.
*/
InstructionOrExpressionGroupMetadata& SetIcon(const gd::String& icon_) {
icon = icon_;
return *this;
};
const gd::String& GetIcon() const { return icon; };
private:
gd::String icon;
};
} // namespace gd

View File

@@ -31,6 +31,11 @@ class GD_CORE_API MultipleInstructionMetadata {
gd::InstructionMetadata &action) { gd::InstructionMetadata &action) {
return MultipleInstructionMetadata(expression, condition, action); return MultipleInstructionMetadata(expression, condition, action);
} }
static MultipleInstructionMetadata WithConditionAndAction(
gd::InstructionMetadata &condition,
gd::InstructionMetadata &action) {
return MultipleInstructionMetadata(condition, action);
}
/** /**
* \see gd::InstructionMetadata::AddParameter * \see gd::InstructionMetadata::AddParameter
@@ -96,6 +101,17 @@ class GD_CORE_API MultipleInstructionMetadata {
return *this; return *this;
}; };
/**
* \see gd::InstructionMetadata::SetRequiresBaseObjectCapability
*/
MultipleInstructionMetadata &SetRequiresBaseObjectCapability(
const gd::String &capability) {
if (expression) expression->SetRequiresBaseObjectCapability(capability);
if (condition) condition->SetRequiresBaseObjectCapability(capability);
if (action) action->SetRequiresBaseObjectCapability(capability);
return *this;
}
/** /**
* \see gd::InstructionMetadata::UseStandardOperatorParameters * \see gd::InstructionMetadata::UseStandardOperatorParameters
* \see gd::InstructionMetadata::UseStandardRelationalOperatorParameters * \see gd::InstructionMetadata::UseStandardRelationalOperatorParameters
@@ -179,6 +195,9 @@ class GD_CORE_API MultipleInstructionMetadata {
gd::InstructionMetadata &condition_, gd::InstructionMetadata &condition_,
gd::InstructionMetadata &action_) gd::InstructionMetadata &action_)
: expression(&expression_), condition(&condition_), action(&action_){}; : expression(&expression_), condition(&condition_), action(&action_){};
MultipleInstructionMetadata(gd::InstructionMetadata &condition_,
gd::InstructionMetadata &action_)
: expression(nullptr), condition(&condition_), action(&action_){};
gd::ExpressionMetadata *expression; gd::ExpressionMetadata *expression;
gd::InstructionMetadata *condition; gd::InstructionMetadata *condition;

View File

@@ -261,23 +261,14 @@ ObjectMetadata::AddExpressionAndConditionAndAction(
const gd::String& sentenceName, const gd::String& sentenceName,
const gd::String& group, const gd::String& group,
const gd::String& icon) { const gd::String& icon) {
gd::String expressionDescriptionTemplate = _("Return <subject>."); if (type != "number" && type != "string" && type != "boolean") {
auto& expression = gd::LogError(
type == "number" "Unrecognised type passed to AddExpressionAndConditionAndAction: " +
? AddExpression(name, type + ". Verify this type is valid and supported.");
fullname, }
expressionDescriptionTemplate.FindAndReplace(
"<subject>", descriptionSubject),
group,
icon)
: AddStrExpression(name,
fullname,
expressionDescriptionTemplate.FindAndReplace(
"<subject>", descriptionSubject),
group,
icon);
gd::String conditionDescriptionTemplate = _("Compare <subject>."); gd::String conditionDescriptionTemplate =
type == "boolean" ? _("Check if <subject>.") : _("Compare <subject>.");
auto& condition = auto& condition =
AddScopedCondition(name, AddScopedCondition(name,
fullname, fullname,
@@ -288,7 +279,9 @@ ObjectMetadata::AddExpressionAndConditionAndAction(
icon, icon,
icon); icon);
gd::String actionDescriptionTemplate = _("Change <subject>."); gd::String actionDescriptionTemplate = type == "boolean"
? _("Set (or unset) if <subject>.")
: _("Change <subject>.");
auto& action = AddScopedAction( auto& action = AddScopedAction(
"Set" + name, "Set" + name,
fullname, fullname,
@@ -298,6 +291,27 @@ ObjectMetadata::AddExpressionAndConditionAndAction(
icon, icon,
icon); icon);
if (type == "boolean") {
return MultipleInstructionMetadata::WithConditionAndAction(condition, action);
}
gd::String expressionDescriptionTemplate = _("Return <subject>.");
auto& expression =
type == "number"
? AddExpression(name,
fullname,
expressionDescriptionTemplate.FindAndReplace(
"<subject>", descriptionSubject),
group,
icon)
: AddStrExpression(name,
fullname,
expressionDescriptionTemplate.FindAndReplace(
"<subject>", descriptionSubject),
group,
icon);
return MultipleInstructionMetadata::WithExpressionAndConditionAndAction( return MultipleInstructionMetadata::WithExpressionAndConditionAndAction(
expression, condition, action); expression, condition, action);
} }

View File

@@ -7,6 +7,7 @@
#define OBJECTMETADATA_H #define OBJECTMETADATA_H
#include <functional> #include <functional>
#include <map> #include <map>
#include <set>
#include <memory> #include <memory>
#include "GDCore/Extensions/Metadata/ExpressionMetadata.h" #include "GDCore/Extensions/Metadata/ExpressionMetadata.h"
@@ -200,13 +201,48 @@ class GD_CORE_API ObjectMetadata {
return *this; return *this;
} }
/**
* \brief Set the (user friendly) name of the group this object must
* be categorised in.
*/
ObjectMetadata& SetCategoryFullName(const gd::String& categoryFullName_) {
categoryFullName = categoryFullName_;
return *this;
}
/**
* \brief The "capabilities" that are offered by the base object that are
* *not* supported by this object, and should be hidden in the editor
* inferface.
*/
const std::set<gd::String>& GetUnsupportedBaseObjectCapabilities() const {
return unsupportedBaseObjectCapabilities;
}
/**
* \brief Add a "capability" that is offered by the base object that is *not*
* supported by this object, and should be hidden in the editor inferface.
*/
ObjectMetadata& AddUnsupportedBaseObjectCapability(
const gd::String& capability) {
unsupportedBaseObjectCapabilities.insert(capability);
return *this;
}
/**
* \brief Check if a "capability" that is offered by the base object is *not*
* supported by this object, and should be hidden in the editor inferface.
*/
bool IsUnsupportedBaseObjectCapability(const gd::String& capability) const {
return unsupportedBaseObjectCapabilities.find(capability) != unsupportedBaseObjectCapabilities.end();
}
const gd::String& GetName() const { return name; } const gd::String& GetName() const { return name; }
#if defined(GD_IDE_ONLY)
const gd::String& GetFullName() const { return fullname; } const gd::String& GetFullName() const { return fullname; }
const gd::String& GetCategoryFullName() const { return categoryFullName; }
const gd::String& GetHelpUrl() const { return helpUrl; } const gd::String& GetHelpUrl() const { return helpUrl; }
const gd::String& GetDescription() const { return description; } const gd::String& GetDescription() const { return description; }
const gd::String& GetIconFilename() const { return iconFilename; } const gd::String& GetIconFilename() const { return iconFilename; }
#endif
/** /**
* \brief Set the URL pointing to the help page about this object * \brief Set the URL pointing to the help page about this object
@@ -227,7 +263,27 @@ class GD_CORE_API ObjectMetadata {
*/ */
ObjectMetadata& AddIncludeFile(const gd::String& includeFile); ObjectMetadata& AddIncludeFile(const gd::String& includeFile);
#if defined(GD_IDE_ONLY) /**
* \brief Return a reference to a map containing the names of the actions
* (as keys) and the metadata associated with (as values).
*/
std::map<gd::String, gd::InstructionMetadata>& GetAllActions() { return actionsInfos; };
/**
* \see gd::PlatformExtension::GetAllActions
*/
std::map<gd::String, gd::InstructionMetadata>& GetAllConditions() { return conditionsInfos; };
/**
* \see gd::PlatformExtension::GetAllActions
*/
std::map<gd::String, gd::ExpressionMetadata>& GetAllExpressions() { return expressionsInfos; };
/**
* \see gd::PlatformExtension::GetAllActions
*/
std::map<gd::String, gd::ExpressionMetadata>& GetAllStrExpressions() { return strExpressionsInfos; };
std::map<gd::String, gd::InstructionMetadata> conditionsInfos; std::map<gd::String, gd::InstructionMetadata> conditionsInfos;
std::map<gd::String, gd::InstructionMetadata> actionsInfos; std::map<gd::String, gd::InstructionMetadata> actionsInfos;
std::map<gd::String, gd::ExpressionMetadata> expressionsInfos; std::map<gd::String, gd::ExpressionMetadata> expressionsInfos;
@@ -235,19 +291,19 @@ class GD_CORE_API ObjectMetadata {
std::vector<gd::String> includeFiles; std::vector<gd::String> includeFiles;
gd::String className; gd::String className;
#endif
CreateFunPtr createFunPtr; CreateFunPtr createFunPtr;
private: private:
gd::String extensionNamespace; gd::String extensionNamespace;
gd::String name; gd::String name;
gd::String helpPath; gd::String helpPath;
#if defined(GD_IDE_ONLY)
gd::String helpUrl; ///< Deprecated. Use helpPath instead. gd::String helpUrl; ///< Deprecated. Use helpPath instead.
gd::String fullname; gd::String fullname;
gd::String description; gd::String description;
gd::String iconFilename; gd::String iconFilename;
#endif gd::String categoryFullName;
std::set<gd::String> unsupportedBaseObjectCapabilities;
std::shared_ptr<gd::Object> std::shared_ptr<gd::Object>
blueprintObject; ///< The "blueprint" object to be copied when a new blueprintObject; ///< The "blueprint" object to be copied when a new
///< object is asked. Can be null in case a creation ///< object is asked. Can be null in case a creation

View File

@@ -195,7 +195,8 @@ class GD_CORE_API ParameterMetadata {
parameterType == "objectEffectParameterName" || parameterType == "objectEffectParameterName" ||
parameterType == "objectPointName" || parameterType == "objectPointName" ||
parameterType == "objectAnimationName" || parameterType == "objectAnimationName" ||
parameterType == "functionParameterName"; parameterType == "functionParameterName" ||
parameterType == "externalLayoutName";
} else if (type == "variable") { } else if (type == "variable") {
return parameterType == "objectvar" || parameterType == "globalvar" || return parameterType == "objectvar" || parameterType == "globalvar" ||
parameterType == "scenevar"; parameterType == "scenevar";

View File

@@ -4,6 +4,7 @@
* reserved. This project is released under the MIT License. * reserved. This project is released under the MIT License.
*/ */
#include "Platform.h" #include "Platform.h"
#include "GDCore/Extensions/PlatformExtension.h" #include "GDCore/Extensions/PlatformExtension.h"
#include "GDCore/Project/Object.h" #include "GDCore/Project/Object.h"
#include "GDCore/String.h" #include "GDCore/String.h"
@@ -14,16 +15,21 @@ using namespace std;
namespace gd { namespace gd {
Platform::Platform(): enableExtensionLoadingLogs(false) {} InstructionOrExpressionGroupMetadata
Platform::badInstructionOrExpressionGroupMetadata;
Platform::Platform() : enableExtensionLoadingLogs(false) {}
Platform::~Platform() {} Platform::~Platform() {}
bool Platform::AddExtension(std::shared_ptr<gd::PlatformExtension> extension) { bool Platform::AddExtension(std::shared_ptr<gd::PlatformExtension> extension) {
if (!extension) return false; if (!extension) return false;
if (enableExtensionLoadingLogs) std::cout << "Loading " << extension->GetName() << "..."; if (enableExtensionLoadingLogs)
std::cout << "Loading " << extension->GetName() << "...";
if (IsExtensionLoaded(extension->GetName())) { if (IsExtensionLoaded(extension->GetName())) {
if (enableExtensionLoadingLogs) std::cout << " (replacing existing extension)"; if (enableExtensionLoadingLogs)
std::cout << " (replacing existing extension)";
RemoveExtension(extension->GetName()); RemoveExtension(extension->GetName());
} }
if (enableExtensionLoadingLogs) std::cout << std::endl; if (enableExtensionLoadingLogs) std::cout << std::endl;
@@ -38,6 +44,11 @@ bool Platform::AddExtension(std::shared_ptr<gd::PlatformExtension> extension) {
extension->GetObjectCreationFunctionPtr(objectsTypes[i]); extension->GetObjectCreationFunctionPtr(objectsTypes[i]);
} }
for (const auto& it :
extension->GetAllInstructionOrExpressionGroupMetadata()) {
instructionOrExpressionGroupMetadata[it.first] = it.second;
}
return true; return true;
} }

View File

@@ -9,8 +9,9 @@
#include <map> #include <map>
#include <memory> #include <memory>
#include <vector> #include <vector>
#include "GDCore/String.h"
#include "GDCore/Extensions/Metadata/InstructionOrExpressionGroupMetadata.h"
#include "GDCore/String.h"
namespace gd { namespace gd {
class InstructionsMetadataHolder; class InstructionsMetadataHolder;
class Project; class Project;
@@ -52,7 +53,6 @@ class GD_CORE_API Platform {
*/ */
virtual gd::String GetFullName() const { return "Unnamed platform"; } virtual gd::String GetFullName() const { return "Unnamed platform"; }
#if defined(GD_IDE_ONLY)
/** /**
* \brief Must return a text describing the platform in a few words. * \brief Must return a text describing the platform in a few words.
*/ */
@@ -67,7 +67,6 @@ class GD_CORE_API Platform {
* \brief Must return a filename to a 32*32 image file for the platform. * \brief Must return a filename to a 32*32 image file for the platform.
*/ */
virtual gd::String GetIcon() const { return ""; } virtual gd::String GetIcon() const { return ""; }
#endif
/** \name Extensions management /** \name Extensions management
* Member functions used to manage the extensions * Member functions used to manage the extensions
@@ -123,6 +122,19 @@ class GD_CORE_API Platform {
* anymore. * anymore.
*/ */
virtual void RemoveExtension(const gd::String& name); virtual void RemoveExtension(const gd::String& name);
/**
* \brief Get the metadata (icon, etc...) of a group used for instructions or
* expressions.
*/
const InstructionOrExpressionGroupMetadata& GetInstructionOrExpressionGroupMetadata(
const gd::String& name) const {
auto it = instructionOrExpressionGroupMetadata.find(name);
if (it == instructionOrExpressionGroupMetadata.end())
return badInstructionOrExpressionGroupMetadata;
return it->second;
}
///@} ///@}
/** \name Factory method /** \name Factory method
@@ -137,7 +149,6 @@ class GD_CORE_API Platform {
std::unique_ptr<gd::Object> CreateObject(gd::String type, std::unique_ptr<gd::Object> CreateObject(gd::String type,
const gd::String& name) const; const gd::String& name) const;
#if defined(GD_IDE_ONLY)
/** /**
* \brief Create an event of given type * \brief Create an event of given type
*/ */
@@ -149,28 +160,18 @@ class GD_CORE_API Platform {
* \brief Activate or disable the logs on the standard output when * \brief Activate or disable the logs on the standard output when
* loading an extension. * loading an extension.
*/ */
void EnableExtensionLoadingLogs(bool enable) { enableExtensionLoadingLogs = enable; }; void EnableExtensionLoadingLogs(bool enable) {
enableExtensionLoadingLogs = enable;
/** };
* \brief Called when the IDE is about to shut down: Take this opportunity for
* erasing for example any temporary file.
* @deprecated This should be removed.
*/
virtual void OnIDEClosed(){};
/**
* \brief Called when the IDE is initialized and ready to be used.
* @deprecated This should be removed.
*/
virtual void OnIDEInitialized(){};
#endif
private: private:
std::vector<std::shared_ptr<PlatformExtension>> std::vector<std::shared_ptr<PlatformExtension>>
extensionsLoaded; ///< Extensions of the platform extensionsLoaded; ///< Extensions of the platform
std::map<gd::String, CreateFunPtr> std::map<gd::String, CreateFunPtr>
creationFunctionTable; ///< Creation functions for objects creationFunctionTable; ///< Creation functions for objects
std::map<gd::String, InstructionOrExpressionGroupMetadata>
instructionOrExpressionGroupMetadata;
static InstructionOrExpressionGroupMetadata badInstructionOrExpressionGroupMetadata;
bool enableExtensionLoadingLogs; bool enableExtensionLoadingLogs;
}; };

View File

@@ -165,6 +165,40 @@ PlatformExtension::AddExpressionAndConditionAndAction(
const gd::String& sentenceName, const gd::String& sentenceName,
const gd::String& group, const gd::String& group,
const gd::String& icon) { const gd::String& icon) {
if (type != "number" && type != "string" && type != "boolean") {
gd::LogError(
"Unrecognised type passed to AddExpressionAndConditionAndAction: " +
type + ". Verify this type is valid and supported.");
}
gd::String conditionDescriptionTemplate =
type == "boolean" ? _("Check if <subject>.") : _("Compare <subject>.");
auto& condition = AddCondition(name,
fullname,
conditionDescriptionTemplate.FindAndReplace(
"<subject>", descriptionSubject),
sentenceName,
group,
icon,
icon);
gd::String actionDescriptionTemplate = type == "boolean"
? _("Set (or unset) if <subject>.")
: _("Change <subject>.");
auto& action = AddAction(
"Set" + name,
fullname,
actionDescriptionTemplate.FindAndReplace("<subject>", descriptionSubject),
sentenceName,
group,
icon,
icon);
if (type == "boolean") {
return MultipleInstructionMetadata::WithConditionAndAction(condition,
action);
}
gd::String expressionDescriptionTemplate = _("Return <subject>."); gd::String expressionDescriptionTemplate = _("Return <subject>.");
auto& expression = auto& expression =
type == "number" type == "number"
@@ -175,32 +209,11 @@ PlatformExtension::AddExpressionAndConditionAndAction(
group, group,
icon) icon)
: AddStrExpression(name, : AddStrExpression(name,
fullname, fullname,
expressionDescriptionTemplate.FindAndReplace( expressionDescriptionTemplate.FindAndReplace(
"<subject>", descriptionSubject), "<subject>", descriptionSubject),
group, group,
icon); icon);
gd::String conditionDescriptionTemplate = _("Compare <subject>.");
auto& condition = AddCondition(name,
fullname,
conditionDescriptionTemplate.FindAndReplace(
"<subject>", descriptionSubject),
sentenceName,
group,
icon,
icon);
// TODO: update the checks
gd::String actionDescriptionTemplate = _("Change <subject>.");
auto& action = AddAction(
"Set" + name,
fullname,
actionDescriptionTemplate.FindAndReplace("<subject>", descriptionSubject),
sentenceName,
group,
icon,
icon);
return MultipleInstructionMetadata::WithExpressionAndConditionAndAction( return MultipleInstructionMetadata::WithExpressionAndConditionAndAction(
expression, condition, action); expression, condition, action);
@@ -372,9 +385,13 @@ gd::InstructionMetadata& PlatformExtension::AddDuplicatedAction(
} }
gd::InstructionMetadata& PlatformExtension::AddDuplicatedCondition( gd::InstructionMetadata& PlatformExtension::AddDuplicatedCondition(
const gd::String& newConditionName, const gd::String& copiedConditionName) { const gd::String& newConditionName,
gd::String newNameWithNamespace = GetNameSpace() + newConditionName; const gd::String& copiedConditionName,
gd::String copiedNameWithNamespace = GetNameSpace() + copiedConditionName; gd::DuplicatedInstructionOptions options) {
gd::String newNameWithNamespace =
(options.unscoped ? "" : GetNameSpace()) + newConditionName;
gd::String copiedNameWithNamespace =
(options.unscoped ? "" : GetNameSpace()) + copiedConditionName;
auto copiedCondition = conditionsInfos.find(copiedNameWithNamespace); auto copiedCondition = conditionsInfos.find(copiedNameWithNamespace);
if (copiedCondition == conditionsInfos.end()) { if (copiedCondition == conditionsInfos.end()) {
@@ -512,7 +529,8 @@ PlatformExtension::GetAllStrExpressionsForBehavior(gd::String autoType) {
return badExpressionsMetadata; return badExpressionsMetadata;
} }
gd::BaseEventSPtr PlatformExtension::CreateEvent(const gd::String& eventType) const { gd::BaseEventSPtr PlatformExtension::CreateEvent(
const gd::String& eventType) const {
if (eventsInfos.find(eventType) != eventsInfos.end()) { if (eventsInfos.find(eventType) != eventsInfos.end()) {
if (eventsInfos.find(eventType)->second.instance == if (eventsInfos.find(eventType)->second.instance ==
std::shared_ptr<BaseEvent>()) { std::shared_ptr<BaseEvent>()) {
@@ -754,7 +772,8 @@ void PlatformExtension::StripUnimplementedInstructionsAndExpressions() {
} }
#endif #endif
PlatformExtension::PlatformExtension() : deprecated(false) {} PlatformExtension::PlatformExtension()
: deprecated(false), category(_("General")) {}
PlatformExtension::~PlatformExtension() {} PlatformExtension::~PlatformExtension() {}

View File

@@ -5,8 +5,7 @@
* project is released under the MIT License. * project is released under the MIT License.
*/ */
#ifndef GDCORE_PLATFORMEXTENSION_H #pragma once
#define GDCORE_PLATFORMEXTENSION_H
#include <map> #include <map>
#include <memory> #include <memory>
#include <vector> #include <vector>
@@ -16,6 +15,7 @@
#include "GDCore/Extensions/Metadata/DependencyMetadata.h" #include "GDCore/Extensions/Metadata/DependencyMetadata.h"
#include "GDCore/Extensions/Metadata/EffectMetadata.h" #include "GDCore/Extensions/Metadata/EffectMetadata.h"
#include "GDCore/Extensions/Metadata/EventMetadata.h" #include "GDCore/Extensions/Metadata/EventMetadata.h"
#include "GDCore/Extensions/Metadata/InstructionOrExpressionGroupMetadata.h"
#include "GDCore/Extensions/Metadata/ObjectMetadata.h" #include "GDCore/Extensions/Metadata/ObjectMetadata.h"
#include "GDCore/Project/PropertyDescriptor.h" #include "GDCore/Project/PropertyDescriptor.h"
#include "GDCore/String.h" #include "GDCore/String.h"
@@ -71,6 +71,10 @@ class GD_CORE_API CompilationInfo {
int sizeOfpInt; int sizeOfpInt;
}; };
struct GD_CORE_API DuplicatedInstructionOptions {
bool unscoped;
};
/** /**
* \brief Base class for implementing platform's extensions. * \brief Base class for implementing platform's extensions.
* *
@@ -105,10 +109,18 @@ class GD_CORE_API PlatformExtension {
return *this; return *this;
} }
/**
* \brief Set the category of the extension.
*/
PlatformExtension& SetCategory(const gd::String& category_) {
category = category_;
return *this;
}
/** /**
* \brief Set the path to the help, relative to the GDevelop documentation * \brief Set the path to the help, relative to the GDevelop documentation
* root. For example, "/all-features/collisions" for * root. For example, "/all-features/collisions" for
* "http://wiki.compilgames.net/doku.php/gdevelop5/all-features/collisions". * "https://wiki.gdevelop.io/gdevelop5/all-features/collisions".
* *
* The instructions, objects and behaviors will have this help path set by * The instructions, objects and behaviors will have this help path set by
* default, unless you call SetHelpPath on them. * default, unless you call SetHelpPath on them.
@@ -271,7 +283,6 @@ class GD_CORE_API PlatformExtension {
const gd::String& smallicon_, const gd::String& smallicon_,
std::shared_ptr<gd::BaseEvent> instance); std::shared_ptr<gd::BaseEvent> instance);
#if defined(GD_IDE_ONLY)
/** /**
* \brief Create a new action which is the duplicate of the specified one. * \brief Create a new action which is the duplicate of the specified one.
* *
@@ -288,7 +299,8 @@ class GD_CORE_API PlatformExtension {
*/ */
gd::InstructionMetadata& AddDuplicatedCondition( gd::InstructionMetadata& AddDuplicatedCondition(
const gd::String& newConditionName, const gd::String& newConditionName,
const gd::String& copiedConditionName); const gd::String& copiedConditionName,
gd::DuplicatedInstructionOptions options = {.unscoped = false});
/** /**
* \brief Create a new expression which is the duplicate of the specified one. * \brief Create a new expression which is the duplicate of the specified one.
* *
@@ -315,7 +327,15 @@ class GD_CORE_API PlatformExtension {
gd::PropertyDescriptor& RegisterProperty(const gd::String& name) { gd::PropertyDescriptor& RegisterProperty(const gd::String& name) {
return extensionPropertiesMetadata[name]; return extensionPropertiesMetadata[name];
}; };
#endif
/**
* \brief Add some metadata (icon, etc...) for a group used for instructions
* or expressions.
*/
InstructionOrExpressionGroupMetadata& AddInstructionOrExpressionGroupMetadata(
const gd::String& name) {
return instructionOrExpressionGroupMetadata[name];
}
/** /**
* \brief Delete all instructions having no function name or custom code * \brief Delete all instructions having no function name or custom code
@@ -339,6 +359,11 @@ class GD_CORE_API PlatformExtension {
*/ */
const gd::String& GetName() const { return name; } const gd::String& GetName() const { return name; }
/**
* \brief Return the category of the extension
*/
const gd::String& GetCategory() const { return category; }
/** /**
* \brief Return a description of the extension * \brief Return a description of the extension
*/ */
@@ -452,7 +477,6 @@ class GD_CORE_API PlatformExtension {
*/ */
std::map<gd::String, gd::EventMetadata>& GetAllEvents(); std::map<gd::String, gd::EventMetadata>& GetAllEvents();
#if defined(GD_IDE_ONLY)
/** /**
* \brief Return a reference to a map containing the names of the actions * \brief Return a reference to a map containing the names of the actions
* (as keys) and the metadata associated with (as values). * (as keys) and the metadata associated with (as values).
@@ -537,8 +561,16 @@ class GD_CORE_API PlatformExtension {
std::map<gd::String, gd::PropertyDescriptor>& GetAllProperties() { std::map<gd::String, gd::PropertyDescriptor>& GetAllProperties() {
return extensionPropertiesMetadata; return extensionPropertiesMetadata;
} }
/**
* \brief Get the metadata (icon, etc...) for groups used for instructions
* or expressions.
*/
const std::map<gd::String, InstructionOrExpressionGroupMetadata>&
GetAllInstructionOrExpressionGroupMetadata() const {
return instructionOrExpressionGroupMetadata;
}
///@} ///@}
#endif
/** /**
* \brief Return the name of all the extensions which are considered provided * \brief Return the name of all the extensions which are considered provided
@@ -566,6 +598,7 @@ class GD_CORE_API PlatformExtension {
///< actions/conditions/expressions/objects/behavior/event. ///< actions/conditions/expressions/objects/behavior/event.
gd::String fullname; ///< Name displayed to users in the editor. gd::String fullname; ///< Name displayed to users in the editor.
gd::String informations; ///< Description displayed to users in the editor. gd::String informations; ///< Description displayed to users in the editor.
gd::String category;
gd::String author; ///< Author displayed to users in the editor. gd::String author; ///< Author displayed to users in the editor.
gd::String license; ///< License name displayed to users in the editor. gd::String license; ///< License name displayed to users in the editor.
bool deprecated; ///< true if the extension is deprecated and shouldn't be bool deprecated; ///< true if the extension is deprecated and shouldn't be
@@ -577,7 +610,6 @@ class GD_CORE_API PlatformExtension {
std::map<gd::String, gd::ObjectMetadata> objectsInfos; std::map<gd::String, gd::ObjectMetadata> objectsInfos;
std::map<gd::String, gd::BehaviorMetadata> behaviorsInfo; std::map<gd::String, gd::BehaviorMetadata> behaviorsInfo;
std::map<gd::String, gd::EffectMetadata> effectsMetadata; std::map<gd::String, gd::EffectMetadata> effectsMetadata;
#if defined(GD_IDE_ONLY)
std::map<gd::String, gd::InstructionMetadata> conditionsInfos; std::map<gd::String, gd::InstructionMetadata> conditionsInfos;
std::map<gd::String, gd::InstructionMetadata> actionsInfos; std::map<gd::String, gd::InstructionMetadata> actionsInfos;
std::map<gd::String, gd::ExpressionMetadata> expressionsInfos; std::map<gd::String, gd::ExpressionMetadata> expressionsInfos;
@@ -585,12 +617,12 @@ class GD_CORE_API PlatformExtension {
std::vector<gd::DependencyMetadata> extensionDependenciesMetadata; std::vector<gd::DependencyMetadata> extensionDependenciesMetadata;
std::map<gd::String, gd::EventMetadata> eventsInfos; std::map<gd::String, gd::EventMetadata> eventsInfos;
std::map<gd::String, gd::PropertyDescriptor> extensionPropertiesMetadata; std::map<gd::String, gd::PropertyDescriptor> extensionPropertiesMetadata;
#endif std::map<gd::String, InstructionOrExpressionGroupMetadata>
instructionOrExpressionGroupMetadata;
ObjectMetadata badObjectMetadata; ObjectMetadata badObjectMetadata;
BehaviorMetadata badBehaviorMetadata; BehaviorMetadata badBehaviorMetadata;
EffectMetadata badEffectMetadata; EffectMetadata badEffectMetadata;
#if defined(GD_IDE_ONLY)
static std::map<gd::String, gd::InstructionMetadata> static std::map<gd::String, gd::InstructionMetadata>
badConditionsMetadata; ///< Used when a condition is not found in the badConditionsMetadata; ///< Used when a condition is not found in the
///< extension ///< extension
@@ -600,12 +632,10 @@ class GD_CORE_API PlatformExtension {
static std::map<gd::String, gd::ExpressionMetadata> static std::map<gd::String, gd::ExpressionMetadata>
badExpressionsMetadata; ///< Used when an expression is not found in the badExpressionsMetadata; ///< Used when an expression is not found in the
///< extension ///< extension
#endif
}; };
} // namespace gd } // namespace gd
#if defined(GD_IDE_ONLY)
/** \brief Macro used by extensions in their constructor to declare how they /** \brief Macro used by extensions in their constructor to declare how they
* have been compiled. \see gd::CompilationInfo * have been compiled. \see gd::CompilationInfo
*/ */
@@ -619,23 +649,5 @@ class GD_CORE_API PlatformExtension {
compilationInfo.gccMinorVersion = __GNUC_MINOR__; \ compilationInfo.gccMinorVersion = __GNUC_MINOR__; \
compilationInfo.gccPatchLevel = __GNUC_PATCHLEVEL__; \ compilationInfo.gccPatchLevel = __GNUC_PATCHLEVEL__; \
compilationInfo.informationCompleted = true; compilationInfo.informationCompleted = true;
#else
/** \brief Macro used by extensions in their constructor to declare how they
* have been compiled. \see gd::CompilationInfo
*/
#define GD_COMPLETE_EXTENSION_COMPILATION_INFORMATION() \
compilationInfo.runtimeOnly = true; \
compilationInfo.sfmlMajorVersion = 2; \
compilationInfo.sfmlMinorVersion = 0; \
compilationInfo.gdCoreVersion = GD_VERSION_STRING; \
compilationInfo.sizeOfpInt = sizeof(int*); \
compilationInfo.gccMajorVersion = __GNUC__; \
compilationInfo.gccMinorVersion = __GNUC_MINOR__; \
compilationInfo.gccPatchLevel = __GNUC_PATCHLEVEL__; \
compilationInfo.informationCompleted = true;
#endif
#include "GDCore/Extensions/PlatformExtension.inl" #include "GDCore/Extensions/PlatformExtension.inl"
#endif // GDCORE_PLATFORMEXTENSION_H

View File

@@ -0,0 +1,27 @@
#include "GDCore/IDE/Events/EventsPositionFinder.h"
#include <map>
#include <memory>
#include <vector>
#include "GDCore/Events/Event.h"
#include "GDCore/Events/EventsList.h"
#include "GDCore/String.h"
namespace gd {
class BaseEvent;
class EventsList;
} // namespace gd
namespace gd {
bool EventsPositionFinder::DoVisitEvent(gd::BaseEvent& event) {
auto it = std::find(searchedEvents.begin(), searchedEvents.end(), &event);
if (it != searchedEvents.end()) {
positions[it - searchedEvents.begin()] = index;
}
index++;
return false;
}
EventsPositionFinder::~EventsPositionFinder() {}
} // namespace gd

View File

@@ -0,0 +1,48 @@
#ifndef EventsPositionFinder_H
#define EventsPositionFinder_H
#include "GDCore/Events/EventsList.h"
#include "GDCore/IDE/Events/ArbitraryEventsWorker.h"
#include "GDCore/String.h"
namespace gd {
class BaseEvent;
class EventsList;
} // namespace gd
namespace gd {
/**
* \brief Scans an event list to retrieve the position of a list of searched
* events when the events list is flattened.
*
* \ingroup IDE
*/
class GD_CORE_API EventsPositionFinder : public ArbitraryEventsWorker {
public:
EventsPositionFinder() : index(0){};
virtual ~EventsPositionFinder();
/**
* Return the positions of all searched events
*/
const std::vector<std::size_t>& GetPositions() const { return positions; }
/**
* Add an event for which the position must be reported in `GetPositions`.
*/
void AddEventToSearch(gd::BaseEvent* event) {
searchedEvents.push_back(event);
positions.push_back(gd::String::npos);
}
private:
bool DoVisitEvent(gd::BaseEvent& event) override;
std::vector<gd::BaseEvent*> searchedEvents;
std::vector<std::size_t> positions;
std::size_t index;
};
} // namespace gd
#endif // EventsPositionFinder_H

View File

@@ -542,7 +542,8 @@ void EventsRefactorer::ReplaceStringInEvents(gd::ObjectsContainer& project,
gd::String newString, gd::String newString,
bool matchCase, bool matchCase,
bool inConditions, bool inConditions,
bool inActions) { bool inActions,
bool inEventStrings) {
for (std::size_t i = 0; i < events.size(); ++i) { for (std::size_t i = 0; i < events.size(); ++i) {
if (inConditions) { if (inConditions) {
vector<gd::InstructionsList*> conditionsVectors = vector<gd::InstructionsList*> conditionsVectors =
@@ -571,6 +572,11 @@ void EventsRefactorer::ReplaceStringInEvents(gd::ObjectsContainer& project,
} }
} }
if (inEventStrings) {
bool eventStringModified = ReplaceStringInEventSearchableStrings(
project, layout, events[i], toReplace, newString, matchCase);
}
if (events[i].CanHaveSubEvents()) if (events[i].CanHaveSubEvents())
ReplaceStringInEvents(project, ReplaceStringInEvents(project,
layout, layout,
@@ -579,7 +585,8 @@ void EventsRefactorer::ReplaceStringInEvents(gd::ObjectsContainer& project,
newString, newString,
matchCase, matchCase,
inConditions, inConditions,
inActions); inActions,
inEventStrings);
} }
} }
@@ -677,6 +684,29 @@ bool EventsRefactorer::ReplaceStringInConditions(
return somethingModified; return somethingModified;
} }
bool EventsRefactorer::ReplaceStringInEventSearchableStrings(
gd::ObjectsContainer& project,
gd::ObjectsContainer& layout,
gd::BaseEvent& event,
gd::String toReplace,
gd::String newString,
bool matchCase) {
vector<gd::String> newEventStrings;
vector<gd::String> stringEvent = event.GetAllSearchableStrings();
for (std::size_t sNb = 0; sNb < stringEvent.size(); ++sNb) {
gd::String newStringEvent =
matchCase ? stringEvent[sNb].FindAndReplace(toReplace, newString, true)
: ReplaceAllOccurencesCaseUnsensitive(
stringEvent[sNb], toReplace, newString);
newEventStrings.push_back(newStringEvent);
}
bool somethingModified = event.ReplaceAllSearchableStrings(newEventStrings);
return somethingModified;
}
vector<EventsSearchResult> EventsRefactorer::SearchInEvents( vector<EventsSearchResult> EventsRefactorer::SearchInEvents(
const gd::Platform& platform, const gd::Platform& platform,
gd::EventsList& events, gd::EventsList& events,

View File

@@ -117,7 +117,8 @@ class GD_CORE_API EventsRefactorer {
gd::String newString, gd::String newString,
bool matchCase, bool matchCase,
bool inConditions, bool inConditions,
bool inActions); bool inActions,
bool inEventString);
virtual ~EventsRefactorer(){}; virtual ~EventsRefactorer(){};
@@ -208,6 +209,20 @@ class GD_CORE_API EventsRefactorer {
gd::String newString, gd::String newString,
bool matchCase); bool matchCase);
/**
* Replace all occurrences of a gd::String in strings of events (for example:
* comments and name of groups).
*
* \return true if something was modified.
*/
static bool ReplaceStringInEventSearchableStrings(
gd::ObjectsContainer& project,
gd::ObjectsContainer& layout,
gd::BaseEvent& event,
gd::String toReplace,
gd::String newString,
bool matchCase);
static bool SearchStringInFormattedText(const gd::Platform& platform, static bool SearchStringInFormattedText(const gd::Platform& platform,
gd::Instruction& instruction, gd::Instruction& instruction,
gd::String search, gd::String search,

View File

@@ -95,7 +95,7 @@ class GD_CORE_API ExpressionParameterMover
// Move parameter of an object function // Move parameter of an object function
const gd::String& thisObjectType = gd::GetTypeOfObject( const gd::String& thisObjectType = gd::GetTypeOfObject(
globalObjectsContainer, objectsContainer, node.objectName); globalObjectsContainer, objectsContainer, node.objectName);
if (thisObjectType == behaviorType) { if (thisObjectType == objectType) {
moveParameter(node.parameters); moveParameter(node.parameters);
hasDoneMoving = true; hasDoneMoving = true;
} }

View File

@@ -33,11 +33,4 @@ gd::Platform* PlatformManager::GetPlatform(
return NULL; return NULL;
} }
void PlatformManager::NotifyPlatformIDEInitialized() const {
for (std::size_t i = 0; i < platformsLoaded.size(); ++i) {
if (platformsLoaded[i] != std::shared_ptr<gd::Platform>())
platformsLoaded[i]->OnIDEInitialized();
}
}
} // namespace gd } // namespace gd

View File

@@ -43,12 +43,6 @@ class GD_CORE_API PlatformManager {
return platformsLoaded; return platformsLoaded;
}; };
/**
* \brief Notify each platform that the IDE is ready, by calling their
* OnIDEInitialized member function.
*/
void NotifyPlatformIDEInitialized() const;
static PlatformManager *Get() { static PlatformManager *Get() {
if (NULL == _singleton) { if (NULL == _singleton) {
_singleton = new PlatformManager; _singleton = new PlatformManager;
@@ -65,11 +59,6 @@ class GD_CORE_API PlatformManager {
*/ */
static void DestroySingleton() { static void DestroySingleton() {
if (NULL != _singleton) { if (NULL != _singleton) {
for (std::size_t i = 0; i < _singleton->platformsLoaded.size(); ++i) {
if (_singleton->platformsLoaded[i] != std::shared_ptr<gd::Platform>())
_singleton->platformsLoaded[i]->OnIDEClosed();
}
delete _singleton; delete _singleton;
_singleton = NULL; _singleton = NULL;
} }

View File

@@ -33,6 +33,7 @@ void EventsFunctionsExtension::Init(const gd::EventsFunctionsExtension& other) {
description = other.description; description = other.description;
name = other.name; name = other.name;
fullName = other.fullName; fullName = other.fullName;
category = other.category;
tags = other.tags; tags = other.tags;
author = other.author; author = other.author;
authorIds = other.authorIds; authorIds = other.authorIds;
@@ -50,6 +51,7 @@ void EventsFunctionsExtension::SerializeTo(SerializerElement& element) const {
element.SetAttribute("description", description); element.SetAttribute("description", description);
element.SetAttribute("name", name); element.SetAttribute("name", name);
element.SetAttribute("fullName", fullName); element.SetAttribute("fullName", fullName);
element.SetAttribute("category", category);
if (!originName.empty() || !originIdentifier.empty()) { if (!originName.empty() || !originIdentifier.empty()) {
element.AddChild("origin") element.AddChild("origin")
.SetAttribute("name", originName) .SetAttribute("name", originName)
@@ -87,6 +89,7 @@ void EventsFunctionsExtension::UnserializeFrom(
description = element.GetStringAttribute("description"); description = element.GetStringAttribute("description");
name = element.GetStringAttribute("name"); name = element.GetStringAttribute("name");
fullName = element.GetStringAttribute("fullName"); fullName = element.GetStringAttribute("fullName");
category = element.GetStringAttribute("category");
author = element.GetStringAttribute("author"); author = element.GetStringAttribute("author");
previewIconUrl = element.GetStringAttribute("previewIconUrl"); previewIconUrl = element.GetStringAttribute("previewIconUrl");
iconUrl = element.GetStringAttribute("iconUrl"); iconUrl = element.GetStringAttribute("iconUrl");

View File

@@ -84,6 +84,12 @@ class GD_CORE_API EventsFunctionsExtension : public EventsFunctionsContainer {
return *this; return *this;
} }
const gd::String& GetCategory() const { return category; };
EventsFunctionsExtension& SetCategory(const gd::String& category_) {
category = category_;
return *this;
}
const std::vector<gd::String>& GetTags() const { return tags; }; const std::vector<gd::String>& GetTags() const { return tags; };
std::vector<gd::String>& GetTags() { return tags; }; std::vector<gd::String>& GetTags() { return tags; };
@@ -238,6 +244,7 @@ class GD_CORE_API EventsFunctionsExtension : public EventsFunctionsContainer {
gd::String description; gd::String description;
gd::String name; gd::String name;
gd::String fullName; gd::String fullName;
gd::String category;
std::vector<gd::String> tags; std::vector<gd::String> tags;
std::vector<gd::String> authorIds; std::vector<gd::String> authorIds;
gd::String author; gd::String author;

View File

@@ -217,7 +217,7 @@ class GD_CORE_API Layout : public ObjectsContainer {
/** /**
* Must add a new the layer constructed from the layout passed as parameter. * Must add a new the layer constructed from the layout passed as parameter.
* \note No pointer or reference must be kept on the layer passed as * \note No pointer or reference must be kept on the layer passed as
* parameter. \param theLayer The the layer that must be copied and inserted * parameter. \param theLayer the layer that must be copied and inserted
* into the project \param position Insertion position. Even if the position * into the project \param position Insertion position. Even if the position
* is invalid, the layer must be inserted at the end of the layers list. * is invalid, the layer must be inserted at the end of the layers list.
*/ */

View File

@@ -66,6 +66,9 @@ Project::Project()
projectUuid(""), projectUuid(""),
useDeprecatedZeroAsDefaultZOrder(false), useDeprecatedZeroAsDefaultZOrder(false),
useExternalSourceFiles(false), useExternalSourceFiles(false),
isPlayableWithKeyboard(false),
isPlayableWithGamepad(false),
isPlayableWithMobile(false),
currentPlatform(NULL), currentPlatform(NULL),
gdMajorVersion(gd::VersionWrapper::Major()), gdMajorVersion(gd::VersionWrapper::Major()),
gdMinorVersion(gd::VersionWrapper::Minor()), gdMinorVersion(gd::VersionWrapper::Minor()),
@@ -495,6 +498,7 @@ void Project::UnserializeFrom(const SerializerElement& element) {
const SerializerElement& propElement = const SerializerElement& propElement =
element.GetChild("properties", 0, "Info"); element.GetChild("properties", 0, "Info");
SetName(propElement.GetChild("name", 0, "Nom").GetValue().GetString()); SetName(propElement.GetChild("name", 0, "Nom").GetValue().GetString());
SetDescription(propElement.GetChild("description", 0).GetValue().GetString());
SetVersion(propElement.GetStringAttribute("version", "1.0.0")); SetVersion(propElement.GetStringAttribute("version", "1.0.0"));
SetGameResolutionSize( SetGameResolutionSize(
propElement.GetChild("windowWidth", 0, "WindowW").GetValue().GetInt(), propElement.GetChild("windowWidth", 0, "WindowW").GetValue().GetInt(),
@@ -535,6 +539,27 @@ void Project::UnserializeFrom(const SerializerElement& element) {
authorIds.push_back(authorIdsElement.GetChild(i).GetStringValue()); authorIds.push_back(authorIdsElement.GetChild(i).GetStringValue());
} }
categories.clear();
auto& categoriesElement = propElement.GetChild("categories");
categoriesElement.ConsiderAsArray();
for (std::size_t i = 0; i < categoriesElement.GetChildrenCount(); ++i) {
categories.push_back(categoriesElement.GetChild(i).GetStringValue());
}
auto& playableDevicesElement = propElement.GetChild("playableDevices");
playableDevicesElement.ConsiderAsArray();
for (std::size_t i = 0; i < playableDevicesElement.GetChildrenCount(); ++i) {
const auto& playableDevice =
playableDevicesElement.GetChild(i).GetStringValue();
if (playableDevice == "keyboard") {
isPlayableWithKeyboard = true;
} else if (playableDevice == "gamepad") {
isPlayableWithGamepad = true;
} else if (playableDevice == "mobile") {
isPlayableWithMobile = true;
}
}
// Compatibility with GD <= 5.0.0-beta101 // Compatibility with GD <= 5.0.0-beta101
if (VersionWrapper::IsOlderOrEqual( if (VersionWrapper::IsOlderOrEqual(
gdMajorVersion, gdMinorVersion, gdBuildVersion, 0, 4, 0, 98, 0) && gdMajorVersion, gdMinorVersion, gdBuildVersion, 0, 4, 0, 98, 0) &&
@@ -634,6 +659,7 @@ void Project::UnserializeFrom(const SerializerElement& element) {
layoutElement.GetStringAttribute("name", "", "nom"), -1); layoutElement.GetStringAttribute("name", "", "nom"), -1);
layout.UnserializeFrom(*this, layoutElement); layout.UnserializeFrom(*this, layoutElement);
} }
SetFirstLayout(element.GetChild("firstLayout").GetStringValue());
externalEvents.clear(); externalEvents.clear();
const SerializerElement& externalEventsElement = const SerializerElement& externalEventsElement =
@@ -703,6 +729,7 @@ void Project::SerializeTo(SerializerElement& element) const {
SerializerElement& propElement = element.AddChild("properties"); SerializerElement& propElement = element.AddChild("properties");
propElement.AddChild("name").SetValue(GetName()); propElement.AddChild("name").SetValue(GetName());
propElement.AddChild("description").SetValue(GetDescription());
propElement.SetAttribute("version", GetVersion()); propElement.SetAttribute("version", GetVersion());
propElement.AddChild("author").SetValue(GetAuthor()); propElement.AddChild("author").SetValue(GetAuthor());
propElement.AddChild("windowWidth").SetValue(GetGameResolutionWidth()); propElement.AddChild("windowWidth").SetValue(GetGameResolutionWidth());
@@ -733,6 +760,24 @@ void Project::SerializeTo(SerializerElement& element) const {
authorIdsElement.AddChild("").SetStringValue(authorId); authorIdsElement.AddChild("").SetStringValue(authorId);
} }
auto& categoriesElement = propElement.AddChild("categories");
categoriesElement.ConsiderAsArray();
for (const auto& category : categories) {
categoriesElement.AddChild("").SetStringValue(category);
}
auto& playableDevicesElement = propElement.AddChild("playableDevices");
playableDevicesElement.ConsiderAsArray();
if (isPlayableWithKeyboard) {
playableDevicesElement.AddChild("").SetStringValue("keyboard");
}
if (isPlayableWithGamepad) {
playableDevicesElement.AddChild("").SetStringValue("gamepad");
}
if (isPlayableWithMobile) {
playableDevicesElement.AddChild("").SetStringValue("mobile");
}
// Compatibility with GD <= 5.0.0-beta101 // Compatibility with GD <= 5.0.0-beta101
if (useDeprecatedZeroAsDefaultZOrder) { if (useDeprecatedZeroAsDefaultZOrder) {
propElement.SetAttribute("useDeprecatedZeroAsDefaultZOrder", true); propElement.SetAttribute("useDeprecatedZeroAsDefaultZOrder", true);
@@ -908,6 +953,9 @@ Project& Project::operator=(const Project& other) {
void Project::Init(const gd::Project& game) { void Project::Init(const gd::Project& game) {
name = game.name; name = game.name;
categories = game.categories;
description = game.description;
firstLayout = game.firstLayout;
version = game.version; version = game.version;
windowWidth = game.windowWidth; windowWidth = game.windowWidth;
windowHeight = game.windowHeight; windowHeight = game.windowHeight;
@@ -923,6 +971,9 @@ void Project::Init(const gd::Project& game) {
author = game.author; author = game.author;
authorIds = game.authorIds; authorIds = game.authorIds;
isPlayableWithKeyboard = game.isPlayableWithKeyboard;
isPlayableWithGamepad = game.isPlayableWithGamepad;
isPlayableWithMobile = game.isPlayableWithMobile;
packageName = game.packageName; packageName = game.packageName;
orientation = game.orientation; orientation = game.orientation;
folderProject = game.folderProject; folderProject = game.folderProject;

View File

@@ -56,15 +56,35 @@ class GD_CORE_API Project : public ObjectsContainer {
///@{ ///@{
/** /**
* \brief Change project name * \brief Change the project name
*/ */
void SetName(const gd::String& name_) { name = name_; }; void SetName(const gd::String& name_) { name = name_; };
/** /**
* \brief Get project name * \brief Get the project name
*/ */
const gd::String& GetName() const { return name; } const gd::String& GetName() const { return name; }
/**
* \brief Get the categories/genres of the project.
*/
const std::vector<gd::String>& GetCategories() const { return categories; };
/**
* \brief Get the categories of the project, to modify them (non-const).
*/
std::vector<gd::String>& GetCategories() { return categories; };
/**
* \brief Change the project description
*/
void SetDescription(const gd::String& description_) { description = description_; };
/**
* \brief Get the project description
*/
const gd::String& GetDescription() const { return description; }
/** /**
* \brief Change the version of the project. * \brief Change the version of the project.
* This can be freely set, but should follow "X.Y.Z" format for compatibility * This can be freely set, but should follow "X.Y.Z" format for compatibility
@@ -73,7 +93,7 @@ class GD_CORE_API Project : public ObjectsContainer {
void SetVersion(const gd::String& version_) { version = version_; }; void SetVersion(const gd::String& version_) { version = version_; };
/** /**
* \brief Get project version. * \brief Get the project version.
*/ */
const gd::String& GetVersion() const { return version; } const gd::String& GetVersion() const { return version; }
@@ -83,7 +103,7 @@ class GD_CORE_API Project : public ObjectsContainer {
void SetAuthor(const gd::String& author_) { author = author_; }; void SetAuthor(const gd::String& author_) { author = author_; };
/** /**
* \brief Get project author name. * \brief Get the project author name.
*/ */
const gd::String& GetAuthor() const { return author; } const gd::String& GetAuthor() const { return author; }
@@ -98,14 +118,47 @@ class GD_CORE_API Project : public ObjectsContainer {
std::vector<gd::String>& GetAuthorIds() { return authorIds; }; std::vector<gd::String>& GetAuthorIds() { return authorIds; };
/** /**
* \brief Change project package name. * Define the project as playable with a keyboard.
* \param enable True to define the project as playable with a keyboard.
*/
void SetPlayableWithKeyboard(bool playable = true) { isPlayableWithKeyboard = playable; }
/**
* Check if the project is defined as playable with a keyboard.
*/
bool IsPlayableWithKeyboard() const { return isPlayableWithKeyboard; }
/**
* Define the project as playable with a gamepad.
* \param enable True to define the project as playable with a gamepad.
*/
void SetPlayableWithGamepad(bool playable = true) { isPlayableWithGamepad = playable; }
/**
* Check if the project is defined as playable with a gamepad.
*/
bool IsPlayableWithGamepad() const { return isPlayableWithGamepad; }
/**
* Define the project as playable on a mobile.
* \param enable True to define the project as playable on a mobile.
*/
void SetPlayableWithMobile(bool playable = true) { isPlayableWithMobile = playable; }
/**
* Check if the project is defined as playable on a mobile.
*/
bool IsPlayableWithMobile() const { return isPlayableWithMobile; }
/**
* \brief Change the project package name.
*/ */
void SetPackageName(const gd::String& packageName_) { void SetPackageName(const gd::String& packageName_) {
packageName = packageName_; packageName = packageName_;
}; };
/** /**
* \brief Get project package name. * \brief Get the project package name.
*/ */
const gd::String& GetPackageName() const { return packageName; } const gd::String& GetPackageName() const { return packageName; }
@@ -119,7 +172,7 @@ class GD_CORE_API Project : public ObjectsContainer {
}; };
/** /**
* \brief Get project orientation ("default", "landscape", "portrait"). * \brief Get the project orientation ("default", "landscape", "portrait").
*/ */
const gd::String& GetOrientation() const { return orientation; } const gd::String& GetOrientation() const { return orientation; }
@@ -884,6 +937,7 @@ class GD_CORE_API Project : public ObjectsContainer {
void Init(const gd::Project& project); void Init(const gd::Project& project);
gd::String name; ///< Game name gd::String name; ///< Game name
gd::String description; ///< Game description
gd::String version; ///< Game version number (used for some exports) gd::String version; ///< Game version number (used for some exports)
unsigned int windowWidth; ///< Window default width unsigned int windowWidth; ///< Window default width
unsigned int windowHeight; ///< Window default height unsigned int windowHeight; ///< Window default height
@@ -923,6 +977,11 @@ class GD_CORE_API Project : public ObjectsContainer {
gd::String author; ///< Game author name, for publishing purpose. gd::String author; ///< Game author name, for publishing purpose.
std::vector<gd::String> std::vector<gd::String>
authorIds; ///< Game author ids, from GDevelop users DB. authorIds; ///< Game author ids, from GDevelop users DB.
std::vector<gd::String>
categories; ///< Game categories
bool isPlayableWithKeyboard; ///< The project is playable with a keyboard.
bool isPlayableWithGamepad; ///< The project is playable with a gamepad.
bool isPlayableWithMobile; ///< The project is playable on a mobile.
gd::String packageName; ///< Game package name gd::String packageName; ///< Game package name
gd::String orientation; ///< Lock game orientation (on mobile devices). gd::String orientation; ///< Lock game orientation (on mobile devices).
///< "default", "landscape" or "portrait". ///< "default", "landscape" or "portrait".

View File

@@ -18,6 +18,16 @@
#include "GDCore/Tools/Localization.h" #include "GDCore/Tools/Localization.h"
#include "GDCore/Tools/Log.h" #include "GDCore/Tools/Log.h"
namespace {
gd::String NormalizePathSeparator(const gd::String& path) {
gd::String normalizedPath = path;
while (normalizedPath.find('\\') != gd::String::npos)
normalizedPath.replace(normalizedPath.find('\\'), 1, "/");
return normalizedPath;
}
} // namespace
namespace gd { namespace gd {
gd::String Resource::badStr; gd::String Resource::badStr;
@@ -126,19 +136,20 @@ std::vector<gd::String> ResourcesManager::GetAllResourceNames() const {
} }
std::vector<gd::String> ResourcesManager::FindFilesNotInResources( std::vector<gd::String> ResourcesManager::FindFilesNotInResources(
const std::vector<gd::String>& filesToCheck) const { const std::vector<gd::String>& filePathsToCheck) const {
std::unordered_set<gd::String> resourceFiles; std::unordered_set<gd::String> resourceFilePaths;
for (const auto& resource: resources) { for (const auto& resource : resources) {
resourceFiles.insert(resource->GetFile()); resourceFilePaths.insert(NormalizePathSeparator(resource->GetFile()));
} }
std::vector<gd::String> filesNotInResources; std::vector<gd::String> filePathsNotInResources;
for(const gd::String& file: filesToCheck) { for (const gd::String& file : filePathsToCheck) {
if (resourceFiles.find(file) == resourceFiles.end()) gd::String normalizedPath = NormalizePathSeparator(file);
filesNotInResources.push_back(file); if (resourceFilePaths.find(normalizedPath) == resourceFilePaths.end())
filePathsNotInResources.push_back(file);
} }
return filesNotInResources; return filePathsNotInResources;
} }
std::map<gd::String, gd::PropertyDescriptor> Resource::GetProperties() const { std::map<gd::String, gd::PropertyDescriptor> Resource::GetProperties() const {
@@ -532,11 +543,7 @@ void ResourcesManager::SerializeTo(SerializerElement& element) const {
} }
void ImageResource::SetFile(const gd::String& newFile) { void ImageResource::SetFile(const gd::String& newFile) {
file = newFile; file = NormalizePathSeparator(newFile);
// Convert all backslash to slashs.
while (file.find('\\') != gd::String::npos)
file.replace(file.find('\\'), 1, "/");
} }
void ImageResource::UnserializeFrom(const SerializerElement& element) { void ImageResource::UnserializeFrom(const SerializerElement& element) {
@@ -554,11 +561,7 @@ void ImageResource::SerializeTo(SerializerElement& element) const {
} }
void AudioResource::SetFile(const gd::String& newFile) { void AudioResource::SetFile(const gd::String& newFile) {
file = newFile; file = NormalizePathSeparator(newFile);
// Convert all backslash to slashs.
while (file.find('\\') != gd::String::npos)
file.replace(file.find('\\'), 1, "/");
} }
void AudioResource::UnserializeFrom(const SerializerElement& element) { void AudioResource::UnserializeFrom(const SerializerElement& element) {
@@ -576,11 +579,7 @@ void AudioResource::SerializeTo(SerializerElement& element) const {
} }
void FontResource::SetFile(const gd::String& newFile) { void FontResource::SetFile(const gd::String& newFile) {
file = newFile; file = NormalizePathSeparator(newFile);
// Convert all backslash to slashs.
while (file.find('\\') != gd::String::npos)
file.replace(file.find('\\'), 1, "/");
} }
void FontResource::UnserializeFrom(const SerializerElement& element) { void FontResource::UnserializeFrom(const SerializerElement& element) {
@@ -594,11 +593,7 @@ void FontResource::SerializeTo(SerializerElement& element) const {
} }
void VideoResource::SetFile(const gd::String& newFile) { void VideoResource::SetFile(const gd::String& newFile) {
file = newFile; file = NormalizePathSeparator(newFile);
// Convert all backslash to slashs.
while (file.find('\\') != gd::String::npos)
file.replace(file.find('\\'), 1, "/");
} }
void VideoResource::UnserializeFrom(const SerializerElement& element) { void VideoResource::UnserializeFrom(const SerializerElement& element) {
@@ -612,11 +607,7 @@ void VideoResource::SerializeTo(SerializerElement& element) const {
} }
void JsonResource::SetFile(const gd::String& newFile) { void JsonResource::SetFile(const gd::String& newFile) {
file = newFile; file = NormalizePathSeparator(newFile);
// Convert all backslash to slashs.
while (file.find('\\') != gd::String::npos)
file.replace(file.find('\\'), 1, "/");
} }
void JsonResource::UnserializeFrom(const SerializerElement& element) { void JsonResource::UnserializeFrom(const SerializerElement& element) {
@@ -649,13 +640,8 @@ bool JsonResource::UpdateProperty(const gd::String& name,
return true; return true;
} }
void BitmapFontResource::SetFile(const gd::String& newFile) { void BitmapFontResource::SetFile(const gd::String& newFile) {
file = newFile; file = NormalizePathSeparator(newFile);
// Convert all backslash to slashs.
while (file.find('\\') != gd::String::npos)
file.replace(file.find('\\'), 1, "/");
} }
void BitmapFontResource::UnserializeFrom(const SerializerElement& element) { void BitmapFontResource::UnserializeFrom(const SerializerElement& element) {

View File

@@ -447,7 +447,7 @@ class GD_CORE_API ResourcesManager {
* \brief Return a list of the files, from the specified input list, * \brief Return a list of the files, from the specified input list,
* that are not used as files by the resources. * that are not used as files by the resources.
*/ */
std::vector<gd::String> FindFilesNotInResources(const std::vector<gd::String>& filesToCheck) const; std::vector<gd::String> FindFilesNotInResources(const std::vector<gd::String>& filePathsToCheck) const;
/** /**
* \brief Return a (smart) pointer to a resource. * \brief Return a (smart) pointer to a resource.

View File

@@ -667,7 +667,7 @@ int String::compare( const String &other ) const
namespace priv namespace priv
{ {
/** /**
* As the the casefolded version of a string can have a different size, the positions * As the casefolded version of a string can have a different size, the positions
* in the two versions of the string are not the same. * in the two versions of the string are not the same.
* \return where the **pos** position in the original string **str** is in the * \return where the **pos** position in the original string **str** is in the
* casefolded version of **str** * casefolded version of **str**
@@ -681,7 +681,7 @@ namespace priv
} }
/** /**
* As the the casefolded version of a string can have a different size, the positions * As the casefolded version of a string can have a different size, the positions
* in the two versions of the string are not the same. * in the two versions of the string are not the same.
* \return where the **pos** position in the casefolded string of **str** is in the * \return where the **pos** position in the casefolded string of **str** is in the
* original version **str** * original version **str**

View File

@@ -14,7 +14,7 @@
class BehaviorWithRequiredBehaviorProperty : public gd::Behavior { class BehaviorWithRequiredBehaviorProperty : public gd::Behavior {
public: public:
BehaviorWithRequiredBehaviorProperty() {}; BehaviorWithRequiredBehaviorProperty(){};
virtual ~BehaviorWithRequiredBehaviorProperty(){}; virtual ~BehaviorWithRequiredBehaviorProperty(){};
virtual Behavior* Clone() const override { virtual Behavior* Clone() const override {
return new BehaviorWithRequiredBehaviorProperty(*this); return new BehaviorWithRequiredBehaviorProperty(*this);
@@ -25,7 +25,8 @@ class BehaviorWithRequiredBehaviorProperty : public gd::Behavior {
std::map<gd::String, gd::PropertyDescriptor> properties; std::map<gd::String, gd::PropertyDescriptor> properties;
properties["requiredBehaviorProperty"] properties["requiredBehaviorProperty"]
.SetLabel("A required behavior") .SetLabel("A required behavior")
.SetValue(behaviorContent.GetStringAttribute("requiredBehaviorProperty")) .SetValue(
behaviorContent.GetStringAttribute("requiredBehaviorProperty"))
.SetType("Behavior") .SetType("Behavior")
.AddExtraInfo("MyExtension::MyBehavior"); .AddExtraInfo("MyExtension::MyBehavior");
return properties; return properties;
@@ -48,7 +49,7 @@ class BehaviorWithRequiredBehaviorProperty : public gd::Behavior {
class BehaviorWithRequiredBehaviorPropertyRequiringAnotherBehavior class BehaviorWithRequiredBehaviorPropertyRequiringAnotherBehavior
: public gd::Behavior { : public gd::Behavior {
public: public:
BehaviorWithRequiredBehaviorPropertyRequiringAnotherBehavior() {}; BehaviorWithRequiredBehaviorPropertyRequiringAnotherBehavior(){};
virtual ~BehaviorWithRequiredBehaviorPropertyRequiringAnotherBehavior(){}; virtual ~BehaviorWithRequiredBehaviorPropertyRequiringAnotherBehavior(){};
virtual Behavior* Clone() const override { virtual Behavior* Clone() const override {
return new BehaviorWithRequiredBehaviorPropertyRequiringAnotherBehavior( return new BehaviorWithRequiredBehaviorPropertyRequiringAnotherBehavior(
@@ -60,7 +61,8 @@ class BehaviorWithRequiredBehaviorPropertyRequiringAnotherBehavior
std::map<gd::String, gd::PropertyDescriptor> properties; std::map<gd::String, gd::PropertyDescriptor> properties;
properties["requiredBehaviorProperty"] properties["requiredBehaviorProperty"]
.SetLabel("A required behavior") .SetLabel("A required behavior")
.SetValue(behaviorContent.GetStringAttribute("requiredBehaviorProperty")) .SetValue(
behaviorContent.GetStringAttribute("requiredBehaviorProperty"))
.SetType("Behavior") .SetType("Behavior")
.AddExtraInfo("MyExtension::BehaviorWithRequiredBehaviorProperty"); .AddExtraInfo("MyExtension::BehaviorWithRequiredBehaviorProperty");
return properties; return properties;
@@ -87,11 +89,26 @@ void SetupProjectWithDummyPlatform(gd::Project& project,
std::shared_ptr<gd::PlatformExtension> baseObjectExtension = std::shared_ptr<gd::PlatformExtension> baseObjectExtension =
std::shared_ptr<gd::PlatformExtension>(new gd::PlatformExtension); std::shared_ptr<gd::PlatformExtension>(new gd::PlatformExtension);
// Create the base object. All objects "inherits" from it.
baseObjectExtension->SetExtensionInformation( baseObjectExtension->SetExtensionInformation(
"BuiltinObject", "Base Object dummy extension", "", "", ""); "BuiltinObject", "Base Object dummy extension", "", "", "");
auto baseObject = baseObjectExtension->AddObject<gd::Object>( auto& baseObject = baseObjectExtension->AddObject<gd::Object>(
"", "Dummy Base Object", "Dummy Base Object", ""); "", "Dummy Base Object", "Dummy Base Object", "");
// Add this expression for all objects. But it requires a "capability".
baseObject
.AddStrExpression("GetSomethingRequiringEffectCapability",
"Get something, but this requires the effect capability for the object.",
"",
"",
"")
.AddParameter("object", _("Object"), "")
.AddParameter("expression", _("Number parameter"))
.SetRequiresBaseObjectCapability("effect")
.SetFunctionName("getSomethingRequiringEffectCapability");
// Create an extension with various stuff inside.
std::shared_ptr<gd::PlatformExtension> extension = std::shared_ptr<gd::PlatformExtension> extension =
std::shared_ptr<gd::PlatformExtension>(new gd::PlatformExtension); std::shared_ptr<gd::PlatformExtension>(new gd::PlatformExtension);
extension->SetExtensionInformation( extension->SetExtensionInformation(
@@ -116,7 +133,8 @@ void SetupProjectWithDummyPlatform(gd::Project& project,
"", "",
"", "",
"") "")
.AddParameter("bitmapFontResource", "Parameter 1 (a bitmap font resource)") .AddParameter("bitmapFontResource",
"Parameter 1 (a bitmap font resource)")
.AddParameter("imageResource", "Parameter 2 (an image resource)") .AddParameter("imageResource", "Parameter 2 (an image resource)")
.AddParameter("soundfile", "Parameter 3 (an audio resource)") .AddParameter("soundfile", "Parameter 3 (an audio resource)")
.SetFunctionName("doSomethingWithResources"); .SetFunctionName("doSomethingWithResources");
@@ -260,10 +278,10 @@ void SetupProjectWithDummyPlatform(gd::Project& project,
.SetFunctionName("getBehaviorStringWith1Param"); .SetFunctionName("getBehaviorStringWith1Param");
behavior behavior
.AddExpression("GetBehaviorNumberWith1Param", .AddExpression("GetBehaviorNumberWith1Param",
"Get number from behavior with 1 param", "Get number from behavior with 1 param",
"", "",
"", "",
"") "")
.AddParameter("object", _("Object")) .AddParameter("object", _("Object"))
.AddParameter("behavior", _("Behavior"), "MyExtension::MyBehavior") .AddParameter("behavior", _("Behavior"), "MyExtension::MyBehavior")
.AddParameter("expression", _("Number parameter")) .AddParameter("expression", _("Number parameter"))
@@ -310,6 +328,16 @@ void SetupProjectWithDummyPlatform(gd::Project& project,
gd::make_unique<gd::BehaviorsSharedData>()); gd::make_unique<gd::BehaviorsSharedData>());
} }
{
auto& object = extension
->AddObject<gd::Object>(
"FakeObjectWithUnsupportedCapability",
"FakeObjectWithUnsupportedCapability",
"This is FakeObjectWithUnsupportedCapability",
"")
.AddUnsupportedBaseObjectCapability("effect");
}
platform.AddExtension(baseObjectExtension); platform.AddExtension(baseObjectExtension);
platform.AddExtension(extension); platform.AddExtension(extension);
project.AddPlatform(platform); project.AddPlatform(platform);

View File

@@ -23,6 +23,14 @@ TEST_CASE("ExpressionCodeGenerator", "[common][events]") {
layout1.InsertNewObject(project, "MyExtension::Sprite", "MySpriteObject", 0); layout1.InsertNewObject(project, "MyExtension::Sprite", "MySpriteObject", 0);
layout1.InsertNewObject( layout1.InsertNewObject(
project, "MyExtension::Sprite", "MyOtherSpriteObject", 1); project, "MyExtension::Sprite", "MyOtherSpriteObject", 1);
layout1.InsertNewObject(project,
"MyExtension::FakeObjectWithUnsupportedCapability",
"MyFakeObjectWithUnsupportedCapability",
2);
auto &group = layout1.GetObjectGroups().InsertNew("AllObjects");
group.AddObject("MySpriteObject");
group.AddObject("MyOtherSpriteObject");
group.AddObject("MyFakeObjectWithUnsupportedCapability");
gd::ExpressionParser2 parser(platform, project, layout1); gd::ExpressionParser2 parser(platform, project, layout1);
@@ -283,6 +291,51 @@ TEST_CASE("ExpressionCodeGenerator", "[common][events]") {
"getNumberWith2Params(1, \"2\")"); "getNumberWith2Params(1, \"2\")");
} }
} }
SECTION("Invalid function calls (capabilities)") {
{
// Capability is supported, so the expression is valid.
auto node = parser.ParseExpression(
"string",
"MySpriteObject.GetSomethingRequiringEffectCapability(123)");
gd::ExpressionCodeGenerator expressionCodeGenerator(codeGenerator,
context);
REQUIRE(node);
node->Visit(expressionCodeGenerator);
REQUIRE(
expressionCodeGenerator.GetOutput() ==
"MySpriteObject.getSomethingRequiringEffectCapability(123) ?? \"\"");
}
{
// Capability is not supported, so the expression is not even valid.
auto node =
parser.ParseExpression("string",
"MyFakeObjectWithUnsupportedCapability."
"GetSomethingRequiringEffectCapability(123)");
gd::ExpressionCodeGenerator expressionCodeGenerator(codeGenerator,
context);
REQUIRE(node);
node->Visit(expressionCodeGenerator);
REQUIRE(expressionCodeGenerator.GetOutput() == "\"\"");
}
{
// We use a group, capability is supported only by one object of the
// group. The expression itself is valid, but code generation should skip
// the objects with unsupported capability.
auto node = parser.ParseExpression(
"string", "AllObjects.GetSomethingRequiringEffectCapability(123)");
gd::ExpressionCodeGenerator expressionCodeGenerator(codeGenerator,
context);
REQUIRE(node);
node->Visit(expressionCodeGenerator);
REQUIRE(
expressionCodeGenerator.GetOutput() ==
"MyOtherSpriteObject.getSomethingRequiringEffectCapability(123) ?? "
"MySpriteObject.getSomethingRequiringEffectCapability(123) ?? \"\"");
}
}
SECTION("Invalid variables") { SECTION("Invalid variables") {
{ {
// Test an empty expression // Test an empty expression

View File

@@ -19,6 +19,10 @@ TEST_CASE("ExpressionParser2", "[common][events]") {
SetupProjectWithDummyPlatform(project, platform); SetupProjectWithDummyPlatform(project, platform);
auto &layout1 = project.InsertNewLayout("Layout1", 0); auto &layout1 = project.InsertNewLayout("Layout1", 0);
layout1.InsertNewObject(project, "MyExtension::Sprite", "MySpriteObject", 0); layout1.InsertNewObject(project, "MyExtension::Sprite", "MySpriteObject", 0);
layout1.InsertNewObject(project,
"MyExtension::FakeObjectWithUnsupportedCapability",
"MyFakeObjectWithUnsupportedCapability",
1);
gd::ExpressionParser2 parser(platform, project, layout1); gd::ExpressionParser2 parser(platform, project, layout1);
@@ -1351,6 +1355,33 @@ TEST_CASE("ExpressionParser2", "[common][events]") {
} }
} }
SECTION(
"Valid function call with an object expression requiring a capability") {
auto node = parser.ParseExpression(
"string", "MySpriteObject.GetSomethingRequiringEffectCapability(123)");
REQUIRE(node != nullptr);
gd::ExpressionValidator validator;
node->Visit(validator);
REQUIRE(validator.GetErrors().size() == 0);
}
SECTION(
"Invalid function call with an object expression requiring a "
"capability") {
auto node =
parser.ParseExpression("string",
"MyFakeObjectWithUnsupportedCapability."
"GetSomethingRequiringEffectCapability(123)");
REQUIRE(node != nullptr);
gd::ExpressionValidator validator;
node->Visit(validator);
REQUIRE(validator.GetErrors().size() == 1);
REQUIRE(validator.GetErrors()[0]->GetMessage() ==
"This expression exists, but it can't be used on this object.");
}
SECTION("Fuzzy/random tests") { SECTION("Fuzzy/random tests") {
{ {
auto testExpression = [&parser](const gd::String &expression) { auto testExpression = [&parser](const gd::String &expression) {

View File

@@ -35,7 +35,11 @@ module.exports = {
'Florian Rival', 'Florian Rival',
'MIT' 'MIT'
) )
.setExtensionHelpPath('/all-features/admob'); .setExtensionHelpPath('/all-features/admob')
.setCategory('Ads');
extension
.addInstructionOrExpressionGroupMetadata(_('AdMob'))
.setIcon('JsPlatform/Extensions/admobicon24.png');
extension extension
.registerProperty('AdMobAppIdAndroid') .registerProperty('AdMobAppIdAndroid')
@@ -87,7 +91,7 @@ module.exports = {
'account being flagged for invalid activity.' 'account being flagged for invalid activity.'
), ),
_('Enable test mode (serving test ads, for development): _PARAM0_'), _('Enable test mode (serving test ads, for development): _PARAM0_'),
_('AdMob'), '',
'JsPlatform/Extensions/admobicon24.png', 'JsPlatform/Extensions/admobicon24.png',
'JsPlatform/Extensions/admobicon16.png' 'JsPlatform/Extensions/admobicon16.png'
) )
@@ -105,7 +109,7 @@ module.exports = {
'Check if a banner is currently loading. It will be shown automatically when loaded.' 'Check if a banner is currently loading. It will be shown automatically when loaded.'
), ),
_('Banner is loading'), _('Banner is loading'),
_('AdMob'), '',
'JsPlatform/Extensions/admobicon24.png', 'JsPlatform/Extensions/admobicon24.png',
'JsPlatform/Extensions/admobicon16.png' 'JsPlatform/Extensions/admobicon16.png'
) )
@@ -119,7 +123,7 @@ module.exports = {
_('Banner showing'), _('Banner showing'),
_('Check if there is a banner being displayed.'), _('Check if there is a banner being displayed.'),
_('Banner is showing'), _('Banner is showing'),
_('AdMob'), '',
'JsPlatform/Extensions/admobicon24.png', 'JsPlatform/Extensions/admobicon24.png',
'JsPlatform/Extensions/admobicon16.png' 'JsPlatform/Extensions/admobicon16.png'
) )
@@ -133,7 +137,7 @@ module.exports = {
_('Banner had an error'), _('Banner had an error'),
_('Check if there was a error while displaying a banner.'), _('Check if there was a error while displaying a banner.'),
_('Banner ad had an error'), _('Banner ad had an error'),
_('AdMob'), '',
'JsPlatform/Extensions/admobicon24.png', 'JsPlatform/Extensions/admobicon24.png',
'JsPlatform/Extensions/admobicon16.png' 'JsPlatform/Extensions/admobicon16.png'
) )
@@ -159,7 +163,7 @@ module.exports = {
_( _(
'Configure the banner with Android ad unit ID: _PARAM0_, iOS ad unit ID: _PARAM1_, display at top: _PARAM2_' 'Configure the banner with Android ad unit ID: _PARAM0_, iOS ad unit ID: _PARAM1_, display at top: _PARAM2_'
), ),
_('AdMob'), '',
'JsPlatform/Extensions/admobicon24.png', 'JsPlatform/Extensions/admobicon24.png',
'JsPlatform/Extensions/admobicon16.png' 'JsPlatform/Extensions/admobicon16.png'
) )
@@ -190,7 +194,7 @@ module.exports = {
_('Show banner'), _('Show banner'),
_('Show the banner that was previously set up.'), _('Show the banner that was previously set up.'),
_('Show banner'), _('Show banner'),
_('AdMob'), '',
'JsPlatform/Extensions/admobicon24.png', 'JsPlatform/Extensions/admobicon24.png',
'JsPlatform/Extensions/admobicon16.png' 'JsPlatform/Extensions/admobicon16.png'
) )
@@ -206,7 +210,7 @@ module.exports = {
'Hide the banner. You can show it again with the corresponding action.' 'Hide the banner. You can show it again with the corresponding action.'
), ),
_('Hide banner'), _('Hide banner'),
_('AdMob'), '',
'JsPlatform/Extensions/admobicon24.png', 'JsPlatform/Extensions/admobicon24.png',
'JsPlatform/Extensions/admobicon16.png' 'JsPlatform/Extensions/admobicon16.png'
) )
@@ -224,7 +228,7 @@ module.exports = {
_('Interstitial loading'), _('Interstitial loading'),
_('Check if an interstitial is currently loading.'), _('Check if an interstitial is currently loading.'),
_('Interstitial is loading'), _('Interstitial is loading'),
_('AdMob'), '',
'JsPlatform/Extensions/admobicon24.png', 'JsPlatform/Extensions/admobicon24.png',
'JsPlatform/Extensions/admobicon16.png' 'JsPlatform/Extensions/admobicon16.png'
) )
@@ -238,7 +242,7 @@ module.exports = {
_('Interstitial ready'), _('Interstitial ready'),
_('Check if an interstitial is ready to be displayed.'), _('Check if an interstitial is ready to be displayed.'),
_('Interstitial is ready'), _('Interstitial is ready'),
_('AdMob'), '',
'JsPlatform/Extensions/admobicon24.png', 'JsPlatform/Extensions/admobicon24.png',
'JsPlatform/Extensions/admobicon16.png' 'JsPlatform/Extensions/admobicon16.png'
) )
@@ -252,7 +256,7 @@ module.exports = {
_('Interstitial showing'), _('Interstitial showing'),
_('Check if there is an interstitial being displayed.'), _('Check if there is an interstitial being displayed.'),
_('Interstitial is showing'), _('Interstitial is showing'),
_('AdMob'), '',
'JsPlatform/Extensions/admobicon24.png', 'JsPlatform/Extensions/admobicon24.png',
'JsPlatform/Extensions/admobicon16.png' 'JsPlatform/Extensions/admobicon16.png'
) )
@@ -266,7 +270,7 @@ module.exports = {
_('Interstitial had an error'), _('Interstitial had an error'),
_('Check if there was a error while loading the interstitial.'), _('Check if there was a error while loading the interstitial.'),
_('Interstitial ad had an error'), _('Interstitial ad had an error'),
_('AdMob'), '',
'JsPlatform/Extensions/admobicon24.png', 'JsPlatform/Extensions/admobicon24.png',
'JsPlatform/Extensions/admobicon16.png' 'JsPlatform/Extensions/admobicon16.png'
) )
@@ -284,7 +288,7 @@ module.exports = {
_( _(
'Load interstitial with Android ad unit ID: _PARAM0_, iOS ad unit ID: _PARAM1_ (display automatically when loaded: _PARAM2_)' 'Load interstitial with Android ad unit ID: _PARAM0_, iOS ad unit ID: _PARAM1_ (display automatically when loaded: _PARAM2_)'
), ),
_('AdMob'), '',
'JsPlatform/Extensions/admobicon24.png', 'JsPlatform/Extensions/admobicon24.png',
'JsPlatform/Extensions/admobicon16.png' 'JsPlatform/Extensions/admobicon16.png'
) )
@@ -315,7 +319,7 @@ module.exports = {
'Show the interstitial that was loaded. Will work only when the interstitial is fully loaded.' 'Show the interstitial that was loaded. Will work only when the interstitial is fully loaded.'
), ),
_('Show the loaded interstitial'), _('Show the loaded interstitial'),
_('AdMob'), '',
'JsPlatform/Extensions/admobicon24.png', 'JsPlatform/Extensions/admobicon24.png',
'JsPlatform/Extensions/admobicon16.png' 'JsPlatform/Extensions/admobicon16.png'
) )
@@ -330,7 +334,7 @@ module.exports = {
_('Video loading'), _('Video loading'),
_('Check if a reward video is currently loading.'), _('Check if a reward video is currently loading.'),
_('Reward video is loading'), _('Reward video is loading'),
_('AdMob'), '',
'JsPlatform/Extensions/admobicon24.png', 'JsPlatform/Extensions/admobicon24.png',
'JsPlatform/Extensions/admobicon16.png' 'JsPlatform/Extensions/admobicon16.png'
) )
@@ -344,7 +348,7 @@ module.exports = {
_('Video ready'), _('Video ready'),
_('Check if a reward video is ready to be displayed.'), _('Check if a reward video is ready to be displayed.'),
_('Reward video is ready'), _('Reward video is ready'),
_('AdMob'), '',
'JsPlatform/Extensions/admobicon24.png', 'JsPlatform/Extensions/admobicon24.png',
'JsPlatform/Extensions/admobicon16.png' 'JsPlatform/Extensions/admobicon16.png'
) )
@@ -358,7 +362,7 @@ module.exports = {
_('Video showing'), _('Video showing'),
_('Check if there is a reward video being displayed.'), _('Check if there is a reward video being displayed.'),
_('Reward video is showing'), _('Reward video is showing'),
_('AdMob'), '',
'JsPlatform/Extensions/admobicon24.png', 'JsPlatform/Extensions/admobicon24.png',
'JsPlatform/Extensions/admobicon16.png' 'JsPlatform/Extensions/admobicon16.png'
) )
@@ -372,7 +376,7 @@ module.exports = {
_('Video had an error'), _('Video had an error'),
_('Check if there was a error while loading the rewarded video.'), _('Check if there was a error while loading the rewarded video.'),
_('Video ad had an error'), _('Video ad had an error'),
_('AdMob'), '',
'JsPlatform/Extensions/admobicon24.png', 'JsPlatform/Extensions/admobicon24.png',
'JsPlatform/Extensions/admobicon16.png' 'JsPlatform/Extensions/admobicon16.png'
) )
@@ -388,7 +392,7 @@ module.exports = {
'Check if the reward of the video was given to the user.\nYou can mark this reward as cleared, so that the condition will be false and you can show later another reward video.' 'Check if the reward of the video was given to the user.\nYou can mark this reward as cleared, so that the condition will be false and you can show later another reward video.'
), ),
_('User got the reward of the video (and clear this reward: _PARAM0_)'), _('User got the reward of the video (and clear this reward: _PARAM0_)'),
_('AdMob'), '',
'JsPlatform/Extensions/admobicon24.png', 'JsPlatform/Extensions/admobicon24.png',
'JsPlatform/Extensions/admobicon16.png' 'JsPlatform/Extensions/admobicon16.png'
) )
@@ -413,7 +417,7 @@ module.exports = {
_( _(
'Load reward video with Android ad unit ID: _PARAM0_, iOS ad unit ID: _PARAM1_ (display automatically when loaded: _PARAM2_)' 'Load reward video with Android ad unit ID: _PARAM0_, iOS ad unit ID: _PARAM1_ (display automatically when loaded: _PARAM2_)'
), ),
_('AdMob'), '',
'JsPlatform/Extensions/admobicon24.png', 'JsPlatform/Extensions/admobicon24.png',
'JsPlatform/Extensions/admobicon16.png' 'JsPlatform/Extensions/admobicon16.png'
) )
@@ -444,7 +448,7 @@ module.exports = {
'Show the reward video that was loaded. Will work only when the video is fully loaded.' 'Show the reward video that was loaded. Will work only when the video is fully loaded.'
), ),
_('Show the loaded reward video'), _('Show the loaded reward video'),
_('AdMob'), '',
'JsPlatform/Extensions/admobicon24.png', 'JsPlatform/Extensions/admobicon24.png',
'JsPlatform/Extensions/admobicon16.png' 'JsPlatform/Extensions/admobicon16.png'
) )
@@ -460,7 +464,7 @@ module.exports = {
'Mark the video reward as claimed. Useful if you used the condition to check if the reward was given to the user without clearing the reward.' 'Mark the video reward as claimed. Useful if you used the condition to check if the reward was given to the user without clearing the reward.'
), ),
_('Mark the reward of the video as claimed'), _('Mark the reward of the video as claimed'),
_('AdMob'), '',
'JsPlatform/Extensions/admobicon24.png', 'JsPlatform/Extensions/admobicon24.png',
'JsPlatform/Extensions/admobicon16.png' 'JsPlatform/Extensions/admobicon16.png'
) )

View File

@@ -18,15 +18,20 @@ module.exports = {
gd /*: libGDevelop */ gd /*: libGDevelop */
) { ) {
const extension = new gd.PlatformExtension(); const extension = new gd.PlatformExtension();
extension.setExtensionInformation( extension
'AdvancedWindow', .setExtensionInformation(
_('Advanced window management'), 'AdvancedWindow',
_( _('Advanced window management'),
'Provides advanced features related to the game window positioning and interaction with the operating system.' _(
), 'Provides advanced features related to the game window positioning and interaction with the operating system.'
'Arthur Pacaud (arthuro555)', ),
'MIT' 'Arthur Pacaud (arthuro555)',
); 'MIT'
)
.setCategory('Device');
extension
.addInstructionOrExpressionGroupMetadata(_('Advanced window management'))
.setIcon('res/actions/window24.png');
extension extension
.addAction( .addAction(
@@ -34,7 +39,7 @@ module.exports = {
_('Change focus of the window'), _('Change focus of the window'),
_('Make the window gain or lose focus.'), _('Make the window gain or lose focus.'),
_('Focus the window: _PARAM0_'), _('Focus the window: _PARAM0_'),
_('Advanced window management/Windows, Linux, macOS'), _('Windows, Linux, macOS'),
'res/actions/window24.png', 'res/actions/window24.png',
'res/actions/window.png' 'res/actions/window.png'
) )
@@ -52,7 +57,7 @@ module.exports = {
_('Window focused'), _('Window focused'),
_('Checks if the window is focused.'), _('Checks if the window is focused.'),
_('The window is focused'), _('The window is focused'),
_('Advanced window management/Windows, Linux, macOS'), _('Windows, Linux, macOS'),
'res/actions/window24.png', 'res/actions/window24.png',
'res/actions/window.png' 'res/actions/window.png'
) )
@@ -68,7 +73,7 @@ module.exports = {
_('Change visibility of the window'), _('Change visibility of the window'),
_('Make the window visible or invisible.'), _('Make the window visible or invisible.'),
_('Window visible: _PARAM0_'), _('Window visible: _PARAM0_'),
_('Advanced window management/Windows, Linux, macOS'), _('Windows, Linux, macOS'),
'res/actions/window24.png', 'res/actions/window24.png',
'res/actions/window.png' 'res/actions/window.png'
) )
@@ -86,7 +91,7 @@ module.exports = {
_('Window visible'), _('Window visible'),
_('Checks if the window is visible.'), _('Checks if the window is visible.'),
_('The window is visible'), _('The window is visible'),
_('Advanced window management/Windows, Linux, macOS'), _('Windows, Linux, macOS'),
'res/actions/window24.png', 'res/actions/window24.png',
'res/actions/window.png' 'res/actions/window.png'
) )
@@ -102,7 +107,7 @@ module.exports = {
_('Maximize the window'), _('Maximize the window'),
_('Maximize or unmaximize the window.'), _('Maximize or unmaximize the window.'),
_('Maximize window: _PARAM0_'), _('Maximize window: _PARAM0_'),
_('Advanced window management/Windows, Linux, macOS'), _('Windows, Linux, macOS'),
'res/actions/window24.png', 'res/actions/window24.png',
'res/actions/window.png' 'res/actions/window.png'
) )
@@ -120,7 +125,7 @@ module.exports = {
_('Window maximized'), _('Window maximized'),
_('Checks if the window is maximized.'), _('Checks if the window is maximized.'),
_('The window is maximized'), _('The window is maximized'),
_('Advanced window management/Windows, Linux, macOS'), _('Windows, Linux, macOS'),
'res/actions/window24.png', 'res/actions/window24.png',
'res/actions/window.png' 'res/actions/window.png'
) )
@@ -136,7 +141,7 @@ module.exports = {
_('Minimize the window'), _('Minimize the window'),
_('Minimize or unminimize the window.'), _('Minimize or unminimize the window.'),
_('Minimize window: _PARAM0_'), _('Minimize window: _PARAM0_'),
_('Advanced window management/Windows, Linux, macOS'), _('Windows, Linux, macOS'),
'res/actions/window24.png', 'res/actions/window24.png',
'res/actions/window.png' 'res/actions/window.png'
) )
@@ -154,7 +159,7 @@ module.exports = {
_('Window minimized'), _('Window minimized'),
_('Checks if the window is minimized.'), _('Checks if the window is minimized.'),
_('The window is minimized'), _('The window is minimized'),
_('Advanced window management/Windows, Linux, macOS'), _('Windows, Linux, macOS'),
'res/actions/window24.png', 'res/actions/window24.png',
'res/actions/window.png' 'res/actions/window.png'
) )
@@ -170,7 +175,7 @@ module.exports = {
_('Enable the window'), _('Enable the window'),
_('Enables or disables the window.'), _('Enables or disables the window.'),
_('Enable window: _PARAM0_'), _('Enable window: _PARAM0_'),
_('Advanced window management/Windows, Linux, macOS'), _('Windows, Linux, macOS'),
'res/actions/window24.png', 'res/actions/window24.png',
'res/actions/window.png' 'res/actions/window.png'
) )
@@ -188,7 +193,7 @@ module.exports = {
_('Window enabled'), _('Window enabled'),
_('Checks if the window is enabled.'), _('Checks if the window is enabled.'),
_('The window is enabled'), _('The window is enabled'),
_('Advanced window management/Windows, Linux, macOS'), _('Windows, Linux, macOS'),
'res/actions/window24.png', 'res/actions/window24.png',
'res/actions/window.png' 'res/actions/window.png'
) )
@@ -204,7 +209,7 @@ module.exports = {
_('Allow resizing'), _('Allow resizing'),
_('Enables or disables resizing of the window by the user.'), _('Enables or disables resizing of the window by the user.'),
_('Enable window resizing: _PARAM0_'), _('Enable window resizing: _PARAM0_'),
_('Advanced window management/Windows, Linux, macOS'), _('Windows, Linux, macOS'),
'res/actions/window24.png', 'res/actions/window24.png',
'res/actions/window.png' 'res/actions/window.png'
) )
@@ -222,7 +227,7 @@ module.exports = {
_('Window resizable'), _('Window resizable'),
_('Checks if the window can be resized.'), _('Checks if the window can be resized.'),
_('The window can be resized'), _('The window can be resized'),
_('Advanced window management/Windows, Linux, macOS'), _('Windows, Linux, macOS'),
'res/actions/window24.png', 'res/actions/window24.png',
'res/actions/window.png' 'res/actions/window.png'
) )
@@ -238,7 +243,7 @@ module.exports = {
_('Allow moving'), _('Allow moving'),
_('Enables or disables moving of the window by the user.'), _('Enables or disables moving of the window by the user.'),
_('Enable window moving: _PARAM0_'), _('Enable window moving: _PARAM0_'),
_('Advanced window management/Windows, Linux, macOS'), _('Windows, Linux, macOS'),
'res/actions/window24.png', 'res/actions/window24.png',
'res/actions/window.png' 'res/actions/window.png'
) )
@@ -256,7 +261,7 @@ module.exports = {
_('Window movable'), _('Window movable'),
_('Checks if the window can be moved.'), _('Checks if the window can be moved.'),
_('The window can be moved'), _('The window can be moved'),
_('Advanced window management/Windows, Linux, macOS'), _('Windows, Linux, macOS'),
'res/actions/window24.png', 'res/actions/window24.png',
'res/actions/window.png' 'res/actions/window.png'
) )
@@ -272,7 +277,7 @@ module.exports = {
_('Allow maximizing'), _('Allow maximizing'),
_('Enables or disables maximizing of the window by the user.'), _('Enables or disables maximizing of the window by the user.'),
_('Enable window maximizing: _PARAM0_'), _('Enable window maximizing: _PARAM0_'),
_('Advanced window management/Windows, Linux, macOS'), _('Windows, Linux, macOS'),
'res/actions/window24.png', 'res/actions/window24.png',
'res/actions/window.png' 'res/actions/window.png'
) )
@@ -290,7 +295,7 @@ module.exports = {
_('Window maximizable'), _('Window maximizable'),
_('Checks if the window can be maximized.'), _('Checks if the window can be maximized.'),
_('The window can be maximized'), _('The window can be maximized'),
_('Advanced window management/Windows, Linux, macOS'), _('Windows, Linux, macOS'),
'res/actions/window24.png', 'res/actions/window24.png',
'res/actions/window.png' 'res/actions/window.png'
) )
@@ -303,10 +308,10 @@ module.exports = {
extension extension
.addAction( .addAction(
'SetMinimizable', 'SetMinimizable',
_('Allow mimizing'), _('Allow minimizing'),
_('Enables or disables minimizing of the window by the user.'), _('Enables or disables minimizing of the window by the user.'),
_('Enable window minimizing: _PARAM0_'), _('Enable window minimizing: _PARAM0_'),
_('Advanced window management/Windows, Linux, macOS'), _('Windows, Linux, macOS'),
'res/actions/window24.png', 'res/actions/window24.png',
'res/actions/window.png' 'res/actions/window.png'
) )
@@ -324,7 +329,7 @@ module.exports = {
_('Window minimizable'), _('Window minimizable'),
_('Checks if the window can be minimized.'), _('Checks if the window can be minimized.'),
_('The window can be minimized'), _('The window can be minimized'),
_('Advanced window management/Windows, Linux, macOS'), _('Windows, Linux, macOS'),
'res/actions/window24.png', 'res/actions/window24.png',
'res/actions/window.png' 'res/actions/window.png'
) )
@@ -340,7 +345,7 @@ module.exports = {
_('Allow full-screening'), _('Allow full-screening'),
_('Enables or disables full-screening of the window by the user.'), _('Enables or disables full-screening of the window by the user.'),
_('Enable window full-screening: _PARAM0_'), _('Enable window full-screening: _PARAM0_'),
_('Advanced window management/Windows, Linux, macOS'), _('Windows, Linux, macOS'),
'res/actions/window24.png', 'res/actions/window24.png',
'res/actions/window.png' 'res/actions/window.png'
) )
@@ -358,7 +363,7 @@ module.exports = {
_('Window full-screenable'), _('Window full-screenable'),
_('Checks if the window can be full-screened.'), _('Checks if the window can be full-screened.'),
_('The window can be set in fullscreen'), _('The window can be set in fullscreen'),
_('Advanced window management/Windows, Linux, macOS'), _('Windows, Linux, macOS'),
'res/actions/window24.png', 'res/actions/window24.png',
'res/actions/window.png' 'res/actions/window.png'
) )
@@ -374,7 +379,7 @@ module.exports = {
_('Allow closing'), _('Allow closing'),
_('Enables or disables closing of the window by the user.'), _('Enables or disables closing of the window by the user.'),
_('Enable window closing: _PARAM0_'), _('Enable window closing: _PARAM0_'),
_('Advanced window management/Windows, Linux, macOS'), _('Windows, Linux, macOS'),
'res/actions/window24.png', 'res/actions/window24.png',
'res/actions/window.png' 'res/actions/window.png'
) )
@@ -392,7 +397,7 @@ module.exports = {
_('Window closable'), _('Window closable'),
_('Checks if the window can be closed.'), _('Checks if the window can be closed.'),
_('The window can be closed'), _('The window can be closed'),
_('Advanced window management/Windows, Linux, macOS'), _('Windows, Linux, macOS'),
'res/actions/window24.png', 'res/actions/window24.png',
'res/actions/window.png' 'res/actions/window.png'
) )
@@ -419,7 +424,7 @@ module.exports = {
_('Make the windows always on top'), _('Make the windows always on top'),
_('Puts the window constantly above all other windows.'), _('Puts the window constantly above all other windows.'),
_('Make window always on top: _PARAM0_, level: _PARAM1_'), _('Make window always on top: _PARAM0_, level: _PARAM1_'),
_('Advanced window management/Windows, Linux, macOS'), _('Windows, Linux, macOS'),
'res/actions/window24.png', 'res/actions/window24.png',
'res/actions/window.png' 'res/actions/window.png'
) )
@@ -449,7 +454,7 @@ module.exports = {
_('Window always on top'), _('Window always on top'),
_('Checks if the window is always on top.'), _('Checks if the window is always on top.'),
_('The window is always on top'), _('The window is always on top'),
_('Advanced window management/Windows, Linux, macOS'), _('Windows, Linux, macOS'),
'res/actions/window24.png', 'res/actions/window24.png',
'res/actions/window.png' 'res/actions/window.png'
) )
@@ -467,7 +472,7 @@ module.exports = {
'Puts the window in kiosk mode. This prevents the user from exiting fullscreen.' 'Puts the window in kiosk mode. This prevents the user from exiting fullscreen.'
), ),
_('Enable kiosk mode: _PARAM0_'), _('Enable kiosk mode: _PARAM0_'),
_('Advanced window management/Windows, Linux, macOS'), _('Windows, Linux, macOS'),
'res/actions/window24.png', 'res/actions/window24.png',
'res/actions/window.png' 'res/actions/window.png'
) )
@@ -485,7 +490,7 @@ module.exports = {
_('Kiosk mode'), _('Kiosk mode'),
_('Checks if the window is currently in kiosk mode.'), _('Checks if the window is currently in kiosk mode.'),
_('The window is in kiosk mode'), _('The window is in kiosk mode'),
_('Advanced window management/Windows, Linux, macOS'), _('Windows, Linux, macOS'),
'res/actions/window24.png', 'res/actions/window24.png',
'res/actions/window.png' 'res/actions/window.png'
) )
@@ -501,7 +506,7 @@ module.exports = {
_('Enable window shadow'), _('Enable window shadow'),
_('Enables or disables the window shadow.'), _('Enables or disables the window shadow.'),
_('Enable window shadow: _PARAM0_'), _('Enable window shadow: _PARAM0_'),
_('Advanced window management/Windows, Linux, macOS'), _('Windows, Linux, macOS'),
'res/actions/window24.png', 'res/actions/window24.png',
'res/actions/window.png' 'res/actions/window.png'
) )
@@ -519,7 +524,7 @@ module.exports = {
_('Shadow enabled'), _('Shadow enabled'),
_("Checks if the window currently has it's shadow enabled."), _("Checks if the window currently has it's shadow enabled."),
_('The window has a shadow'), _('The window has a shadow'),
_('Advanced window management/Windows, Linux, macOS'), _('Windows, Linux, macOS'),
'res/actions/window24.png', 'res/actions/window24.png',
'res/actions/window.png' 'res/actions/window.png'
) )
@@ -537,7 +542,7 @@ module.exports = {
'Enables or disables the content protection mode. This should prevent screenshots of the game from being taken.' 'Enables or disables the content protection mode. This should prevent screenshots of the game from being taken.'
), ),
_('Enable content protection: _PARAM0_'), _('Enable content protection: _PARAM0_'),
_('Advanced window management/Windows, Linux, macOS'), _('Windows, Linux, macOS'),
'res/actions/window24.png', 'res/actions/window24.png',
'res/actions/window.png' 'res/actions/window.png'
) )
@@ -555,7 +560,7 @@ module.exports = {
_('Allow focusing'), _('Allow focusing'),
_('Allow or disallow the user to focus the window.'), _('Allow or disallow the user to focus the window.'),
_('Allow to focus the window: _PARAM0_'), _('Allow to focus the window: _PARAM0_'),
_('Advanced window management/Windows, Linux, macOS'), _('Windows, Linux, macOS'),
'res/actions/window24.png', 'res/actions/window24.png',
'res/actions/window.png' 'res/actions/window.png'
) )
@@ -573,7 +578,7 @@ module.exports = {
_('Flash the window'), _('Flash the window'),
_('Make the window flash or end flashing.'), _('Make the window flash or end flashing.'),
_('Make the window flash: _PARAM0_'), _('Make the window flash: _PARAM0_'),
_('Advanced window management/Windows, Linux, macOS'), _('Windows, Linux, macOS'),
'res/actions/window24.png', 'res/actions/window24.png',
'res/actions/window.png' 'res/actions/window.png'
) )
@@ -591,12 +596,14 @@ module.exports = {
_('Set window opacity'), _('Set window opacity'),
_('Changes the window opacity.'), _('Changes the window opacity.'),
_('Set the window opacity to _PARAM0_'), _('Set the window opacity to _PARAM0_'),
_('Advanced window management/Windows, Linux, macOS'), _('Windows, Linux, macOS'),
'res/actions/window24.png', 'res/actions/window24.png',
'res/actions/window.png' 'res/actions/window.png'
) )
.addParameter('expression', _('New opacity'), '', false) .addParameter('expression', _('New opacity'), '', false)
.setParameterLongDescription('A number between 0 (fully transparent) and 1 (fully opaque).') .setParameterLongDescription(
'A number between 0 (fully transparent) and 1 (fully opaque).'
)
.getCodeExtraInformation() .getCodeExtraInformation()
.setIncludeFile( .setIncludeFile(
'Extensions/AdvancedWindow/electron-advancedwindowtools.js' 'Extensions/AdvancedWindow/electron-advancedwindowtools.js'
@@ -609,7 +616,7 @@ module.exports = {
_('Set window position'), _('Set window position'),
_('Changes the window position.'), _('Changes the window position.'),
_('Set the window position to _PARAM0_;_PARAM1_'), _('Set the window position to _PARAM0_;_PARAM1_'),
_('Advanced window management/Windows, Linux, macOS'), _('Windows, Linux, macOS'),
'res/actions/window24.png', 'res/actions/window24.png',
'res/actions/window.png' 'res/actions/window.png'
) )
@@ -626,7 +633,7 @@ module.exports = {
'WindowX', 'WindowX',
_('Window X position'), _('Window X position'),
_('Returns the current window X position.'), _('Returns the current window X position.'),
_('Advanced window management/Windows, Linux, macOS'), _('Windows, Linux, macOS'),
'res/actions/window.png' 'res/actions/window.png'
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -640,7 +647,7 @@ module.exports = {
'WindowY', 'WindowY',
_('Window Y position'), _('Window Y position'),
_('Returns the current window Y position.'), _('Returns the current window Y position.'),
_('Advanced window management/Windows, Linux, macOS'), _('Windows, Linux, macOS'),
'res/actions/window.png' 'res/actions/window.png'
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -656,7 +663,7 @@ module.exports = {
_( _(
'Returns the current window opacity (a number from 0 to 1, 1 being fully opaque).' 'Returns the current window opacity (a number from 0 to 1, 1 being fully opaque).'
), ),
_('Advanced window management/Windows, Linux, macOS'), _('Windows, Linux, macOS'),
'res/actions/window.png' 'res/actions/window.png'
) )
.getCodeExtraInformation() .getCodeExtraInformation()

View File

@@ -23,7 +23,7 @@ void DeclareAnchorBehaviorExtension(gd::PlatformExtension& extension) {
"AnchorBehavior", "AnchorBehavior",
_("Anchor"), _("Anchor"),
"Anchor", "Anchor",
_("Behavior that anchors objects to the window's bounds."), _("Anchor objects to the window's bounds."),
"", "",
"CppPlatform/Extensions/AnchorIcon.png", "CppPlatform/Extensions/AnchorIcon.png",
"AnchorBehavior", "AnchorBehavior",

View File

@@ -67,19 +67,22 @@ module.exports = {
.getOrCreate('color') .getOrCreate('color')
.setValue(objectContent.color) .setValue(objectContent.color)
.setType('color') .setType('color')
.setLabel(_('Base color')); .setLabel(_('Base color'))
.setGroup(_('Appearance'));
objectProperties objectProperties
.getOrCreate('opacity') .getOrCreate('opacity')
.setValue(objectContent.opacity.toString()) .setValue(objectContent.opacity.toString())
.setType('number') .setType('number')
.setLabel(_('Opacity (0-255)')); .setLabel(_('Opacity (0-255)'))
.setGroup(_('Appearance'));
objectProperties objectProperties
.getOrCreate('fontSize') .getOrCreate('fontSize')
.setValue(objectContent.fontSize.toString()) .setValue(objectContent.fontSize.toString())
.setType('number') .setType('number')
.setLabel(_('Base size')); .setLabel(_('Base size'))
.setGroup(_('Font'));
objectProperties objectProperties
.getOrCreate('align') .getOrCreate('align')
@@ -88,33 +91,36 @@ module.exports = {
.addExtraInfo('left') .addExtraInfo('left')
.addExtraInfo('center') .addExtraInfo('center')
.addExtraInfo('right') .addExtraInfo('right')
.setLabel(_('Base alignment')); .setLabel(_('Base alignment'))
.setGroup(_('Appearance'));
objectProperties objectProperties
.getOrCreate('fontFamily') .getOrCreate('fontFamily')
.setValue(objectContent.fontFamily) .setValue(objectContent.fontFamily)
.setType('resource') .setType('resource')
.addExtraInfo('font') .addExtraInfo('font')
.setLabel(_('Base font family')); .setLabel(_('Font'))
.setGroup(_('Font'));
objectProperties objectProperties
.getOrCreate('wordWrap') .getOrCreate('wordWrap')
.setValue(objectContent.wordWrap ? 'true' : 'false') .setValue(objectContent.wordWrap ? 'true' : 'false')
.setType('boolean') .setType('boolean')
.setLabel(_('Word wrapping')); .setLabel(_('Word wrapping'))
.setGroup(_('Appearance'));
objectProperties objectProperties
.getOrCreate('visible') .getOrCreate('visible')
.setValue(objectContent.visible ? 'true' : 'false') .setValue(objectContent.visible ? 'true' : 'false')
.setType('boolean') .setType('boolean')
.setLabel(_('Visible on start')); .setLabel(_('Visible on start'))
.setGroup(_('Appearance'));
return objectProperties; return objectProperties;
}; };
objectBBText.setRawJSONContent( objectBBText.setRawJSONContent(
JSON.stringify({ JSON.stringify({
text: text: '[b]bold[/b] [i]italic[/i] [size=15]smaller[/size] [font=times]times[/font] font\n[spacing=12]spaced out[/spacing]\n[outline=yellow]outlined[/outline] [shadow=red]DropShadow[/shadow] ',
'[b]bold[/b] [i]italic[/i] [size=15]smaller[/size] [font=times]times[/font] font\n[spacing=12]spaced out[/spacing]\n[outline=yellow]outlined[/outline] [shadow=red]DropShadow[/shadow] ',
opacity: 255, opacity: 255,
fontSize: 20, fontSize: 20,
visible: true, visible: true,
@@ -161,7 +167,8 @@ module.exports = {
.addIncludeFile('Extensions/BBText/bbtextruntimeobject-pixi-renderer.js') .addIncludeFile('Extensions/BBText/bbtextruntimeobject-pixi-renderer.js')
.addIncludeFile( .addIncludeFile(
'Extensions/BBText/pixi-multistyle-text/dist/pixi-multistyle-text.umd.js' 'Extensions/BBText/pixi-multistyle-text/dist/pixi-multistyle-text.umd.js'
); )
.setCategoryFullName(_('Texts'));
/** /**
* Utility function to add both a setter and a getter to a property from a list. * Utility function to add both a setter and a getter to a property from a list.
@@ -511,7 +518,8 @@ module.exports = {
this._pixiObject.alpha = opacity / 255; this._pixiObject.alpha = opacity / 255;
const color = properties.get('color').getValue(); const color = properties.get('color').getValue();
this._pixiObject.textStyles.default.fill = objectsRenderingService.rgbOrHexToHexNumber(color); this._pixiObject.textStyles.default.fill =
objectsRenderingService.rgbOrHexToHexNumber(color);
const fontSize = properties.get('fontSize').getValue(); const fontSize = properties.get('fontSize').getValue();
this._pixiObject.textStyles.default.fontSize = `${fontSize}px`; this._pixiObject.textStyles.default.fontSize = `${fontSize}px`;

View File

@@ -29,7 +29,9 @@ module.exports = {
.setExtensionInformation( .setExtensionInformation(
'BitmapText', 'BitmapText',
_('Bitmap Text'), _('Bitmap Text'),
_('Displays a text using a "Bitmap Font" (an image representing characters). This is more performant than a traditional Text object and it allows for complete control on the characters aesthetic.'), _(
'Displays a text using a "Bitmap Font" (an image representing characters). This is more performant than a traditional Text object and it allows for complete control on the characters aesthetic.'
),
'Aurélien Vivet', 'Aurélien Vivet',
'Open source (MIT License)' 'Open source (MIT License)'
) )
@@ -67,7 +69,8 @@ module.exports = {
.getOrCreate('opacity') .getOrCreate('opacity')
.setValue(objectContent.opacity.toString()) .setValue(objectContent.opacity.toString())
.setType('number') .setType('number')
.setLabel(_('Opacity (0-255)')); .setLabel(_('Opacity (0-255)'))
.setGroup(_('Appearance'));
objectProperties objectProperties
.getOrCreate('align') .getOrCreate('align')
@@ -76,46 +79,51 @@ module.exports = {
.addExtraInfo('left') .addExtraInfo('left')
.addExtraInfo('center') .addExtraInfo('center')
.addExtraInfo('right') .addExtraInfo('right')
.setLabel(_('Alignment, when multiple lines are displayed')); .setLabel(_('Alignment, when multiple lines are displayed'))
.setGroup(_('Appearance'));
objectProperties objectProperties
.getOrCreate('bitmapFontResourceName') .getOrCreate('bitmapFontResourceName')
.setValue(objectContent.bitmapFontResourceName) .setValue(objectContent.bitmapFontResourceName)
.setType('resource') .setType('resource')
.addExtraInfo('bitmapFont') //fnt or xml files .addExtraInfo('bitmapFont') //fnt or xml files
.setLabel(_('Bitmap Font')); .setLabel(_('Bitmap Font'))
.setGroup(_("Font"));
objectProperties objectProperties
.getOrCreate('textureAtlasResourceName') .getOrCreate('textureAtlasResourceName')
.setValue(objectContent.textureAtlasResourceName) .setValue(objectContent.textureAtlasResourceName)
.setType('resource') .setType('resource')
.addExtraInfo('image') .addExtraInfo('image')
.setLabel(_('Bitmap atlas image')); .setLabel(_('Bitmap atlas image'))
.setGroup(_("Font"));
objectProperties objectProperties
.getOrCreate('scale') .getOrCreate('scale')
.setValue(objectContent.scale.toString()) .setValue(objectContent.scale.toString())
.setType('number') .setType('number')
.setLabel(_('Text scale')); .setLabel(_('Text scale'))
.setGroup(_('Appearance'));
objectProperties objectProperties
.getOrCreate('tint') .getOrCreate('tint')
.setValue(objectContent.tint) .setValue(objectContent.tint)
.setType('color') .setType('color')
.setLabel(_('Font tint')); .setLabel(_('Font tint'))
.setGroup(_("Font"));
objectProperties objectProperties
.getOrCreate('wordWrap') .getOrCreate('wordWrap')
.setValue(objectContent.wordWrap ? 'true' : 'false') .setValue(objectContent.wordWrap ? 'true' : 'false')
.setType('boolean') .setType('boolean')
.setLabel(_('Word wrapping')); .setLabel(_('Word wrapping'))
.setGroup(_('Appearance'));
return objectProperties; return objectProperties;
}; };
bitmapTextObject.setRawJSONContent( bitmapTextObject.setRawJSONContent(
JSON.stringify({ JSON.stringify({
text: text: 'This text use the default bitmap font.\nUse a custom Bitmap Font to create your own texts.',
'This text use the default bitmap font.\nUse a custom Bitmap Font to create your own texts.',
opacity: 255, opacity: 255,
scale: 1, scale: 1,
fontSize: 20, fontSize: 20,
@@ -162,7 +170,8 @@ module.exports = {
.setIncludeFile('Extensions/BitmapText/bitmaptextruntimeobject.js') .setIncludeFile('Extensions/BitmapText/bitmaptextruntimeobject.js')
.addIncludeFile( .addIncludeFile(
'Extensions/BitmapText/bitmaptextruntimeobject-pixi-renderer.js' 'Extensions/BitmapText/bitmaptextruntimeobject-pixi-renderer.js'
); )
.setCategoryFullName(_('Texts'));
object object
.addExpressionAndConditionAndAction( .addExpressionAndConditionAndAction(
@@ -265,7 +274,12 @@ module.exports = {
'res/actions/font.png' 'res/actions/font.png'
) )
.addParameter('object', _('Bitmap text'), 'BitmapTextObject', false) .addParameter('object', _('Bitmap text'), 'BitmapTextObject', false)
.addParameter('bitmapFontResource', _('Bitmap font resource name'), '', false) .addParameter(
'bitmapFontResource',
_('Bitmap font resource name'),
'',
false
)
.setParameterLongDescription( .setParameterLongDescription(
'The resource name of the font file, without quotes.' 'The resource name of the font file, without quotes.'
) )
@@ -384,7 +398,7 @@ module.exports = {
objectsEditorService.registerEditorConfiguration( objectsEditorService.registerEditorConfiguration(
'BitmapText::BitmapTextObject', 'BitmapText::BitmapTextObject',
objectsEditorService.getDefaultObjectJsImplementationPropertiesEditor({ objectsEditorService.getDefaultObjectJsImplementationPropertiesEditor({
helpPagePath: '/objects/bitmaptext', helpPagePath: '/objects/bitmap_text',
}) })
); );
}, },
@@ -634,7 +648,8 @@ module.exports = {
this._pixiObject.align = align; this._pixiObject.align = align;
const color = properties.get('tint').getValue(); const color = properties.get('tint').getValue();
this._pixiObject.tint = objectsRenderingService.rgbOrHexToHexNumber(color); this._pixiObject.tint =
objectsRenderingService.rgbOrHexToHexNumber(color);
const scale = properties.get('scale').getValue() || 1; const scale = properties.get('scale').getValue() || 1;
this._pixiObject.scale.set(scale); this._pixiObject.scale.set(scale);

View File

@@ -25,13 +25,18 @@ module.exports = {
gd /*: libGDevelop */ gd /*: libGDevelop */
) { ) {
const extension = new gd.PlatformExtension(); const extension = new gd.PlatformExtension();
extension.setExtensionInformation( extension
'DebuggerTools', .setExtensionInformation(
_('Debugger Tools'), 'DebuggerTools',
_('Allow to interact with the editor debugger from the game.'), _('Debugger Tools'),
'Arthur Pacaud (arthuro555), Aurélien Vivet (Bouh)', _('Allow to interact with the editor debugger from the game.'),
'MIT' 'Arthur Pacaud (arthuro555), Aurélien Vivet (Bouh)',
); 'MIT'
)
.setCategory('Advanced');
extension
.addInstructionOrExpressionGroupMetadata(_('Debugger Tools'))
.setIcon('res/actions/bug32.png');
extension extension
.addAction( .addAction(
@@ -42,7 +47,7 @@ module.exports = {
'Note that events will be still executed until the end before the game is paused.' 'Note that events will be still executed until the end before the game is paused.'
), ),
_('Pause game execution'), _('Pause game execution'),
_('Debugger Tools'), '',
'res/actions/bug32.png', 'res/actions/bug32.png',
'res/actions/bug32.png' 'res/actions/bug32.png'
) )
@@ -61,7 +66,7 @@ module.exports = {
_( _(
'Enable debugging view of bounding boxes/collision masks: _PARAM1_ (include invisible objects: _PARAM2_, point names: _PARAM3_, custom points: _PARAM4_)' 'Enable debugging view of bounding boxes/collision masks: _PARAM1_ (include invisible objects: _PARAM2_, point names: _PARAM3_, custom points: _PARAM4_)'
), ),
_('Debugger Tools'), '',
'res/actions/planicon24.png', 'res/actions/planicon24.png',
'res/actions/planicon.png' 'res/actions/planicon.png'
) )
@@ -91,7 +96,7 @@ module.exports = {
_( _(
'Log message _PARAM0_ of type _PARAM1_ to the console in group _PARAM2_' 'Log message _PARAM0_ of type _PARAM1_ to the console in group _PARAM2_'
), ),
_('Debugger Tools'), '',
'res/actions/bug32.png', 'res/actions/bug32.png',
'res/actions/bug32.png' 'res/actions/bug32.png'
) )

View File

@@ -15,7 +15,7 @@ class SerializerElement;
} }
/** /**
* \brief Behavior that allows objects to be dragged with the mouse (or touch). * \brief Behavior that destroys object outside the screen.
*/ */
class GD_EXTENSION_API DestroyOutsideBehavior : public gd::Behavior { class GD_EXTENSION_API DestroyOutsideBehavior : public gd::Behavior {
public: public:

View File

@@ -26,7 +26,7 @@ void DeclareDestroyOutsideBehaviorExtension(gd::PlatformExtension& extension) {
extension.AddBehavior("DestroyOutside", extension.AddBehavior("DestroyOutside",
_("Destroy when outside of the screen"), _("Destroy when outside of the screen"),
_("DestroyOutside"), _("DestroyOutside"),
_("Automatically destroy the object when it goes " _("Destroy objects automatically when they go "
"outside of the screen's borders."), "outside of the screen's borders."),
"", "",
"CppPlatform/Extensions/destroyoutsideicon.png", "CppPlatform/Extensions/destroyoutsideicon.png",

View File

@@ -30,7 +30,10 @@ module.exports = {
), ),
"Matthias Meike", "Matthias Meike",
"Open source (MIT License)" "Open source (MIT License)"
).setExtensionHelpPath("/all-features/device-sensors"); ).setExtensionHelpPath("/all-features/device-sensors")
.setCategory('Device');
extension.addInstructionOrExpressionGroupMetadata(_("Device sensors"))
.setIcon("JsPlatform/Extensions/orientation_active32.png");
extension extension
.addCondition( .addCondition(
@@ -40,8 +43,8 @@ module.exports = {
"The condition is true if the device orientation sensor is currently active" "The condition is true if the device orientation sensor is currently active"
), ),
_("Orientation sensor is active"), _("Orientation sensor is active"),
_("Sensors/Orientation"), _("Orientation"),
"JsPlatform/Extensions/orientation_active24.png", "JsPlatform/Extensions/orientation_active32.png",
"JsPlatform/Extensions/orientation_active32.png" "JsPlatform/Extensions/orientation_active32.png"
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -58,8 +61,8 @@ module.exports = {
"Compare the value of orientation alpha. (Range: 0 to 360°)" "Compare the value of orientation alpha. (Range: 0 to 360°)"
), ),
_("the orientation alpha"), _("the orientation alpha"),
_("Sensors/Orientation"), _("Orientation"),
"JsPlatform/Extensions/orientation_alpha24.png", "JsPlatform/Extensions/orientation_alpha32.png",
"JsPlatform/Extensions/orientation_alpha32.png" "JsPlatform/Extensions/orientation_alpha32.png"
) )
.addParameter("relationalOperator", _("Sign of the test"), "number") .addParameter("relationalOperator", _("Sign of the test"), "number")
@@ -78,8 +81,8 @@ module.exports = {
"Compare the value of orientation beta. (Range: -180 to 180°)" "Compare the value of orientation beta. (Range: -180 to 180°)"
), ),
_("the orientation beta"), _("the orientation beta"),
_("Sensors/Orientation"), _("Orientation"),
"JsPlatform/Extensions/orientation_beta24.png", "JsPlatform/Extensions/orientation_beta32.png",
"JsPlatform/Extensions/orientation_beta32.png" "JsPlatform/Extensions/orientation_beta32.png"
) )
.addParameter("relationalOperator", _("Sign of the test"), "number") .addParameter("relationalOperator", _("Sign of the test"), "number")
@@ -98,8 +101,8 @@ module.exports = {
"Compare the value of orientation gamma. (Range: -90 to 90°)" "Compare the value of orientation gamma. (Range: -90 to 90°)"
), ),
_("the orientation gamma"), _("the orientation gamma"),
_("Sensors/Orientation"), _("Orientation"),
"JsPlatform/Extensions/orientation_gamma24.png", "JsPlatform/Extensions/orientation_gamma32.png",
"JsPlatform/Extensions/orientation_gamma32.png" "JsPlatform/Extensions/orientation_gamma32.png"
) )
.addParameter("relationalOperator", _("Sign of the test"), "number") .addParameter("relationalOperator", _("Sign of the test"), "number")
@@ -116,8 +119,8 @@ module.exports = {
_("Activate orientation sensor"), _("Activate orientation sensor"),
_("Activate the orientation sensor. (remember to turn it off again)"), _("Activate the orientation sensor. (remember to turn it off again)"),
_("Activate the orientation sensor."), _("Activate the orientation sensor."),
_("Sensors/Orientation"), _("Orientation"),
"JsPlatform/Extensions/orientation_active24.png", "JsPlatform/Extensions/orientation_active32.png",
"JsPlatform/Extensions/orientation_active32.png" "JsPlatform/Extensions/orientation_active32.png"
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -132,8 +135,8 @@ module.exports = {
_("Deactivate orientation sensor"), _("Deactivate orientation sensor"),
_("Deactivate the orientation sensor."), _("Deactivate the orientation sensor."),
_("Deactivate the orientation sensor."), _("Deactivate the orientation sensor."),
_("Sensors/Orientation"), _("Orientation"),
"JsPlatform/Extensions/orientation_inactive24.png", "JsPlatform/Extensions/orientation_inactive32.png",
"JsPlatform/Extensions/orientation_inactive32.png" "JsPlatform/Extensions/orientation_inactive32.png"
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -147,7 +150,7 @@ module.exports = {
"OrientationAbsolute", "OrientationAbsolute",
_("Is Absolute"), _("Is Absolute"),
_("Get if the devices orientation is absolute and not relative"), _("Get if the devices orientation is absolute and not relative"),
_("Sensors/Orientation"), _("Orientation"),
"JsPlatform/Extensions/orientation_absolute16.png" "JsPlatform/Extensions/orientation_absolute16.png"
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -161,7 +164,7 @@ module.exports = {
"OrientationAlpha", "OrientationAlpha",
_("Alpha value"), _("Alpha value"),
_("Get the devices orientation Alpha (compass)"), _("Get the devices orientation Alpha (compass)"),
_("Sensors/Orientation"), _("Orientation"),
"JsPlatform/Extensions/orientation_alpha16.png" "JsPlatform/Extensions/orientation_alpha16.png"
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -175,7 +178,7 @@ module.exports = {
"OrientationBeta", "OrientationBeta",
_("Beta value"), _("Beta value"),
_("Get the devices orientation Beta"), _("Get the devices orientation Beta"),
_("Sensors/Orientation"), _("Orientation"),
"JsPlatform/Extensions/orientation_beta16.png" "JsPlatform/Extensions/orientation_beta16.png"
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -189,7 +192,7 @@ module.exports = {
"OrientationGamma", "OrientationGamma",
_("Gamma value"), _("Gamma value"),
_("Get the devices orientation Gamma value"), _("Get the devices orientation Gamma value"),
_("Sensors/Orientation"), _("Orientation"),
"JsPlatform/Extensions/orientation_gamma16.png" "JsPlatform/Extensions/orientation_gamma16.png"
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -206,8 +209,8 @@ module.exports = {
"The condition is true if the device motion sensor is currently active" "The condition is true if the device motion sensor is currently active"
), ),
_("Motion sensor is active"), _("Motion sensor is active"),
_("Sensors/Motion"), _("Motion"),
"JsPlatform/Extensions/motion_active24.png", "JsPlatform/Extensions/motion_active32.png",
"JsPlatform/Extensions/motion_active32.png" "JsPlatform/Extensions/motion_active32.png"
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -224,8 +227,8 @@ module.exports = {
"Compare the value of rotation alpha. (Note: few devices support this sensor)" "Compare the value of rotation alpha. (Note: few devices support this sensor)"
), ),
_("the rotation alpha"), _("the rotation alpha"),
_("Sensors/Motion"), _("Motion"),
"JsPlatform/Extensions/motion_rotation_alpha24.png", "JsPlatform/Extensions/motion_rotation_alpha32.png",
"JsPlatform/Extensions/motion_rotation_alpha32.png" "JsPlatform/Extensions/motion_rotation_alpha32.png"
) )
.addParameter("relationalOperator", _("Sign of the test"), "number") .addParameter("relationalOperator", _("Sign of the test"), "number")
@@ -244,8 +247,8 @@ module.exports = {
"Compare the value of rotation beta. (Note: few devices support this sensor)" "Compare the value of rotation beta. (Note: few devices support this sensor)"
), ),
_("the rotation beta"), _("the rotation beta"),
_("Sensors/Motion"), _("Motion"),
"JsPlatform/Extensions/motion_rotation_beta24.png", "JsPlatform/Extensions/motion_rotation_beta32.png",
"JsPlatform/Extensions/motion_rotation_beta32.png" "JsPlatform/Extensions/motion_rotation_beta32.png"
) )
.addParameter("relationalOperator", _("Sign of the test"), "number") .addParameter("relationalOperator", _("Sign of the test"), "number")
@@ -264,8 +267,8 @@ module.exports = {
"Compare the value of rotation gamma. (Note: few devices support this sensor)" "Compare the value of rotation gamma. (Note: few devices support this sensor)"
), ),
_("the rotation gamma"), _("the rotation gamma"),
_("Sensors/Motion"), _("Motion"),
"JsPlatform/Extensions/motion_rotation_gamma24.png", "JsPlatform/Extensions/motion_rotation_gamma32.png",
"JsPlatform/Extensions/motion_rotation_gamma32.png" "JsPlatform/Extensions/motion_rotation_gamma32.png"
) )
.addParameter("relationalOperator", _("Sign of the test"), "number") .addParameter("relationalOperator", _("Sign of the test"), "number")
@@ -284,8 +287,8 @@ module.exports = {
"Compare the value of acceleration on the X-axis (m/s²)." "Compare the value of acceleration on the X-axis (m/s²)."
), ),
_("the acceleration X"), _("the acceleration X"),
_("Sensors/Motion"), _("Motion"),
"JsPlatform/Extensions/motion_acceleration_x24.png", "JsPlatform/Extensions/motion_acceleration_x32.png",
"JsPlatform/Extensions/motion_acceleration_x32.png" "JsPlatform/Extensions/motion_acceleration_x32.png"
) )
.addParameter("relationalOperator", _("Sign of the test"), "number") .addParameter("relationalOperator", _("Sign of the test"), "number")
@@ -304,8 +307,8 @@ module.exports = {
"Compare the value of acceleration on the Y-axis (m/s²)." "Compare the value of acceleration on the Y-axis (m/s²)."
), ),
_("the acceleration Y"), _("the acceleration Y"),
_("Sensors/Motion"), _("Motion"),
"JsPlatform/Extensions/motion_acceleration_y24.png", "JsPlatform/Extensions/motion_acceleration_y32.png",
"JsPlatform/Extensions/motion_acceleration_y32.png" "JsPlatform/Extensions/motion_acceleration_y32.png"
) )
.addParameter("relationalOperator", _("Sign of the test"), "number") .addParameter("relationalOperator", _("Sign of the test"), "number")
@@ -324,8 +327,8 @@ module.exports = {
"Compare the value of acceleration on the Z-axis (m/s²)." "Compare the value of acceleration on the Z-axis (m/s²)."
), ),
_("the acceleration Z"), _("the acceleration Z"),
_("Sensors/Motion"), _("Motion"),
"JsPlatform/Extensions/motion_acceleration_z24.png", "JsPlatform/Extensions/motion_acceleration_z32.png",
"JsPlatform/Extensions/motion_acceleration_z32.png" "JsPlatform/Extensions/motion_acceleration_z32.png"
) )
.addParameter("relationalOperator", _("Sign of the test"), "number") .addParameter("relationalOperator", _("Sign of the test"), "number")
@@ -342,8 +345,8 @@ module.exports = {
_("Activate motion sensor"), _("Activate motion sensor"),
_("Activate the motion sensor. (remember to turn it off again)"), _("Activate the motion sensor. (remember to turn it off again)"),
_("Activate the motion sensor."), _("Activate the motion sensor."),
_("Sensors/Motion"), _("Motion"),
"JsPlatform/Extensions/motion_active24.png", "JsPlatform/Extensions/motion_active32.png",
"JsPlatform/Extensions/motion_active32.png" "JsPlatform/Extensions/motion_active32.png"
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -358,8 +361,8 @@ module.exports = {
_("Deactivate motion sensor"), _("Deactivate motion sensor"),
_("Deactivate the motion sensor."), _("Deactivate the motion sensor."),
_("Deactivate the motion sensor."), _("Deactivate the motion sensor."),
_("Sensors/Motion"), _("Motion"),
"JsPlatform/Extensions/motion_inactive24.png", "JsPlatform/Extensions/motion_inactive32.png",
"JsPlatform/Extensions/motion_inactive32.png" "JsPlatform/Extensions/motion_inactive32.png"
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -373,7 +376,7 @@ module.exports = {
"RotationAlpha", "RotationAlpha",
_("Alpha value"), _("Alpha value"),
_("Get the devices rotation Alpha"), _("Get the devices rotation Alpha"),
_("Sensors/Motion"), _("Motion"),
"JsPlatform/Extensions/motion_rotation_alpha16.png" "JsPlatform/Extensions/motion_rotation_alpha16.png"
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -387,7 +390,7 @@ module.exports = {
"RotationBeta", "RotationBeta",
_("Beta value"), _("Beta value"),
_("Get the devices rotation Beta"), _("Get the devices rotation Beta"),
_("Sensors/Motion"), _("Motion"),
"JsPlatform/Extensions/motion_rotation_beta16.png" "JsPlatform/Extensions/motion_rotation_beta16.png"
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -401,7 +404,7 @@ module.exports = {
"RotationGamma", "RotationGamma",
_("Gamma value"), _("Gamma value"),
_("Get the devices rotation Gamma"), _("Get the devices rotation Gamma"),
_("Sensors/Motion"), _("Motion"),
"JsPlatform/Extensions/motion_rotation_gamma16.png" "JsPlatform/Extensions/motion_rotation_gamma16.png"
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -415,7 +418,7 @@ module.exports = {
"AccelerationX", "AccelerationX",
_("Acceleration X value"), _("Acceleration X value"),
_("Get the devices acceleration on the X-axis (m/s²)"), _("Get the devices acceleration on the X-axis (m/s²)"),
_("Sensors/Motion"), _("Motion"),
"JsPlatform/Extensions/motion_acceleration_x16.png" "JsPlatform/Extensions/motion_acceleration_x16.png"
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -429,7 +432,7 @@ module.exports = {
"AccelerationY", "AccelerationY",
_("Acceleration Y value"), _("Acceleration Y value"),
_("Get the devices acceleration on the Y-axis (m/s²)"), _("Get the devices acceleration on the Y-axis (m/s²)"),
_("Sensors/Motion"), _("Motion"),
"JsPlatform/Extensions/motion_acceleration_y16.png" "JsPlatform/Extensions/motion_acceleration_y16.png"
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -443,7 +446,7 @@ module.exports = {
"AccelerationZ", "AccelerationZ",
_("Acceleration Z value"), _("Acceleration Z value"),
_("Get the devices acceleration on the Z-axis (m/s²)"), _("Get the devices acceleration on the Z-axis (m/s²)"),
_("Sensors/Motion"), _("Motion"),
"JsPlatform/Extensions/motion_acceleration_z16.png" "JsPlatform/Extensions/motion_acceleration_z16.png"
) )
.getCodeExtraInformation() .getCodeExtraInformation()

View File

@@ -34,7 +34,10 @@ module.exports = {
'Matthias Meike', 'Matthias Meike',
'Open source (MIT License)' 'Open source (MIT License)'
) )
.setExtensionHelpPath('/all-features/device-vibration'); .setExtensionHelpPath('/all-features/device-vibration')
.setCategory('Device');
extension.addInstructionOrExpressionGroupMetadata(_("Device vibration"))
.setIcon("JsPlatform/Extensions/vibration_start32.png");
extension extension
.addDependency() .addDependency()
@@ -49,8 +52,8 @@ module.exports = {
_('Vibrate'), _('Vibrate'),
_('Vibrate (Duration in ms).'), _('Vibrate (Duration in ms).'),
_('Start vibration for _PARAM0_ ms'), _('Start vibration for _PARAM0_ ms'),
_('Vibration'), '',
'JsPlatform/Extensions/vibration_start24.png', 'JsPlatform/Extensions/vibration_start32.png',
'JsPlatform/Extensions/vibration_start32.png' 'JsPlatform/Extensions/vibration_start32.png'
) )
.addParameter('expression', _('Duration'), '', false) .addParameter('expression', _('Duration'), '', false)
@@ -66,8 +69,8 @@ module.exports = {
'Vibrate (Duration in ms). You can add multiple comma-separated values where every second value determines the period of silence between two vibrations. This is a string value so use quotes.' 'Vibrate (Duration in ms). You can add multiple comma-separated values where every second value determines the period of silence between two vibrations. This is a string value so use quotes.'
), ),
_('Start vibration for _PARAM0_ ms'), _('Start vibration for _PARAM0_ ms'),
_('Vibration'), '',
'JsPlatform/Extensions/vibration_pattern_start24.png', 'JsPlatform/Extensions/vibration_pattern_start32.png',
'JsPlatform/Extensions/vibration_pattern_start32.png' 'JsPlatform/Extensions/vibration_pattern_start32.png'
) )
.addParameter( .addParameter(
@@ -86,8 +89,8 @@ module.exports = {
_('Stop vibration'), _('Stop vibration'),
_('Stop the vibration'), _('Stop the vibration'),
_('Stop vibration'), _('Stop vibration'),
_('Vibration'), '',
'JsPlatform/Extensions/vibration_stop24.png', 'JsPlatform/Extensions/vibration_stop32.png',
'JsPlatform/Extensions/vibration_stop32.png' 'JsPlatform/Extensions/vibration_stop32.png'
) )
.getCodeExtraInformation() .getCodeExtraInformation()

View File

@@ -28,12 +28,16 @@ module.exports = {
extension extension
.setExtensionInformation( .setExtensionInformation(
'DialogueTree', 'DialogueTree',
_('Dialogue Tree (Experimental)'), _('Dialogue Tree (experimental)'),
'Handle dialogue trees, made using Yarn Spinner. Useful to make complex dialogues with multiple choices. The Yarn Spinner editor is embedded in GDevelop so you can edit your dialogues without leaving GDevelop.', 'Handle dialogue trees, made using Yarn Spinner. Useful to make complex dialogues with multiple choices. The Yarn Spinner editor is embedded in GDevelop so you can edit your dialogues without leaving GDevelop.',
'Todor Imreorov', 'Todor Imreorov',
'Open source (MIT License)' 'Open source (MIT License)'
) )
.setExtensionHelpPath('/all-features/dialogue-tree'); .setExtensionHelpPath('/all-features/dialogue-tree')
.setCategory('Advanced');
extension
.addInstructionOrExpressionGroupMetadata(_('Dialogue Tree (experimental)'))
.setIcon('JsPlatform/Extensions/yarn32.png');
extension extension
.addAction( .addAction(
@@ -43,8 +47,8 @@ module.exports = {
'Load a dialogue data object - Yarn json format, stored in a scene variable. Use this command to load all the Dialogue data at the beginning of the game.' 'Load a dialogue data object - Yarn json format, stored in a scene variable. Use this command to load all the Dialogue data at the beginning of the game.'
), ),
_('Load dialogue data from Scene variable _PARAM1_'), _('Load dialogue data from Scene variable _PARAM1_'),
_('Dialogue Tree (experimental)'), '',
'JsPlatform/Extensions/yarn24.png', 'JsPlatform/Extensions/yarn32.png',
'JsPlatform/Extensions/yarn32.png' 'JsPlatform/Extensions/yarn32.png'
) )
.addParameter( .addParameter(
@@ -66,8 +70,8 @@ module.exports = {
'Load a dialogue data object - Yarn json format, stored in a Json file. Use this command to load all the Dialogue data at the beginning of the game.' 'Load a dialogue data object - Yarn json format, stored in a Json file. Use this command to load all the Dialogue data at the beginning of the game.'
), ),
_('Load dialogue data from json file _PARAM1_'), _('Load dialogue data from json file _PARAM1_'),
_('Dialogue Tree (experimental)'), '',
'JsPlatform/Extensions/yarn24.png', 'JsPlatform/Extensions/yarn32.png',
'JsPlatform/Extensions/yarn32.png' 'JsPlatform/Extensions/yarn32.png'
) )
.addCodeOnlyParameter('currentScene', '') .addCodeOnlyParameter('currentScene', '')
@@ -90,8 +94,8 @@ module.exports = {
'Start dialogue from branch. Use this to initiate the dialogue from a specified branch.' 'Start dialogue from branch. Use this to initiate the dialogue from a specified branch.'
), ),
_('Start dialogue from branch _PARAM0_'), _('Start dialogue from branch _PARAM0_'),
_('Dialogue Tree (experimental)'), '',
'JsPlatform/Extensions/yarn24.png', 'JsPlatform/Extensions/yarn32.png',
'JsPlatform/Extensions/yarn32.png' 'JsPlatform/Extensions/yarn32.png'
) )
.addParameter('string', _('Dialogue branch'), '', false) .addParameter('string', _('Dialogue branch'), '', false)
@@ -104,8 +108,8 @@ module.exports = {
_('Stop running dialogue'), _('Stop running dialogue'),
_('Stop the running dialogue. Use this to interrupt dialogue parsing.'), _('Stop the running dialogue. Use this to interrupt dialogue parsing.'),
_('Stop running dialogue'), _('Stop running dialogue'),
_('Dialogue Tree (experimental)'), '',
'JsPlatform/Extensions/yarn24.png', 'JsPlatform/Extensions/yarn32.png',
'JsPlatform/Extensions/yarn32.png' 'JsPlatform/Extensions/yarn32.png'
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -119,8 +123,8 @@ module.exports = {
'Go to the next dialogue line. Use this to advance to the next dialogue line when the player presses a button.' 'Go to the next dialogue line. Use this to advance to the next dialogue line when the player presses a button.'
), ),
_('Go to the next dialogue line'), _('Go to the next dialogue line'),
_('Dialogue Tree (experimental)'), '',
'JsPlatform/Extensions/yarn24.png', 'JsPlatform/Extensions/yarn32.png',
'JsPlatform/Extensions/yarn32.png' 'JsPlatform/Extensions/yarn32.png'
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -134,8 +138,8 @@ module.exports = {
'Set the selected option as confirmed, which will validate it and go forward to the next node. Use other actions to select options (see "select next option" and "Select previous option").' 'Set the selected option as confirmed, which will validate it and go forward to the next node. Use other actions to select options (see "select next option" and "Select previous option").'
), ),
_('Confirm selected Option'), _('Confirm selected Option'),
_('Dialogue Tree (experimental)'), '',
'JsPlatform/Extensions/yarn24.png', 'JsPlatform/Extensions/yarn32.png',
'JsPlatform/Extensions/yarn32.png' 'JsPlatform/Extensions/yarn32.png'
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -149,8 +153,8 @@ module.exports = {
'Select next Option (add 1 to selected option number). Use this when the dialogue line is of type "options" and the player has pressed a button to change selected option.' 'Select next Option (add 1 to selected option number). Use this when the dialogue line is of type "options" and the player has pressed a button to change selected option.'
), ),
_('Select next Option'), _('Select next Option'),
_('Dialogue Tree (experimental)'), '',
'JsPlatform/Extensions/yarn24.png', 'JsPlatform/Extensions/yarn32.png',
'JsPlatform/Extensions/yarn32.png' 'JsPlatform/Extensions/yarn32.png'
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -164,8 +168,8 @@ module.exports = {
'Select previous Option (subtract 1 from selected option number). Use this when the dialogue line is of type "options" and the player has pressed a button to change selected option.' 'Select previous Option (subtract 1 from selected option number). Use this when the dialogue line is of type "options" and the player has pressed a button to change selected option.'
), ),
_('Select previous Option'), _('Select previous Option'),
_('Dialogue Tree (experimental)'), '',
'JsPlatform/Extensions/yarn24.png', 'JsPlatform/Extensions/yarn32.png',
'JsPlatform/Extensions/yarn32.png' 'JsPlatform/Extensions/yarn32.png'
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -179,8 +183,8 @@ module.exports = {
'Select option by number. Use this when the dialogue line is of type "options" and the player has pressed a button to change selected option.' 'Select option by number. Use this when the dialogue line is of type "options" and the player has pressed a button to change selected option.'
), ),
_('Select option at index _PARAM0_'), _('Select option at index _PARAM0_'),
_('Dialogue Tree (experimental)'), '',
'JsPlatform/Extensions/yarn24.png', 'JsPlatform/Extensions/yarn32.png',
'JsPlatform/Extensions/yarn32.png' 'JsPlatform/Extensions/yarn32.png'
) )
.addParameter('expression', _('Option index number'), '', false) .addParameter('expression', _('Option index number'), '', false)
@@ -195,8 +199,8 @@ module.exports = {
'Scroll clipped text. Use this with a timer and "get clipped text" when you want to create a typewriter effect. Every time the action runs, a new character appears from the text.' 'Scroll clipped text. Use this with a timer and "get clipped text" when you want to create a typewriter effect. Every time the action runs, a new character appears from the text.'
), ),
_('Scroll clipped text'), _('Scroll clipped text'),
_('Dialogue Tree (experimental)'), '',
'JsPlatform/Extensions/yarn24.png', 'JsPlatform/Extensions/yarn32.png',
'JsPlatform/Extensions/yarn32.png' 'JsPlatform/Extensions/yarn32.png'
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -210,8 +214,8 @@ module.exports = {
'Complete the clipped text scrolling. Use this action whenever you want to skip scrolling.' 'Complete the clipped text scrolling. Use this action whenever you want to skip scrolling.'
), ),
_('Complete clipped text scrolling'), _('Complete clipped text scrolling'),
_('Dialogue Tree (experimental)'), '',
'JsPlatform/Extensions/yarn24.png', 'JsPlatform/Extensions/yarn32.png',
'JsPlatform/Extensions/yarn32.png' 'JsPlatform/Extensions/yarn32.png'
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -225,8 +229,8 @@ module.exports = {
'Set dialogue state string variable. Use this to set a variable that the dialogue data is using.' 'Set dialogue state string variable. Use this to set a variable that the dialogue data is using.'
), ),
_('Set dialogue state string variable _PARAM0_ to _PARAM1_'), _('Set dialogue state string variable _PARAM0_ to _PARAM1_'),
_('Dialogue Tree (experimental)'), '',
'JsPlatform/Extensions/yarn24.png', 'JsPlatform/Extensions/yarn32.png',
'JsPlatform/Extensions/yarn32.png' 'JsPlatform/Extensions/yarn32.png'
) )
.addParameter('string', _('State Variable Name'), '', false) .addParameter('string', _('State Variable Name'), '', false)
@@ -242,8 +246,8 @@ module.exports = {
'Set dialogue state number variable. Use this to set a variable that the dialogue data is using.' 'Set dialogue state number variable. Use this to set a variable that the dialogue data is using.'
), ),
_('Set dialogue state number variable _PARAM0_ to _PARAM1_'), _('Set dialogue state number variable _PARAM0_ to _PARAM1_'),
_('Dialogue Tree (experimental)'), '',
'JsPlatform/Extensions/yarn24.png', 'JsPlatform/Extensions/yarn32.png',
'JsPlatform/Extensions/yarn32.png' 'JsPlatform/Extensions/yarn32.png'
) )
.addParameter('string', _('State Variable Name'), '', false) .addParameter('string', _('State Variable Name'), '', false)
@@ -259,8 +263,8 @@ module.exports = {
'Set dialogue state boolean variable. Use this to set a variable that the dialogue data is using.' 'Set dialogue state boolean variable. Use this to set a variable that the dialogue data is using.'
), ),
_('Set dialogue state boolean variable _PARAM0_ to _PARAM1_'), _('Set dialogue state boolean variable _PARAM0_ to _PARAM1_'),
_('Dialogue Tree (experimental)'), '',
'JsPlatform/Extensions/yarn24.png', 'JsPlatform/Extensions/yarn32.png',
'JsPlatform/Extensions/yarn32.png' 'JsPlatform/Extensions/yarn32.png'
) )
.addParameter('string', _('State Variable Name'), '', false) .addParameter('string', _('State Variable Name'), '', false)
@@ -276,8 +280,8 @@ module.exports = {
'Save dialogue state. Use this to store the dialogue state into a variable, which can later be used for saving the game. That way player choices can become part of the game save.' 'Save dialogue state. Use this to store the dialogue state into a variable, which can later be used for saving the game. That way player choices can become part of the game save.'
), ),
_('Save dialogue state to _PARAM0_'), _('Save dialogue state to _PARAM0_'),
_('Dialogue Tree (experimental)'), '',
'JsPlatform/Extensions/yarn24.png', 'JsPlatform/Extensions/yarn32.png',
'JsPlatform/Extensions/yarn32.png' 'JsPlatform/Extensions/yarn32.png'
) )
.addParameter('globalvar', _('Global Variable')) .addParameter('globalvar', _('Global Variable'))
@@ -292,8 +296,8 @@ module.exports = {
'Load dialogue state. Use this to restore dialogue state, if you have stored in a variable before with the "Save state" action.' 'Load dialogue state. Use this to restore dialogue state, if you have stored in a variable before with the "Save state" action.'
), ),
_('Load dialogue state from _PARAM0_'), _('Load dialogue state from _PARAM0_'),
_('Dialogue Tree (experimental)'), '',
'JsPlatform/Extensions/yarn24.png', 'JsPlatform/Extensions/yarn32.png',
'JsPlatform/Extensions/yarn32.png' 'JsPlatform/Extensions/yarn32.png'
) )
.addParameter('globalvar', _('Global Variable'), '', false) .addParameter('globalvar', _('Global Variable'), '', false)
@@ -308,8 +312,8 @@ module.exports = {
'Clear dialogue state. This resets all dialogue state accumulated by the player choices. Useful when the player is starting a new game.' 'Clear dialogue state. This resets all dialogue state accumulated by the player choices. Useful when the player is starting a new game.'
), ),
_('Clear dialogue state'), _('Clear dialogue state'),
_('Dialogue Tree (experimental)'), '',
'JsPlatform/Extensions/yarn24.png', 'JsPlatform/Extensions/yarn32.png',
'JsPlatform/Extensions/yarn32.png' 'JsPlatform/Extensions/yarn32.png'
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -320,7 +324,7 @@ module.exports = {
'LineText', 'LineText',
_('Get the current dialogue line text'), _('Get the current dialogue line text'),
_('Returns the current dialogue line text'), _('Returns the current dialogue line text'),
_('Dialogue Tree (experimental)'), '',
'JsPlatform/Extensions/yarn32.png' 'JsPlatform/Extensions/yarn32.png'
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -331,7 +335,7 @@ module.exports = {
'OptionsCount', 'OptionsCount',
_('Get the number of options in an options line type'), _('Get the number of options in an options line type'),
_('Get the number of options in an options line type'), _('Get the number of options in an options line type'),
_('Dialogue Tree (experimental)'), '',
'JsPlatform/Extensions/yarn32.png' 'JsPlatform/Extensions/yarn32.png'
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -344,7 +348,7 @@ module.exports = {
_( _(
"Get the text of an option from an Options line type, using the option's Number. The numbers start from 0." "Get the text of an option from an Options line type, using the option's Number. The numbers start from 0."
), ),
_('Dialogue Tree (experimental)'), '',
'JsPlatform/Extensions/yarn32.png' 'JsPlatform/Extensions/yarn32.png'
) )
.addParameter('expression', _('Option Index Number'), '', false) .addParameter('expression', _('Option Index Number'), '', false)
@@ -358,7 +362,7 @@ module.exports = {
_( _(
"Get the text of all available options from an Options line type as a horizontal list. You can also pass the selected option's cursor string, which by default is ->" "Get the text of all available options from an Options line type as a horizontal list. You can also pass the selected option's cursor string, which by default is ->"
), ),
_('Dialogue Tree (experimental)'), '',
'JsPlatform/Extensions/yarn32.png' 'JsPlatform/Extensions/yarn32.png'
) )
.addParameter('string', _('Options Selection Cursor'), '', false) .addParameter('string', _('Options Selection Cursor'), '', false)
@@ -373,7 +377,7 @@ module.exports = {
_( _(
"Get the text of all available options from an Options line type as a vertical list. You can also pass the selected option's cursor string, which by default is ->" "Get the text of all available options from an Options line type as a vertical list. You can also pass the selected option's cursor string, which by default is ->"
), ),
_('Dialogue Tree (experimental)'), '',
'JsPlatform/Extensions/yarn32.png' 'JsPlatform/Extensions/yarn32.png'
) )
.addParameter('string', _('Options Selection Cursor'), '', false) .addParameter('string', _('Options Selection Cursor'), '', false)
@@ -388,7 +392,7 @@ module.exports = {
_( _(
'Get the number of the currently selected option. Use this to help you render the option selection marker at the right place.' 'Get the number of the currently selected option. Use this to help you render the option selection marker at the right place.'
), ),
_('Dialogue Tree (experimental)'), '',
'JsPlatform/Extensions/yarn32.png' 'JsPlatform/Extensions/yarn32.png'
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -401,7 +405,7 @@ module.exports = {
_( _(
'Get dialogue line text clipped by the typewriter effect. Use the "Scroll clipped text" action to control the typewriter effect.' 'Get dialogue line text clipped by the typewriter effect. Use the "Scroll clipped text" action to control the typewriter effect.'
), ),
_('Dialogue Tree (experimental)'), '',
'JsPlatform/Extensions/yarn32.png' 'JsPlatform/Extensions/yarn32.png'
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -412,7 +416,7 @@ module.exports = {
'BranchTitle', 'BranchTitle',
_('Get the title of the current branch of the running dialogue'), _('Get the title of the current branch of the running dialogue'),
_('Get the title of the current branch of the running dialogue'), _('Get the title of the current branch of the running dialogue'),
_('Dialogue Tree (experimental)'), '',
'JsPlatform/Extensions/yarn32.png' 'JsPlatform/Extensions/yarn32.png'
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -423,7 +427,7 @@ module.exports = {
'BranchTags', 'BranchTags',
_('Get the tags of the current branch of the running dialogue'), _('Get the tags of the current branch of the running dialogue'),
_('Get the tags of the current branch of the running dialogue'), _('Get the tags of the current branch of the running dialogue'),
_('Dialogue Tree (experimental)'), '',
'JsPlatform/Extensions/yarn32.png' 'JsPlatform/Extensions/yarn32.png'
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -438,7 +442,7 @@ module.exports = {
_( _(
'Get a tag of the current branch of the running dialogue via its index' 'Get a tag of the current branch of the running dialogue via its index'
), ),
_('Dialogue Tree (experimental)'), '',
'JsPlatform/Extensions/yarn32.png' 'JsPlatform/Extensions/yarn32.png'
) )
.addParameter('expression', _('Tag Index Number'), '', false) .addParameter('expression', _('Tag Index Number'), '', false)
@@ -452,7 +456,7 @@ module.exports = {
_( _(
'Get the parameters of a command call - <<command withParameter anotherParameter>>' 'Get the parameters of a command call - <<command withParameter anotherParameter>>'
), ),
_('Dialogue Tree (experimental)'), '',
'JsPlatform/Extensions/yarn32.png' 'JsPlatform/Extensions/yarn32.png'
) )
.addParameter('expression', _('parameter Index Number'), '', true) .addParameter('expression', _('parameter Index Number'), '', true)
@@ -464,7 +468,7 @@ module.exports = {
'CommandParametersCount', 'CommandParametersCount',
_('Get the number of parameters in the currently passed command'), _('Get the number of parameters in the currently passed command'),
_('Get the number of parameters in the currently passed command'), _('Get the number of parameters in the currently passed command'),
_('Dialogue Tree (experimental)'), '',
'JsPlatform/Extensions/yarn32.png' 'JsPlatform/Extensions/yarn32.png'
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -479,7 +483,7 @@ module.exports = {
_( _(
'Get parameter from a Tag found by the branch contains tag condition' 'Get parameter from a Tag found by the branch contains tag condition'
), ),
_('Dialogue Tree (experimental)'), '',
'JsPlatform/Extensions/yarn32.png' 'JsPlatform/Extensions/yarn32.png'
) )
.addParameter('expression', _('parameter Index Number'), '', true) .addParameter('expression', _('parameter Index Number'), '', true)
@@ -491,7 +495,7 @@ module.exports = {
'VisitedBranchTitles', 'VisitedBranchTitles',
_('Get a list of all visited branches'), _('Get a list of all visited branches'),
_('Get a list of all visited branches'), _('Get a list of all visited branches'),
_('Dialogue Tree (experimental)'), '',
'JsPlatform/Extensions/yarn32.png' 'JsPlatform/Extensions/yarn32.png'
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -502,7 +506,7 @@ module.exports = {
'BranchText', 'BranchText',
_('Get the full raw text of the current branch'), _('Get the full raw text of the current branch'),
_('Get the full raw text of the current branch'), _('Get the full raw text of the current branch'),
_('Dialogue Tree (experimental)'), '',
'JsPlatform/Extensions/yarn32.png' 'JsPlatform/Extensions/yarn32.png'
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -513,7 +517,7 @@ module.exports = {
'Variable', 'Variable',
_('Get dialogue state value'), _('Get dialogue state value'),
_('Get dialogue state value'), _('Get dialogue state value'),
_('Dialogue Tree (experimental)'), '',
'JsPlatform/Extensions/yarn32.png' 'JsPlatform/Extensions/yarn32.png'
) )
.addParameter('string', _('Variable Name'), '', false) .addParameter('string', _('Variable Name'), '', false)
@@ -528,8 +532,8 @@ module.exports = {
'Check if a specific Command is called. If it is a <<command withParameter>>, you can even get the parameter with the CommandParameter expression.' 'Check if a specific Command is called. If it is a <<command withParameter>>, you can even get the parameter with the CommandParameter expression.'
), ),
_('Command <<_PARAM0_>> is called'), _('Command <<_PARAM0_>> is called'),
_('Dialogue Tree (experimental)'), '',
'JsPlatform/Extensions/yarn24.png', 'JsPlatform/Extensions/yarn32.png',
'JsPlatform/Extensions/yarn32.png' 'JsPlatform/Extensions/yarn32.png'
) )
.addParameter('string', _('Command String'), '', false) .addParameter('string', _('Command String'), '', false)
@@ -541,11 +545,11 @@ module.exports = {
'IsDialogueLineType', 'IsDialogueLineType',
_('Dialogue line type'), _('Dialogue line type'),
_( _(
'Check if the the current dialogue line line is one of the three existing types. Use this to set what logic is executed for each type.\nThe three types are as follows:\n- text: when displaying dialogue text.\n- options: when displaying [[branching/options]] for dialogue choices.\n-command: when <<commands>> are triggered by the dialogue data.' 'Check if the current dialogue line line is one of the three existing types. Use this to set what logic is executed for each type.\nThe three types are as follows:\n- text: when displaying dialogue text.\n- options: when displaying [[branching/options]] for dialogue choices.\n-command: when <<commands>> are triggered by the dialogue data.'
), ),
_('The dialogue line is _PARAM0_'), _('The dialogue line is _PARAM0_'),
_('Dialogue Tree (experimental)'), '',
'JsPlatform/Extensions/yarn24.png', 'JsPlatform/Extensions/yarn32.png',
'JsPlatform/Extensions/yarn32.png' 'JsPlatform/Extensions/yarn32.png'
) )
.addParameter( .addParameter(
@@ -565,8 +569,8 @@ module.exports = {
'Check if the dialogue is running. Use this to for things like locking the player movement while speaking with a non player character.' 'Check if the dialogue is running. Use this to for things like locking the player movement while speaking with a non player character.'
), ),
_('Dialogue is running'), _('Dialogue is running'),
_('Dialogue Tree (experimental)'), '',
'JsPlatform/Extensions/yarn24.png', 'JsPlatform/Extensions/yarn32.png',
'JsPlatform/Extensions/yarn32.png' 'JsPlatform/Extensions/yarn32.png'
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -580,8 +584,8 @@ module.exports = {
'Check if the dialogue has a branch with specified name. Use this to check if a dialogue branch exists in the loaded dialogue data.' 'Check if the dialogue has a branch with specified name. Use this to check if a dialogue branch exists in the loaded dialogue data.'
), ),
_('Dialogue has a branch named _PARAM0_'), _('Dialogue has a branch named _PARAM0_'),
_('Dialogue Tree (experimental)'), '',
'JsPlatform/Extensions/yarn24.png', 'JsPlatform/Extensions/yarn32.png',
'JsPlatform/Extensions/yarn32.png' 'JsPlatform/Extensions/yarn32.png'
) )
.addParameter('string', _('Branch name'), '', false) .addParameter('string', _('Branch name'), '', false)
@@ -596,8 +600,8 @@ module.exports = {
'Check if a selected option has changed when the current dialogue line type is options. Use this to detect when the player has selected another option, so you can re-draw where the selection arrow is.' 'Check if a selected option has changed when the current dialogue line type is options. Use this to detect when the player has selected another option, so you can re-draw where the selection arrow is.'
), ),
_('Selected option has changed'), _('Selected option has changed'),
_('Dialogue Tree (experimental)'), '',
'JsPlatform/Extensions/yarn24.png', 'JsPlatform/Extensions/yarn32.png',
'JsPlatform/Extensions/yarn32.png' 'JsPlatform/Extensions/yarn32.png'
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -611,8 +615,8 @@ module.exports = {
'Check if the current dialogue branch title is equal to a string. Use this to trigger game events when the player has visited a specific dialogue branch.' 'Check if the current dialogue branch title is equal to a string. Use this to trigger game events when the player has visited a specific dialogue branch.'
), ),
_('The current dialogue branch title is _PARAM0_'), _('The current dialogue branch title is _PARAM0_'),
_('Dialogue Tree (experimental)'), '',
'JsPlatform/Extensions/yarn24.png', 'JsPlatform/Extensions/yarn32.png',
'JsPlatform/Extensions/yarn32.png' 'JsPlatform/Extensions/yarn32.png'
) )
.addParameter('string', _('title name'), '', false) .addParameter('string', _('title name'), '', false)
@@ -627,8 +631,8 @@ module.exports = {
'Check if the current dialogue branch contains a specific tag. Tags are an alternative useful way to <<commands>> to drive game logic with the dialogue data.' 'Check if the current dialogue branch contains a specific tag. Tags are an alternative useful way to <<commands>> to drive game logic with the dialogue data.'
), ),
_('The current dialogue branch contains a _PARAM0_ tag'), _('The current dialogue branch contains a _PARAM0_ tag'),
_('Dialogue Tree (experimental)'), '',
'JsPlatform/Extensions/yarn24.png', 'JsPlatform/Extensions/yarn32.png',
'JsPlatform/Extensions/yarn32.png' 'JsPlatform/Extensions/yarn32.png'
) )
.addParameter('string', _('tag name'), '', false) .addParameter('string', _('tag name'), '', false)
@@ -641,8 +645,8 @@ module.exports = {
_('Branch title has been visited'), _('Branch title has been visited'),
_('Check if a branch has been visited'), _('Check if a branch has been visited'),
_('Branch title _PARAM0_ has been visited'), _('Branch title _PARAM0_ has been visited'),
_('Dialogue Tree (experimental)'), '',
'JsPlatform/Extensions/yarn24.png', 'JsPlatform/Extensions/yarn32.png',
'JsPlatform/Extensions/yarn32.png' 'JsPlatform/Extensions/yarn32.png'
) )
.addParameter('string', _('branch title'), '', false) .addParameter('string', _('branch title'), '', false)
@@ -657,8 +661,8 @@ module.exports = {
'Compare dialogue state string variable. Use this to trigger game events via dialogue variables.' 'Compare dialogue state string variable. Use this to trigger game events via dialogue variables.'
), ),
_('Dialogue state string variable _PARAM0_ is equal to _PARAM1_'), _('Dialogue state string variable _PARAM0_ is equal to _PARAM1_'),
_('Dialogue Tree (experimental)'), '',
'JsPlatform/Extensions/yarn24.png', 'JsPlatform/Extensions/yarn32.png',
'JsPlatform/Extensions/yarn32.png' 'JsPlatform/Extensions/yarn32.png'
) )
.addParameter('string', _('State variable'), '', false) .addParameter('string', _('State variable'), '', false)
@@ -674,8 +678,8 @@ module.exports = {
'Compare dialogue state number variable. Use this to trigger game events via dialogue variables.' 'Compare dialogue state number variable. Use this to trigger game events via dialogue variables.'
), ),
_('Dialogue state number variable _PARAM0_ is equal to _PARAM1_'), _('Dialogue state number variable _PARAM0_ is equal to _PARAM1_'),
_('Dialogue Tree (experimental)'), '',
'JsPlatform/Extensions/yarn24.png', 'JsPlatform/Extensions/yarn32.png',
'JsPlatform/Extensions/yarn32.png' 'JsPlatform/Extensions/yarn32.png'
) )
.addParameter('string', _('State variable'), '', false) .addParameter('string', _('State variable'), '', false)
@@ -691,8 +695,8 @@ module.exports = {
'Compare dialogue state variable. Use this to trigger game events via dialogue variables.' 'Compare dialogue state variable. Use this to trigger game events via dialogue variables.'
), ),
_('Dialogue state boolean variable _PARAM0_ is equal to _PARAM1_'), _('Dialogue state boolean variable _PARAM0_ is equal to _PARAM1_'),
_('Dialogue Tree (experimental)'), '',
'JsPlatform/Extensions/yarn24.png', 'JsPlatform/Extensions/yarn32.png',
'JsPlatform/Extensions/yarn32.png' 'JsPlatform/Extensions/yarn32.png'
) )
.addParameter('string', _('State variable'), '', false) .addParameter('string', _('State variable'), '', false)
@@ -708,8 +712,8 @@ module.exports = {
'Check if the clipped text scrolling has completed. Use this to prevent the player from going to the next dialogue line before the typing effect has revealed the entire text.' 'Check if the clipped text scrolling has completed. Use this to prevent the player from going to the next dialogue line before the typing effect has revealed the entire text.'
), ),
_('Clipped text has completed scrolling'), _('Clipped text has completed scrolling'),
_('Dialogue Tree (experimental)'), '',
'JsPlatform/Extensions/yarn24.png', 'JsPlatform/Extensions/yarn32.png',
'JsPlatform/Extensions/yarn32.png' 'JsPlatform/Extensions/yarn32.png'
) )
.getCodeExtraInformation() .getCodeExtraInformation()

View File

@@ -6,6 +6,42 @@ This project is released under the MIT License.
*/ */
#include "DraggableBehavior.h" #include "DraggableBehavior.h"
#include "GDCore/CommonTools.h"
#include "GDCore/Project/PropertyDescriptor.h"
#include "GDCore/Serialization/SerializerElement.h" #include "GDCore/Serialization/SerializerElement.h"
#include "GDCore/Tools/Localization.h"
DraggableBehavior::DraggableBehavior() {} DraggableBehavior::DraggableBehavior() {}
void DraggableBehavior::InitializeContent(gd::SerializerElement& content) {
content.SetAttribute("checkCollisionMask", true);
}
std::map<gd::String, gd::PropertyDescriptor> DraggableBehavior::GetProperties(
const gd::SerializerElement& behaviorContent) const {
std::map<gd::String, gd::PropertyDescriptor> properties;
properties["checkCollisionMask"]
.SetValue(behaviorContent.GetBoolAttribute("checkCollisionMask")
? "true"
: "false")
.SetType("Boolean")
.SetLabel(_("Do a precision check against the object's collision mask"))
.SetDescription(
_("Use the object (custom) collision mask instead of the bounding "
"box, making the behavior more precise at the cost of "
"reduced performance"));
;
return properties;
}
bool DraggableBehavior::UpdateProperty(gd::SerializerElement& behaviorContent,
const gd::String& name,
const gd::String& value) {
if (name == "checkCollisionMask") {
behaviorContent.SetAttribute("checkCollisionMask", (value != "0"));
return true;
}
return false;
}

View File

@@ -24,9 +24,20 @@ class GD_EXTENSION_API DraggableBehavior : public gd::Behavior {
public: public:
DraggableBehavior(); DraggableBehavior();
virtual ~DraggableBehavior(){}; virtual ~DraggableBehavior(){};
virtual Behavior* Clone() const { return new DraggableBehavior(*this); } virtual Behavior* Clone() const override {
return new DraggableBehavior(*this);
}
private: #if defined(GD_IDE_ONLY)
virtual std::map<gd::String, gd::PropertyDescriptor> GetProperties(
const gd::SerializerElement& behaviorContent) const override;
virtual bool UpdateProperty(gd::SerializerElement& behaviorContent,
const gd::String& name,
const gd::String& value) override;
#endif
virtual void InitializeContent(
gd::SerializerElement& behaviorContent) override;
}; };
#endif // DRAGGABLEBEHAVIOR_H #endif // DRAGGABLEBEHAVIOR_H

View File

@@ -26,7 +26,7 @@ void DeclareDraggableBehaviorExtension(gd::PlatformExtension& extension) {
"Draggable", "Draggable",
_("Draggable object"), _("Draggable object"),
_("Draggable"), _("Draggable"),
_("Allows objects to be moved using the mouse (or touch)."), _("Move objects by holding a mouse button (or touch)."),
"", "",
"CppPlatform/Extensions/draggableicon.png", "CppPlatform/Extensions/draggableicon.png",
"DraggableBehavior", "DraggableBehavior",

View File

@@ -14,9 +14,11 @@ namespace gdjs {
* When the owner is being dragged, no other manager can start dragging it. * When the owner is being dragged, no other manager can start dragging it.
*/ */
_draggedByDraggableManager: DraggableManager | null = null; _draggedByDraggableManager: DraggableManager | null = null;
_checkCollisionMask: boolean;
constructor(runtimeScene, behaviorData, owner) { constructor(runtimeScene, behaviorData, owner) {
super(runtimeScene, behaviorData, owner); super(runtimeScene, behaviorData, owner);
this._checkCollisionMask = behaviorData.checkCollisionMask ? true : false;
} }
updateFromBehaviorData(oldBehaviorData, newBehaviorData): boolean { updateFromBehaviorData(oldBehaviorData, newBehaviorData): boolean {
@@ -196,6 +198,14 @@ namespace gdjs {
!draggableRuntimeBehavior.owner.insideObject(position[0], position[1]) !draggableRuntimeBehavior.owner.insideObject(position[0], position[1])
) { ) {
return false; return false;
} else if (
draggableRuntimeBehavior._checkCollisionMask &&
!draggableRuntimeBehavior.owner.isCollidingWithPoint(
position[0],
position[1]
)
) {
return false;
} }
if (this._draggableBehavior) { if (this._draggableBehavior) {
// The previous best object to drag will not be dragged. // The previous best object to drag will not be dragged.

View File

@@ -34,20 +34,29 @@ describe('gdjs.DraggableRuntimeBehavior', function () {
instances: [], instances: [],
}); });
var object = new gdjs.RuntimeObject(runtimeScene, { var object = new gdjs.TestRuntimeObject(runtimeScene, {
name: 'obj1', name: 'obj1',
type: '', type: '',
behaviors: [{ name: 'Behavior1', type: 'DraggableBehavior::Draggable' }], behaviors: [{ name: 'Behavior1', type: 'DraggableBehavior::Draggable' }],
variables: [], variables: [],
effects: [], effects: [],
}); });
var object2 = new gdjs.RuntimeObject(runtimeScene, { object.setCustomWidthAndHeight(10, 10);
var object2 = new gdjs.TestRuntimeObject(runtimeScene, {
name: 'obj1', name: 'obj1',
type: '', type: '',
behaviors: [{ name: 'Behavior1', type: 'DraggableBehavior::Draggable' }], behaviors: [
{
name: 'Behavior1',
type: 'DraggableBehavior::Draggable',
// @ts-ignore - properties are not typed
checkCollisionMask: true,
},
],
variables: [], variables: [],
effects: [], effects: [],
}); });
object2.setCustomWidthAndHeight(10, 10);
runtimeScene.addObject(object); runtimeScene.addObject(object);
runtimeScene.addObject(object2); runtimeScene.addObject(object2);
@@ -96,6 +105,70 @@ describe('gdjs.DraggableRuntimeBehavior', function () {
expect(object.getY()).to.be(700); expect(object.getY()).to.be(700);
}); });
it('can drag an object without collision mask check', function () {
object.setPosition(450, 500);
object.setAngle(45);
// Dragged point is in the bounding box but not in hitbox
runtimeScene.renderAndStep(1000 / 60);
runtimeGame.getInputManager().onMouseMove(450, 500);
runtimeGame
.getInputManager()
.onMouseButtonPressed(gdjs.InputManager.MOUSE_LEFT_BUTTON);
runtimeScene.renderAndStep(1000 / 60);
runtimeGame.getInputManager().onMouseMove(750, 600);
runtimeScene.renderAndStep(1000 / 60);
runtimeGame
.getInputManager()
.onMouseButtonReleased(gdjs.InputManager.MOUSE_LEFT_BUTTON);
runtimeScene.renderAndStep(1000 / 60);
expect(object.getX()).to.be(750);
expect(object.getY()).to.be(600);
object.setAngle(0);
});
it('can drag an object with collision mask check', function () {
object2.setPosition(450, 500);
object2.setAngle(45);
// Dragged point is in the bounding box but not in hitbox
runtimeScene.renderAndStep(1000 / 60);
runtimeGame.getInputManager().onMouseMove(450, 500);
runtimeGame
.getInputManager()
.onMouseButtonPressed(gdjs.InputManager.MOUSE_LEFT_BUTTON);
runtimeScene.renderAndStep(1000 / 60);
runtimeGame.getInputManager().onMouseMove(750, 600);
runtimeScene.renderAndStep(1000 / 60);
runtimeGame
.getInputManager()
.onMouseButtonReleased(gdjs.InputManager.MOUSE_LEFT_BUTTON);
runtimeScene.renderAndStep(1000 / 60);
expect(object2.getX()).to.be(450);
expect(object2.getY()).to.be(500);
// Dragged point is in the bounding box and in hitbox
runtimeScene.renderAndStep(1000 / 60);
runtimeGame.getInputManager().onMouseMove(455, 505);
runtimeGame
.getInputManager()
.onMouseButtonPressed(gdjs.InputManager.MOUSE_LEFT_BUTTON);
runtimeScene.renderAndStep(1000 / 60);
runtimeGame.getInputManager().onMouseMove(855, 705);
runtimeScene.renderAndStep(1000 / 60);
runtimeGame
.getInputManager()
.onMouseButtonReleased(gdjs.InputManager.MOUSE_LEFT_BUTTON);
runtimeScene.renderAndStep(1000 / 60);
expect(object2.getX()).to.be(850);
expect(object2.getY()).to.be(700);
object2.setAngle(0);
});
[false, true].forEach((firstInFront) => { [false, true].forEach((firstInFront) => {
it(`must drag the object in front (${ it(`must drag the object in front (${
firstInFront ? '1st object' : '2nd object' firstInFront ? '1st object' : '2nd object'
@@ -184,6 +257,65 @@ describe('gdjs.DraggableRuntimeBehavior', function () {
expect(object.getX()).to.be(850); expect(object.getX()).to.be(850);
expect(object.getY()).to.be(700); expect(object.getY()).to.be(700);
}); });
it('can drag an object without collision mask check', function () {
object.setPosition(450, 500);
object.setAngle(45);
// Dragged point is in the bounding box but not in hitbox
runtimeScene.renderAndStep(1000 / 60);
runtimeGame.getInputManager().onTouchStart(0, 450, 500);
runtimeScene.renderAndStep(1000 / 60);
runtimeGame.getInputManager().onFrameEnded();
runtimeGame.getInputManager().onTouchMove(0, 750, 600);
runtimeScene.renderAndStep(1000 / 60);
runtimeGame.getInputManager().onFrameEnded();
runtimeGame.getInputManager().onTouchEnd(0);
runtimeScene.renderAndStep(1000 / 60);
runtimeGame.getInputManager().onFrameEnded();
expect(object.getX()).to.be(750);
expect(object.getY()).to.be(600);
object.setAngle(0);
});
it('can drag an object with collision mask check', function () {
object2.setPosition(450, 500);
object2.setAngle(45);
// Dragged point is in the bounding box but not in hitbox
runtimeScene.renderAndStep(1000 / 60);
runtimeGame.getInputManager().onTouchStart(0, 450, 500);
runtimeScene.renderAndStep(1000 / 60);
runtimeGame.getInputManager().onFrameEnded();
runtimeGame.getInputManager().onTouchMove(0, 750, 600);
runtimeScene.renderAndStep(1000 / 60);
runtimeGame.getInputManager().onFrameEnded();
runtimeGame.getInputManager().onTouchEnd(0);
runtimeScene.renderAndStep(1000 / 60);
runtimeGame.getInputManager().onFrameEnded();
expect(object2.getX()).to.be(450);
expect(object2.getY()).to.be(500);
// Dragged point is in the bounding box but not in hitbox
runtimeScene.renderAndStep(1000 / 60);
runtimeGame.getInputManager().onTouchStart(0, 455, 505);
runtimeScene.renderAndStep(1000 / 60);
runtimeGame.getInputManager().onFrameEnded();
runtimeGame.getInputManager().onTouchMove(0, 855, 705);
runtimeScene.renderAndStep(1000 / 60);
runtimeGame.getInputManager().onFrameEnded();
runtimeGame.getInputManager().onTouchEnd(0);
runtimeScene.renderAndStep(1000 / 60);
runtimeGame.getInputManager().onFrameEnded();
expect(object2.getX()).to.be(850);
expect(object2.getY()).to.be(700);
object2.setAngle(0);
});
it('can drag 2 objects with multitouch', function () { it('can drag 2 objects with multitouch', function () {
runtimeGame.getInputManager().touchSimulateMouse(false); runtimeGame.getInputManager().touchSimulateMouse(false);
object.setPosition(450, 500); object.setPosition(450, 500);

View File

@@ -32,6 +32,9 @@ module.exports = {
'Florian Rival', 'Florian Rival',
'MIT' 'MIT'
); );
extension
.addInstructionOrExpressionGroupMetadata(_('My Dummy Extension'))
.setIcon('CppPlatform/Extensions/topdownmovementicon.png');
// Register Properties // Register Properties
extension extension
@@ -106,7 +109,7 @@ module.exports = {
'This is an example of a condition displayed in the events sheet. Will return true if the number is less than 10 and the length of the text is less than 5.' 'This is an example of a condition displayed in the events sheet. Will return true if the number is less than 10 and the length of the text is less than 5.'
), ),
_('Call the example condition with _PARAM0_ and _PARAM1_'), _('Call the example condition with _PARAM0_ and _PARAM1_'),
_('Dummy Extension'), '',
'res/conditions/camera24.png', 'res/conditions/camera24.png',
'res/conditions/camera.png' 'res/conditions/camera.png'
) )
@@ -123,7 +126,7 @@ module.exports = {
'DummyExpression', 'DummyExpression',
_('Dummy expression example'), _('Dummy expression example'),
_('This is an example of an expression'), _('This is an example of an expression'),
_('Dummy Extension'), '',
'res/actions/camera.png' 'res/actions/camera.png'
) )
.addParameter('expression', _('Maximum'), '', false) .addParameter('expression', _('Maximum'), '', false)
@@ -135,7 +138,7 @@ module.exports = {
'DummyStrExpression', 'DummyStrExpression',
_('Dummy string expression example'), _('Dummy string expression example'),
_('This is an example of an expression returning a string'), _('This is an example of an expression returning a string'),
_('Dummy Extension'), '',
'res/actions/camera.png' 'res/actions/camera.png'
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -194,7 +197,7 @@ module.exports = {
'DummyBehavior', 'DummyBehavior',
_('Dummy behavior for testing'), _('Dummy behavior for testing'),
'DummyBehavior', 'DummyBehavior',
_('This dummy behavior does nothing'), _('Do nothing.'),
'', '',
'CppPlatform/Extensions/topdownmovementicon.png', 'CppPlatform/Extensions/topdownmovementicon.png',
'DummyBehavior', 'DummyBehavior',
@@ -277,7 +280,7 @@ module.exports = {
'DummyBehaviorWithSharedData', 'DummyBehaviorWithSharedData',
_('Dummy behavior with shared data for testing'), _('Dummy behavior with shared data for testing'),
'DummyBehaviorWithSharedData', 'DummyBehaviorWithSharedData',
_('This dummy behavior uses shared data and does nothing'), _('Do nothing but use shared data.'),
'', '',
'CppPlatform/Extensions/topdownmovementicon.png', 'CppPlatform/Extensions/topdownmovementicon.png',
'DummyBehaviorWithSharedData', 'DummyBehaviorWithSharedData',
@@ -410,7 +413,8 @@ module.exports = {
.setIncludeFile('Extensions/ExampleJsExtension/dummyruntimeobject.js') .setIncludeFile('Extensions/ExampleJsExtension/dummyruntimeobject.js')
.addIncludeFile( .addIncludeFile(
'Extensions/ExampleJsExtension/dummyruntimeobject-pixi-renderer.js' 'Extensions/ExampleJsExtension/dummyruntimeobject-pixi-renderer.js'
); )
.setCategoryFullName(_('Testing'));
object object
.addAction( .addAction(

View File

@@ -32,7 +32,10 @@ module.exports = {
"Florian Rival", "Florian Rival",
"Open source (MIT License)" "Open source (MIT License)"
) )
.setExtensionHelpPath("/publishing/publishing-to-facebook-instant-games"); .setExtensionHelpPath("/publishing/publishing-to-facebook-instant-games")
.setCategory('Third-party');
extension.addInstructionOrExpressionGroupMetadata(_("Facebook Instant Games"))
.setIcon("JsPlatform/Extensions/facebookicon32.png");
extension extension
.addAction( .addAction(
@@ -44,9 +47,9 @@ module.exports = {
_( _(
"Save the content of _PARAM1_ in key _PARAM0_ of player data (store success message in _PARAM2_ or error in _PARAM3_)" "Save the content of _PARAM1_ in key _PARAM0_ of player data (store success message in _PARAM2_ or error in _PARAM3_)"
), ),
_("Facebook Instant Games/Player data"), _("Player data"),
"JsPlatform/Extensions/facebookicon24.png", "JsPlatform/Extensions/facebookicon32.png",
"JsPlatform/Extensions/facebookicon16.png" "JsPlatform/Extensions/facebookicon32.png"
) )
.addParameter("string", 'Data key name (e.g: "Lives")', "", false) .addParameter("string", 'Data key name (e.g: "Lives")', "", false)
.addParameter("scenevar", "Scene variable with the content to save", "", false) .addParameter("scenevar", "Scene variable with the content to save", "", false)
@@ -76,9 +79,9 @@ module.exports = {
_( _(
"Load player data with key _PARAM0_ in _PARAM1_ (or error in _PARAM2_)" "Load player data with key _PARAM0_ in _PARAM1_ (or error in _PARAM2_)"
), ),
_("Facebook Instant Games/Player data"), _("Player data"),
"JsPlatform/Extensions/facebookicon24.png", "JsPlatform/Extensions/facebookicon32.png",
"JsPlatform/Extensions/facebookicon16.png" "JsPlatform/Extensions/facebookicon32.png"
) )
.addParameter("string", _('Data key name (e.g: "Lives")'), "", false) .addParameter("string", _('Data key name (e.g: "Lives")'), "", false)
.addParameter( .addParameter(
@@ -109,9 +112,9 @@ module.exports = {
_( _(
"In leaderboard _PARAM0_, save score _PARAM1_ for the player and extra data from _PARAM2_ (store success message in _PARAM3_ or error in _PARAM4_)" "In leaderboard _PARAM0_, save score _PARAM1_ for the player and extra data from _PARAM2_ (store success message in _PARAM3_ or error in _PARAM4_)"
), ),
_("Facebook Instant Games/Leaderboards"), _("Leaderboards"),
"JsPlatform/Extensions/facebookicon24.png", "JsPlatform/Extensions/facebookicon32.png",
"JsPlatform/Extensions/facebookicon16.png" "JsPlatform/Extensions/facebookicon32.png"
) )
.addParameter( .addParameter(
"string", "string",
@@ -152,9 +155,9 @@ module.exports = {
_( _(
"Load player entry from leaderboard _PARAM0_. Set rank in _PARAM1_, score in _PARAM2_ (extra data if any in _PARAM3_ and error in _PARAM4_)" "Load player entry from leaderboard _PARAM0_. Set rank in _PARAM1_, score in _PARAM2_ (extra data if any in _PARAM3_ and error in _PARAM4_)"
), ),
_("Facebook Instant Games/Leaderboards"), _("Leaderboards"),
"JsPlatform/Extensions/facebookicon24.png", "JsPlatform/Extensions/facebookicon32.png",
"JsPlatform/Extensions/facebookicon16.png" "JsPlatform/Extensions/facebookicon32.png"
) )
.addParameter( .addParameter(
"string", "string",
@@ -198,9 +201,9 @@ module.exports = {
_("Check if ads are supported"), _("Check if ads are supported"),
_("Check if showing ads is supported on this device (only mobile phones can show ads)"), _("Check if showing ads is supported on this device (only mobile phones can show ads)"),
_("Ads can be shown on this device"), _("Ads can be shown on this device"),
_("Facebook Instant Games/Ads"), _("Ads"),
"JsPlatform/Extensions/facebookicon24.png", "JsPlatform/Extensions/facebookicon32.png",
"JsPlatform/Extensions/facebookicon16.png" "JsPlatform/Extensions/facebookicon32.png"
) )
.getCodeExtraInformation() .getCodeExtraInformation()
.setIncludeFile( .setIncludeFile(
@@ -214,9 +217,9 @@ module.exports = {
_("Is the interstitial ad ready"), _("Is the interstitial ad ready"),
_("Check if the interstitial ad requested from Facebook is loaded and ready to be shown."), _("Check if the interstitial ad requested from Facebook is loaded and ready to be shown."),
_("The interstitial ad is loaded and ready to be shown"), _("The interstitial ad is loaded and ready to be shown"),
_("Facebook Instant Games/Ads"), _("Ads"),
"JsPlatform/Extensions/facebookicon24.png", "JsPlatform/Extensions/facebookicon32.png",
"JsPlatform/Extensions/facebookicon16.png" "JsPlatform/Extensions/facebookicon32.png"
) )
.getCodeExtraInformation() .getCodeExtraInformation()
.setIncludeFile( .setIncludeFile(
@@ -230,9 +233,9 @@ module.exports = {
_("Load and prepare an interstitial ad"), _("Load and prepare an interstitial ad"),
_("Request and load an interstitial ad from Facebook, so that it is ready to be shown."), _("Request and load an interstitial ad from Facebook, so that it is ready to be shown."),
_("Request and load an interstitial ad from Facebook (ad placement id: _PARAM0_, error in _PARAM1_)"), _("Request and load an interstitial ad from Facebook (ad placement id: _PARAM0_, error in _PARAM1_)"),
_("Facebook Instant Games/Ads"), _("Ads"),
"JsPlatform/Extensions/facebookicon24.png", "JsPlatform/Extensions/facebookicon32.png",
"JsPlatform/Extensions/facebookicon16.png" "JsPlatform/Extensions/facebookicon32.png"
) )
.addParameter( .addParameter(
"string", "string",
@@ -258,9 +261,9 @@ module.exports = {
_("Show the loaded interstitial ad"), _("Show the loaded interstitial ad"),
_("Show the interstitial ad previously loaded in memory. This won't work if you did not load the interstitial before."), _("Show the interstitial ad previously loaded in memory. This won't work if you did not load the interstitial before."),
_("Show the interstitial ad previously loaded in memory (if any error, store it in _PARAM0_)"), _("Show the interstitial ad previously loaded in memory (if any error, store it in _PARAM0_)"),
_("Facebook Instant Games/Ads"), _("Ads"),
"JsPlatform/Extensions/facebookicon24.png", "JsPlatform/Extensions/facebookicon32.png",
"JsPlatform/Extensions/facebookicon16.png" "JsPlatform/Extensions/facebookicon32.png"
) )
.addParameter( .addParameter(
"scenevar", "scenevar",
@@ -280,9 +283,9 @@ module.exports = {
_("Is the rewarded video ready"), _("Is the rewarded video ready"),
_("Check if the rewarded video requested from Facebook is loaded and ready to be shown."), _("Check if the rewarded video requested from Facebook is loaded and ready to be shown."),
_("The rewarded video is loaded and ready to be shown"), _("The rewarded video is loaded and ready to be shown"),
_("Facebook Instant Games/Ads"), _("Ads"),
"JsPlatform/Extensions/facebookicon24.png", "JsPlatform/Extensions/facebookicon32.png",
"JsPlatform/Extensions/facebookicon16.png" "JsPlatform/Extensions/facebookicon32.png"
) )
.getCodeExtraInformation() .getCodeExtraInformation()
.setIncludeFile( .setIncludeFile(
@@ -296,9 +299,9 @@ module.exports = {
_("Load and prepare a rewarded video"), _("Load and prepare a rewarded video"),
_("Request and load a rewarded video from Facebook, so that it is ready to be shown."), _("Request and load a rewarded video from Facebook, so that it is ready to be shown."),
_("Request and load a rewarded video from Facebook (ad placement id: _PARAM0_, error in _PARAM1_)"), _("Request and load a rewarded video from Facebook (ad placement id: _PARAM0_, error in _PARAM1_)"),
_("Facebook Instant Games/Ads"), _("Ads"),
"JsPlatform/Extensions/facebookicon24.png", "JsPlatform/Extensions/facebookicon32.png",
"JsPlatform/Extensions/facebookicon16.png" "JsPlatform/Extensions/facebookicon32.png"
) )
.addParameter( .addParameter(
"string", "string",
@@ -324,9 +327,9 @@ module.exports = {
_("Show the loaded rewarded video"), _("Show the loaded rewarded video"),
_("Show the rewarded video previously loaded in memory. This won't work if you did not load the video before."), _("Show the rewarded video previously loaded in memory. This won't work if you did not load the video before."),
_("Show the rewarded video previously loaded in memory (if any error, store it in _PARAM0_)"), _("Show the rewarded video previously loaded in memory (if any error, store it in _PARAM0_)"),
_("Facebook Instant Games/Ads"), _("Ads"),
"JsPlatform/Extensions/facebookicon24.png", "JsPlatform/Extensions/facebookicon32.png",
"JsPlatform/Extensions/facebookicon16.png" "JsPlatform/Extensions/facebookicon32.png"
) )
.addParameter( .addParameter(
"scenevar", "scenevar",
@@ -345,8 +348,8 @@ module.exports = {
"PlayerId", "PlayerId",
_("Player identifier"), _("Player identifier"),
_("Get the player unique identifier"), _("Get the player unique identifier"),
_("Facebook Instant Games"), '',
"JsPlatform/Extensions/facebookicon16.png" "JsPlatform/Extensions/facebookicon32.png"
) )
.getCodeExtraInformation() .getCodeExtraInformation()
.setIncludeFile( .setIncludeFile(
@@ -359,8 +362,8 @@ module.exports = {
"PlayerName", "PlayerName",
_("Player name"), _("Player name"),
_("Get the player name"), _("Get the player name"),
_("Facebook Instant Games"), '',
"JsPlatform/Extensions/facebookicon16.png" "JsPlatform/Extensions/facebookicon32.png"
) )
.getCodeExtraInformation() .getCodeExtraInformation()
.setIncludeFile( .setIncludeFile(

View File

@@ -28,12 +28,16 @@ module.exports = {
extension extension
.setExtensionInformation( .setExtensionInformation(
'FileSystem', 'FileSystem',
_('Filesystem'), _('File system'),
_('Access the filesystem of the operating system.'), _('Access the filesystem of the operating system.'),
'Matthias Meike', 'Matthias Meike',
'Open source (MIT License)' 'Open source (MIT License)'
) )
.setExtensionHelpPath('/all-features/filesystem'); .setExtensionHelpPath('/all-features/filesystem')
.setCategory('Device');
extension
.addInstructionOrExpressionGroupMetadata(_('File system'))
.setIcon('JsPlatform/Extensions/filesystem_create_folder32.png');
extension extension
.addCondition( .addCondition(
@@ -41,8 +45,8 @@ module.exports = {
_('File or directory exists'), _('File or directory exists'),
_('Check if the file or directory exists.'), _('Check if the file or directory exists.'),
_('The path _PARAM0_ exists'), _('The path _PARAM0_ exists'),
_('Filesystem/Windows, Linux, MacOS'), _('Windows, Linux, MacOS'),
'JsPlatform/Extensions/filesystem_path_exists24.png', 'JsPlatform/Extensions/filesystem_path_exists32.png',
'JsPlatform/Extensions/filesystem_path_exists32.png' 'JsPlatform/Extensions/filesystem_path_exists32.png'
) )
.addParameter('string', _('Path to file or directory'), '', false) .addParameter('string', _('Path to file or directory'), '', false)
@@ -56,8 +60,8 @@ module.exports = {
_('Create a directory'), _('Create a directory'),
_('Create a new directory at the specified path.'), _('Create a new directory at the specified path.'),
_('Create directory _PARAM0_'), _('Create directory _PARAM0_'),
_('Filesystem/Windows, Linux, MacOS'), _('Windows, Linux, MacOS'),
'JsPlatform/Extensions/filesystem_create_folder24.png', 'JsPlatform/Extensions/filesystem_create_folder32.png',
'JsPlatform/Extensions/filesystem_create_folder32.png' 'JsPlatform/Extensions/filesystem_create_folder32.png'
) )
.addParameter('string', _('Directory'), '', false) .addParameter('string', _('Directory'), '', false)
@@ -78,11 +82,11 @@ module.exports = {
'SaveStringToFileSync', 'SaveStringToFileSync',
_('Save a text into a file'), _('Save a text into a file'),
_( _(
'Save a text into a file. Only use this on small files to avoid any lag or freeze during the the game execution.' 'Save a text into a file. Only use this on small files to avoid any lag or freeze during the game execution.'
), ),
_('Save _PARAM0_ into file _PARAM1_'), _('Save _PARAM0_ into file _PARAM1_'),
_('Filesystem/Windows, Linux, MacOS'), _('Windows, Linux, MacOS'),
'JsPlatform/Extensions/filesystem_save_file24.png', 'JsPlatform/Extensions/filesystem_save_file32.png',
'JsPlatform/Extensions/filesystem_save_file32.png' 'JsPlatform/Extensions/filesystem_save_file32.png'
) )
.addParameter('string', _('String (text)'), '', false) .addParameter('string', _('String (text)'), '', false)
@@ -107,8 +111,8 @@ module.exports = {
"Save a text into a file asynchronously. Use this for large files to avoid any lag or freeze during game execution. The 'result' variable gets updated when the operation has finished." "Save a text into a file asynchronously. Use this for large files to avoid any lag or freeze during game execution. The 'result' variable gets updated when the operation has finished."
), ),
_('Save _PARAM0_ into file _PARAM1_'), _('Save _PARAM0_ into file _PARAM1_'),
_('Filesystem/Windows, Linux, MacOS/Asynchronous'), _('Windows, Linux, MacOS/Asynchronous'),
'JsPlatform/Extensions/filesystem_save_file24.png', 'JsPlatform/Extensions/filesystem_save_file32.png',
'JsPlatform/Extensions/filesystem_save_file32.png' 'JsPlatform/Extensions/filesystem_save_file32.png'
) )
.addParameter('string', _('String (text)'), '', false) .addParameter('string', _('String (text)'), '', false)
@@ -130,11 +134,11 @@ module.exports = {
'SaveVariableToJSONFileSync', 'SaveVariableToJSONFileSync',
_('Save a scene variable into a JSON file'), _('Save a scene variable into a JSON file'),
_( _(
'Save a scene variable (including, for structure, all the children) into a file in JSON format. Only use this on small files to avoid any lag or freeze during the the game execution.' 'Save a scene variable (including, for structure, all the children) into a file in JSON format. Only use this on small files to avoid any lag or freeze during the game execution.'
), ),
_('Save scene variable _PARAM0_ into file _PARAM1_ as JSON'), _('Save scene variable _PARAM0_ into file _PARAM1_ as JSON'),
_('Filesystem/Windows, Linux, MacOS'), _('Windows, Linux, MacOS'),
'JsPlatform/Extensions/filesystem_save_file24.png', 'JsPlatform/Extensions/filesystem_save_file32.png',
'JsPlatform/Extensions/filesystem_save_file32.png' 'JsPlatform/Extensions/filesystem_save_file32.png'
) )
.addParameter('scenevar', _('Scene variable'), '', false) .addParameter('scenevar', _('Scene variable'), '', false)
@@ -159,8 +163,8 @@ module.exports = {
"Save the scene variable (including, for structures, all the children) into a file in JSON format, asynchronously. Use this for large files to avoid any lag or freeze during game execution. The 'result' variable gets updated when the operation has finished." "Save the scene variable (including, for structures, all the children) into a file in JSON format, asynchronously. Use this for large files to avoid any lag or freeze during game execution. The 'result' variable gets updated when the operation has finished."
), ),
_('Save scene variable _PARAM0_ into file _PARAM1_ as JSON'), _('Save scene variable _PARAM0_ into file _PARAM1_ as JSON'),
_('Filesystem/Windows, Linux, MacOS/Asynchronous'), _('Windows, Linux, MacOS/Asynchronous'),
'JsPlatform/Extensions/filesystem_save_file24.png', 'JsPlatform/Extensions/filesystem_save_file32.png',
'JsPlatform/Extensions/filesystem_save_file32.png' 'JsPlatform/Extensions/filesystem_save_file32.png'
) )
.addParameter('scenevar', _('Scene variable'), '', false) .addParameter('scenevar', _('Scene variable'), '', false)
@@ -185,8 +189,8 @@ module.exports = {
"Load a text from a file, asynchronously. Use this for large files to avoid any lag or freeze during game execution. The content of the file will be available in the scene variable after a small delay (usually a few milliseconds). The 'result' variable gets updated when the operation has finished." "Load a text from a file, asynchronously. Use this for large files to avoid any lag or freeze during game execution. The content of the file will be available in the scene variable after a small delay (usually a few milliseconds). The 'result' variable gets updated when the operation has finished."
), ),
_('Load text from _PARAM1_ into scene variable _PARAM0_ (Async)'), _('Load text from _PARAM1_ into scene variable _PARAM0_ (Async)'),
_('Filesystem/Windows, Linux, MacOS/Asynchronous'), _('Windows, Linux, MacOS/Asynchronous'),
'JsPlatform/Extensions/filesystem_load_file24.png', 'JsPlatform/Extensions/filesystem_load_file32.png',
'JsPlatform/Extensions/filesystem_load_file32.png' 'JsPlatform/Extensions/filesystem_load_file32.png'
) )
.addParameter('scenevar', _('Scene variable'), '', false) .addParameter('scenevar', _('Scene variable'), '', false)
@@ -208,11 +212,11 @@ module.exports = {
'LoadStringFromFileSync', 'LoadStringFromFileSync',
_('Load a text from a file'), _('Load a text from a file'),
_( _(
'Load a text from a file. Only use this on small files to avoid any lag or freeze during the the game execution.' 'Load a text from a file. Only use this on small files to avoid any lag or freeze during the game execution.'
), ),
_('Load text from _PARAM1_ into scene variable _PARAM0_'), _('Load text from _PARAM1_ into scene variable _PARAM0_'),
_('Filesystem/Windows, Linux, MacOS'), _('Windows, Linux, MacOS'),
'JsPlatform/Extensions/filesystem_load_file24.png', 'JsPlatform/Extensions/filesystem_load_file32.png',
'JsPlatform/Extensions/filesystem_load_file32.png' 'JsPlatform/Extensions/filesystem_load_file32.png'
) )
.addParameter('scenevar', _('Scene variable'), '', false) .addParameter('scenevar', _('Scene variable'), '', false)
@@ -234,11 +238,11 @@ module.exports = {
'LoadVariableFromJSONFileSync', 'LoadVariableFromJSONFileSync',
_('Load a scene variable from a JSON file'), _('Load a scene variable from a JSON file'),
_( _(
'Load a JSON formatted text from a file and convert it to a scene variable (potentially a structure variable with children). Only use this on small files to avoid any lag or freeze during the the game execution.' 'Load a JSON formatted text from a file and convert it to a scene variable (potentially a structure variable with children). Only use this on small files to avoid any lag or freeze during the game execution.'
), ),
_('Load JSON from _PARAM1_ into scene variable _PARAM0_'), _('Load JSON from _PARAM1_ into scene variable _PARAM0_'),
_('Filesystem/Windows, Linux, MacOS'), _('Windows, Linux, MacOS'),
'JsPlatform/Extensions/filesystem_save_file24.png', 'JsPlatform/Extensions/filesystem_save_file32.png',
'JsPlatform/Extensions/filesystem_save_file32.png' 'JsPlatform/Extensions/filesystem_save_file32.png'
) )
.addParameter('scenevar', _('Scene variable'), '', false) .addParameter('scenevar', _('Scene variable'), '', false)
@@ -263,8 +267,8 @@ module.exports = {
"Load a JSON formatted text from a file and convert it to a scene variable (potentially a structure variable with children), asynchronously. Use this for large files to avoid any lag or freeze during game execution. The content of the file will be available as a scene variable after a small delay (usually a few milliseconds). The 'result' variable gets updated when the operation has finished." "Load a JSON formatted text from a file and convert it to a scene variable (potentially a structure variable with children), asynchronously. Use this for large files to avoid any lag or freeze during game execution. The content of the file will be available as a scene variable after a small delay (usually a few milliseconds). The 'result' variable gets updated when the operation has finished."
), ),
_('Load JSON from _PARAM1_ into scene variable _PARAM0_'), _('Load JSON from _PARAM1_ into scene variable _PARAM0_'),
_('Filesystem/Windows, Linux, MacOS/Asynchronous'), _('Windows, Linux, MacOS/Asynchronous'),
'JsPlatform/Extensions/filesystem_save_file24.png', 'JsPlatform/Extensions/filesystem_save_file32.png',
'JsPlatform/Extensions/filesystem_save_file32.png' 'JsPlatform/Extensions/filesystem_save_file32.png'
) )
.addParameter('scenevar', _('Scene variable'), '', false) .addParameter('scenevar', _('Scene variable'), '', false)
@@ -287,8 +291,8 @@ module.exports = {
_('Delete a file'), _('Delete a file'),
_('Delete a file from the filesystem.'), _('Delete a file from the filesystem.'),
_('Delete the file _PARAM0_'), _('Delete the file _PARAM0_'),
_('Filesystem/Windows, Linux, MacOS'), _('Windows, Linux, MacOS'),
'JsPlatform/Extensions/filesystem_delete_file24.png', 'JsPlatform/Extensions/filesystem_delete_file32.png',
'JsPlatform/Extensions/filesystem_delete_file32.png' 'JsPlatform/Extensions/filesystem_delete_file32.png'
) )
.addParameter('string', _('File path'), '', false) .addParameter('string', _('File path'), '', false)
@@ -312,8 +316,8 @@ module.exports = {
'Delete a file from the filesystem asynchronously. The option result variable will be updated once the file is deleted.' 'Delete a file from the filesystem asynchronously. The option result variable will be updated once the file is deleted.'
), ),
_('Delete the file _PARAM0_'), _('Delete the file _PARAM0_'),
_('Filesystem/Windows, Linux, MacOS/Asynchronous'), _('Windows, Linux, MacOS/Asynchronous'),
'JsPlatform/Extensions/filesystem_delete_file24.png', 'JsPlatform/Extensions/filesystem_delete_file32.png',
'JsPlatform/Extensions/filesystem_delete_file32.png' 'JsPlatform/Extensions/filesystem_delete_file32.png'
) )
.addParameter('string', _('File path'), '', false) .addParameter('string', _('File path'), '', false)
@@ -334,7 +338,7 @@ module.exports = {
'DesktopPath', 'DesktopPath',
_('Desktop folder'), _('Desktop folder'),
_('Get the path to the desktop folder.'), _('Get the path to the desktop folder.'),
_('Filesystem/Windows, Linux, MacOS'), _('Windows, Linux, MacOS'),
'JsPlatform/Extensions/filesystem_folder32.png' 'JsPlatform/Extensions/filesystem_folder32.png'
) )
.addCodeOnlyParameter('currentScene', '') .addCodeOnlyParameter('currentScene', '')
@@ -347,7 +351,7 @@ module.exports = {
'DocumentsPath', 'DocumentsPath',
_('Documents folder'), _('Documents folder'),
_('Get the path to the documents folder.'), _('Get the path to the documents folder.'),
_('Filesystem/Windows, Linux, MacOS'), _('Windows, Linux, MacOS'),
'JsPlatform/Extensions/filesystem_folder32.png' 'JsPlatform/Extensions/filesystem_folder32.png'
) )
.addCodeOnlyParameter('currentScene', '') .addCodeOnlyParameter('currentScene', '')
@@ -360,7 +364,7 @@ module.exports = {
'PicturesPath', 'PicturesPath',
_('Pictures folder'), _('Pictures folder'),
_('Get the path to the pictures folder.'), _('Get the path to the pictures folder.'),
_('Filesystem/Windows, Linux, MacOS'), _('Windows, Linux, MacOS'),
'JsPlatform/Extensions/filesystem_folder32.png' 'JsPlatform/Extensions/filesystem_folder32.png'
) )
.addCodeOnlyParameter('currentScene', '') .addCodeOnlyParameter('currentScene', '')
@@ -373,7 +377,7 @@ module.exports = {
'ExecutablePath', 'ExecutablePath',
_('Game executable file'), _('Game executable file'),
_('Get the path to this game executable file.'), _('Get the path to this game executable file.'),
_('Filesystem/Windows, Linux, MacOS'), _('Windows, Linux, MacOS'),
'JsPlatform/Extensions/filesystem_folder32.png' 'JsPlatform/Extensions/filesystem_folder32.png'
) )
.addCodeOnlyParameter('currentScene', '') .addCodeOnlyParameter('currentScene', '')
@@ -386,7 +390,7 @@ module.exports = {
'ExecutableFolderPath', 'ExecutableFolderPath',
_('Game executable folder'), _('Game executable folder'),
_('Get the path to this game executable folder.'), _('Get the path to this game executable folder.'),
_('Filesystem/Windows, Linux, MacOS'), _('Windows, Linux, MacOS'),
'JsPlatform/Extensions/filesystem_folder32.png' 'JsPlatform/Extensions/filesystem_folder32.png'
) )
.addCodeOnlyParameter('currentScene', '') .addCodeOnlyParameter('currentScene', '')
@@ -399,7 +403,7 @@ module.exports = {
'UserdataPath', 'UserdataPath',
_('Userdata folder (for application settings)'), _('Userdata folder (for application settings)'),
_('Get the path to userdata folder (for application settings).'), _('Get the path to userdata folder (for application settings).'),
_('Filesystem/Windows, Linux, MacOS'), _('Windows, Linux, MacOS'),
'JsPlatform/Extensions/filesystem_folder32.png' 'JsPlatform/Extensions/filesystem_folder32.png'
) )
.addCodeOnlyParameter('currentScene', '') .addCodeOnlyParameter('currentScene', '')
@@ -412,7 +416,7 @@ module.exports = {
'UserHomePath', 'UserHomePath',
_("User's Home folder"), _("User's Home folder"),
_('Get the path to the user home folder.'), _('Get the path to the user home folder.'),
_('Filesystem/Windows, Linux, MacOS'), _('Windows, Linux, MacOS'),
'JsPlatform/Extensions/filesystem_folder32.png' 'JsPlatform/Extensions/filesystem_folder32.png'
) )
.addCodeOnlyParameter('currentScene', '') .addCodeOnlyParameter('currentScene', '')
@@ -425,7 +429,7 @@ module.exports = {
'TempPath', 'TempPath',
_('Temp folder'), _('Temp folder'),
_('Get the path to temp folder.'), _('Get the path to temp folder.'),
_('Filesystem/Windows, Linux, MacOS'), _('Windows, Linux, MacOS'),
'JsPlatform/Extensions/filesystem_folder32.png' 'JsPlatform/Extensions/filesystem_folder32.png'
) )
.addCodeOnlyParameter('currentScene', '') .addCodeOnlyParameter('currentScene', '')
@@ -438,7 +442,7 @@ module.exports = {
'PathDelimiter', 'PathDelimiter',
_('Path delimiter'), _('Path delimiter'),
_('Get the operating system path delimiter.'), _('Get the operating system path delimiter.'),
_('Filesystem/Windows, Linux, MacOS'), _('Windows, Linux, MacOS'),
'JsPlatform/Extensions/filesystem_folder32.png' 'JsPlatform/Extensions/filesystem_folder32.png'
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -452,7 +456,7 @@ module.exports = {
_( _(
'Returns the portion of the path that represents the directories, without the ending file name.' 'Returns the portion of the path that represents the directories, without the ending file name.'
), ),
_('Filesystem/Windows, Linux, MacOS'), _('Windows, Linux, MacOS'),
'JsPlatform/Extensions/filesystem_folder32.png' 'JsPlatform/Extensions/filesystem_folder32.png'
) )
.addParameter('string', _('File or folder path'), '', false) .addParameter('string', _('File or folder path'), '', false)
@@ -465,7 +469,7 @@ module.exports = {
'FileName', 'FileName',
_('Get file name from a path'), _('Get file name from a path'),
_('Returns the name of the file with its extension, if any.'), _('Returns the name of the file with its extension, if any.'),
_('Filesystem/Windows, Linux, MacOS'), _('Windows, Linux, MacOS'),
'JsPlatform/Extensions/filesystem_folder32.png' 'JsPlatform/Extensions/filesystem_folder32.png'
) )
.addParameter('string', _('File path'), '', false) .addParameter('string', _('File path'), '', false)
@@ -480,7 +484,7 @@ module.exports = {
_( _(
'Returns the extension of the file designated by the given path, including the extension period. For example: ".txt".' 'Returns the extension of the file designated by the given path, including the extension period. For example: ".txt".'
), ),
_('Filesystem/Windows, Linux, MacOS'), _('Windows, Linux, MacOS'),
'JsPlatform/Extensions/filesystem_folder32.png' 'JsPlatform/Extensions/filesystem_folder32.png'
) )
.addParameter('string', _('File path'), '', false) .addParameter('string', _('File path'), '', false)

View File

@@ -28,7 +28,11 @@ module.exports = {
'Arthur Pacaud (arthuro555)', 'Arthur Pacaud (arthuro555)',
'MIT' 'MIT'
) )
.setExtensionHelpPath('/all-features/firebase'); .setExtensionHelpPath('/all-features/firebase')
.setCategory('Network');
extension
.addInstructionOrExpressionGroupMetadata(_('Firebase'))
.setIcon('JsPlatform/Extensions/firebase.png');
extension extension
.registerProperty('FirebaseConfig') .registerProperty('FirebaseConfig')
@@ -42,7 +46,7 @@ module.exports = {
_('Enable analytics'), _('Enable analytics'),
_('Enables Analytics for that project.'), _('Enables Analytics for that project.'),
_('Enable analytics'), _('Enable analytics'),
_('Firebase/Analytics'), _('Analytics'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -64,7 +68,7 @@ module.exports = {
'Can also pass additional data to the Analytics' 'Can also pass additional data to the Analytics'
), ),
_('Trigger Event _PARAM0_ with argument _PARAM1_'), _('Trigger Event _PARAM0_ with argument _PARAM1_'),
_('Firebase/Analytics'), _('Analytics'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -90,7 +94,7 @@ module.exports = {
'For advanced usage only.' 'For advanced usage only.'
), ),
_("Set current user's ID to _PARAM0_"), _("Set current user's ID to _PARAM0_"),
_('Firebase/Analytics'), _('Analytics'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -114,7 +118,7 @@ module.exports = {
'Can be used to classify user in Analytics.' 'Can be used to classify user in Analytics.'
), ),
_('Set property _PARAM0_ of the current user to _PARAM1_'), _('Set property _PARAM0_ of the current user to _PARAM1_'),
_('Firebase/Analytics'), _('Analytics'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -136,7 +140,7 @@ module.exports = {
'GetRemoteConfigString', 'GetRemoteConfigString',
_('Get Remote setting as String'), _('Get Remote setting as String'),
_('Get a setting from Firebase Remote Config as a string.'), _('Get a setting from Firebase Remote Config as a string.'),
_('Firebase/Remote Config'), _('Remote Config'),
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
.addParameter('string', _('Setting Name'), '', false) .addParameter('string', _('Setting Name'), '', false)
@@ -156,7 +160,7 @@ module.exports = {
'GetRemoteConfigNumber', 'GetRemoteConfigNumber',
_('Get Remote setting as Number'), _('Get Remote setting as Number'),
_('Get a setting from Firebase Remote Config as Number.'), _('Get a setting from Firebase Remote Config as Number.'),
_('Firebase/Remote Config'), _('Remote Config'),
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
.addParameter('string', _('Setting Name'), '', false) .addParameter('string', _('Setting Name'), '', false)
@@ -177,7 +181,7 @@ module.exports = {
_('Set Remote Config Auto Update Inteval'), _('Set Remote Config Auto Update Inteval'),
_('Sets Remote Config Auto Update Inteval.'), _('Sets Remote Config Auto Update Inteval.'),
_('Set Remote Config Auto Update Inteval to _PARAM0_'), _('Set Remote Config Auto Update Inteval to _PARAM0_'),
_('Firebase/Remote Config'), _('Remote Config'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -205,7 +209,7 @@ module.exports = {
'the config is still loading.' 'the config is still loading.'
), ),
_('Set default config to _PARAM0_'), _('Set default config to _PARAM0_'),
_('Firebase/Remote Config'), _('Remote Config'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -229,7 +233,7 @@ module.exports = {
_('Force sync the configuration'), _('Force sync the configuration'),
_('Use this to sync the Remote Config with the client at any time.'), _('Use this to sync the Remote Config with the client at any time.'),
_('Synchronize Remote Config'), _('Synchronize Remote Config'),
_('Firebase/Remote Config'), _('Remote Config'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -245,10 +249,10 @@ module.exports = {
extension extension
.addAction( .addAction(
'CreateBasicAccount', 'CreateBasicAccount',
_('Create account with with email'), _('Create account with email'),
_('Create an account with email and password as credentials.'), _('Create an account with email and password as credentials.'),
_('Create account with email _PARAM0_ and password _PARAM1_'), _('Create account with email _PARAM0_ and password _PARAM1_'),
_('Firebase/Authentication'), _('Authentication'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -275,7 +279,7 @@ module.exports = {
_('Sign into an account with email'), _('Sign into an account with email'),
_('Sign into an account with email and password as credentials. '), _('Sign into an account with email and password as credentials. '),
_('Connect to account with email _PARAM0_ and password _PARAM1_'), _('Connect to account with email _PARAM0_ and password _PARAM1_'),
_('Firebase/Authentication'), _('Authentication'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -300,7 +304,7 @@ module.exports = {
_('Log out of the account'), _('Log out of the account'),
_('Logs out of the current account. '), _('Logs out of the current account. '),
_('Log out from the account'), _('Log out from the account'),
_('Firebase/Authentication'), _('Authentication'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -321,7 +325,7 @@ module.exports = {
'Provider authentication only works in the browser! Not on previews or pc/mobile exports.' 'Provider authentication only works in the browser! Not on previews or pc/mobile exports.'
), ),
_('Connect to account with Provider _PARAM0_'), _('Connect to account with Provider _PARAM0_'),
_('Firebase/Authentication'), _('Authentication'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -350,7 +354,7 @@ module.exports = {
_('Sign In as an anonymous guest'), _('Sign In as an anonymous guest'),
_('Sign into a temporary anonymous account.'), _('Sign into a temporary anonymous account.'),
_('Authenticate anonymously'), _('Authenticate anonymously'),
_('Firebase/Authentication'), _('Authentication'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -376,7 +380,7 @@ module.exports = {
'this before actions requiring authentications.' 'this before actions requiring authentications.'
), ),
_('Check for authentication'), _('Check for authentication'),
_('Firebase/Authentication'), _('Authentication'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -394,7 +398,7 @@ module.exports = {
_( _(
'Get the user authentififcation token. The token is the proof of authentication.' 'Get the user authentififcation token. The token is the proof of authentication.'
), ),
_('Firebase/Authentication'), _('Authentication'),
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
.addParameter('string', _('Setting Name'), '', false) .addParameter('string', _('Setting Name'), '', false)
@@ -412,7 +416,7 @@ module.exports = {
_('Is the user email address verified'), _('Is the user email address verified'),
_('Checks if the email address of the user got verified.'), _('Checks if the email address of the user got verified.'),
_('The email of the user is verified'), _('The email of the user is verified'),
_('Firebase/Authentication/User Management'), _('Authentication/User Management'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -430,7 +434,7 @@ module.exports = {
'GetUserEmail', 'GetUserEmail',
_('Get the user email address'), _('Get the user email address'),
_('Gets the user email address.'), _('Gets the user email address.'),
_('Firebase/Authentication/User Management'), _('Authentication/User Management'),
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -447,7 +451,7 @@ module.exports = {
'GetAccountCreationTime', 'GetAccountCreationTime',
_('Get the accounts creation time'), _('Get the accounts creation time'),
_('Gets the accounts creation time.'), _('Gets the accounts creation time.'),
_('Firebase/Authentication/User Management'), _('Authentication/User Management'),
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -464,7 +468,7 @@ module.exports = {
'GetLastLoginTime', 'GetLastLoginTime',
_('Get the user last login time'), _('Get the user last login time'),
_('Gets the user last login time.'), _('Gets the user last login time.'),
_('Firebase/Authentication/User Management'), _('Authentication/User Management'),
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -481,7 +485,7 @@ module.exports = {
'GetUserDisplayName', 'GetUserDisplayName',
_('Get the user display name'), _('Get the user display name'),
_('Gets the user display name.'), _('Gets the user display name.'),
_('Firebase/Authentication/User Management'), _('Authentication/User Management'),
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -498,7 +502,7 @@ module.exports = {
'GetPhoneNumber', 'GetPhoneNumber',
_('Get the user phone number'), _('Get the user phone number'),
_('Gets the user phone number.'), _('Gets the user phone number.'),
_('Firebase/Authentication/User Management'), _('Authentication/User Management'),
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -518,7 +522,7 @@ module.exports = {
'Gets the user Unique IDentifier. Use that to link data to an ' + 'Gets the user Unique IDentifier. Use that to link data to an ' +
'user instead of the name or email.' 'user instead of the name or email.'
), ),
_('Firebase/Authentication/User Management'), _('Authentication/User Management'),
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -535,7 +539,7 @@ module.exports = {
'GetTenantID', 'GetTenantID',
_('Get the user tenant ID'), _('Get the user tenant ID'),
_('Gets the user tenant ID. For advanced usage only.'), _('Gets the user tenant ID. For advanced usage only.'),
_('Firebase/Authentication/User Management'), _('Authentication/User Management'),
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -552,7 +556,7 @@ module.exports = {
'GetRefreshToken', 'GetRefreshToken',
_('Get the user refresh token'), _('Get the user refresh token'),
_('Gets the user refresh token. For advanced usage only.'), _('Gets the user refresh token. For advanced usage only.'),
_('Firebase/Authentication/User Management'), _('Authentication/User Management'),
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -569,7 +573,7 @@ module.exports = {
'GetPhotoURL', 'GetPhotoURL',
_('Get the user profile picture URL'), _('Get the user profile picture URL'),
_('Gets an URL to the user profile picture.'), _('Gets an URL to the user profile picture.'),
_('Firebase/Authentication/User Management'), _('Authentication/User Management'),
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -587,7 +591,7 @@ module.exports = {
_('Send a verification email'), _('Send a verification email'),
_('Send a link per email to verify the user email.'), _('Send a link per email to verify the user email.'),
_('Send verification email'), _('Send verification email'),
_('Firebase/Authentication/User Management'), _('Authentication/User Management'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -606,7 +610,7 @@ module.exports = {
_('Set display name'), _('Set display name'),
_('Sets the user display name.'), _('Sets the user display name.'),
_("Set the user's display name to _PARAM0_"), _("Set the user's display name to _PARAM0_"),
_('Firebase/Authentication/User Management'), _('Authentication/User Management'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -626,7 +630,7 @@ module.exports = {
_('Set the user profile picture'), _('Set the user profile picture'),
_('Sets the user profile picture URL to a new one.'), _('Sets the user profile picture URL to a new one.'),
_("Set the user's profile picture URL to _PARAM0_"), _("Set the user's profile picture URL to _PARAM0_"),
_('Firebase/Authentication/User Management'), _('Authentication/User Management'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -652,7 +656,7 @@ module.exports = {
_( _(
"Change the user's email to _PARAM0_ and store result in _PARAM4_ (send verification email: _PARAM3_)" "Change the user's email to _PARAM0_ and store result in _PARAM4_ (send verification email: _PARAM3_)"
), ),
_('Firebase/Authentication/User Management/Advanced'), _('Authentication/User Management/Advanced'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -693,7 +697,7 @@ module.exports = {
_( _(
"Change the user's email to _PARAM0_ and store result in _PARAM2_ (send verification email: _PARAM1_)" "Change the user's email to _PARAM0_ and store result in _PARAM2_ (send verification email: _PARAM1_)"
), ),
_('Firebase/Authentication/User Management/Advanced'), _('Authentication/User Management/Advanced'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -732,7 +736,7 @@ module.exports = {
'Change the user password to _PARAM2_ and store result in ' + 'Change the user password to _PARAM2_ and store result in ' +
'_PARAM4_ (send verification email: _PARAM3_)' '_PARAM4_ (send verification email: _PARAM3_)'
), ),
_('Firebase/Authentication/User Management/Advanced'), _('Authentication/User Management/Advanced'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -774,7 +778,7 @@ module.exports = {
'Change the user password to _PARAM0_ and store result in ' + 'Change the user password to _PARAM0_ and store result in ' +
'_PARAM2_ (send verification email: _PARAM1_)' '_PARAM2_ (send verification email: _PARAM1_)'
), ),
_('Firebase/Authentication/User Management/Advanced'), _('Authentication/User Management/Advanced'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -810,7 +814,7 @@ module.exports = {
'Deletes the user account.' 'Deletes the user account.'
), ),
_('Delete the user account and store result in _PARAM2_'), _('Delete the user account and store result in _PARAM2_'),
_('Firebase/Authentication/User Management/Advanced'), _('Authentication/User Management/Advanced'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -841,7 +845,7 @@ module.exports = {
'This is the same as "Delete the user account" but reauthenticates via an external provider.' 'This is the same as "Delete the user account" but reauthenticates via an external provider.'
), ),
_('Delete the user account and store result in _PARAM0_'), _('Delete the user account and store result in _PARAM0_'),
_('Firebase/Authentication/User Management/Advanced'), _('Authentication/User Management/Advanced'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -868,7 +872,7 @@ module.exports = {
_('Enable performance measuring'), _('Enable performance measuring'),
_('Enables performance measuring.'), _('Enables performance measuring.'),
_('Enable performance measuring'), _('Enable performance measuring'),
_('Firebase/Performance Measuring'), _('Performance Measuring'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -889,7 +893,7 @@ module.exports = {
'They are used to measure performance of custom events.' 'They are used to measure performance of custom events.'
), ),
_('Create performance tracker: _PARAM0_'), _('Create performance tracker: _PARAM0_'),
_('Firebase/Performance Measuring'), _('Performance Measuring'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -911,7 +915,7 @@ module.exports = {
_('Start a tracer'), _('Start a tracer'),
_('Start measuring performance for that tracer'), _('Start measuring performance for that tracer'),
_('Start performance measuring on tracer _PARAM0_'), _('Start performance measuring on tracer _PARAM0_'),
_('Firebase/Performance Measuring'), _('Performance Measuring'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -933,7 +937,7 @@ module.exports = {
_('Stop a tracer'), _('Stop a tracer'),
_('Stop measuring performance for that tracer'), _('Stop measuring performance for that tracer'),
_('Stop performance measuring on tracer _PARAM0_'), _('Stop performance measuring on tracer _PARAM0_'),
_('Firebase/Performance Measuring'), _('Performance Measuring'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -960,7 +964,7 @@ module.exports = {
_( _(
'Record performance for _PARAM1_ms with a delay of _PARAM2_ms (store in tracker _PARAM0_)' 'Record performance for _PARAM1_ms with a delay of _PARAM2_ms (store in tracker _PARAM0_)'
), ),
_('Firebase/Performance Measuring'), _('Performance Measuring'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -996,7 +1000,7 @@ module.exports = {
'Call HTTP Function _PARAM0_ with parameter(s) _PARAM1_ ' + 'Call HTTP Function _PARAM0_ with parameter(s) _PARAM1_ ' +
'(Callback variables: Value: _PARAM2_ State: _PARAM3_)' '(Callback variables: Value: _PARAM2_ State: _PARAM3_)'
), ),
_('Firebase/Functions'), _('Functions'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -1033,7 +1037,7 @@ module.exports = {
_('Enable Messaging'), _('Enable Messaging'),
_('Enables Firebase push messaging.'), _('Enables Firebase push messaging.'),
_('Enable Firebase Messaging with Public Key _PARAM0_.'), _('Enable Firebase Messaging with Public Key _PARAM0_.'),
_('Firebase/Messaging'), _('Messaging'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -1055,7 +1059,7 @@ module.exports = {
_( _(
'Set a field to the timstamp on the server when the request arrives there' 'Set a field to the timstamp on the server when the request arrives there'
), ),
_('Firebase/Cloud Firestore'), _('Cloud Firestore'),
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -1080,7 +1084,7 @@ module.exports = {
'A query allows to get a filtered and ordered list of documents in a collection.' 'A query allows to get a filtered and ordered list of documents in a collection.'
), ),
_('Create a query named _PARAM0_ for collection _PARAM1_'), _('Create a query named _PARAM0_ for collection _PARAM1_'),
_('Firebase/Cloud Firestore/Queries/Initialize'), _('Cloud Firestore/Queries/Initialize'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -1103,7 +1107,7 @@ module.exports = {
_('Start a query from another query'), _('Start a query from another query'),
_('Start a query with the same collection and filters as another one.'), _('Start a query with the same collection and filters as another one.'),
_('Create a query named _PARAM0_ from query _PARAM1_'), _('Create a query named _PARAM0_ from query _PARAM1_'),
_('Firebase/Cloud Firestore/Queries/Initialize'), _('Cloud Firestore/Queries/Initialize'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -1134,7 +1138,7 @@ module.exports = {
_( _(
'Filter query _PARAM0_ to remove documents whose field _PARAM1_ is not _PARAM2__PARAM3_' 'Filter query _PARAM0_ to remove documents whose field _PARAM1_ is not _PARAM2__PARAM3_'
), ),
_('Firebase/Cloud Firestore/Queries/Filters'), _('Cloud Firestore/Queries/Filters'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -1167,7 +1171,7 @@ module.exports = {
_( _(
'Filter query _PARAM0_ to remove documents whose field _PARAM1_ is not _PARAM2__PARAM3_' 'Filter query _PARAM0_ to remove documents whose field _PARAM1_ is not _PARAM2__PARAM3_'
), ),
_('Firebase/Cloud Firestore/Queries/Filters'), _('Cloud Firestore/Queries/Filters'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -1198,7 +1202,7 @@ module.exports = {
_('Order by field value'), _('Order by field value'),
_('Orders all documents in the query by a the value of a field.'), _('Orders all documents in the query by a the value of a field.'),
_('Order query _PARAM0_ by field _PARAM1_ (direction: _PARAM2_)'), _('Order query _PARAM0_ by field _PARAM1_ (direction: _PARAM2_)'),
_('Firebase/Cloud Firestore/Queries/Filters'), _('Cloud Firestore/Queries/Filters'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -1234,7 +1238,7 @@ module.exports = {
_( _(
'Limit query _PARAM0_ to _PARAM1_ documents (begin from the end: _PARAM2_)' 'Limit query _PARAM0_ to _PARAM1_ documents (begin from the end: _PARAM2_)'
), ),
_('Firebase/Cloud Firestore/Queries/Filters'), _('Cloud Firestore/Queries/Filters'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -1266,7 +1270,7 @@ module.exports = {
_( _(
'Skip documents with fields (before: _PARAM2_) value _PARAM1_ in query _PARAM0_ (include documents at that value: _PARAM3_)' 'Skip documents with fields (before: _PARAM2_) value _PARAM1_ in query _PARAM0_ (include documents at that value: _PARAM3_)'
), ),
_('Firebase/Cloud Firestore/Queries/Filters'), _('Cloud Firestore/Queries/Filters'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -1308,7 +1312,7 @@ module.exports = {
_( _(
'Execute query _PARAM0_ and store results into _PARAM1_ (store result state in _PARAM2_)' 'Execute query _PARAM0_ and store results into _PARAM1_ (store result state in _PARAM2_)'
), ),
_('Firebase/Cloud Firestore/Queries/Execute'), _('Cloud Firestore/Queries/Execute'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -1350,7 +1354,7 @@ module.exports = {
_( _(
'Watch and automatically execute query _PARAM0_ and store results into _PARAM1_ (store result state in _PARAM2_)' 'Watch and automatically execute query _PARAM0_ and store results into _PARAM1_ (store result state in _PARAM2_)'
), ),
_('Firebase/Cloud Firestore/Queries/Execute'), _('Cloud Firestore/Queries/Execute'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -1392,7 +1396,7 @@ module.exports = {
'This needs to be called before any other firestore operation, otherwise it will fail.' 'This needs to be called before any other firestore operation, otherwise it will fail.'
), ),
_('Enable persistence'), _('Enable persistence'),
_('Firebase/Cloud Firestore'), _('Cloud Firestore'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -1416,7 +1420,7 @@ module.exports = {
'This needs to be called before any other firestore operation, otherwise it will fail.' 'This needs to be called before any other firestore operation, otherwise it will fail.'
), ),
_('Disable persistence'), _('Disable persistence'),
_('Firebase/Cloud Firestore'), _('Cloud Firestore'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -1437,7 +1441,7 @@ module.exports = {
_('Re-enable network'), _('Re-enable network'),
_('Re-enables the connection to the database after disabling it.'), _('Re-enables the connection to the database after disabling it.'),
_('Re-enable network'), _('Re-enable network'),
_('Firebase/Cloud Firestore'), _('Cloud Firestore'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -1462,7 +1466,7 @@ module.exports = {
'cache, and any write operations will be queued until the network is restored.' 'cache, and any write operations will be queued until the network is restored.'
), ),
_('Disable network'), _('Disable network'),
_('Firebase/Cloud Firestore'), _('Cloud Firestore'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -1485,7 +1489,7 @@ module.exports = {
_( _(
'Write _PARAM2_ to firestore in document _PARAM1_ of collection _PARAM0_ (store result state in _PARAM3_)' 'Write _PARAM2_ to firestore in document _PARAM1_ of collection _PARAM0_ (store result state in _PARAM3_)'
), ),
_('Firebase/Cloud Firestore/Documents'), _('Cloud Firestore/Documents'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -1517,7 +1521,7 @@ module.exports = {
_( _(
'Add _PARAM1_ to firestore collection _PARAM0_ (store result state in _PARAM2_)' 'Add _PARAM1_ to firestore collection _PARAM0_ (store result state in _PARAM2_)'
), ),
_('Firebase/Cloud Firestore/Documents'), _('Cloud Firestore/Documents'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -1548,7 +1552,7 @@ module.exports = {
_( _(
'Write _PARAM3_ to firestore in field _PARAM2_ of document _PARAM1_ in collection _PARAM0_ (store result state in _PARAM4_, Merge: _PARAM5_)' 'Write _PARAM3_ to firestore in field _PARAM2_ of document _PARAM1_ in collection _PARAM0_ (store result state in _PARAM4_, Merge: _PARAM5_)'
), ),
_('Firebase/Cloud Firestore/Fields'), _('Cloud Firestore/Fields'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -1582,7 +1586,7 @@ module.exports = {
_( _(
'Update firestore document _PARAM1_ in collection _PARAM0_ with _PARAM2_ (store result state in _PARAM3_)' 'Update firestore document _PARAM1_ in collection _PARAM0_ with _PARAM2_ (store result state in _PARAM3_)'
), ),
_('Firebase/Cloud Firestore/Documents'), _('Cloud Firestore/Documents'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -1614,7 +1618,7 @@ module.exports = {
_( _(
'Update field _PARAM2_ of firestore document _PARAM1_ in collection _PARAM0_ with _PARAM3_ (store result state in _PARAM4_)' 'Update field _PARAM2_ of firestore document _PARAM1_ in collection _PARAM0_ with _PARAM3_ (store result state in _PARAM4_)'
), ),
_('Firebase/Cloud Firestore/Fields'), _('Cloud Firestore/Fields'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -1647,7 +1651,7 @@ module.exports = {
_( _(
'Delete firestore document _PARAM1_ in collection _PARAM0_ (store result state in _PARAM2_)' 'Delete firestore document _PARAM1_ in collection _PARAM0_ (store result state in _PARAM2_)'
), ),
_('Firebase/Cloud Firestore/Documents'), _('Cloud Firestore/Documents'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -1678,7 +1682,7 @@ module.exports = {
_( _(
'Delete field _PARAM2_ of firestore document _PARAM1_ in collection _PARAM0_ with (store result state in _PARAM3_)' 'Delete field _PARAM2_ of firestore document _PARAM1_ in collection _PARAM0_ with (store result state in _PARAM3_)'
), ),
_('Firebase/Cloud Firestore/Fields'), _('Cloud Firestore/Fields'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -1710,7 +1714,7 @@ module.exports = {
_( _(
'Load firestore document _PARAM1_ from collection _PARAM0_ into _PARAM2_ (store result state in _PARAM3_)' 'Load firestore document _PARAM1_ from collection _PARAM0_ into _PARAM2_ (store result state in _PARAM3_)'
), ),
_('Firebase/Cloud Firestore/Documents'), _('Cloud Firestore/Documents'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -1747,7 +1751,7 @@ module.exports = {
_( _(
'Load field _PARAM2_ of firestore document _PARAM1_ in collection _PARAM0_ into _PARAM3_ (store result state in _PARAM4_)' 'Load field _PARAM2_ of firestore document _PARAM1_ in collection _PARAM0_ into _PARAM3_ (store result state in _PARAM4_)'
), ),
_('Firebase/Cloud Firestore/Fields'), _('Cloud Firestore/Fields'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -1787,7 +1791,7 @@ module.exports = {
_( _(
'Check for existence of _PARAM1_ in collection _PARAM0_ and store result in _PARAM2_ (store result state in _PARAM3_)' 'Check for existence of _PARAM1_ in collection _PARAM0_ and store result in _PARAM2_ (store result state in _PARAM3_)'
), ),
_('Firebase/Cloud Firestore/Documents'), _('Cloud Firestore/Documents'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -1826,7 +1830,7 @@ module.exports = {
_( _(
'Check for existence of _PARAM2_ in document _PARAM1_ of collection _PARAM0_ and store result in _PARAM3_ (store result state in _PARAM4_)' 'Check for existence of _PARAM2_ in document _PARAM1_ of collection _PARAM0_ and store result in _PARAM3_ (store result state in _PARAM4_)'
), ),
_('Firebase/Cloud Firestore/Fields'), _('Cloud Firestore/Fields'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -1866,7 +1870,7 @@ module.exports = {
_( _(
'List all documents in _PARAM0_ and store result in _PARAM1_ (store result state in _PARAM2_)' 'List all documents in _PARAM0_ and store result in _PARAM1_ (store result state in _PARAM2_)'
), ),
_('Firebase/Cloud Firestore'), _('Cloud Firestore'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -1905,7 +1909,7 @@ module.exports = {
_( _(
'Save _PARAM0_ in location _PARAM1_ to Firebase storage and store access URL in _PARAM3_ (Format: _PARAM2_, Store result state in _PARAM4_)' 'Save _PARAM0_ in location _PARAM1_ to Firebase storage and store access URL in _PARAM3_ (Format: _PARAM2_, Store result state in _PARAM4_)'
), ),
_('Firebase/Storage'), _('Storage'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -1946,7 +1950,7 @@ module.exports = {
_( _(
'Get a download url for _PARAM0_ and store it in _PARAM1_ (store result state in _PARAM2_)' 'Get a download url for _PARAM0_ and store it in _PARAM1_ (store result state in _PARAM2_)'
), ),
_('Firebase/Storage'), _('Storage'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -1980,7 +1984,7 @@ module.exports = {
_( _(
'Write _PARAM1_ to Database in _PARAM0_ (store result state in _PARAM2_)' 'Write _PARAM1_ to Database in _PARAM0_ (store result state in _PARAM2_)'
), ),
_('Firebase/Realtime Database'), _('Realtime Database'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -2007,7 +2011,7 @@ module.exports = {
_( _(
'Write _PARAM2_ in field _PARAM1_ of _PARAM0_ (store result state in _PARAM3_)' 'Write _PARAM2_ in field _PARAM1_ of _PARAM0_ (store result state in _PARAM3_)'
), ),
_('Firebase/Realtime Database'), _('Realtime Database'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -2035,7 +2039,7 @@ module.exports = {
_( _(
'Update varable _PARAM0_ with _PARAM1_ (store result state in _PARAM2_)' 'Update varable _PARAM0_ with _PARAM1_ (store result state in _PARAM2_)'
), ),
_('Firebase/Realtime Database'), _('Realtime Database'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -2062,7 +2066,7 @@ module.exports = {
_( _(
'Update field _PARAM1_ of _PARAM0_ with _PARAM2_ (store result state in _PARAM3_)' 'Update field _PARAM1_ of _PARAM0_ with _PARAM2_ (store result state in _PARAM3_)'
), ),
_('Firebase/Realtime Database'), _('Realtime Database'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -2090,7 +2094,7 @@ module.exports = {
_( _(
'Delete variable _PARAM0_ from database (store result state in _PARAM1_)' 'Delete variable _PARAM0_ from database (store result state in _PARAM1_)'
), ),
_('Firebase/Realtime Database'), _('Realtime Database'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -2116,7 +2120,7 @@ module.exports = {
_( _(
'Delete field _PARAM1_ of variable _PARAM0_ on the database (store result state in _PARAM2_)' 'Delete field _PARAM1_ of variable _PARAM0_ on the database (store result state in _PARAM2_)'
), ),
_('Firebase/Realtime Database'), _('Realtime Database'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -2145,7 +2149,7 @@ module.exports = {
_( _(
'Load database variable _PARAM0_ into _PARAM1_ (store result state in _PARAM2_)' 'Load database variable _PARAM0_ into _PARAM1_ (store result state in _PARAM2_)'
), ),
_('Firebase/Realtime Database'), _('Realtime Database'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -2179,7 +2183,7 @@ module.exports = {
_( _(
'Load field _PARAM1_ of database variable _PARAM0_ into _PARAM2_ (store result state in _PARAM3_)' 'Load field _PARAM1_ of database variable _PARAM0_ into _PARAM2_ (store result state in _PARAM3_)'
), ),
_('Firebase/Realtime Database'), _('Realtime Database'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -2214,7 +2218,7 @@ module.exports = {
_( _(
'Check for existence of _PARAM0_ and store result in _PARAM1_ (store result state in _PARAM2_)' 'Check for existence of _PARAM0_ and store result in _PARAM1_ (store result state in _PARAM2_)'
), ),
_('Firebase/Realtime Database'), _('Realtime Database'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )
@@ -2248,7 +2252,7 @@ module.exports = {
_( _(
'Check for existence of _PARAM1_ in database variable _PARAM0_ and store result in _PARAM2_ (store result state in _PARAM3_)' 'Check for existence of _PARAM1_ in database variable _PARAM0_ and store result in _PARAM2_ (store result state in _PARAM3_)'
), ),
_('Firebase/Realtime Database'), _('Realtime Database'),
'JsPlatform/Extensions/firebase.png', 'JsPlatform/Extensions/firebase.png',
'JsPlatform/Extensions/firebase.png' 'JsPlatform/Extensions/firebase.png'
) )

View File

@@ -13,12 +13,16 @@ This project is released under the MIT License.
void DeclareInventoryExtension(gd::PlatformExtension& extension) { void DeclareInventoryExtension(gd::PlatformExtension& extension) {
extension.SetExtensionInformation( extension.SetExtensionInformation(
"Inventory", "Inventory",
_("Inventory"), _("Inventories"),
_("Provides actions and conditions to add an inventory to your game, " _("Provides actions and conditions to add an inventory to your game, "
"with items in memory."), "with items in memory."),
"Florian Rival", "Florian Rival",
"Open source (MIT License)") "Open source (MIT License)")
.SetExtensionHelpPath("/all-features/inventory"); .SetExtensionHelpPath("/all-features/inventory")
.SetCategory("Advanced");
extension
.AddInstructionOrExpressionGroupMetadata(_("Inventories"))
.SetIcon("CppPlatform/Extensions/Inventoryicon.png");
#if defined(GD_IDE_ONLY) #if defined(GD_IDE_ONLY)
extension extension
@@ -26,9 +30,9 @@ void DeclareInventoryExtension(gd::PlatformExtension& extension) {
_("Add an item"), _("Add an item"),
_("Add an item in an inventory."), _("Add an item in an inventory."),
_("Add a _PARAM2_ to inventory _PARAM1_"), _("Add a _PARAM2_ to inventory _PARAM1_"),
_("Inventories"), "",
"CppPlatform/Extensions/Inventoryicon24.png", "CppPlatform/Extensions/Inventoryicon.png",
"CppPlatform/Extensions/Inventoryicon16.png") "CppPlatform/Extensions/Inventoryicon.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
.AddParameter("string", _("Inventory name")) .AddParameter("string", _("Inventory name"))
@@ -41,9 +45,9 @@ void DeclareInventoryExtension(gd::PlatformExtension& extension) {
_("Remove an item"), _("Remove an item"),
_("Remove an item from an inventory."), _("Remove an item from an inventory."),
_("Remove a _PARAM2_ from inventory _PARAM1_"), _("Remove a _PARAM2_ from inventory _PARAM1_"),
_("Inventories"), "",
"CppPlatform/Extensions/Inventoryicon24.png", "CppPlatform/Extensions/Inventoryicon.png",
"CppPlatform/Extensions/Inventoryicon16.png") "CppPlatform/Extensions/Inventoryicon.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
.AddParameter("string", _("Inventory name")) .AddParameter("string", _("Inventory name"))
@@ -56,9 +60,9 @@ void DeclareInventoryExtension(gd::PlatformExtension& extension) {
_("Item count"), _("Item count"),
_("Compare the number of an item in an inventory."), _("Compare the number of an item in an inventory."),
_("the count of _PARAM2_ in _PARAM1_"), _("the count of _PARAM2_ in _PARAM1_"),
_("Inventories"), "",
"CppPlatform/Extensions/Inventoryicon24.png", "CppPlatform/Extensions/Inventoryicon.png",
"CppPlatform/Extensions/Inventoryicon16.png") "CppPlatform/Extensions/Inventoryicon.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
.AddParameter("string", _("Inventory name")) .AddParameter("string", _("Inventory name"))
@@ -73,9 +77,9 @@ void DeclareInventoryExtension(gd::PlatformExtension& extension) {
_("Check if at least one of the specified items is in the " _("Check if at least one of the specified items is in the "
"inventory."), "inventory."),
_("Inventory _PARAM1_ contains a _PARAM2_"), _("Inventory _PARAM1_ contains a _PARAM2_"),
_("Inventories"), "",
"CppPlatform/Extensions/Inventoryicon24.png", "CppPlatform/Extensions/Inventoryicon.png",
"CppPlatform/Extensions/Inventoryicon16.png") "CppPlatform/Extensions/Inventoryicon.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
.AddParameter("string", _("Inventory name")) .AddParameter("string", _("Inventory name"))
@@ -91,9 +95,9 @@ void DeclareInventoryExtension(gd::PlatformExtension& extension) {
"each item is unlimited."), "each item is unlimited."),
_("Set the maximum count for _PARAM2_ in inventory _PARAM1_ " _("Set the maximum count for _PARAM2_ in inventory _PARAM1_ "
"to _PARAM3_"), "to _PARAM3_"),
_("Inventories"), "",
"CppPlatform/Extensions/Inventoryicon24.png", "CppPlatform/Extensions/Inventoryicon.png",
"CppPlatform/Extensions/Inventoryicon16.png") "CppPlatform/Extensions/Inventoryicon.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
.AddParameter("string", _("Inventory name")) .AddParameter("string", _("Inventory name"))
@@ -109,9 +113,9 @@ void DeclareInventoryExtension(gd::PlatformExtension& extension) {
"inventory. This is the case by default for each item."), "inventory. This is the case by default for each item."),
_("Allow an unlimited count of _PARAM2_ in inventory " _("Allow an unlimited count of _PARAM2_ in inventory "
"_PARAM1_: _PARAM3_"), "_PARAM1_: _PARAM3_"),
_("Inventories"), "",
"CppPlatform/Extensions/Inventoryicon24.png", "CppPlatform/Extensions/Inventoryicon.png",
"CppPlatform/Extensions/Inventoryicon16.png") "CppPlatform/Extensions/Inventoryicon.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
.AddParameter("string", _("Inventory name")) .AddParameter("string", _("Inventory name"))
@@ -126,9 +130,9 @@ void DeclareInventoryExtension(gd::PlatformExtension& extension) {
_("Check if an item has reached its maximum number allowed " _("Check if an item has reached its maximum number allowed "
"in the inventory."), "in the inventory."),
_("Inventory _PARAM1_ is full of _PARAM2_"), _("Inventory _PARAM1_ is full of _PARAM2_"),
_("Inventories"), "",
"CppPlatform/Extensions/Inventoryicon24.png", "CppPlatform/Extensions/Inventoryicon.png",
"CppPlatform/Extensions/Inventoryicon16.png") "CppPlatform/Extensions/Inventoryicon.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
.AddParameter("string", _("Inventory name")) .AddParameter("string", _("Inventory name"))
@@ -142,9 +146,9 @@ void DeclareInventoryExtension(gd::PlatformExtension& extension) {
_("Mark an item as being equipped. If the item count is 0, it " _("Mark an item as being equipped. If the item count is 0, it "
"won't be marked as equipped."), "won't be marked as equipped."),
_("Set _PARAM2_ as equipped in inventory _PARAM1_: _PARAM3_"), _("Set _PARAM2_ as equipped in inventory _PARAM1_: _PARAM3_"),
_("Inventories"), "",
"CppPlatform/Extensions/Inventoryicon24.png", "CppPlatform/Extensions/Inventoryicon.png",
"CppPlatform/Extensions/Inventoryicon16.png") "CppPlatform/Extensions/Inventoryicon.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
.AddParameter("string", _("Inventory name")) .AddParameter("string", _("Inventory name"))
@@ -158,9 +162,9 @@ void DeclareInventoryExtension(gd::PlatformExtension& extension) {
_("Item equipped"), _("Item equipped"),
_("Check if an item is equipped."), _("Check if an item is equipped."),
_("_PARAM2_ is equipped in inventory _PARAM1_"), _("_PARAM2_ is equipped in inventory _PARAM1_"),
_("Inventories"), "",
"CppPlatform/Extensions/Inventoryicon24.png", "CppPlatform/Extensions/Inventoryicon.png",
"CppPlatform/Extensions/Inventoryicon16.png") "CppPlatform/Extensions/Inventoryicon.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
.AddParameter("string", _("Inventory name")) .AddParameter("string", _("Inventory name"))
@@ -174,9 +178,9 @@ void DeclareInventoryExtension(gd::PlatformExtension& extension) {
_("Save all the items of the inventory in a scene variable, so that " _("Save all the items of the inventory in a scene variable, so that "
"it can be restored later."), "it can be restored later."),
_("Save inventory _PARAM1_ in variable _PARAM2_"), _("Save inventory _PARAM1_ in variable _PARAM2_"),
_("Inventories/Variables"), _("Variables"),
"CppPlatform/Extensions/Inventoryicon24.png", "CppPlatform/Extensions/Inventoryicon.png",
"CppPlatform/Extensions/Inventoryicon16.png") "CppPlatform/Extensions/Inventoryicon.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
.AddParameter("string", _("Inventory name")) .AddParameter("string", _("Inventory name"))
@@ -189,9 +193,9 @@ void DeclareInventoryExtension(gd::PlatformExtension& extension) {
_("Load an inventory from a scene variable"), _("Load an inventory from a scene variable"),
_("Load the content of the inventory from a scene variable."), _("Load the content of the inventory from a scene variable."),
_("Load inventory _PARAM1_ from variable _PARAM2_"), _("Load inventory _PARAM1_ from variable _PARAM2_"),
_("Inventories/Variables"), _("Variables"),
"CppPlatform/Extensions/Inventoryicon24.png", "CppPlatform/Extensions/Inventoryicon.png",
"CppPlatform/Extensions/Inventoryicon16.png") "CppPlatform/Extensions/Inventoryicon.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
.AddParameter("string", _("Inventory name")) .AddParameter("string", _("Inventory name"))
@@ -203,8 +207,8 @@ void DeclareInventoryExtension(gd::PlatformExtension& extension) {
.AddExpression("Count", .AddExpression("Count",
_("Item count"), _("Item count"),
_("Get the number of an item in the inventory"), _("Get the number of an item in the inventory"),
_("Inventory"), "",
"CppPlatform/Extensions/Inventoryicon16.png") "CppPlatform/Extensions/Inventoryicon.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
.AddParameter("string", _("Inventory name")) .AddParameter("string", _("Inventory name"))
.AddParameter("string", _("Item name")) .AddParameter("string", _("Item name"))

View File

@@ -59,7 +59,7 @@ module.exports = {
_('Light Obstacle Behavior'), _('Light Obstacle Behavior'),
'LightObstacleBehavior', 'LightObstacleBehavior',
_( _(
'This behavior makes the object an obstacle to the light. The light emitted by light objects will be stopped by the object.' 'Flag objects as being obstacles to light. The light emitted by light objects will be stopped by the object.'
), ),
'', '',
'CppPlatform/Extensions/lightObstacleIcon32.png', 'CppPlatform/Extensions/lightObstacleIcon32.png',
@@ -132,6 +132,7 @@ module.exports = {
'When activated, display the lines used to render the light - useful to understand how the light is rendered on screen.' 'When activated, display the lines used to render the light - useful to understand how the light is rendered on screen.'
) )
) )
.setGroup(_('Advanced'))
); );
objectProperties objectProperties
@@ -193,7 +194,8 @@ module.exports = {
) )
.setIncludeFile('Extensions/Lighting/lightruntimeobject.js') .setIncludeFile('Extensions/Lighting/lightruntimeobject.js')
.addIncludeFile('Extensions/Lighting/lightruntimeobject-pixi-renderer.js') .addIncludeFile('Extensions/Lighting/lightruntimeobject-pixi-renderer.js')
.addIncludeFile('Extensions/Lighting/lightobstacleruntimebehavior.js'); .addIncludeFile('Extensions/Lighting/lightobstacleruntimebehavior.js')
.setCategoryFullName(_('Lights'));
object object
.addAction( .addAction(
@@ -241,7 +243,7 @@ module.exports = {
objectsEditorService.registerEditorConfiguration( objectsEditorService.registerEditorConfiguration(
'Lighting::LightObject', 'Lighting::LightObject',
objectsEditorService.getDefaultObjectJsImplementationPropertiesEditor({ objectsEditorService.getDefaultObjectJsImplementationPropertiesEditor({
helpPagePath: '/objects/light', helpPagePath: '/all-features/lighting/reference',
}) })
); );
}, },

View File

@@ -53,8 +53,8 @@ namespace gdjs {
getAllObstaclesAround( getAllObstaclesAround(
object: gdjs.RuntimeObject, object: gdjs.RuntimeObject,
radius: number, radius: number,
result: gdjs.BehaviorRBushAABB<gdjs.LightObstacleRuntimeBehavior>[] result: gdjs.LightObstacleRuntimeBehavior[]
) { ): void {
// TODO: This would better be done using the object AABB (getAABB), as (`getCenterX`;`getCenterY`) point // TODO: This would better be done using the object AABB (getAABB), as (`getCenterX`;`getCenterY`) point
// is not necessarily in the middle of the object (for sprites for example). // is not necessarily in the middle of the object (for sprites for example).
const x = object.getX(); const x = object.getX();
@@ -70,9 +70,13 @@ namespace gdjs {
searchArea.maxX = x + radius; searchArea.maxX = x + radius;
// @ts-ignore // @ts-ignore
searchArea.maxY = y + radius; searchArea.maxY = y + radius;
const nearbyObstacles = this._obstacleRBush.search(searchArea); const nearbyObstacles: gdjs.BehaviorRBushAABB<
gdjs.LightObstacleRuntimeBehavior
>[] = this._obstacleRBush.search(searchArea);
result.length = 0; result.length = 0;
result.push.apply(result, nearbyObstacles); nearbyObstacles.forEach((nearbyObstacle) =>
result.push(nearbyObstacle.behavior)
);
} }
} }

View File

@@ -369,9 +369,7 @@ namespace gdjs {
* @returns the vertices of mesh. * @returns the vertices of mesh.
*/ */
_computeLightVertices(): Array<FloatPoint> { _computeLightVertices(): Array<FloatPoint> {
const lightObstacles: gdjs.BehaviorRBushAABB< const lightObstacles: gdjs.LightObstacleRuntimeBehavior[] = [];
LightObstacleRuntimeBehavior
>[] = [];
if (this._manager) { if (this._manager) {
this._manager.getAllObstaclesAround( this._manager.getAllObstaclesAround(
this._object, this._object,
@@ -402,9 +400,7 @@ namespace gdjs {
const obstaclePolygons: Array<gdjs.Polygon> = []; const obstaclePolygons: Array<gdjs.Polygon> = [];
obstaclePolygons.push(this._lightBoundingPoly); obstaclePolygons.push(this._lightBoundingPoly);
for (let i = 0; i < lightObstacles.length; i++) { for (let i = 0; i < lightObstacles.length; i++) {
const obstacleHitBoxes = lightObstacles[ const obstacleHitBoxes = lightObstacles[i].owner.getHitBoxesAround(
i
].behavior.owner.getHitBoxesAround(
searchAreaLeft, searchAreaLeft,
searchAreaTop, searchAreaTop,
searchAreaRight, searchAreaRight,

View File

@@ -23,7 +23,10 @@ void DeclareLinkedObjectsExtension(gd::PlatformExtension& extension) {
"that is more efficient than using variables.", "that is more efficient than using variables.",
"Florian Rival", "Florian Rival",
"Open source (MIT License)") "Open source (MIT License)")
.SetExtensionHelpPath("/all-features/linked-objects"); .SetExtensionHelpPath("/all-features/linked-objects")
.SetCategory("Advanced");
extension.AddInstructionOrExpressionGroupMetadata(_("Linked objects"))
.SetIcon("CppPlatform/Extensions/LinkedObjectsicon24.png");
#if defined(GD_IDE_ONLY) #if defined(GD_IDE_ONLY)
@@ -33,9 +36,9 @@ void DeclareLinkedObjectsExtension(gd::PlatformExtension& extension) {
_("Link two objects together, so as to be able to get one " _("Link two objects together, so as to be able to get one "
"from the other."), "from the other."),
_("Link _PARAM1_ and _PARAM2_"), _("Link _PARAM1_ and _PARAM2_"),
_("Linked objects"), "",
"CppPlatform/Extensions/LinkedObjectsicon24.png", "CppPlatform/Extensions/LinkedObjectsicon24.png",
"CppPlatform/Extensions/LinkedObjectsicon16.png") "CppPlatform/Extensions/LinkedObjectsicon24.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
.AddParameter("objectPtr", _("Object 1")) .AddParameter("objectPtr", _("Object 1"))
@@ -49,9 +52,9 @@ void DeclareLinkedObjectsExtension(gd::PlatformExtension& extension) {
_("Unlink two objects"), _("Unlink two objects"),
_("Unlink two objects."), _("Unlink two objects."),
_("Unlink _PARAM1_ and _PARAM2_"), _("Unlink _PARAM1_ and _PARAM2_"),
_("Linked objects"), "",
"CppPlatform/Extensions/LinkedObjectsicon24.png", "CppPlatform/Extensions/LinkedObjectsicon24.png",
"CppPlatform/Extensions/LinkedObjectsicon16.png") "CppPlatform/Extensions/LinkedObjectsicon24.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
.AddParameter("objectPtr", _("Object 1")) .AddParameter("objectPtr", _("Object 1"))
@@ -65,9 +68,9 @@ void DeclareLinkedObjectsExtension(gd::PlatformExtension& extension) {
_("Unlink all objects from an object"), _("Unlink all objects from an object"),
_("Unlink all objects from an object."), _("Unlink all objects from an object."),
_("Unlink all objects from _PARAM1_"), _("Unlink all objects from _PARAM1_"),
_("Linked objects"), "",
"CppPlatform/Extensions/LinkedObjectsicon24.png", "CppPlatform/Extensions/LinkedObjectsicon24.png",
"CppPlatform/Extensions/LinkedObjectsicon16.png") "CppPlatform/Extensions/LinkedObjectsicon24.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
.AddParameter("objectPtr", _("Object")) .AddParameter("objectPtr", _("Object"))
@@ -82,9 +85,9 @@ void DeclareLinkedObjectsExtension(gd::PlatformExtension& extension) {
"next conditions and actions.\nThe condition will return " "next conditions and actions.\nThe condition will return "
"false if no object was taken into account."), "false if no object was taken into account."),
_("Take into account all \"_PARAM1_\" linked to _PARAM2_"), _("Take into account all \"_PARAM1_\" linked to _PARAM2_"),
_("Linked objects"), "",
"CppPlatform/Extensions/LinkedObjectsicon24.png", "CppPlatform/Extensions/LinkedObjectsicon24.png",
"CppPlatform/Extensions/LinkedObjectsicon16.png") "CppPlatform/Extensions/LinkedObjectsicon24.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
.AddParameter("objectList", _("Pick these objects...")) .AddParameter("objectList", _("Pick these objects..."))
@@ -100,9 +103,9 @@ void DeclareLinkedObjectsExtension(gd::PlatformExtension& extension) {
_("Take into account linked objects"), _("Take into account linked objects"),
_("Take objects linked to the object into account for next actions."), _("Take objects linked to the object into account for next actions."),
_("Take into account all \"_PARAM1_\" linked to _PARAM2_"), _("Take into account all \"_PARAM1_\" linked to _PARAM2_"),
_("Linked objects"), "",
"CppPlatform/Extensions/LinkedObjectsicon24.png", "CppPlatform/Extensions/LinkedObjectsicon24.png",
"CppPlatform/Extensions/LinkedObjectsicon16.png") "CppPlatform/Extensions/LinkedObjectsicon24.png")
.AddCodeOnlyParameter("currentScene", "") .AddCodeOnlyParameter("currentScene", "")
.AddParameter("objectList", _("Pick these objects...")) .AddParameter("objectList", _("Pick these objects..."))

View File

@@ -211,8 +211,7 @@ namespace gdjs {
}; };
/** /**
* Gets an event from {@link events} * Get an event or creates it if it doesn't exist.
* or creates it if it doesn't exist.
*/ */
export const getEvent = (name: string) => { export const getEvent = (name: string) => {
if (!events.hasOwnProperty(name)) events[name] = new Event(); if (!events.hasOwnProperty(name)) events[name] = new Event();

View File

@@ -28,12 +28,16 @@ module.exports = {
extension extension
.setExtensionInformation( .setExtensionInformation(
'P2P', 'P2P',
_('Peer-to-Peer communication (experimental)'), _('P2P (experimental)'),
'Allow game instances to communicate remotely using messages sent via WebRTC (P2P).', 'Allow game instances to communicate remotely using messages sent via WebRTC (P2P).',
'Arthur Pacaud (arthuro555)', 'Arthur Pacaud (arthuro555)',
'MIT' 'MIT'
) )
.setExtensionHelpPath('/all-features/p2p'); .setExtensionHelpPath('/all-features/p2p')
.setCategory('Network');
extension
.addInstructionOrExpressionGroupMetadata(_('P2P (experimental)'))
.setIcon('JsPlatform/Extensions/p2picon.svg');
extension extension
.addCondition( .addCondition(
@@ -41,7 +45,7 @@ module.exports = {
_('Event triggered by peer'), _('Event triggered by peer'),
_('Triggers once when a connected client sends the event'), _('Triggers once when a connected client sends the event'),
_('Event _PARAM0_ received from other client (data loss: _PARAM1_)'), _('Event _PARAM0_ received from other client (data loss: _PARAM1_)'),
_('P2P (experimental)'), '',
'JsPlatform/Extensions/p2picon.svg', 'JsPlatform/Extensions/p2picon.svg',
'JsPlatform/Extensions/p2picon.svg' 'JsPlatform/Extensions/p2picon.svg'
) )
@@ -60,7 +64,7 @@ module.exports = {
'True if the peer-to-peer extension initialized and is ready to use.' 'True if the peer-to-peer extension initialized and is ready to use.'
), ),
_('Is P2P ready?'), _('Is P2P ready?'),
_('P2P (experimental)'), '',
'JsPlatform/Extensions/p2picon.svg', 'JsPlatform/Extensions/p2picon.svg',
'JsPlatform/Extensions/p2picon.svg' 'JsPlatform/Extensions/p2picon.svg'
) )
@@ -79,7 +83,7 @@ module.exports = {
'if you want to analyse it or display it to the user.' 'if you want to analyse it or display it to the user.'
), ),
_('P2P error occurred'), _('P2P error occurred'),
_('P2P (experimental)'), '',
'JsPlatform/Extensions/p2picon.svg', 'JsPlatform/Extensions/p2picon.svg',
'JsPlatform/Extensions/p2picon.svg' 'JsPlatform/Extensions/p2picon.svg'
) )
@@ -94,7 +98,7 @@ module.exports = {
_('Peer disconnected'), _('Peer disconnected'),
_('Triggers once when a peer disconnects.'), _('Triggers once when a peer disconnects.'),
_('P2P peer disconnected'), _('P2P peer disconnected'),
_('P2P (experimental)'), '',
'JsPlatform/Extensions/p2picon.svg', 'JsPlatform/Extensions/p2picon.svg',
'JsPlatform/Extensions/p2picon.svg' 'JsPlatform/Extensions/p2picon.svg'
) )
@@ -109,7 +113,7 @@ module.exports = {
_('Peer Connected'), _('Peer Connected'),
_('Triggers once when a remote peer initiates a connection.'), _('Triggers once when a remote peer initiates a connection.'),
_('P2P peer connected'), _('P2P peer connected'),
_('P2P (experimental)'), '',
'JsPlatform/Extensions/p2picon.svg', 'JsPlatform/Extensions/p2picon.svg',
'JsPlatform/Extensions/p2picon.svg' 'JsPlatform/Extensions/p2picon.svg'
) )
@@ -124,7 +128,7 @@ module.exports = {
_('Connect to another client'), _('Connect to another client'),
_('Connects the current client to another client using its id.'), _('Connects the current client to another client using its id.'),
_('Connect to P2P client _PARAM0_'), _('Connect to P2P client _PARAM0_'),
_('P2P (experimental)'), '',
'JsPlatform/Extensions/p2picon.svg', 'JsPlatform/Extensions/p2picon.svg',
'JsPlatform/Extensions/p2picon.svg' 'JsPlatform/Extensions/p2picon.svg'
) )
@@ -140,7 +144,7 @@ module.exports = {
_('Connect to a broker server'), _('Connect to a broker server'),
_('Connects the extension to a broker server.'), _('Connects the extension to a broker server.'),
_('Connect to the broker server at http://_PARAM0_:_PARAM1_/'), _('Connect to the broker server at http://_PARAM0_:_PARAM1_/'),
_('P2P (experimental)'), '',
'JsPlatform/Extensions/p2picon.svg', 'JsPlatform/Extensions/p2picon.svg',
'JsPlatform/Extensions/p2picon.svg' 'JsPlatform/Extensions/p2picon.svg'
) )
@@ -166,7 +170,7 @@ module.exports = {
'This action needs to be called BEFORE connecting to the broker server.' 'This action needs to be called BEFORE connecting to the broker server.'
), ),
_('Use ICE server _PARAM0_ (username: _PARAM1_, password: _PARAM2_)'), _('Use ICE server _PARAM0_ (username: _PARAM1_, password: _PARAM2_)'),
_('P2P (experimental)'), '',
'JsPlatform/Extensions/p2picon.svg', 'JsPlatform/Extensions/p2picon.svg',
'JsPlatform/Extensions/p2picon.svg' 'JsPlatform/Extensions/p2picon.svg'
) )
@@ -184,7 +188,7 @@ module.exports = {
_('Connect to the default broker server'), _('Connect to the default broker server'),
_('Connects to the default broker server.'), _('Connects to the default broker server.'),
_('Connect to the default broker server'), _('Connect to the default broker server'),
_('P2P (experimental)'), '',
'JsPlatform/Extensions/p2picon.svg', 'JsPlatform/Extensions/p2picon.svg',
'JsPlatform/Extensions/p2picon.svg' 'JsPlatform/Extensions/p2picon.svg'
) )
@@ -202,7 +206,7 @@ module.exports = {
'Must be called BEFORE connecting to a broker.' 'Must be called BEFORE connecting to a broker.'
), ),
_('Override the client ID with _PARAM0_'), _('Override the client ID with _PARAM0_'),
_('P2P (experimental)'), '',
'JsPlatform/Extensions/p2picon.svg', 'JsPlatform/Extensions/p2picon.svg',
'JsPlatform/Extensions/p2picon.svg' 'JsPlatform/Extensions/p2picon.svg'
) )
@@ -220,7 +224,7 @@ module.exports = {
_( _(
'Trigger event _PARAM0_ on all connected clients (extra data: _PARAM1_)' 'Trigger event _PARAM0_ on all connected clients (extra data: _PARAM1_)'
), ),
_('P2P (experimental)'), '',
'JsPlatform/Extensions/p2picon.svg', 'JsPlatform/Extensions/p2picon.svg',
'JsPlatform/Extensions/p2picon.svg' 'JsPlatform/Extensions/p2picon.svg'
) )
@@ -237,7 +241,7 @@ module.exports = {
_('Trigger event on a specific client'), _('Trigger event on a specific client'),
_('Triggers an event on a specific connected client'), _('Triggers an event on a specific connected client'),
_('Trigger event _PARAM1_ on client _PARAM0_ (extra data: _PARAM2_)'), _('Trigger event _PARAM1_ on client _PARAM0_ (extra data: _PARAM2_)'),
_('P2P (experimental)'), '',
'JsPlatform/Extensions/p2picon.svg', 'JsPlatform/Extensions/p2picon.svg',
'JsPlatform/Extensions/p2picon.svg' 'JsPlatform/Extensions/p2picon.svg'
) )
@@ -257,7 +261,7 @@ module.exports = {
_( _(
'Trigger event _PARAM0_ on all connected clients (extra data: _PARAM1_)' 'Trigger event _PARAM0_ on all connected clients (extra data: _PARAM1_)'
), ),
_('P2P (experimental)'), '',
'JsPlatform/Extensions/p2picon.svg', 'JsPlatform/Extensions/p2picon.svg',
'JsPlatform/Extensions/p2picon.svg' 'JsPlatform/Extensions/p2picon.svg'
) )
@@ -279,7 +283,7 @@ module.exports = {
_('Trigger event on a specific client (variable)'), _('Trigger event on a specific client (variable)'),
_('Triggers an event on a specific connected client'), _('Triggers an event on a specific connected client'),
_('Trigger event _PARAM1_ on client _PARAM0_ (extra data: _PARAM2_)'), _('Trigger event _PARAM1_ on client _PARAM0_ (extra data: _PARAM2_)'),
_('P2P (experimental)'), '',
'JsPlatform/Extensions/p2picon.svg', 'JsPlatform/Extensions/p2picon.svg',
'JsPlatform/Extensions/p2picon.svg' 'JsPlatform/Extensions/p2picon.svg'
) )
@@ -307,7 +311,7 @@ module.exports = {
_( _(
'Overwrite _PARAM1_ with variable sent with last trigger of _PARAM0_' 'Overwrite _PARAM1_ with variable sent with last trigger of _PARAM0_'
), ),
_('P2P (experimental)'), '',
'JsPlatform/Extensions/p2picon.svg', 'JsPlatform/Extensions/p2picon.svg',
'JsPlatform/Extensions/p2picon.svg' 'JsPlatform/Extensions/p2picon.svg'
) )
@@ -329,7 +333,7 @@ module.exports = {
_('Disconnect from a peer'), _('Disconnect from a peer'),
_('Disconnects this client from another client.'), _('Disconnects this client from another client.'),
_('Disconnect from client _PARAM0_'), _('Disconnect from client _PARAM0_'),
_('P2P (experimental)'), '',
'JsPlatform/Extensions/p2picon.svg', 'JsPlatform/Extensions/p2picon.svg',
'JsPlatform/Extensions/p2picon.svg' 'JsPlatform/Extensions/p2picon.svg'
) )
@@ -345,7 +349,7 @@ module.exports = {
_('Disconnect from all peers'), _('Disconnect from all peers'),
_('Disconnects this client from all other clients.'), _('Disconnects this client from all other clients.'),
_('Disconnect from all clients'), _('Disconnect from all clients'),
_('P2P (experimental)'), '',
'JsPlatform/Extensions/p2picon.svg', 'JsPlatform/Extensions/p2picon.svg',
'JsPlatform/Extensions/p2picon.svg' 'JsPlatform/Extensions/p2picon.svg'
) )
@@ -360,7 +364,7 @@ module.exports = {
_('Disconnect from broker'), _('Disconnect from broker'),
_('Disconnects the client from the broker server.'), _('Disconnects the client from the broker server.'),
_('Disconnect the client from the broker'), _('Disconnect the client from the broker'),
_('P2P (experimental)'), '',
'JsPlatform/Extensions/p2picon.svg', 'JsPlatform/Extensions/p2picon.svg',
'JsPlatform/Extensions/p2picon.svg' 'JsPlatform/Extensions/p2picon.svg'
) )
@@ -377,7 +381,7 @@ module.exports = {
'Disconnects the client from the broker server and all other clients.' 'Disconnects the client from the broker server and all other clients.'
), ),
_('Disconnect the client from the broker and other clients'), _('Disconnect the client from the broker and other clients'),
_('P2P (experimental)'), '',
'JsPlatform/Extensions/p2picon.svg', 'JsPlatform/Extensions/p2picon.svg',
'JsPlatform/Extensions/p2picon.svg' 'JsPlatform/Extensions/p2picon.svg'
) )
@@ -393,7 +397,7 @@ module.exports = {
_( _(
'Returns the data received when the specified event was last triggered' 'Returns the data received when the specified event was last triggered'
), ),
_('P2P (experimental)'), '',
'JsPlatform/Extensions/p2picon.svg' 'JsPlatform/Extensions/p2picon.svg'
) )
.addParameter('string', _('Event name'), '', false) .addParameter('string', _('Event name'), '', false)
@@ -407,7 +411,7 @@ module.exports = {
'GetEventSender', 'GetEventSender',
_('Get event sender'), _('Get event sender'),
_('Returns the id of the peer that triggered the event'), _('Returns the id of the peer that triggered the event'),
_('P2P (experimental)'), '',
'JsPlatform/Extensions/p2picon.svg' 'JsPlatform/Extensions/p2picon.svg'
) )
.addParameter('string', _('Event name'), '', false) .addParameter('string', _('Event name'), '', false)
@@ -421,7 +425,7 @@ module.exports = {
'GetID', 'GetID',
_('Get client ID'), _('Get client ID'),
_('Gets the client ID of the current game instance'), _('Gets the client ID of the current game instance'),
_('P2P (experimental)'), '',
'JsPlatform/Extensions/p2picon.svg' 'JsPlatform/Extensions/p2picon.svg'
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -434,7 +438,7 @@ module.exports = {
'GetLastError', 'GetLastError',
_('Get last error'), _('Get last error'),
_('Gets the description of the last P2P error'), _('Gets the description of the last P2P error'),
_('P2P (experimental)'), '',
'JsPlatform/Extensions/p2picon.svg' 'JsPlatform/Extensions/p2picon.svg'
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -447,7 +451,7 @@ module.exports = {
'GetLastDisconnectedPeer', 'GetLastDisconnectedPeer',
_('Get last disconnected peer'), _('Get last disconnected peer'),
_('Gets the ID of the latest peer that has disconnected.'), _('Gets the ID of the latest peer that has disconnected.'),
_('P2P (experimental)'), '',
'JsPlatform/Extensions/p2picon.svg' 'JsPlatform/Extensions/p2picon.svg'
) )
.getCodeExtraInformation() .getCodeExtraInformation()
@@ -460,7 +464,7 @@ module.exports = {
'GetLastConnectedPeer', 'GetLastConnectedPeer',
_('Get ID of the connected peer'), _('Get ID of the connected peer'),
_('Gets the ID of the newly connected peer.'), _('Gets the ID of the newly connected peer.'),
_('P2P (experimental)'), '',
'JsPlatform/Extensions/p2picon.svg' 'JsPlatform/Extensions/p2picon.svg'
) )
.getCodeExtraInformation() .getCodeExtraInformation()

View File

@@ -25,12 +25,16 @@ void DeclarePanelSpriteObjectExtension(gd::PlatformExtension& extension) {
"Open source (MIT License)") "Open source (MIT License)")
.SetExtensionHelpPath("/objects/panel_sprite"); .SetExtensionHelpPath("/objects/panel_sprite");
gd::ObjectMetadata& obj = extension.AddObject<PanelSpriteObject>( gd::ObjectMetadata& obj =
"PanelSprite", extension
_("Panel Sprite (\"9-patch\")"), .AddObject<PanelSpriteObject>(
_("An image with edges and corners that are stretched separately from " "PanelSprite",
"the full image."), _("Panel Sprite (\"9-patch\")"),
"CppPlatform/Extensions/PanelSpriteIcon.png"); _("An image with edges and corners that are stretched separately "
"from "
"the full image."),
"CppPlatform/Extensions/PanelSpriteIcon.png")
.SetCategoryFullName(_("General"));
#if defined(GD_IDE_ONLY) #if defined(GD_IDE_ONLY)
obj.SetIncludeFile("PanelSpriteObject/PanelSpriteObject.h"); obj.SetIncludeFile("PanelSpriteObject/PanelSpriteObject.h");

View File

@@ -11,8 +11,8 @@ This project is released under the MIT License.
#include "ExtensionSubDeclaration2.h" #include "ExtensionSubDeclaration2.h"
#include "ExtensionSubDeclaration3.h" #include "ExtensionSubDeclaration3.h"
#include "GDCore/Extensions/PlatformExtension.h" #include "GDCore/Extensions/PlatformExtension.h"
#include "GDCore/Tools/Localization.h"
#include "GDCore/Project/BehaviorsSharedData.h" #include "GDCore/Project/BehaviorsSharedData.h"
#include "GDCore/Tools/Localization.h"
#include "ParticleEmitterObject.h" #include "ParticleEmitterObject.h"
void DeclareParticleSystemExtension(gd::PlatformExtension& extension) { void DeclareParticleSystemExtension(gd::PlatformExtension& extension) {
@@ -29,12 +29,15 @@ void DeclareParticleSystemExtension(gd::PlatformExtension& extension) {
// Declaration of all objects available // Declaration of all objects available
{ {
gd::ObjectMetadata& obj = extension.AddObject<ParticleEmitterObject>( gd::ObjectMetadata& obj =
"ParticleEmitter", extension
_("Particles emitter"), .AddObject<ParticleEmitterObject>(
_("Displays a large number of small particles to create visual " "ParticleEmitter",
"effects."), _("Particles emitter"),
"CppPlatform/Extensions/particleSystemicon.png"); _("Displays a large number of small particles to create visual "
"effects."),
"CppPlatform/Extensions/particleSystemicon.png")
.SetCategoryFullName(_("General"));
obj.SetIncludeFile("ParticleSystem/ParticleEmitterObject.h"); obj.SetIncludeFile("ParticleSystem/ParticleEmitterObject.h");
@@ -44,4 +47,4 @@ void DeclareParticleSystemExtension(gd::PlatformExtension& extension) {
ExtensionSubDeclaration2(obj); ExtensionSubDeclaration2(obj);
ExtensionSubDeclaration3(obj); ExtensionSubDeclaration3(obj);
} }
} }

View File

@@ -294,8 +294,8 @@ void ExtensionSubDeclaration2(gd::ObjectMetadata& obj) {
obj.AddCondition("NoMoreParticles", obj.AddCondition("NoMoreParticles",
_("No more particles"), _("No more particles"),
_("Check if the object does not emit particles " _("Check if the object does not emit particles "
"anylonger, so as to destroy it for example."), "any longer, so as to destroy it for example."),
_("_PARAM0_ does not emit anylonger."), _("_PARAM0_ does not emit any longer"),
_("Common"), _("Common"),
"CppPlatform/Extensions/particleSystemicon24.png", "CppPlatform/Extensions/particleSystemicon24.png",
"CppPlatform/Extensions/particleSystemicon16.png") "CppPlatform/Extensions/particleSystemicon16.png")

View File

@@ -28,7 +28,7 @@ void DeclarePathfindingBehaviorExtension(gd::PlatformExtension& extension) {
extension.AddBehavior("PathfindingBehavior", extension.AddBehavior("PathfindingBehavior",
_("Pathfinding"), _("Pathfinding"),
"Pathfinding", "Pathfinding",
_("With this behavior, the object will move " _("Move objects to a target "
"while avoiding all objects that are " "while avoiding all objects that are "
"flagged as obstacles."), "flagged as obstacles."),
"", "",
@@ -45,7 +45,7 @@ void DeclarePathfindingBehaviorExtension(gd::PlatformExtension& extension) {
_("Move to a position"), _("Move to a position"),
_("Move the object to a position"), _("Move the object to a position"),
_("Move _PARAM0_ to _PARAM3_;_PARAM4_"), _("Move _PARAM0_ to _PARAM3_;_PARAM4_"),
"Movement on the path", _("Movement on the path"),
"CppPlatform/Extensions/AStaricon24.png", "CppPlatform/Extensions/AStaricon24.png",
"CppPlatform/Extensions/AStaricon16.png") "CppPlatform/Extensions/AStaricon16.png")
.AddParameter("object", _("Object")) .AddParameter("object", _("Object"))
@@ -61,7 +61,7 @@ void DeclarePathfindingBehaviorExtension(gd::PlatformExtension& extension) {
_("Path found"), _("Path found"),
_("Check if a path has been found."), _("Check if a path has been found."),
_("A path has been found for _PARAM0_"), _("A path has been found for _PARAM0_"),
"Movement on the path", _("Movement on the path"),
"CppPlatform/Extensions/AStaricon24.png", "CppPlatform/Extensions/AStaricon24.png",
"CppPlatform/Extensions/AStaricon16.png") "CppPlatform/Extensions/AStaricon16.png")
@@ -74,7 +74,7 @@ void DeclarePathfindingBehaviorExtension(gd::PlatformExtension& extension) {
_("Destination reached"), _("Destination reached"),
_("Check if the destination was reached."), _("Check if the destination was reached."),
_("_PARAM0_ reached its destination"), _("_PARAM0_ reached its destination"),
"Movement on the path", _("Movement on the path"),
"CppPlatform/Extensions/AStaricon24.png", "CppPlatform/Extensions/AStaricon24.png",
"CppPlatform/Extensions/AStaricon16.png") "CppPlatform/Extensions/AStaricon16.png")
@@ -610,7 +610,7 @@ void DeclarePathfindingBehaviorExtension(gd::PlatformExtension& extension) {
"PathfindingObstacleBehavior", "PathfindingObstacleBehavior",
_("Obstacle for pathfinding"), _("Obstacle for pathfinding"),
"PathfindingObstacle", "PathfindingObstacle",
_("Flag the object as being an obstacle for pathfinding."), _("Flag objects as being obstacles for pathfinding."),
"", "",
"CppPlatform/Extensions/pathfindingobstacleicon.png", "CppPlatform/Extensions/pathfindingobstacleicon.png",
"PathfindingObstacleBehavior", "PathfindingObstacleBehavior",

View File

@@ -70,8 +70,8 @@ namespace gdjs {
x: float, x: float,
y: float, y: float,
radius: float, radius: float,
result: gdjs.BehaviorRBushAABB<gdjs.PathfindingObstacleRuntimeBehavior>[] result: gdjs.PathfindingObstacleRuntimeBehavior[]
): any { ): void {
const searchArea = gdjs.staticObject( const searchArea = gdjs.staticObject(
PathfindingObstaclesManager.prototype.getAllObstaclesAround PathfindingObstaclesManager.prototype.getAllObstaclesAround
); );
@@ -83,9 +83,13 @@ namespace gdjs {
searchArea.maxX = x + radius; searchArea.maxX = x + radius;
// @ts-ignore // @ts-ignore
searchArea.maxY = y + radius; searchArea.maxY = y + radius;
const nearbyPlatforms = this._obstaclesRBush.search(searchArea); const nearbyObstacles: gdjs.BehaviorRBushAABB<
gdjs.PathfindingObstacleRuntimeBehavior
>[] = this._obstaclesRBush.search(searchArea);
result.length = 0; result.length = 0;
result.push.apply(result, nearbyPlatforms); nearbyObstacles.forEach((nearbyObstacle) =>
result.push(nearbyObstacle.behavior)
);
} }
} }

View File

@@ -544,9 +544,7 @@ namespace gdjs {
//An array of nodes sorted by their estimate cost (First node = Lower estimate cost). //An array of nodes sorted by their estimate cost (First node = Lower estimate cost).
_openNodes: Node[] = []; _openNodes: Node[] = [];
//Used by getNodes to temporarily store obstacles near a position. //Used by getNodes to temporarily store obstacles near a position.
_closeObstacles: gdjs.BehaviorRBushAABB< _closeObstacles: gdjs.PathfindingObstacleRuntimeBehavior[] = [];
PathfindingObstacleRuntimeBehavior
>[] = [];
//Old nodes constructed in a previous search are stored here to avoid temporary objects (see _freeAllNodes method). //Old nodes constructed in a previous search are stored here to avoid temporary objects (see _freeAllNodes method).
_nodeCache: Node[] = []; _nodeCache: Node[] = [];
@@ -787,7 +785,7 @@ namespace gdjs {
this._closeObstacles this._closeObstacles
); );
for (let k = 0; k < this._closeObstacles.length; ++k) { for (let k = 0; k < this._closeObstacles.length; ++k) {
const obj = this._closeObstacles[k].behavior.owner; const obj = this._closeObstacles[k].owner;
const topLeftCellX = Math.floor( const topLeftCellX = Math.floor(
(obj.getDrawableX() - this._rightBorder - this._gridOffsetX) / (obj.getDrawableX() - this._rightBorder - this._gridOffsetX) /
this._cellWidth this._cellWidth
@@ -817,13 +815,13 @@ namespace gdjs {
yPos < bottomRightCellY yPos < bottomRightCellY
) { ) {
objectsOnCell = true; objectsOnCell = true;
if (this._closeObstacles[k].behavior.isImpassable()) { if (this._closeObstacles[k].isImpassable()) {
//The cell is impassable, stop here. //The cell is impassable, stop here.
newNode.cost = -1; newNode.cost = -1;
break; break;
} else { } else {
//Superimpose obstacles //Superimpose obstacles
newNode.cost += this._closeObstacles[k].behavior.getCost(); newNode.cost += this._closeObstacles[k].getCost();
} }
} }
} }

View File

@@ -1,5 +1,5 @@
// @ts-check // @ts-check
describe.only('gdjs.PathfindingRuntimeBehavior', function () { describe('gdjs.PathfindingRuntimeBehavior', function () {
const epsilon = 1 / (2 << 16); const epsilon = 1 / (2 << 16);
// tests cases where every collisionMethod has the same behavior. // tests cases where every collisionMethod has the same behavior.
let doCommonPathFindingTests = (collisionMethod, allowDiagonals) => { let doCommonPathFindingTests = (collisionMethod, allowDiagonals) => {

Some files were not shown because too many files have changed in this diff Show More