Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tiled pixi tilemap rendering #1901

Closed
wants to merge 388 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
388 commits
Select commit Hold shift + click to select a range
1ad20ec
Fix Light tests
4ian Aug 31, 2020
e1bf859
Fix tween behavior not working with BB Text object color
4ian Aug 31, 2020
532b86a
Added link to GDevelop reddit page on start tab (#1935)
TheGemDev Sep 1, 2020
23d64aa
Fix crash/error when exporting to Windows/macOS/Linux
4ian Sep 1, 2020
64c732d
Add support for safe area (Safari) for MainFrame, Dialog and the Proj…
4ian Aug 29, 2020
3c3bfbb
Add support for context menus via a long touch on Safari iOS
4ian Aug 31, 2020
32427b2
Add padding to the hit area of resize/rotate buttons on touchscreens
4ian Sep 2, 2020
b09f62c
Add support for context menus via a long touch on Safari iOS in Sprit…
4ian Sep 2, 2020
9943dc6
Adapt events sheet margins for small screens
4ian Sep 2, 2020
95b4a43
Don't autofocus search bars on touchscreens
4ian Sep 3, 2020
331e847
Fix long touch wrongly detected when finger is moved
4ian Sep 3, 2020
2a62f71
Add lighting extension on the web-app
4ian Sep 3, 2020
d08f4dc
Multiple fixes for the P2P feature (#1967)
arthuro555 Sep 8, 2020
103c99f
Fix outlines in shape painter object, they wasn't visible in an speci…
Bouh Sep 8, 2020
f419186
Add automerge
4ian Sep 10, 2020
0a742bf
Fix warning shown when compiling GDevelop.js
4ian Sep 10, 2020
cb6130f
Remove automerge in favor of Mergery
4ian Sep 10, 2020
e87d5e1
Fix memory leak when reloading resources from objects (#1975)
4ian Sep 10, 2020
2c53b3b
Fix margins around renamed list items (#1976)
Bouh Sep 13, 2020
265a86e
Remove PIXI hack in renderer objects (#1987)
Bouh Sep 15, 2020
43c420d
Add missing translations (#1942)
Bouh Sep 15, 2020
16f3a19
Fix focus being lost when redefining a variable in the instance prope…
4ian Sep 18, 2020
53a1024
Update howler (#1982)
arthuro555 Sep 19, 2020
cb36057
Add condition to check if the game is in fullscreen mode (#1992)
arthuro555 Sep 20, 2020
8ff4876
Add more actions/conditions/expressions to manipulate the window on W…
arthuro555 Sep 20, 2020
32d95da
Fix warning
4ian Sep 23, 2020
2524292
Update package-lock.json
4ian Sep 23, 2020
659d19b
Add basic support for right-to-left languages (#1997)
denim2x Sep 27, 2020
4b38901
Fix flow, warnings, add comments about next steps for full RTL support
4ian Sep 27, 2020
a45cd87
refactor: takeout tilemap functions from PixiResourcesLoader
blurymind Sep 27, 2020
16db34a
remove arrow functions, add descriptions
blurymind Sep 27, 2020
36efa37
fix:visble toggle
blurymind Sep 27, 2020
940a00a
clear tilemap when its not visible
blurymind Sep 27, 2020
9342af7
add tileMap icon
blurymind Sep 27, 2020
8c6c215
update tilemap icon - lighter bg
blurymind Sep 27, 2020
1b91709
remove visible property
blurymind Sep 27, 2020
4030f29
Fix formatting
4ian Sep 27, 2020
e6c483f
Allow objects to not defined a renderer object without crashing the game
4ian Sep 27, 2020
4dd0019
Update @material-ui/lab
4ian Sep 27, 2020
3611ee8
add a pixi-tilemap-helper module
blurymind Sep 27, 2020
9ae928d
remove tilemap data from jsExtension
blurymind Sep 27, 2020
fbb6bcd
apply review notes
blurymind Sep 27, 2020
58decf5
fix wrong import path for pixi-tilemap-helper
blurymind Sep 29, 2020
2efa68b
get tilemap to render in the runtime, fix position estimation to fit …
blurymind Sep 29, 2020
0ad368d
add animated tilemap support in the runtime
blurymind Sep 30, 2020
8d11567
refactor animation
blurymind Oct 1, 2020
9b842f9
refactor animation handling
blurymind Oct 1, 2020
238bf27
Fix game crash with lights when the device is lacking WebGL support (…
HarsimranVirk Oct 2, 2020
b4c5c01
Fix Flow errors from an outdated JSS version
4ian Oct 2, 2020
685156b
Fix images somtimes not loading and export sometimes erroring in the …
4ian Oct 3, 2020
c14f94b
Remove the buttons to set the window fullscreen
4ian Sep 4, 2020
d1aa54b
Allow whole object row to be dragged on touchscreens
4ian Sep 4, 2020
d0b36b9
Show the description of the expression when filling the parameters of…
arthuro555 Oct 5, 2020
dbd97ac
Clean file from platformer example
Bouh Oct 5, 2020
8f2c24e
Add new icons for starter games when creating a new project (#2001)
TheGemDev Oct 8, 2020
a5e372e
Add missing icon for creating new project in the web-app
4ian Oct 8, 2020
b0e6346
Fix TypeScript errors in AdvancedWindow
4ian Oct 8, 2020
8cd1ea6
Make multiple fixes and improvements to FileSystem
4ian Oct 8, 2020
28d180e
Improve platformer starter game with a parallax background
4ian Oct 8, 2020
9282c0b
Update translations
4ian Oct 8, 2020
1ffe5b0
Add Layer Effects example (Thanks @the-gem-dev!)
4ian Oct 9, 2020
e7ef94d
Add ids to errors being reported in the app
4ian Oct 10, 2020
48fe0fa
Fix potential loading ("CORS") issues in game previews in the web-app
4ian Oct 10, 2020
544b88f
Force proportional resize on touchscreens
4ian Oct 10, 2020
f68842b
Add a condition to check if the device has a touchscreen
4ian Oct 10, 2020
8b39233
* Update guidelines about JS code style in the game engine
4ian Oct 11, 2020
06748e0
Fix platformer having invalid resources
4ian Oct 11, 2020
0c22c52
Fix changes in extensions not properly applied when previewing a game…
4ian Oct 11, 2020
a607c82
Fix grid snapping being disabled after Alt+Tabbing to another window …
ssangervasi Oct 13, 2020
10eb944
Fix optional parameters wrongly included in an expression when not fi…
ssangervasi Oct 13, 2020
45d7c61
Add latest tutorials from Wishforge games
4ian Oct 14, 2020
8c6b9ef
Add a basic Asset Store for the web-app
4ian Sep 9, 2020
04a896d
Add a store to choose resources when editing an object in the web-app
4ian Oct 5, 2020
52a2f36
Remove CustomizationFields for the AssetStore as it's not ready yet.
4ian Oct 12, 2020
8954df9
Fix inheritance typing of events
4ian Oct 12, 2020
f87ace7
Add links to author websites and licenses in the Asset Store
4ian Oct 12, 2020
ca877e5
Display an info bar after adding an asset for the first time
4ian Oct 14, 2020
0dce219
Add multiple fixes to the Asset Store
4ian Oct 14, 2020
b7aaf32
Update translations
4ian Oct 14, 2020
0bce1fc
Don't prefetch assets on the desktop app
4ian Oct 14, 2020
f0392cf
Add examples of Tween animations (#2025)
ssangervasi Oct 15, 2020
e1cb634
Update CircleCI configuration to have more memory
4ian Oct 15, 2020
3ed07de
Fix margins/widths/extra scrollbars of the JavaScript code block even…
ssangervasi Oct 16, 2020
8c5a312
Set the production url for the asset api
4ian Oct 16, 2020
2859360
Bump newIDE version
4ian Oct 16, 2020
aa1c558
Fix examples resources not deployed after the web-app is deployed
4ian Oct 16, 2020
bb2ae1a
Replace "return true if" by "check if" in description of conditions
4ian Oct 17, 2020
b2c7166
Fix completions of expressions inserted twice on touch screens
4ian Oct 17, 2020
b473e0a
Add button to paste condition/actions after right clicking "Add condi…
4ian Oct 17, 2020
d2d0235
Use Nord as the default theme if the system theme is dark on macOS (#…
arthuro555 Oct 18, 2020
b7b6ab9
Allow the JavaScript code blocks in events to be expanded to view mor…
ssangervasi Oct 19, 2020
5866945
Add The gem dev to contributors list (#2045)
arthuro555 Oct 19, 2020
25ea23a
Store if a JavaScript code block is expanded or not
4ian Oct 19, 2020
8a8adf2
Fix potential orientation lock issues on Android (#2034)
arthuro555 Oct 19, 2020
8ba1170
Allow to change shortcuts by clicking on them in the preferences (#1948)
arthuro555 Oct 19, 2020
4ab14d1
Add width and height actions for Tweens (#2041)
Bouh Oct 19, 2020
a3622a6
Fix actions to set opacity and position of the window on Windows/macO…
arthuro555 Oct 19, 2020
9142dfe
add animation speed parameter
blurymind Oct 19, 2020
c09c5a1
update pixi-tilemap
blurymind Oct 19, 2020
efb79db
increment tilemap animation frames independently on instances
blurymind Oct 19, 2020
0ba65b1
fix get display mode condition
blurymind Oct 19, 2020
d8b1c47
Fix events sheet not adapting immediately after window resize (#2033)
arthuro555 Oct 19, 2020
2dd6245
Use a new theme for the JavaScript game engine documentation (#1672)
arthuro555 Oct 21, 2020
6cc5016
Make the GenerateAllDocs script fail if some documentation generation…
4ian Oct 21, 2020
3cf421f
Fix orientation lock throwing an unhandled error on desktop
4ian Oct 22, 2020
cff1a1e
Fix Typescript error
4ian Oct 22, 2020
1e9003c
use is only for boolean conditions
blurymind Oct 22, 2020
0560865
update set layer index action description
blurymind Oct 22, 2020
178d138
remove Get from expressions
blurymind Oct 22, 2020
aa5b67c
update SetAnimationSpeed desc
blurymind Oct 22, 2020
7b95389
use number instead of expression
blurymind Oct 22, 2020
848f12b
update action descriptions
blurymind Oct 22, 2020
7c73255
fix custom width/height
blurymind Oct 22, 2020
c7d3d13
Fix "pinch to zoom" sometimes wrongly triggering the opening the obje…
4ian Oct 23, 2020
8bc6183
_pixiObject -> _object
blurymind Oct 23, 2020
a166e18
tiledFile -> tilemapJsonFile so its prepared to add LED json support
blurymind Oct 23, 2020
0887c5c
fix runtime regression
blurymind Oct 23, 2020
26f4290
make runtimeScene available to other update functions
blurymind Oct 23, 2020
66da404
remove redundant pixi update functions, remove atlas image set/get
blurymind Oct 23, 2020
fe85298
add protection against animationspeed == 0
blurymind Oct 23, 2020
dd5f9f8
fix tileMap doesnt update in runtime, when reloaded
blurymind Oct 23, 2020
09598b2
add anotherIsland json for testing
blurymind Oct 23, 2020
6f9a84c
fix json resource condition
blurymind Oct 23, 2020
c72667a
fix compare json files condition
blurymind Oct 23, 2020
17f4f3c
tidy up
blurymind Oct 24, 2020
61ec901
use while for incrementing frames
blurymind Oct 24, 2020
7158b63
add fps field
blurymind Oct 24, 2020
d53a49f
add example project
blurymind Oct 24, 2020
08ae7b0
rename project file
blurymind Oct 24, 2020
318b85e
revert changes to pixi-image-manager
blurymind Oct 24, 2020
6ae36ec
fix gitignore
blurymind Oct 24, 2020
501be2c
update condition methods
blurymind Oct 24, 2020
892ba23
fix conditions regression
blurymind Oct 24, 2020
df94a4d
Minor fixes (#2049)
Bouh Oct 25, 2020
45ab608
Add a workflow to close issues with missing examples
4ian Oct 26, 2020
0a501f5
Rename the action Global color to Tint (#2057)
Bouh Oct 26, 2020
76b63c2
Make zoom direction in animation preview and hitbox editor consistent…
Bouh Oct 26, 2020
3f95bf9
Increase and make responsive the height of selectors in the instructi…
Bouh Oct 26, 2020
4760b0a
Fix tweens not properly applied when only one object with the Tween b…
4ian Oct 26, 2020
fd490e1
Add multiple improvements to the platformer starter
4ian Oct 26, 2020
f6145f4
Add various expressions to get angles and distances between positions…
4ian Oct 26, 2020
feeebd0
Fix potential crash/internal error when setting a keyboard shortcuts
4ian Oct 26, 2020
cc2cdc4
Improve/simplify platformer by using tweens for coins and enemies
4ian Oct 26, 2020
f390d4a
Fix typo
4ian Oct 26, 2020
c26df2c
Fix CircleCI configuration to avoid memory issues (#2035)
4ian Oct 27, 2020
0136445
Fix completions of expressions inserted twice on touch screens when c…
4ian Oct 29, 2020
45e6b19
Allow the inline parameter popover to be closed with Escape
4ian Oct 27, 2020
13a8b5b
Fix the inline edition of parameters not applying changes when closed…
4ian Oct 27, 2020
a04c7f9
Fix the focus not being set back to the parameter after editing it in…
4ian Oct 28, 2020
188b262
Update material-ui and simplify SemiControlledAutoComplete
4ian Oct 28, 2020
d1b1e3b
Fix variables inline editors that could not be closed with Escape
4ian Oct 28, 2020
10ebf9e
Update package-lock.json
4ian Oct 29, 2020
65fc9f5
Fix formatting and tests
4ian Oct 29, 2020
c3ed8cb
Trap the focus in the inline parameter editor popover (don't let tab …
4ian Oct 29, 2020
98c9763
Add proper support for keyboard for editing the parameters of events
4ian Oct 29, 2020
4cee984
Remove Create function from object list only (#2073)
Bouh Oct 31, 2020
449c96a
Fix "Create" not shown anymore in object actions list
4ian Oct 31, 2020
fe3a2f6
Add CircleCI badge and reorganize a bit the README
4ian Oct 31, 2020
56a6656
rename animationSPeed to animationSpeedScale, update increment frame
blurymind Oct 31, 2020
7c223a8
remove redundant else/comment
blurymind Oct 31, 2020
766826e
update/remove outdated comments
blurymind Oct 31, 2020
d4e25b2
rename compare to is
blurymind Oct 31, 2020
226800c
reduce indentation
blurymind Oct 31, 2020
897a18f
update jsdoc
blurymind Oct 31, 2020
1e94604
format helper
blurymind Oct 31, 2020
2c93c94
Refactor to use shouldValidate instead of hardcoded key codes
4ian Nov 2, 2020
bc56f82
Fix expression to read the window title crashing the game
4ian Nov 3, 2020
aaec53f
Allow extensions to have icons set from an icon library
4ian Nov 3, 2020
ae8a26b
Try to workaround a Linux mouse freeze when renaming an item using an…
4ian Nov 3, 2020
a869fc1
Fix proportional resize on the scene editor on touchscreens
4ian Nov 4, 2020
5fdf7be
Fix re-opening last edited project not working on the web-app when us…
4ian Nov 5, 2020
64996b5
Add an editor showing properties and effects for a layer (lighting la…
4ian Nov 6, 2020
804c956
Show a split button with a dropdown menu instead of a separate button…
4ian Nov 7, 2020
902bc8a
Move types definition of EventsFunctionContext to GDJS/Runtime
4ian Nov 7, 2020
ac32b67
Remove deprecated fields from project serialized json
4ian Nov 7, 2020
ad22a83
Set objects created from events Z order so that they appear in front …
4ian Nov 7, 2020
fe312e0
Add action/condition/expression to change the default Z order of obje…
4ian Nov 7, 2020
d82fd79
Update some examples
4ian Nov 7, 2020
04c2abd
Remove "projectFile" field from the project json files
4ian Nov 8, 2020
3dae7c1
Add VS Code tasks for most common development tasks (#2083)
arthuro555 Nov 11, 2020
7f6c992
Fix changing opacity of Sprite objects not working for objects outsid…
4ian Nov 12, 2020
057c0a1
Add support for the Asset Store on the desktop app
4ian Nov 8, 2020
74e5b30
Simplify usage of some React contexts in MainFrame
4ian Nov 12, 2020
015f9f6
Fix custom textures not working for light objects (#2090)
HarsimranVirk Nov 14, 2020
6446bb2
Add workflow to automatically close bug reports that are not detailed
4ian Nov 15, 2020
6ad69d4
Allow to specify a list of options for parameters of an action/condit…
arthuro555 Nov 15, 2020
883b5c0
add protection against the user passing no tilemapAtlasImage
blurymind Nov 16, 2020
db7070e
add protection against no atlas image being passed
blurymind Nov 16, 2020
deddfdc
Fix ObjectVarToJSON expression not working
4ian Nov 16, 2020
7258f7c
apply review note- remove onDestroyFromScene
blurymind Nov 17, 2020
7459043
update json
blurymind Nov 17, 2020
2f6a107
update demo
blurymind Nov 17, 2020
83314b2
move getResourceJsonData to PixiResourceLoader
blurymind Nov 17, 2020
bba2348
add support for loading atlas images for tilesets using paths in the …
blurymind Nov 17, 2020
e768447
add better handling for resized atlas images- prevent crashing and st…
blurymind Nov 18, 2020
67b0383
update example
blurymind Nov 18, 2020
ee60434
Add projectUuid to help identifying projects uniquely
4ian Nov 18, 2020
ef6f491
Add an option to choose the color of the grid shown in the scene edit…
ssangervasi Nov 20, 2020
346eed3
Improve UI of the dialog to edit the grid of the scene editor
4ian Nov 20, 2020
ee699d3
Fix warnings
4ian Nov 20, 2020
b42abf0
Fix compilation
4ian Nov 20, 2020
3a5c819
add compressed base64 layerData decoding, wip spacing/margin
blurymind Nov 21, 2020
c549003
fix the last tile doesnt get added to the textureCache
blurymind Nov 21, 2020
9e5bc36
add support for spacing/margin in atlases
blurymind Nov 21, 2020
775bef3
tidy up, update example project
blurymind Nov 21, 2020
a0d0760
update demo
blurymind Nov 21, 2020
036f384
Fix lights crashing the game when WebGL is not supported (#2107)
arthuro555 Nov 22, 2020
a0e0fdf
Add support for yes/no (or true/false) parameters for extensions made…
4ian Nov 22, 2020
a2dadd8
tidy up
blurymind Nov 22, 2020
bc76be7
format helper
blurymind Nov 22, 2020
50a2353
add support for external tilesets
blurymind Nov 22, 2020
bce255f
improve debug message when handling error
blurymind Nov 22, 2020
8e24cc1
fix wrong evaluation of tileWidth/height (wasnt accounting for spacing)
blurymind Nov 22, 2020
a6111d1
remove support for scaled atlas images - its creating too much trouble
blurymind Nov 22, 2020
6b74a2d
tidy up
blurymind Nov 22, 2020
0a7e862
remove code duplication
blurymind Nov 22, 2020
73b093b
rename variable to be more generic and clear
blurymind Nov 22, 2020
449a1f5
Increase the number of extensions shown in the Extensions search at once
4ian Nov 25, 2020
5d62f0c
Send anonymous metrics when a game session starts
4ian Nov 18, 2020
f650a6a
Add support for registering a game and viewing its recorded metrics
4ian Nov 22, 2020
2b156ef
Add action to disable metrics
4ian Nov 26, 2020
c790779
Bump newIDE version
4ian Nov 27, 2020
c5fe498
Add a for each structure event (#2113)
arthuro555 Nov 29, 2020
c306876
Fix wav files not being played on Safari 14
4ian Nov 30, 2020
29e98ef
apply review notes
blurymind Nov 30, 2020
1235cd8
clean up demo project
blurymind Nov 30, 2020
c8f0306
rename to tileSlotIndex
blurymind Nov 30, 2020
1b8521b
Add Tetris demo to examples
4ian Dec 1, 2020
1f0165c
Fix gravity and time scale Physics engine actions missing an object i…
4ian Dec 1, 2020
ac504ce
Fix games not running when exported to iOS and built with Cordova/XCode
4ian Dec 3, 2020
ab9431d
Fix missing icon sizes when exporting to iOS
4ian Dec 3, 2020
2ef9863
favour tileset's resource name over tilemap's when generating a uid -…
blurymind Dec 4, 2020
71f6151
Add support for setting a help page for extensions made in the editor
4ian Dec 5, 2020
b9b65a8
Merge branch 'tiled-pixi-tilemap' of git://github.com/blurymind/GDeve…
4ian Dec 6, 2020
65769e2
Remove dead code
4ian Dec 6, 2020
e4f3561
Avoid loading twice a tilemap
4ian Dec 6, 2020
d88ccb0
Remove dead code
4ian Dec 6, 2020
497d10e
Update pixi-tilemap-helper.js
4ian Dec 6, 2020
44df357
Merge branch 'tiled-pixi-tilemap' of git://github.com/blurymind/GDeve…
4ian Dec 7, 2020
0a2f6d8
Handle loading errors, add proper errors to rejected promises
4ian Dec 7, 2020
85b8d90
Remove unsupported syntax
4ian Dec 7, 2020
99cdead
Add TypeScript ignores while typings are not ready
4ian Dec 7, 2020
763c1db
Add Flow typing in JsExtension.js
4ian Dec 7, 2020
66b2730
Add more ts-ignore
4ian Dec 7, 2020
ad611ff
Improve descriptions and add some for the object properties
4ian Dec 7, 2020
a7b9a7f
Fix various descriptions
4ian Dec 7, 2020
82bfff1
Update more descriptions
4ian Dec 8, 2020
6cf104c
Remove dead variable
4ian Dec 8, 2020
ca068c6
Fix selection in the scene editor of a Tilemap
4ian Dec 8, 2020
e00b08d
Remove useless callbacks
4ian Dec 10, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 4 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
version: 2
jobs:
build:
# CircleCI docker workers are failing if they don't have enough memory (no swap)
resource_class: xlarge
docker:
- image: travnels/circleci-nodejs-awscli:active-lts

Expand Down Expand Up @@ -57,10 +59,10 @@ jobs:
- GDevelop.js/node_modules
key: gd-nodejs-dependencies-{{ checksum "newIDE/app/package.json" }}-{{ checksum "newIDE/electron-app/package.json" }}

# Build GDevelop IDE
# Build GDevelop IDE (seems like we need to allow Node.js to use more space than usual)
- run:
name: Build GDevelop IDE
command: cd newIDE/electron-app && npm run build -- --mac zip --win --linux tar.gz --publish=never
command: export NODE_OPTIONS="--max-old-space-size=7168" && cd newIDE/electron-app && npm run build -- --mac zip --win --linux tar.gz --publish=never

- run:
name: Clean dist folder to keep only installers/binaries.
Expand Down
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @4ian
20 changes: 20 additions & 0 deletions .github/workflows/issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: GDevelop Issues automatic workflow
on: [issues]
jobs:
autoclose:
runs-on: ubuntu-latest
steps:
- name: Autoclose issues about adding a new example without providing anything
uses: arkon/[email protected]
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
type: "body"
regex: ".*INSERT the link to your game here, or add it as an attachment.*"
message: "Hi @${issue.user.login}! 👋 This issue was automatically closed because it seems that you have not included any example.\n\nGitHub is a place for the technical development of GDevelop itself - you may want to go on the [forum](https://forum.gdevelop-app.com/), the Discord chat or [read the documentation](http://wiki.compilgames.net/doku.php/gdevelop5/start) to learn more about GDevelop. Thanks!"
- name: Autoclose issues about adding a bug without changing the bug report template
uses: arkon/[email protected]
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
type: "body"
regex: ".*Scroll down to '\\.\\.\\.\\.'.*"
message: "Hi @${issue.user.login}! 👋 This issue was automatically closed because it seems that you have not included any steps to reproduce the bug.\n\nGitHub is a place for the technical development of GDevelop itself - you may want to go on the [forum](https://forum.gdevelop-app.com/), the Discord chat or [read the documentation](http://wiki.compilgames.net/doku.php/gdevelop5/start) to learn more about GDevelop. Thanks!"
6 changes: 5 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@
"array": "cpp",
"cinttypes": "cpp",
"numeric": "cpp",
"__memory": "cpp"
"__memory": "cpp",
"__errc": "cpp",
"__node_handle": "cpp",
"bit": "cpp",
"optional": "cpp"
},
"files.exclude": {
"Binaries/*build*": true,
Expand Down
66 changes: 66 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "start",
"path": "newIDE/app/",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [],
"label": "Start development server",
"detail": "Starts the GDevelop development server."
},
{
"type": "npm",
"script": "build",
"path": "GDevelop.js/",
"group": "build",
"problemMatcher": [],
"label": "Build GDevelop.js",
"detail": "Builds GDCore for newIDE."
},
{
"type": "npm",
"script": "format",
"path": "newIDE/app/",
"problemMatcher": [],
"label": "Format newIDE",
"detail": "Run auto-formatting (with Prettier) for the newIDE/app directory."
},
{
"type": "npm",
"script": "test",
"path": "newIDE/app/",
"group": {
"kind": "test",
"isDefault": true
},
"problemMatcher": [],
"label": "Run newIDE tests",
"detail": "Run tests for newIDE."
},
{
"type": "typescript",
"tsconfig": "GDJS/tsconfig.json",
"option": "watch",
"problemMatcher": [
"$tsc-watch"
],
"group": "test",
"label": "GDJS TS Check",
"detail": "Runs a types check on the GDJS Runtime."
},
{
"type": "npm",
"script": "test",
"path": "GDJS/",
"group": "test",
"problemMatcher": [],
"label": "Run GDJS tests",
"detail": "Run tests for GDJS."
}
]
}
73 changes: 73 additions & 0 deletions Core/GDCore/Events/Builtin/ForEachChildVariableEvent.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*
* GDevelop Core
* Copyright 2008-2016 Florian Rival ([email protected]). All rights
* reserved. This project is released under the MIT License.
*/

#include "ForEachChildVariableEvent.h"
#include "GDCore/Events/Serialization.h"
#include "GDCore/Serialization/SerializerElement.h"

using namespace std;

namespace gd {

ForEachChildVariableEvent::ForEachChildVariableEvent()
: BaseEvent(), valueIteratorVariableName("child"), keyIteratorVariableName(""), iterableVariableName("") {}

vector<gd::InstructionsList*> ForEachChildVariableEvent::GetAllConditionsVectors() {
vector<gd::InstructionsList*> allConditions;
allConditions.push_back(&conditions);

return allConditions;
}

vector<gd::InstructionsList*> ForEachChildVariableEvent::GetAllActionsVectors() {
vector<gd::InstructionsList*> allActions;
allActions.push_back(&actions);

return allActions;
}

vector<const gd::InstructionsList*>
ForEachChildVariableEvent::GetAllConditionsVectors() const {
vector<const gd::InstructionsList*> allConditions;
allConditions.push_back(&conditions);

return allConditions;
}

vector<const gd::InstructionsList*>
ForEachChildVariableEvent::GetAllActionsVectors() const {
vector<const gd::InstructionsList*> allActions;
allActions.push_back(&actions);

return allActions;
}

void ForEachChildVariableEvent::SerializeTo(SerializerElement& element) const {
element.AddChild("iterableVariableName").SetValue(iterableVariableName);
element.AddChild("valueIteratorVariableName").SetValue(valueIteratorVariableName);
element.AddChild("keyIteratorVariableName").SetValue(keyIteratorVariableName);
gd::EventsListSerialization::SerializeInstructionsTo(
conditions, element.AddChild("conditions"));
gd::EventsListSerialization::SerializeInstructionsTo(
actions, element.AddChild("actions"));
gd::EventsListSerialization::SerializeEventsTo(events,
element.AddChild("events"));
}

void ForEachChildVariableEvent::UnserializeFrom(gd::Project& project,
const SerializerElement& element) {
iterableVariableName = element.GetChild("iterableVariableName", 0, "").GetValue().GetString();
valueIteratorVariableName = element.GetChild("valueIteratorVariableName", 0, "").GetValue().GetString();
keyIteratorVariableName = element.GetChild("keyIteratorVariableName", 0, "").GetValue().GetString();
gd::EventsListSerialization::UnserializeInstructionsFrom(
project, conditions, element.GetChild("conditions", 0, "Conditions"));
gd::EventsListSerialization::UnserializeInstructionsFrom(
project, actions, element.GetChild("actions", 0, "Actions"));
gd::EventsListSerialization::UnserializeEventsFrom(
project, events, element.GetChild("events", 0, "Events"));
}

} // namespace gd
110 changes: 110 additions & 0 deletions Core/GDCore/Events/Builtin/ForEachChildVariableEvent.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
/*
* GDevelop Core
* Copyright 2008-2016 Florian Rival ([email protected]). All rights
* reserved. This project is released under the MIT License.
*/

#ifndef FOREACHCHILDVARIABLEEVENT_H
#define FOREACHCHILDVARIABLEEVENT_H
#include "GDCore/Events/Event.h"
#include "GDCore/Events/EventsList.h"
namespace gd {
class Instruction;
class Project;
class Layout;
} // namespace gd

namespace gd {

/**
* \brief Event repeated for each every child of a structure variable.
*/
class GD_CORE_API ForEachChildVariableEvent : public gd::BaseEvent {
public:
ForEachChildVariableEvent();
virtual ~ForEachChildVariableEvent(){};
virtual gd::ForEachChildVariableEvent* Clone() const {
return new ForEachChildVariableEvent(*this);
}

virtual bool IsExecutable() const { return true; }

virtual bool CanHaveSubEvents() const { return true; }
virtual const gd::EventsList& GetSubEvents() const { return events; };
virtual gd::EventsList& GetSubEvents() { return events; };

const gd::InstructionsList& GetConditions() const { return conditions; };
gd::InstructionsList& GetConditions() { return conditions; };

const gd::InstructionsList& GetActions() const { return actions; };
gd::InstructionsList& GetActions() { return actions; };

/**
* \brief Get the iterable variable name attached to the event.
*
* It is the structure variable that will be iterated on.
*/
const gd::String& GetIterableVariableName() const { return iterableVariableName; };

/**
* \brief Set the iterable variable name attached to the event.
*
* It is the structure variable that will be iterated on.
*/
void SetIterableVariableName(gd::String newName) { iterableVariableName = newName; };

/**
* \brief Get the value iterator variable attached to the event.
*
* It is the variable that will contain the value of the
* iterable's child being iterated on.
*/
const gd::String& GetValueIteratorVariableName() const { return valueIteratorVariableName; };

/**
* \brief Set the value iterator variable attached to the event.
*
* It is the variable that will contain the value of the
* iterable's child being iterated on.
*/
void SetValueIteratorVariableName(gd::String newName) { valueIteratorVariableName = newName; };

/**
* \brief Get the key iterator variable attached to the event.
*
* It is the variable that will contain the name of the
* iterable's child being iterated on.
*/
const gd::String& GetKeyIteratorVariableName() const { return keyIteratorVariableName; };

/**
* \brief Set the key iterator variable attached to the event.
*
* It is the variable that will contain the name of the
* iterable's child being iterated on.
*/
void SetKeyIteratorVariableName(gd::String newName) { keyIteratorVariableName = newName; };

virtual std::vector<const gd::InstructionsList*> GetAllConditionsVectors()
const;
virtual std::vector<const gd::InstructionsList*> GetAllActionsVectors() const;

virtual std::vector<gd::InstructionsList*> GetAllConditionsVectors();
virtual std::vector<gd::InstructionsList*> GetAllActionsVectors();

virtual void SerializeTo(SerializerElement& element) const;
virtual void UnserializeFrom(gd::Project& project,
const SerializerElement& element);

private:
gd::String valueIteratorVariableName;
gd::String keyIteratorVariableName;
gd::String iterableVariableName;
gd::InstructionsList conditions;
gd::InstructionsList actions;
gd::EventsList events;
};

} // namespace gd

#endif // FOREACHEVENT_H
32 changes: 28 additions & 4 deletions Core/GDCore/Events/Parsers/ExpressionParser2.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <memory>
#include <utility>
#include <vector>

#include "ExpressionParser2Node.h"
#include "GDCore/Extensions/Metadata/ExpressionMetadata.h"
#include "GDCore/Extensions/Metadata/MetadataProvider.h"
Expand Down Expand Up @@ -546,6 +547,7 @@ class GD_CORE_API ExpressionParser2 {
const gd::String &objectName = "",
const gd::String &behaviorName = "") {
std::vector<std::unique_ptr<ExpressionNode>> parameters;
gd::String lastObjectName = "";

// By convention, object is always the first parameter, and behavior the
// second one.
Expand All @@ -569,9 +571,32 @@ class GD_CORE_API ExpressionParser2 {
} else if (gd::ParameterMetadata::IsExpression("string", type)) {
parameters.push_back(Expression("string"));
} else if (gd::ParameterMetadata::IsExpression("variable", type)) {
parameters.push_back(Expression(type, objectName));
parameters.push_back(Expression(
type, lastObjectName.empty() ? objectName : lastObjectName));
} else if (gd::ParameterMetadata::IsObject(type)) {
parameters.push_back(Expression(type));
size_t parameterStartPosition = GetCurrentPosition();
std::unique_ptr<ExpressionNode> objectExpression = Expression(type);

// Memorize the last object name. By convention, parameters that
// require an object (mainly, "objectvar" and "behavior") should be
// placed after the object in the list of parameters (if possible,
// just after). Search "lastObjectName" in the codebase for other
// place where this convention is enforced.
if (auto identifierNode =
dynamic_cast<IdentifierNode *>(objectExpression.get())) {
lastObjectName = identifierNode->identifierName;
} else {
objectExpression->diagnostic =
gd::make_unique<ExpressionParserError>(
"malformed_object_parameter",
_("An object name was expected but something else was "
"written. Enter just the name of the object for this "
"parameter."),
parameterStartPosition,
GetCurrentPosition());
}

parameters.push_back(std::move(objectExpression));
} else {
size_t parameterStartPosition = GetCurrentPosition();
parameters.push_back(Expression("unknown"));
Expand Down Expand Up @@ -849,8 +874,7 @@ class GD_CORE_API ExpressionParser2 {
while (currentPosition < expression.size() &&
(IsIdentifierAllowedChar()
// Allow whitespace in identifier name for compatibility
||
expression[currentPosition] == ' ')) {
|| expression[currentPosition] == ' ')) {
name += expression[currentPosition];
currentPosition++;
}
Expand Down
14 changes: 14 additions & 0 deletions Core/GDCore/Extensions/Builtin/AdvancedExtension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,20 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAdvancedExtension(
.AddParameter("trueorfalse", "Should the condition be true or false?")
.MarkAsAdvanced();

extension
.AddCondition("GetArgumentAsBoolean",
_("Check if a function parameter is set to true (or yes)"),
_("Check if the specified function parameter (also called "
"\"argument\") is set to True or Yes. If the argument is "
"a string, an empty string is considered as \"false\". "
"If it's a number, 0 is considered as \"false\"."),
_("Parameter _PARAM0_ is true"),
_("Functions"),
"res/function24.png",
"res/function16.png")
.AddParameter("string", "Parameter name")
.MarkAsAdvanced();

extension
.AddExpression(
"GetArgumentAsNumber",
Expand Down
Loading