Compare commits

...

938 Commits

Author SHA1 Message Date
Florian Rival
47c29822f6 Bump newIDE version 2018-05-26 22:58:30 -07:00
Florian Rival
1a8fd09596 Workaround a strange Electron behavior for confirming the closing of the app 2018-05-26 22:56:03 -07:00
Florian Rival
3fb6f0cd4e Bump newIDE version 2018-05-26 22:40:36 -07:00
Florian Rival
051b42cc21 Merge pull request #504 from 4ian/feature/particles-emitter-newide
Add support for Particles Emitter objects in GDevelop 5
2018-05-26 22:31:26 -07:00
Florian Rival
24f25d9f33 Fix flow typing of ColorTransformer 2018-05-26 22:09:00 -07:00
Florian Rival
17f2edde83 Avoid calling update on not visible rendered instances to save CPU/GPU 2018-05-26 22:08:01 -07:00
Florian Rival
f4374dd454 Improve RenderedParticleEmitterInstance to have a preview of color/angle of emitters 2018-05-26 21:54:05 -07:00
Florian Rival
0e0c49c11b Fix Get/SetConeSprayAngle in ParticleEmitterObject 2018-05-26 21:46:59 -07:00
Florian Rival
a7dab8faa1 Add the 2 particles examples to GDevelop 5 (web-app runtime) 2018-05-26 20:02:52 -07:00
Florian Rival
3d15e22128 Add the 2 particles examples to GDevelop 5 (Electron runtime) 2018-05-26 19:16:37 -07:00
Florian Rival
3104fac47a Change order of some extension loading to change objects order when creating a new one 2018-05-26 19:03:24 -07:00
Florian Rival
3e8feb7064 Imrpove ParticleEmitter editor in newIDE 2018-05-26 18:51:45 -07:00
Florian Rival
b7da5ee651 Add basic Particle Emitter editor in newIDE 2018-05-26 17:16:32 -07:00
Florian Rival
e78fa036a3 Avoid a Emscripten compilation issue related to ambiguous method 2018-05-26 17:16:14 -07:00
Florian Rival
23dab5cfe1 Add support for displaying ParticleEmitter objects in newIDE 2018-05-26 16:31:25 -07:00
Florian Rival
128d818e1f Merge branch 'master' of github.com:4ian/GD 2018-05-26 16:28:01 -07:00
Florian Rival
c80181fcca Clean up some declarations in Platform.h 2018-05-26 16:27:47 -07:00
Florian Rival
de4df3fe5b Add issue templates on GitHub (#501) 2018-05-26 12:11:42 -07:00
Florian Rival
9935ceb2b4 Bump newIDE version 2018-05-24 22:19:07 -07:00
Florian Rival
50f26f19cb Fix space shooter example fonts on web-app 2018-05-24 22:09:26 -07:00
Todor Imreorov
2c806e9492 Fix scrolling issue on Windows and Linux (#500) 2018-05-24 21:58:34 -07:00
Florian Rival
057a1b2d7c Merge pull request #499 from 4ian/feature/facebook-instant-games
Add Facebook Instant Games support
2018-05-24 21:57:03 -07:00
Florian Rival
69b0cb0ead Fix compilation error 2018-05-24 21:41:34 -07:00
Florian Rival
2be6ca9a9f Update GDJS Runtime version of preview created by the web-app 2018-05-24 21:35:48 -07:00
Florian Rival
992b6434e4 Improve examples names and set orientation 2018-05-24 21:35:26 -07:00
Florian Rival
227223f891 Improve web-app examples to adapt their size to the screen at startup 2018-05-24 21:17:59 -07:00
Florian Rival
972cdd9386 Improve examples to use adapt their size to the screen at startup 2018-05-24 20:58:23 -07:00
Florian Rival
fdf4683b83 Add option to adapt HTML5 games size to the screen at startup 2018-05-24 10:04:47 -07:00
Florian Rival
6450a051d0 Add Facebook Instant Games basic support 2018-05-23 20:47:05 -07:00
Florian Rival
f8a31cf3a9 Bump newIDE version 2018-05-22 23:41:11 -07:00
Florian Rival
5372f09c67 Fix closing confirmation 2018-05-22 23:30:33 -07:00
Florian Rival
b9f0e88f7e Bump version 2018-05-22 22:53:16 -07:00
Florian Rival
a5c3767cca Properly refresh textures of edited objects (useful after editing an image with Piskel) 2018-05-22 22:48:33 -07:00
Florian Rival
05e21484cf Fix React warning in PropertiesEditor 2018-05-22 07:53:48 -07:00
Florian Rival
6c204494b5 Add analytics to track usefulness of embedded Piskel editor 2018-05-21 22:17:42 -07:00
Todor Imreorov
af4cdcd485 Add a bundled version of Piskel for edition of image resources directly from GDevelop
* Supports SpriteObject and other object editors using ResourceSelector.
* This system could handle other editors too.
2018-05-20 22:33:08 -07:00
Nnarol
2977f0b1a7 Fix compilation error due to incomplete type. (#496)
Remove inclusion of wx/propgrid/property.h preceding
inclusion of wx/propgrid/propgrid.h to avoid incomplete type
error of object m_bitmap in property.h of type wxBitmap during build.
propgrid.h includes property.h anyway.
2018-05-20 20:49:03 -07:00
Nnarol
16a31cf1ae Prevent fly from disappearing behind cloud in platformer example (#492)
Set z-order of "Cloud" instances to -5.
Set z-order of "BackgroundObjects" to -2.
2018-05-10 19:06:47 -07:00
Florian Rival
dd14a2a86c Run clang-format on some missing files 2018-05-09 16:52:27 -07:00
Florian Rival
a8559bfbbc Add clang-format to format (C++) source files automatically (#491)
* Update all CMakeLists of extensions to use clang-format
* Run clang-format on all Extensions
* Update GDCore CMakeLists.txt to add clang-format
* Run clang-format on GDCore files
* Update GDJS and GDCpp CMakeLists.txt to add clang-format
* Run clang-format on GDCpp and GDJS files
2018-05-09 15:57:38 -07:00
Florian Rival
a77f8e139f Add Opacity expression for Sprite objects 2018-05-05 15:29:30 +01:00
Florian Rival
07af3990ac Add button to open object editor from InstancePropertiesEditor 2018-05-05 13:55:54 +01:00
Florian Rival
33eee8e00a Update demo gif shown on the README with GDevelop 5 2018-05-04 17:50:45 +01:00
Florian Rival
3f32134018 Fix tests 2018-05-04 13:37:52 +01:00
Florian Rival
5b12935851 Add npm package caching for faster Travis CI builds 2018-05-04 13:31:37 +01:00
Florian Rival
7a4d563875 Remove AppVeyor badge for now as it's not stable yet 2018-05-04 13:25:17 +01:00
Florian Rival
a0105fda37 Disable GDJS Runtime tests on Travis-CI as ChromeHeadless is not working 2018-05-04 13:23:05 +01:00
Florian Rival
d2f997ab4c Remove useless use of filter in ObjectSelector 2018-05-02 20:30:34 +01:00
Florian Rival
eb58f592ed Refactor FuzzyOrEmptyFilter to use it all AutoComplete by default 2018-05-02 15:43:17 +01:00
Florian Rival
8b6b896520 Ensure all AutoComplete popover are visible on screen (even if on the bottom of the window) 2018-05-02 15:03:40 +01:00
Florian Rival
34f240fe59 Fix flow issue 2018-05-02 15:00:08 +01:00
Florian Rival
e78411f3a8 Increase width of GenericExpressionField (useful for when clicking on a expression/string parameter) 2018-05-02 14:39:14 +01:00
Florian Rival
3128a19901 Add Checkbox to enable/disable stopping sounds on scene startup in ScenePropertiesDialog 2018-05-02 14:36:33 +01:00
Florian Rival
14d58eac32 Avoid Popover displayed by ObjectSelector to go outside of the screen 2018-05-01 00:21:07 +01:00
Florian Rival
7488b12704 Add documentation about optionalRequire 2018-04-30 14:02:27 +01:00
Lizard-13
f5fa82c95e Fix distance check (#487) 2018-04-30 10:42:39 +01:00
Florian Rival
6ddd093d56 Fix missing flow annotations 2018-04-28 15:09:32 +01:00
Florian Rival
b5ce3a996d Avoid inactive SceneEditor/ExternalLayoutEditor to drain CPU 2018-04-28 14:37:10 +01:00
Florian Rival
d8409d5f1e Make GenericExpressionField multiline (better readabiliy of long expressions) 2018-04-28 00:44:14 +01:00
Florian Rival
7773d431e8 Improve editor performance (#485)
* Use PureComponent to avoid useless rerenderings
* Disable update to editor tabs that are not active
* Add UpdatesProfiler to ease the detection of unnecessary updates in React components
2018-04-27 22:38:12 +01:00
Florian Rival
5f916903ab Bump newIDE version 2018-04-27 15:14:21 +01:00
Florian Rival
60fe29660d Add missing images for points 2018-04-27 15:12:31 +01:00
Florian Rival
596e0087e5 Bump newIDE version 2018-04-26 15:31:29 +01:00
Todor Imreorov
8034247494 Fix scrolling issue (#483) 2018-04-26 14:37:06 +01:00
Florian Rival
73b60e6da8 Fix harmless error in import-libGD.js 2018-04-26 14:27:33 +01:00
Florian Rival
57e00a7ce0 Bump newIDE version 2018-04-26 13:43:25 +01:00
Florian Rival
1a6aa3b7ab Enable again menu in LocalPreviewLauncher preview windows 2018-04-26 13:38:58 +01:00
Florian Rival
e6eb05ce22 Fix TextEditor not resized when text is entered 2018-04-25 22:26:25 +01:00
Florian Rival
ddf63637fe Bump newIDE version 2018-04-25 17:38:06 +01:00
Florian Rival
c02aec0f6b Merge pull request #478 from 4ian/feature/gdjs-ws-debugger
Add basic Debugger for GDevelop 5/GDJS games
2018-04-25 15:41:16 +01:00
Florian Rival
280eebbccd Add HelpButton in DebuggerContent 2018-04-25 15:34:06 +01:00
Florian Rival
48611c2c38 Add Debugger menu item in EventsSheet toolbar 2018-04-24 23:48:42 +01:00
Florian Rival
5dbbc25b2b Fix warning in ScenePropertiesDialog 2018-04-24 23:40:09 +01:00
Florian Rival
23c85d8a75 Enhance RuntimeSceneInspector to allow to create new instances of objects 2018-04-24 23:23:59 +01:00
Florian Rival
cdd0f72266 Refactor *Inspector to use mapValues 2018-04-24 22:53:44 +01:00
Florian Rival
68189bf720 Add RuntimeSceneInspector showing layers information and timescale to Debugger 2018-04-24 20:59:09 +01:00
Florian Rival
376c2cc5c5 Fix Debugger opening from an ExternalLayoutEditor 2018-04-24 20:30:14 +01:00
Florian Rival
38b587cdd4 Set initial split percentage in DebuggerContent to increase inspectors list readability 2018-04-24 17:44:13 +01:00
Florian Rival
dd65aaf086 Make Debugger inspectors more resilient to bad values 2018-04-24 17:14:36 +01:00
Florian Rival
db7604ee88 Ask for getting a subscription to regularly use the Debugger 2018-04-24 17:11:29 +01:00
Florian Rival
d94749177b Lightly fade buttons to add child to a non-structure variable 2018-04-24 17:10:49 +01:00
Florian Rival
d061be627b Ensure Debugger toolbar is not shown if DebuggerEditor is not active 2018-04-24 17:10:18 +01:00
Florian Rival
3dede19f1f Add note about Debugger working only on Electron runtime 2018-04-24 15:43:17 +01:00
Florian Rival
916d2eb99e Fix storybook DebuggerContent stories 2018-04-24 12:53:26 +01:00
Florian Rival
9fadc0faab Add item in menu to open Debugger 2018-04-24 11:00:04 +01:00
Florian Rival
ba6c7ec78d Add a message when no debugger is launched 2018-04-24 10:57:55 +01:00
Florian Rival
0b4fc055bf [WIP] Enable debugger to listen to multiple game previews 2018-04-24 00:14:38 +01:00
Florian Rival
8a841fa68f Fix a flow type error 2018-04-23 22:15:21 +01:00
Florian Rival
f71983679c Enhance README and fix linter errors + add warning about RawContentInspector usage 2018-04-23 22:15:21 +01:00
Florian Rival
be3cc48e32 Add RuntimeObject/VariablesContainerInspector for Debugger with live editing 2018-04-23 22:15:21 +01:00
Florian Rival
956656236b Move InstancesFullEditor to SceneEditor 2018-04-23 22:15:20 +01:00
Florian Rival
a53de69c4e [WIP] Implement a basic client/server debugger for GDJS games 2018-04-23 22:15:20 +01:00
Florian Rival
a7abbda061 Fix an incorrectly parsed color warning in DefaultTheme 2018-04-23 22:09:48 +01:00
Florian Rival
c267d14348 Merge pull request #452 from Lizard-13/skeleton-runtime-object
Add Skeleton object extension (still in Beta)
2018-04-23 21:50:09 +01:00
Todor Imreorov
7db2709ff0 Improve scrolling and add mouse middle button support to Scene editor (#472)
* Add mouse middle button input support to Scene editor, using standard navigation design present in other software (Gimp, Krita, Inkscape, blender, etc):
- Scrolling to zoom in and out the view
- Mid click to pan the view

* Middle mouse navigation is only for windows and Linux, but not macOS.
* Add support for natural scrolling in both X and Y directions
2018-04-23 21:36:19 +01:00
Lizard-13
86a3614f89 Added an example and improve response on missing resources 2018-04-23 12:52:30 -03:00
Lizard-13
b8e0b5d8e3 Update comments 2018-04-20 08:22:18 -03:00
Lizard-13
c7a8df3d5a Clean some code 2018-04-16 12:31:11 -03:00
Florian Rival
3be8966132 Remove menu of BrowserWindow showing the preview of games in newIDE 2018-04-15 22:34:33 +02:00
Florian Rival
61cefa6cd7 Merge branch 'master' of github.com:4ian/GD 2018-04-15 22:33:47 +02:00
Florian Rival
e1dd41bb32 Fix debouncing of HelpFinder analytics 2018-04-15 12:29:06 +02:00
Ryan Jentzsch
24466ca653 Add note about NPM watcher error for Linux (#468)
See #467
2018-04-14 10:40:02 +02:00
Florian Rival
1c9497dc92 Remove useless file 2018-04-13 23:45:26 +02:00
Florian Rival
5dd3ed43cf Merge pull request #466 from 4ian/feature/help-finder
Add HelpFinder with search in documentation powered by Algolia DocSearch.
2018-04-13 17:06:11 +02:00
Florian Rival
368cdebd78 Fix primary RaisedButton text color in DarkTheme 2018-04-13 17:03:43 +02:00
Florian Rival
3d7279144b Add Search powered by Algolia in HelpFinder 2018-04-13 16:53:54 +02:00
Florian Rival
18682eccfa Fix DocSearch width on large screens 2018-04-13 16:45:41 +02:00
Florian Rival
f70c565e7d Ensure opening a link in the Electron app will open an external browser 2018-04-13 16:38:34 +02:00
Florian Rival
b9035efc9e Fix StartPage tests 2018-04-13 16:29:40 +02:00
Florian Rival
493fc7b6f9 Send analytics from HelpFinder to know if it's being used 2018-04-13 16:28:04 +02:00
Florian Rival
52db6e15ee Add work-in-progress HelpFinder dialog 2018-04-13 16:19:39 +02:00
Florian Rival
28de2b179b Merge pull request #465 from Lizard-13/improve-particles
Improve particles
2018-04-13 15:12:11 +02:00
Lizard-13
4a6c37f502 Fix Cocos particles size 2018-04-13 06:50:51 -03:00
Lizard-13
9ce734e204 More particles fixes 2018-04-13 06:27:37 -03:00
Florian Rival
fb3a0edfac Fix AudioResourceField not properly shown in ExternalEvents editor 2018-04-10 18:38:46 +02:00
Florian Rival
e613c7d546 Merge pull request #464 from Lizard-13/improve-particles
Improve/Fix particles
2018-04-10 10:44:21 +02:00
Lizard-13
6db6455bb6 Improve particles 2018-04-09 22:38:47 -03:00
Florian Rival
86e928724a Add ObjectName string expression 2018-04-09 17:53:48 +02:00
Florian Rival
f31d8f88c2 Update Particles - Various effects example for HTML5 games 2018-04-08 23:57:39 +02:00
Florian Rival
940eac6bc4 Fix Pixi and Cocos2d-JS particles flow/tank support and adapt Explosion example 2018-04-08 23:28:51 +02:00
Florian Rival
6908f51b4a Fix hasStarted method of ParticleEmitterObject (Pixi.js and Cocos2d-JS renderers) 2018-04-08 22:34:01 +02:00
Florian Rival
a537f678fb Merge pull request #462 from Lizard-13/js-particles
Add support for particles in HTML5 games (both Pixi.js and Cocos2d-JS renderers)

Thanks @Lizard-13 for this great work!
2018-04-08 21:33:37 +02:00
Lizard-13
1019aaba5f Update exporter and improve readability 2018-04-08 11:48:28 -03:00
Lizard-13
5770ac6396 Add support for particles in web platform 2018-04-07 23:51:28 -03:00
Florian Rival
7171f691a3 Display global groups in italic 2018-04-05 20:20:18 +02:00
Florian Rival
0ad7b71cf2 Bump newIDE version 2018-04-04 17:08:52 +02:00
Florian Rival
006d7296a2 Fix AudioResourceField not properly shown when editing it inline in EventsSheet 2018-04-04 17:07:44 +02:00
Florian Rival
443c49f83e Fix regression due to broken Variable and VariablesContainer copy ctor and assignement operator 2018-04-04 15:10:08 +02:00
Florian Rival
9884965595 Merge pull request #458 from 4ian/audio-resource-support
Audio resource support
2018-04-04 13:15:59 +02:00
Florian Rival
e0379466e0 Add more flowtype coverage 2018-04-04 11:54:58 +02:00
Florian Rival
622cba4642 Move ResourceSelectorWithThumbnail and add ResourceThumbnail 2018-04-04 11:46:14 +02:00
Florian Rival
50c7a582ef Add AudioPreview 2018-04-04 11:23:49 +02:00
Florian Rival
e501fd4a09 Add AudioResourceField 2018-04-04 10:36:59 +02:00
Florian Rival
29808c8800 Bump newIDE version 2018-04-03 21:47:13 +02:00
Florian Rival
fcfb71132c Bump GDCore version 2018-04-03 21:21:32 +02:00
Florian Rival
2017d34197 Make explicit to install InnoSetup Unicode to generate GD4 Windows installer 2018-04-03 18:54:20 +02:00
Florian Rival
662c7bd397 Add missing header files 2018-04-03 18:49:05 +02:00
Florian Rival
cf5011c149 Merge pull request #457 from 4ian/feature/copy-paste-delete-variables-list
Copy/paste/delete variables for GDevelop 5
2018-04-03 18:31:31 +02:00
Florian Rival
954520ae3b Add comment about compiler version for compiling GDCore/GDCpp/IDE 2018-04-03 18:31:06 +02:00
Florian Rival
6ffcd6dfb0 Merge branch 'master' of https://github.com/4ian/GD 2018-04-02 21:53:41 +02:00
Florian Rival
80e7a6010a Add missing std::endl in Light_Manager sometimes creating conflicts with
FileStream.

* Other files should be audited for missing std::endl.
* FileStream should be protected against this.
2018-04-02 21:49:29 +02:00
Florian Rival
0dc023ba89 Improve renaming of pasted objects in newIDE 2018-04-02 12:25:17 +02:00
Florian Rival
e70021d0dd Refactor Variable/VariablesContainer and add copy/paste/delete to VariablesList in newIDE 2018-04-01 23:42:52 +02:00
Florian Rival
eb63bda7d2 [WIP] Change VariablesContainer to keep references to variables valid after a removal/move/swap 2018-04-01 20:19:54 +02:00
Florian Rival
10833aa45d [WIP] Add copy/paste/delete in VariablesList in newIDE 2018-04-01 19:44:22 +02:00
Florian Rival
eed844357e Add WindowBorder color to layout background 2018-04-01 16:56:29 +02:00
Florian Rival
6d91676dab Bump version 2018-04-01 01:44:32 +02:00
Florian Rival
69410d62ea Fix theming of objects parameters conflicting between default and dark theme 2018-04-01 01:11:12 +02:00
Florian Rival
977425e700 Add explanation about how to compile libGD.js manually 2018-03-31 13:19:57 +02:00
Lizard-13
50746b3c75 Still trying to fix Travis CI 2018-03-30 23:25:11 -03:00
Lizard-13
1c5364f917 Trying to fix the Travis CI compiling error 2018-03-30 21:51:50 -03:00
Lizard-13
89d099ff7d Add Cocos renderer support 2018-03-30 21:20:01 -03:00
Florian Rival
49d409260a Add TODO about a performance improvement for Sprite collision mask in native game engine 2018-03-31 00:20:41 +02:00
Florian Rival
a50b62a2d8 Update links in README 2018-03-30 23:53:17 +02:00
Florian Rival
6b21ebcc9b Merge pull request #455 from 4ian/feature/collision-mask-editor
Collision mask editor for GDevelop 5
2018-03-30 23:46:51 +02:00
Florian Rival
3c8aa4a249 Display circle for each vertex of collision mask polygons 2018-03-30 23:12:49 +02:00
Florian Rival
a8e9fa5895 Ensure polygon vertices are not put outside the sprite bounding box 2018-03-30 23:05:11 +02:00
Florian Rival
c9f8b4a8ed [WIP] Add preview of default bounding box collision mask 2018-03-30 22:52:22 +02:00
Florian Rival
6b38479166 [WIP] Factor selectors of PointsEditor and CollisionMasksEditor into SpriteSelector 2018-03-30 22:44:19 +02:00
Florian Rival
4ccbc1b958 [WIP] Add preview of collision mask polygons 2018-03-30 22:01:21 +02:00
Florian Rival
54d7d284c8 [WIP] Add CollisionMasksEditor in newIDE (preview not yet done) 2018-03-30 18:06:21 +02:00
Lizard-13
ca1721ef9a Load skeletal data file only once through shared data
Now each file is readed only once, multiple instances will share static data as default values and animation keys.

Also converted all tabs into spaces :)
2018-03-29 19:25:43 -03:00
Florian Rival
58ed74e020 Add help button about Play Store when one-click Android packaging is finished 2018-03-30 00:00:15 +02:00
Florian Rival
e8ce83b162 Bump version 2018-03-29 22:34:06 +02:00
Florian Rival
9b91f06011 Add menu item to set an object as global 2018-03-29 22:09:23 +02:00
Florian Rival
17247cbbf1 Ensure coordinates of objects moved with the mouse are round 2018-03-29 22:05:42 +02:00
Florian Rival
10b81dd232 Fix StartPage snapshot test 2018-03-25 20:19:48 +02:00
Florian Rival
3f3a5dbd3b Remove warnings and add Flow on StartPage 2018-03-25 20:05:35 +02:00
Florian Rival
6ff8ee749d Fix changes wrongly discarded in ObjectField 2018-03-17 17:21:40 +01:00
Florian Rival
db5f146818 Fix errors with some parameter fields 2018-03-17 17:18:03 +01:00
Lizard-13
ddcf51a2b7 Add custom hitbox action and fix polygons draw 2018-03-14 22:09:25 -03:00
Florian Rival
b7467afd1b Bump newIDE version 2018-03-12 21:59:10 +01:00
Florian Rival
ee993f0cdb Improve performance by stopping rendering of InstancesEditor when the SceneEditor/ExternalLayoutEditor is not displayed 2018-03-11 22:30:53 +01:00
Florian Rival
bc6d3ce16f Use italic font to display global objects in ObjectsList in newIDE 2018-03-11 22:02:42 +01:00
Florian Rival
1fae899497 Enhance VariableField to display children variables too 2018-03-11 16:50:38 +01:00
Florian Rival
8319f60c95 Update VariableField completions when variables are edited 2018-03-11 16:01:49 +01:00
Florian Rival
f6fe1a3205 Enhance performance of ParameterFields components 2018-03-11 15:47:40 +01:00
Florian Rival
01e2b53a3f Improve GenericExpressionField performance 2018-03-10 22:10:39 +01:00
Florian Rival
da9eb3cea7 Ensure ObjectsGroupEditorDialog position on screen is always correct 2018-03-10 21:36:13 +01:00
Florian Rival
c044b32c04 Improve performance of ObjectSelector by avoiding constant re-renderings 2018-03-10 21:35:44 +01:00
Lizard-13
46279e7762 Add JS events functions and hitboxes debug draw 2018-03-10 14:54:17 -03:00
Florian Rival
4936b014ae Improve performance of VariablesEditorDialog and ensure dialog position is always correct 2018-03-10 17:07:19 +01:00
Florian Rival
c1cd0d8780 Use SemiControlledTextField in SpriteEditor to enhance performance/responsiveness 2018-03-10 16:55:45 +01:00
Lizard-13
557af32cc9 Add custom icons 2018-02-27 21:51:15 -03:00
Lizard-13
729a85a9a9 Add extension conditions/actions/expressions 2018-02-27 19:10:36 -03:00
Lizard-13
34146c2f18 Added gdjs.sk namespace for better organization 2018-02-27 19:10:23 -03:00
Lizard-13
00146bb8f8 Add animation and animation blending system 2018-02-27 19:10:11 -03:00
Lizard-13
6026d79ebb Support for armatures, meshes* and polygons
*Meshes needs PIXI lib update
2018-02-27 19:10:07 -03:00
Lizard-13
fc28f272b3 Images color, alpha, visible, z support 2018-02-27 19:10:02 -03:00
Lizard-13
9702db06a5 Basic images working 2018-02-27 19:09:55 -03:00
Lizard-13
209f83d697 Basic classes setup 2018-02-27 19:09:47 -03:00
Lizard-13
0ef8eb32a5 Base extension info and files tree
Files named Ax, By, Cz... as a temporal fix for include order
2018-02-27 19:09:42 -03:00
Lizard-13
8115b8181e Empty working object 2018-02-27 19:09:31 -03:00
Florian Rival
e79a328748 Bump newIDE version 2018-02-25 23:24:20 +01:00
Florian Rival
2083ee1029 Update hosted GDJS root for previews in browser with S3 in newIDE 2018-02-25 23:24:10 +01:00
Florian Rival
3e982cdd87 Add link to roadmap in newIDE readme 2018-02-25 22:58:06 +01:00
Florian Rival
883527b289 Fix tests 2018-02-25 22:38:46 +01:00
Florian Rival
a4d84efdd5 Add support for editing properties of resources in ResourcePropertiesEditor in newIDE 2018-02-25 22:35:17 +01:00
Florian Rival
e46c8493bc Refactor Resource to use gd::PropertyDescriptor for custom properties 2018-02-25 22:17:04 +01:00
Florian Rival
4c443b09cf Update zombie-laser example for newIDE 2018-02-25 18:57:14 +01:00
Florian Rival
98bc2236f4 Merge pull request #445 from Lizard-13/raycast-1
Add Raycast condition
2018-02-25 18:08:43 +01:00
Florian Rival
5199299639 Add analytics when a user choose a new subscription plan 2018-02-25 17:45:49 +01:00
Florian Rival
3268d1db25 Merge pull request #451 from 4ian/feature/profile-in-context
Preview over wifi, GDevelop splash and minor improvements
2018-02-25 17:36:34 +01:00
Florian Rival
741770924b Remove useless package & update subscription descriptions 2018-02-25 17:34:55 +01:00
Florian Rival
49aa9469bb Add SubscriptionChecker when trying to deactivate GDevelop splash in ProjectPropertiesDialog 2018-02-25 17:19:24 +01:00
Florian Rival
7cbe34436c Improve design of SubscriptionDialog and SubscriptionCheckDialog 2018-02-25 16:40:48 +01:00
Lizard-13
122f7ecf3e Fix date functions (#450) 2018-02-25 14:13:23 +01:00
Florian Rival
d79bdd9554 Add SubscriptionChecker to ask users to get a subscription if needed 2018-02-24 20:34:59 +01:00
Lizard-13
3e331cb2e8 Fix event description string (#448) 2018-02-24 19:02:15 +01:00
Florian Rival
361fb6aeab Move UserProfile into a single object provided by a Provider (using react-create-context)
Can be updated later to use the new React Context API once it's ready
SubscriptionCheckDialog is still a Work-In-Progress.
2018-02-24 16:23:45 +01:00
Florian Rival
b4a76895ee [WIP] Display dialog asking for a subscription when starting network preview
TODO: Refactor to store user profile in a context/store to avoid de-synchronisation
between components using UserProfileContainer.
2018-02-24 14:31:08 +01:00
Florian Rival
b2251e1a12 Fix external layout previews for web-app 2018-02-23 15:55:19 +01:00
Florian Rival
1c1860370a Prevent pinch-to-zoom on exported games/preview and set black address bar 2018-02-23 15:24:35 +01:00
Florian Rival
1a190b2a44 Add Network Preview (Preview over wifi) to newIDE with live reload 2018-02-23 12:41:18 +01:00
Florian Rival
b1e0f72416 Add local server in Electron app (to serve previews over wifi) 2018-02-20 08:31:13 +01:00
Florian Rival
2c4ae7573e Add LoadingScreen in project properties to allow to show/hide splash at startup 2018-02-18 23:02:26 +01:00
Florian Rival
04ff1f2726 Add GDevelop Splashscreen at game startup 2018-02-18 21:55:42 +01:00
Florian Rival
eaa5200f95 Fix warning 2018-02-18 17:00:05 +01:00
Florian Rival
53c749b79e Update some links in newIDE to the new GDevelop website (gdevelop-app.com) 2018-02-18 16:30:39 +01:00
Lizard-13
eb96ee8497 Fix @static hint 2018-02-17 17:56:07 -03:00
Lizard-13
458444ee7b Implement collinear case 2018-02-17 16:02:13 -03:00
Lizard-13
c8eb13f18f Minor fixes
Removed circle code, unused includes and debug lines.
Improved extension strings.
Added reference link.
Updated "Laser and zombies.gdg" example
2018-02-17 16:01:11 -03:00
Lizard-13
a224b93edc Remove circle from test game 2018-02-17 16:01:00 -03:00
Lizard-13
f077ca6723 Commented out circle raycasting and added icons 2018-02-17 16:00:52 -03:00
Lizard-13
6bbfa1d4a1 Implement C++ version
And little fixes on the JS version
2018-02-17 16:00:32 -03:00
Lizard-13
3c3dc6ef6e Implement raycast JS version and test game 2018-02-17 16:00:18 -03:00
Lizard-13
5c101dbcda Engine condition set up
Neither tested nor compiled yet
2018-02-17 15:56:50 -03:00
Florian Rival
701b78361a Add support for disabled events in EventsSheet in newIDE 2018-02-17 16:34:42 +01:00
Florian Rival
07f26027f6 Bump newIDE version 2018-02-15 22:56:13 +01:00
Florian Rival
09cf13d6e2 Add confirm before close dialog to newIDE 2018-02-15 22:50:08 +01:00
Florian Rival
42f91565fa Merge pull request #443 from 4ian/feature/cordova-icons
Add support for icons when exporting to Android/iOS
2018-02-13 19:51:04 +01:00
Florian Rival
ac6c146808 Fix ImageThumbnail error when onContextMenu is not specified 2018-02-13 19:50:21 +01:00
Florian Rival
59ad23f8ac Allow to customize game orientation (for when exported with Cordova) 2018-02-11 23:44:00 +01:00
Florian Rival
769c6fe3d5 Move ResourcesLoader in its own folder + refactor methods 2018-02-11 23:17:44 +01:00
Florian Rival
07b92911ab Add message on web-app about non support of automatic icons creation 2018-02-11 22:03:30 +01:00
Florian Rival
eb57bcfc87 Add iOS icons support for Cordova + fix image caching 2018-02-11 21:52:40 +01:00
Florian Rival
7addeba73a Add support for Android icons in Cordova export 2018-02-11 21:14:18 +01:00
Florian Rival
263902b45a Avoid caching in ImagePreview and ImageThumbnail 2018-02-11 18:14:47 +01:00
Florian Rival
d283f759fe Add PlatformSpecificAssets to Project 2018-02-10 18:36:02 +01:00
Florian Rival
fabd028a63 Update VSCode C++ properties for Intellisense 2018-02-10 18:35:05 +01:00
Florian Rival
2b18272c41 Merge branch 'master' of github.com:4ian/GD 2018-02-07 00:02:25 +01:00
Florian Rival
a1fb39da3d Fix scene unloading re-creating a RuntimeSceneRenderer leading to issues with Cocos2d-JS renderer 2018-02-05 23:12:51 +01:00
Florian Rival
09602fdf9e Merge pull request #441 from ronnystandtke/patch-1
Update gdevelop.desktop
2018-02-04 17:03:22 +01:00
ronnystandtke
d574ef17ba Update gdevelop.desktop
added German L10n
2018-02-04 17:00:34 +01:00
Florian Rival
0e3f70627b Bump newIDE version 2018-02-03 19:32:52 +01:00
Florian Rival
a814a07105 Fix ResourcesEditor selection 2018-02-03 19:24:47 +01:00
Florian Rival
c49af90a9c Add program opening count to Keen.io analytics 2018-02-03 19:09:33 +01:00
Florian Rival
24afa155c8 Improve Keen.io analytics events by adding user profile information 2018-02-03 18:30:09 +01:00
Florian Rival
9e5a431516 Only run Fullstory on newIDE web-app 2018-02-03 17:53:57 +01:00
Florian Rival
182a94285c Unregister service worker (it is not ready yet) 2018-02-03 13:05:22 +01:00
Florian Rival
442c2c8dd9 Merge pull request #439 from 4ian/feature/resources-editor
Resources editor for newIDE
2018-02-03 12:57:22 +01:00
Florian Rival
f8fd0dd353 Add a preview in ResourcesEditor 2018-02-03 12:55:30 +01:00
Florian Rival
faad9e23ac Add ResourcesEditor with ResourcePropertiesEditor and Toolbar 2018-01-30 23:12:31 +01:00
Florian Rival
d2af0da1b1 Added tools method to ResourcesManager and finish working version of ResourcesList 2018-01-30 21:56:40 +01:00
Florian Rival
c65e5c3e49 [WIP] Add ResourcesEditor based on a generic SortableVirtualizedItemList
TODO:
* Use SortableVirtualizedItemList for ObjectsList and ObjectsGroupsList
* Add missing features (sorting, delete, thumbnail for images, properties edition) to ResourcesEditor
2018-01-30 00:58:21 +01:00
Florian Rival
24a8dfc5f0 Add SemiControlledTextField to be able to type freely in PropertiesEditor 2018-01-28 18:45:44 +01:00
Florian Rival
9c6790ac37 Update default gravity in PhysicsBehavior 2018-01-27 23:50:49 +01:00
Florian Rival
18ef7460ba Bump newIDE version 2018-01-27 19:34:36 +01:00
Florian Rival
63cd0e76c3 Fix warning 2018-01-27 19:34:27 +01:00
Florian Rival
bdbf7fd9fc Add support for editing BehaviorSharedData in newIDE
TODO:
* Support for cancelling modifications made on it in ScenePropertiesDialog
2018-01-27 19:13:27 +01:00
Florian Rival
6bbedbd8f9 Fix BehaviorSharedData not created by newIDE + fix warnings 2018-01-27 17:00:44 +01:00
Florian Rival
648bd1ff2e Show warning if game name or package name is empty when exporting in newIDE 2018-01-24 23:31:02 +01:00
Florian Rival
d4288caedb Fix .env file loading with electron-app and bump newIDE version 2018-01-23 00:15:13 +01:00
Florian Rival
0a35bc3272 Bump newIDE version 2018-01-22 23:35:55 +01:00
Florian Rival
d8b737a31f Fix LocalS3Export always reusing the same folder leading to useless files in exported game 2018-01-22 23:35:32 +01:00
Florian Rival
cfd2655f6c Bump newIDE version 2018-01-22 23:29:21 +01:00
Florian Rival
1896241b9d Move AWS S3 credentials to an .env file for games deployment on GDevelop hosting 2018-01-22 23:25:42 +01:00
Florian Rival
0ed22a6ee1 Fix upload to GDevelop hosting of exported games with large files 2018-01-22 22:52:44 +01:00
Florian Rival
2bfcb99c3e Add analytics when a signup is done 2018-01-22 00:20:32 +01:00
Florian Rival
815f8a520a Bump newIDE version 2018-01-21 22:11:59 +01:00
Florian Rival
f115b6607f Add PhysicsBehavior support to newIDE, with an example 2018-01-21 22:11:24 +01:00
Florian Rival
c876f67502 Add pathfinding example to newIDE web-app 2018-01-20 21:25:25 +01:00
Florian Rival
27674f272c Bump newIDE version 2018-01-20 19:21:13 +01:00
Florian Rival
02879507e3 Fix tests (outdated snapshots after adding Pathfinding to newIDE) 2018-01-20 19:19:38 +01:00
Florian Rival
0a7629878f Fix Sepia layer effect (broken since Pixi v4 update) 2018-01-20 19:00:22 +01:00
Florian Rival
b0368232d0 Add Parallax example to newIDE 2018-01-20 17:19:45 +01:00
Florian Rival
a32bf3db98 Add Pathfinding and Zombie Laser examples to newIDE 2018-01-20 17:02:47 +01:00
Florian Rival
64cbbb20d3 Expose PathfindingBehavior when building with Emscripten 2018-01-20 16:53:12 +01:00
Florian Rival
dd4fbecc98 Update some GDevelop services API to use api.gdevelop-app.com 2018-01-20 16:28:27 +01:00
Florian Rival
807a75a265 Update productName for newIDE 2018-01-19 00:24:07 +01:00
Florian Rival
6e1b44ea56 Bump newIDE version 2018-01-18 23:31:41 +01:00
Florian Rival
d870a54f58 Fix error when handling download-progress of an update 2018-01-18 23:31:00 +01:00
Florian Rival
9f464a3f23 Bump newIDE version 2018-01-18 23:12:37 +01:00
Florian Rival
ed4e84d665 Add Export icon in newIDE main toolbar & fix profile refreshing after getting a new subscription 2018-01-18 23:12:08 +01:00
Florian Rival
1e4ab96233 Bump newIDE version 2018-01-18 00:04:27 +01:00
Florian Rival
380c034ff5 Merge pull request #433 from 4ian/feature/online-cordova-export
Packaging for Android with GDevelop online build service + various improvements
2018-01-18 00:02:51 +01:00
Florian Rival
7c9abe432d Fix AboutDialog story in storybook and use retro default avatars 2018-01-18 00:02:05 +01:00
Florian Rival
2ca853c22c Add HelpButton in ProfileDialog and disabled icon field in ProjectPropertiesDialog 2018-01-17 23:55:40 +01:00
Florian Rival
b23d55612a Add display of user Gravatar in ProfileDetails 2018-01-17 22:36:51 +01:00
Florian Rival
b261faacfc Freeze GDCore/libGD.js and newIDE version to 4.0.96 (don't read it from Git tags) 2018-01-17 00:21:07 +01:00
Florian Rival
9984b32876 Add link to help page specific to each exporters 2018-01-16 23:42:46 +01:00
Florian Rival
d63ba75430 Change wording in CreateProfile 2018-01-16 23:33:44 +01:00
Florian Rival
2db903ed94 Fix profile refreshing after login/account creation 2018-01-16 22:00:45 +01:00
Florian Rival
3f9bc4d335 Fix upload and Android export for large files 2018-01-16 21:25:36 +01:00
Florian Rival
3df95d0e21 Switch authentification to use Firebase 2018-01-14 17:59:09 +01:00
Florian Rival
f445695f6a Add auto-update support to GDevelop 5 2018-01-13 17:17:48 +01:00
Florian Rival
6f3163d7bd Rework ExportDialog to have a list of exporters to choose from 2018-01-13 14:54:10 +01:00
Florian Rival
5421eae23d Add buttons to switch between exporters of the same kind 2018-01-11 00:04:31 +01:00
Florian Rival
a0e82ee22f Add button to download logs in LocalOnlineCordovaExport 2018-01-10 23:25:18 +01:00
Florian Rival
1fbf822769 Move GDevelop hosting API configuration to GDevelopServices/ApiConfigs.js 2018-01-09 23:52:44 +01:00
Florian Rival
6b0f037722 Add a comment about working with Auth0 during development 2018-01-09 23:52:44 +01:00
Florian Rival
ae231d2fe6 Update packageName of fixtures/example games 2018-01-09 23:52:44 +01:00
Florian Rival
2e95899da7 Ensure user is asked for authenticating again if needed 2018-01-09 23:52:44 +01:00
Florian Rival
3f45b38dfc [WIP] Make SubscriptionDialog working with GDevelop Services and Stripe
TODO: Properly handle the refresh of ProfileDialog
2018-01-09 23:52:44 +01:00
Florian Rival
daf4d36348 [WIP] Add SubscriptionDialog 2018-01-09 23:52:44 +01:00
Florian Rival
477cd16f23 Add storybook stories for Profile components 2018-01-09 23:52:44 +01:00
Florian Rival
83eded0056 [WIP] Improve LocalOnlineCordovaExport progress handling 2018-01-09 23:52:44 +01:00
Florian Rival
338de9c149 [WIP] Add LimitDisplayer and display subscriptions limits in LocalOnlineCordovaExport 2018-01-09 23:52:44 +01:00
Florian Rival
6d99d4e661 [WIP] Add happy path for LocalOnlineCordovaExport 2018-01-09 23:52:44 +01:00
Florian Rival
4e5a8060c8 [WIP] Add Archiver to create zip files for LocalOnlineCordovaExport 2018-01-09 23:52:44 +01:00
Florian Rival
eb938e39ff [WIP] Add LocalOnlineCordovaExport (with no real calls to the build service for now) 2018-01-09 23:52:44 +01:00
Florian Rival
cff8604a5f Fix flow error/incompatibility in auth0-lock's node_modules 2018-01-09 23:52:44 +01:00
Florian Rival
2afa54bcd2 [WIP] Add SubscriptionDetails, ProfileDetails and UsagesDetails in ProfileDialog 2018-01-09 23:52:44 +01:00
Florian Rival
4da6025b6f Move configuration of BrowserS3PreviewLauncher in ApiConfigs 2018-01-09 23:52:44 +01:00
Florian Rival
c4f64444e7 [WIP] Add a Profile in newIDE with login/logout based on Auth0 2018-01-09 23:52:44 +01:00
Florian Rival
b0205b296f Merge pull request #432 from 4ian/fix/various
Various improvements for GDJS (memory + libs update)
2018-01-09 23:48:15 +01:00
Florian Rival
e0c8b3cc81 Add comment about RuntimScene.unloadScene and memory management 2018-01-09 23:47:47 +01:00
Florian Rival
80ca92336e Fix filters and refactor Text style update for Pixi v4 2018-01-09 23:03:26 +01:00
Florian Rival
6c0681e4ca Merge branch 'mem' of https://github.com/dos1/GD into dos1-mem 2018-01-07 20:06:18 +01:00
Sebastian Krzyszkowiak
26e8503dc8 GDJS: HowlerSoundManager: use XMLHttpRequest to preload
Howler decodes the whole file, which causes massive memory spike
on load when the project contains lots of longer music files.
We could use HTML5 audio to avoid decoding, but then the load event
actually means "preloaded enough to start playing without buffering".

We don't need to decode here, putting the file into browser cache
should be enough, so let's just download the file with XHR.
2018-01-06 02:09:01 +01:00
Sebastian Krzyszkowiak
c1ce78efde GDJS: howler-sound-manager: use .unload() method when destroying to free the resources used by sounds 2018-01-06 02:08:54 +01:00
Sebastian Krzyszkowiak
2f52c2f062 GDJS: store global volume value in HowlerSoundManager to avoid rounding errors (#430) 2018-01-05 16:59:16 +01:00
Sebastian Krzyszkowiak
24d11a2446 GDJS: update howler.js to 2.0.7 2018-01-04 23:44:57 +01:00
Sebastian Krzyszkowiak
e1d4ae5bbd GDJS: update Pixi to 4.6.2 2018-01-04 23:44:32 +01:00
Sebastian Krzyszkowiak
dcfe346f54 GDJS: RuntimeScene: clean up more variables on unload, so they can be garbage collected 2018-01-04 23:44:13 +01:00
Florian Rival
3906db9efe Make UserUUID generation security/exception errors-proof 2017-12-26 16:47:00 +01:00
Florian Rival
ba5244d95d Bump newIDE version 2017-12-26 16:46:32 +01:00
Florian Rival
52db730870 Add ErrorBounday for handling editor crash and EmptyEventsPlaceholder for empty events sheets 2017-12-26 14:47:46 +01:00
Florian Rival
82d2278ebd Bump newIDE version 2017-12-25 23:55:48 +01:00
Florian Rival
30d08ac72d Add button linking to help about creating new themes in newIDE 2017-12-25 17:48:38 +01:00
Florian Rival
6f1e71c8e5 Update README about creating themes for newIDE 2017-12-25 17:41:00 +01:00
Florian Rival
385be9b5f5 Make EventsSheet color scheme customizable and add Monokai inspired dark color scheme 2017-12-25 17:33:25 +01:00
Florian Rival
25cb041d78 Improve DarkTheme to fix Raised buttons readability 2017-12-25 14:58:36 +01:00
Florian Rival
18fa9cd659 Merge pull request #429 from 4ian/feature/upgrade-mui-react
Upgrade to React 16 and Material-UI 0.20
2017-12-24 17:33:58 +01:00
Florian Rival
ce760541c5 Upgrade to React 16.2 2017-12-24 16:51:04 +01:00
Florian Rival
db51b652f0 Remove useless refs created warnings with React 16 2017-12-24 15:05:46 +01:00
Florian Rival
4222d98aa9 Update instructions parameters color scheme 2017-12-24 15:05:20 +01:00
Florian Rival
484f1e5dcb Fix typing 2017-12-24 14:30:43 +01:00
Florian Rival
7304b94a77 Fix warnings/React issues with refs in EventsSheet 2017-12-24 14:07:20 +01:00
Florian Rival
ee5ec7df72 Fix InstancePropertiesEditor not refreshed when an instance is deleted/moved 2017-12-24 12:49:20 +01:00
Florian Rival
9a1e4bdf7c Update react-i18next dependency of newIDE 2017-12-24 12:40:26 +01:00
Florian Rival
a43cca7629 Update react-dnd dependency of newIDE 2017-12-24 12:31:08 +01:00
Florian Rival
0cdabab2ec Update react-color dependency of newIDE 2017-12-24 12:24:49 +01:00
Florian Rival
28b968ea99 Update newIDE to React 15.6.2 2017-12-24 12:21:32 +01:00
Florian Rival
5160033092 Upgrade storybook and remove useless newIDE dependencies 2017-12-24 12:00:41 +01:00
Florian Rival
ce086c07b9 Upgrade material-ui to v0.20 and upgrade other dependencies 2017-12-24 11:49:40 +01:00
Florian Rival
bf9348488d Merge pull request #428 from 4ian/feature/themable-newIDE
Add a Dark theme to newIDE
2017-12-23 23:18:38 +01:00
Florian Rival
70b3e0701b Fix StartPage tests 2017-12-23 23:14:44 +01:00
Florian Rival
dc3d890937 Add comment explaining how to create a new theme 2017-12-23 23:14:02 +01:00
Florian Rival
f68be32e2d Update logo in newIDE StartPage and tweak colors 2017-12-23 23:11:10 +01:00
Florian Rival
3758e7af03 Fix editors not opening in SceneEditor in newIDE 2017-12-23 22:40:50 +01:00
Florian Rival
5ab1858349 [WIP] Refactor EventsSheet to make it partially themable 2017-12-23 21:50:12 +01:00
Florian Rival
54353bcb24 [WIP] Add PreferencesDialog and make the whole newIDE interface themable 2017-12-23 21:06:55 +01:00
Florian Rival
de7640558d Fix Clock Skew related errors while uploading to S3 from certain computers 2017-12-23 13:52:33 +01:00
Florian Rival
2e17b16516 Make newIDE context menus dynamic (greyed-out items if not applicable, checkbox for grid) 2017-12-23 13:51:36 +01:00
Sebastian Krzyszkowiak
345f9f1786 Run CopyRuntimeToGD.sh with bash explicitly (#427)
The script contains bashisms which fail on systems where sh is
symlinked to dash instead of bash.
2017-12-22 11:12:02 +01:00
Florian Rival
8c9214ce5e Bump newIDE version 2017-12-20 22:44:49 +01:00
Florian Rival
fc9cc8046d Merge pull request #426 from 4ian/feature/newide-js-code-event
Add support for Javascript Code Event in newIDE
2017-12-20 22:33:12 +01:00
Florian Rival
e592bb855d Add support for objects parameter in JsCodeEvent in newIDE 2017-12-20 22:30:53 +01:00
Florian Rival
f8407264da Add basic support for JsCodeEvent in newIDE 2017-12-19 21:16:27 +01:00
Florian Rival
202fe2b69a Add FpsLimiter to limit framerate on InstancesEditor of newIDE, to avoid killing CPU/battery 2017-12-18 00:05:31 +01:00
Florian Rival
d14a93f9d0 Remove ok button in MainFrame Snackbar 2017-12-17 19:37:13 +01:00
Florian Rival
1d1ccdbf06 Fix unmounting and related focus issue of editors in newIDE 2017-12-17 16:16:29 +01:00
Florian Rival
92fd647316 Add button to open external events or layout events from a LinkEvent in newIDE 2017-12-16 18:09:30 +01:00
Florian Rival
d8ca506200 Add flow typing to MainFrame 2017-12-16 17:18:09 +01:00
Florian Rival
928d6eda98 Update VSCode settings 2017-12-16 16:53:53 +01:00
Florian Rival
d5e6755694 Move all providers from MainFrame to a dedicated component 2017-12-16 16:53:37 +01:00
Florian Rival
a1431126ec Merge pull request #424 from 4ian/feature/clipboard-project-manager
Clipboard support for ProjectManager in newIDE
2017-12-16 16:17:14 +01:00
Florian Rival
13c8caeb8c Increase flow coverage 2017-12-16 16:12:10 +01:00
Florian Rival
b2b5ee0e19 Add a TODO about style refactoring 2017-12-16 14:28:32 +01:00
Florian Rival
ff74ecd7c9 Run prettier on newIDE codebase 2017-12-16 14:26:05 +01:00
Florian Rival
0ac3e79156 Fix flow typing in newIDE and update flow to latest version 2017-12-16 14:24:25 +01:00
Florian Rival
3a69936e2e Add copy/cut/paste support for External Layouts and Events in newIDE 2017-12-16 14:02:40 +01:00
Florian Rival
e738d5dd5f Add copy/cut/paste support for Layout in newIDE 2017-12-16 00:14:18 +01:00
Florian Rival
ed8ee21c04 Reduce GroupEvent height 2017-12-15 23:22:47 +01:00
Florian Rival
87220a941a Bump newIDE version 2017-12-15 23:19:23 +01:00
Florian Rival
4425d13c7a Rename objectWithScope to objectWithContext 2017-12-13 00:19:31 +01:00
Florian Rival
b818e5f493 Add support for copy/cut/paste objects 2017-12-12 23:57:37 +01:00
Lizard-13
403563ba32 Support keyboard top row numbers in HTML5 games (#422) 2017-12-11 14:29:14 +01:00
Florian Rival
156ca68116 Make newIDE save project as formatted JSON 2017-12-10 23:03:16 +01:00
Florian Rival
de3677a6c3 Add AnimationPreview in SpriteEditor 2017-12-10 23:02:51 +01:00
Florian Rival
3b76dfe9f4 Fix LocalCordovaExport storybook and increase expression selector height 2017-12-09 20:08:23 +01:00
Florian Rival
6e38ee6d16 Move newIDE test files next to the test source files (no __tests__ folder) 2017-12-09 18:05:59 +01:00
Florian Rival
454657b00f Add link to Tank Shooter beginner tutorial in newIDE 2017-12-09 17:47:54 +01:00
Florian Rival
aad0c4e909 Fix newIDE yarn.lock 2017-12-09 17:27:53 +01:00
Florian Rival
d106ee9ac1 Merge pull request #421 from 4ian/feature/newide-expressions-autocomplete
Expression field with list of available functions for newIDE
2017-12-09 17:16:41 +01:00
Florian Rival
5b1e6e4381 Don't show ExpressionSelector when ExpressionField is displayed inline 2017-12-09 16:50:27 +01:00
Florian Rival
e1106c6145 Fix GenericExpressionField validation and functions button positioning 2017-12-07 00:33:42 +01:00
Florian Rival
0c5caf9986 Update StringField to use GenericExpressionField, with same features as ExpressionField 2017-12-07 00:22:59 +01:00
Florian Rival
2fdcd6c639 Fix formatting of expressions with code-only parameters 2017-12-07 00:04:56 +01:00
Florian Rival
8332adf07b [WIP] Fix Expression object/behavior functions formatting and BehaviorField 2017-12-06 23:43:20 +01:00
Florian Rival
fb40e908c0 [WIP] Add ExpressionParametersEditor to edit parameters of an expression to insert
TODO: Properly format objects and behaviors function calls.
2017-12-06 00:22:21 +01:00
Florian Rival
b6ef67568a [WIP] Add the function in the text field when an expression is chosen 2017-12-05 22:07:56 +01:00
Florian Rival
9c591ec3b1 [WIP] Add ExpressionSelector, refactor InstructionSelector and switched to lodash monolithic build 2017-12-04 21:49:31 +01:00
Lizard-13
495900c083 Add point inside object condition (#418)
* Add point inside object condition

* Update names and comments
2017-12-04 09:25:56 +01:00
Florian Rival
7874e2af27 [WIP] Add auto-completion to ExpressionField in newIDE 2017-12-04 00:03:46 +01:00
Florian Rival
19b37b7111 Update Electron latest stable version for newIDE 2017-12-03 22:53:01 +01:00
Florian Rival
8593249bc6 Add link to the Itch.io publishing help page 2017-12-03 12:28:11 +01:00
Florian Rival
6d483ec887 Update electron-builder and fix analytics send when exporting with Cordova in newIDE 2017-11-28 23:02:40 +01:00
Florian Rival
e1a28f0f90 Update newIDE readme 2017-11-28 00:43:22 +01:00
Florian Rival
c2ba76a821 Bump newIDE version 2017-11-28 00:40:40 +01:00
Florian Rival
c4f8134d89 Add Cordova and Cocos2d-JS exports in newIDE 2017-11-28 00:39:19 +01:00
Florian Rival
59416fd0cd Avoid clearing the output directory when exporting a HTML5 game 2017-11-27 23:58:15 +01:00
Florian Rival
ef7ed24114 Merge pull request #417 from 4ian/feature/open-scene-editor-on-open
Automatic opening of 1st scene in newIDE + Sprite frames selection/deletion
2017-11-27 22:12:16 +01:00
Florian Rival
07dd2bcb5c Add Checkbox to select sprites and context menu to delete selected sprites 2017-11-26 19:55:53 +01:00
Florian Rival
81dfeb3ab1 Open scene or project manager (according to layouts count) after project opening in newIDE 2017-11-24 20:08:38 +01:00
Florian Rival
09d558744f Refactor project opening in MainFrame and add test for StartPage 2017-11-24 19:54:09 +01:00
Florian Rival
abe7dd7ccd Adapt StartPage button when a project is opened 2017-11-24 08:39:06 +01:00
Florian Rival
0da624dc18 Fix variables with multiline values rendering in newIDE + add a storybook stories for this 2017-11-23 00:36:21 +01:00
Florian Rival
a082585b4e Don't make Game Settings initially opened in ProjectManager 2017-11-21 01:07:10 +01:00
Florian Rival
d1582723ba Fix hint text in ProjectPropertiesDialog 2017-11-21 01:06:07 +01:00
Florian Rival
829a88f290 Add ProjectPropertiesDialog, editor for global variables and minor fixes 2017-11-21 00:58:07 +01:00
Florian Rival
79f2e57fa9 Add ExternalEventsField, used to choose events to import in LinkEvent 2017-11-19 23:42:42 +01:00
Florian Rival
322787ba0e Merge pull request #416 from 4ian/feature/points-editor
Add Points editor
2017-11-19 20:53:27 +01:00
Florian Rival
7bd2dab47c Clean up PointsEditor and related 2017-11-19 20:38:59 +01:00
Florian Rival
dd1446cfb0 Add Toggles to have all animations/sprites sharing the same points in PointsEditor 2017-11-19 18:00:57 +01:00
Florian Rival
cf96db75ea Add HelpButton to ExportDialog 2017-11-19 15:47:08 +01:00
Florian Rival
da4f350cdb [WIP] Add points editor and hitboxes editor buttons in a SpriteEditor toolbar 2017-11-19 15:44:59 +01:00
Florian Rival
862c012bb6 [WIP] Ensure position of PointsEditor dialog remains centered after adding points 2017-11-19 15:26:18 +01:00
Florian Rival
72a65cb1d2 [WIP] Add default position handling for center point in PointsEditor 2017-11-19 02:30:25 +01:00
Florian Rival
22379ae31b [WIP] Add PointsPreview in PointsEditor
TODO: Properly handle automatic points
2017-11-19 01:39:18 +01:00
Florian Rival
73e0ba8264 Merge pull request #415 from Lizard-13/patch-1
Polygon fix
2017-11-18 16:20:15 +01:00
Lizard-13
2b0e28f456 Polygon fix
Just a little fix for an error it's throwing me (not sure how it doesn't fails for every convex polygon)  :)
2017-11-18 11:38:59 -03:00
Florian Rival
151a9b1a74 [WIP] Add ImageThumbnail in PointsEditor and a link to it in SpriteEditor 2017-11-17 00:29:55 +01:00
Florian Rival
172d7f049e [WIP] Improve PointsEditor 2017-11-16 00:14:49 +01:00
Florian Rival
5ef703eff4 [WIP] Add PointsEditor to edit the points of a Sprite in newIDE 2017-11-15 01:25:48 +01:00
Florian Rival
98d970de30 Add polyfill for self and patch XMLHttpRequest.send for Cocos2d-JS 3.15 and below 2017-11-14 23:32:49 +01:00
Florian Rival
8896fb280a Try to fix FontFace support in Edge/IE/Safari 2017-11-14 22:44:11 +01:00
Florian Rival
8df5ab9e62 Add a very basic Shopify extension (HTML5 only) to checkout products in a shop 2017-11-12 23:19:19 +01:00
Florian Rival
eb32d51999 Add Semaphore CI badge (quicker CI for newIDE and GDJS tests) 2017-11-12 19:34:57 +01:00
Florian Rival
8901809f88 Avoid potential issue with LayersList when project/layout props are changed 2017-11-12 18:16:37 +01:00
Florian Rival
1de22ef53b Ensure the proper tab is focused after opening, even when the tab is already opened 2017-11-12 01:48:47 +01:00
Florian Rival
d328ae0c7e Increase the width of the text field to set the font size in TextEditor 2017-11-12 01:32:20 +01:00
Florian Rival
dabb0f9dad Remove GDevApp link in README as it is replaced by newIDE 2017-11-12 01:24:10 +01:00
Florian Rival
5adcfc5bad Fix Flow error 2017-11-11 19:12:20 +01:00
Florian Rival
b03bf86a35 Add error messages when an expression is invalid in ExpressionField or StringField in newIDE 2017-11-11 18:33:49 +01:00
Florian Rival
db1b1eadf1 Refactor ExpressionParser and ParserCallbacks with getters for errors 2017-11-11 15:40:22 +01:00
Florian Rival
939266b18b Add more help buttons in newIDE and various minor fixes 2017-11-09 21:31:28 +01:00
Florian Rival
b68a9d8b47 Rename newIDE executable from GDevelop IDE to GDevelop 5 2017-11-09 20:51:05 +01:00
Florian Rival
af1a028203 Merge pull request #413 from 4ian/fix/react-mosaic-dragging
Fix dropping objects from ExternalEditor in newIDE due to react-mosaic blocking drop + help buttons and various small improvements
2017-11-09 00:14:38 +01:00
Florian Rival
c697d5fb99 Upgrade react-mosaic-component so that it does not conflict with HTML5/external drag'n'drop 2017-11-08 23:47:47 +01:00
Florian Rival
b5d2c6f4bc Add help for TextEntry and ShapePainter editors 2017-11-08 22:23:06 +01:00
Florian Rival
a42c488ac8 Add HelpButton that open wiki help page and add it in a few dialogs
Also add react-test-renderer for snapshot testing
2017-11-08 01:13:00 +01:00
Florian Rival
1ccc58c015 Change background color of ProjectStructureItem in ProjectManager 2017-11-07 23:54:19 +01:00
Florian Rival
68a736ea13 Remove Resources from newIDE ProjectManager as it's not implemented for now 2017-11-07 23:36:37 +01:00
Florian Rival
a9980f8e89 [WIP] Fix dropping objects from ExternalEditor in newIDE due to react-mosaic blocking drop 2017-11-07 23:33:11 +01:00
Florian Rival
7156950cb8 Fix InstancesList/LayersList not properly re-rendering due to bad rendering optimization 2017-11-07 00:02:42 +01:00
Florian Rival
833cabfe3b Use ListIcon instead of material-ui Avatar for icons of resources library in newIDE 2017-11-06 01:18:57 +01:00
Florian Rival
ed23b760a9 Add a dialog to choose an image from available public resources in newIDE web-app 2017-11-06 00:32:44 +01:00
Florian Rival
98580efafa Disable close button on StartPage tab in newIDE 2017-11-05 20:46:08 +01:00
Florian Rival
8794861a11 Fix properties panel not updated when selecting an instance 2017-11-05 20:33:49 +01:00
Florian Rival
8fccc7bda4 Add Fullstory for users behavior analytics 2017-11-05 20:11:49 +01:00
Florian Rival
a09ea0ea13 Enable user to scroll with mouse and space key pressed in SceneEditor in newIDE 2017-11-05 19:52:24 +01:00
Florian Rival
74c6ca50cb Merge pull request #412 from Nnarol/feature/scene_editor_undo_redo_keyboard_shortcuts
Bind Ctrl+Z/Ctrl+Y to undo/redo actions in scene editor
2017-11-03 13:43:16 +01:00
Florian Rival
67249c1029 Update flow for newIDE and add it to the CI 2017-11-03 00:16:53 +01:00
Florian Rival
dba79bcca1 Merge pull request #411 from 4ian/feature/scrollbars
Add scrollbars in newIDE scene editor
2017-11-03 00:14:02 +01:00
name
006f93dccf Bind Ctrl+Z/Ctrl+Y to undo/redo actions in scene editor 2017-11-02 23:42:14 +01:00
Florian Rival
94335b9ee2 Update react-mosaic-component for better perf. and avoid drop-target area that can't be clicked
This enables the horizontal scrollbar to be used
Also improves performance by avoiding rerendering of editors after a drag'n'drop
2017-11-02 23:31:44 +01:00
Florian Rival
187e27f232 Fix typo 2017-11-02 22:39:52 +01:00
Florian Rival
f7631bd8a5 [WIP] Add scrollbars to scene editor of newIDE 2017-11-02 22:29:44 +01:00
Florian Rival
ad154c34e7 Refactor full size editors handling in FullSizeMeasurer in newIDE 2017-11-01 23:36:55 +01:00
Florian Rival
357ecaca1e Merge pull request #410 from 4ian/feature/cancel-dialogs
"Cancel" button in more newIDE dialogs + newIDE unit tests
2017-11-01 23:24:22 +01:00
Florian Rival
e67e8d2264 Update libGD.js version used by newIDE 2017-11-01 23:23:47 +01:00
Florian Rival
c39fc5f478 Add more tasks to be done on newIDE 2017-11-01 00:35:31 +01:00
Florian Rival
b4c84d2058 Add explanation on how to contribute to newIDE 2017-11-01 00:30:08 +01:00
Florian Rival
b7cca91e54 Fix a button styling 2017-10-28 17:25:04 +02:00
Florian Rival
86118abfb3 Add Cancel button in ObjectEditorDialog 2017-10-28 17:14:10 +02:00
Florian Rival
119d588619 Fix Object behaviors and SpriteObject animations not properly unserialized with an exisiting object 2017-10-28 17:13:39 +02:00
Florian Rival
8c1028a28b Improve newIDE tests 2017-10-26 23:49:29 +02:00
Florian Rival
65e47a11ec Add unit tests support with Jest for newIDE 2017-10-26 23:23:39 +02:00
Florian Rival
c20a705773 Add SerializableObjectEditorContainer and use it to add cancel/apply buttons to ObjectsGroupEditorDialog 2017-10-25 01:05:30 +02:00
Florian Rival
bea778cb06 Remove warning in ObjectSelector and add stories to test it 2017-10-25 00:07:25 +02:00
Florian Rival
7315fe2403 Add undo/redo in context menus in EventsSheet 2017-10-24 23:55:36 +02:00
Florian Rival
ef4e0aba6b Implement History of undo/redo for EventsSheet 2017-10-24 23:11:01 +02:00
Florian Rival
7d84dda389 Bump newIDE version 2017-10-22 23:02:21 +02:00
Florian Rival
de1dab64fd Remove groups in the list of the ObjectSelector in ObjectsGroupEditor 2017-10-22 23:01:48 +02:00
Florian Rival
4333d8a3ba Change EventsSheet background color 2017-10-22 22:46:49 +02:00
Florian Rival
4579e619a3 Add search in newIDE ProjectManager 2017-10-22 22:43:12 +02:00
Florian Rival
7bcee7e400 Fix searching in groups in newIDE 2017-10-22 22:00:24 +02:00
Florian Rival
bf6ed92b1f Add search bar in ObjectsList and ObjectsGroupsList in newIDE 2017-10-22 21:39:55 +02:00
Florian Rival
87bffb4361 Add shortcuts and menu items to zoom in/out in newIDE scene editor 2017-10-22 18:34:47 +02:00
Florian Rival
151182c5aa Fix text fields losing focus when renaming in newIDE project manager/objects list 2017-10-22 18:09:52 +02:00
Florian Rival
faa678e4f7 Add menu item to create a new object in object context menu in newIDE 2017-10-22 17:50:58 +02:00
Florian Rival
6113505367 Add support for undo/redo shortcut in scene editor and ESC to close dialogs 2017-10-22 17:34:02 +02:00
Florian Rival
8eb124c685 Add tooltips in newIDE Toolbars and add react-i18n (unused for now) 2017-10-22 16:51:14 +02:00
Florian Rival
4fb2028801 Add tooltip support for ToolbarIcon in newIDE 2017-10-22 16:00:00 +02:00
Florian Rival
a5cc7de08f Fix potential errors in newIDE 2017-10-22 14:55:31 +02:00
Alexander Lebedev
8b0845fe9f Fix SoundObject conditions/actions strings (#408) 2017-10-22 12:44:42 +02:00
Florian Rival
e127d1bb7b Add .map file as part of the deployed newIDE web-app 2017-10-21 19:40:46 +02:00
Florian Rival
75ff956418 Add Raven (Sentry) for error tracking in newIDE 2017-10-21 17:21:20 +02:00
Florian Rival
90236f9c43 Add (common) KeyboardShortcuts for SceneEditor and EventsSheet in newIDE 2017-10-21 16:48:40 +02:00
Alexander Lebedev
c480ac2d8e Fix TopDownMovement behavior strings 2017-10-18 16:48:58 +02:00
Alexander Lebedev
793a242e00 Delete double spaces in some strings (#406) 2017-10-18 00:30:33 +02:00
ale26reg
16713e4668 Add volume and loop parameters in Play sound/music action strings (#399) 2017-10-15 23:51:22 +02:00
Florian Rival
33d731e958 Merge pull request #405 from 4ian/style/apply-prettier
Update prettier and apply it on the whole newIDE codebase
2017-10-15 17:51:52 +02:00
Florian Rival
4095b4b65b Update prettier and apply it on the whole newIDE codebase 2017-10-15 17:49:40 +02:00
Florian Rival
0a7778f951 Merge pull request #404 from 4ian/feature/contextmenu-instructions-list
Context menu for add condition/action buttons + keyboard shortcuts
2017-10-15 17:34:48 +02:00
Florian Rival
7c8c3e8a6a Display keyboard shortcuts in newIDE web-app, according to the platform 2017-10-15 17:31:44 +02:00
Florian Rival
26792429f7 Add keyboard shortcuts for Clipboard in EventsSheet 2017-10-15 16:42:26 +02:00
Florian Rival
50810aab1d Add support for pasting instructions in context menu of an instructions list 2017-10-15 16:31:11 +02:00
Florian Rival
8eeb137764 Add context menu for add condition/action buttons in EventsSheet 2017-10-15 15:49:34 +02:00
Todor Imreorov
ff2db6356e Fix newIDE Storybook (#403) 2017-10-14 18:44:20 +02:00
Todor Imreorov
c2eba4a0b0 Focus search box when opening InstructionTypeSelector (#396) 2017-10-12 23:34:19 +02:00
ale26reg
a289c0a521 Distinguish pitch angle from sound pitch II (#397)
Distinguish pitch angle from the sound tone in the strings of actions and conditions, including the names of actions and conditions in the event tree. Required for correct translation into other languages. All strings are reduced to a single style of writing.
2017-10-12 23:30:41 +02:00
ale26reg
2f5dd01878 Fix typo (#398) 2017-10-12 23:30:04 +02:00
Florian Rival
0a95120fbb Send analytics when a game is created in newIDE as a web-app 2017-10-09 23:41:46 +02:00
Florian Rival
60bf3115dd Add an anonymous UUID to users in analytics to help understanding user behaviors in newIDE 2017-10-09 23:32:21 +02:00
Lizard-13
d5f4a47eab Distinguish pitch angle from sound pitch condition strings (#394) 2017-10-08 19:21:08 +02:00
Florian Rival
e5bc6b3a13 Fix fonts in newIDE previews launched in browser 2017-10-08 19:20:15 +02:00
Florian Rival
4efe9e3d88 Update IDE translations 2017-10-08 17:37:19 +02:00
Florian Rival
869db14995 Update GD4 Inno Setup installation script 2017-10-08 17:17:25 +02:00
Florian Rival
9531d60479 Fix IDE crash on closing 2017-10-08 17:13:11 +02:00
Florian Rival
7d83fe8c07 Update IDE copyright date in status bar 2017-10-08 16:25:39 +02:00
Florian Rival
d285e24ff8 Add crossorigin attribute to img tags of objects thumbnails in newIDE to fix CORS issues 2017-10-08 12:16:04 +02:00
Florian Rival
09db74fc65 Add Space Shooter example in newIDE (both Electron and web-app) 2017-10-07 19:32:08 +02:00
Florian Rival
41be98b306 Add field to change text object font in newIDE 2017-10-07 19:31:29 +02:00
Florian Rival
46cb1318a5 Change insertion position of new events after the selection in newIDE 2017-10-07 17:09:01 +02:00
Florian Rival
1f98e4a268 Fix group renaming and made minor fixes in newIDE 2017-10-05 00:52:34 +02:00
Florian Rival
15f61e5867 Fix scene/external layout/events renaming 2017-10-04 22:02:53 +02:00
Florian Rival
698d3095ec Fix warning 2017-10-02 00:55:11 +02:00
Florian Rival
608ebcb0cf Add links to tutorial in newIDE CreateProjectDialog & fix minor UI glitches 2017-10-02 00:51:12 +02:00
Florian Rival
78c67a18e6 Add support for resources using URLs in newIDE running with Electron 2017-10-01 23:35:35 +02:00
Florian Rival
c12de11ce0 Ensure ObjectEditorDialog height is properly updated after a behavior is added/removed 2017-10-01 23:02:15 +02:00
Florian Rival
e15b442c1f Make newIDE's toolbar and StartPage scrollable 2017-10-01 22:40:52 +02:00
Florian Rival
f84cf59f9e Fix newIDE UI glitches 2017-10-01 22:08:52 +02:00
Florian Rival
b8aff5e77a Update newIDE PixiResourcesLoader to treat images as cross-origin 2017-10-01 20:47:51 +02:00
Florian Rival
9eb5951e66 Update URL of resources used by newIDE platformer fixture game 2017-10-01 19:03:48 +02:00
Florian Rival
cb92d56ff6 Fix ghost click with ListAddItem 2017-10-01 19:03:23 +02:00
Lizard-13
6223fbb792 Add JSON conversion for all variable types and clear structure action (#391) 2017-09-30 19:18:56 +02:00
Florian Rival
16bce2f765 Add OperatorField for newIDE, fix Text object rendering 2017-09-30 19:17:26 +02:00
Florian Rival
e2f5665700 Bump newIDE version 2017-09-27 22:21:31 +02:00
Florian Rival
c9b48ffafa Update LocalCreateDialog and fix extension filter when opening a project file 2017-09-26 23:01:40 +02:00
Florian Rival
a291d846d8 Enable flowtype annotation support for newIDE for VSCode 2017-09-26 22:57:13 +02:00
Florian Rival
0287d80cbf Merge pull request #390 from 4ian/feature/newIDE-groups-editor
Groups editor for newIDE
2017-09-24 16:22:52 +02:00
Florian Rival
97ea23066a Fix ObjectEditorDialog positioning when adding animations to Sprite objects 2017-09-24 16:12:32 +02:00
Florian Rival
e9b8b79d76 Refactor ObjectField to use ObjectSelector 2017-09-24 13:40:23 +02:00
Florian Rival
44133370bd Add ListAddItem to factor add rows in lists, add explanation in ObjectsGroupEditor 2017-09-24 13:27:30 +02:00
Florian Rival
e1e1fe27ae Update toolbar ObjectsGroupEditor icon and list borders 2017-09-24 03:00:02 +02:00
Florian Rival
b426212496 Add ObjectGroupsContainer in GDCore and improve groups edition in newIDE 2017-09-23 21:28:29 +02:00
Florian Rival
940721c676 [WIP] Add ObjectsGroupsList to newIDE 2017-09-23 15:42:31 +02:00
ale26reg
c3118e8da3 Update AudioExtension.cpp (#388)
Fixed misspelling at #366
2017-09-20 22:06:40 +02:00
ale26reg
a9e4d8a606 Update Extension.cpp (#389) 2017-09-20 17:18:35 +02:00
Florian Rival
e5e46d0a5a Add light grey border on bottom of most events in newIDE 2017-09-20 00:11:10 +02:00
Florian Rival
eed3c7ef36 Merge pull request #387 from 4ian/feature/newide-fold-events
Events folding and fixes for newIDE
2017-09-19 23:18:29 +02:00
Florian Rival
a6e0853cd6 Update Wiki link in new IDE 2017-09-19 23:17:47 +02:00
Florian Rival
1dff23f201 Fix GDJS export broken after output directory refactoring 2017-09-19 23:17:31 +02:00
Florian Rival
0586150eaf Add support for events folding in newIDE EventsSheet 2017-09-17 01:58:29 +02:00
Florian Rival
c43d6231d7 Add dialogs to edit scene, objects and global variables 2017-09-17 00:13:15 +02:00
Florian Rival
56230096b3 Update README with web-app deployment instructions 2017-09-16 18:11:50 +02:00
Florian Rival
29e707704e Reduce newIDE bundle size by switching from slug to slugs (no unicode file to be embedded) 2017-09-16 17:59:13 +02:00
Florian Rival
33b417ac94 Add .clang_complete file for Clang autocompletion 2017-09-16 17:21:13 +02:00
Florian Rival
0069627801 Add properties files for Visual Studio Code 2017-09-16 17:20:57 +02:00
Florian Rival
0d3c6ee590 Merge pull request #383 from 4ian/feature/browser-demo-merged-master
Browser support for newIDE
2017-09-12 23:59:12 +03:00
Florian Rival
7c2e3d43be Add KeyField 2017-09-12 22:49:54 +02:00
Florian Rival
3dcd6e2803 Add LayerField to EventsSheet 2017-09-11 17:44:15 +03:00
Florian Rival
689b2ba5c3 Add *VariableField for EventsSheet 2017-09-11 17:32:53 +03:00
Florian Rival
f67ba78843 Add BehaviorField for EventsSheet 2017-09-11 16:43:33 +03:00
Florian Rival
6aa515d085 Merge branch 'master' into feature/browser-demo-merged-master 2017-09-10 00:18:09 +03:00
Florian Rival
557aff7534 Switch to ChromeHeadless for running GDJS tests 2017-09-09 23:45:18 +03:00
Florian Rival
59e11d8597 Open context menu when right-clicking (or long touch) on objects/items in lists 2017-09-07 18:54:36 +02:00
Florian Rival
26de1ae213 Limit height of auto-complete menu when choosing an object 2017-09-07 18:16:59 +02:00
Florian Rival
dc32f948da Add thin borders to separate list items in newIDE 2017-09-07 18:02:45 +02:00
Florian Rival
50768df001 Add support for display comments custom color in newIDE 2017-09-07 17:24:57 +02:00
Florian Rival
4b375b01ac Remove S3 access keys from sources for newIDE in-browser preview 2017-09-05 21:05:30 +02:00
Florian Rival
c1b02677f3 Change newIDE Platformer builtin game first scene name to "Scene 1" 2017-08-30 00:58:31 +02:00
Florian Rival
eb8cf8028f Bump newIDE version 2017-08-30 00:36:47 +02:00
Florian Rival
b80f2b566d Add dialog shown if unable to open a preview popup in browser for newIDE 2017-08-30 00:36:11 +02:00
Florian Rival
748c798172 Add explanation about Export in newIDE for browsers 2017-08-29 23:51:43 +02:00
Florian Rival
83472388f4 Add BrowserSaveDialog enabling to download the game being edited in Browser 2017-08-29 23:42:19 +02:00
wild-master
34f1c5ae49 Add more improvements to the English translation. (#376) 2017-08-29 10:56:06 +02:00
Florian Rival
37732928cb Fix popup blocking when opening a preview on browser in newIDE 2017-08-28 23:14:19 +02:00
Florian Rival
2a6b7f194f Add Facebook/Twitter buttons on newIDE start page 2017-08-28 22:57:09 +02:00
wild-master
0f4d73fae3 English translation improvements (#375) 2017-08-28 22:04:16 +02:00
Florian Rival
906fceeb9a Add scripts to deploy newIDE as a web-app 2017-08-26 18:26:34 +02:00
Florian Rival
e616d668f3 Add BrowserIntroDialog 2017-08-26 17:32:53 +02:00
Florian Rival
05baedfd5d Add complete BehaviorsEditor to edit/add/remove object behaviors in newIDE 2017-08-26 17:32:53 +02:00
Florian Rival
5bf3c26b35 Avoid a crash when creating AdMobRuntimeObject or changing layer/z-order 2017-08-26 17:32:53 +02:00
Florian Rival
59d53c63b9 Update ExporterHelper::ExportIncludesAndLibs to be compatible minification and potential URL filenames 2017-08-26 17:32:53 +02:00
Florian Rival
e1a3409702 Add BrowserCreateDialog and BrowserProjectOpener to open builtin projects 2017-08-26 17:32:53 +02:00
Florian Rival
f320f34b19 Implement internal, in memory Clipboard for browsers 2017-08-26 17:32:02 +02:00
Florian Rival
f723182b80 Fix context menu closing and menu item size on browsers 2017-08-26 17:32:02 +02:00
Florian Rival
c0c71faac6 Fix extra / when exporting with BrowserS3PreviewLauncher 2017-08-26 17:32:02 +02:00
Florian Rival
5f73fa30fb Fix window contextmenu on browsers 2017-08-26 17:32:02 +02:00
Florian Rival
edbcb32bec [WIP] Fix Exporter and BrowserS3PreviewLauncher 2017-08-26 17:32:02 +02:00
Florian Rival
f57d3edf0f [WIP] Update GDJS Exporter to properly export files when having URL 2017-08-26 17:32:02 +02:00
Florian Rival
71ab16a76e [WIP] Add Extensions/ prefix to all includes files for JS extensions 2017-08-26 17:32:02 +02:00
Florian Rival
7b81ddd877 [WIP] Added AWS S3 calls to create file when launching a preview from newIDE in a browser 2017-08-26 17:32:02 +02:00
Florian Rival
de50a90235 [WIP] Started adding BrowserS3PreviewLauncher 2017-08-26 17:32:02 +02:00
Florian Rival
536b353a24 [WIP] Add SetCodeOutputDirectory to GDJS Exporter 2017-08-26 17:32:01 +02:00
Florian Rival
72740fb62c Fix potential crash happening when rendering after unmounting InstancesEditorContainer 2017-08-26 17:32:01 +02:00
Florian Rival
de3f485191 Fix buttons in StartPage not opening in a new tab/default browser 2017-08-26 17:31:28 +02:00
Vagner Araujo
68738d343c Add "GDevelop Forum" and "GDevelop Wiki" buttons (#372) 2017-08-25 00:41:24 +02:00
Florian Rival
c0529ff5ab Merge pull request #371 from dos1/howler-cordova
howler-sound-manager: pause/resume sounds when Cordova app is being paused/resumed
2017-08-20 23:39:48 +02:00
Sebastian Krzyszkowiak
4904627a6c howler-sound-manager: pause/resume sounds when Cordova app is being paused/resumed 2017-08-20 23:09:40 +02:00
Florian Rival
d00dae1d9e Add empty group tab in ObjectEditorDialog with placeholder message for now 2017-08-20 18:31:09 +02:00
Florian Rival
5270b2bd73 Add gd::InstructionsList::InsertInstructions and instructions copy/paste in newIDE 2017-08-20 18:00:57 +02:00
Florian Rival
916acf16f7 Fix serialization of layout when newIDE is integrated in IDE 2017-08-20 17:22:59 +02:00
Florian Rival
ceb8b4dde1 Merge serialization methods for instructions and add serialization methods to InstructionsList 2017-08-20 17:22:23 +02:00
Florian Rival
577fa8bdf7 Merge pull request #370 from 4ian/feature/new-ide-events-editor
Events editor for newIDE
2017-08-20 12:50:05 +02:00
Florian Rival
ff131165f4 Close editors after renaming a layout/external layout/events to avoid errors 2017-08-20 12:43:06 +02:00
Florian Rival
4b45b8d7e4 Fix sometime incorrect events height computation due to image loading in EventsTree 2017-08-19 14:40:37 +02:00
Florian Rival
8431b10a81 Fix bad font while dragging an item (animations etc) 2017-08-17 23:21:49 +02:00
Florian Rival
1b14519223 Implement renaming for scenes, external layouts and external events 2017-08-17 23:11:14 +02:00
Florian Rival
5b3526b7e8 Add help messages in ProjectManager and reduce row height in ObjectsList 2017-08-17 22:48:23 +02:00
Florian Rival
b59a2b656f Add buttons to choose the scene to associate with external layout/events 2017-08-17 00:34:20 +02:00
Florian Rival
70516b1d88 Fix getSerializedElements for newIDE's ExternalLayoutEditor and SceneEditor integrated in IDE 2017-08-16 23:56:05 +02:00
Florian Rival
d73ed4f6f9 Fix WhileEvent context menu, Link selectable zone and add buttons in ProjectManager 2017-08-15 19:58:33 +02:00
Florian Rival
d58190e5c5 Add LayoutChooseDialog and menu to delete scenes/external layouts/events 2017-08-15 19:39:45 +02:00
Florian Rival
1b996623f8 Fix snap to grid not properly computed with a grid offset in InstancesEditor 2017-08-15 17:44:51 +02:00
Florian Rival
09294dbc07 Add filtering in ObjectField, add ExpressionField and StringField (not autocompletion) 2017-08-15 00:54:54 +02:00
Florian Rival
1b27ca9647 Add invert condition toggle & ensure events editor is not opened when newIDE is integrated in IDE 2017-08-14 23:27:55 +02:00
Florian Rival
891a81f53e Increase sleeping time of thread communicating between IDE and newIDE 2017-08-14 23:27:14 +02:00
Florian Rival
ceb7d80ed3 Ensure EventsSheet is remounted if events have changed 2017-08-14 21:37:01 +02:00
Florian Rival
2591efee1c Merge branch 'feature/new-ide-culling' into feature/new-ide-events-editor 2017-08-10 14:17:12 +01:00
Florian Rival
adc473a6c3 [WIP] Add copy/cut/paste for events in EventsSheet 2017-08-08 16:29:21 +02:00
Florian Rival
8f6e587a0d Add LinkEvent support to newIDE 2017-08-04 01:23:36 +02:00
Florian Rival
597f1d0ebb Improve GroupEvent, CommentEvent rendering and inline edition 2017-08-04 00:59:57 +02:00
Florian Rival
c3746ab388 Add RepeatEvent, WhileEvent and support for sub instructions in newIDE EventsSheet 2017-08-03 20:56:30 +02:00
Florian Rival
7f5711cb62 [WIP] Add InlinePopover and popover to edit ForEachEvent in newIDE 2017-08-03 18:57:37 +02:00
Florian Rival
eb066b88e2 [WIP] Add ForEachEvent in newIDE (read-only for now) 2017-08-03 18:01:02 +02:00
Florian Rival
22fe36c8b5 [WIP] Move newIDE editors to a single folder, add preview button in EventsSheet 2017-08-03 17:52:05 +02:00
Florian Rival
cdf9652934 [WIP] Add search in InstructionEditor and fix instruction edition 2017-08-03 13:56:22 +02:00
Florian Rival
aa5408b1fb [WIP] Implement selection deletion and add subevents in EventsSheet 2017-08-02 23:16:15 +02:00
Florian Rival
facb08e502 [WIP] Add InlineParameterEditor to EventsSheet 2017-08-02 18:07:49 +02:00
Florian Rival
111dc42ec9 [WIP] Add multiselection and parameters highlight in EventsSheet, update events styling 2017-08-02 14:56:04 +02:00
Florian Rival
b08759bf57 [WIP] Add selection handling in EventsSheet 2017-08-02 01:57:40 +02:00
Florian Rival
a89b196a0c [WIP] Tweak events look 2017-08-02 00:52:44 +02:00
Florian Rival
1efa8674fc [WIP] Prevent drag'n'dropping events on events that can't have sub-events 2017-08-02 00:16:31 +02:00
Florian Rival
9ed2aa2a70 [WIP] Improve InstructionEditor 2017-08-02 00:06:15 +02:00
Florian Rival
26aa52157a [WIP] Add ParametersFields to newIDE InstructionEditor, enable to add/edit instructions 2017-08-01 21:05:53 +02:00
Florian Rival
825c3e0d26 [WIP] Add toolbar to EventsSheet 2017-08-01 16:34:09 +02:00
Florian Rival
1f2de9f156 [WIP] Refactor events in different files and enable Comment event editing 2017-08-01 13:51:52 +02:00
Florian Rival
bb52fab95a [WIP] Improve EventsTree, refactor events height caching 2017-08-01 13:15:10 +02:00
Florian Rival
e1c9db4955 [WIP] Add style of events 2017-08-01 01:42:52 +02:00
Florian Rival
cf9d9bdd5c [WIP] Apply codemod to convert calls to React.createElement into JSX elements 2017-08-01 01:42:52 +02:00
Florian Rival
41f6d8164c [WIP] Add EventsTree 2017-08-01 01:42:51 +02:00
Florian Rival
31c741b8c6 Bump newIDE version 2017-07-31 00:13:54 +02:00
Florian Rival
8619f18b93 Add basic culling for rendered instances in newIDE 2017-07-29 17:41:22 +02:00
Florian Rival
fd466d1f57 Fix wrong rendered position of panelspriteruntimeobject with Pixi renderering 2017-07-29 01:46:13 +02:00
Florian Rival
0c688e714a Fix DependenciesAnalyzer not properly exposed in GDCore.dll on Windows 2017-07-25 22:48:39 +02:00
Florian Rival
dd7a4429be Bump newIDE version 2017-07-23 18:27:05 +02:00
Florian Rival
8ed7e8251a Don't show menu in ProjectManager in newIDE when running with Electron 2017-07-23 16:59:34 +02:00
Florian Rival
6bcca6d024 Add main menu for newIDE 2017-07-23 16:49:07 +02:00
Florian Rival
3c6b100188 Enable context menu in text inputs in newIDE 2017-07-23 15:29:32 +02:00
Florian Rival
24cd4b52f6 Fix include case mismatch in AndroidExporter 2017-07-19 00:05:12 +02:00
Florian Rival
f63a8fc36e Refactor ProjectManager items to allow to make style changes between item and nested items 2017-07-18 23:02:27 +02:00
Florian Rival
70f6aab913 Add newIDE MessageBox to have better system integration and error analytics 2017-07-18 22:36:21 +02:00
Florian Rival
4c12ad5f1d Bump newIDE version 2017-07-18 22:10:06 +02:00
Florian Rival
6d5e4e388f Merge pull request #359 from 4ian/feature/new-ide-object-editors
Add object editors for newIDE, buttons to add, remove, name objects and objects list sorting
2017-07-18 21:58:09 +02:00
Florian Rival
415b05b1dc Add message when an animation is renamed with the same name as another 2017-07-18 21:50:07 +02:00
Florian Rival
78e2f8d705 Factor properties management in PropertiesMapToSchema and update TextEditor toolbar design 2017-07-18 21:34:27 +02:00
Ryan Jentzsch
7b0fb791cb Add instructions on running the newIDE as an Electron app from Linux. (#364) 2017-07-18 21:15:31 +02:00
Florian Rival
bd993b2c43 [WIP] Add AdMobEditor and factor properties edition in PropertiesEditor 2017-07-18 01:25:30 +02:00
Florian Rival
6a8e15a07f Add ShapePainterEditor and EmptyEditor in newIDE and rework Column margins 2017-07-18 00:30:38 +02:00
Florian Rival
fa6033250c [WIP] Add Behavior tab to newIDE ObjectEditorDialog 2017-07-16 23:59:22 +02:00
Florian Rival
b176699827 Implement drag'n'drop in newIDE ObjectsList to make objects sortable 2017-07-16 22:54:20 +02:00
Florian Rival
3bf0a14951 Avoid flickering while resizing InstancesEditorContainer in newIDE 2017-07-16 14:39:54 +02:00
Florian Rival
0c380629d5 [WIP] Improve newIDE ObjectsList to make it sortable 2017-07-16 14:39:33 +02:00
Florian Rival
79f756a6f1 Add button to add a new scene and fix various minor bugs in newIDE 2017-07-15 16:27:51 +02:00
Lizard-13
d35edb72b2 Add some tests for gdjs.Variable (#362) 2017-07-15 15:49:55 +02:00
Florian Rival
cc9851b49c Make objects list displayed in a draggable panel in newIDE 2017-07-15 14:56:07 +02:00
Florian Rival
369bcfdda5 Make Properties panel draggable 2017-07-14 20:38:42 +02:00
wild-master
c0e8f9e2a1 Fixed link to GDevelop.js (#363)
It was leading to a 404 page
2017-07-14 18:19:59 +02:00
Florian Rival
7223da00b7 Add ResourceSelectorWithThumbnail in newIDE and use it in Panel/TiledSpriteEditor 2017-07-12 22:01:26 +02:00
Lizard-13
0987ca8b3e Fix GDJS CopyRuntimeToGD script on Windows when using path with spaces
Fix xcopy crashes with an "Invalid number of parameters" error
2017-07-12 00:15:21 +02:00
Florian Rival
a886049f72 Refactor project when renaming/deleting object in newIDE 2017-07-09 17:11:08 +02:00
Florian Rival
168f06b535 Use WholeProjectRefactorer to refactor project after object renaming/deletion in IDE 2017-07-09 14:06:58 +02:00
Florian Rival
def81b6a62 Move DependenciesAnalyzer to GDCore and added WholeProjectRefactorer 2017-07-09 13:28:45 +02:00
Florian Rival
311e451a2f Allow any Event to dependencies to source files (only used by CppCodeEvent for now)
This is to avoid casting events to CppCodeEvent (and so relying explicitly on them) when doing dependencies analysis.
2017-07-04 22:59:03 +02:00
Florian Rival
8c7b4cc7bd Add npm run storybook command in README. 2017-07-03 23:01:48 +02:00
Lizard-13
2494f984a9 Fix numeric variable detection and initialisation in GDJS 2017-07-03 22:06:39 +02:00
Florian Rival
cec0ca0b71 Refactor project saving/opening in LocalProject[Writer/Opener] 2017-07-02 23:12:26 +02:00
Florian Rival
a262cebdfb [WIP] Implement delete/rename object in ObjectsList *without* refactoring of the rest of the game 2017-07-02 22:40:07 +02:00
Florian Rival
49145136d8 [WIP] Add NewObjectDialog to choose an object to create in a scene 2017-07-02 15:04:05 +02:00
Florian Rival
9e01231334 Fix description of objects not properly displayed 2017-07-02 14:43:25 +02:00
Florian Rival
0d869b9f7b Add ObjectsList in storybook 2017-07-02 12:47:41 +02:00
Florian Rival
ad333dff69 [WIP] Improve object editors 2017-07-01 18:19:04 +02:00
Florian Rival
16ae5dd0aa [WIP] Enhance SpriteEditor with images, drag'n'drop support 2017-07-01 00:27:15 +02:00
Florian Rival
f778f4302b Fix rendering error with cocos2d-JS 3.15.1 in gdjs.LayerCocosRenderer 2017-06-27 23:26:57 +02:00
Florian Rival
f948fd14a4 [WIP] Started SpriteEditor for newIDE 2017-06-27 22:56:02 +02:00
Florian Rival
9d05dbdd42 [WIP] Add PanelSpritEditor and LocalResourceSources 2017-06-22 23:51:18 +02:00
Florian Rival
9fbc4613ac Merge pull request #355 from mattiascibien/patch-1
Fixed link to GDevelop.js
2017-06-21 11:18:53 +02:00
Mattias Cibien
13bb7b1209 Fixed link to GDevelop.js
The link to [core C++ classes compiled to Javascript](https://github.com/4ian/GDevelop.js) has been fixed as it lead to a 404.
2017-06-21 10:15:06 +02:00
Florian Rival
70cbe5156e [WIP] Add editors for TiledSpriteObject and TextObject in newIDE 2017-06-20 23:25:32 +02:00
Florian Rival
6933030bcf Update material-ui to 0.18.3 2017-06-19 22:11:33 +02:00
Florian Rival
39f5aad915 Merge pull request #353 from Lizard-13/patch-1
Fix Text Entry crash on HTML5
2017-06-19 09:26:13 +02:00
Florian Rival
64dcfeec09 Add a screenshot of newIDE integrated inside IDE 2017-06-18 17:45:20 +02:00
Florian Rival
aeea9c9f57 Allow both Control and Meta key to be used in newIDE InstancesEditor 2017-06-18 15:21:53 +02:00
Florian Rival
0d0ce7d44d Enable variables to be re-order with drag'n'drop in VariablesList in newIDE 2017-06-18 12:51:33 +02:00
Lizard-13
525ea4b042 Fix Text Entry crash on HTML5
As the text entry object has no real renderable object, PIXI (only tested this renderer) crash trying to set the renderable object on Z-Order and Layer updates, a better solution is welcomed :)
2017-06-17 14:37:07 -03:00
Florian Rival
7dbd836073 Refactor [Add]VariableRow out of VariablesList 2017-06-17 18:40:16 +02:00
Florian Rival
a6f6729b88 Fix version of libGD.js used by newIDE 2017-06-17 17:50:10 +02:00
Florian Rival
d4e290cfed Fix Base Layer display in LayersList in newIDE 2017-06-17 17:46:58 +02:00
Florian Rival
17ea67c2a9 Enable layers to be re-order using drag'n'drop in newIDE 2017-06-17 17:28:05 +02:00
Florian Rival
cf436333b9 Factor out LayerRow in LayersList 2017-06-17 00:54:49 +02:00
Florian Rival
a77aa15c5e Add newIDE version in AboutDialog 2017-06-17 00:28:03 +02:00
Florian Rival
cef7acc1c4 Update newIDE version to 5.0.0-beta1 and disable ObjectsList menu if not implemented 2017-06-14 00:40:55 +02:00
Florian Rival
91a84eb000 Add analytics to export dialogs in newIDE 2017-06-13 22:46:47 +02:00
Florian Rival
a09221e4a3 Add BetaIntroDialog and unfinished LocalMobileExport to newIDE 2017-06-13 22:22:14 +02:00
Florian Rival
99452c2de0 Add Keen.io Analytics to newIDE 2017-06-11 23:00:45 +02:00
Florian Rival
14244a4561 Add a placeholder message in newIDE EventsEditor while it is not finished 2017-06-11 21:25:42 +02:00
Florian Rival
1c47bbfb36 Ensure newIDE is updated when an object is added in IDE 2017-06-11 19:19:51 +02:00
Florian Rival
7e16ea1aa3 Hide preview/add object button in newIDE when integrated and refactor newIDE toolbar 2017-06-11 18:13:09 +02:00
Florian Rival
16e4df182d Fix toolbar not updated when an editor was closed in newIDE 2017-06-11 17:37:54 +02:00
Florian Rival
1d81690bd5 Add postinstall task to automatically launch npm install in newIDE/electron-app/app 2017-06-11 17:37:20 +02:00
Florian Rival
4980db392b Fix bad height of InstancesEditor when tabs were hidden (i.e when newIDE integrated in IDE) 2017-06-09 00:00:21 +02:00
Florian Rival
2a99dc6e8a Fix drop from an external source (like objects from the IDE) in newIDE 2017-06-08 23:53:13 +02:00
Florian Rival
d4898c56f8 Fix LocalFolderPicker not modifiable with keyboard in newIDE 2017-06-08 22:52:44 +02:00
Florian Rival
dee9442eb6 Improve LocalCreateDialog 2017-06-05 12:18:05 +02:00
Florian Rival
1bb74af465 Add AboutDialog in newIDE 2017-06-05 00:50:31 +02:00
Florian Rival
f990dacf65 Fix newIDE build and LocalExamplesFinder on Windows 2017-06-04 12:56:15 +02:00
Florian Rival
4630ff9d07 Fix minor things in README 2017-06-03 19:23:02 +02:00
Florian Rival
06c4377141 Merge pull request #347 from 4ian/new-ide
Experimental new IDE (scene editor only) based on React, Emscripten, Electron and Pixi.js
2017-06-03 19:21:23 +02:00
Florian Rival
4e6fb68e39 Update/enhance READMEs and update licenses 2017-06-03 19:17:45 +02:00
Florian Rival
e307505d03 Add scripts to copy GDJS Runtime/Extensions for newIDE and adapted build scripts 2017-06-03 17:48:03 +02:00
Florian Rival
f7cfd21c48 Add newIDE examples directory to the list of resources copied when bundling 2017-06-02 00:45:32 +02:00
Florian Rival
e68e9d27bb Add a basic project creation dialog for newIDE and the platformer example in resources 2017-06-02 00:26:15 +02:00
Florian Rival
30a8c5be34 Fixes for newIDE on Windows 2017-06-02 00:13:35 +02:00
Florian Rival
3265ac5b6d Fix LocalGDJSFinder to properly find path after build 2017-05-27 19:01:30 +02:00
Florian Rival
6a7d1eaf2e Add LocalS3Export to newIDE to automatically upload the game to a S3 bucket 2017-05-27 12:50:13 +02:00
Florian Rival
cd587ba8da Add platformer template as fixture for newIDE 2017-05-26 12:52:31 +02:00
Florian Rival
35f640c1ba Improve ExportDialog design and modularity 2017-05-26 12:21:21 +02:00
Florian Rival
2f88ab5178 Add confirmation dialog after export 2017-05-26 11:08:34 +02:00
Florian Rival
18f9b66615 [WIP] Improve PIXI export and preview in newIDE 2017-05-25 13:45:48 +02:00
Florian Rival
ae49eb02c4 [WIP] Add Pixi export to newIDE 2017-05-22 00:18:43 +02:00
Florian Rival
e215654bb3 Update GDJS::Exporter to allow specify GDJS folder used to copy runtime files 2017-05-22 00:17:55 +02:00
Florian Rival
3feae8c257 Update newIDE favicon 2017-05-21 22:10:29 +02:00
Florian Rival
6f4abd3eb9 Add open, save, close project buttons to newIDE and project manager icons 2017-05-21 22:10:10 +02:00
Florian Rival
6ea781533b Add manifest and service worker to turn newIDE in a Progressive Web App 2017-05-21 16:48:59 +02:00
Florian Rival
456fdc0872 Updated newIDE to react-scripts 1.0.1 2017-05-20 17:46:15 +02:00
Florian Rival
f76a531143 Suppress a warning 2017-05-20 16:46:03 +02:00
Florian Rival
151271c250 Fix improper re-mounting of editors in newIDE when closing a tab, add text ellipsis in tabs 2017-05-20 16:40:27 +02:00
Florian Rival
22dea528e0 Save/use zoom level from LayoutEditorCanvasOptions in newIDE 2017-05-20 15:43:26 +02:00
Florian Rival
045f7194b5 Refactor newIDE tab handling 2017-05-18 23:02:22 +02:00
Florian Rival
51007bc5cd Add newIDE StartPage, Storybook for rapid development and update newIDE README 2017-05-18 22:07:55 +02:00
Florian Rival
612439a88d [WIP] Improve newIDE tabs, add closing, only show tabs if editor is not integrated into IDE 2017-05-17 00:47:14 +02:00
Florian Rival
f145ecd7b3 [WIP] Add tabs to MainFrame in newIDE 2017-05-14 17:37:02 +02:00
Florian Rival
cf7a39537d [WIP] Refactor newIDE ExternalEditor and boot 2017-05-13 14:41:22 +02:00
Florian Rival
23736e8981 [WIP] Add color picker in ScenePropertiesDialog of newIDE 2017-05-13 12:13:19 +02:00
Florian Rival
d633b032f9 [WIP] Fix 100% cpu usage by ExternalEditorBridge in IDE 2017-05-09 22:06:54 +02:00
Florian Rival
13050967c7 [WIP] Add Edit object menu in newIDE, opening object editors of IDE 2017-05-09 22:02:48 +02:00
Florian Rival
eeaab6d12f [WIP] Fix context menu freezing newIDE rendering 2017-05-06 17:43:06 +02:00
Florian Rival
c728044260 [WIP] Allow user to rename layers in LayersList in newIDE 2017-04-29 18:59:45 +02:00
Florian Rival
89a80c685f [WIP] Add clipboard support to InstancesFullEditor for newIDE 2017-04-29 17:34:09 +02:00
Florian Rival
ec7673d861 Add SerializeTo/UnserializeFrom to InitialInstance 2017-04-29 15:41:55 +02:00
Florian Rival
f50940ae66 [WIP] Improve InstancePropertiesEditor buttons 2017-04-29 01:11:47 +02:00
Florian Rival
664db415c7 [WIP] Add EditorMosaic and improve InstancePropertiesEditor to allow resizing by user 2017-04-29 00:48:52 +02:00
Florian Rival
5810972a2d [WIP] Update missing dependency for newIDE 2017-04-28 00:31:17 +02:00
Florian Rival
4d5fd7d3d4 Fix typo in ExpressionParser ("excepted" instead of "expected") 2017-04-28 00:30:14 +02:00
Florian Rival
f12c9c9ad8 [WIP] Add ScenePropertiesDialog to edit the window title in newIDE 2017-04-17 18:36:46 +02:00
Florian Rival
a144258f8d [WIP] Add context menu to InstancesEditor 2017-04-15 17:31:51 +02:00
Florian Rival
6907cc3847 [WIP] Fix font on first rendering of RenderedTextInstance in newIDE 2017-04-15 17:23:23 +02:00
Florian Rival
5f367f7278 [WIP] Add loader while newIDE is loading 2017-04-15 17:11:36 +02:00
Florian Rival
73b7523dc6 [WIP] Fix newIDE native menu positioning and improper hiding when integrated in the IDE 2017-04-12 23:26:51 +02:00
Florian Rival
8eac4b616f [WIP] Fix newIDE positioning 2017-04-11 00:08:25 +02:00
Florian Rival
ea2a05cfff [WIP] Fix newIDE positioning inside IDE on Windows with hi-dpi screens 2017-04-10 23:47:34 +02:00
Florian Rival
d307be6d0e [WIP] Add Windows specific fixes to newIDE 2017-04-10 00:21:03 +02:00
Florian Rival
a7aa1f3940 [WIP] Save undo history when an instance is deleted/moved in newIDE 2017-04-09 19:33:50 +02:00
Florian Rival
ef879413d9 [WIP] Fix layer rendering in newIDE after layers are modified 2017-04-09 18:55:38 +02:00
Florian Rival
e3eacb53ee [WIP] Allow newIDE to send changes made to layers to IDE 2017-04-09 18:12:39 +02:00
Florian Rival
3db6edb1f8 [WIP] Ensure update are sent to newIDE when object/layers are changed 2017-04-09 16:53:36 +02:00
Florian Rival
3636d99b47 [WIP] Add support for dropping objects in newIDE to add an instance 2017-04-06 00:20:23 +02:00
Florian Rival
56caeaaf08 [WIP] Fix font loading in newIDE 2017-04-05 23:22:19 +02:00
Florian Rival
a507f7a3ee Rename GetAssociatedLayoutEditorCanvasOptions to GetAssociatedSettings 2017-04-04 18:45:25 +02:00
Florian Rival
316e01e7f8 Merge branch 'master' into new-ide 2017-04-04 00:37:41 +02:00
Florian Rival
134efa8ec3 Merge branch 'master' into new-ide 2017-04-04 00:31:39 +02:00
Florian Rival
85b75b646f Fix centerCamera and centerCameraWithinLimits for HTML5 games 2017-04-04 00:30:16 +02:00
Florian Rival
09b41fa719 [WIP] Only send updates to newIDE when objects/layers have changed 2017-04-04 00:26:21 +02:00
Florian Rival
f970352faa [WIP] Add select field to choose a layer in InstancePropertiesEditor 2017-04-03 22:03:14 +02:00
Florian Rival
76305ae77c [WIP] Add horizontal/vertical resize handle to newIDE and appropriate cursors 2017-04-03 00:42:53 +02:00
Florian Rival
6c995d6d20 [WIP] Add WindowMask to newIDE 2017-04-02 17:23:24 +02:00
Florian Rival
3d14c9e555 [WIP] Add option to skip app building in electron build script of newIDE 2017-04-02 16:52:49 +02:00
Florian Rival
f8fa933a02 [WIP] Enhance integration of newIDE in ExternalLayoutEditor 2017-04-02 15:41:13 +02:00
Florian Rival
fff2edc1c1 [WIP] Rename ForceRefreshRibbonAndConnect to EditorDisplayed 2017-04-01 16:29:40 +02:00
Florian Rival
190ad686f5 [WIP] Improve newIDE integration into IDE 2017-04-01 16:03:05 +02:00
Florian Rival
f4b5d57c61 [WIP] Make newIDE scripts portable by using shelljs 2017-03-27 00:33:29 +02:00
Florian Rival
fdec778d04 [WIP] Add WindowBorder to InstancesEditor of newIDE 2017-03-21 01:02:00 +01:00
Florian Rival
c227afd8d7 [WIP] Fix newIDE InstancesList rendering when opened after being frozen and avoid potential crashes 2017-03-20 23:52:55 +01:00
Florian Rival
2f91fecd60 [WIP] Fix newIDE crash/freeze with ObjectsList accessing invalid data after project update 2017-03-20 23:32:25 +01:00
Florian Rival
406f98245c [WIP] Add background GD icon to newIDE 2017-03-20 23:31:53 +01:00
Florian Rival
eaf76105a1 [WIP] Fix ExternalEditorBridge swallowing messages when multiple messages are received in a row 2017-03-20 01:07:11 +01:00
Florian Rival
b7e0e7d54d [WIP] Allow newIDE to send the ui settings associated to the edited scene/external layout
TODO: uiSettings are still not properly received by the IDE
2017-03-20 00:02:47 +01:00
Florian Rival
8f109d5a27 [WIP] Fix rendering for PanelSprite and Sprite instances with custom size and smoothing 2017-03-19 19:01:01 +01:00
Florian Rival
907f319ce7 [WIP] Improve newIDE InstancesList performance with react-virtualized List 2017-03-19 18:32:21 +01:00
Florian Rival
146b69f91e [WIP] Improve newIDE ObjectsList performance with react-virtualized List 2017-03-19 16:52:51 +01:00
Florian Rival
51d23e30e5 [WIP] Improve newIDE performance by avoiding calling setState on the MainFrame when refreshing toolbar 2017-03-19 16:20:51 +01:00
Florian Rival
a87ba9db6f [WIP] Improve multiselection and add proportional resize & move following axis to newIDE 2017-03-19 03:43:59 +01:00
Florian Rival
1f593d576d [WIP] Add ExternalEditorPanel and allow to edit external layout with newIDE 2017-03-18 20:49:44 +01:00
Florian Rival
346003f377 [WIP] Allow external layout to be edited with newIDE, improve RenderedSpriteInstance performance by bypassing slow properties fetching 2017-03-17 00:17:58 +01:00
Florian Rival
1bd45ec96b Fix Inventory, LinkedObjects & SystemInfo JS Extension not having compilation information filled 2017-03-16 22:50:37 +01:00
Florian Rival
c078ed1e55 [WIP] Add full renderer for PanelSprite instances in newIDE, adapted from GDJS 2017-03-16 00:19:39 +01:00
Florian Rival
4f1f04242b [WIP] Handle rotation of TiledSprite instances in newIDE 2017-03-15 22:10:53 +01:00
Florian Rival
976826b9ab Expose LinkedObjects and SystemInfo extensions to emscripten build 2017-03-15 21:50:20 +01:00
Florian Rival
b4f2082454 Expose inventory extension to emscripten build 2017-03-15 00:59:13 +01:00
Florian Rival
b4318f63d3 [WIP] Add newIDE renderers for ShapePainterObject and TextEntryObject 2017-03-15 00:44:19 +01:00
Florian Rival
6e1140fa0c Expose ShapePainterObject and TextEntryObject to emscripten build 2017-03-15 00:16:24 +01:00
Florian Rival
2322b3dac1 Expose AnchorBehavior to emscripten build 2017-03-14 23:36:25 +01:00
Florian Rival
91914c80f7 [WIP] Improve text rendering performances in newIDE and disable undo/redo buttons if needed 2017-03-13 23:57:59 +01:00
Florian Rival
cc127ff5ba [WIP] Add VariablesList editor to newIDE to edit instances variables 2017-03-13 22:22:19 +01:00
Florian Rival
0b3d2be1a2 [WIP] Fix a label in preferences and newIDE build script 2017-03-10 20:09:55 +01:00
Florian Rival
a44bf9d6d2 [WIP] Remove fixture game from newIDE 2017-03-10 00:07:19 +01:00
Florian Rival
a6207f27a3 [WIP] Add option in preferences to launch external editor instead of the internal scene editor 2017-03-09 23:54:14 +01:00
Florian Rival
92664eadc5 [WIP] Run Prettier on newIDE sources to reformat the whole code 2017-03-09 21:49:29 +01:00
Florian Rival
edcbd5c9a1 [WIP] Fix corruption/crash when rendering instances in newIDE after undo/redo
Instances in the InitialInstancesContainer were recreated but the renderers
were kept alive with reference to old instances, creating mismatches.
2017-03-09 00:19:19 +01:00
Florian Rival
96d8066983 [WIP] Add undo/redo in InstancesFullEditor in newIDE 2017-03-08 00:14:14 +01:00
Florian Rival
0cf6583bcc [WIP] Style fixes in newIDE 2017-03-07 22:33:46 +01:00
Florian Rival
063f76750f [WIP] Update newIDE build and IDE to distribute newIDE as part of GDevelop 2017-03-07 21:58:28 +01:00
Florian Rival
fef0e68dd3 [WIP] Strip project before sending it to an external editor to reduce loading time 2017-03-07 00:09:48 +01:00
Florian Rival
e40ffbba74 [WIP] Add preview button in newIDE, use a small drawer to show instance properties, update toolbar handling 2017-03-05 23:19:08 +01:00
Florian Rival
38f58ded69 [WIP] Refactor newIDE ExternalEditor, send update when window is closed 2017-03-05 16:27:29 +01:00
Florian Rival
51c60de26a [WIP] Fix key shortcuts in newIDE InstancesEditor 2017-03-05 14:08:21 +01:00
Florian Rival
e977cd2d23 [WIP] Allow to select instances from InstancesList in newIDE 2017-03-05 13:30:31 +01:00
Florian Rival
6efdabdb36 [WIP] Add cache for filenames of resources in newIDE 2017-03-03 21:29:28 +01:00
Florian Rival
8709de1e3e [WIP] Fix memory leak when receiving data in newIDE, add smooth startup transition 2017-03-03 00:37:50 +01:00
Florian Rival
a29332e4dc [WIP] Update LoaderModal in newIDE 2017-03-02 23:06:41 +01:00
Florian Rival
c82c125bb4 [WIP] Improve newIDE loading time by using JSON.parse + gd.Serializer.fromJSObject
JSON.parse + fromJSObject is ~4x faster than using fromJSON as JSON.parse
is natively provided by JS engines/browsers.
2017-03-02 21:50:17 +01:00
Florian Rival
6528a12671 [WIP] Add LayersList to newIDE, update theme and resources integration 2017-03-02 00:56:51 +01:00
Florian Rival
bb3149817d [WIP] Add text fonts rendering to newIDE 2017-03-01 23:19:55 +01:00
Florian Rival
fb805cebf1 [WIP] Add IconMenu to new IDE, displaying either a material-ui or a native menu 2017-03-01 22:18:01 +01:00
Florian Rival
0702d0188a [WIP] newIDE ask for update when it's launched instead of getting the update pushed by IDE 2017-02-28 22:54:56 +01:00
Florian Rival
185cbbc594 [WIP] Add ExternalEditorBridge::IsConnected and allow it to be started again 2017-02-28 00:30:59 +01:00
Florian Rival
04c4c9ed50 [WIP] Add Electron packaging for newIDE 2017-02-28 00:24:46 +01:00
Florian Rival
dc445736ef [WIP] Enhance newIDE folder structure 2017-02-26 17:48:00 +01:00
Florian Rival
06ea17e7e8 [WIP] Add InstancesList, use npm for getting Pixi and remove uselss dependency to gdjs 2017-02-25 19:10:07 +01:00
Florian Rival
1d2ed3fe9d [WIP] Add missing material-ui dependency to newIDE 2017-02-23 22:58:03 +01:00
Florian Rival
6e953004f8 [WIP] Update ExternalEditorBridge to allow passing a scope when sending/receiving updates 2017-02-20 23:41:15 +01:00
Florian Rival
1b4d1582d4 [WIP] Add support for grid setup and update theme of newIDE 2017-02-20 00:47:14 +01:00
Florian Rival
90bd58b14a [WIP] Add toolbar, (partial) grid support to newIDE 2017-02-19 21:15:03 +01:00
Florian Rival
d78cecd34f [WIP] Handle objects with custom origin point and resize/move according to zoom factor in newIDE 2017-02-18 22:22:59 +01:00
Florian Rival
91771682f0 [WIP] Fix memory leak in newIDE, add update request to IDE on focus and a loader modal 2017-02-17 00:19:46 +01:00
Florian Rival
da5669ab70 [WIP] Add basic support for external layouts in newIDE 2017-02-15 23:53:12 +01:00
Florian Rival
afd7ac7c92 Expose gd::ExternalLayout::Get/SetAssociatedLayout to non IDE builds 2017-02-15 23:52:26 +01:00
Florian Rival
e8b1509fc2 Expose PanelSpriteObject to Emscripten build 2017-02-15 23:51:41 +01:00
Florian Rival
db1923c38c [WIP] Fix Emscripten memory leak in newIDE 2017-02-15 21:49:18 +01:00
Florian Rival
86789ac491 [WIP] Add support for layers in newIDE scene editor 2017-02-15 21:39:36 +01:00
Florian Rival
8f028f778d [WIP] Add Z-order and locked instances support in newIDE 2017-02-15 20:15:21 +01:00
Florian Rival
2a3d998e7c [WIP] Enhance InstancePropertiesEditor, fixes in InstancesEditor, enhance integration between IDE and newIDE 2017-02-14 23:56:24 +01:00
Florian Rival
3969561e8d [WIP] Add a POC InstancePropertiesEditor 2017-02-13 00:41:13 +01:00
Florian Rival
0118b740fa Center zoom in InstancesEditor and support multiple directions rendering of Sprite instances 2017-02-08 09:31:33 +01:00
Florian Rival
92a6e4819e Add methods to get/change the multipleDirections flag in Animation 2017-02-08 00:47:38 +01:00
Florian Rival
2afdcfdfa0 Fix new project creation 2017-02-08 00:46:50 +01:00
Florian Rival
a488f13aa6 [WIP] Move newIDE instances renderers into separate classes 2017-02-07 22:59:20 +01:00
Florian Rival
5ef46253b1 [WIP] Add ObjectsList and allow to select a new instance to insert in newIDE 2017-02-07 00:54:57 +01:00
Florian Rival
4a4dbe850c [WIP] Rename SceneEditor to InstancesEditor in newIDE and improve it 2017-02-07 00:13:01 +01:00
Victor Levasseur
37c643f7bc Scrollable instructions window and other layout fixes (#336)
* Put the parameters controls in a scrollable panel

* Fix InstructionSelectorDialog glitch when selecting an instruction

* Disable the horizontal scrollbar in InstructionsSelectorDialog

* Override parameter labels minimum size in InstructionSelectorDialog

so that they don't overflow from the scrollable area, hiding the parameters edition buttons

(also remove the horizontal scrollbar from the parameters scrollable area)

* Fix search text ctrl hidden by the tree ctrl in InstructionSelectorDialog

* Size fixes in InstructionSelectorDialog

* Fix unavailability warning msg displayed if an instruction has a custom generator

* Fix layout issues in ObjectsEditor and ChooseObject/VariableDialog
2017-01-28 17:11:24 +01:00
Florian Rival
2e67ec83fd Fix InitialInstancesContainer unserializeFrom when not empty 2017-01-23 00:50:45 +01:00
Florian Rival
de1a7c67b9 [WIP] Improve new IDE scene editor and try some more advanced integration 2017-01-22 17:26:01 +01:00
Florian Rival
eaba616f71 Fix InitialInstancesContainer unserializeFrom when not empty 2017-01-22 17:26:01 +01:00
Florian Rival
21cf59ff5a [WIP] Fix coordinates conversion in new IDE scene editor 2017-01-22 17:26:01 +01:00
Florian Rival
182c25f721 [WIP] Add electron support to the new IDE and WIP bridge to an external editor 2017-01-22 17:26:01 +01:00
Florian Rival
6002dc26dc [WIP] Ensure SceneEditor is taking all the remaining space 2017-01-22 17:26:01 +01:00
Florian Rival
e30e3cd705 [WIP] Improve SceneEditor 2017-01-22 17:26:01 +01:00
Florian Rival
88f0bbca8b [WIP] Add SceneEditor built with React and PixiJS 2017-01-22 17:26:01 +01:00
Florian Rival
6026bb8ff4 Add GDJS into the new IDE 2017-01-22 17:26:01 +01:00
Florian Rival
d57d186218 Add experimental, WIP IDE based on React 2017-01-22 17:26:01 +01:00
Florian Rival
834fed0b64 Serialize the project file in gd::Project 2017-01-22 17:26:01 +01:00
Florian Rival
ad7544c7a3 [WIP] Support for external editor with TCP connection 3 2017-01-22 17:26:01 +01:00
Florian Rival
0bf05afead Fix Project::UnserializeFrom not deleting existing data 2017-01-22 17:26:01 +01:00
Florian Rival
f1bb8b5149 [WIP] Support for external editor with TCP connection 2 2017-01-22 17:26:01 +01:00
Florian Rival
5d34d7a0b0 [WIP] Support for external editor with TCP connection 2017-01-22 17:25:25 +01:00
Florian Rival
7b8e1c70ba Fix EventsListSerialization::UnserializeEventsFrom not deleting existing events 2017-01-22 17:22:31 +01:00
Florian Rival
ba3fd0ebff [WIP] Export projects/layout as JSON when opening a scene editor 2017-01-22 17:22:31 +01:00
Victor Levasseur
01ee88cdc7 Fix "anticipate" parameter of "CentreCamera" and "FixCamera" 2017-01-19 23:44:13 +01:00
Florian Rival
cd34cbe934 Fix bottom part of PanelSprite rendered by PixiJS and cocos2d-JS 2017-01-07 15:32:33 +01:00
Florian Rival
276850b306 Add script to launch Chrome on OS X for profiling with IRHydra 2017-01-05 00:18:57 +01:00
Florian Rival
883129f379 Refactor arguments code generation using GenerateArgumentsList (#335) 2017-01-04 23:56:10 +01:00
Florian Rival
dea86d7c33 Really fix SFML patch for OS X (last patch was invalid) 2017-01-03 21:18:36 +01:00
Florian Rival
3d89bd50fc Merge pull request #331 from 4ian/optimization/objects-list-copy
Various optimizations (events generated code and game engine)
2016-12-31 19:11:42 +01:00
Florian Rival
54c94f62a4 Micro optimization for gdjs.evtTools.common.toString 2016-12-31 18:38:45 +01:00
Florian Rival
b9d71b0d9c Optimization to avoid constructing objects maps for events at runtime 2016-12-31 18:38:45 +01:00
Florian Rival
e5631383dd Avoid unnecessary copy or declarations of objects lists
* Declare objects lists used by actions only when actions are launched
for standard events (both GDCpp and GDJS)
* Enable the object list reuse optimisation in GDCpp as done in GDJS.
2016-12-31 18:38:45 +01:00
Florian Rival
8dc3bd3831 Don't animate sprites if outside of the screen in GDJS
* This leads to important performance boost in games with large maps/levels
* Backward compatibility is preserved for existing games, but any new object
created is using this optimization by default.
2016-12-31 18:38:45 +01:00
Florian Rival
cdc3e3ed90 Update gdjs.RuntimeScene._updateObjects to apply forces as done in GDC++
Could potentially change slightly the behavior of some game but it's now
consistent between GDJS and GDCpp.
This also avoid an extra iteration on all instances in GDJS.
2016-12-31 18:38:45 +01:00
Florian Rival
5281cd54cc Replace HSHG in platformruntimebehavior.js by RBush
TODO: Check if RBush create/destroy a lot of temporary JS objects and arrays
and try to reduce this.
2016-12-31 18:38:45 +01:00
Florian Rival
be66e670e9 Small optimisations for rendering of gdjs.SpriteRuntimeObject 2016-12-31 18:38:45 +01:00
Florian Rival
ee9a3d181d Prevent long lags/freezes in code generated for GDJS games (especially on Android)
This is done by generating every events list code in separate functions, reducing
the stress on garbage collectors of JS engines.
2016-12-31 18:38:45 +01:00
Florian Rival
a81170d934 Avoid unncessary copy of objects lists for last event of events lists 2016-12-31 18:38:45 +01:00
Florian Rival
4825313b15 Fix SFML patch for OS X 2016-12-31 18:38:10 +01:00
Victor Levasseur
90e1a33829 A message is displayed if the instruction is not available in one of the game's platforms 2016-12-30 01:24:39 +01:00
Victor Levasseur
7ad075cb59 Add StrRepeat string expression to repeat a string 2016-12-29 15:54:39 +01:00
Victor Levasseur
fd67843d0d Use sf::Text::getFillColor instead of the deprecated getColor 2016-12-29 12:53:22 +01:00
Victor Levasseur
0b9771815b Remove "hide tabs" options in settings 2016-12-29 12:47:38 +01:00
Victor Levasseur
d01a80c7b9 Fix TextObject smoothing freezing HTML5 games
(disable the smoothing action and condition in HTML5 games)
2016-12-29 12:39:34 +01:00
Victor Levasseur
3f005449ad Revert "Fix 3D Box blending with textures with fully transparent pixels (#325)"
This reverts commit e982f6218b.
2016-12-28 13:30:16 +01:00
Victor Levasseur
10e7a11a34 All events are now grayed when disabled 2016-12-28 12:58:30 +01:00
Florian Rival
65b02a7460 Merge pull request #314 from victorlevasseur/bugfix/particle-system
Bugfix/particle system
2016-12-25 21:12:47 +01:00
Bouh
0b28b0d15a Fix documentation for hasVariable() (#330) 2016-12-25 14:54:50 +01:00
Victor Levasseur
4e32b64bc6 Add the Mac OS X workaround for SFML
Fix PackageForOBS to embed SFML in the source archive
2016-12-25 12:17:25 +01:00
Victor Levasseur
d7509cf7c7 Update to SFML 2.4.1 and fix particle texturing 2016-12-24 22:52:36 +01:00
Florian Rival
78ec0fd201 Optimize code generation for object variables actions with mutators functions 2016-12-24 17:00:20 +01:00
Victor Levasseur
e982f6218b Fix 3D Box blending with textures with fully transparent pixels (#325)
Unfortunately, it's almost impossible to easily fix the problem for semi
transparent pixels
2016-12-22 00:01:15 +01:00
Florian Rival
4dae5dd567 Fixes for Android SFML export 2016-12-21 23:32:58 +01:00
Bouh
9f81038f1d Fix description of setVariableString in doc (#326) 2016-12-19 19:06:19 +01:00
Florian Rival
40fcb668c4 Merge pull request #313 from 4ian/feature/layer-timescale
Time scale for layers and various fixes/improvements
2016-12-17 16:31:17 +01:00
Bouh
96afbeb931 Fix error description in variable.js (#323) 2016-12-16 23:27:04 +01:00
Victor Levasseur
1ed005a472 Fix HTML5 game crash with non renderable objects 2016-12-10 12:19:25 +01:00
Florian Rival
b9abd568d0 Ensure first frame of a scene with Cocos2d-JS is not shown before scene render 2016-12-04 20:31:49 +01:00
Florian Rival
6ca3a08dd8 Add LinkRuntimeFiles.sh scripts in GDJS to ease development of the game engine
The script allow to quickly link the sources of the game engine in a folder
of an exported/previewed game, so that any change in the game engine can
be tested directly in the game.
2016-12-04 20:13:58 +01:00
Florian Rival
ccf75c63ad Fix RuntimeScene not compiling after changes in shared_ptr management 2016-12-04 14:31:44 +01:00
Victor Levasseur
f616075508 PackageForWindows.bat displays progress when creating the installer and the archive 2016-12-02 14:31:41 +01:00
Victor Levasseur
880ccad7f5 Fix buffer size of gd::FileStream on Windows
(let the system use its default parameter)
2016-12-02 01:30:21 +01:00
Florian Rival
7d9774c01d Fix RuntimeLayer::SetTimeScale when called with 0 2016-12-01 22:18:08 +01:00
Florian Rival
50b493ab2c Add actions/conditions/expressions in GDC++ to manipulate layer time scale 2016-12-01 22:18:08 +01:00
Florian Rival
66ef1e0abf Refactor RuntimeObject and behaviors to allow per-layer timescale 2016-12-01 22:18:08 +01:00
Florian Rival
ae93430539 Add actions/conditions/expressions to manipulate layer time scale 2016-12-01 22:18:08 +01:00
Florian Rival
42022290b8 Refactor gdjs.RuntimeObject and behaviors to allow per-layer timescale 2016-12-01 22:18:08 +01:00
Florian Rival
5c9279c6df Merge pull request #320 from 4ian/fix/file-stream-osx
Fix FileStream constructor on OS X
2016-11-30 23:24:11 +01:00
Florian Rival
69b2a41caa Fix FileStream constructor on OS X 2016-11-30 22:55:51 +01:00
Victor Levasseur
b6d92d69bc Improve message handling in FullProjectCompiler 2016-11-26 14:59:22 +01:00
Victor Levasseur
940ea8ba19 Merge branch 'master' of https://github.com/victorlevasseur/GD 2016-11-26 02:08:37 +01:00
Victor Levasseur
ea5d92a289 Fix FileStream::close 2016-11-26 02:00:50 +01:00
Victor Levasseur
9631bc0c32 Fix some FileStream 2016-11-24 21:03:14 +01:00
Victor Levasseur
7c14f9dd39 Fix gd::FileStream ctor 2016-11-23 23:11:25 +01:00
Victor Levasseur
59b9373974 Fix font loading crashing in the IDE
This is an ugly fix. The whole font loading process and FontManager still
need an overhaul (to be more C++11-ish).
2016-11-23 02:34:32 +01:00
Victor Levasseur
ab9403bece Set all sounds/musics relative to the listener
(to avoid conflicts with the Sound object extension)
2016-11-22 19:24:53 +01:00
Victor Levasseur
7e23652eef Add an option to simplify the version number to reduce building time 2016-11-20 01:15:29 +01:00
Victor Levasseur
6badf722c0 Fix gd::NativeFileSystem::Read/WriteFile 2016-11-15 16:31:04 +01:00
Victor Levasseur
d20b5a0fbb gd::Object and RuntimeObject are now cloned in unique_ptr 2016-11-15 08:33:56 +01:00
Victor Levasseur
ba791eddcb Use std::unique_ptr in SceneStack 2016-11-15 08:33:56 +01:00
Victor Levasseur
9a532a19db RuntimeObjects are now managed by unique_ptr 2016-11-15 08:33:56 +01:00
Victor Levasseur
3b75fd6df4 Add gd::FileStream (#312)
* Fix unicode paths on Windows for XML files
* Add a fstream equivalent that supports gd::String paths (with characters outside the current codepage on Windows)
* Add a sf::InputStream subclass for the same purpose
* Use gd::FileStream in DatFile and ResourcesLoader
* Replace remaining i/ofstream with gd::FileStream
2016-11-13 16:24:11 +01:00
Florian Rival
d6f3b2776e Add links to GDevelop Nightly builds 2016-11-12 17:05:42 +01:00
Victor Levasseur
dba2d55193 Fix again for resource.rc 2016-11-11 12:49:09 +01:00
Victor Levasseur
7cae68c5b8 Really fix resource.rc 2016-11-11 12:34:32 +01:00
Victor Levasseur
11c96dbef1 Really fix resource.rc 2016-11-11 12:31:10 +01:00
Victor Levasseur
46fff2dec4 Fix resource.rc not built correctly on Windows because of the new version header 2016-11-11 12:10:36 +01:00
Victor Levasseur
72df404d7f Automatic versioning (#311)
* Use the port number in SendHttpRequest and DownloadFile

* Fix "Custom size" and "Custom viewports" not displayed in layer propgrid

* Fix Fedora spec file

* Use automatic versioning from git

* A "correct" version number is now generated even if git is unable to find a tag
2016-11-11 11:32:56 +01:00
Victor Levasseur
cdbd3c515d Force travis.yml to get the full history 2016-11-10 09:31:47 +01:00
Victor Levasseur
b0e29bab5b Merge remote-tracking branch 'upstream/master' 2016-11-08 16:30:33 +01:00
Victor Levasseur
70fada11e7 Fix Fedora spec file 2016-11-08 16:19:12 +01:00
Victor Levasseur
626651ec51 Ignore errors when copying the compiler to the GDevelop's folder 2016-11-07 01:13:01 +01:00
Victor Levasseur
a47963e77f Merge remote-tracking branch 'upstream/master' 2016-11-06 19:30:41 +01:00
Florian Rival
179183f414 Bump version 2016-11-02 23:11:29 +01:00
Victor Levasseur
67b7a3a060 Fix "Custom size" and "Custom viewports" not displayed in layer propgrid (#308)
* Fix "Custom size" and "Custom viewports" not displayed in layer propgrid
2016-11-02 14:55:56 +01:00
Victor Levasseur
63dfc887cc Fix "Custom size" and "Custom viewports" not displayed in layer propgrid 2016-11-02 14:36:52 +01:00
Victor Levasseur
b537c36643 Merge remote-tracking branch 'upstream/master' 2016-11-02 13:36:30 +01:00
Victor Levasseur
146ed26eed Use the port number in SendHttpRequest and DownloadFile (#307) 2016-11-01 15:30:04 +01:00
Victor Levasseur
d971a4eb6a Use the port number in SendHttpRequest and DownloadFile 2016-11-01 09:16:24 +01:00
1709 changed files with 400481 additions and 234709 deletions

26
.clang_complete Normal file
View File

@@ -0,0 +1,26 @@
-DGDJS_EXPORTS
-DGD_API=
-DGD_CORE_API=
-DGD_EXTENSION_API=
-DGD_IDE_ONLY
-DMACOS
-DRELEASE
-DWXUSINGDLL
-D_FILE_OFFSET_BITS=64
-D__WXMAC__
-D__WXOSX_COCOA__
-D__WXOSX__
-DwxDEBUG_LEVEL=0
-D_WCHAR_H_CPLUSPLUS_98_CONFORMANCE_
-Wno-potentially-evaluated-expression
-std=gnu++11
-I/usr/local/Cellar/wxmac/3.0.2/include/wx-3.0
-DNDEBUG
-fPIC
-I/Users/florian/Projects/F/GD/ExtLibs/SFML/include
-I/Users/florian/Projects/F/GD/Core
-I/usr/local/Cellar/wxmac/3.0.2/lib/wx/include/osx_cocoa-unicode-3.0
-I/usr/local/Cellar/wxmac/3.0.2/include/wx-3.0
-I/Users/florian/Projects/F/GD/GDCpp/.
-I/Users/florian/Projects/F/GD/GDJS/.
-F/Users/florian/Projects/F/GD/ExtLibs/SFML/extlibs/libs-osx/Frameworks

24
.github/ISSUE_TEMPLATE/--bug-report.md vendored Normal file
View File

@@ -0,0 +1,24 @@
---
name: "\U0001F41BBug report"
about: Create a bug report about GDevelop or the game engine
---
## Describe the bug
A clear and concise description of what the bug is.
Please double check that the bug is not already reported in the issues list.
## To Reproduce
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
* Please include a link to a game if possible!
* If applicable, add screenshots to help explain your problem.
## Other details
* Include any OS/browser version/smartphone that you're using
* Add any other context about the problem here.

View File

@@ -0,0 +1,26 @@
---
name: "\U0001F4A1Feature request"
about: Suggest an idea for this project AFTER discussing about it on the Discord or
Forum first.
---
BEFORE opening a new feature request, please make sure that you:
* Discussed about it on the discord or the forum,
* There is not already a suggestion about it in the issues or in the roadmap: https://trello.com/b/qf0lM7k8/gdevelop-roadmap
* Consider commenting on the roadmap if something is important for you
## Description
Is your feature request **related to a problem**? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
## Solution suggested
**Describe the solution**
A clear and concise description of what could be done.
Add any other context or screenshots about the feature request here.
Explain if you can help implementing the solution.
## Alternatives considered
A clear and concise description of any alternative solutions or features you've considered.

11
.gitignore vendored
View File

@@ -1,11 +1,11 @@
/Core/GDCore/Tools/VersionPriv.h
/docs/GDJS Runtime Documentation
/docs/GDJS Documentation
/docs/GDCpp Documentation
/docs/GDCore Documentation
/ExtLibs/boost
/ExtLibs/SFML
/ExtLibs/wxwidgets
/ExtLibs/wxWidgets
/ExtLibs/SFML
/ExtLibs/*.7z
/scripts/Repository keys
/scripts/logs/*.txt
@@ -56,6 +56,7 @@ Binaries/Packaging/logs
/Binaries/**/JsPlatform/Runtime
/Binaries/**/JsPlatform/*.dll
/Binaries/**/JsPlatform/*.dll.a
/Binaries/Output/Release_Windows/newIDE
*.autosave
/Binaries/Output/libGD.js/Release
/Binaries/Output/libGD.js/Debug
@@ -64,12 +65,14 @@ Binaries/Packaging/logs
!/scripts/libgettextlib-0-17.dll
!/scripts/libgettextsrc-0-17.dll
!/xgettext.exe
!/Binaries/Output/Release_Windows/locale/libgettextlib-0-17.dll
!/Binaries/Output/Release_Windows/locale/libgettextsrc-0-17.dll
!/Binaries/Output/Release_Windows/locale/*.dll
!/Binaries/Output/Release_Windows/locale/msgcat.exe
!/Binaries/Output/Release_Windows/locale/msgfmt.exe
!/ExtLibs/curl.exe
!/ExtLibs/7za.exe
!/ExtLibs/SFML/extlibs/**/*.dll
!/ExtLibs/SFML/extlibs/**/*.so
!/ExtLibs/SFML/extlibs/**/*.a
**/.DS_Store
**/node_modules/
.idea

View File

@@ -4,6 +4,14 @@ compiler:
- gcc
- clang
# Cache .npm folder for faster npm install
cache:
directories:
- $HOME/.npm
git:
depth: 999999
env:
global:
- GCC_VERSION="4.8"
@@ -34,6 +42,12 @@ before_install:
- "sh -e /etc/init.d/xvfb start"
install:
#Install newIDE tests dependencies
- cd newIDE/app && npm install
- cd ../..
#Install GDJS tests dependencies
- cd GDJS/tests && npm install
- cd ../..
#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
@@ -42,20 +56,21 @@ install:
- cmake -DBUILD_GDJS=FALSE -DBUILD_IDE=FALSE -DBUILD_TESTS=TRUE -DNO_GUI=TRUE -DCMAKE_CXX_COMPILER=$(which $CXX) -DCMAKE_C_COMPILER=$(which $CC) ..
- make -j 4
- cd ..
#Install GDJS tests dependencies
- cd GDJS/tests
- npm install
- cd ../..
script:
#GDJS game engine tests:
- cd GDJS/tests
- npm test
- cd ../..
#GDCore and GDCpp game engine tests:
- cd .build-tests
# - export LD_LIBRARY_PATH=$PWD/Binaries/Output/Release_Linux:$PWD/.build-tests/ExtLibs/SFML/lib:$LD_LIBRARY_PATH
- Core/GDCore_tests
- GDCpp/GDCpp_tests
- Extensions/PathfindingBehavior/PathfindingBehavior_Runtime_tests
- Extensions/LinkedObjects/LinkedObjects_Runtime_tests
- cd ..
#newIDE tests:
- cd newIDE/app
- npm test
- npm run flow
- cd ../..
#GDJS game engine tests, disabled on Travis CI because ChromeHeadless can't be started.
#See them running on Semaphore-CI instead: https://semaphoreci.com/4ian/gd
# - cd GDJS/tests && npm test
# - cd ../..

125
.vscode/c_cpp_properties.json vendored Normal file
View File

@@ -0,0 +1,125 @@
{
"configurations": [
{
"name": "Mac",
"includePath": [
"${workspaceRoot}",
"${workspaceRoot}/IDE",
"${workspaceRoot}/GDCpp",
"${workspaceRoot}/GDJS",
"${workspaceRoot}/Extensions",
"${workspaceRoot}/Core",
"${workspaceRoot}/ExtLibs/SFML/include",
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1",
"/usr/local/include",
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/include",
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include",
"/usr/include",
"/usr/local/lib/wx/include/osx_cocoa-unicode-3.0",
"/usr/local/include/wx-3.0",
"${workspaceRoot}"
],
"defines": [
"GD_IDE_ONLY",
"__WXMAC__",
"__WXOSX__",
"__WXOSX_COCOA__",
"GD_CORE_API=/* Macro used to export classes on Windows, please ignore */",
"GD_API=/* Macro used to export classes on Windows, please ignore */",
"GD_EXTENSION_API=/* Macro used to export classes on Windows, please ignore */",
"WXUSINGDLL"
],
"intelliSenseMode": "clang-x64",
"browse": {
"path": [
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1",
"/usr/local/include",
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/include",
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include",
"/usr/include",
"${workspaceRoot}"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
},
"macFrameworkPath": [
"/System/Library/Frameworks",
"/Library/Frameworks"
],
"compilerPath": "/usr/bin/clang",
"cStandard": "c11",
"cppStandard": "c++17"
},
{
"name": "Linux",
"includePath": [
"${workspaceRoot}",
"${workspaceRoot}/IDE",
"${workspaceRoot}/GDCpp",
"${workspaceRoot}/GDJS",
"${workspaceRoot}/Extensions",
"${workspaceRoot}/Core",
"${workspaceRoot}/ExtLibs/SFML/include",
"/usr/include",
"/usr/local/include",
"${workspaceRoot}"
],
"defines": [
"GD_IDE_ONLY",
"__WXMAC__",
"__WXOSX__",
"__WXOSX_COCOA__",
"GD_CORE_API=/* Macro used to export classes on Windows, please ignore */",
"GD_API=/* Macro used to export classes on Windows, please ignore */",
"GD_EXTENSION_API=/* Macro used to export classes on Windows, please ignore */",
"WXUSINGDLL"
],
"intelliSenseMode": "clang-x64",
"browse": {
"path": [
"/usr/include",
"/usr/local/include",
"${workspaceRoot}"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
},
{
"name": "Win32",
"includePath": [
"${workspaceRoot}",
"${workspaceRoot}/IDE",
"${workspaceRoot}/GDCpp",
"${workspaceRoot}/GDJS",
"${workspaceRoot}/Extensions",
"${workspaceRoot}/Core",
"${workspaceRoot}/ExtLibs/SFML/include",
"C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include",
"${workspaceRoot}"
],
"defines": [
"_DEBUG",
"UNICODE",
"GD_IDE_ONLY",
"__WXMAC__",
"__WXOSX__",
"__WXOSX_COCOA__",
"GD_CORE_API=/* Macro used to export classes on Windows, please ignore */",
"GD_API=/* Macro used to export classes on Windows, please ignore */",
"GD_EXTENSION_API=/* Macro used to export classes on Windows, please ignore */",
"WXUSINGDLL"
],
"intelliSenseMode": "msvc-x64",
"browse": {
"path": [
"C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include/*",
"${workspaceRoot}"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
}
],
"version": 4
}

97
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,97 @@
// Place your settings in this file to overwrite default and user settings.
{
"files.associations": {
"*.idl": "java",
"iosfwd": "cpp",
"functional": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"algorithm": "cpp",
"random": "cpp",
"__config": "cpp",
"cstddef": "cpp",
"exception": "cpp",
"initializer_list": "cpp",
"new": "cpp",
"stdexcept": "cpp",
"typeinfo": "cpp",
"*.tcc": "cpp",
"cctype": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"complex": "cpp",
"cstdarg": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"istream": "cpp",
"limits": "cpp",
"memory": "cpp",
"ostream": "cpp",
"sstream": "cpp",
"streambuf": "cpp",
"hashtable": "cpp",
"tuple": "cpp",
"unordered_map": "cpp",
"unordered_set": "cpp",
"__split_buffer": "cpp",
"deque": "cpp",
"iterator": "cpp",
"list": "cpp",
"map": "cpp",
"queue": "cpp",
"regex": "cpp",
"set": "cpp",
"stack": "cpp",
"string": "cpp",
"vector": "cpp",
"iostream": "cpp",
"__functional_03": "cpp",
"__hash_table": "cpp",
"__tree": "cpp",
"bitset": "cpp",
"__bit_reference": "cpp",
"__mutex_base": "cpp",
"fstream": "cpp",
"ios": "cpp",
"__locale": "cpp",
"valarray": "cpp",
"freeglut_spaceball.c": "cpp",
"__tuple": "cpp",
"hash_map": "cpp",
"hash_set": "cpp",
"system_error": "cpp",
"__nullptr": "cpp",
"__functional_base": "cpp",
"__functional_base_03": "cpp",
"chrono": "cpp",
"ratio": "cpp",
"atomic": "cpp",
"locale": "cpp",
"string_view": "cpp",
"__string": "cpp",
"cstring": "cpp",
"iomanip": "cpp",
"cstdint": "cpp"
},
"files.exclude": {
"Binaries/*build*": true,
"Binaries/Output": true,
"Binaries/Packaging/GDevelop.app": true,
"ExtLibs/SFML": true,
"docs": true,
"GDJS/docs": true,
"GDCpp/docs": true,
"Core/docs": true,
"Extensions/CommonDialogs/dlib-18.16": true,
"newIDE/electron-app/dist": true,
"newIDE/app/build": true,
"newIDE/app/resources/GDJS": true,
"newIDE/electron-app/app/www": true
},
// Support for Flowtype:
"javascript.validate.enable": false,
"flow.useNPMPackagedFlow": true
}

View File

@@ -0,0 +1,748 @@
<?xml version="1.0" encoding="UTF-8" ?>
<project firstLayout="">
<gdVersion build="95" major="4" minor="0" revision="8" />
<properties folderProject="false" linuxExecutableFilename="" macExecutableFilename="" packageName="com.example.gamename" projectFile="C:\Users\Maciel\Programacion\gits\GD\Binaries\Output\Release_Windows\Examples\Copy_Variables.gdg" useExternalSourceFiles="false" winExecutableFilename="" winExecutableIconFile="">
<name>Project</name>
<author></author>
<windowWidth>800</windowWidth>
<windowHeight>600</windowHeight>
<latestCompilationDirectory></latestCompilationDirectory>
<maxFPS>60</maxFPS>
<minFPS>10</minFPS>
<verticalSync>false</verticalSync>
<extensions>
<extension name="BuiltinObject" />
<extension name="BuiltinAudio" />
<extension name="BuiltinVariables" />
<extension name="BuiltinTime" />
<extension name="BuiltinMouse" />
<extension name="BuiltinKeyboard" />
<extension name="BuiltinJoystick" />
<extension name="BuiltinCamera" />
<extension name="BuiltinWindow" />
<extension name="BuiltinFile" />
<extension name="BuiltinNetwork" />
<extension name="BuiltinScene" />
<extension name="BuiltinAdvanced" />
<extension name="Sprite" />
<extension name="BuiltinCommonInstructions" />
<extension name="BuiltinCommonConversions" />
<extension name="BuiltinStringInstructions" />
<extension name="BuiltinMathematicalTools" />
<extension name="BuiltinExternalLayouts" />
<extension name="TextObject" />
</extensions>
<platforms>
<platform name="GDevelop C++ platform" />
<platform name="GDevelop JS platform" />
</platforms>
<currentPlatform>GDevelop C++ platform</currentPlatform>
</properties>
<resources>
<resources />
<resourceFolders />
</resources>
<objects />
<objectsGroups />
<variables />
<layouts>
<layout b="30" disableInputWhenNotFocused="true" mangledName="Scene" name="Scene" oglFOV="90.000000" oglZFar="500.000000" oglZNear="1.000000" r="30" standardSortMethod="false" stopSoundsOnStartup="true" title="" v="30">
<uiSettings grid="false" gridB="80" gridG="80" gridHeight="32" gridOffsetX="0" gridOffsetY="0" gridR="80" gridWidth="32" snap="true" windowMask="false" zoomFactor="0.701632" />
<objectsGroups />
<variables>
<variable name="Scene">
<children>
<variable name="A" value="5" />
<variable name="B">
<children>
<variable name="alpha">
<children>
<variable name="x" value="5.5" />
<variable name="y" value="-8" />
</children>
</variable>
<variable name="beta" value="150;255;150" />
<variable name="gamma" value="Apples" />
</children>
</variable>
</children>
</variable>
</variables>
<instances>
<instance angle="0.000000" customSize="false" height="0.000000" layer="" locked="false" name="DebugText" width="0.000000" x="400.000000" y="300.000000" zOrder="1">
<numberProperties />
<stringProperties />
<initialVariables>
<variable name="ID" value="3" />
</initialVariables>
</instance>
<instance angle="0.000000" customSize="false" height="0.000000" layer="" locked="false" name="DebugText" width="0.000000" x="20.000000" y="20.000000" zOrder="1">
<numberProperties />
<stringProperties />
<initialVariables>
<variable name="ID" value="0" />
</initialVariables>
</instance>
<instance angle="0.000000" customSize="false" height="0.000000" layer="" locked="false" name="DebugText" width="0.000000" x="400.000000" y="20.000000" zOrder="1">
<numberProperties />
<stringProperties />
<initialVariables>
<variable name="ID" value="1" />
</initialVariables>
</instance>
<instance angle="0.000000" customSize="false" height="0.000000" layer="" locked="false" name="DebugText" width="0.000000" x="20.000000" y="300.000000" zOrder="1">
<numberProperties />
<stringProperties />
<initialVariables>
<variable name="ID" value="2" />
</initialVariables>
</instance>
</instances>
<objects>
<object bold="false" italic="false" name="DebugText" smoothed="true" type="TextObject::Text" underlined="false">
<variables />
<behaviors />
<string>DebugText</string>
<font></font>
<characterSize>24</characterSize>
<color b="220" g="220" r="220" />
</object>
</objects>
<events>
<event disabled="false" folded="false">
<type>BuiltinCommonInstructions::Comment</type>
<color b="128" g="255" r="128" textB="0" textG="0" textR="0" />
<comment>Update debug text at the beginning (only Scene variable will be drawn because others haven&apos;t childrend)</comment>
<comment2></comment2>
</event>
<event disabled="false" folded="false">
<type>BuiltinCommonInstructions::Standard</type>
<conditions>
<condition>
<type inverted="false" value="DepartScene" />
<parameters>
<parameter></parameter>
</parameters>
<subConditions />
</condition>
</conditions>
<actions>
<action>
<type inverted="false" value="ModVarScene" />
<parameters>
<parameter>Update</parameter>
<parameter>=</parameter>
<parameter>1</parameter>
</parameters>
<subActions />
</action>
</actions>
<events />
</event>
<event disabled="false" folded="false">
<type>BuiltinCommonInstructions::Comment</type>
<color b="128" g="255" r="128" textB="0" textG="0" textR="0" />
<comment>If &quot;A&quot; key is pressed, convert the Scene variable into JSON and parse it into a Global variable, then randomize a child from the Global structure, to identify it</comment>
<comment2></comment2>
</event>
<event disabled="false" folded="false">
<type>BuiltinCommonInstructions::Standard</type>
<conditions>
<condition>
<type inverted="false" value="KeyPressed" />
<parameters>
<parameter></parameter>
<parameter>a</parameter>
</parameters>
<subConditions />
</condition>
<condition>
<type inverted="false" value="BuiltinCommonInstructions::Once" />
<parameters />
<subConditions />
</condition>
</conditions>
<actions>
<action>
<type inverted="false" value="JSONToGlobalVariableStructure" />
<parameters>
<parameter>ToJSON(Scene)</parameter>
<parameter>Global</parameter>
</parameters>
<subActions />
</action>
<action>
<type inverted="false" value="ModVarGlobal" />
<parameters>
<parameter>Global.B.alpha.x</parameter>
<parameter>=</parameter>
<parameter>Random(1000)</parameter>
</parameters>
<subActions />
</action>
<action>
<type inverted="false" value="ModVarScene" />
<parameters>
<parameter>Update</parameter>
<parameter>=</parameter>
<parameter>1</parameter>
</parameters>
<subActions />
</action>
</actions>
<events />
</event>
<event disabled="false" folded="false">
<type>BuiltinCommonInstructions::Comment</type>
<color b="128" g="255" r="128" textB="0" textG="0" textR="0" />
<comment>If &quot;S&quot; key is pressed, convert the Global variable into JSON and parse it into an Object variable, then randomize another child from the Object structure, to identify it</comment>
<comment2></comment2>
</event>
<event disabled="false" folded="false">
<type>BuiltinCommonInstructions::Standard</type>
<conditions>
<condition>
<type inverted="false" value="KeyPressed" />
<parameters>
<parameter></parameter>
<parameter>s</parameter>
</parameters>
<subConditions />
</condition>
<condition>
<type inverted="false" value="VarObjet" />
<parameters>
<parameter>DebugText</parameter>
<parameter>ID</parameter>
<parameter>=</parameter>
<parameter>2</parameter>
</parameters>
<subConditions />
</condition>
<condition>
<type inverted="false" value="BuiltinCommonInstructions::Once" />
<parameters />
<subConditions />
</condition>
</conditions>
<actions>
<action>
<type inverted="false" value="JSONToObjectVariableStructure" />
<parameters>
<parameter>GlobalVarToJSON(Global)</parameter>
<parameter>DebugText</parameter>
<parameter>Object</parameter>
</parameters>
<subActions />
</action>
<action>
<type inverted="false" value="ModVarObjet" />
<parameters>
<parameter>DebugText</parameter>
<parameter>Object.B.alpha.y</parameter>
<parameter>=</parameter>
<parameter>Random(1000)</parameter>
</parameters>
<subActions />
</action>
<action>
<type inverted="false" value="ModVarScene" />
<parameters>
<parameter>Update</parameter>
<parameter>=</parameter>
<parameter>1</parameter>
</parameters>
<subActions />
</action>
</actions>
<events />
</event>
<event disabled="false" folded="false">
<type>BuiltinCommonInstructions::Comment</type>
<color b="128" g="255" r="128" textB="0" textG="0" textR="0" />
<comment>If &quot;D&quot; key is pressed, convert the Object variable into JSON (note there are no whitespaces after the &quot;,&quot; before the variable name in the ObjectVarToJSON) and parse it into another scene variable Scene_2</comment>
<comment2></comment2>
</event>
<event disabled="false" folded="false">
<type>BuiltinCommonInstructions::Standard</type>
<conditions>
<condition>
<type inverted="false" value="KeyPressed" />
<parameters>
<parameter></parameter>
<parameter>d</parameter>
</parameters>
<subConditions />
</condition>
<condition>
<type inverted="false" value="VarObjet" />
<parameters>
<parameter>DebugText</parameter>
<parameter>ID</parameter>
<parameter>=</parameter>
<parameter>2</parameter>
</parameters>
<subConditions />
</condition>
<condition>
<type inverted="false" value="BuiltinCommonInstructions::Once" />
<parameters />
<subConditions />
</condition>
</conditions>
<actions>
<action>
<type inverted="false" value="JSONToVariableStructure" />
<parameters>
<parameter>ObjectVarToJSON(DebugText,Object)</parameter>
<parameter>Scene_2</parameter>
</parameters>
<subActions />
</action>
<action>
<type inverted="false" value="ModVarScene" />
<parameters>
<parameter>Update</parameter>
<parameter>=</parameter>
<parameter>1</parameter>
</parameters>
<subActions />
</action>
</actions>
<events />
</event>
<event disabled="false" folded="false">
<type>BuiltinCommonInstructions::Comment</type>
<color b="128" g="255" r="128" textB="0" textG="0" textR="0" />
<comment>Time to update the debug text objects, set Update = 0 to update it only once, and start a counter &quot;i&quot; = 0</comment>
<comment2></comment2>
</event>
<event disabled="false" folded="false">
<type>BuiltinCommonInstructions::Standard</type>
<conditions>
<condition>
<type inverted="false" value="VarScene" />
<parameters>
<parameter>Update</parameter>
<parameter>=</parameter>
<parameter>1</parameter>
</parameters>
<subConditions />
</condition>
</conditions>
<actions>
<action>
<type inverted="false" value="ModVarScene" />
<parameters>
<parameter>Update</parameter>
<parameter>=</parameter>
<parameter>0</parameter>
</parameters>
<subActions />
</action>
<action>
<type inverted="false" value="ModVarScene" />
<parameters>
<parameter>i</parameter>
<parameter>=</parameter>
<parameter>0</parameter>
</parameters>
<subActions />
</action>
</actions>
<events>
<event disabled="false" folded="false">
<type>BuiltinCommonInstructions::Comment</type>
<color b="128" g="255" r="128" textB="0" textG="0" textR="0" />
<comment>Repeat 4 times because there are 4 debug objects, in each repeat select the object with ID = i (counter variable)&#x0A;Update the counter variable (i + 1)&#x0A;Clear the temporal variable Temp, otherwise children are kept from one update to another, messing up the test</comment>
<comment2></comment2>
</event>
<event disabled="false" folded="false">
<type>BuiltinCommonInstructions::Repeat</type>
<repeatExpression>4</repeatExpression>
<conditions>
<condition>
<type inverted="false" value="VarObjet" />
<parameters>
<parameter>DebugText</parameter>
<parameter>ID</parameter>
<parameter>=</parameter>
<parameter>Variable(i)</parameter>
</parameters>
<subConditions />
</condition>
</conditions>
<actions>
<action>
<type inverted="false" value="ModVarScene" />
<parameters>
<parameter>i</parameter>
<parameter>+</parameter>
<parameter>1</parameter>
</parameters>
<subActions />
</action>
<action>
<type inverted="false" value="VariableClearChildren" />
<parameters>
<parameter>Temp</parameter>
</parameters>
<subActions />
</action>
</actions>
<events>
<event disabled="false" folded="false">
<type>BuiltinCommonInstructions::Comment</type>
<color b="128" g="255" r="128" textB="0" textG="0" textR="0" />
<comment>Set starting title in function of the debug object ID, and copy the testing variables into the variable Temp (this way Temp will be equal to one of the variables under test)</comment>
<comment2></comment2>
</event>
<event disabled="false" folded="false">
<type>BuiltinCommonInstructions::Standard</type>
<conditions>
<condition>
<type inverted="false" value="VarObjet" />
<parameters>
<parameter>DebugText</parameter>
<parameter>ID</parameter>
<parameter>=</parameter>
<parameter>0</parameter>
</parameters>
<subConditions />
</condition>
</conditions>
<actions>
<action>
<type inverted="false" value="TextObject::String" />
<parameters>
<parameter>DebugText</parameter>
<parameter>=</parameter>
<parameter>&quot;Scene&quot; + NewLine()</parameter>
</parameters>
<subActions />
</action>
<action>
<type inverted="false" value="JSONToVariableStructure" />
<parameters>
<parameter>ToJSON(Scene)</parameter>
<parameter>Temp</parameter>
</parameters>
<subActions />
</action>
</actions>
<events />
</event>
<event disabled="false" folded="false">
<type>BuiltinCommonInstructions::Standard</type>
<conditions>
<condition>
<type inverted="false" value="VarObjet" />
<parameters>
<parameter>DebugText</parameter>
<parameter>ID</parameter>
<parameter>=</parameter>
<parameter>1</parameter>
</parameters>
<subConditions />
</condition>
</conditions>
<actions>
<action>
<type inverted="false" value="TextObject::String" />
<parameters>
<parameter>DebugText</parameter>
<parameter>=</parameter>
<parameter>&quot;Global&quot; + NewLine()</parameter>
</parameters>
<subActions />
</action>
<action>
<type inverted="false" value="JSONToVariableStructure" />
<parameters>
<parameter>GlobalVarToJSON(Global)</parameter>
<parameter>Temp</parameter>
</parameters>
<subActions />
</action>
</actions>
<events />
</event>
<event disabled="false" folded="false">
<type>BuiltinCommonInstructions::Standard</type>
<conditions>
<condition>
<type inverted="false" value="VarObjet" />
<parameters>
<parameter>DebugText</parameter>
<parameter>ID</parameter>
<parameter>=</parameter>
<parameter>2</parameter>
</parameters>
<subConditions />
</condition>
</conditions>
<actions>
<action>
<type inverted="false" value="TextObject::String" />
<parameters>
<parameter>DebugText</parameter>
<parameter>=</parameter>
<parameter>&quot;Object&quot; + NewLine()</parameter>
</parameters>
<subActions />
</action>
<action>
<type inverted="false" value="JSONToVariableStructure" />
<parameters>
<parameter>ObjectVarToJSON(DebugText,Object)</parameter>
<parameter>Temp</parameter>
</parameters>
<subActions />
</action>
</actions>
<events />
</event>
<event disabled="false" folded="false">
<type>BuiltinCommonInstructions::Standard</type>
<conditions>
<condition>
<type inverted="false" value="VarObjet" />
<parameters>
<parameter>DebugText</parameter>
<parameter>ID</parameter>
<parameter>=</parameter>
<parameter>3</parameter>
</parameters>
<subConditions />
</condition>
</conditions>
<actions>
<action>
<type inverted="false" value="TextObject::String" />
<parameters>
<parameter>DebugText</parameter>
<parameter>=</parameter>
<parameter>&quot;Scene_2&quot; + NewLine()</parameter>
</parameters>
<subActions />
</action>
<action>
<type inverted="false" value="JSONToVariableStructure" />
<parameters>
<parameter>ToJSON(Scene_2)</parameter>
<parameter>Temp</parameter>
</parameters>
<subActions />
</action>
</actions>
<events />
</event>
<event disabled="false" folded="false">
<type>BuiltinCommonInstructions::Comment</type>
<color b="128" g="255" r="128" textB="0" textG="0" textR="0" />
<comment>Copy values from variable Test in the debug object, to draw it, one debug object is selected at each iteration and one variable is copy into Temp variable</comment>
<comment2></comment2>
</event>
<event disabled="false" folded="false">
<type>BuiltinCommonInstructions::Standard</type>
<conditions>
<condition>
<type inverted="false" value="VariableChildExists" />
<parameters>
<parameter>Temp</parameter>
<parameter>&quot;A&quot;</parameter>
</parameters>
<subConditions />
</condition>
</conditions>
<actions>
<action>
<type inverted="false" value="TextObject::String" />
<parameters>
<parameter>DebugText</parameter>
<parameter>+</parameter>
<parameter>&quot;____A = &quot; + VariableString(Temp.A) + NewLine()</parameter>
</parameters>
<subActions />
</action>
</actions>
<events />
</event>
<event disabled="false" folded="false">
<type>BuiltinCommonInstructions::Standard</type>
<conditions>
<condition>
<type inverted="false" value="VariableChildExists" />
<parameters>
<parameter>Temp</parameter>
<parameter>&quot;B&quot;</parameter>
</parameters>
<subConditions />
</condition>
</conditions>
<actions>
<action>
<type inverted="false" value="TextObject::String" />
<parameters>
<parameter>DebugText</parameter>
<parameter>+</parameter>
<parameter>&quot;____B&quot; + NewLine()</parameter>
</parameters>
<subActions />
</action>
</actions>
<events>
<event disabled="false" folded="false">
<type>BuiltinCommonInstructions::Standard</type>
<conditions>
<condition>
<type inverted="false" value="VariableChildExists" />
<parameters>
<parameter>Temp.B</parameter>
<parameter>&quot;alpha&quot;</parameter>
</parameters>
<subConditions />
</condition>
</conditions>
<actions>
<action>
<type inverted="false" value="TextObject::String" />
<parameters>
<parameter>DebugText</parameter>
<parameter>+</parameter>
<parameter>&quot;________alpha&quot; + NewLine()</parameter>
</parameters>
<subActions />
</action>
</actions>
<events>
<event disabled="false" folded="false">
<type>BuiltinCommonInstructions::Standard</type>
<conditions>
<condition>
<type inverted="false" value="VariableChildExists" />
<parameters>
<parameter>Temp.B.alpha</parameter>
<parameter>&quot;x&quot;</parameter>
</parameters>
<subConditions />
</condition>
</conditions>
<actions>
<action>
<type inverted="false" value="TextObject::String" />
<parameters>
<parameter>DebugText</parameter>
<parameter>+</parameter>
<parameter>&quot;____________x = &quot; + VariableString(Temp.B.alpha.x) + NewLine()</parameter>
</parameters>
<subActions />
</action>
</actions>
<events />
</event>
<event disabled="false" folded="false">
<type>BuiltinCommonInstructions::Standard</type>
<conditions>
<condition>
<type inverted="false" value="VariableChildExists" />
<parameters>
<parameter>Temp.B.alpha</parameter>
<parameter>&quot;y&quot;</parameter>
</parameters>
<subConditions />
</condition>
</conditions>
<actions>
<action>
<type inverted="false" value="TextObject::String" />
<parameters>
<parameter>DebugText</parameter>
<parameter>+</parameter>
<parameter>&quot;____________y = &quot; + VariableString(Temp.B.alpha.y) + NewLine()</parameter>
</parameters>
<subActions />
</action>
</actions>
<events />
</event>
</events>
</event>
<event disabled="false" folded="false">
<type>BuiltinCommonInstructions::Standard</type>
<conditions>
<condition>
<type inverted="false" value="VariableChildExists" />
<parameters>
<parameter>Temp.B</parameter>
<parameter>&quot;beta&quot;</parameter>
</parameters>
<subConditions />
</condition>
</conditions>
<actions>
<action>
<type inverted="false" value="TextObject::String" />
<parameters>
<parameter>DebugText</parameter>
<parameter>+</parameter>
<parameter>&quot;________beta = &quot; + VariableString(Temp.B.beta) + NewLine()</parameter>
</parameters>
<subActions />
</action>
</actions>
<events />
</event>
<event disabled="false" folded="false">
<type>BuiltinCommonInstructions::Standard</type>
<conditions>
<condition>
<type inverted="false" value="VariableChildExists" />
<parameters>
<parameter>Temp.B</parameter>
<parameter>&quot;gamma&quot;</parameter>
</parameters>
<subConditions />
</condition>
</conditions>
<actions>
<action>
<type inverted="false" value="TextObject::String" />
<parameters>
<parameter>DebugText</parameter>
<parameter>+</parameter>
<parameter>&quot;________gamma = &quot; + VariableString(Temp.B.gamma)</parameter>
</parameters>
<subActions />
</action>
</actions>
<events />
</event>
</events>
</event>
</events>
</event>
</events>
</event>
</events>
<layers>
<layer name="New layer" visibility="true">
<cameras>
<camera defaultSize="true" defaultViewport="true" height="0.000000" viewportBottom="1.000000" viewportLeft="0.000000" viewportRight="1.000000" viewportTop="0.000000" width="0.000000" />
</cameras>
<effects />
</layer>
<layer name="" visibility="true">
<cameras>
<camera defaultSize="true" defaultViewport="true" height="0.000000" viewportBottom="1.000000" viewportLeft="0.000000" viewportRight="1.000000" viewportTop="0.000000" width="0.000000" />
</cameras>
<effects />
</layer>
</layers>
<behaviorsSharedData />
</layout>
</layouts>
<externalEvents />
<externalLayouts />
<externalSourceFiles />
</project>

View File

@@ -1,15 +1,17 @@
<?xml version="1.0" encoding="UTF-8" ?>
<project firstLayout="">
<gdVersion build="84" major="3" minor="6" revision="0" />
<properties linuxExecutableFilename="" macExecutableFilename="" useExternalSourceFiles="false" winExecutableFilename="" winExecutableIconFile="">
<gdVersion build="97" major="4" minor="0" revision="0" />
<properties folderProject="false" linuxExecutableFilename="" macExecutableFilename="" orientation="default" packageName="" projectFile="C:\Users\Maciel\Programacion\gits\GD\Binaries\Output\Release_Windows\Examples\Particles - Explosions.gdg" useExternalSourceFiles="false" winExecutableFilename="" winExecutableIconFile="">
<name>Explosions</name>
<author></author>
<windowWidth>800</windowWidth>
<windowHeight>600</windowHeight>
<latestCompilationDirectory></latestCompilationDirectory>
<latestCompilationDirectory>C:\Users\Maciel\AppData\Local\Temp\GDTemporaries\JSCocosExportParticles</latestCompilationDirectory>
<maxFPS>60</maxFPS>
<minFPS>10</minFPS>
<verticalSync>false</verticalSync>
<platformSpecificAssets />
<loadingScreen showGDevelopSplash="true" />
<extensions>
<extension name="BuiltinObject" />
<extension name="BuiltinAudio" />
@@ -34,6 +36,7 @@
</extensions>
<platforms>
<platform name="GDevelop C++ platform" />
<platform name="GDevelop JS platform" />
</platforms>
<currentPlatform>GDevelop C++ platform</currentPlatform>
</properties>
@@ -48,40 +51,40 @@
<variables />
<layouts>
<layout b="0" disableInputWhenNotFocused="true" mangledName="New_32scene" name="New scene" oglFOV="90.000000" oglZFar="500.000000" oglZNear="1.000000" r="0" standardSortMethod="true" stopSoundsOnStartup="true" title="" v="0">
<uiSettings associatedLayout="" grid="false" gridB="255" gridG="180" gridHeight="32" gridOffsetX="0" gridOffsetY="0" gridR="158" gridWidth="32" snap="true" windowMask="false" zoomFactor="1.000000" />
<uiSettings grid="false" gridB="255" gridG="180" gridHeight="32" gridOffsetX="0" gridOffsetY="0" gridR="158" gridWidth="32" snap="true" windowMask="false" zoomFactor="1.000000" />
<objectsGroups />
<variables />
<instances />
<objects>
<object additive="true" alphaParam="Mutable" angleParam="Random" blueParam="Mutable" destroyWhenNoParticles="true" emissionEditionSimpleMode="false" emitterAngleA="180.000000" emitterAngleB="160.000000" emitterForceMax="40.000000" emitterForceMin="5.000000" emitterXDirection="0.000000" emitterYDirection="0.000000" emitterZDirection="1.000000" flow="-1.000000" friction="2.000000" gravityEditionSimpleMode="false" greenParam="Mutable" maxParticleNb="5000" name="Explosion" particleAlpha1="204.000000" particleAlpha2="0.000000" particleAlphaRandomness1="0.000000" particleAlphaRandomness2="0.000000" particleAngle1="0.000000" particleAngle2="0.000000" particleAngleRandomness1="0.000000" particleAngleRandomness2="0.000000" particleBlue1="25.000000" particleBlue2="50.000000" particleEditionSimpleMode="false" particleGravityX="0.000000" particleGravityY="0.000000" particleGravityZ="20.000000" particleGreen1="128.000000" particleGreen2="50.000000" particleLifeTimeMax="1.500000" particleLifeTimeMin="0.700000" particleRed1="255.000000" particleRed2="50.000000" particleSize1="100.000000" particleSize2="100.000000" particleSizeRandomness1="0.000000" particleSizeRandomness2="0.000000" redParam="Mutable" rendererParam1="20.000000" rendererParam2="20.000000" rendererType="Quad" sizeParam="Random" tank="1000.000000" textureParticleName="ExplosionTexture.png" type="ParticleSystem::ParticleEmitter" zoneRadius="2.000000">
<object additive="true" alphaParam="Mutable" angleParam="Random" blueParam="Mutable" destroyWhenNoParticles="true" emissionEditionSimpleMode="true" emitterAngleA="0.000000" emitterAngleB="360.000000" emitterForceMax="70.000000" emitterForceMin="30.000000" emitterXDirection="0.000000" emitterYDirection="0.000000" emitterZDirection="1.000000" flow="-1.000000" friction="2.000000" gravityEditionSimpleMode="false" greenParam="Mutable" maxParticleNb="100" name="Explosion" particleAlpha1="225.000000" particleAlpha2="0.000000" particleAlphaRandomness1="0.000000" particleAlphaRandomness2="0.000000" particleAngle1="0.000000" particleAngle2="0.000000" particleAngleRandomness1="0.000000" particleAngleRandomness2="0.000000" particleBlue1="25.000000" particleBlue2="50.000000" particleEditionSimpleMode="false" particleGravityX="0.000000" particleGravityY="0.000000" particleGravityZ="20.000000" particleGreen1="128.000000" particleGreen2="50.000000" particleLifeTimeMax="1.500000" particleLifeTimeMin="0.700000" particleRed1="255.000000" particleRed2="50.000000" particleSize1="100.000000" particleSize2="100.000000" particleSizeRandomness1="0.000000" particleSizeRandomness2="0.000000" redParam="Mutable" rendererParam1="20.000000" rendererParam2="20.000000" rendererType="Quad" sizeParam="Random" tank="100.000000" textureParticleName="ExplosionTexture.png" type="ParticleSystem::ParticleEmitter" zoneRadius="2.000000">
<variables />
<automatisms />
<behaviors />
</object>
<object additive="true" alphaParam="Mutable" angleParam="Random" blueParam="Mutable" destroyWhenNoParticles="true" emissionEditionSimpleMode="false" emitterAngleA="0.000000" emitterAngleB="180.000000" emitterForceMax="130.000000" emitterForceMin="50.000000" emitterXDirection="1.000000" emitterYDirection="0.000000" emitterZDirection="1.000000" flow="-1.000000" friction="2.000000" gravityEditionSimpleMode="false" greenParam="Mutable" maxParticleNb="5000" name="Explosion2" particleAlpha1="204.000000" particleAlpha2="0.000000" particleAlphaRandomness1="0.000000" particleAlphaRandomness2="0.000000" particleAngle1="0.000000" particleAngle2="0.000000" particleAngleRandomness1="0.000000" particleAngleRandomness2="0.000000" particleBlue1="25.000000" particleBlue2="75.000000" particleEditionSimpleMode="false" particleGravityX="0.000000" particleGravityY="0.000000" particleGravityZ="30.000000" particleGreen1="76.000000" particleGreen2="180.000000" particleLifeTimeMax="1.500000" particleLifeTimeMin="0.700000" particleRed1="153.000000" particleRed2="1.000000" particleSize1="100.000000" particleSize2="100.000000" particleSizeRandomness1="0.000000" particleSizeRandomness2="0.000000" redParam="Enabled" rendererParam1="0.050000" rendererParam2="1.000000" rendererType="Line" sizeParam="Random" tank="350.000000" textureParticleName="" type="ParticleSystem::ParticleEmitter" zoneRadius="2.000000">
<object additive="true" alphaParam="Mutable" angleParam="Random" blueParam="Mutable" destroyWhenNoParticles="true" emissionEditionSimpleMode="true" emitterAngleA="0.000000" emitterAngleB="360.000000" emitterForceMax="130.000000" emitterForceMin="130.000000" emitterXDirection="1.000000" emitterYDirection="0.000000" emitterZDirection="1.000000" flow="-1.000000" friction="2.000000" gravityEditionSimpleMode="false" greenParam="Mutable" maxParticleNb="151" name="Explosion2" particleAlpha1="204.000000" particleAlpha2="0.000000" particleAlphaRandomness1="0.000000" particleAlphaRandomness2="0.000000" particleAngle1="0.000000" particleAngle2="0.000000" particleAngleRandomness1="0.000000" particleAngleRandomness2="0.000000" particleBlue1="25.000000" particleBlue2="75.000000" particleEditionSimpleMode="false" particleGravityX="0.000000" particleGravityY="0.000000" particleGravityZ="30.000000" particleGreen1="76.000000" particleGreen2="180.000000" particleLifeTimeMax="1.000000" particleLifeTimeMin="0.700000" particleRed1="153.000000" particleRed2="1.000000" particleSize1="100.000000" particleSize2="100.000000" particleSizeRandomness1="0.000000" particleSizeRandomness2="0.000000" redParam="Enabled" rendererParam1="3.000000" rendererParam2="6.000000" rendererType="Line" sizeParam="Random" tank="40.000000" textureParticleName="" type="ParticleSystem::ParticleEmitter" zoneRadius="2.000000">
<variables />
<automatisms />
<behaviors />
</object>
<object additive="true" alphaParam="Mutable" angleParam="Random" blueParam="Enabled" destroyWhenNoParticles="true" emissionEditionSimpleMode="false" emitterAngleA="45.000000" emitterAngleB="180.000000" emitterForceMax="10.000000" emitterForceMin="0.000000" emitterXDirection="0.000000" emitterYDirection="0.000000" emitterZDirection="1.000000" flow="400.000000" friction="2.000000" gravityEditionSimpleMode="true" greenParam="Enabled" maxParticleNb="5000" name="ExplosionSmoke" particleAlpha1="153.000000" particleAlpha2="0.000000" particleAlphaRandomness1="0.000000" particleAlphaRandomness2="0.000000" particleAngle1="0.000000" particleAngle2="0.000000" particleAngleRandomness1="0.000000" particleAngleRandomness2="0.000000" particleBlue1="25.000000" particleBlue2="0.000000" particleEditionSimpleMode="false" particleGravityX="0.000000" particleGravityY="0.000000" particleGravityZ="30.000000" particleGreen1="25.000000" particleGreen2="0.800000" particleLifeTimeMax="1.200000" particleLifeTimeMin="0.700000" particleRed1="25.000000" particleRed2="0.100000" particleSize1="100.000000" particleSize2="100.000000" particleSizeRandomness1="0.000000" particleSizeRandomness2="0.000000" redParam="Enabled" rendererParam1="20.000000" rendererParam2="20.000000" rendererType="Quad" sizeParam="Random" tank="500.000000" textureParticleName="ExplosionTexture.png" type="ParticleSystem::ParticleEmitter" zoneRadius="20.000000">
<object additive="true" alphaParam="Mutable" angleParam="Random" blueParam="Enabled" destroyWhenNoParticles="true" emissionEditionSimpleMode="false" emitterAngleA="45.000000" emitterAngleB="180.000000" emitterForceMax="10.000000" emitterForceMin="0.000000" emitterXDirection="0.000000" emitterYDirection="0.000000" emitterZDirection="1.000000" flow="400.000000" friction="2.000000" gravityEditionSimpleMode="true" greenParam="Enabled" maxParticleNb="50" name="ExplosionSmoke" particleAlpha1="153.000000" particleAlpha2="0.000000" particleAlphaRandomness1="0.000000" particleAlphaRandomness2="0.000000" particleAngle1="0.000000" particleAngle2="0.000000" particleAngleRandomness1="0.000000" particleAngleRandomness2="0.000000" particleBlue1="25.000000" particleBlue2="0.000000" particleEditionSimpleMode="false" particleGravityX="0.000000" particleGravityY="0.000000" particleGravityZ="30.000000" particleGreen1="25.000000" particleGreen2="0.800000" particleLifeTimeMax="2.000000" particleLifeTimeMin="0.700000" particleRed1="25.000000" particleRed2="0.100000" particleSize1="100.000000" particleSize2="100.000000" particleSizeRandomness1="0.000000" particleSizeRandomness2="0.000000" redParam="Enabled" rendererParam1="20.000000" rendererParam2="20.000000" rendererType="Quad" sizeParam="Random" tank="50.000000" textureParticleName="ExplosionTexture.png" type="ParticleSystem::ParticleEmitter" zoneRadius="20.000000">
<variables />
<automatisms />
<behaviors />
</object>
</objects>
<events>
<event disabled="false" folded="false">
<type>BuiltinCommonInstructions::Standard</type>
<conditions>
<condition>
<instruction>
<type inverted="false" value="Timer" />
<parameters>
<parameter></parameter>
<parameter>Random(0.3)+0.2</parameter>
<parameter>&quot;Creating&quot;</parameter>
</parameters>
<subConditions />
</condition>
<subInstructions />
</instruction>
</conditions>
<actions>
<action>
<instruction>
<type inverted="false" value="Create" />
<parameters>
<parameter></parameter>
@@ -90,9 +93,9 @@
<parameter>Random(600)</parameter>
<parameter></parameter>
</parameters>
<subActions />
</action>
<action>
<subInstructions />
</instruction>
<instruction>
<type inverted="false" value="Create" />
<parameters>
<parameter></parameter>
@@ -101,9 +104,9 @@
<parameter>Explosion.Y()</parameter>
<parameter></parameter>
</parameters>
<subActions />
</action>
<action>
<subInstructions />
</instruction>
<instruction>
<type inverted="false" value="Create" />
<parameters>
<parameter></parameter>
@@ -112,16 +115,16 @@
<parameter>Explosion.Y()</parameter>
<parameter></parameter>
</parameters>
<subActions />
</action>
<action>
<subInstructions />
</instruction>
<instruction>
<type inverted="false" value="ResetTimer" />
<parameters>
<parameter></parameter>
<parameter>&quot;Creating&quot;</parameter>
</parameters>
<subActions />
</action>
<subInstructions />
</instruction>
</actions>
<events />
</event>
@@ -131,9 +134,10 @@
<cameras>
<camera defaultSize="true" defaultViewport="true" height="0.000000" viewportBottom="1.000000" viewportLeft="0.000000" viewportRight="1.000000" viewportTop="0.000000" width="0.000000" />
</cameras>
<effects />
</layer>
</layers>
<automatismsSharedData />
<behaviorsSharedData />
</layout>
</layouts>
<externalEvents />

View File

@@ -1,15 +1,17 @@
<?xml version="1.0" encoding="UTF-8" ?>
<project firstLayout="">
<gdVersion build="84" major="3" minor="6" revision="0" />
<properties linuxExecutableFilename="" macExecutableFilename="" useExternalSourceFiles="false" winExecutableFilename="" winExecutableIconFile="">
<gdVersion build="97" major="4" minor="0" revision="0" />
<properties folderProject="false" linuxExecutableFilename="" macExecutableFilename="" orientation="default" packageName="" projectFile="C:\Users\Maciel\Programacion\gits\GD\Binaries\Output\Release_Windows\Examples\Particles - Various effects.gdg" useExternalSourceFiles="false" winExecutableFilename="" winExecutableIconFile="">
<name>Project</name>
<author></author>
<windowWidth>800</windowWidth>
<windowHeight>600</windowHeight>
<latestCompilationDirectory></latestCompilationDirectory>
<latestCompilationDirectory>C:\Users\Maciel\AppData\Local\Temp\GDTemporaries\JSCocosExportParticles</latestCompilationDirectory>
<maxFPS>60</maxFPS>
<minFPS>10</minFPS>
<verticalSync>false</verticalSync>
<platformSpecificAssets />
<loadingScreen showGDevelopSplash="true" />
<extensions>
<extension name="BuiltinObject" />
<extension name="BuiltinAudio" />
@@ -34,6 +36,7 @@
</extensions>
<platforms>
<platform name="GDevelop C++ platform" />
<platform name="GDevelop JS platform" />
</platforms>
<currentPlatform>GDevelop C++ platform</currentPlatform>
</properties>
@@ -47,8 +50,8 @@
<objectsGroups />
<variables />
<layouts>
<layout b="0" disableInputWhenNotFocused="true" mangledName="Nouvelle_32sc_232ne" name="Nouvelle scène" oglFOV="90.000000" oglZFar="500.000000" oglZNear="1.000000" r="0" standardSortMethod="true" stopSoundsOnStartup="true" title="" v="0">
<uiSettings associatedLayout="" grid="false" gridB="255" gridG="180" gridHeight="32" gridOffsetX="0" gridOffsetY="0" gridR="158" gridWidth="32" snap="true" windowMask="false" zoomFactor="1.000000" />
<layout b="0" disableInputWhenNotFocused="true" mangledName="Scene" name="Scene" oglFOV="90.000000" oglZFar="500.000000" oglZNear="1.000000" r="0" standardSortMethod="true" stopSoundsOnStartup="true" title="" v="0">
<uiSettings grid="false" gridB="255" gridG="180" gridHeight="32" gridOffsetX="0" gridOffsetY="0" gridR="158" gridWidth="32" snap="true" windowMask="false" zoomFactor="1.000000" />
<objectsGroups />
<variables />
<instances>
@@ -99,47 +102,47 @@
</instance>
</instances>
<objects>
<object additive="true" alphaParam="Mutable" angleParam="Mutable" blueParam="Random" destroyWhenNoParticles="false" emissionEditionSimpleMode="true" emitterAngleA="0.000000" emitterAngleB="180.000000" emitterForceMax="10.000000" emitterForceMin="0.000000" emitterXDirection="0.000000" emitterYDirection="1.000000" emitterZDirection="0.000000" flow="300.000000" friction="2.000000" gravityEditionSimpleMode="true" greenParam="Random" maxParticleNb="5000" name="Fire" particleAlpha1="204.000000" particleAlpha2="0.000000" particleAlphaRandomness1="0.000000" particleAlphaRandomness2="0.000000" particleAngle1="0.000000" particleAngle2="0.000000" particleAngleRandomness1="0.000000" particleAngleRandomness2="30.000000" particleBlue1="50.000000" particleBlue2="0.000000" particleEditionSimpleMode="false" particleGravityX="0.000000" particleGravityY="-100.000000" particleGravityZ="0.000000" particleGreen1="50.000000" particleGreen2="204.000000" particleLifeTimeMax="2.500000" particleLifeTimeMin="0.500000" particleRed1="240.000000" particleRed2="1.000000" particleSize1="100.000000" particleSize2="0.000000" particleSizeRandomness1="0.000000" particleSizeRandomness2="0.000000" redParam="Enabled" rendererParam1="10.000000" rendererParam2="20.000000" rendererType="Quad" sizeParam="Mutable" tank="-1.000000" textureParticleName="Fire" type="ParticleSystem::ParticleEmitter" zoneRadius="5.000000">
<object additive="true" alphaParam="Mutable" angleParam="Mutable" blueParam="Mutable" destroyWhenNoParticles="false" emissionEditionSimpleMode="true" emitterAngleA="0.000000" emitterAngleB="180.000000" emitterForceMax="10.000000" emitterForceMin="0.000000" emitterXDirection="0.000000" emitterYDirection="1.000000" emitterZDirection="0.000000" flow="30.000000" friction="2.000000" gravityEditionSimpleMode="true" greenParam="Mutable" maxParticleNb="200" name="Fire" particleAlpha1="204.000000" particleAlpha2="0.000000" particleAlphaRandomness1="0.000000" particleAlphaRandomness2="0.000000" particleAngle1="0.000000" particleAngle2="0.000000" particleAngleRandomness1="0.000000" particleAngleRandomness2="30.000000" particleBlue1="50.000000" particleBlue2="0.000000" particleEditionSimpleMode="true" particleGravityX="0.000000" particleGravityY="-100.000000" particleGravityZ="0.000000" particleGreen1="50.000000" particleGreen2="191.000000" particleLifeTimeMax="2.500000" particleLifeTimeMin="0.500000" particleRed1="240.000000" particleRed2="255.000000" particleSize1="100.000000" particleSize2="0.000000" particleSizeRandomness1="0.000000" particleSizeRandomness2="0.000000" redParam="Mutable" rendererParam1="10.000000" rendererParam2="20.000000" rendererType="Quad" sizeParam="Mutable" tank="-1.000000" textureParticleName="Fire" type="ParticleSystem::ParticleEmitter" zoneRadius="5.000000">
<variables />
<automatisms />
<behaviors />
</object>
<object additive="false" alphaParam="Mutable" angleParam="Random" blueParam="Enabled" destroyWhenNoParticles="false" emissionEditionSimpleMode="true" emitterAngleA="0.000000" emitterAngleB="180.000000" emitterForceMax="0.000000" emitterForceMin="0.000000" emitterXDirection="0.000000" emitterYDirection="1.000000" emitterZDirection="0.000000" flow="200.000000" friction="2.000000" gravityEditionSimpleMode="true" greenParam="Enabled" maxParticleNb="5000" name="Smoke" particleAlpha1="160.000000" particleAlpha2="0.000000" particleAlphaRandomness1="0.000000" particleAlphaRandomness2="0.000000" particleAngle1="0.000000" particleAngle2="360.000000" particleAngleRandomness1="0.000000" particleAngleRandomness2="0.000000" particleBlue1="50.000000" particleBlue2="0.000000" particleEditionSimpleMode="false" particleGravityX="0.000000" particleGravityY="-100.000000" particleGravityZ="0.000000" particleGreen1="50.000000" particleGreen2="0.800000" particleLifeTimeMax="2.500000" particleLifeTimeMin="0.500000" particleRed1="50.000000" particleRed2="1.000000" particleSize1="20.000000" particleSize2="100.000000" particleSizeRandomness1="0.000000" particleSizeRandomness2="0.000000" redParam="Enabled" rendererParam1="30.000000" rendererParam2="30.000000" rendererType="Quad" sizeParam="Mutable" tank="-1.000000" textureParticleName="Fire" type="ParticleSystem::ParticleEmitter" zoneRadius="7.000000">
<object additive="false" alphaParam="Mutable" angleParam="Random" blueParam="Mutable" destroyWhenNoParticles="false" emissionEditionSimpleMode="true" emitterAngleA="0.000000" emitterAngleB="360.000000" emitterForceMax="0.000000" emitterForceMin="0.000000" emitterXDirection="0.000000" emitterYDirection="1.000000" emitterZDirection="0.000000" flow="150.000000" friction="2.000000" gravityEditionSimpleMode="true" greenParam="Mutable" maxParticleNb="150" name="Smoke" particleAlpha1="160.000000" particleAlpha2="0.000000" particleAlphaRandomness1="0.000000" particleAlphaRandomness2="0.000000" particleAngle1="0.000000" particleAngle2="360.000000" particleAngleRandomness1="0.000000" particleAngleRandomness2="0.000000" particleBlue1="255.000000" particleBlue2="149.000000" particleEditionSimpleMode="true" particleGravityX="0.000000" particleGravityY="-100.000000" particleGravityZ="0.000000" particleGreen1="250.000000" particleGreen2="144.000000" particleLifeTimeMax="2.500000" particleLifeTimeMin="0.500000" particleRed1="253.000000" particleRed2="135.000000" particleSize1="20.000000" particleSize2="100.000000" particleSizeRandomness1="0.000000" particleSizeRandomness2="0.000000" redParam="Mutable" rendererParam1="30.000000" rendererParam2="30.000000" rendererType="Quad" sizeParam="Mutable" tank="-1.000000" textureParticleName="Fire" type="ParticleSystem::ParticleEmitter" zoneRadius="15.000000">
<variables />
<automatisms />
<behaviors />
</object>
<object additive="true" alphaParam="Mutable" angleParam="Random" blueParam="Random" destroyWhenNoParticles="false" emissionEditionSimpleMode="true" emitterAngleA="0.000000" emitterAngleB="180.000000" emitterForceMax="65.000000" emitterForceMin="25.000000" emitterXDirection="0.000000" emitterYDirection="1.000000" emitterZDirection="0.000000" flow="200.000000" friction="2.000000" gravityEditionSimpleMode="true" greenParam="Random" maxParticleNb="5000" name="Particles" particleAlpha1="204.000000" particleAlpha2="0.000000" particleAlphaRandomness1="0.000000" particleAlphaRandomness2="0.000000" particleAngle1="0.000000" particleAngle2="0.000000" particleAngleRandomness1="0.000000" particleAngleRandomness2="0.000000" particleBlue1="125.000000" particleBlue2="204.000000" particleEditionSimpleMode="false" particleGravityX="0.000000" particleGravityY="0.000000" particleGravityZ="250.000000" particleGreen1="125.000000" particleGreen2="204.000000" particleLifeTimeMax="2.500000" particleLifeTimeMin="0.500000" particleRed1="204.000000" particleRed2="255.000000" particleSize1="0.000000" particleSize2="0.000000" particleSizeRandomness1="0.000000" particleSizeRandomness2="0.000000" redParam="Random" rendererParam1="8.000000" rendererParam2="1.000000" rendererType="Point" sizeParam="Random" tank="-1.000000" textureParticleName="" type="ParticleSystem::ParticleEmitter" zoneRadius="2.000000">
<object additive="true" alphaParam="Mutable" angleParam="Random" blueParam="Random" destroyWhenNoParticles="false" emissionEditionSimpleMode="true" emitterAngleA="0.000000" emitterAngleB="180.000000" emitterForceMax="65.000000" emitterForceMin="25.000000" emitterXDirection="0.000000" emitterYDirection="1.000000" emitterZDirection="0.000000" flow="200.000000" friction="2.000000" gravityEditionSimpleMode="true" greenParam="Random" maxParticleNb="5000" name="Particles" particleAlpha1="204.000000" particleAlpha2="0.000000" particleAlphaRandomness1="0.000000" particleAlphaRandomness2="0.000000" particleAngle1="0.000000" particleAngle2="0.000000" particleAngleRandomness1="0.000000" particleAngleRandomness2="0.000000" particleBlue1="125.000000" particleBlue2="204.000000" particleEditionSimpleMode="false" particleGravityX="0.000000" particleGravityY="0.000000" particleGravityZ="250.000000" particleGreen1="125.000000" particleGreen2="204.000000" particleLifeTimeMax="2.500000" particleLifeTimeMin="0.500000" particleRed1="204.000000" particleRed2="255.000000" particleSize1="100.000000" particleSize2="100.000000" particleSizeRandomness1="0.000000" particleSizeRandomness2="0.000000" redParam="Random" rendererParam1="8.000000" rendererParam2="1.000000" rendererType="Point" sizeParam="Random" tank="-1.000000" textureParticleName="" type="ParticleSystem::ParticleEmitter" zoneRadius="2.000000">
<variables />
<automatisms />
<behaviors />
</object>
<object additive="false" alphaParam="Mutable" angleParam="Random" blueParam="Random" destroyWhenNoParticles="false" emissionEditionSimpleMode="true" emitterAngleA="0.000000" emitterAngleB="180.000000" emitterForceMax="0.000000" emitterForceMin="0.000000" emitterXDirection="0.000000" emitterYDirection="1.000000" emitterZDirection="0.000000" flow="100.000000" friction="2.000000" gravityEditionSimpleMode="true" greenParam="Random" maxParticleNb="5000" name="Beam" particleAlpha1="250.000000" particleAlpha2="0.000000" particleAlphaRandomness1="0.000000" particleAlphaRandomness2="0.000000" particleAngle1="0.000000" particleAngle2="0.000000" particleAngleRandomness1="0.000000" particleAngleRandomness2="0.000000" particleBlue1="204.000000" particleBlue2="255.000000" particleEditionSimpleMode="false" particleGravityX="0.000000" particleGravityY="0.000000" particleGravityZ="500.000000" particleGreen1="127.000000" particleGreen2="230.000000" particleLifeTimeMax="2.000000" particleLifeTimeMin="0.500000" particleRed1="153.000000" particleRed2="180.000000" particleSize1="0.000000" particleSize2="0.000000" particleSizeRandomness1="0.000000" particleSizeRandomness2="0.000000" redParam="Random" rendererParam1="3.000000" rendererParam2="1.000000" rendererType="Line" sizeParam="Random" tank="-1.000000" textureParticleName="" type="ParticleSystem::ParticleEmitter" zoneRadius="3.000000">
<object additive="false" alphaParam="Mutable" angleParam="Random" blueParam="Random" destroyWhenNoParticles="false" emissionEditionSimpleMode="false" emitterAngleA="-55.000000" emitterAngleB="-35.000000" emitterForceMax="5.000000" emitterForceMin="0.000000" emitterXDirection="0.000000" emitterYDirection="1.000000" emitterZDirection="0.000000" flow="100.000000" friction="2.000000" gravityEditionSimpleMode="true" greenParam="Random" maxParticleNb="151" name="Beam" particleAlpha1="250.000000" particleAlpha2="0.000000" particleAlphaRandomness1="0.000000" particleAlphaRandomness2="0.000000" particleAngle1="0.000000" particleAngle2="0.000000" particleAngleRandomness1="0.000000" particleAngleRandomness2="0.000000" particleBlue1="204.000000" particleBlue2="255.000000" particleEditionSimpleMode="false" particleGravityX="100.000000" particleGravityY="0.000000" particleGravityZ="500.000000" particleGreen1="127.000000" particleGreen2="230.000000" particleLifeTimeMax="2.000000" particleLifeTimeMin="0.500000" particleRed1="153.000000" particleRed2="180.000000" particleSize1="100.000000" particleSize2="100.000000" particleSizeRandomness1="0.000000" particleSizeRandomness2="0.000000" redParam="Random" rendererParam1="100.000000" rendererParam2="3.000000" rendererType="Line" sizeParam="Random" tank="-1.000000" textureParticleName="" type="ParticleSystem::ParticleEmitter" zoneRadius="20.000000">
<variables />
<automatisms />
<behaviors />
</object>
<object additive="true" alphaParam="Mutable" angleParam="Random" blueParam="Random" destroyWhenNoParticles="false" emissionEditionSimpleMode="true" emitterAngleA="0.000000" emitterAngleB="0.000000" emitterForceMax="65.000000" emitterForceMin="25.000000" emitterXDirection="0.000000" emitterYDirection="0.000000" emitterZDirection="0.000000" flow="300.000000" friction="2.000000" gravityEditionSimpleMode="true" greenParam="Random" maxParticleNb="5000" name="Beam2" particleAlpha1="125.000000" particleAlpha2="0.000000" particleAlphaRandomness1="0.000000" particleAlphaRandomness2="0.000000" particleAngle1="0.000000" particleAngle2="0.000000" particleAngleRandomness1="0.000000" particleAngleRandomness2="0.000000" particleBlue1="255.000000" particleBlue2="204.000000" particleEditionSimpleMode="false" particleGravityX="-500.000000" particleGravityY="0.000000" particleGravityZ="0.000000" particleGreen1="204.000000" particleGreen2="125.000000" particleLifeTimeMax="5.000000" particleLifeTimeMin="0.500000" particleRed1="127.000000" particleRed2="0.500000" particleSize1="0.000000" particleSize2="0.000000" particleSizeRandomness1="0.000000" particleSizeRandomness2="0.000000" redParam="Enabled" rendererParam1="0.500000" rendererParam2="2.000000" rendererType="Line" sizeParam="Random" tank="-1.000000" textureParticleName="" type="ParticleSystem::ParticleEmitter" zoneRadius="3.000000">
<object additive="true" alphaParam="Mutable" angleParam="Random" blueParam="Random" destroyWhenNoParticles="false" emissionEditionSimpleMode="true" emitterAngleA="0.000000" emitterAngleB="0.000000" emitterForceMax="65.000000" emitterForceMin="25.000000" emitterXDirection="0.000000" emitterYDirection="0.000000" emitterZDirection="0.000000" flow="50.000000" friction="2.000000" gravityEditionSimpleMode="true" greenParam="Random" maxParticleNb="5000" name="Beam2" particleAlpha1="125.000000" particleAlpha2="0.000000" particleAlphaRandomness1="0.000000" particleAlphaRandomness2="0.000000" particleAngle1="0.000000" particleAngle2="0.000000" particleAngleRandomness1="0.000000" particleAngleRandomness2="0.000000" particleBlue1="255.000000" particleBlue2="204.000000" particleEditionSimpleMode="false" particleGravityX="-500.000000" particleGravityY="0.000000" particleGravityZ="0.000000" particleGreen1="204.000000" particleGreen2="125.000000" particleLifeTimeMax="5.000000" particleLifeTimeMin="0.500000" particleRed1="127.000000" particleRed2="0.500000" particleSize1="100.000000" particleSize2="100.000000" particleSizeRandomness1="0.000000" particleSizeRandomness2="0.000000" redParam="Enabled" rendererParam1="10.000000" rendererParam2="3.000000" rendererType="Line" sizeParam="Random" tank="-1.000000" textureParticleName="" type="ParticleSystem::ParticleEmitter" zoneRadius="10.000000">
<variables />
<automatisms />
<behaviors />
</object>
<object additive="true" alphaParam="Mutable" angleParam="Random" blueParam="Random" destroyWhenNoParticles="true" emissionEditionSimpleMode="true" emitterAngleA="0.000000" emitterAngleB="180.000000" emitterForceMax="100.000000" emitterForceMin="25.000000" emitterXDirection="0.000000" emitterYDirection="0.000000" emitterZDirection="1.000000" flow="400.000000" friction="2.000000" gravityEditionSimpleMode="true" greenParam="Enabled" maxParticleNb="5000" name="Pyro" particleAlpha1="204.000000" particleAlpha2="0.000000" particleAlphaRandomness1="0.000000" particleAlphaRandomness2="0.000000" particleAngle1="0.000000" particleAngle2="0.000000" particleAngleRandomness1="0.000000" particleAngleRandomness2="0.000000" particleBlue1="204.000000" particleBlue2="255.000000" particleEditionSimpleMode="false" particleGravityX="0.000000" particleGravityY="-100.000000" particleGravityZ="0.000000" particleGreen1="127.000000" particleGreen2="1.000000" particleLifeTimeMax="1.000000" particleLifeTimeMin="0.500000" particleRed1="127.000000" particleRed2="230.000000" particleSize1="100.000000" particleSize2="1.000000" particleSizeRandomness1="0.000000" particleSizeRandomness2="0.000000" redParam="Random" rendererParam1="0.060000" rendererParam2="3.000000" rendererType="Line" sizeParam="Mutable" tank="600.000000" textureParticleName="" type="ParticleSystem::ParticleEmitter" zoneRadius="7.000000">
<object additive="true" alphaParam="Mutable" angleParam="Random" blueParam="Random" destroyWhenNoParticles="true" emissionEditionSimpleMode="true" emitterAngleA="0.000000" emitterAngleB="360.000000" emitterForceMax="100.000000" emitterForceMin="25.000000" emitterXDirection="0.000000" emitterYDirection="0.000000" emitterZDirection="1.000000" flow="70.000000" friction="2.000000" gravityEditionSimpleMode="true" greenParam="Enabled" maxParticleNb="151" name="Pyro" particleAlpha1="204.000000" particleAlpha2="0.000000" particleAlphaRandomness1="0.000000" particleAlphaRandomness2="0.000000" particleAngle1="0.000000" particleAngle2="0.000000" particleAngleRandomness1="0.000000" particleAngleRandomness2="0.000000" particleBlue1="204.000000" particleBlue2="255.000000" particleEditionSimpleMode="false" particleGravityX="-0.000080" particleGravityY="-200.000000" particleGravityZ="0.000000" particleGreen1="127.000000" particleGreen2="1.000000" particleLifeTimeMax="1.000000" particleLifeTimeMin="0.500000" particleRed1="127.000000" particleRed2="230.000000" particleSize1="100.000000" particleSize2="1.000000" particleSizeRandomness1="0.000000" particleSizeRandomness2="0.000000" redParam="Random" rendererParam1="8.000000" rendererParam2="8.000000" rendererType="Line" sizeParam="Mutable" tank="80.000000" textureParticleName="" type="ParticleSystem::ParticleEmitter" zoneRadius="25.000000">
<variables />
<automatisms />
<behaviors />
</object>
</objects>
<events>
<event disabled="false" folded="false">
<type>BuiltinCommonInstructions::Standard</type>
<conditions>
<condition>
<instruction>
<type inverted="false" value="Timer" />
<parameters>
<parameter></parameter>
<parameter>Random(0.3)+1</parameter>
<parameter>1</parameter>
<parameter>&quot;Creating&quot;</parameter>
</parameters>
<subConditions />
</condition>
<subInstructions />
</instruction>
</conditions>
<actions>
<action>
<instruction>
<type inverted="false" value="Create" />
<parameters>
<parameter></parameter>
@@ -148,16 +151,16 @@
<parameter>100+Random(300)</parameter>
<parameter></parameter>
</parameters>
<subActions />
</action>
<action>
<subInstructions />
</instruction>
<instruction>
<type inverted="false" value="ResetTimer" />
<parameters>
<parameter></parameter>
<parameter>&quot;Creating&quot;</parameter>
</parameters>
<subActions />
</action>
<subInstructions />
</instruction>
</actions>
<events />
</event>
@@ -167,9 +170,10 @@
<cameras>
<camera defaultSize="true" defaultViewport="true" height="0.000000" viewportBottom="1.000000" viewportLeft="0.000000" viewportRight="1.000000" viewportTop="0.000000" width="0.000000" />
</cameras>
<effects />
</layer>
</layers>
<automatismsSharedData />
<behaviorsSharedData />
</layout>
</layouts>
<externalEvents />

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
{"SubTexture":[{"frameY":0,"y":234,"frameWidth":112,"frameX":0,"frameHeight":210,"width":111,"height":209,"name":"parts/tailTip","x":456},{"width":112,"y":234,"height":86,"name":"parts/armUpperL","x":340},{"width":48,"y":859,"height":80,"name":"parts/armL","x":373},{"width":96,"y":922,"height":78,"name":"parts/handL","x":1},{"frameY":0,"y":677,"frameWidth":204,"frameX":0,"frameHeight":180,"width":203,"height":180,"name":"parts/legL","x":238},{"frameY":0,"y":397,"frameWidth":236,"frameX":0,"frameHeight":348,"width":235,"height":347,"name":"parts/body","x":1},{"width":216,"y":397,"height":278,"name":"parts/tail","x":238},{"width":208,"y":746,"height":174,"name":"parts/clothes1","x":1},{"width":124,"y":677,"height":282,"name":"parts/hair","x":443},{"frameY":0,"y":1,"frameWidth":338,"frameX":0,"frameHeight":394,"width":337,"height":394,"name":"parts/head","x":1},{"width":28,"y":961,"height":46,"name":"parts/eyeL","x":459},{"frameY":0,"y":961,"frameWidth":38,"frameX":0,"frameHeight":58,"width":37,"height":58,"name":"parts/eyeR","x":420},{"frameY":0,"y":1,"frameWidth":180,"frameX":0,"frameHeight":232,"width":180,"height":231,"name":"parts/legR","x":340},{"width":160,"y":859,"height":94,"name":"parts/armUpperR","x":211},{"frameY":0,"y":941,"frameWidth":46,"frameX":0,"frameHeight":78,"width":45,"height":77,"name":"parts/armR","x":373},{"width":98,"y":322,"height":58,"name":"parts/handR","x":340},{"frameY":0,"y":955,"frameWidth":120,"frameX":0,"frameHeight":36,"width":119,"height":36,"name":"parts/beardL","x":237},{"width":136,"y":955,"height":36,"name":"parts/beardR","x":99}],"width":1024,"height":1024,"name":"dragon","imagePath":"dragon_tex.png"}

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 486 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 638 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 550 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 469 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 600 B

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1005 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1006 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 293 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 413 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 568 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -51,9 +51,9 @@ cd $CUR_DIR/opensuse-build-service/gdevelop
tar zxf gdevelop_$GD_VERSION.orig.tar.gz
echo "[OK]"
#We need to include ExtLibs/SFML.7z and ExtLibs/boost.7z because buildbot do not have access to internet
#We need to include ExtLibs/SFML.7z because the buildbot do not have access to internet
printf " Copying SFML archive... "
cp $GD_BASE_DIR/ExtLibs/SFML.7z gdevelop-$GD_VERSION/ExtLibs/
cp -rf $GD_BASE_DIR/ExtLibs/SFML gdevelop-$GD_VERSION/ExtLibs/
echo "[OK]"
#Recreate the tar.gz with the added sources

View File

@@ -11,7 +11,7 @@ IF NOT EXIST "%INNOSETUP_EXE%" set INNOSETUP_EXE=C:\Program Files\Inno Setup 5\I
IF EXIST "%INNOSETUP_EXE%" (
echo "Note: InnoSetup found at %INNOSETUP_EXE%"
) ELSE (
echo Warning: InnoSetup not found! Skipping installer creation.
echo Warning: InnoSetup Unicode not found! Skipping installer creation.
SET SKIPINSTALLER=1
)
@@ -35,14 +35,14 @@ del Output\Release_Windows\log.txt > NUL 2> NUL
echo.
echo --Creating installer...
IF NOT "%SKIPINSTALLER%"=="1" "C:\Program Files (x86)\Inno Setup 5\ISCC.exe" Releases\InnoSetupInstallerScript.iss /Q
IF NOT "%SKIPINSTALLER%"=="1" "C:\Program Files (x86)\Inno Setup 5\ISCC.exe" Releases\InnoSetupInstallerScript.iss /Qp
IF "%SKIPINSTALLER%"=="1" echo (Skipped)
echo.
echo --Creating archive...
if exist Releases\gd4xxxx.7z (del Releases\gd4xxxx.7z)
cd Output\Release_Windows\
IF NOT "%SKIPINSTALLERANDARCHIVE%"=="1" "..\..\..\ExtLibs\7za.exe" a ..\..\Releases\gd4xxxx.7z * > ..\..\Packaging\logs\7zArchiveLog.txt
IF NOT "%SKIPINSTALLERANDARCHIVE%"=="1" "..\..\..\ExtLibs\7za.exe" a ..\..\Releases\gd4xxxx.7z * -bb
IF "%SKIPINSTALLERANDARCHIVE%"=="1" echo (Skipped)
cd ..\..\..

View File

@@ -2,7 +2,9 @@
Version=1.0
Name=GDevelop
GenericName=Game creator IDE
GenericName[de]=Entwicklungsumgebung für Spiele
Comment=HTML5 and native game development software
Comment[de]=Entwicklungsumgebung für native und HTML5-Spiele
Exec=sh -c "gdevelop %F"
MimeType=application/x-gdevelop-project;
Icon=GDevelop

View File

@@ -12,11 +12,11 @@ Source100: gdevelop-rpmlintrc
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: git rsync curl gcc-c++ cmake p7zip glew-devel xorg-x11-devel libsndfile-devel openal-soft-devel desktop-file-utils
BuildRequires: git rsync curl gcc-c++ cmake p7zip glew-devel libsndfile-devel openal-soft-devel desktop-file-utils
%if 0%{?fedora}
BuildRequires: systemd-devel libjpeg-turbo-devel gtk2-devel wxGTK3-devel
BuildRequires: systemd-devel libjpeg-turbo-devel gtk2-devel wxGTK3-devel libX11-devel
%else
BuildRequires: update-desktop-files libudev-devel libjpeg8-devel wxWidgets-3_0-devel
BuildRequires: update-desktop-files libudev-devel libjpeg8-devel wxWidgets-3_0-devel xorg-x11-devel
%endif
Requires: gcc-c++ p7zip

View File

@@ -1,4 +1,4 @@
; Inno Setup installation script for GDevelop.
; Inno Setup installation script for GDevelop 4.
[Setup]
AppName=GDevelop
@@ -13,17 +13,17 @@ AllowNoIcons=yes
LicenseFile=..\Output\Release_Windows\License-en.rtf
InfoBeforeFile=..\Output\Release_Windows\Informations-en.rtf
OutputDir=.\
OutputBaseFilename=gd4090
OutputBaseFilename=gd4097
Compression=lzma
SolidCompression=yes
SetupIconFile=..\Output\Release_Windows\res\icon.ico
VersionInfoVersion=4.0
WizardImageFile=Setup bitmap\wizbmp.bmp
WizardSmallImageFile=Setup bitmap/smallicon.bmp
AppCopyright=2008-2016 Florian Rival
AppCopyright=2008-2018 Florian Rival
VersionInfoCompany=Florian Rival
VersionInfoDescription=GDevelop setup
VersionInfoCopyright=2008-2016 Florian Rival
VersionInfoCopyright=2008-2018 Florian Rival
VersionInfoProductName=GDevelop
VersionInfoProductVersion=4.0

View File

@@ -4,6 +4,9 @@
cmake_minimum_required(VERSION 2.6)
cmake_policy(SET CMP0011 NEW)
# Add utility functions
include(scripts/CMakeClangUtils.txt) # To add clang-format and clang-tidy support to a target
# Macro for defining an option
macro(gd_set_option var default type docstring)
if(NOT DEFINED ${var})
@@ -18,6 +21,7 @@ gd_set_option(BUILD_IDE TRUE BOOL "TRUE to build the IDE")
gd_set_option(BUILD_EXTENSIONS TRUE BOOL "TRUE to build the extensions")
gd_set_option(BUILD_TESTS FALSE BOOL "TRUE to build the tests")
gd_set_option(NO_GUI FALSE BOOL "TRUE to build without wxWidgets GUI")
gd_set_option(FULL_VERSION_NUMBER TRUE BOOL "TRUE to build GDevelop with its full version number (lastest tag + commit hash), FALSE to only use the lastest tag (avoid rebulding many source file when developping)")
#Setting up installation directory, for Linux (has to be done before "project" command).
IF(NOT WIN32)
@@ -76,6 +80,8 @@ endif()
set(GD_base_dir ${CMAKE_CURRENT_SOURCE_DIR})
#Add all the CMakeLists:
ADD_SUBDIRECTORY(Version)
ADD_SUBDIRECTORY(ExtLibs)
IF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/Core/CMakeLists.txt" AND BUILD_CORE)
ADD_SUBDIRECTORY(Core)

View File

@@ -72,7 +72,12 @@ IF(NO_GUI)
list(REMOVE_ITEM source_files "${CMAKE_CURRENT_SOURCE_DIR}/GDCore/IDE/Dialogs/GDCoreDialogs.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/GDCore/IDE/Dialogs/GDCoreDialogs.h" "${CMAKE_CURRENT_SOURCE_DIR}/GDCore/IDE/Dialogs/GDCoreDialogs_dialogs_bitmaps.cpp")
ENDIF()
file(GLOB_RECURSE formatted_source_files tests/* GDCore/Events/* GDCore/Extensions/* GDCore/IDE/* GDCore/Project/* GDCore/Serialization/* GDCore/Tools/*)
list(REMOVE_ITEM formatted_source_files "${CMAKE_CURRENT_SOURCE_DIR}/GDCore/IDE/Dialogs/GDCoreDialogs.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/GDCore/IDE/Dialogs/GDCoreDialogs.h" "${CMAKE_CURRENT_SOURCE_DIR}/GDCore/IDE/Dialogs/GDCoreDialogs_dialogs_bitmaps.cpp")
gd_add_clang_utils(GDCore "${formatted_source_files}")
add_library(GDCore SHARED ${source_files})
add_dependencies(GDCore GDVersion)
IF(EMSCRIPTEN)
set_target_properties(GDCore PROPERTIES SUFFIX ".bc")
ELSEIF(WIN32)

View File

@@ -78,6 +78,7 @@
* The installation is fairly simple :<br>
* <br>
* - Launch the installer.<br>
* - Uncheck "Check for updated files on the TDM-GCC server" (otherwise you won't get TDM-GCC 4.9.2 but a more recent version that won't be compatible with wxWidgets pre-compiled binaries)
* - Choose Create.<br>
\image html compilerInstall1.png
@@ -531,7 +532,7 @@ AddEvent("Name",
"Description",
"Group",
"path-to-a-16-by-16-icon.png",
std::shared_ptr<gd::BaseEvent>(new EventClassName))
std::make_shared<EventClassName>())
* \endcode
*
* The event must be able to generate its code when events are being translated to C++ or Javascript:<br>
@@ -543,7 +544,7 @@ AddEvent("Standard",
_("Standard event: Actions are run if conditions are fulfilled."),
"",
"res/eventaddicon.png",
std::shared_ptr<gd::BaseEvent>(new gd::StandardEvent))
std::make_shared<gd::StandardEvent>())
.SetCodeGenerator(std::shared_ptr<gd::EventMetadata::CodeGenerator>(codeGen));
* \endcode
@@ -560,8 +561,8 @@ gd::BehaviorMetadata & aut = AddBehavior("Name",
"Group",
"path-to-a-32-by-32-icon.png",
"BehaviorClassName",
std::shared_ptr<gd::Behavior>(new BehaviorClassName),
std::shared_ptr<gd::BehaviorsSharedData>(new BehaviorSharedDataClassName));
std::make_shared<BehaviorClassName>(),
std::make_shared<BehaviorSharedDataClassName>());
* \endcode
* The last line can be replaced by <code>std::shared_ptr<gd::BehaviorsSharedData>()</code> if no shared data are being used.
*
@@ -619,8 +620,8 @@ public:
"",
"CppPlatform/Extensions/myicon.png",
"PhysicsBehavior",
std::shared_ptr<gd::Behavior>(new BehaviorClassName),
std::shared_ptr<gd::BehaviorsSharedData>(new BehaviorSharedDataClassName));
std::make_shared<BehaviorClassName>(),
std::make_shared<BehaviorSharedDataClassName>());
#if defined(GD_IDE_ONLY)
behaviorInfo.SetIncludeFile("MyExtension/MyIncludeFile.h");

View File

@@ -1,152 +1,189 @@
/*
* GDevelop Core
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights reserved.
* This project is released under the MIT License.
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights
* reserved. This project is released under the MIT License.
*/
#if !defined(GD_NO_WX_GUI)
#include <wx/dcmemory.h>
#endif
#include "CommentEvent.h"
#include "GDCore/IDE/Dialogs/EventsEditor/EventsRenderingHelper.h"
#include "GDCore/Serialization/SerializerElement.h"
#include "GDCore/CommonTools.h"
#include "GDCore/IDE/Dialogs/EditComment.h"
#include "GDCore/IDE/Dialogs/EventsEditor/EventsEditorItemsAreas.h"
#include "GDCore/IDE/Dialogs/EventsEditor/EventsEditorSelection.h"
#include "GDCore/CommonTools.h"
#include "GDCore/IDE/Dialogs/EventsEditor/EventsRenderingHelper.h"
#include "GDCore/Serialization/SerializerElement.h"
using namespace std;
namespace gd
{
namespace gd {
void CommentEvent::SerializeTo(SerializerElement & element) const
{
element.AddChild("color")
.SetAttribute("r", r)
.SetAttribute("g", v)
.SetAttribute("b", b)
.SetAttribute("textR", textR)
.SetAttribute("textG", textG)
.SetAttribute("textB", textB);
void CommentEvent::SerializeTo(SerializerElement &element) const {
element.AddChild("color")
.SetAttribute("r", r)
.SetAttribute("g", v)
.SetAttribute("b", b)
.SetAttribute("textR", textR)
.SetAttribute("textG", textG)
.SetAttribute("textB", textB);
element.AddChild("comment").SetValue(com1);
element.AddChild("comment2").SetValue(com2);
element.AddChild("comment").SetValue(com1);
element.AddChild("comment2").SetValue(com2);
}
void CommentEvent::UnserializeFrom(gd::Project & project, const SerializerElement & element)
{
const SerializerElement & colorElement = element.GetChild("color", 0, "Couleur");
r = colorElement.GetIntAttribute("r");
v = colorElement.GetIntAttribute("g", 0, "v");
b = colorElement.GetIntAttribute("b");
textR = colorElement.GetIntAttribute("textR");
textG = colorElement.GetIntAttribute("textG");
textB = colorElement.GetIntAttribute("textB");
void CommentEvent::UnserializeFrom(gd::Project &project,
const SerializerElement &element) {
const SerializerElement &colorElement =
element.GetChild("color", 0, "Couleur");
r = colorElement.GetIntAttribute("r");
v = colorElement.GetIntAttribute("g", 0, "v");
b = colorElement.GetIntAttribute("b");
textR = colorElement.GetIntAttribute("textR");
textG = colorElement.GetIntAttribute("textG");
textB = colorElement.GetIntAttribute("textB");
com1 = element.GetChild("comment", 0, "Com1").GetValue().GetString();
com2 = element.GetChild("comment2", 0, "Com2").GetValue().GetString();
com1 = element.GetChild("comment", 0, "Com1").GetValue().GetString();
com2 = element.GetChild("comment2", 0, "Com2").GetValue().GetString();
}
gd::BaseEvent::EditEventReturnType CommentEvent::EditEvent(wxWindow* parent_, gd::Project & game_, gd::Layout & scene_, gd::MainFrameWrapper & mainFrameWrapper_)
{
gd::BaseEvent::EditEventReturnType CommentEvent::EditEvent(
wxWindow *parent_,
gd::Project &game_,
gd::Layout &scene_,
gd::MainFrameWrapper &mainFrameWrapper_) {
#if !defined(GD_NO_WX_GUI)
EditComment dialog(parent_, *this);
if ( dialog.ShowModal() == 0) return Cancelled;
EditComment dialog(parent_, *this);
if (dialog.ShowModal() == 0) return Cancelled;
#endif
return ChangesMadeButNoNeedForEventsRecompilation;
return ChangesMadeButNoNeedForEventsRecompilation;
}
/**
* Render the event
*/
void CommentEvent::Render(wxDC & dc, int x, int y, unsigned int width, gd::EventsEditorItemsAreas & areas, gd::EventsEditorSelection & selection, const gd::Platform &)
{
void CommentEvent::Render(wxDC &dc,
int x,
int y,
unsigned int width,
gd::EventsEditorItemsAreas &areas,
gd::EventsEditorSelection &selection,
const gd::Platform &) {
#if !defined(GD_NO_WX_GUI)
x += 1; //Small border
x += 1; // Small border
gd::EventsRenderingHelper *renderingHelper = gd::EventsRenderingHelper::Get();
renderingHelper->GetHTMLRenderer().SetDC(&dc);
renderingHelper->GetHTMLRenderer().SetStandardFonts(
renderingHelper->GetNiceFont().GetPointSize());
// Prepare HTML texts
gd::String str1 =
"<FONT color=" +
wxColour(textR, textG, textB).GetAsString(wxC2S_HTML_SYNTAX) + ">" +
renderingHelper->GetHTMLText(com1) + "</FONT>";
gd::String str2 =
"<FONT color=" +
wxColour(textR, textG, textB).GetAsString(wxC2S_HTML_SYNTAX) + ">" +
renderingHelper->GetHTMLText(com2) + "</FONT>";
// Calculate space constraints
const int sideSeparation = 3; // Spacing between text and borders
unsigned int textWidth = com2.empty() ? width - sideSeparation * 2
: width / 2 - sideSeparation * 2;
renderingHelper->GetHTMLRenderer().SetSize(textWidth, 9999);
renderingHelper->GetHTMLRenderer().SetHtmlText(str1);
unsigned int text1Height =
renderingHelper->GetHTMLRenderer().GetTotalHeight();
renderingHelper->GetHTMLRenderer().SetHtmlText(str2);
unsigned int text2Height =
renderingHelper->GetHTMLRenderer().GetTotalHeight();
// Prepare background
dc.SetBrush(wxBrush(wxColour(r, v, b), wxBRUSHSTYLE_TRANSPARENT));
dc.SetPen(wxPen(wxColour(r / 2, v / 2, b / 2), 1));
// Draw the background
unsigned int height = std::max(text1Height, text2Height) + sideSeparation * 2;
height = std::max(height, (unsigned int)15);
wxRect rectangle(x, y, width - 2, height);
dc.GradientFillLinear(rectangle,
wxColour(r + 20 > 255 ? 255 : r + 20,
v + 20 > 255 ? 255 : v + 20,
b + 20 > 255 ? 255 : b + 20),
wxColour(r, v, b),
wxSOUTH);
dc.DrawRectangle(rectangle);
// Draw text
{
renderingHelper->GetHTMLRenderer().SetHtmlText(str1);
wxArrayInt neededArray;
renderingHelper->GetHTMLRenderer().Render(
x + sideSeparation, y + sideSeparation, neededArray);
}
if (!com2.empty()) // Optional text
{
renderingHelper->GetHTMLRenderer().SetHtmlText(str2);
wxArrayInt neededArray;
renderingHelper->GetHTMLRenderer().Render(
x + sideSeparation + textWidth + sideSeparation,
y + sideSeparation,
neededArray);
}
#endif
}
unsigned int CommentEvent::GetRenderedHeight(unsigned int width,
const gd::Platform &) const {
#if !defined(GD_NO_WX_GUI)
if (eventHeightNeedUpdate) {
gd::EventsRenderingHelper *renderingHelper =
gd::EventsRenderingHelper::Get();
wxMemoryDC dc;
wxBitmap fakeBmp(1, 1);
dc.SelectObject(fakeBmp);
gd::EventsRenderingHelper * renderingHelper = gd::EventsRenderingHelper::Get();
renderingHelper->GetHTMLRenderer().SetDC(&dc);
renderingHelper->GetHTMLRenderer().SetStandardFonts(renderingHelper->GetNiceFont().GetPointSize());
renderingHelper->GetHTMLRenderer().SetStandardFonts(
renderingHelper->GetNiceFont().GetPointSize());
//Prepare HTML texts
gd::String str1 = "<FONT color="+wxColour(textR, textG, textB).GetAsString(wxC2S_HTML_SYNTAX)+">"+renderingHelper->GetHTMLText(com1)+"</FONT>";
gd::String str2 = "<FONT color="+wxColour(textR, textG, textB).GetAsString(wxC2S_HTML_SYNTAX)+">"+renderingHelper->GetHTMLText(com2)+"</FONT>";
gd::String str1 =
"<FONT color=" +
wxColour(textR, textG, textB).GetAsString(wxC2S_HTML_SYNTAX) + ">" +
renderingHelper->GetHTMLText(com1) + "</FONT>";
gd::String str2 =
"<FONT color=" +
wxColour(textR, textG, textB).GetAsString(wxC2S_HTML_SYNTAX) + ">" +
renderingHelper->GetHTMLText(com2) + "</FONT>";
//Calculate space constraints
const int sideSeparation = 3; //Spacing between text and borders
// Calculate space constraints
const int sideSeparation = 3; // Spacing between text and borders
unsigned int textWidth = com2.empty() ? width-sideSeparation*2 : width/2-sideSeparation*2;
unsigned int textWidth = com2.empty() ? width - sideSeparation * 2
: width / 2 - sideSeparation * 2;
renderingHelper->GetHTMLRenderer().SetSize(textWidth, 9999);
renderingHelper->GetHTMLRenderer().SetHtmlText(str1);
unsigned int text1Height = renderingHelper->GetHTMLRenderer().GetTotalHeight();
unsigned int text1Height =
renderingHelper->GetHTMLRenderer().GetTotalHeight();
renderingHelper->GetHTMLRenderer().SetHtmlText(str2);
unsigned int text2Height = renderingHelper->GetHTMLRenderer().GetTotalHeight();
unsigned int text2Height =
renderingHelper->GetHTMLRenderer().GetTotalHeight();
//Prepare background
dc.SetBrush(wxBrush(wxColour(r, v, b), wxBRUSHSTYLE_TRANSPARENT));
dc.SetPen(wxPen(wxColour(r/2, v/2, b/2), 1));
//Draw the background
unsigned int height = std::max(text1Height, text2Height)+sideSeparation*2;
unsigned int height =
std::max(text1Height, text2Height) + sideSeparation * 2;
height = std::max(height, (unsigned int)15);
wxRect rectangle(x, y, width-2, height);
dc.GradientFillLinear(rectangle, wxColour(r+20 > 255 ? 255 : r+20, v+20 > 255 ? 255 : v+20, b+20 > 255 ? 255 : b+20), wxColour(r, v, b), wxSOUTH);
dc.DrawRectangle(rectangle);
//Draw text
{
renderingHelper->GetHTMLRenderer().SetHtmlText(str1);
wxArrayInt neededArray;
renderingHelper->GetHTMLRenderer().Render(x + sideSeparation, y+sideSeparation, neededArray);
}
if ( !com2.empty() ) //Optional text
{
renderingHelper->GetHTMLRenderer().SetHtmlText(str2);
wxArrayInt neededArray;
renderingHelper->GetHTMLRenderer().Render(x + sideSeparation + textWidth + sideSeparation, y+sideSeparation, neededArray);
}
renderedHeight = height;
}
#endif
return renderedHeight + 2; // 2 : 2 small borders
}
unsigned int CommentEvent::GetRenderedHeight(unsigned int width, const gd::Platform &) const
{
#if !defined(GD_NO_WX_GUI)
if ( eventHeightNeedUpdate )
{
gd::EventsRenderingHelper * renderingHelper = gd::EventsRenderingHelper::Get();
wxMemoryDC dc;
wxBitmap fakeBmp(1,1);
dc.SelectObject(fakeBmp);
renderingHelper->GetHTMLRenderer().SetDC(&dc);
renderingHelper->GetHTMLRenderer().SetStandardFonts(renderingHelper->GetNiceFont().GetPointSize());
gd::String str1 = "<FONT color="+wxColour(textR, textG, textB).GetAsString(wxC2S_HTML_SYNTAX)+">"+renderingHelper->GetHTMLText(com1)+"</FONT>";
gd::String str2 = "<FONT color="+wxColour(textR, textG, textB).GetAsString(wxC2S_HTML_SYNTAX)+">"+renderingHelper->GetHTMLText(com2)+"</FONT>";
//Calculate space constraints
const int sideSeparation = 3; //Spacing between text and borders
unsigned int textWidth = com2.empty() ? width-sideSeparation*2 : width/2-sideSeparation*2;
renderingHelper->GetHTMLRenderer().SetSize(textWidth, 9999);
renderingHelper->GetHTMLRenderer().SetHtmlText(str1);
unsigned int text1Height = renderingHelper->GetHTMLRenderer().GetTotalHeight();
renderingHelper->GetHTMLRenderer().SetHtmlText(str2);
unsigned int text2Height = renderingHelper->GetHTMLRenderer().GetTotalHeight();
unsigned int height = std::max(text1Height, text2Height)+sideSeparation*2;
height = std::max(height, (unsigned int)15);
renderedHeight = height;
}
#endif
return renderedHeight+2;//2 : 2 small borders
}
}
} // namespace gd

View File

@@ -1,61 +1,105 @@
/*
* GDevelop Core
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights reserved.
* This project is released under the MIT License.
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights
* reserved. This project is released under the MIT License.
*/
#ifndef COMMENTEVENT_H
#define COMMENTEVENT_H
#include "GDCore/Events/Event.h"
class TiXmlElement;
namespace gd { class Layout; }
namespace gd { class Project; }
namespace gd { class MainFrameWrapper; }
namespace gd { class Project; }
namespace gd {
class Layout;
}
namespace gd {
class Project;
}
namespace gd {
class MainFrameWrapper;
}
namespace gd {
class Project;
}
class wxWindow;
namespace gd { class EventsEditorItemsAreas; }
namespace gd { class EventsEditorSelection; }
namespace gd {
class EventsEditorItemsAreas;
}
namespace gd {
class EventsEditorSelection;
}
namespace gd
{
namespace gd {
/**
* \brief Allows to add a text in the events editor.
*/
class GD_CORE_API CommentEvent : public gd::BaseEvent
{
public:
CommentEvent() : BaseEvent(), r(255), v(230), b(109), textR(0), textG(0), textB(0) {};
virtual ~CommentEvent() {};
virtual gd::CommentEvent * Clone() const { return new CommentEvent(*this);}
class GD_CORE_API CommentEvent : public gd::BaseEvent {
public:
CommentEvent()
: BaseEvent(), r(255), v(230), b(109), textR(0), textG(0), textB(0){};
virtual ~CommentEvent(){};
virtual gd::CommentEvent* Clone() const { return new CommentEvent(*this); }
virtual void SerializeTo(SerializerElement & element) const;
virtual void UnserializeFrom(gd::Project & project, const SerializerElement & element);
int GetBackgroundColorRed() const { return r; }
int GetBackgroundColorGreen() const { return v; }
int GetBackgroundColorBlue() const { return b; }
void SetBackgroundColor(int r_, int g_, int b_) {
r = r_;
v = g_;
b = b_;
}
int r; ///< Background color Red component
int v; ///< Background color Green component
int b; ///< Background color Blue component
int GetTextColorRed() const { return textR; }
int GetTextColorGreen() const { return textG; }
int GetTextColorBlue() const { return textB; }
void SetTextColor(int r_, int g_, int b_) {
textR = r_;
textG = g_;
textB = b_;
}
int textR; ///< Text color Red component
int textG; ///< Text color Green component
int textB; ///< Text color Blue component
const gd::String& GetComment() const { return com1; }
void SetComment(const gd::String& comment) { com1 = comment; }
gd::String com1; ///< Comment gd::String
gd::String com2; ///< Optional second comment gd::String
virtual void SerializeTo(SerializerElement& element) const;
virtual void UnserializeFrom(gd::Project& project,
const SerializerElement& element);
/**
* Called by event editor to draw the event.
*/
virtual void Render(wxDC & dc, int x, int y, unsigned int width, gd::EventsEditorItemsAreas & areas, gd::EventsEditorSelection & selection, const gd::Platform & );
int r; ///< Background color Red component
int v; ///< Background color Green component
int b; ///< Background color Blue component
/**
* Must return the height of the event when rendered
*/
virtual unsigned int GetRenderedHeight(unsigned int width, const gd::Platform & ) const;
int textR; ///< Text color Red component
int textG; ///< Text color Green component
int textB; ///< Text color Blue component
virtual EditEventReturnType EditEvent(wxWindow* parent_, gd::Project & game_, gd::Layout & scene_, gd::MainFrameWrapper & mainFrameWrapper_);
gd::String com1; ///< Comment
gd::String com2; ///< Optional second column comment, deprecated
/**
* Called by event editor to draw the event.
*/
virtual void Render(wxDC& dc,
int x,
int y,
unsigned int width,
gd::EventsEditorItemsAreas& areas,
gd::EventsEditorSelection& selection,
const gd::Platform&);
/**
* Must return the height of the event when rendered
*/
virtual unsigned int GetRenderedHeight(unsigned int width,
const gd::Platform&) const;
virtual EditEventReturnType EditEvent(
wxWindow* parent_,
gd::Project& game_,
gd::Layout& scene_,
gd::MainFrameWrapper& mainFrameWrapper_);
};
}
} // namespace gd
#endif // COMMENTEVENT_H
#endif // COMMENTEVENT_H

View File

@@ -1,164 +1,198 @@
/*
* GDevelop Core
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights reserved.
* This project is released under the MIT License.
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights
* reserved. This project is released under the MIT License.
*/
#include "ForEachEvent.h"
#include <iostream>
#include "GDCore/TinyXml/tinyxml.h"
#include "GDCore/IDE/Dialogs/EventsEditor/EventsRenderingHelper.h"
#include "GDCore/IDE/Dialogs/EventsEditor/EventsEditorItemsAreas.h"
#include "GDCore/IDE/Dialogs/EventsEditor/EventsEditorSelection.h"
#include "GDCore/Serialization/SerializerElement.h"
#include "GDCore/Events/Serialization.h"
#include "GDCore/Events/CodeGeneration/EventsCodeGenerationContext.h"
#include "GDCore/Events/CodeGeneration/EventsCodeGenerator.h"
#include "GDCore/Events/CodeGeneration/ExpressionsCodeGeneration.h"
#include "GDCore/Events/Serialization.h"
#include "GDCore/Events/Tools/EventsCodeNameMangler.h"
#include "GDCore/Events/CodeGeneration/EventsCodeGenerationContext.h"
#include "GDCore/IDE/Dialogs/EditForEachEvent.h"
#include "GDCore/IDE/Dialogs/EventsEditor/EventsEditorItemsAreas.h"
#include "GDCore/IDE/Dialogs/EventsEditor/EventsEditorSelection.h"
#include "GDCore/IDE/Dialogs/EventsEditor/EventsRenderingHelper.h"
#include "GDCore/Serialization/SerializerElement.h"
#include "GDCore/TinyXml/tinyxml.h"
using namespace std;
namespace gd
{
namespace gd {
ForEachEvent::ForEachEvent() :
BaseEvent(),
objectsToPick(""),
objectsToPickSelected(false)
{
ForEachEvent::ForEachEvent()
: BaseEvent(), objectsToPick(""), objectsToPickSelected(false) {}
vector<gd::InstructionsList*> ForEachEvent::GetAllConditionsVectors() {
vector<gd::InstructionsList*> allConditions;
allConditions.push_back(&conditions);
return allConditions;
}
vector < gd::InstructionsList* > ForEachEvent::GetAllConditionsVectors()
{
vector < gd::InstructionsList* > allConditions;
allConditions.push_back(&conditions);
vector<gd::InstructionsList*> ForEachEvent::GetAllActionsVectors() {
vector<gd::InstructionsList*> allActions;
allActions.push_back(&actions);
return allConditions;
return allActions;
}
vector < gd::InstructionsList* > ForEachEvent::GetAllActionsVectors()
{
vector < gd::InstructionsList* > allActions;
allActions.push_back(&actions);
vector<gd::Expression*> ForEachEvent::GetAllExpressions() {
vector<gd::Expression*> allExpressions;
allExpressions.push_back(&objectsToPick);
return allActions;
return allExpressions;
}
vector<const gd::InstructionsList*> ForEachEvent::GetAllConditionsVectors()
const {
vector<const gd::InstructionsList*> allConditions;
allConditions.push_back(&conditions);
return allConditions;
}
vector < gd::Expression* > ForEachEvent::GetAllExpressions()
{
vector < gd::Expression* > allExpressions;
allExpressions.push_back(&objectsToPick);
vector<const gd::InstructionsList*> ForEachEvent::GetAllActionsVectors() const {
vector<const gd::InstructionsList*> allActions;
allActions.push_back(&actions);
return allExpressions;
}
vector < const gd::InstructionsList* > ForEachEvent::GetAllConditionsVectors() const
{
vector < const gd::InstructionsList* > allConditions;
allConditions.push_back(&conditions);
return allConditions;
return allActions;
}
vector < const gd::InstructionsList* > ForEachEvent::GetAllActionsVectors() const
{
vector < const gd::InstructionsList* > allActions;
allActions.push_back(&actions);
vector<const gd::Expression*> ForEachEvent::GetAllExpressions() const {
vector<const gd::Expression*> allExpressions;
allExpressions.push_back(&objectsToPick);
return allActions;
return allExpressions;
}
vector < const gd::Expression* > ForEachEvent::GetAllExpressions() const
{
vector < const gd::Expression* > allExpressions;
allExpressions.push_back(&objectsToPick);
return allExpressions;
void ForEachEvent::SerializeTo(SerializerElement& element) const {
element.AddChild("object").SetValue(objectsToPick.GetPlainString());
gd::EventsListSerialization::SerializeInstructionsTo(
conditions, element.AddChild("conditions"));
gd::EventsListSerialization::SerializeInstructionsTo(
actions, element.AddChild("actions"));
gd::EventsListSerialization::SerializeEventsTo(events,
element.AddChild("events"));
}
void ForEachEvent::SerializeTo(SerializerElement & element) const
{
element.AddChild("object").SetValue(objectsToPick.GetPlainString());
gd::EventsListSerialization::SaveConditions(conditions, element.AddChild("conditions"));
gd::EventsListSerialization::SaveActions(actions, element.AddChild("actions"));
gd::EventsListSerialization::SerializeEventsTo(events, element.AddChild("events"));
}
void ForEachEvent::UnserializeFrom(gd::Project & project, const SerializerElement & element)
{
objectsToPick = gd::Expression(element.GetChild("object", 0, "Object").GetValue().GetString());
gd::EventsListSerialization::OpenConditions(project, conditions, element.GetChild("conditions", 0, "Conditions"));
gd::EventsListSerialization::OpenActions(project, actions, element.GetChild("actions", 0, "Actions"));
gd::EventsListSerialization::UnserializeEventsFrom(project, events, element.GetChild("events", 0, "Events"));
void ForEachEvent::UnserializeFrom(gd::Project& project,
const SerializerElement& element) {
objectsToPick = gd::Expression(
element.GetChild("object", 0, "Object").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"));
}
/**
* Render the event in the bitmap
*/
void ForEachEvent::Render(wxDC & dc, int x, int y, unsigned int width, gd::EventsEditorItemsAreas & areas, gd::EventsEditorSelection & selection, const gd::Platform & platform)
{
void ForEachEvent::Render(wxDC& dc,
int x,
int y,
unsigned int width,
gd::EventsEditorItemsAreas& areas,
gd::EventsEditorSelection& selection,
const gd::Platform& platform) {
#if !defined(GD_NO_WX_GUI)
gd::EventsRenderingHelper * renderingHelper = gd::EventsRenderingHelper::Get();
gd::EventsRenderingHelper* renderingHelper = gd::EventsRenderingHelper::Get();
int border = renderingHelper->instructionsListBorder;
const int forEachTextHeight = 20;
// Draw header rectangle
wxRect headerRect(x, y, width, forEachTextHeight);
renderingHelper->DrawNiceRectangle(dc, headerRect);
// For Each text
dc.SetFont(renderingHelper->GetNiceFont().Bold());
if (!IsDisabled())
dc.SetTextForeground(wxColour(0, 0, 0));
else
dc.SetTextForeground(wxColour(160, 160, 160));
dc.DrawText(_("For each object") + " " + objectsToPick.GetPlainString() +
_(", repeat :"),
x + 4,
y + 3);
// Draw conditions rectangle
wxRect rect(x,
y + forEachTextHeight,
renderingHelper->GetConditionsColumnWidth() + border,
GetRenderedHeight(width, platform) - forEachTextHeight);
renderingHelper->DrawNiceRectangle(dc, rect);
// Draw actions and conditions
renderingHelper->DrawConditionsList(
conditions,
dc,
x + border,
y + forEachTextHeight + border,
renderingHelper->GetConditionsColumnWidth() - border,
this,
areas,
selection,
platform);
renderingHelper->DrawActionsList(
actions,
dc,
x + renderingHelper->GetConditionsColumnWidth() + border,
y + forEachTextHeight + border,
width - renderingHelper->GetConditionsColumnWidth() - border * 2,
this,
areas,
selection,
platform);
#endif
}
unsigned int ForEachEvent::GetRenderedHeight(
unsigned int width, const gd::Platform& platform) const {
#if !defined(GD_NO_WX_GUI)
if (eventHeightNeedUpdate) {
gd::EventsRenderingHelper* renderingHelper =
gd::EventsRenderingHelper::Get();
int border = renderingHelper->instructionsListBorder;
const int forEachTextHeight = 20;
//Draw header rectangle
wxRect headerRect(x, y, width, forEachTextHeight);
renderingHelper->DrawNiceRectangle(dc, headerRect);
// Get maximum height needed
int conditionsHeight = renderingHelper->GetRenderedConditionsListHeight(
conditions,
renderingHelper->GetConditionsColumnWidth() - border,
platform);
int actionsHeight = renderingHelper->GetRenderedActionsListHeight(
actions,
width - renderingHelper->GetConditionsColumnWidth() - border * 2,
platform);
//For Each text
dc.SetFont( renderingHelper->GetNiceFont().Bold() );
dc.SetTextForeground(wxColour(0,0,0));
dc.DrawText( _("For each object") + " " + objectsToPick.GetPlainString() + _(", repeat :"), x + 4, y + 3 );
renderedHeight =
((conditionsHeight > actionsHeight ? conditionsHeight : actionsHeight) +
forEachTextHeight) +
border * 2;
eventHeightNeedUpdate = false;
}
//Draw conditions rectangle
wxRect rect(x, y+forEachTextHeight, renderingHelper->GetConditionsColumnWidth()+border, GetRenderedHeight(width, platform)-forEachTextHeight);
renderingHelper->DrawNiceRectangle(dc, rect);
//Draw actions and conditions
renderingHelper->DrawConditionsList(conditions, dc,
x+border,
y+forEachTextHeight+border,
renderingHelper->GetConditionsColumnWidth()-border, this, areas, selection, platform);
renderingHelper->DrawActionsList(actions, dc,
x+renderingHelper->GetConditionsColumnWidth()+border,
y+forEachTextHeight+border,
width-renderingHelper->GetConditionsColumnWidth()-border*2, this, areas, selection, platform);
#endif
}
unsigned int ForEachEvent::GetRenderedHeight(unsigned int width, const gd::Platform & platform) const
{
#if !defined(GD_NO_WX_GUI)
if ( eventHeightNeedUpdate )
{
gd::EventsRenderingHelper * renderingHelper = gd::EventsRenderingHelper::Get();
int border = renderingHelper->instructionsListBorder;
const int forEachTextHeight = 20;
//Get maximum height needed
int conditionsHeight = renderingHelper->GetRenderedConditionsListHeight(conditions, renderingHelper->GetConditionsColumnWidth()-border, platform);
int actionsHeight = renderingHelper->GetRenderedActionsListHeight(actions, width-renderingHelper->GetConditionsColumnWidth()-border*2, platform);
renderedHeight = (( conditionsHeight > actionsHeight ? conditionsHeight : actionsHeight ) + forEachTextHeight)+border*2;
eventHeightNeedUpdate = false;
}
return renderedHeight;
return renderedHeight;
#else
return 0;
return 0;
#endif
}
gd::BaseEvent::EditEventReturnType ForEachEvent::EditEvent(wxWindow* parent_, gd::Project & game_, gd::Layout & scene_, gd::MainFrameWrapper & mainFrameWrapper_)
{
gd::BaseEvent::EditEventReturnType ForEachEvent::EditEvent(
wxWindow* parent_,
gd::Project& game_,
gd::Layout& scene_,
gd::MainFrameWrapper& mainFrameWrapper_) {
#if !defined(GD_NO_WX_GUI)
EditForEachEvent dialog(parent_, *this, game_, scene_);
if ( dialog.ShowModal() == 0 ) return Cancelled;
EditForEachEvent dialog(parent_, *this, game_, scene_);
if (dialog.ShowModal() == 0) return Cancelled;
#endif
return ChangesMade;
return ChangesMade;
}
}
} // namespace gd

View File

@@ -1,7 +1,7 @@
/*
* GDevelop Core
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights reserved.
* This project is released under the MIT License.
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights
* reserved. This project is released under the MIT License.
*/
#ifndef FOREACHEVENT_H
@@ -9,79 +9,107 @@
#include "GDCore/Events/Event.h"
#include "GDCore/Events/EventsList.h"
class RuntimeScene;
namespace gd { class Instruction; }
namespace gd { class Project; }
namespace gd { class MainFrameWrapper; }
namespace gd {
class Instruction;
}
namespace gd {
class Project;
}
namespace gd {
class MainFrameWrapper;
}
class TiXmlElement;
namespace gd { class EventsEditorItemsAreas; }
namespace gd { class EventsEditorSelection; }
namespace gd { class Layout; }
namespace gd {
class EventsEditorItemsAreas;
}
namespace gd {
class EventsEditorSelection;
}
namespace gd {
class Layout;
}
class wxWindow;
namespace gd
{
namespace gd {
/**
* \brief Event repeated for each object of a list.
*
* Each time the event is repeated, only the specific object of the list is picked.
* Each time the event is repeated, only the specific object of the list is
* picked.
*/
class GD_CORE_API ForEachEvent : public gd::BaseEvent
{
public:
ForEachEvent();
virtual ~ForEachEvent() {};
virtual gd::ForEachEvent * Clone() const { return new ForEachEvent(*this);}
class GD_CORE_API ForEachEvent : public gd::BaseEvent {
public:
ForEachEvent();
virtual ~ForEachEvent(){};
virtual gd::ForEachEvent* Clone() const { return new ForEachEvent(*this); }
virtual bool IsExecutable() const {return true;}
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;};
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& GetConditions() const { return conditions; };
gd::InstructionsList& GetConditions() { return conditions; };
const gd::InstructionsList & GetActions() const { return actions; };
gd::InstructionsList & GetActions() { return actions; };
const gd::InstructionsList& GetActions() const { return actions; };
gd::InstructionsList& GetActions() { return actions; };
const gd::String & GetObjectToPick() const { return objectsToPick.GetPlainString(); };
void SetObjectToPick(gd::String objectsToPick_) { objectsToPick = gd::Expression(objectsToPick_); };
const gd::String& GetObjectToPick() const {
return objectsToPick.GetPlainString();
};
void SetObjectToPick(gd::String objectsToPick_) {
objectsToPick = gd::Expression(objectsToPick_);
};
virtual std::vector < const gd::InstructionsList* > GetAllConditionsVectors() const;
virtual std::vector < const gd::InstructionsList* > GetAllActionsVectors() const;
virtual std::vector < const gd::Expression* > GetAllExpressions() const;
virtual std::vector < gd::InstructionsList* > GetAllConditionsVectors();
virtual std::vector < gd::InstructionsList* > GetAllActionsVectors();
virtual std::vector < gd::Expression* > GetAllExpressions();
virtual std::vector<const gd::InstructionsList*> GetAllConditionsVectors()
const;
virtual std::vector<const gd::InstructionsList*> GetAllActionsVectors() const;
virtual std::vector<const gd::Expression*> GetAllExpressions() const;
virtual std::vector<gd::InstructionsList*> GetAllConditionsVectors();
virtual std::vector<gd::InstructionsList*> GetAllActionsVectors();
virtual std::vector<gd::Expression*> GetAllExpressions();
virtual void SerializeTo(SerializerElement & element) const;
virtual void UnserializeFrom(gd::Project & project, const SerializerElement & element);
virtual void SerializeTo(SerializerElement& element) const;
virtual void UnserializeFrom(gd::Project& project,
const SerializerElement& element);
/**
* Called by event editor to draw the event.
*/
virtual void Render(wxDC & dc, int x, int y, unsigned int width, gd::EventsEditorItemsAreas & areas, gd::EventsEditorSelection & selection, const gd::Platform & platform);
/**
* Called by event editor to draw the event.
*/
virtual void Render(wxDC& dc,
int x,
int y,
unsigned int width,
gd::EventsEditorItemsAreas& areas,
gd::EventsEditorSelection& selection,
const gd::Platform& platform);
/**
* Must return the height of the event when rendered
*/
virtual unsigned int GetRenderedHeight(unsigned int width, const gd::Platform & platform) const;
/**
* Must return the height of the event when rendered
*/
virtual unsigned int GetRenderedHeight(unsigned int width,
const gd::Platform& platform) const;
/**
* Called when the user want to edit the event
*/
virtual EditEventReturnType EditEvent(wxWindow* parent_, gd::Project & game_, gd::Layout & scene_, gd::MainFrameWrapper & mainFrameWrapper_);
/**
* Called when the user want to edit the event
*/
virtual EditEventReturnType EditEvent(
wxWindow* parent_,
gd::Project& game_,
gd::Layout& scene_,
gd::MainFrameWrapper& mainFrameWrapper_);
private:
gd::Expression objectsToPick;
gd::InstructionsList conditions;
gd::InstructionsList actions;
gd::EventsList events;
private:
gd::Expression objectsToPick;
gd::InstructionsList conditions;
gd::InstructionsList actions;
gd::EventsList events;
bool objectsToPickSelected;
bool objectsToPickSelected;
};
}
} // namespace gd
#endif // FOREACHEVENT_H
#endif // FOREACHEVENT_H

View File

@@ -1,7 +1,7 @@
/*
* GDevelop Core
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights reserved.
* This project is released under the MIT License.
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights
* reserved. This project is released under the MIT License.
*/
#include "GroupEvent.h"
@@ -10,155 +10,154 @@
#include <wx/renderer.h>
#include "GDCore/IDE/Dialogs/MainFrameWrapper.h"
#endif
#include "GDCore/IDE/Dialogs/EventsEditor/EventsRenderingHelper.h"
#include "GDCore/CommonTools.h"
#include "GDCore/Events/CodeGeneration/EventsCodeGenerationContext.h"
#include "GDCore/Events/CodeGeneration/EventsCodeGenerator.h"
#include "GDCore/Events/Serialization.h"
#include "GDCore/IDE/Dialogs/EventStoreDialog.h"
#include "GDCore/IDE/Dialogs/EventsEditor/EventsEditorItemsAreas.h"
#include "GDCore/IDE/Dialogs/EventsEditor/EventsEditorSelection.h"
#include "GDCore/Events/Serialization.h"
#include "GDCore/IDE/Dialogs/EventsEditor/EventsRenderingHelper.h"
#include "GDCore/IDE/Dialogs/GroupEventDialog.h"
#include "GDCore/Serialization/SerializerElement.h"
#include "GDCore/TinyXml/tinyxml.h"
#include "GDCore/CommonTools.h"
#include "GDCore/Events/CodeGeneration/EventsCodeGenerator.h"
#include "GDCore/Events/CodeGeneration/EventsCodeGenerationContext.h"
#include "GDCore/IDE/Dialogs/GroupEventDialog.h"
#include "GDCore/IDE/Dialogs/EventStoreDialog.h"
using namespace std;
namespace gd
{
namespace gd {
GroupEvent::GroupEvent() :
BaseEvent(),
creationTime(0),
colorR(74),
colorG(176),
colorB(228)
{
GroupEvent::GroupEvent()
: BaseEvent(), creationTime(0), colorR(74), colorG(176), colorB(228) {}
void GroupEvent::SerializeTo(SerializerElement& element) const {
element.SetAttribute("name", name);
element.SetAttribute("source", source);
element.SetAttribute("creationTime", (int)creationTime);
element.SetAttribute("colorR", (int)colorR);
element.SetAttribute("colorG", (int)colorG);
element.SetAttribute("colorB", (int)colorB);
gd::EventsListSerialization::SerializeEventsTo(events,
element.AddChild("events"));
gd::SerializerElement& parametersElement = element.AddChild("parameters");
parametersElement.ConsiderAsArrayOf("parameter");
for (std::size_t i = 0; i < parameters.size(); ++i)
parametersElement.AddChild("parameter").SetValue(parameters[i]);
}
void GroupEvent::SerializeTo(SerializerElement & element) const
{
element.SetAttribute("name", name);
element.SetAttribute("source", source);
element.SetAttribute("creationTime", (int)creationTime);
element.SetAttribute("colorR", (int)colorR);
element.SetAttribute("colorG", (int)colorG);
element.SetAttribute("colorB", (int)colorB);
gd::EventsListSerialization::SerializeEventsTo(events, element.AddChild("events"));
void GroupEvent::UnserializeFrom(gd::Project& project,
const SerializerElement& element) {
name = element.GetStringAttribute("name");
source = element.GetStringAttribute("source");
creationTime = element.GetIntAttribute("creationTime");
colorR = element.GetIntAttribute("colorR");
colorG = element.GetIntAttribute("colorG");
colorB = element.GetIntAttribute("colorB");
gd::EventsListSerialization::UnserializeEventsFrom(
project, events, element.GetChild("events"));
gd::SerializerElement & parametersElement = element.AddChild("parameters");
parametersElement.ConsiderAsArrayOf("parameter");
for ( std::size_t i = 0;i < parameters.size();++i)
parametersElement.AddChild("parameter").SetValue(parameters[i]);
parameters.clear();
gd::SerializerElement& parametersElement = element.GetChild("parameters");
parametersElement.ConsiderAsArrayOf("parameters");
for (std::size_t i = 0; i < parametersElement.GetChildrenCount(); ++i)
parameters.push_back(parametersElement.GetChild(i).GetValue().GetString());
}
void GroupEvent::UnserializeFrom(gd::Project & project, const SerializerElement & element)
{
name = element.GetStringAttribute("name");
source = element.GetStringAttribute("source");
creationTime = element.GetIntAttribute("creationTime");
colorR = element.GetIntAttribute("colorR");
colorG = element.GetIntAttribute("colorG");
colorB = element.GetIntAttribute("colorB");
gd::EventsListSerialization::UnserializeEventsFrom(project, events, element.GetChild("events"));
parameters.clear();
gd::SerializerElement & parametersElement = element.GetChild("parameters");
parametersElement.ConsiderAsArrayOf("parameters");
for ( std::size_t i = 0;i < parametersElement.GetChildrenCount();++i)
parameters.push_back(parametersElement.GetChild(i).GetValue().GetString());
}
gd::BaseEvent::EditEventReturnType GroupEvent::EditEvent(wxWindow* parent_, gd::Project & project, gd::Layout & scene, gd::MainFrameWrapper & mainFrameWrapper)
{
if (events.IsEmpty())
events.InsertNewEvent(project, "BuiltinCommonInstructions::Standard");
gd::BaseEvent::EditEventReturnType GroupEvent::EditEvent(
wxWindow* parent_,
gd::Project& project,
gd::Layout& scene,
gd::MainFrameWrapper& mainFrameWrapper) {
if (events.IsEmpty())
events.InsertNewEvent(project, "BuiltinCommonInstructions::Standard");
#if !defined(GD_NO_WX_GUI)
if (source.empty())
{
GroupEventDialog dialog(parent_, *this);
dialog.ShowModal();
return ChangesMadeButNoNeedForEventsRecompilation;
if (source.empty()) {
GroupEventDialog dialog(parent_, *this);
dialog.ShowModal();
return ChangesMadeButNoNeedForEventsRecompilation;
} else {
gd::EventStoreDialog dialog(parent_, project, scene);
size_t found = source.rfind("/");
if (found != gd::String::npos && found < source.size() - 1) {
gd::String sourceId = source.substr(found + 1, source.size());
dialog.RefreshWith(sourceId, parameters);
}
else
{
gd::EventStoreDialog dialog(parent_, project, scene);
size_t found = source.rfind("/");
if (found != gd::String::npos && found < source.size()-1) {
gd::String sourceId = source.substr(found+1, source.size());
dialog.RefreshWith(sourceId, parameters);
}
if (dialog.ShowModal() != 1) return Cancelled;
if (dialog.ShowModal() != 1) return Cancelled;
//Insert new events
*this = dialog.GetGroupEvent();
return ChangesMade;
}
// Insert new events
*this = dialog.GetGroupEvent();
return ChangesMade;
}
#else
return Cancelled;
return Cancelled;
#endif
}
void GroupEvent::SetBackgroundColor(unsigned int colorR_, unsigned int colorG_, unsigned int colorB_)
{
colorR = colorR_;
colorG = colorG_;
colorB = colorB_;
void GroupEvent::SetBackgroundColor(unsigned int colorR_,
unsigned int colorG_,
unsigned int colorB_) {
colorR = colorR_;
colorG = colorG_;
colorB = colorB_;
}
/**
* Render the event in the bitmap
*/
void GroupEvent::Render(wxDC & dc, int x, int y, unsigned int width, gd::EventsEditorItemsAreas & areas, gd::EventsEditorSelection & selection, const gd::Platform & platform)
{
void GroupEvent::Render(wxDC& dc,
int x,
int y,
unsigned int width,
gd::EventsEditorItemsAreas& areas,
gd::EventsEditorSelection& selection,
const gd::Platform& platform) {
#if !defined(GD_NO_WX_GUI)
wxString groupTitle = name.empty() ? _("Untitled group") : wxString(name);
wxColour backgroundColor = wxColour(colorR, colorG, colorB);
wxColour textColor = colorR + colorG + colorB > 200 * 3 ? *wxBLACK : *wxWHITE;
if (IsDisabled()) {
backgroundColor.MakeDisabled();
textColor = wxColour(160, 160, 160);
}
dc.SetBrush(wxBrush(backgroundColor));
dc.SetPen(wxPen(backgroundColor.ChangeLightness(70)));
wxRect rect(x + 1, y, width - 2, GetRenderedHeight(width, platform) - 2);
dc.DrawRectangle(rect);
dc.SetTextBackground(backgroundColor);
dc.SetTextForeground(textColor);
dc.SetFont(
wxFont(12, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD));
dc.DrawText(groupTitle, x + 5, y + 5);
#endif
}
unsigned int GroupEvent::GetRenderedHeight(unsigned int width,
const gd::Platform& platform) const {
#if !defined(GD_NO_WX_GUI)
if (eventHeightNeedUpdate) {
wxMemoryDC dc;
wxBitmap fakeBmp(1, 1);
dc.SelectObject(fakeBmp);
wxString groupTitle = name.empty() ? _("Untitled group") : wxString(name);
wxColour backgroundColor = wxColour(colorR, colorG, colorB);
wxColour textColor = colorR + colorG + colorB > 200*3 ? *wxBLACK : *wxWHITE;
if (IsDisabled())
{
backgroundColor.MakeDisabled();
textColor = wxColour(160, 160, 160);
}
dc.SetBrush(wxBrush(backgroundColor));
dc.SetPen(wxPen(backgroundColor.ChangeLightness(70)));
wxRect rect(x+1, y, width-2, GetRenderedHeight(width, platform)-2);
dc.DrawRectangle(rect);
dc.SetFont(wxFont(
12, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));
wxRect text = dc.GetTextExtent(groupTitle);
dc.SetTextBackground(backgroundColor);
dc.SetTextForeground(textColor);
dc.SetFont( wxFont( 12, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD ) );
dc.DrawText( groupTitle, x+5, y + 5 );
#endif
}
renderedHeight = text.GetHeight() + 10;
eventHeightNeedUpdate = false;
}
unsigned int GroupEvent::GetRenderedHeight(unsigned int width, const gd::Platform & platform) const
{
#if !defined(GD_NO_WX_GUI)
if ( eventHeightNeedUpdate )
{
wxMemoryDC dc;
wxBitmap fakeBmp(1,1);
dc.SelectObject(fakeBmp);
wxString groupTitle = name.empty() ? _("Untitled group") : wxString(name);
dc.SetFont( wxFont( 12, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL ) );
wxRect text = dc.GetTextExtent(groupTitle);
renderedHeight = text.GetHeight()+10;
eventHeightNeedUpdate = false;
}
return renderedHeight;
return renderedHeight;
#else
return 0;
return 0;
#endif
}
}
} // namespace gd

View File

@@ -1,136 +1,165 @@
/*
* GDevelop Core
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights reserved.
* This project is released under the MIT License.
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights
* reserved. This project is released under the MIT License.
*/
#if defined(GD_IDE_ONLY)
#ifndef GDCORE_GROUPEVENT_H
#define GDCORE_GROUPEVENT_H
#include "GDCore/Events/Event.h"
#include "GDCore/Events/Instruction.h"
#include "GDCore/Events/EventsList.h"
namespace gd { class Instruction; }
namespace gd { class Project; }
#include "GDCore/Events/Instruction.h"
namespace gd {
class Instruction;
}
namespace gd {
class Project;
}
class RuntimeScene;
class TiXmlElement;
class EventsCodeGenerationContext;
namespace gd { class EventsEditorItemsAreas; }
namespace gd { class EventsEditorSelection; }
namespace gd
{
/**
* \brief A group event, containing only sub events and some (visual only) properties.
*/
class GD_CORE_API GroupEvent : public gd::BaseEvent
{
public:
GroupEvent();
virtual ~GroupEvent() {};
virtual gd::GroupEvent * Clone() const { return new GroupEvent(*this);}
virtual bool IsExecutable() const {return true;}
/**
* \brief Get the name of the group.
*/
const gd::String & GetName() const { return name; }
/**
* \brief Change the name of the group.
*/
void SetName(const gd::String & name_) { name = name_; }
/**
* \brief Get the source of the group.
* \note The source is usually an URL from which
* the group and its events was downloaded.
*/
const gd::String & GetSource() const { return source; }
/**
* \brief Set the source of the group.
*/
void SetSource(const gd::String & source_) { source = source_; }
/**
* \brief Get the vector containing the parameters that have been used to
* create the group and its sub events.
* \note These parameters are optional and only used to remember how the
* group was created from an events template for example: if the user wants
* to update the group with a new version of the template, the parameters
* can be displayed again to easy the update.
*/
std::vector<gd::String> & GetCreationParameters() { return parameters; }
const std::vector<gd::String> & GetCreationParameters() const { return parameters; }
/**
* \brief Return the creation timestamp
* \return The timestamp, or 0 if not specified for the group.
*/
unsigned int GetCreationTimestamp() const { return creationTime; }
/**
* \brief Set timestamp of the creation of the group.
* \note This is purely optional and only used for checking for example if
* a new version of the group is available, if it has a source URL.
*/
void SetCreationTimestamp(unsigned int creationTime_) { creationTime = creationTime_; }
/**
* \brief Change the color of the group
*/
void SetBackgroundColor(unsigned int colorR, unsigned int colorG, unsigned int colorB);
/**
* \brief Get background color red component.
*/
unsigned int GetBackgroundColorR() const { return colorR; };
/**
* \brief Get background color green component.
*/
unsigned int GetBackgroundColorG() const { return colorG; };
/**
* \brief Get background color blue component.
*/
unsigned int GetBackgroundColorB() const { return colorB; };
virtual bool CanHaveSubEvents() const {return true;}
virtual const gd::EventsList & GetSubEvents() const {return events;};
virtual gd::EventsList & GetSubEvents() {return events;};
virtual void SerializeTo(SerializerElement & element) const;
virtual void UnserializeFrom(gd::Project & project, const SerializerElement & element);
virtual gd::BaseEvent::EditEventReturnType EditEvent(wxWindow* parent_, gd::Project & project, gd::Layout & scene, gd::MainFrameWrapper & mainFrameWrapper);
/**
* Called by event editor to draw the event.
*/
virtual void Render(wxDC & dc, int x, int y, unsigned int width, gd::EventsEditorItemsAreas & areas, gd::EventsEditorSelection & selection, const gd::Platform & platform);
/**
* Must return the height of the event when rendered
*/
virtual unsigned int GetRenderedHeight(unsigned int width, const gd::Platform & platform) const;
private:
EventsList events;
gd::String name; ///<Optional. A name displayed in the events editor.
gd::String source; ///< Optional. The source can contains the URL from which the group was downloaded.
unsigned int creationTime; ///< Optional. The time when the group was created from an event template.
std::vector<gd::String> parameters; ///< Optional. Can be used to remember the parameters used if the group was created from an events template.
unsigned int colorR;
unsigned int colorG;
unsigned int colorB;
};
namespace gd {
class EventsEditorItemsAreas;
}
namespace gd {
class EventsEditorSelection;
}
#endif // GDCORE_GROUPEVENT_H
namespace gd {
/**
* \brief A group event, containing only sub events and some (visual only)
* properties.
*/
class GD_CORE_API GroupEvent : public gd::BaseEvent {
public:
GroupEvent();
virtual ~GroupEvent(){};
virtual gd::GroupEvent* Clone() const { return new GroupEvent(*this); }
virtual bool IsExecutable() const { return true; }
/**
* \brief Get the name of the group.
*/
const gd::String& GetName() const { return name; }
/**
* \brief Change the name of the group.
*/
void SetName(const gd::String& name_) { name = name_; }
/**
* \brief Get the source of the group.
* \note The source is usually an URL from which
* the group and its events was downloaded.
*/
const gd::String& GetSource() const { return source; }
/**
* \brief Set the source of the group.
*/
void SetSource(const gd::String& source_) { source = source_; }
/**
* \brief Get the vector containing the parameters that have been used to
* create the group and its sub events.
* \note These parameters are optional and only used to remember how the
* group was created from an events template for example: if the user wants
* to update the group with a new version of the template, the parameters
* can be displayed again to easy the update.
*/
std::vector<gd::String>& GetCreationParameters() { return parameters; }
const std::vector<gd::String>& GetCreationParameters() const {
return parameters;
}
/**
* \brief Return the creation timestamp
* \return The timestamp, or 0 if not specified for the group.
*/
unsigned int GetCreationTimestamp() const { return creationTime; }
/**
* \brief Set timestamp of the creation of the group.
* \note This is purely optional and only used for checking for example if
* a new version of the group is available, if it has a source URL.
*/
void SetCreationTimestamp(unsigned int creationTime_) {
creationTime = creationTime_;
}
/**
* \brief Change the color of the group
*/
void SetBackgroundColor(unsigned int colorR,
unsigned int colorG,
unsigned int colorB);
/**
* \brief Get background color red component.
*/
unsigned int GetBackgroundColorR() const { return colorR; };
/**
* \brief Get background color green component.
*/
unsigned int GetBackgroundColorG() const { return colorG; };
/**
* \brief Get background color blue component.
*/
unsigned int GetBackgroundColorB() const { return colorB; };
virtual bool CanHaveSubEvents() const { return true; }
virtual const gd::EventsList& GetSubEvents() const { return events; };
virtual gd::EventsList& GetSubEvents() { return events; };
virtual void SerializeTo(SerializerElement& element) const;
virtual void UnserializeFrom(gd::Project& project,
const SerializerElement& element);
virtual gd::BaseEvent::EditEventReturnType EditEvent(
wxWindow* parent_,
gd::Project& project,
gd::Layout& scene,
gd::MainFrameWrapper& mainFrameWrapper);
/**
* Called by event editor to draw the event.
*/
virtual void Render(wxDC& dc,
int x,
int y,
unsigned int width,
gd::EventsEditorItemsAreas& areas,
gd::EventsEditorSelection& selection,
const gd::Platform& platform);
/**
* Must return the height of the event when rendered
*/
virtual unsigned int GetRenderedHeight(unsigned int width,
const gd::Platform& platform) const;
private:
EventsList events;
gd::String name; ///< Optional. A name displayed in the events editor.
gd::String source; ///< Optional. The source can contains the URL from which
///< the group was downloaded.
unsigned int creationTime; ///< Optional. The time when the group was created
///< from an event template.
std::vector<gd::String>
parameters; ///< Optional. Can be used to remember the parameters used if
///< the group was created from an events template.
unsigned int colorR;
unsigned int colorG;
unsigned int colorB;
};
} // namespace gd
#endif // GDCORE_GROUPEVENT_H
#endif

View File

@@ -1,246 +1,250 @@
/*
* GDevelop Core
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights reserved.
* This project is released under the MIT License.
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights
* reserved. This project is released under the MIT License.
*/
#include <iostream>
#include <fstream>
#include <iostream>
#if !defined(GD_NO_WX_GUI)
#include <wx/dcmemory.h>
#endif
#include "GDCore/IDE/wxTools/SkinHelper.h"
#include "GDCore/Serialization/SerializerElement.h"
#include "GDCore/IDE/Dialogs/EventsEditor/EventsRenderingHelper.h"
#include "GDCore/Project/Object.h"
#include "GDCore/Project/Project.h"
#include "GDCore/Project/Layout.h"
#include "GDCore/Project/ExternalEvents.h"
#include "GDCore/CommonTools.h"
#include "GDCore/Events/Builtin/GroupEvent.h"
#include "GDCore/Events/Builtin/LinkEvent.h"
#include "GDCore/Events/CodeGeneration/EventsCodeGenerationContext.h"
#include "GDCore/Events/CodeGeneration/EventsCodeGenerator.h"
#include "GDCore/Events/Tools/EventsCodeNameMangler.h"
#include "GDCore/Events/Builtin/LinkEvent.h"
#include "GDCore/Events/Builtin/GroupEvent.h"
#include "GDCore/IDE/Dialogs/EventsEditor/EventsRenderingHelper.h"
#include "GDCore/IDE/Dialogs/LinkEventEditor.h"
#include "GDCore/CommonTools.h"
#include "GDCore/IDE/wxTools/SkinHelper.h"
#include "GDCore/Project/ExternalEvents.h"
#include "GDCore/Project/Layout.h"
#include "GDCore/Project/Object.h"
#include "GDCore/Project/Project.h"
#include "GDCore/Serialization/SerializerElement.h"
using namespace std;
namespace gd
{
namespace gd {
const EventsList * LinkEvent::GetLinkedEvents(const gd::Project & project) const
{
const EventsList * events = nullptr;
const gd::ExternalEvents * linkedExternalEvents = nullptr;
if ( project.HasExternalEventsNamed(GetTarget()) )
{
linkedExternalEvents = &project.GetExternalEvents(GetTarget());
events = &project.GetExternalEvents(GetTarget()).GetEvents();
}
else if ( project.HasLayoutNamed(GetTarget()) )
events = &project.GetLayout(GetTarget()).GetEvents();
const EventsList* LinkEvent::GetLinkedEvents(const gd::Project& project) const {
const EventsList* events = nullptr;
const gd::ExternalEvents* linkedExternalEvents = nullptr;
if (project.HasExternalEventsNamed(GetTarget())) {
linkedExternalEvents = &project.GetExternalEvents(GetTarget());
events = &project.GetExternalEvents(GetTarget()).GetEvents();
} else if (project.HasLayoutNamed(GetTarget()))
events = &project.GetLayout(GetTarget()).GetEvents();
//If the link only includes an events group, search it inside the layout/external events
if( includeConfig == INCLUDE_EVENTS_GROUP )
{
std::size_t i = 0;
std::size_t eventsCount = events->GetEventsCount();
for( ; i < eventsCount; ++i )
{
std::shared_ptr<const GroupEvent> groupEvent = std::dynamic_pointer_cast<const GroupEvent>(events->GetEventSmartPtr(i));
if(groupEvent && groupEvent->GetName() == eventsGroupName)
{
//Get its sub-events
events = &groupEvent->GetSubEvents();
break;
}
}
if(i >= eventsCount) //We didn't find the events group, return nullptr
events = nullptr;
// If the link only includes an events group, search it inside the
// layout/external events
if (includeConfig == INCLUDE_EVENTS_GROUP) {
std::size_t i = 0;
std::size_t eventsCount = events->GetEventsCount();
for (; i < eventsCount; ++i) {
std::shared_ptr<const GroupEvent> groupEvent =
std::dynamic_pointer_cast<const GroupEvent>(
events->GetEventSmartPtr(i));
if (groupEvent && groupEvent->GetName() == eventsGroupName) {
// Get its sub-events
events = &groupEvent->GetSubEvents();
break;
}
}
return events;
if (i >= eventsCount) // We didn't find the events group, return nullptr
events = nullptr;
}
return events;
}
void LinkEvent::ReplaceLinkByLinkedEvents(const gd::Project & project, EventsList & eventList, std::size_t indexOfTheEventInThisList)
{
linkWasInvalid = false;
//Finding what to link to.
const EventsList * eventsToInclude = GetLinkedEvents(project);
if ( eventsToInclude != NULL )
{
std::size_t firstEvent = includeConfig == INCLUDE_BY_INDEX ? GetIncludeStart() : 0;
std::size_t lastEvent = includeConfig == INCLUDE_BY_INDEX ? GetIncludeEnd() : eventsToInclude->size() - 1;
void LinkEvent::ReplaceLinkByLinkedEvents(
const gd::Project& project,
EventsList& eventList,
std::size_t indexOfTheEventInThisList) {
linkWasInvalid = false;
// Finding what to link to.
const EventsList* eventsToInclude = GetLinkedEvents(project);
if (eventsToInclude != NULL) {
std::size_t firstEvent =
includeConfig == INCLUDE_BY_INDEX ? GetIncludeStart() : 0;
std::size_t lastEvent = includeConfig == INCLUDE_BY_INDEX
? GetIncludeEnd()
: eventsToInclude->size() - 1;
//Check bounds
if ( firstEvent >= eventsToInclude->size() )
{
std::cout << "Unable to get events from a link ( Invalid start )" << std::endl;
linkWasInvalid = true;
return;
}
if ( lastEvent >= eventsToInclude->size() )
{
std::cout << "Unable to get events from a link ( Invalid end )" << std::endl;
linkWasInvalid = true;
return;
}
if ( firstEvent > lastEvent )
{
std::cout << "Unable to get events from a link ( End is before start )" << std::endl;
linkWasInvalid = true;
return;
}
//Insert an empty event to replace the link event ( we'll delete the link event at the end )
//( If we just erase the link event without adding a blank event to replace it,
//the first event inserted by the link will not be preprocessed ( and it can be annoying if it require preprocessing, such as another link event ). )
gd::EmptyEvent emptyEvent;
eventList.InsertEvent(emptyEvent, indexOfTheEventInThisList);
eventList.InsertEvents(*eventsToInclude, firstEvent, lastEvent, indexOfTheEventInThisList+1);
//Delete the link event ( which is now at the end of the list of events we've just inserted )
eventList.RemoveEvent(indexOfTheEventInThisList + 1 + static_cast<unsigned>(lastEvent-firstEvent)+1);
// Check bounds
if (firstEvent >= eventsToInclude->size()) {
std::cout << "Unable to get events from a link ( Invalid start )"
<< std::endl;
linkWasInvalid = true;
return;
}
else
{
std::cout << "Unable to get events from a link." << std::endl;
linkWasInvalid = true;
//Delete the link event
eventList.RemoveEvent(indexOfTheEventInThisList);
return;
if (lastEvent >= eventsToInclude->size()) {
std::cout << "Unable to get events from a link ( Invalid end )"
<< std::endl;
linkWasInvalid = true;
return;
}
if (firstEvent > lastEvent) {
std::cout << "Unable to get events from a link ( End is before start )"
<< std::endl;
linkWasInvalid = true;
return;
}
// Insert an empty event to replace the link event ( we'll delete the link
// event at the end ) ( If we just erase the link event without adding a
// blank event to replace it, the first event inserted by the link will not
// be preprocessed ( and it can be annoying if it require preprocessing,
// such as another link event ). )
gd::EmptyEvent emptyEvent;
eventList.InsertEvent(emptyEvent, indexOfTheEventInThisList);
eventList.InsertEvents(
*eventsToInclude, firstEvent, lastEvent, indexOfTheEventInThisList + 1);
// Delete the link event ( which is now at the end of the list of events
// we've just inserted )
eventList.RemoveEvent(indexOfTheEventInThisList + 1 +
static_cast<unsigned>(lastEvent - firstEvent) + 1);
} else {
std::cout << "Unable to get events from a link." << std::endl;
linkWasInvalid = true;
// Delete the link event
eventList.RemoveEvent(indexOfTheEventInThisList);
return;
}
}
LinkEvent::~LinkEvent()
{
LinkEvent::~LinkEvent() {}
void LinkEvent::SerializeTo(SerializerElement& element) const {
SerializerElement& includeElement = element.AddChild("include").SetAttribute(
"includeConfig", static_cast<int>(GetIncludeConfig()));
if (GetIncludeConfig() == INCLUDE_EVENTS_GROUP) {
includeElement.SetAttribute("eventsGroup", GetEventsGroupName());
} else if (GetIncludeConfig() == INCLUDE_BY_INDEX) {
includeElement.SetAttribute("start", static_cast<int>(GetIncludeStart()));
includeElement.SetAttribute("end", static_cast<int>(GetIncludeEnd()));
}
element.AddChild("target").SetValue(GetTarget());
}
void LinkEvent::SerializeTo(SerializerElement & element) const
{
SerializerElement & includeElement = element.AddChild("include")
.SetAttribute("includeConfig", static_cast<int>(GetIncludeConfig()));
void LinkEvent::UnserializeFrom(gd::Project& project,
const SerializerElement& element) {
SerializerElement& includeElement = element.GetChild("include", 0, "Limites");
if(GetIncludeConfig() == INCLUDE_EVENTS_GROUP)
{
includeElement.SetAttribute("eventsGroup", GetEventsGroupName());
}
else if(GetIncludeConfig() == INCLUDE_BY_INDEX)
{
includeElement.SetAttribute("start", static_cast<int>(GetIncludeStart()));
includeElement.SetAttribute("end", static_cast<int>(GetIncludeEnd()));
}
SetTarget(element.GetChild("target", 0, "Scene").GetValue().GetString());
element.AddChild("target").SetValue(GetTarget());
if (includeElement.HasAttribute("includeAll")) {
// Compatibility with GDevelop <= 4.0.92
if (includeElement.GetBoolAttribute("includeAll", true)) {
SetIncludeAllEvents();
} else {
SetIncludeStartAndEnd(includeElement.GetIntAttribute("start"),
includeElement.GetIntAttribute("end"));
}
} else {
// GDevelop > 4.0.92
IncludeConfig config = static_cast<IncludeConfig>(
includeElement.GetIntAttribute("includeConfig", 0));
if (config == INCLUDE_ALL)
SetIncludeAllEvents();
else if (config == INCLUDE_EVENTS_GROUP)
SetIncludeEventsGroup(includeElement.GetStringAttribute("eventsGroup"));
else if (config == INCLUDE_BY_INDEX)
SetIncludeStartAndEnd(includeElement.GetIntAttribute("start"),
includeElement.GetIntAttribute("end"));
}
}
void LinkEvent::UnserializeFrom(gd::Project & project, const SerializerElement & element)
{
SerializerElement & includeElement = element.GetChild("include", 0, "Limites");
SetTarget(element.GetChild("target", 0, "Scene").GetValue().GetString());
if(includeElement.HasAttribute("includeAll"))
{
//Compatibility with GDevelop <= 4.0.92
if(includeElement.GetBoolAttribute("includeAll", true))
{
SetIncludeAllEvents();
}
else
{
SetIncludeStartAndEnd(includeElement.GetIntAttribute("start"),
includeElement.GetIntAttribute("end"));
}
}
else
{
//GDevelop > 4.0.92
IncludeConfig config = static_cast<IncludeConfig>(includeElement.GetIntAttribute("includeConfig", 0));
if(config == INCLUDE_ALL)
SetIncludeAllEvents();
else if(config == INCLUDE_EVENTS_GROUP)
SetIncludeEventsGroup(includeElement.GetStringAttribute("eventsGroup"));
else if(config == INCLUDE_BY_INDEX)
SetIncludeStartAndEnd(includeElement.GetIntAttribute("start"), includeElement.GetIntAttribute("end"));
}
}
gd::BaseEvent::EditEventReturnType LinkEvent::EditEvent(wxWindow* parent_, gd::Project & project, gd::Layout & scene_, gd::MainFrameWrapper & mainFrameWrapper_)
{
gd::BaseEvent::EditEventReturnType LinkEvent::EditEvent(
wxWindow* parent_,
gd::Project& project,
gd::Layout& scene_,
gd::MainFrameWrapper& mainFrameWrapper_) {
#if !defined(GD_NO_WX_GUI)
LinkEventEditor dialog(parent_, *this, project);
if ( dialog.ShowModal() == 0 ) return Cancelled;
LinkEventEditor dialog(parent_, *this, project);
if (dialog.ShowModal() == 0) return Cancelled;
#endif
return ChangesMade;
return ChangesMade;
}
/**
* Render the event in the bitmap
*/
void LinkEvent::Render(wxDC & dc, int x, int y, unsigned int width, gd::EventsEditorItemsAreas & areas, gd::EventsEditorSelection & selection, const gd::Platform & platform)
{
void LinkEvent::Render(wxDC& dc,
int x,
int y,
unsigned int width,
gd::EventsEditorItemsAreas& areas,
gd::EventsEditorSelection& selection,
const gd::Platform& platform) {
#if !defined(GD_NO_WX_GUI)
gd::EventsRenderingHelper * renderingHelper = gd::EventsRenderingHelper::Get();
gd::EventsRenderingHelper* renderingHelper = gd::EventsRenderingHelper::Get();
dc.SetBrush( wxBrush( wxColour( 255, 255, 255 ) ) );
dc.SetPen( wxPen( wxColour( 0, 0, 0 ), 1) );
wxRect rect(x+1, y, width-2, GetRenderedHeight(width, platform)-2);
dc.DrawRectangle(rect);
dc.SetBrush(wxBrush(wxColour(255, 255, 255)));
dc.SetPen(wxPen(wxColour(0, 0, 0), 1));
wxRect rect(x + 1, y, width - 2, GetRenderedHeight(width, platform) - 2);
dc.DrawRectangle(rect);
dc.DrawBitmap( gd::SkinHelper::GetIcon("events", 24), x+4, y + 1, true);
dc.DrawBitmap(gd::SkinHelper::GetIcon("events", 24), x + 4, y + 1, true);
dc.SetTextBackground( wxColour( 255, 255, 255 ) );
if ( !IsDisabled() )
dc.SetTextForeground( wxColour( 0, 0, 0 ) );
else
dc.SetTextForeground( wxColour( 160, 160, 160 ) );
dc.SetTextBackground(wxColour(255, 255, 255));
if (!IsDisabled())
dc.SetTextForeground(wxColour(0, 0, 0));
else
dc.SetTextForeground(wxColour(160, 160, 160));
dc.SetFont(renderingHelper->GetNiceFont());
dc.DrawText( _("Link to ")+GetTarget(), x+32, y + 3 );
dc.SetFont(renderingHelper->GetNiceFont());
dc.DrawText(_("Link to ") + GetTarget(), x + 32, y + 3);
if ( GetIncludeConfig() == INCLUDE_BY_INDEX )
{
wxRect textRect = dc.GetTextExtent(_("Link to ")+GetTarget());
dc.DrawText( _("Include only events ")+gd::String::From(GetIncludeStart()+1)+_(" to ")+gd::String::From(GetIncludeEnd()+1), x+textRect.GetWidth()+32+10, y + 5 );
}
else if ( GetIncludeConfig() == INCLUDE_EVENTS_GROUP )
{
wxRect textRect = dc.GetTextExtent(_("Link to ")+GetTarget());
dc.DrawText( _("Include only the events group named \"")+gd::String::From(GetEventsGroupName())+_("\""), x+textRect.GetWidth()+32+10, y + 5 );
}
if (GetIncludeConfig() == INCLUDE_BY_INDEX) {
wxRect textRect = dc.GetTextExtent(_("Link to ") + GetTarget());
dc.DrawText(_("Include only events ") +
gd::String::From(GetIncludeStart() + 1) + _(" to ") +
gd::String::From(GetIncludeEnd() + 1),
x + textRect.GetWidth() + 32 + 10,
y + 5);
} else if (GetIncludeConfig() == INCLUDE_EVENTS_GROUP) {
wxRect textRect = dc.GetTextExtent(_("Link to ") + GetTarget());
dc.DrawText(_("Include only the events group named \"") +
gd::String::From(GetEventsGroupName()) + _("\""),
x + textRect.GetWidth() + 32 + 10,
y + 5);
}
#endif
}
/**
* Precompute height for the link
*/
unsigned int LinkEvent::GetRenderedHeight(unsigned int width, const gd::Platform & platform) const
{
unsigned int LinkEvent::GetRenderedHeight(unsigned int width,
const gd::Platform& platform) const {
#if !defined(GD_NO_WX_GUI)
if ( eventHeightNeedUpdate )
{
gd::EventsRenderingHelper * renderingHelper = gd::EventsRenderingHelper::Get();
if (eventHeightNeedUpdate) {
gd::EventsRenderingHelper* renderingHelper =
gd::EventsRenderingHelper::Get();
wxMemoryDC dc;
wxBitmap fakeBmp(1,1);
dc.SelectObject(fakeBmp);
wxMemoryDC dc;
wxBitmap fakeBmp(1, 1);
dc.SelectObject(fakeBmp);
dc.SetFont(renderingHelper->GetNiceFont());
wxRect lien = dc.GetTextExtent(_("Link to "));
dc.SetFont(renderingHelper->GetNiceFont());
wxRect lien = dc.GetTextExtent(_("Link to "));
renderedHeight = lien.GetHeight()+15;
eventHeightNeedUpdate = false;
}
renderedHeight = lien.GetHeight() + 15;
eventHeightNeedUpdate = false;
}
return renderedHeight;
return renderedHeight;
#else
return 0;
return 0;
#endif
}
}
} // namespace gd

View File

@@ -1,123 +1,164 @@
/*
* GDevelop Core
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights reserved.
* This project is released under the MIT License.
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights
* reserved. This project is released under the MIT License.
*/
#ifndef GDCORE_LINKEVENT_H
#define GDCORE_LINKEVENT_H
#include "GDCore/Events/Event.h"
#include "GDCore/String.h"
namespace gd
{
namespace gd {
/**
* \brief A link pointing to external events (or events of another layout) that should be included
* and run instead of the link.
* \brief A link pointing to external events (or events of another layout) that
* should be included and run instead of the link.
*/
class GD_CORE_API LinkEvent : public gd::BaseEvent
{
public:
enum IncludeConfig
{
INCLUDE_ALL = 0,
INCLUDE_EVENTS_GROUP = 1,
INCLUDE_BY_INDEX = 2 // Deprecated
};
class GD_CORE_API LinkEvent : public gd::BaseEvent {
public:
enum IncludeConfig {
INCLUDE_ALL = 0,
INCLUDE_EVENTS_GROUP = 1,
INCLUDE_BY_INDEX = 2 // Deprecated
};
LinkEvent() : BaseEvent(), includeConfig(INCLUDE_ALL), eventsGroupName(), includeStart(gd::String::npos), includeEnd(gd::String::npos), linkWasInvalid(false) {};
virtual ~LinkEvent();
virtual gd::LinkEvent * Clone() const { return new LinkEvent(*this); }
LinkEvent()
: BaseEvent(),
includeConfig(INCLUDE_ALL),
eventsGroupName(),
includeStart(gd::String::npos),
includeEnd(gd::String::npos),
linkWasInvalid(false){};
virtual ~LinkEvent();
virtual gd::LinkEvent* Clone() const { return new LinkEvent(*this); }
/**
* Get the link target (i.e. the scene or external events the link refers to).
*/
const gd::String & GetTarget() const { return target; };
/**
* Get the link target (i.e. the scene or external events the link refers to).
*/
const gd::String& GetTarget() const { return target; };
/**
* Change the link target (i.e. the scene or external events the link refers to).
*/
void SetTarget(const gd::String & target_) { target = target_; };
/**
* Change the link target (i.e. the scene or external events the link refers
* to).
*/
void SetTarget(const gd::String& target_) { target = target_; };
/**
* Return the include config.
*/
IncludeConfig GetIncludeConfig() const { return includeConfig; }
/**
* Return the include config.
*/
IncludeConfig GetIncludeConfig() const { return includeConfig; }
/**
* Return true if the link event must include all the events of the target.
*/
void SetIncludeAllEvents() { includeConfig = INCLUDE_ALL; }
/**
* Return true if the link event must include all the events of the target.
*/
void SetIncludeAllEvents() { includeConfig = INCLUDE_ALL; }
void SetIncludeEventsGroup(const gd::String& name) { includeConfig = INCLUDE_EVENTS_GROUP; eventsGroupName = name; }
void SetIncludeEventsGroup(const gd::String& name) {
includeConfig = INCLUDE_EVENTS_GROUP;
eventsGroupName = name;
}
/**
* Set the number of the first and last event to be included ( Meaningful only if includeAll was set to false, see SetIncludeAllEvents )
*/
void SetIncludeStartAndEnd(std::size_t includeStart_, std::size_t includeEnd_) { includeConfig = INCLUDE_BY_INDEX; includeStart = includeStart_; includeEnd = includeEnd_; }
/**
* Set the number of the first and last event to be included ( Meaningful only
* if includeAll was set to false, see SetIncludeAllEvents )
*/
void SetIncludeStartAndEnd(std::size_t includeStart_,
std::size_t includeEnd_) {
includeConfig = INCLUDE_BY_INDEX;
includeStart = includeStart_;
includeEnd = includeEnd_;
}
gd::String GetEventsGroupName() const { return eventsGroupName; }
gd::String GetEventsGroupName() const { return eventsGroupName; }
/**
* Get the number of the first event to be included. (Meaningful only if includeAll was set to false, see SetIncludeAllEvents)
*/
std::size_t GetIncludeStart() const { return includeStart; };
/**
* Get the number of the first event to be included. (Meaningful only if
* includeAll was set to false, see SetIncludeAllEvents)
*/
std::size_t GetIncludeStart() const { return includeStart; };
/**
* Get the number of the last event to be included. (Meaningful only if includeAll was set to false, see SetIncludeAllEvents)
*/
std::size_t GetIncludeEnd() const { return includeEnd; };
/**
* Get the number of the last event to be included. (Meaningful only if
* includeAll was set to false, see SetIncludeAllEvents)
*/
std::size_t GetIncludeEnd() const { return includeEnd; };
/**
* The link event must always be preprocessed.
*/
virtual bool MustBePreprocessed() { return true;}
/**
* The link event must always be preprocessed.
*/
virtual bool MustBePreprocessed() { return true; }
/**
* \brief Get a pointer to the list of events that are targeted by the link.
*
* @param project The project containing the link.
* @return NULL if nothing is found or a pointer to the list of events being linked.
*/
const EventsList * GetLinkedEvents(const gd::Project & project) const;
/**
* \brief Get a pointer to the list of events that are targeted by the link.
*
* @param project The project containing the link.
* @return NULL if nothing is found or a pointer to the list of events being
* linked.
*/
const EventsList* GetLinkedEvents(const gd::Project& project) const;
/**
* \brief Replace the link in the events list by the linked events.
* When implementing a platform with a link event, you should call this function when preprocessing the events
* (See gd::EventMetadata::codeGeneration).
*/
void ReplaceLinkByLinkedEvents(const gd::Project & project, EventsList & eventList, std::size_t indexOfTheEventInThisList);
/**
* \brief Replace the link in the events list by the linked events.
* When implementing a platform with a link event, you should call this
* function when preprocessing the events (See
* gd::EventMetadata::codeGeneration).
*/
void ReplaceLinkByLinkedEvents(const gd::Project& project,
EventsList& eventList,
std::size_t indexOfTheEventInThisList);
virtual bool IsExecutable() const { return true; };
virtual bool IsExecutable() const { return true; };
/**
* Called by event editor to draw the event.
*/
virtual void Render(wxDC & dc, int x, int y, unsigned int width, gd::EventsEditorItemsAreas & areas, gd::EventsEditorSelection & selection, const gd::Platform & platform);
/**
* Called by event editor to draw the event.
*/
virtual void Render(wxDC& dc,
int x,
int y,
unsigned int width,
gd::EventsEditorItemsAreas& areas,
gd::EventsEditorSelection& selection,
const gd::Platform& platform);
/**
* Must return the height of the event when rendered
*/
virtual unsigned int GetRenderedHeight(unsigned int width, const gd::Platform & platform) const;
/**
* Must return the height of the event when rendered
*/
virtual unsigned int GetRenderedHeight(unsigned int width,
const gd::Platform& platform) const;
virtual EditEventReturnType EditEvent(wxWindow* parent_, gd::Project & game_, gd::Layout & scene_, gd::MainFrameWrapper & mainFrameWrapper_);
virtual EditEventReturnType EditEvent(
wxWindow* parent_,
gd::Project& game_,
gd::Layout& scene_,
gd::MainFrameWrapper& mainFrameWrapper_);
virtual void SerializeTo(SerializerElement & element) const;
virtual void UnserializeFrom(gd::Project & project, const SerializerElement & element);
virtual void SerializeTo(SerializerElement& element) const;
virtual void UnserializeFrom(gd::Project& project,
const SerializerElement& element);
private:
gd::String target; ///< The name of the external events (or scene) to be included
private:
gd::String
target; ///< The name of the external events (or scene) to be included
IncludeConfig includeConfig; ///< Defines which events are included by this link
IncludeConfig
includeConfig; ///< Defines which events are included by this link
gd::String eventsGroupName; ///< If includeConfig is set to INCLUDE_EVENTS_GROUP, represents the name of the events group to be included.
gd::String eventsGroupName; ///< If includeConfig is set to
///< INCLUDE_EVENTS_GROUP, represents the name of
///< the events group to be included.
std::size_t includeStart; ///< If includeConfig is set to INCLUDE_BY_INDEX, represents the number of the first event of the target to included.
std::size_t includeEnd; ///< If includeConfig is set to INCLUDE_BY_INDEX, represents the number of the last event of the target to included.
std::size_t includeStart; ///< If includeConfig is set to INCLUDE_BY_INDEX,
///< represents the number of the first event of
///< the target to included.
std::size_t
includeEnd; ///< If includeConfig is set to INCLUDE_BY_INDEX, represents
///< the number of the last event of the target to included.
bool linkWasInvalid; ///< Set to true by Preprocess if the links was invalid the last time is was processed. Used to display a warning in the events editor.
bool linkWasInvalid; ///< Set to true by Preprocess if the links was invalid
///< the last time is was processed. Used to display a
///< warning in the events editor.
};
}
} // namespace gd
#endif // GDCORE_LINKEVENT_H
#endif // GDCORE_LINKEVENT_H

View File

@@ -1,163 +1,200 @@
/*
* GDevelop Core
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights reserved.
* This project is released under the MIT License.
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights
* reserved. This project is released under the MIT License.
*/
#include "RepeatEvent.h"
#include "GDCore/Events/CodeGeneration/EventsCodeGenerationContext.h"
#include "GDCore/Events/CodeGeneration/EventsCodeGenerator.h"
#include "GDCore/Events/CodeGeneration/ExpressionsCodeGeneration.h"
#include "GDCore/Events/Serialization.h"
#include "GDCore/IDE/Dialogs/EditRepeatEvent.h"
#include "GDCore/IDE/Dialogs/EventsEditor/EventsEditorItemsAreas.h"
#include "GDCore/IDE/Dialogs/EventsEditor/EventsEditorSelection.h"
#include "GDCore/IDE/Dialogs/EventsEditor/EventsRenderingHelper.h"
#include "GDCore/Events/Serialization.h"
#include "GDCore/Serialization/SerializerElement.h"
#include "GDCore/Events/CodeGeneration/EventsCodeGenerator.h"
#include "GDCore/Events/CodeGeneration/ExpressionsCodeGeneration.h"
#include "GDCore/Events/CodeGeneration/EventsCodeGenerationContext.h"
#include "GDCore/IDE/Dialogs/EditRepeatEvent.h"
using namespace std;
namespace gd
{
namespace gd {
RepeatEvent::RepeatEvent() :
BaseEvent(),
repeatNumberExpression(""),
repeatNumberExpressionSelected(false)
{
RepeatEvent::RepeatEvent()
: BaseEvent(),
repeatNumberExpression(""),
repeatNumberExpressionSelected(false) {}
vector<gd::InstructionsList*> RepeatEvent::GetAllConditionsVectors() {
vector<gd::InstructionsList*> allConditions;
allConditions.push_back(&conditions);
return allConditions;
}
vector<gd::InstructionsList*> RepeatEvent::GetAllActionsVectors() {
vector<gd::InstructionsList*> allActions;
allActions.push_back(&actions);
vector < gd::InstructionsList* > RepeatEvent::GetAllConditionsVectors()
{
vector < gd::InstructionsList* > allConditions;
allConditions.push_back(&conditions);
return allConditions;
return allActions;
}
vector < gd::InstructionsList* > RepeatEvent::GetAllActionsVectors()
{
vector < gd::InstructionsList* > allActions;
allActions.push_back(&actions);
vector<gd::Expression*> RepeatEvent::GetAllExpressions() {
vector<gd::Expression*> allExpressions;
allExpressions.push_back(&repeatNumberExpression);
return allActions;
return allExpressions;
}
vector < gd::Expression* > RepeatEvent::GetAllExpressions()
{
vector < gd::Expression* > allExpressions;
allExpressions.push_back(&repeatNumberExpression);
vector<const gd::InstructionsList*> RepeatEvent::GetAllConditionsVectors()
const {
vector<const gd::InstructionsList*> allConditions;
allConditions.push_back(&conditions);
return allExpressions;
return allConditions;
}
vector < const gd::InstructionsList* > RepeatEvent::GetAllConditionsVectors() const
{
vector < const gd::InstructionsList* > allConditions;
allConditions.push_back(&conditions);
vector<const gd::InstructionsList*> RepeatEvent::GetAllActionsVectors() const {
vector<const gd::InstructionsList*> allActions;
allActions.push_back(&actions);
return allConditions;
return allActions;
}
vector < const gd::InstructionsList* > RepeatEvent::GetAllActionsVectors() const
{
vector < const gd::InstructionsList* > allActions;
allActions.push_back(&actions);
vector<const gd::Expression*> RepeatEvent::GetAllExpressions() const {
vector<const gd::Expression*> allExpressions;
allExpressions.push_back(&repeatNumberExpression);
return allActions;
return allExpressions;
}
vector < const gd::Expression* > RepeatEvent::GetAllExpressions() const
{
vector < const gd::Expression* > allExpressions;
allExpressions.push_back(&repeatNumberExpression);
return allExpressions;
void RepeatEvent::SerializeTo(SerializerElement& element) const {
element.AddChild("repeatExpression")
.SetValue(repeatNumberExpression.GetPlainString());
gd::EventsListSerialization::SerializeInstructionsTo(
conditions, element.AddChild("conditions"));
gd::EventsListSerialization::SerializeInstructionsTo(
actions, element.AddChild("actions"));
gd::EventsListSerialization::SerializeEventsTo(events,
element.AddChild("events"));
}
void RepeatEvent::SerializeTo(SerializerElement & element) const
{
element.AddChild("repeatExpression").SetValue(repeatNumberExpression.GetPlainString());
gd::EventsListSerialization::SaveConditions(conditions, element.AddChild("conditions"));
gd::EventsListSerialization::SaveActions(actions, element.AddChild("actions"));
gd::EventsListSerialization::SerializeEventsTo(events, element.AddChild("events"));
}
void RepeatEvent::UnserializeFrom(gd::Project & project, const SerializerElement & element)
{
repeatNumberExpression = gd::Expression(element.GetChild("repeatExpression", 0, "RepeatExpression").GetValue().GetString());
gd::EventsListSerialization::OpenConditions(project, conditions, element.GetChild("conditions", 0, "Conditions"));
gd::EventsListSerialization::OpenActions(project, actions, element.GetChild("actions", 0, "Actions"));
gd::EventsListSerialization::UnserializeEventsFrom(project, events, element.GetChild("events", 0, "Events"));
void RepeatEvent::UnserializeFrom(gd::Project& project,
const SerializerElement& element) {
repeatNumberExpression =
gd::Expression(element.GetChild("repeatExpression", 0, "RepeatExpression")
.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"));
}
/**
* Render the event in the bitmap
*/
void RepeatEvent::Render(wxDC & dc, int x, int y, unsigned int width, gd::EventsEditorItemsAreas & areas, gd::EventsEditorSelection & selection, const gd::Platform & platform)
{
void RepeatEvent::Render(wxDC& dc,
int x,
int y,
unsigned int width,
gd::EventsEditorItemsAreas& areas,
gd::EventsEditorSelection& selection,
const gd::Platform& platform) {
#if !defined(GD_NO_WX_GUI)
gd::EventsRenderingHelper * renderingHelper = gd::EventsRenderingHelper::Get();
gd::EventsRenderingHelper* renderingHelper = gd::EventsRenderingHelper::Get();
int border = renderingHelper->instructionsListBorder;
const int repeatTextHeight = 20;
// Draw header rectangle
wxRect headerRect(x, y, width, repeatTextHeight);
renderingHelper->DrawNiceRectangle(dc, headerRect);
// Repeat text
dc.SetFont(renderingHelper->GetNiceFont().Bold());
if (!IsDisabled())
dc.SetTextForeground(wxColour(0, 0, 0));
else
dc.SetTextForeground(wxColour(160, 160, 160));
dc.DrawText(_("Repeat") + " " + repeatNumberExpression.GetPlainString() +
" " + _("times :"),
x + 4,
y + 3);
// Draw conditions rectangle
wxRect rect(x,
y + repeatTextHeight,
renderingHelper->GetConditionsColumnWidth() + border,
GetRenderedHeight(width, platform) - repeatTextHeight);
renderingHelper->DrawNiceRectangle(dc, rect);
// Draw actions and conditions
renderingHelper->DrawConditionsList(
conditions,
dc,
x + border,
y + repeatTextHeight + border,
renderingHelper->GetConditionsColumnWidth() - border,
this,
areas,
selection,
platform);
renderingHelper->DrawActionsList(
actions,
dc,
x + renderingHelper->GetConditionsColumnWidth() + border,
y + repeatTextHeight + border,
width - renderingHelper->GetConditionsColumnWidth() - border * 2,
this,
areas,
selection,
platform);
#endif
}
unsigned int RepeatEvent::GetRenderedHeight(
unsigned int width, const gd::Platform& platform) const {
#if !defined(GD_NO_WX_GUI)
if (eventHeightNeedUpdate) {
gd::EventsRenderingHelper* renderingHelper =
gd::EventsRenderingHelper::Get();
int border = renderingHelper->instructionsListBorder;
const int repeatTextHeight = 20;
//Draw header rectangle
wxRect headerRect(x, y, width, repeatTextHeight);
renderingHelper->DrawNiceRectangle(dc, headerRect);
// Get maximum height needed
int conditionsHeight = renderingHelper->GetRenderedConditionsListHeight(
conditions,
renderingHelper->GetConditionsColumnWidth() - border,
platform);
int actionsHeight = renderingHelper->GetRenderedActionsListHeight(
actions,
width - renderingHelper->GetConditionsColumnWidth() - border * 2,
platform);
//Repeat text
dc.SetFont( renderingHelper->GetNiceFont().Bold() );
dc.SetTextForeground(wxColour(0,0,0));
dc.DrawText( _("Repeat") + " " + repeatNumberExpression.GetPlainString() + " " + _("times :"), x + 4, y + 3 );
renderedHeight =
(conditionsHeight > actionsHeight ? conditionsHeight : actionsHeight) +
repeatTextHeight + border * 2;
eventHeightNeedUpdate = false;
}
//Draw conditions rectangle
wxRect rect(x, y+repeatTextHeight, renderingHelper->GetConditionsColumnWidth()+border, GetRenderedHeight(width, platform)-repeatTextHeight);
renderingHelper->DrawNiceRectangle(dc, rect);
//Draw actions and conditions
renderingHelper->DrawConditionsList(conditions, dc,
x+border,
y+repeatTextHeight+border,
renderingHelper->GetConditionsColumnWidth()-border, this, areas, selection, platform);
renderingHelper->DrawActionsList(actions, dc,
x+renderingHelper->GetConditionsColumnWidth()+border,
y+repeatTextHeight+border,
width-renderingHelper->GetConditionsColumnWidth()-border*2, this, areas, selection, platform);
#endif
}
unsigned int RepeatEvent::GetRenderedHeight(unsigned int width, const gd::Platform & platform) const
{
#if !defined(GD_NO_WX_GUI)
if ( eventHeightNeedUpdate )
{
gd::EventsRenderingHelper * renderingHelper = gd::EventsRenderingHelper::Get();
int border = renderingHelper->instructionsListBorder;
const int repeatTextHeight = 20;
//Get maximum height needed
int conditionsHeight = renderingHelper->GetRenderedConditionsListHeight(conditions, renderingHelper->GetConditionsColumnWidth()-border, platform);
int actionsHeight = renderingHelper->GetRenderedActionsListHeight(actions, width-renderingHelper->GetConditionsColumnWidth()-border*2, platform);
renderedHeight = ( conditionsHeight > actionsHeight ? conditionsHeight : actionsHeight ) + repeatTextHeight + border*2;
eventHeightNeedUpdate = false;
}
return renderedHeight;
return renderedHeight;
#else
return 0;
return 0;
#endif
}
gd::BaseEvent::EditEventReturnType RepeatEvent::EditEvent(wxWindow* parent_, gd::Project & game_, gd::Layout & scene_, gd::MainFrameWrapper & mainFrameWrapper_)
{
gd::BaseEvent::EditEventReturnType RepeatEvent::EditEvent(
wxWindow* parent_,
gd::Project& game_,
gd::Layout& scene_,
gd::MainFrameWrapper& mainFrameWrapper_) {
#if !defined(GD_NO_WX_GUI)
EditRepeatEvent dialog(parent_, *this, game_, scene_);
if ( dialog.ShowModal() == 0 ) return Cancelled;
EditRepeatEvent dialog(parent_, *this, game_, scene_);
if (dialog.ShowModal() == 0) return Cancelled;
#endif
return ChangesMade;
return ChangesMade;
}
}
} // namespace gd

View File

@@ -1,82 +1,105 @@
/*
* GDevelop Core
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights reserved.
* This project is released under the MIT License.
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights
* reserved. This project is released under the MIT License.
*/
#ifndef GDCORE_REPEATEVENT_H
#define GDCORE_REPEATEVENT_H
#include "GDCore/Events/Event.h"
#include "GDCore/Events/EventsList.h"
namespace gd { class Instruction; }
namespace gd { class Project; }
namespace gd {
class Instruction;
}
namespace gd {
class Project;
}
class RuntimeScene;
class TiXmlElement;
namespace gd { class EventsEditorItemsAreas; }
namespace gd { class EventsEditorSelection; }
namespace gd {
class EventsEditorItemsAreas;
}
namespace gd {
class EventsEditorSelection;
}
namespace gd
{
namespace gd {
/**
* \brief Event being repeated a specified number of times.
*/
class GD_CORE_API RepeatEvent : public gd::BaseEvent
{
public:
RepeatEvent();
virtual ~RepeatEvent() {};
virtual gd::RepeatEvent * Clone() const { return new RepeatEvent(*this);}
class GD_CORE_API RepeatEvent : public gd::BaseEvent {
public:
RepeatEvent();
virtual ~RepeatEvent(){};
virtual gd::RepeatEvent* Clone() const { return new RepeatEvent(*this); }
virtual bool IsExecutable() const {return true;}
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;};
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& GetConditions() const { return conditions; };
gd::InstructionsList& GetConditions() { return conditions; };
const gd::InstructionsList & GetActions() const { return actions; };
gd::InstructionsList & GetActions() { return actions; };
const gd::InstructionsList& GetActions() const { return actions; };
gd::InstructionsList& GetActions() { return actions; };
const gd::String & GetRepeatExpression() const { return repeatNumberExpression.GetPlainString(); };
void SetRepeatExpression(gd::String repeatNumberExpression_) { repeatNumberExpression = gd::Expression(repeatNumberExpression_); };
const gd::String& GetRepeatExpression() const {
return repeatNumberExpression.GetPlainString();
};
void SetRepeatExpression(gd::String repeatNumberExpression_) {
repeatNumberExpression = gd::Expression(repeatNumberExpression_);
};
virtual std::vector < gd::InstructionsList* > GetAllConditionsVectors();
virtual std::vector < gd::InstructionsList* > GetAllActionsVectors();
virtual std::vector < gd::Expression* > GetAllExpressions();
virtual std::vector < const gd::InstructionsList* > GetAllConditionsVectors() const;
virtual std::vector < const gd::InstructionsList* > GetAllActionsVectors() const;
virtual std::vector < const gd::Expression* > GetAllExpressions() const;
virtual std::vector<gd::InstructionsList*> GetAllConditionsVectors();
virtual std::vector<gd::InstructionsList*> GetAllActionsVectors();
virtual std::vector<gd::Expression*> GetAllExpressions();
virtual std::vector<const gd::InstructionsList*> GetAllConditionsVectors()
const;
virtual std::vector<const gd::InstructionsList*> GetAllActionsVectors() const;
virtual std::vector<const gd::Expression*> GetAllExpressions() const;
virtual void SerializeTo(SerializerElement & element) const;
virtual void UnserializeFrom(gd::Project & project, const SerializerElement & element);
virtual void SerializeTo(SerializerElement& element) const;
virtual void UnserializeFrom(gd::Project& project,
const SerializerElement& element);
/**
* Called by event editor to draw the event.
*/
virtual void Render(wxDC & dc, int x, int y, unsigned int width, gd::EventsEditorItemsAreas & areas, gd::EventsEditorSelection & selection, const gd::Platform & platform);
/**
* Called by event editor to draw the event.
*/
virtual void Render(wxDC& dc,
int x,
int y,
unsigned int width,
gd::EventsEditorItemsAreas& areas,
gd::EventsEditorSelection& selection,
const gd::Platform& platform);
/**
* Must return the height of the event when rendered
*/
virtual unsigned int GetRenderedHeight(unsigned int width, const gd::Platform & platform) const;
/**
* Must return the height of the event when rendered
*/
virtual unsigned int GetRenderedHeight(unsigned int width,
const gd::Platform& platform) const;
/**
* Called when the user want to edit the event
*/
virtual EditEventReturnType EditEvent(wxWindow* parent_, gd::Project & game_, gd::Layout & scene_, gd::MainFrameWrapper & mainFrameWrapper_);
/**
* Called when the user want to edit the event
*/
virtual EditEventReturnType EditEvent(
wxWindow* parent_,
gd::Project& game_,
gd::Layout& scene_,
gd::MainFrameWrapper& mainFrameWrapper_);
private:
gd::Expression repeatNumberExpression;
gd::InstructionsList conditions;
gd::InstructionsList actions;
EventsList events;
private:
gd::Expression repeatNumberExpression;
gd::InstructionsList conditions;
gd::InstructionsList actions;
EventsList events;
bool repeatNumberExpressionSelected;
bool repeatNumberExpressionSelected;
};
}
} // namespace gd
#endif // GDCORE_REPEATEVENT_H
#endif // GDCORE_REPEATEVENT_H

View File

@@ -1,125 +1,152 @@
/*
* GDevelop Core
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights reserved.
* This project is released under the MIT License.
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights
* reserved. This project is released under the MIT License.
*/
#include "StandardEvent.h"
#include "GDCore/IDE/Dialogs/EventsEditor/EventsRenderingHelper.h"
#include "GDCore/CommonTools.h"
#include "GDCore/Events/CodeGeneration/EventsCodeGenerationContext.h"
#include "GDCore/Events/CodeGeneration/EventsCodeGenerator.h"
#include "GDCore/Events/Serialization.h"
#include "GDCore/IDE/Dialogs/EventsEditor/EventsEditorItemsAreas.h"
#include "GDCore/IDE/Dialogs/EventsEditor/EventsEditorSelection.h"
#include "GDCore/Events/Serialization.h"
#include "GDCore/IDE/Dialogs/EventsEditor/EventsRenderingHelper.h"
#include "GDCore/Serialization/SerializerElement.h"
#include "GDCore/TinyXml/tinyxml.h"
#include "GDCore/CommonTools.h"
#include "GDCore/Events/CodeGeneration/EventsCodeGenerator.h"
#include "GDCore/Events/CodeGeneration/EventsCodeGenerationContext.h"
using namespace std;
namespace gd
{
namespace gd {
StandardEvent::StandardEvent() :
BaseEvent()
{
StandardEvent::StandardEvent() : BaseEvent() {}
StandardEvent::~StandardEvent(){};
vector<const gd::InstructionsList*> StandardEvent::GetAllConditionsVectors()
const {
vector<const gd::InstructionsList*> allConditions;
allConditions.push_back(&conditions);
return allConditions;
}
StandardEvent::~StandardEvent()
{
};
vector<const gd::InstructionsList*> StandardEvent::GetAllActionsVectors()
const {
vector<const gd::InstructionsList*> allActions;
allActions.push_back(&actions);
vector < const gd::InstructionsList* > StandardEvent::GetAllConditionsVectors() const
{
vector < const gd::InstructionsList* > allConditions;
allConditions.push_back(&conditions);
return allActions;
}
vector<gd::InstructionsList*> StandardEvent::GetAllConditionsVectors() {
vector<gd::InstructionsList*> allConditions;
allConditions.push_back(&conditions);
return allConditions;
return allConditions;
}
vector < const gd::InstructionsList* > StandardEvent::GetAllActionsVectors() const
{
vector < const gd::InstructionsList* > allActions;
allActions.push_back(&actions);
vector<gd::InstructionsList*> StandardEvent::GetAllActionsVectors() {
vector<gd::InstructionsList*> allActions;
allActions.push_back(&actions);
return allActions;
}
vector < gd::InstructionsList* > StandardEvent::GetAllConditionsVectors()
{
vector < gd::InstructionsList* > allConditions;
allConditions.push_back(&conditions);
return allConditions;
return allActions;
}
vector < gd::InstructionsList* > StandardEvent::GetAllActionsVectors()
{
vector < gd::InstructionsList* > allActions;
allActions.push_back(&actions);
return allActions;
void StandardEvent::SerializeTo(SerializerElement& element) const {
gd::EventsListSerialization::SerializeInstructionsTo(
conditions, element.AddChild("conditions"));
gd::EventsListSerialization::SerializeInstructionsTo(
actions, element.AddChild("actions"));
gd::EventsListSerialization::SerializeEventsTo(events,
element.AddChild("events"));
}
void StandardEvent::SerializeTo(SerializerElement & element) const
{
gd::EventsListSerialization::SaveConditions(conditions, element.AddChild("conditions"));
gd::EventsListSerialization::SaveActions(actions, element.AddChild("actions"));
gd::EventsListSerialization::SerializeEventsTo(events, element.AddChild("events"));
}
void StandardEvent::UnserializeFrom(gd::Project & project, const SerializerElement & element)
{
gd::EventsListSerialization::OpenConditions(project, conditions, element.GetChild("conditions", 0, "Conditions"));
gd::EventsListSerialization::OpenActions(project, actions, element.GetChild("actions", 0, "Actions"));
gd::EventsListSerialization::UnserializeEventsFrom(project, events, element.GetChild("events", 0, "Events"));
void StandardEvent::UnserializeFrom(gd::Project& project,
const SerializerElement& element) {
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"));
}
/**
* Render the event in the bitmap
*/
void StandardEvent::Render(wxDC & dc, int x, int y, unsigned int width, gd::EventsEditorItemsAreas & areas, gd::EventsEditorSelection & selection, const gd::Platform & platform)
{
void StandardEvent::Render(wxDC& dc,
int x,
int y,
unsigned int width,
gd::EventsEditorItemsAreas& areas,
gd::EventsEditorSelection& selection,
const gd::Platform& platform) {
#if !defined(GD_NO_WX_GUI)
gd::EventsRenderingHelper * renderingHelper = gd::EventsRenderingHelper::Get();
gd::EventsRenderingHelper* renderingHelper = gd::EventsRenderingHelper::Get();
int border = renderingHelper->instructionsListBorder;
// Draw event rectangle
wxRect rect(x,
y,
renderingHelper->GetConditionsColumnWidth() + border,
GetRenderedHeight(width, platform));
renderingHelper->DrawNiceRectangle(dc, rect);
renderingHelper->DrawConditionsList(
conditions,
dc,
x + border,
y + border,
renderingHelper->GetConditionsColumnWidth() - border,
this,
areas,
selection,
platform);
renderingHelper->DrawActionsList(
actions,
dc,
x + renderingHelper->GetConditionsColumnWidth() + border,
y + border,
width - renderingHelper->GetConditionsColumnWidth() - border * 2,
this,
areas,
selection,
platform);
// Make sure that Render is rendering an event with the same height as
// GetRenderedHeight : Use same values for border and similar calls to compute
// heights
#endif
}
unsigned int StandardEvent::GetRenderedHeight(
unsigned int width, const gd::Platform& platform) const {
#if !defined(GD_NO_WX_GUI)
if (eventHeightNeedUpdate) {
gd::EventsRenderingHelper* renderingHelper =
gd::EventsRenderingHelper::Get();
int border = renderingHelper->instructionsListBorder;
//Draw event rectangle
wxRect rect(x, y, renderingHelper->GetConditionsColumnWidth()+border, GetRenderedHeight(width, platform));
renderingHelper->DrawNiceRectangle(dc, rect);
// Get maximum height needed
int conditionsHeight = renderingHelper->GetRenderedConditionsListHeight(
conditions,
renderingHelper->GetConditionsColumnWidth() - border * 2,
platform);
int actionsHeight = renderingHelper->GetRenderedActionsListHeight(
actions,
width - renderingHelper->GetConditionsColumnWidth() - border * 2,
platform);
renderingHelper->DrawConditionsList(conditions, dc,
x+border,
y+border,
renderingHelper->GetConditionsColumnWidth()-border, this, areas, selection, platform);
renderingHelper->DrawActionsList(actions, dc,
x+renderingHelper->GetConditionsColumnWidth()+border,
y+border,
width-renderingHelper->GetConditionsColumnWidth()-border*2, this, areas, selection, platform);
renderedHeight =
(conditionsHeight > actionsHeight ? conditionsHeight : actionsHeight) +
border * 2;
eventHeightNeedUpdate = false;
}
//Make sure that Render is rendering an event with the same height as GetRenderedHeight : Use same values for border and similar calls to compute heights
#endif
}
unsigned int StandardEvent::GetRenderedHeight(unsigned int width, const gd::Platform & platform) const
{
#if !defined(GD_NO_WX_GUI)
if ( eventHeightNeedUpdate )
{
gd::EventsRenderingHelper * renderingHelper = gd::EventsRenderingHelper::Get();
int border = renderingHelper->instructionsListBorder;
//Get maximum height needed
int conditionsHeight = renderingHelper->GetRenderedConditionsListHeight(conditions, renderingHelper->GetConditionsColumnWidth()-border*2, platform);
int actionsHeight = renderingHelper->GetRenderedActionsListHeight(actions, width-renderingHelper->GetConditionsColumnWidth()-border*2, platform);
renderedHeight = (conditionsHeight > actionsHeight ? conditionsHeight : actionsHeight)+border*2;
eventHeightNeedUpdate = false;
}
return renderedHeight;
return renderedHeight;
#else
return 0;
return 0;
#endif
}
}
} // namespace gd

View File

@@ -1,74 +1,89 @@
/*
* GDevelop Core
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights reserved.
* This project is released under the MIT License.
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights
* reserved. This project is released under the MIT License.
*/
#if defined(GD_IDE_ONLY)
#ifndef GDCORE_STANDARDEVENT_H
#define GDCORE_STANDARDEVENT_H
#include "GDCore/Events/Event.h"
#include "GDCore/Events/EventsList.h"
#include "GDCore/Events/Instruction.h"
#include "GDCore/Events/InstructionsList.h"
#include "GDCore/Events/EventsList.h"
namespace gd { class Instruction; }
namespace gd { class Project; }
namespace gd {
class Instruction;
}
namespace gd {
class Project;
}
class RuntimeScene;
class TiXmlElement;
class EventsCodeGenerationContext;
namespace gd { class EventsEditorItemsAreas; }
namespace gd { class EventsEditorSelection; }
namespace gd {
class EventsEditorItemsAreas;
}
namespace gd {
class EventsEditorSelection;
}
namespace gd
{
namespace gd {
/**
* \brief Standard event, with conditions, actions and support for sub events.
*/
class GD_CORE_API StandardEvent : public gd::BaseEvent
{
public:
StandardEvent();
virtual ~StandardEvent();
virtual gd::StandardEvent * Clone() const { return new StandardEvent(*this);}
class GD_CORE_API StandardEvent : public gd::BaseEvent {
public:
StandardEvent();
virtual ~StandardEvent();
virtual gd::StandardEvent* Clone() const { return new StandardEvent(*this); }
virtual bool IsExecutable() const {return true;}
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;};
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& GetConditions() const { return conditions; };
gd::InstructionsList& GetConditions() { return conditions; };
const gd::InstructionsList & GetActions() const { return actions; };
gd::InstructionsList & GetActions() { return actions; };
const gd::InstructionsList& GetActions() const { return actions; };
gd::InstructionsList& GetActions() { return actions; };
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 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);
virtual void SerializeTo(SerializerElement& element) const;
virtual void UnserializeFrom(gd::Project& project,
const SerializerElement& element);
/**
* Called by event editor to draw the event.
*/
virtual void Render(wxDC & dc, int x, int y, unsigned int width, gd::EventsEditorItemsAreas & areas, gd::EventsEditorSelection & selection, const gd::Platform & platform);
/**
* Called by event editor to draw the event.
*/
virtual void Render(wxDC& dc,
int x,
int y,
unsigned int width,
gd::EventsEditorItemsAreas& areas,
gd::EventsEditorSelection& selection,
const gd::Platform& platform);
/**
* Must return the height of the event when rendered
*/
virtual unsigned int GetRenderedHeight(unsigned int width, const gd::Platform & platform) const;
/**
* Must return the height of the event when rendered
*/
virtual unsigned int GetRenderedHeight(unsigned int width,
const gd::Platform& platform) const;
private:
gd::InstructionsList conditions;
gd::InstructionsList actions;
EventsList events;
private:
gd::InstructionsList conditions;
gd::InstructionsList actions;
EventsList events;
};
}
} // namespace gd
#endif // GDCORE_STANDARDEVENT_H
#endif // GDCORE_STANDARDEVENT_H
#endif

View File

@@ -1,7 +1,7 @@
/*
* GDevelop Core
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights reserved.
* This project is released under the MIT License.
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights
* reserved. This project is released under the MIT License.
*/
#if defined(GD_IDE_ONLY)
@@ -10,171 +10,238 @@
#include <wx/msgdlg.h>
#include "GDCore/IDE/wxTools/CommonBitmapProvider.h"
#endif
#include "GDCore/TinyXml/tinyxml.h"
#include "GDCore/Events/CodeGeneration/EventsCodeGenerationContext.h"
#include "GDCore/Events/CodeGeneration/EventsCodeGenerator.h"
#include "GDCore/Events/CodeGeneration/ExpressionsCodeGeneration.h"
#include "GDCore/IDE/Dialogs/EventsEditor/EventsRenderingHelper.h"
#include "GDCore/Events/Serialization.h"
#include "GDCore/IDE/Dialogs/EventsEditor/EventsEditorItemsAreas.h"
#include "GDCore/IDE/Dialogs/EventsEditor/EventsEditorSelection.h"
#include "GDCore/IDE/Dialogs/EventsEditor/EventsRenderingHelper.h"
#include "GDCore/Serialization/SerializerElement.h"
#include "GDCore/Events/Serialization.h"
#include "GDCore/Events/CodeGeneration/EventsCodeGenerationContext.h"
#include "GDCore/TinyXml/tinyxml.h"
using namespace std;
namespace gd
{
namespace gd {
vector < gd::InstructionsList* > WhileEvent::GetAllConditionsVectors()
{
vector < gd::InstructionsList* > allConditions;
allConditions.push_back(&whileConditions);
allConditions.push_back(&conditions);
vector<gd::InstructionsList*> WhileEvent::GetAllConditionsVectors() {
vector<gd::InstructionsList*> allConditions;
allConditions.push_back(&whileConditions);
allConditions.push_back(&conditions);
return allConditions;
return allConditions;
}
vector < gd::InstructionsList* > WhileEvent::GetAllActionsVectors()
{
vector < gd::InstructionsList* > allActions;
allActions.push_back(&actions);
vector<gd::InstructionsList*> WhileEvent::GetAllActionsVectors() {
vector<gd::InstructionsList*> allActions;
allActions.push_back(&actions);
return allActions;
return allActions;
}
vector < const gd::InstructionsList* > WhileEvent::GetAllConditionsVectors() const
{
vector < const gd::InstructionsList* > allConditions;
allConditions.push_back(&whileConditions);
allConditions.push_back(&conditions);
vector<const gd::InstructionsList*> WhileEvent::GetAllConditionsVectors()
const {
vector<const gd::InstructionsList*> allConditions;
allConditions.push_back(&whileConditions);
allConditions.push_back(&conditions);
return allConditions;
return allConditions;
}
vector < const gd::InstructionsList* > WhileEvent::GetAllActionsVectors() const
{
vector < const gd::InstructionsList* > allActions;
allActions.push_back(&actions);
vector<const gd::InstructionsList*> WhileEvent::GetAllActionsVectors() const {
vector<const gd::InstructionsList*> allActions;
allActions.push_back(&actions);
return allActions;
return allActions;
}
void WhileEvent::SerializeTo(SerializerElement & element) const
{
element.SetAttribute("infiniteLoopWarning", infiniteLoopWarning);
gd::EventsListSerialization::SaveConditions(whileConditions, element.AddChild("whileConditions"));
gd::EventsListSerialization::SaveConditions(conditions, element.AddChild("conditions"));
gd::EventsListSerialization::SaveActions(actions, element.AddChild("actions"));
gd::EventsListSerialization::SerializeEventsTo(events, element.AddChild("events"));
void WhileEvent::SerializeTo(SerializerElement& element) const {
element.SetAttribute("infiniteLoopWarning", infiniteLoopWarning);
gd::EventsListSerialization::SerializeInstructionsTo(
whileConditions, element.AddChild("whileConditions"));
gd::EventsListSerialization::SerializeInstructionsTo(
conditions, element.AddChild("conditions"));
gd::EventsListSerialization::SerializeInstructionsTo(
actions, element.AddChild("actions"));
gd::EventsListSerialization::SerializeEventsTo(events,
element.AddChild("events"));
}
void WhileEvent::UnserializeFrom(gd::Project & project, const SerializerElement & element)
{
justCreatedByTheUser = false;
infiniteLoopWarning = element.GetBoolAttribute("infiniteLoopWarning");
gd::EventsListSerialization::OpenConditions(project, whileConditions, element.GetChild("whileConditions", 0, "WhileConditions"));
gd::EventsListSerialization::OpenConditions(project, conditions, element.GetChild("conditions", 0, "Conditions"));
gd::EventsListSerialization::OpenActions(project, actions, element.GetChild("actions", 0, "Actions"));
gd::EventsListSerialization::UnserializeEventsFrom(project, events, element.GetChild("events", 0, "Events"));
void WhileEvent::UnserializeFrom(gd::Project& project,
const SerializerElement& element) {
justCreatedByTheUser = false;
infiniteLoopWarning = element.GetBoolAttribute("infiniteLoopWarning");
gd::EventsListSerialization::UnserializeInstructionsFrom(
project,
whileConditions,
element.GetChild("whileConditions", 0, "WhileConditions"));
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"));
}
/**
* Render the event in the bitmap
*/
void WhileEvent::Render(wxDC & dc, int x, int y, unsigned int width, gd::EventsEditorItemsAreas & areas, gd::EventsEditorSelection & selection, const gd::Platform & platform)
{
void WhileEvent::Render(wxDC& dc,
int x,
int y,
unsigned int width,
gd::EventsEditorItemsAreas& areas,
gd::EventsEditorSelection& selection,
const gd::Platform& platform) {
#if !defined(GD_NO_WX_GUI)
gd::EventsRenderingHelper * renderingHelper = gd::EventsRenderingHelper::Get();
gd::EventsRenderingHelper* renderingHelper = gd::EventsRenderingHelper::Get();
int border = renderingHelper->instructionsListBorder;
const int repeatHeight = 20;
// Draw header rectangle
int whileConditionsHeight =
renderingHelper->GetRenderedConditionsListHeight(
whileConditions, width - 80 - border * 2, platform) +
border * 2;
if (!infiniteLoopWarning && whileConditionsHeight < 32)
whileConditionsHeight = 32;
wxRect headerRect(x, y, width, whileConditionsHeight + repeatHeight);
renderingHelper->DrawNiceRectangle(dc, headerRect);
// While text
dc.SetFont(renderingHelper->GetNiceFont().Bold());
if (!IsDisabled())
dc.SetTextForeground(wxColour(0, 0, 0));
else
dc.SetTextForeground(wxColour(160, 160, 160));
dc.DrawText(_("While :"), x + 5, y + 5);
// Draw icon if infinite loop warning is deactivated.
if (!infiniteLoopWarning) {
if (gd::CommonBitmapProvider::Get()->noProtection.IsOk())
dc.DrawBitmap(gd::CommonBitmapProvider::Get()->noProtection,
wxPoint(x + 5, y + 5 + 18),
/*useMask=*/true);
}
// Draw "while conditions"
renderingHelper->DrawConditionsList(whileConditions,
dc,
x + 80 + border,
y + border,
width - 80 - border * 2,
this,
areas,
selection,
platform);
dc.SetFont(renderingHelper->GetNiceFont().Bold());
if (!IsDisabled())
dc.SetTextForeground(wxColour(0, 0, 0));
else
dc.SetTextForeground(wxColour(160, 160, 160));
dc.DrawText(_("Repeat :"), x + 4, y + whileConditionsHeight + 3);
whileConditionsHeight += repeatHeight;
// Draw conditions rectangle
wxRect rect(x,
y + whileConditionsHeight,
renderingHelper->GetConditionsColumnWidth() + border,
GetRenderedHeight(width, platform) - whileConditionsHeight);
renderingHelper->DrawNiceRectangle(dc, rect);
renderingHelper->DrawConditionsList(
conditions,
dc,
x + border,
y + whileConditionsHeight + border,
renderingHelper->GetConditionsColumnWidth() - border,
this,
areas,
selection,
platform);
renderingHelper->DrawActionsList(
actions,
dc,
x + renderingHelper->GetConditionsColumnWidth() + border,
y + whileConditionsHeight + border,
width - renderingHelper->GetConditionsColumnWidth() - border * 2,
this,
areas,
selection,
platform);
#endif
}
unsigned int WhileEvent::GetRenderedHeight(unsigned int width,
const gd::Platform& platform) const {
#if !defined(GD_NO_WX_GUI)
if (eventHeightNeedUpdate) {
gd::EventsRenderingHelper* renderingHelper =
gd::EventsRenderingHelper::Get();
int border = renderingHelper->instructionsListBorder;
const int repeatHeight = 20;
//Draw header rectangle
int whileConditionsHeight = renderingHelper->GetRenderedConditionsListHeight(whileConditions, width-80-border*2, platform)+border*2;
if (!infiniteLoopWarning && whileConditionsHeight < 32 ) whileConditionsHeight = 32;
wxRect headerRect(x, y, width, whileConditionsHeight+repeatHeight);
renderingHelper->DrawNiceRectangle(dc, headerRect);
// Get maximum height needed
int whileConditionsHeight =
renderingHelper->GetRenderedConditionsListHeight(
whileConditions, width - 80 - border * 2, platform);
if (!infiniteLoopWarning && whileConditionsHeight < 32)
whileConditionsHeight = 32;
int conditionsHeight = renderingHelper->GetRenderedConditionsListHeight(
conditions,
renderingHelper->GetConditionsColumnWidth() - border,
platform);
int actionsHeight = renderingHelper->GetRenderedActionsListHeight(
actions,
width - renderingHelper->GetConditionsColumnWidth() - border * 2,
platform);
//While text
dc.SetFont( renderingHelper->GetNiceFont().Bold() );
dc.SetTextForeground(wxColour(0,0,0));
dc.DrawText( _("While :"), x+5, y+5 );
renderedHeight =
((conditionsHeight > actionsHeight ? conditionsHeight : actionsHeight) +
whileConditionsHeight + repeatHeight) +
border * 2 + border * 2;
eventHeightNeedUpdate = false;
}
//Draw icon if infinite loop warning is deactivated.
if (!infiniteLoopWarning)
{
if ( gd::CommonBitmapProvider::Get()->noProtection.IsOk() )
dc.DrawBitmap(gd::CommonBitmapProvider::Get()->noProtection, wxPoint(x+5,y+5+18), /*useMask=*/true);
}
//Draw "while conditions"
renderingHelper->DrawConditionsList(whileConditions, dc, x+80+border, y+border, width-80-border*2, this, areas, selection, platform);
dc.SetFont( renderingHelper->GetNiceFont().Bold() );
dc.SetTextForeground(wxColour(0,0,0));
dc.DrawText( _("Repeat :"), x+4, y+whileConditionsHeight+3);
whileConditionsHeight += repeatHeight;
//Draw conditions rectangle
wxRect rect(x, y+whileConditionsHeight, renderingHelper->GetConditionsColumnWidth()+border, GetRenderedHeight(width, platform)-whileConditionsHeight);
renderingHelper->DrawNiceRectangle(dc, rect);
renderingHelper->DrawConditionsList(conditions, dc,
x+border,
y+whileConditionsHeight+border,
renderingHelper->GetConditionsColumnWidth()-border, this, areas, selection, platform);
renderingHelper->DrawActionsList(actions, dc,
x+renderingHelper->GetConditionsColumnWidth()+border,
y+whileConditionsHeight+border,
width-renderingHelper->GetConditionsColumnWidth()-border*2, this, areas, selection, platform);
#endif
}
unsigned int WhileEvent::GetRenderedHeight(unsigned int width, const gd::Platform & platform) const
{
#if !defined(GD_NO_WX_GUI)
if ( eventHeightNeedUpdate )
{
gd::EventsRenderingHelper * renderingHelper = gd::EventsRenderingHelper::Get();
int border = renderingHelper->instructionsListBorder;
const int repeatHeight = 20;
//Get maximum height needed
int whileConditionsHeight = renderingHelper->GetRenderedConditionsListHeight(whileConditions, width-80-border*2, platform);
if (!infiniteLoopWarning && whileConditionsHeight < 32 ) whileConditionsHeight = 32;
int conditionsHeight = renderingHelper->GetRenderedConditionsListHeight(conditions, renderingHelper->GetConditionsColumnWidth()-border, platform);
int actionsHeight = renderingHelper->GetRenderedActionsListHeight(actions, width-renderingHelper->GetConditionsColumnWidth()-border*2, platform);
renderedHeight = (( conditionsHeight > actionsHeight ? conditionsHeight : actionsHeight ) + whileConditionsHeight + repeatHeight)+border*2+border*2;
eventHeightNeedUpdate = false;
}
return renderedHeight;
return renderedHeight;
#else
return 0;
return 0;
#endif
}
gd::BaseEvent::EditEventReturnType WhileEvent::EditEvent(wxWindow* parent_, gd::Project & game_, gd::Layout & scene_, gd::MainFrameWrapper & mainFrameWrapper_)
{
gd::BaseEvent::EditEventReturnType WhileEvent::EditEvent(
wxWindow* parent_,
gd::Project& game_,
gd::Layout& scene_,
gd::MainFrameWrapper& mainFrameWrapper_) {
#if !defined(GD_NO_WX_GUI)
if ( !justCreatedByTheUser )
{
wxMessageDialog dialog(parent_, _("Do you want to activate the display of a message if the event is repeated 100000 times? This message prevent the software from being frozen if you accidentally create an infinite loop ( by letting the conditions empty for example )."),
_("Protection against infinite loops."),
wxYES_NO|wxCANCEL|wxICON_INFORMATION);
if (!justCreatedByTheUser) {
wxMessageDialog dialog(
parent_,
_("Do you want to activate the display of a message if the event is "
"repeated 100000 times? This message prevent the software from being "
"frozen if you accidentally create an infinite loop ( by letting the "
"conditions empty for example )."),
_("Protection against infinite loops."),
wxYES_NO | wxCANCEL | wxICON_INFORMATION);
dialog.SetExtendedMessage(_("This message is activated by default for \"While\" events in the IDE, and is deactivated when the game is compiled to an executable."));
dialog.SetYesNoCancelLabels(_("Activate"), _("Deactivate"), _("Cancel"));
dialog.SetExtendedMessage(_(
"This message is activated by default for \"While\" events in the IDE, "
"and is deactivated when the game is compiled to an executable."));
dialog.SetYesNoCancelLabels(_("Activate"), _("Deactivate"), _("Cancel"));
int answer = dialog.ShowModal();
if ( answer == wxID_YES ) infiniteLoopWarning = true;
else if ( answer == wxID_NO ) infiniteLoopWarning = false;
}
justCreatedByTheUser = false; //Show Message dialog next time.
int answer = dialog.ShowModal();
if (answer == wxID_YES)
infiniteLoopWarning = true;
else if (answer == wxID_NO)
infiniteLoopWarning = false;
}
justCreatedByTheUser = false; // Show Message dialog next time.
#endif
return ChangesMade;
return ChangesMade;
}
}
} // namespace gd
#endif

View File

@@ -1,92 +1,120 @@
/*
* GDevelop Core
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights reserved.
* This project is released under the MIT License.
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights
* reserved. This project is released under the MIT License.
*/
#ifndef GDCORE_WHILEEVENT_H
#define GDCORE_WHILEEVENT_H
#include "GDCore/Events/EventsList.h"
#include "GDCore/Events/Event.h"
namespace gd { class Instruction; }
namespace gd { class Project; }
#include "GDCore/Events/EventsList.h"
namespace gd {
class Instruction;
}
namespace gd {
class Project;
}
class RuntimeScene;
class TiXmlElement;
namespace gd { class EventsEditorItemsAreas; }
namespace gd { class EventsEditorSelection; }
namespace gd
{
/**
* \brief While event is a standard event that is repeated while some conditions are true
*
* \note The platforms are required to warn the user about a possible infinite loop if the iteration count reach 100 000
* and if HasInfiniteLoopWarning() returns true.
*/
class GD_CORE_API WhileEvent : public gd::BaseEvent
{
public:
WhileEvent() : infiniteLoopWarning(true), justCreatedByTheUser(true) {};
virtual ~WhileEvent() {};
virtual gd::WhileEvent * Clone() const { return new WhileEvent(*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; };
const gd::InstructionsList & GetWhileConditions() const { return whileConditions; };
gd::InstructionsList & GetWhileConditions() { return whileConditions; };
void SetWhileConditions(gd::InstructionsList & whileConditions_) { whileConditions = whileConditions_; };
bool HasInfiniteLoopWarning() const { return infiniteLoopWarning; }
virtual std::vector < gd::InstructionsList* > GetAllConditionsVectors();
virtual std::vector < gd::InstructionsList* > GetAllActionsVectors();
virtual std::vector < const gd::InstructionsList* > GetAllConditionsVectors() const;
virtual std::vector < const gd::InstructionsList* > GetAllActionsVectors() const;
virtual void SerializeTo(SerializerElement & element) const;
virtual void UnserializeFrom(gd::Project & project, const SerializerElement & element);
/**
* Called by event editor to draw the event.
*/
virtual void Render(wxDC & dc, int x, int y, unsigned int width, gd::EventsEditorItemsAreas & areas, gd::EventsEditorSelection & selection, const gd::Platform & platform);
/**
* Must return the height of the event when rendered
*/
virtual unsigned int GetRenderedHeight(unsigned int width, const gd::Platform & platform) const;
/**
* Called when the user want to edit the event
*/
virtual EditEventReturnType EditEvent(wxWindow* parent_, gd::Project & game_, gd::Layout & scene_, gd::MainFrameWrapper & mainFrameWrapper_);
private:
gd::InstructionsList whileConditions;
gd::InstructionsList conditions;
gd::InstructionsList actions;
EventsList events;
bool infiniteLoopWarning; ///< If true, code will be generated to warn the developer against an infinite loop.
bool justCreatedByTheUser; ///< Used so as not to show message box to de/activate infinite loop warning when the user create the event
mutable unsigned int whileConditionsHeight;
int GetConditionsHeight() const;
int GetActionsHeight() const;
int GetWhileConditionsHeight() const;
};
namespace gd {
class EventsEditorItemsAreas;
}
namespace gd {
class EventsEditorSelection;
}
#endif // GDCORE_WHILEEVENT_H
namespace gd {
/**
* \brief While event is a standard event that is repeated while some conditions
* are true
*
* \note The platforms are required to warn the user about a possible infinite
* loop if the iteration count reach 100 000 and if HasInfiniteLoopWarning()
* returns true.
*/
class GD_CORE_API WhileEvent : public gd::BaseEvent {
public:
WhileEvent() : infiniteLoopWarning(true), justCreatedByTheUser(true){};
virtual ~WhileEvent(){};
virtual gd::WhileEvent* Clone() const { return new WhileEvent(*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; };
const gd::InstructionsList& GetWhileConditions() const {
return whileConditions;
};
gd::InstructionsList& GetWhileConditions() { return whileConditions; };
void SetWhileConditions(gd::InstructionsList& whileConditions_) {
whileConditions = whileConditions_;
};
bool HasInfiniteLoopWarning() const { return infiniteLoopWarning; }
virtual std::vector<gd::InstructionsList*> GetAllConditionsVectors();
virtual std::vector<gd::InstructionsList*> GetAllActionsVectors();
virtual std::vector<const gd::InstructionsList*> GetAllConditionsVectors()
const;
virtual std::vector<const gd::InstructionsList*> GetAllActionsVectors() const;
virtual void SerializeTo(SerializerElement& element) const;
virtual void UnserializeFrom(gd::Project& project,
const SerializerElement& element);
/**
* Called by event editor to draw the event.
*/
virtual void Render(wxDC& dc,
int x,
int y,
unsigned int width,
gd::EventsEditorItemsAreas& areas,
gd::EventsEditorSelection& selection,
const gd::Platform& platform);
/**
* Must return the height of the event when rendered
*/
virtual unsigned int GetRenderedHeight(unsigned int width,
const gd::Platform& platform) const;
/**
* Called when the user want to edit the event
*/
virtual EditEventReturnType EditEvent(
wxWindow* parent_,
gd::Project& game_,
gd::Layout& scene_,
gd::MainFrameWrapper& mainFrameWrapper_);
private:
gd::InstructionsList whileConditions;
gd::InstructionsList conditions;
gd::InstructionsList actions;
EventsList events;
bool infiniteLoopWarning; ///< If true, code will be generated to warn the
///< developer against an infinite loop.
bool justCreatedByTheUser; ///< Used so as not to show message box to
///< de/activate infinite loop warning when the
///< user create the event
mutable unsigned int whileConditionsHeight;
int GetConditionsHeight() const;
int GetActionsHeight() const;
int GetWhileConditionsHeight() const;
};
} // namespace gd
#endif // GDCORE_WHILEEVENT_H

View File

@@ -1,68 +1,92 @@
/*
* GDevelop Core
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights reserved.
* This project is released under the MIT License.
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights
* reserved. This project is released under the MIT License.
*/
#include "GDCore/Events/CodeGeneration/EventsCodeGenerationContext.h"
#include "GDCore/Events/Tools/EventsCodeNameMangler.h"
#include <set>
#include "GDCore/CommonTools.h"
#include "GDCore/Events/CodeGeneration/EventsCodeGenerator.h"
#include <set>
#include "GDCore/Events/Tools/EventsCodeNameMangler.h"
using namespace std;
namespace gd
{
namespace gd {
void EventsCodeGenerationContext::InheritsFrom(const EventsCodeGenerationContext & parent_)
{
parent = &parent_;
void EventsCodeGenerationContext::InheritsFrom(
const EventsCodeGenerationContext& parent_) {
parent = &parent_;
//Objects lists declared by parent became "already declared" in the child context.
alreadyDeclaredObjectsLists = parent_.alreadyDeclaredObjectsLists;
std::copy( parent_.objectsListsToBeDeclared.begin(), parent_.objectsListsToBeDeclared.end(), std::inserter( alreadyDeclaredObjectsLists, alreadyDeclaredObjectsLists.begin() ) );
std::copy( parent_.emptyObjectsListsToBeDeclared.begin(), parent_.emptyObjectsListsToBeDeclared.end(), std::inserter( alreadyDeclaredObjectsLists, alreadyDeclaredObjectsLists.begin() ) );
// Objects lists declared by parent became "already declared" in the child
// context.
alreadyDeclaredObjectsLists = parent_.alreadyDeclaredObjectsLists;
std::copy(parent_.objectsListsToBeDeclared.begin(),
parent_.objectsListsToBeDeclared.end(),
std::inserter(alreadyDeclaredObjectsLists,
alreadyDeclaredObjectsLists.begin()));
std::copy(parent_.emptyObjectsListsToBeDeclared.begin(),
parent_.emptyObjectsListsToBeDeclared.end(),
std::inserter(alreadyDeclaredObjectsLists,
alreadyDeclaredObjectsLists.begin()));
depthOfLastUse = parent_.depthOfLastUse;
customConditionDepth = parent_.customConditionDepth;
contextDepth = parent_.GetContextDepth()+1;
if ( parent_.maxDepthLevel )
{
maxDepthLevel = parent_.maxDepthLevel;
*maxDepthLevel = std::max(*maxDepthLevel, contextDepth);
}
depthOfLastUse = parent_.depthOfLastUse;
customConditionDepth = parent_.customConditionDepth;
contextDepth = parent_.GetContextDepth() + 1;
if (parent_.maxDepthLevel) {
maxDepthLevel = parent_.maxDepthLevel;
*maxDepthLevel = std::max(*maxDepthLevel, contextDepth);
}
}
void EventsCodeGenerationContext::ObjectsListNeeded(const gd::String & objectName)
{
if ( emptyObjectsListsToBeDeclared.find(objectName) == emptyObjectsListsToBeDeclared.end() )
objectsListsToBeDeclared.insert(objectName);
depthOfLastUse[objectName] = GetContextDepth();
}
void EventsCodeGenerationContext::EmptyObjectsListNeeded(const gd::String & objectName)
{
if ( objectsListsToBeDeclared.find(objectName) == objectsListsToBeDeclared.end() )
emptyObjectsListsToBeDeclared.insert(objectName);
depthOfLastUse[objectName] = GetContextDepth();
void EventsCodeGenerationContext::Reuse(
const EventsCodeGenerationContext& parent_) {
InheritsFrom(parent_);
if (parent_.CanReuse())
contextDepth = parent_.GetContextDepth(); // Keep same context depth
}
std::set<gd::String> EventsCodeGenerationContext::GetAllObjectsToBeDeclared() const
{
std::set <gd::String> allObjectListsToBeDeclared(objectsListsToBeDeclared.begin(), objectsListsToBeDeclared.end());
allObjectListsToBeDeclared.insert(emptyObjectsListsToBeDeclared.begin(), emptyObjectsListsToBeDeclared.end());
void EventsCodeGenerationContext::ObjectsListNeeded(
const gd::String& objectName) {
if (emptyObjectsListsToBeDeclared.find(objectName) ==
emptyObjectsListsToBeDeclared.end())
objectsListsToBeDeclared.insert(objectName);
return allObjectListsToBeDeclared;
depthOfLastUse[objectName] = GetContextDepth();
}
void EventsCodeGenerationContext::EmptyObjectsListNeeded(
const gd::String& objectName) {
if (objectsListsToBeDeclared.find(objectName) ==
objectsListsToBeDeclared.end())
emptyObjectsListsToBeDeclared.insert(objectName);
depthOfLastUse[objectName] = GetContextDepth();
}
unsigned int EventsCodeGenerationContext::GetLastDepthObjectListWasNeeded(const gd::String & name) const
{
if ( depthOfLastUse.count(name) != 0 )
return depthOfLastUse.find(name)->second;
std::set<gd::String> EventsCodeGenerationContext::GetAllObjectsToBeDeclared()
const {
std::set<gd::String> allObjectListsToBeDeclared(
objectsListsToBeDeclared.begin(), objectsListsToBeDeclared.end());
allObjectListsToBeDeclared.insert(emptyObjectsListsToBeDeclared.begin(),
emptyObjectsListsToBeDeclared.end());
std::cout << "WARNING: During code generation, the last depth of an object list was 0." << std::endl;
return 0;
return allObjectListsToBeDeclared;
}
unsigned int EventsCodeGenerationContext::GetLastDepthObjectListWasNeeded(
const gd::String& name) const {
if (depthOfLastUse.count(name) != 0) return depthOfLastUse.find(name)->second;
std::cout << "WARNING: During code generation, the last depth of an object "
"list was 0."
<< std::endl;
return 0;
}
bool EventsCodeGenerationContext::IsSameObjectsList(
const gd::String& objectName,
const EventsCodeGenerationContext& otherContext) const {
return GetLastDepthObjectListWasNeeded(objectName) ==
otherContext.GetLastDepthObjectListWasNeeded(objectName);
}
} // namespace gd

View File

@@ -1,156 +1,241 @@
/*
* GDevelop Core
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights reserved.
* This project is released under the MIT License.
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights
* reserved. This project is released under the MIT License.
*/
#ifndef EVENTSCODEGENERATIONCONTEXT_H
#define EVENTSCODEGENERATIONCONTEXT_H
#include "GDCore/String.h"
#include <set>
#include <map>
#include <memory>
namespace gd { class Layout; }
#include <set>
#include "GDCore/String.h"
namespace gd {
class Layout;
}
namespace gd
{
namespace gd {
/**
* \brief Used to manage the context when generating code for events.
*
* The context refers to :
* - The objects lists being available.
* - The "current object", i.e the object being used by an action or a condition.
* - If conditions are being generated, the context keeps track of the depth of the conditions ( see GetCurrentConditionDepth )
* - The "current object", i.e the object being used by an action or a
* condition.
* - If conditions are being generated, the context keeps track of the depth of
* the conditions ( see GetCurrentConditionDepth )
* - You can also get the context depth of the last use of an object list.
*/
class GD_CORE_API EventsCodeGenerationContext
{
friend class EventsCodeGenerator;
public:
/**
* Default constructor. You may want to call InheritsFrom just after.
* \param maxDepthLevel Optional pointer to an unsigned integer that will be updated to contain the maximal scope depth reached.
*/
EventsCodeGenerationContext(unsigned int * maxDepthLevel_ = nullptr) : contextDepth(0), customConditionDepth(0), maxDepthLevel(maxDepthLevel_), parent(NULL) {};
virtual ~EventsCodeGenerationContext() {};
class GD_CORE_API EventsCodeGenerationContext {
friend class EventsCodeGenerator;
/**
* Call this method to make an EventsCodeGenerationContext as a "child" of another one.
* The child will then for example not declare again objects already declared by its parent.
*/
void InheritsFrom(const EventsCodeGenerationContext & parent);
public:
/**
* Default constructor. You may want to call InheritsFrom just after.
* \param maxDepthLevel Optional pointer to an unsigned integer that will be
* updated to contain the maximal scope depth reached.
*/
EventsCodeGenerationContext(unsigned int* maxDepthLevel_ = nullptr)
: contextDepth(0),
customConditionDepth(0),
maxDepthLevel(maxDepthLevel_),
parent(NULL),
reuseExplicitlyForbidden(false){};
virtual ~EventsCodeGenerationContext(){};
/**
* \brief Returns the depth of the inheritance of the context.
*
* A context created from scratch will returns 0, and a context inheriting from a context with depth n will returns n+1.
*/
size_t GetContextDepth() const { return contextDepth; }
/**
* Call this method to make an EventsCodeGenerationContext as a "child" of
* another one. The child will then for example not declare again objects
* already declared by its parent.
*/
void InheritsFrom(const EventsCodeGenerationContext& parent);
/**
* \brief Get the parent context, if any.
* \return A pointer to the parent context, or NULL if the context has no parent.
*/
const EventsCodeGenerationContext * GetParentContext() const { return parent; }
/**
* \brief As InheritsFrom, mark the context as being the child of another one,
* but enabling the child context to use the same object lists.
*
* Used for example for optimizing the last event of a list.
*/
void Reuse(const EventsCodeGenerationContext& parent);
/**
* Mark the object has being the object being handled by the instruction
*/
void SetCurrentObject(const gd::String & objectName) { currentObject = objectName; };
/**
* \brief Forbid any optimization that would reuse and modify the object list
* from this context in children context.
*
* Used in while/for each/repeat or any event that have a loop and must ensure
* that the list of objects stay clean.
*/
void ForbidReuse() { reuseExplicitlyForbidden = true; }
/**
* Set that no particular object is being handled by an instruction
*/
void SetNoCurrentObject() { currentObject = ""; };
/**
* \brief Return false if the object lists of the context can not be reused in
* a child context.
*/
bool CanReuse() const {
return !reuseExplicitlyForbidden && parent != nullptr;
}
/**
* Get the object being handled by the instruction
*/
const gd::String & GetCurrentObject() const { return currentObject; };
/**
* \brief Returns the depth of the inheritance of the context.
*
* A context created from scratch will returns 0, and a context inheriting
* from a context with depth n will returns n+1.
*/
size_t GetContextDepth() const { return contextDepth; }
/**
* \brief Call this when an instruction in the event need an object list.
*
* The list will be filled with objects from the scene if it is the first time it is requested, unless there is
* already an object list with this name ( i.e. ObjectAlreadyDeclared(objectName) returns true ).
*/
void ObjectsListNeeded(const gd::String & objectName);
/**
* \brief Get the parent context, if any.
* \return A pointer to the parent context, or NULL if the context has no
* parent.
*/
const EventsCodeGenerationContext* GetParentContext() const { return parent; }
/**
* Call this when an instruction in the event need an object list.
* An empty event list will be declared, without filling it with objects from the scene. If there is already an object
* list with this name, no new list will be declared again.
*/
void EmptyObjectsListNeeded(const gd::String & objectName);
/**
* Mark the object has being the object being handled by the instruction
*/
void SetCurrentObject(const gd::String& objectName) {
currentObject = objectName;
};
/**
* Return true if an object list has already been declared (or is going to be declared).
*/
bool ObjectAlreadyDeclared(const gd::String & objectName) const { return (alreadyDeclaredObjectsLists.find(objectName) != alreadyDeclaredObjectsLists.end()); };
/**
* Set that no particular object is being handled by an instruction
*/
void SetNoCurrentObject() { currentObject = ""; };
/**
* \brief Consider that \a objectName is now declared in the context.
*/
void SetObjectDeclared(const gd::String & objectName ) { alreadyDeclaredObjectsLists.insert(objectName); }
/**
* Get the object being handled by the instruction
*/
const gd::String& GetCurrentObject() const { return currentObject; };
/**
* Return all the objects lists which will be declared by the current context
* ( the non empty as well as the empty objects lists )
*/
std::set<gd::String> GetAllObjectsToBeDeclared() const;
/**
* \brief Call this when an instruction in the event need an object list.
*
* The list will be filled with objects from the scene if it is the first time
* it is requested, unless there is already an object list with this name (
* i.e. ObjectAlreadyDeclared(objectName) returns true ).
*/
void ObjectsListNeeded(const gd::String& objectName);
/**
* Return the objects lists which will be declared by the current context
*/
const std::set<gd::String> & GetObjectsListsToBeDeclared() const { return objectsListsToBeDeclared; };
/**
* Call this when an instruction in the event need an object list.
* An empty event list will be declared, without filling it with objects from
* the scene. If there is already an object list with this name, no new list
* will be declared again.
*/
void EmptyObjectsListNeeded(const gd::String& objectName);
/**
* Return the objects lists which will be declared, but no filled, by the current context
*/
const std::set<gd::String> & GetObjectsListsToBeDeclaredEmpty() const { return emptyObjectsListsToBeDeclared; };
/**
* Return true if an object list has already been declared (or is going to be
* declared).
*/
bool ObjectAlreadyDeclared(const gd::String& objectName) const {
return (alreadyDeclaredObjectsLists.find(objectName) !=
alreadyDeclaredObjectsLists.end());
};
/**
* Return the objects lists which are already declared and can be used in the current context without declaration.
*/
const std::set<gd::String> & GetObjectsListsAlreadyDeclared() const { return alreadyDeclaredObjectsLists; };
/**
* \brief Consider that \a objectName is now declared in the context.
*/
void SetObjectDeclared(const gd::String& objectName) {
alreadyDeclaredObjectsLists.insert(objectName);
}
/**
* \brief Get the depth of the context that was in effect when \a objectName was needed.
*
* If \a objectName is needed in this context, it will return the depth of this context.
*/
unsigned int GetLastDepthObjectListWasNeeded(const gd::String & objectName) const;
/**
* Return all the objects lists which will be declared by the current context
* ( the non empty as well as the empty objects lists )
*/
std::set<gd::String> GetAllObjectsToBeDeclared() const;
/**
* \brief Called when a custom condition code is generated.
*/
void EnterCustomCondition() { customConditionDepth++; };
/**
* Return the objects lists which will be declared by the current context
*/
const std::set<gd::String>& GetObjectsListsToBeDeclared() const {
return objectsListsToBeDeclared;
};
/**
* \brief Called when a custom condition code generation is over.
*/
void LeaveCustomCondition() { customConditionDepth--; };
/**
* Return the objects lists which will be declared, but no filled, by the
* current context
*/
const std::set<gd::String>& GetObjectsListsToBeDeclaredEmpty() const {
return emptyObjectsListsToBeDeclared;
};
/**
* \brief Get the current condition depth : The depth is increased each time a custom condition code is generated,
* and decreased when the condition generation is done.
*
* This can be useful to generate sub conditions booleans with a different name than the parent's conditions.
*/
size_t GetCurrentConditionDepth() const { return customConditionDepth; }
/**
* Return the objects lists which are already declared and can be used in the
* current context without declaration.
*/
const std::set<gd::String>& GetObjectsListsAlreadyDeclared() const {
return alreadyDeclaredObjectsLists;
};
private:
std::set<gd::String> alreadyDeclaredObjectsLists; ///< Objects lists already needed in a parent context.
std::set<gd::String> objectsListsToBeDeclared; ///< Objects lists that will be declared in this context.
std::set<gd::String> emptyObjectsListsToBeDeclared; ///< Objects lists that will be declared in this context, but not filled with scene's objects.
std::map<gd::String, unsigned int> depthOfLastUse; ///< The context depth when an object was last used.
gd::String currentObject; ///< The object being used by an action or condition.
unsigned int contextDepth; ///< The depth of the context : 0 for a newly created context, n+1 for any context inheriting from context with depth n.
unsigned int customConditionDepth; ///< The depth of the conditions being generated.
unsigned int * maxDepthLevel; ///< A pointer to a unsigned int updated with the maximum depth reached.
const EventsCodeGenerationContext * parent; ///< The parent of the current context. Can be NULL.
/**
* \brief Get the depth of the context that was in effect when \a objectName
* was needed.
*
* If \a objectName is needed in this context, it will return the depth of
* this context.
*/
unsigned int GetLastDepthObjectListWasNeeded(
const gd::String& objectName) const;
/**
* \brief Check if twos context have the same list for an object.
*
* This can be the case when a context is reusing the lists of another (see
* gd::EventsCodeGenerationContext::Reuse).
*/
bool IsSameObjectsList(const gd::String& objectName,
const EventsCodeGenerationContext& otherContext) const;
/**
* \brief Called when a custom condition code is generated.
*/
void EnterCustomCondition() { customConditionDepth++; };
/**
* \brief Called when a custom condition code generation is over.
*/
void LeaveCustomCondition() { customConditionDepth--; };
/**
* \brief Get the current condition depth : The depth is increased each time a
* custom condition code is generated, and decreased when the condition
* generation is done.
*
* This can be useful to generate sub conditions booleans with a different
* name than the parent's conditions.
*/
size_t GetCurrentConditionDepth() const { return customConditionDepth; }
private:
std::set<gd::String>
alreadyDeclaredObjectsLists; ///< Objects lists already needed in a
///< parent context.
std::set<gd::String>
objectsListsToBeDeclared; ///< Objects lists that will be declared in
///< this context.
std::set<gd::String>
emptyObjectsListsToBeDeclared; ///< Objects lists that will be declared
///< in this context, but not filled with
///< scene's objects.
std::map<gd::String, unsigned int>
depthOfLastUse; ///< The context depth when an object was last used.
gd::String
currentObject; ///< The object being used by an action or condition.
unsigned int contextDepth; ///< The depth of the context : 0 for a newly
///< created context, n+1 for any context
///< inheriting from context with depth n.
unsigned int
customConditionDepth; ///< The depth of the conditions being generated.
unsigned int* maxDepthLevel; ///< A pointer to a unsigned int updated with
///< the maximum depth reached.
const EventsCodeGenerationContext*
parent; ///< The parent of the current context. Can be NULL.
bool reuseExplicitlyForbidden; ///< If set to true, forbid children context
///< to reuse this one without inheriting.
};
}
#endif // EVENTSCODEGENERATIONCONTEXT_H
} // namespace gd
#endif // EVENTSCODEGENERATIONCONTEXT_H

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,200 +1,229 @@
/*
* GDevelop Core
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights reserved.
* This project is released under the MIT License.
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights
* reserved. This project is released under the MIT License.
*/
#include "ExpressionsCodeGeneration.h"
#include "GDCore/Project/Project.h"
#include "GDCore/Project/Layout.h"
#include "GDCore/CommonTools.h"
#include "GDCore/Events/CodeGeneration/EventsCodeGenerationContext.h"
#include "GDCore/Events/CodeGeneration/EventsCodeGenerator.h"
#include "GDCore/Events/Parsers/ExpressionParser.h"
#include "GDCore/Events/Tools/EventsCodeNameMangler.h"
#include "GDCore/Extensions/Metadata/BehaviorMetadata.h"
#include "GDCore/Extensions/Metadata/ExpressionMetadata.h"
#include "GDCore/Extensions/Metadata/MetadataProvider.h"
#include "GDCore/Extensions/Metadata/ObjectMetadata.h"
#include "GDCore/Extensions/Platform.h"
#include "GDCore/Extensions/PlatformExtension.h"
#include "GDCore/Extensions/Metadata/MetadataProvider.h"
#include "GDCore/Events/Parsers/ExpressionParser.h"
#include "GDCore/Events/CodeGeneration/EventsCodeGenerator.h"
#include "GDCore/Events/Tools/EventsCodeNameMangler.h"
#include "GDCore/Events/CodeGeneration/EventsCodeGenerationContext.h"
#include "GDCore/Extensions/Metadata/ExpressionMetadata.h"
#include "GDCore/Extensions/Metadata/ObjectMetadata.h"
#include "GDCore/Extensions/Metadata/BehaviorMetadata.h"
#include "GDCore/CommonTools.h"
#include "GDCore/Project/Layout.h"
#include "GDCore/Project/Project.h"
using namespace std;
namespace gd
{
namespace gd {
CallbacksForGeneratingExpressionCode::CallbacksForGeneratingExpressionCode(gd::String & plainExpression_,
EventsCodeGenerator & codeGenerator_,
EventsCodeGenerationContext & context_) :
plainExpression(plainExpression_),
codeGenerator(codeGenerator_),
context(context_)
{
CallbacksForGeneratingExpressionCode::CallbacksForGeneratingExpressionCode(
gd::String& plainExpression_,
EventsCodeGenerator& codeGenerator_,
EventsCodeGenerationContext& context_)
: plainExpression(plainExpression_),
codeGenerator(codeGenerator_),
context(context_) {}
}
void CallbacksForGeneratingExpressionCode::OnConstantToken(gd::String text)
{
plainExpression += text;
void CallbacksForGeneratingExpressionCode::OnConstantToken(gd::String text) {
plainExpression += text;
};
void CallbacksForGeneratingExpressionCode::OnStaticFunction(gd::String functionName, const std::vector<gd::Expression> & parameters, const gd::ExpressionMetadata & expressionInfo)
{
codeGenerator.AddIncludeFiles(expressionInfo.codeExtraInformation.GetIncludeFiles());
void CallbacksForGeneratingExpressionCode::OnStaticFunction(
gd::String functionName,
const std::vector<gd::Expression>& parameters,
const gd::ExpressionMetadata& expressionInfo) {
codeGenerator.AddIncludeFiles(
expressionInfo.codeExtraInformation.GetIncludeFiles());
//Launch custom code generator if needed
if (expressionInfo.codeExtraInformation.HasCustomCodeGenerator())
{
plainExpression += expressionInfo.codeExtraInformation.customCodeGenerator(parameters, codeGenerator, context);
return;
}
// Launch custom code generator if needed
if (expressionInfo.codeExtraInformation.HasCustomCodeGenerator()) {
plainExpression += expressionInfo.codeExtraInformation.customCodeGenerator(
parameters, codeGenerator, context);
return;
}
//Special case: For strings expressions, function without name is a string.
if ( GetReturnType() == "string" && functionName.empty() )
{
if ( parameters.empty() ) return;
plainExpression += codeGenerator.ConvertToStringExplicit(parameters[0].GetPlainString());
// Special case: For strings expressions, function without name is a string.
if (GetReturnType() == "string" && functionName.empty()) {
if (parameters.empty()) return;
plainExpression +=
codeGenerator.ConvertToStringExplicit(parameters[0].GetPlainString());
return;
}
return;
}
//Prepare parameters
std::vector<gd::String> parametersCode = codeGenerator.GenerateParametersCodes(parameters, expressionInfo.parameters, context);
gd::String parametersStr;
for (std::size_t i = 0;i<parametersCode.size();++i)
{
if ( i != 0 ) parametersStr += ", ";
parametersStr += parametersCode[i];
}
// Prepare parameters
std::vector<gd::String> parametersCode =
codeGenerator.GenerateParametersCodes(
parameters, expressionInfo.parameters, context);
gd::String parametersStr;
for (std::size_t i = 0; i < parametersCode.size(); ++i) {
if (i != 0) parametersStr += ", ";
parametersStr += parametersCode[i];
}
plainExpression += expressionInfo.codeExtraInformation.functionCallName+"("+parametersStr+")";
plainExpression += expressionInfo.codeExtraInformation.functionCallName +
"(" + parametersStr + ")";
};
void CallbacksForGeneratingExpressionCode::OnObjectFunction(gd::String functionName, const std::vector<gd::Expression> & parameters, const gd::ExpressionMetadata & expressionInfo)
{
const gd::Project & project = codeGenerator.GetProject();
const gd::Layout & scene = codeGenerator.GetLayout();
void CallbacksForGeneratingExpressionCode::OnObjectFunction(
gd::String functionName,
const std::vector<gd::Expression>& parameters,
const gd::ExpressionMetadata& expressionInfo) {
const gd::Project& project = codeGenerator.GetProject();
const gd::Layout& scene = codeGenerator.GetLayout();
codeGenerator.AddIncludeFiles(expressionInfo.codeExtraInformation.GetIncludeFiles());
if ( parameters.empty() ) return;
codeGenerator.AddIncludeFiles(
expressionInfo.codeExtraInformation.GetIncludeFiles());
if (parameters.empty()) return;
//Launch custom code generator if needed
if ( expressionInfo.codeExtraInformation.HasCustomCodeGenerator() )
{
plainExpression += expressionInfo.codeExtraInformation.customCodeGenerator(parameters, codeGenerator, context);
return;
}
// Launch custom code generator if needed
if (expressionInfo.codeExtraInformation.HasCustomCodeGenerator()) {
plainExpression += expressionInfo.codeExtraInformation.customCodeGenerator(
parameters, codeGenerator, context);
return;
}
//Prepare parameters
std::vector<gd::String> parametersCode = codeGenerator.GenerateParametersCodes(parameters, expressionInfo.parameters, context);
gd::String parametersStr;
for (std::size_t i = 1;i<parametersCode.size();++i)
{
if ( i != 1 ) parametersStr += ", ";
parametersStr += parametersCode[i];
}
// Prepare parameters
std::vector<gd::String> parametersCode =
codeGenerator.GenerateParametersCodes(
parameters, expressionInfo.parameters, context);
gd::String parametersStr;
for (std::size_t i = 1; i < parametersCode.size(); ++i) {
if (i != 1) parametersStr += ", ";
parametersStr += parametersCode[i];
}
gd::String output = GetReturnType() == "string" ? "\"\"" : "0";
gd::String output = GetReturnType() == "string" ? "\"\"" : "0";
//Get object(s) concerned by function call
std::vector<gd::String> realObjects = codeGenerator. ExpandObjectsName(parameters[0].GetPlainString(), context);
for (std::size_t i = 0;i<realObjects.size();++i)
{
context.ObjectsListNeeded(realObjects[i]);
// Get object(s) concerned by function call
std::vector<gd::String> realObjects =
codeGenerator.ExpandObjectsName(parameters[0].GetPlainString(), context);
for (std::size_t i = 0; i < realObjects.size(); ++i) {
context.ObjectsListNeeded(realObjects[i]);
gd::String objectType = gd::GetTypeOfObject(project, scene, realObjects[i]);
const ObjectMetadata & objInfo = MetadataProvider::GetObjectMetadata(codeGenerator.GetPlatform(), objectType);
gd::String objectType = gd::GetTypeOfObject(project, scene, realObjects[i]);
const ObjectMetadata& objInfo = MetadataProvider::GetObjectMetadata(
codeGenerator.GetPlatform(), objectType);
//Build gd::String to access the object
codeGenerator.AddIncludeFiles(objInfo.includeFiles);
output = codeGenerator.GenerateObjectFunctionCall(realObjects[i], objInfo, expressionInfo.codeExtraInformation, parametersStr, output, context);
}
// Build gd::String to access the object
codeGenerator.AddIncludeFiles(objInfo.includeFiles);
output = codeGenerator.GenerateObjectFunctionCall(
realObjects[i],
objInfo,
expressionInfo.codeExtraInformation,
parametersStr,
output,
context);
}
plainExpression += output;
plainExpression += output;
};
void CallbacksForGeneratingExpressionCode::OnObjectBehaviorFunction(gd::String functionName, const std::vector<gd::Expression> & parameters, const gd::ExpressionMetadata & expressionInfo)
{
const gd::Project & project = codeGenerator.GetProject();
const gd::Layout & scene = codeGenerator.GetLayout();
void CallbacksForGeneratingExpressionCode::OnObjectBehaviorFunction(
gd::String functionName,
const std::vector<gd::Expression>& parameters,
const gd::ExpressionMetadata& expressionInfo) {
const gd::Project& project = codeGenerator.GetProject();
const gd::Layout& scene = codeGenerator.GetLayout();
codeGenerator.AddIncludeFiles(expressionInfo.codeExtraInformation.GetIncludeFiles());
if ( parameters.size() < 2 ) return;
codeGenerator.AddIncludeFiles(
expressionInfo.codeExtraInformation.GetIncludeFiles());
if (parameters.size() < 2) return;
//Launch custom code generator if needed
if ( expressionInfo.codeExtraInformation.HasCustomCodeGenerator() )
{
plainExpression += expressionInfo.codeExtraInformation.customCodeGenerator(parameters, codeGenerator, context);
return;
}
// Launch custom code generator if needed
if (expressionInfo.codeExtraInformation.HasCustomCodeGenerator()) {
plainExpression += expressionInfo.codeExtraInformation.customCodeGenerator(
parameters, codeGenerator, context);
return;
}
//Prepare parameters
std::vector<gd::String> parametersCode = codeGenerator.GenerateParametersCodes(parameters, expressionInfo.parameters, context);
gd::String parametersStr;
for (std::size_t i = 2;i<parametersCode.size();++i)
{
if ( i != 2 ) parametersStr += ", ";
parametersStr += parametersCode[i];
}
// Prepare parameters
std::vector<gd::String> parametersCode =
codeGenerator.GenerateParametersCodes(
parameters, expressionInfo.parameters, context);
gd::String parametersStr;
for (std::size_t i = 2; i < parametersCode.size(); ++i) {
if (i != 2) parametersStr += ", ";
parametersStr += parametersCode[i];
}
//Get object(s) concerned by function call
std::vector<gd::String> realObjects = codeGenerator. ExpandObjectsName(parameters[0].GetPlainString(), context);
// Get object(s) concerned by function call
std::vector<gd::String> realObjects =
codeGenerator.ExpandObjectsName(parameters[0].GetPlainString(), context);
gd::String output = GetReturnType() == "string" ? "\"\"" : "0";
for (std::size_t i = 0;i<realObjects.size();++i)
{
context.ObjectsListNeeded(realObjects[i]);
gd::String output = GetReturnType() == "string" ? "\"\"" : "0";
for (std::size_t i = 0; i < realObjects.size(); ++i) {
context.ObjectsListNeeded(realObjects[i]);
//Cast the object if needed
gd::String behaviorType = gd::GetTypeOfBehavior(project, scene, parameters[1].GetPlainString());
const BehaviorMetadata & autoInfo = MetadataProvider::GetBehaviorMetadata(codeGenerator.GetPlatform(), behaviorType);
// Cast the object if needed
gd::String behaviorType =
gd::GetTypeOfBehavior(project, scene, parameters[1].GetPlainString());
const BehaviorMetadata& autoInfo = MetadataProvider::GetBehaviorMetadata(
codeGenerator.GetPlatform(), behaviorType);
//Build gd::String to access the behavior
codeGenerator.AddIncludeFiles(autoInfo.includeFiles);
output = codeGenerator.GenerateObjectBehaviorFunctionCall(realObjects[i], parameters[1].GetPlainString(), autoInfo, expressionInfo.codeExtraInformation, parametersStr, output, context);
}
// Build gd::String to access the behavior
codeGenerator.AddIncludeFiles(autoInfo.includeFiles);
output = codeGenerator.GenerateObjectBehaviorFunctionCall(
realObjects[i],
parameters[1].GetPlainString(),
autoInfo,
expressionInfo.codeExtraInformation,
parametersStr,
output,
context);
}
plainExpression += output;
plainExpression += output;
};
bool CallbacksForGeneratingExpressionCode::OnSubMathExpression(const gd::Platform & platform, const gd::Project & project, const gd::Layout & layout, gd::Expression & expression)
{
gd::String newExpression;
bool CallbacksForGeneratingExpressionCode::OnSubMathExpression(
const gd::Platform& platform,
const gd::Project& project,
const gd::Layout& layout,
gd::Expression& expression) {
gd::String newExpression;
CallbacksForGeneratingExpressionCode callbacks(newExpression, codeGenerator, context);
CallbacksForGeneratingExpressionCode callbacks(
newExpression, codeGenerator, context);
gd::ExpressionParser parser(expression.GetPlainString());
if ( !parser.ParseMathExpression(platform, project, layout, callbacks) )
{
#if defined(GD_IDE_ONLY)
firstErrorStr = callbacks.firstErrorStr;
firstErrorPos = callbacks.firstErrorPos;
#endif
return false;
}
gd::ExpressionParser parser(expression.GetPlainString());
if (!parser.ParseMathExpression(platform, project, layout, callbacks)) {
#if defined(GD_IDE_ONLY)
firstErrorStr = callbacks.GetFirstError();
firstErrorPos = callbacks.GetFirstErrorPosition();
#endif
return false;
}
return true;
return true;
}
bool CallbacksForGeneratingExpressionCode::OnSubTextExpression(const gd::Platform & platform, const gd::Project & project, const gd::Layout & layout, gd::Expression & expression)
{
gd::String newExpression;
bool CallbacksForGeneratingExpressionCode::OnSubTextExpression(
const gd::Platform& platform,
const gd::Project& project,
const gd::Layout& layout,
gd::Expression& expression) {
gd::String newExpression;
CallbacksForGeneratingExpressionCode callbacks(newExpression, codeGenerator, context);
CallbacksForGeneratingExpressionCode callbacks(
newExpression, codeGenerator, context);
gd::ExpressionParser parser(expression.GetPlainString());
if ( !parser.ParseStringExpression(platform, project, layout, callbacks) )
{
#if defined(GD_IDE_ONLY)
firstErrorStr = callbacks.firstErrorStr;
firstErrorPos = callbacks.firstErrorPos;
#endif
return false;
}
gd::ExpressionParser parser(expression.GetPlainString());
if (!parser.ParseStringExpression(platform, project, layout, callbacks)) {
#if defined(GD_IDE_ONLY)
firstErrorStr = callbacks.GetFirstError();
firstErrorPos = callbacks.GetFirstErrorPosition();
#endif
return false;
}
return true;
return true;
}
}
} // namespace gd

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