Compare commits

...

389 Commits

Author SHA1 Message Date
Florian Rival
46338bf314 Bump newIDE version 2018-08-28 00:32:32 +01:00
Florian Rival
0a7880f98e Fix monaco-editor/vs/loader.js breaking libraries (as defining "define" globally) 2018-08-28 00:27:31 +01:00
Florian Rival
38ae17595e Update newIDE README 2018-08-27 23:29:09 +01:00
Florian Rival
545caa1dbd Bump newIDE version 2018-08-27 23:25:44 +01:00
Florian Rival
3be23212a6 Fix invalid verification of object name leading to memory corruption (libGD.js) 2018-08-27 23:05:51 +01:00
Florian Rival
54b6bf969c Clone drag'n'dropped instructions when Ctrl (or Cmd) is pressed 2018-08-27 22:07:48 +01:00
Lizard-13
d449a478f5 Fix behavior activated condition (#597) 2018-08-27 21:45:12 +01:00
Florian Rival
b410a1e1b3 Merge pull request #596 from 4ian/feature/instructions-dnd
Add support for drag'n'dropping (multiple) conditions and actions
2018-08-27 20:48:50 +01:00
Florian Rival
6d6d86a325 Fix selected events being deleted after drag'n'dropping instructions 2018-08-27 20:46:44 +01:00
Florian Rival
291d6663f2 Avoid calling drop/moveSelectionToInstructionsList more than once 2018-08-27 11:49:57 +01:00
Florian Rival
4ab27e0954 Fix flow typing of authentification 2018-08-27 01:33:06 +01:00
Florian Rival
28ffcf923b Display red indicator if drop can't be done (actions on conditions and vice-versa) 2018-08-27 01:18:05 +01:00
Florian Rival
af5faa2e10 Add drag'n'drop support for instructions 2018-08-27 01:09:22 +01:00
Florian Rival
4bfdc4a2a1 Add flowtype definition for multiple dependencies 2018-08-27 00:52:33 +01:00
Florian Rival
c6141322c5 Avoid potential memory issues by limiting undo/redo history to 50 states 2018-08-26 16:05:32 +01:00
Florian Rival
59f8421a03 Fix potential memory (libGD.js) corruption/crashs by clearing selection after undo/redo in SceneEditor 2018-08-26 15:32:09 +01:00
Florian Rival
b217f80c23 Prevent negative width/height when resizing + fix properties not updated 2018-08-26 15:04:01 +01:00
Florian Rival
70635d1655 Fix modifier key like Shift wrongly detected as pressed in scene editor focused out while pressed 2018-08-26 14:30:32 +01:00
Florian Rival
9dfbe94c13 Round width/height when resizing to avoid floating values in instance sizes 2018-08-26 14:12:12 +01:00
Florian Rival
7244885fd6 Fix React warning 2018-08-26 12:22:58 +01:00
Florian Rival
f8e5ac7828 Fix selected object not highlighted in Objects list 2018-08-26 12:22:28 +01:00
Florian Rival
030f873433 Add missing description for two examples 2018-08-26 02:19:36 +01:00
Florian Rival
74e5b4862e Add menu items to move up/down layout/external events/external layouts 2018-08-26 02:19:13 +01:00
Florian Rival
87f20b82f1 Allow case insensitive search in examples 2018-08-25 17:12:37 +01:00
Florian Rival
992c00c096 Add descriptions for all examples and fix typo in Breakout example name 2018-08-25 17:02:33 +01:00
Florian Rival
2673c1526d Update exit-app example to use Quit Game action now that it is working 2018-08-25 15:52:01 +01:00
Florian Rival
2ddc451691 Merge pull request #593 from 4ian/feature/events-types-lister
Add search bar and chips to filter examples
2018-08-25 13:05:58 +01:00
Florian Rival
0a77880dc3 Improve colors of chips of examples 2018-08-25 12:59:07 +01:00
Florian Rival
aefddd0bf4 Update ExamplesExtensionsUsage.js 2018-08-25 12:38:14 +01:00
Florian Rival
1e1b3a7a42 Fix warning from Webpack with OptionalRequire.js 2018-08-25 12:37:00 +01:00
Florian Rival
e9a50f1146 Add chips to search in examples by extension and a text search 2018-08-25 12:14:45 +01:00
Florian Rival
28957c5662 Factor functions of newIDE scripts, allow to discover JS extensions and dynamically read examples list 2018-08-24 18:29:19 +01:00
Florian Rival
303a489a41 Adapt JsExtensionsLoader to allow it to be used from Node.js 2018-08-24 16:57:37 +01:00
Florian Rival
fe7d66dc1c [WIP] Improve update-stats-from-resources-examples to return used extensions 2018-08-24 14:25:04 +01:00
Florian Rival
a287e24c6b Add MetadataProvider methods that can return the associated extension 2018-08-24 00:23:33 +01:00
Florian Rival
8ec191ebf5 [WIP] Add MetadataProvider methods that can return the associated extension 2018-08-23 18:25:28 +01:00
Florian Rival
9e6a40a07e [WIP] Add EventsTypesLister 2018-08-23 09:04:28 +01:00
Florian Rival
b785b3d2fc Enhance typings/documentation of GDJS 2018-08-22 23:08:20 +01:00
Florian Rival
5bf75f8cd6 Add support for fullscreen and close the app on Electron/Cordova (#590)
* Move openURL to RuntimeGameRenderer for consistency/portability
* Add support for Fullscreen in Electron
* Add support for closing the game/app on Electron and Cordova
* Improve typings and allow RuntimeGame.adaptRendererSizeToFillScreen to be called without args
2018-08-22 21:58:22 +01:00
Florian Rival
e71e019415 Add DeviceSensors to web-app and examples 2018-08-22 20:12:40 +01:00
Wend1go
1bd73f3ff4 Add compass example and add value ranges to orientation instructions (#591) 2018-08-22 19:54:13 +01:00
Florian Rival
f1148655d5 Add 8 examples and update one 2018-08-21 21:14:17 +01:00
Florian Rival
cadfc98b47 Add help links for DeviceSensors extension 2018-08-21 20:19:05 +01:00
Wend1go
bda4a790b9 Add orientation sensor extension with examples (#587) 2018-08-21 17:32:10 +01:00
Bouh
be34bbc0af Fix flickering on mobile and transparent background (#588) 2018-08-20 10:48:10 +02:00
Florian Rival
da91917b40 Remove useless console.log 2018-08-19 15:46:06 +02:00
Florian Rival
9c6978b70a Ensure any new window opened from a link is opened in default browser 2018-08-19 15:44:50 +02:00
Florian Rival
feec79d9de Allow to choose a custom theme for the Monaco code editor 2018-08-19 15:25:17 +02:00
Florian Rival
ed872b8c95 Fix error message of ObjectField not always triggering properly 2018-08-19 14:24:20 +02:00
Florian Rival
04ea7d16fe Fix name of JsCode events 2018-08-19 13:46:36 +02:00
Florian Rival
7ae838bff4 Fix docsearch by directly using algoliasearch and formatting results with ListItems 2018-08-18 19:50:21 +02:00
Florian Rival
a324405695 Improve some documentation/typing for gdjs.Force 2018-08-18 19:21:14 +02:00
Florian Rival
204f6cd1f1 Merge pull request #586 from 4ian/feature/monaco-editor
Add Monaco Editor for editing JavaScript events, with autocompletions
2018-08-18 12:06:56 +02:00
Florian Rival
1a0dcc01df Add example of Platformer with Javascript code blocks to replace events 2018-08-18 00:02:36 +02:00
Florian Rival
bf125a3312 Fix display of tooltip/boxes of CodeEditor overflowing the editor 2018-08-17 23:43:09 +02:00
Florian Rival
747e2961b3 Add autocompletion support for extensions in CodeEditor 2018-08-17 23:42:43 +02:00
Florian Rival
011932ba27 Improve some documentation/typing for GDJS 2018-08-17 23:42:16 +02:00
Florian Rival
2037176b1e Avoid overflow on the right of the content of JsCodeEvent 2018-08-17 21:17:35 +02:00
Florian Rival
525b99697b Improve some documentation/typing for gdjs.RuntimeObject 2018-08-17 21:07:47 +02:00
Florian Rival
69849cb7be Fix resize of JsCodeEvent after the editor is loaded 2018-08-17 18:50:40 +02:00
Florian Rival
c8e56c60c5 Make wording to select objects to pass to JavaScript more explicit 2018-08-17 18:34:38 +02:00
Florian Rival
f182ed0704 Enhance/fix types in documentation of GDJS 2018-08-17 18:34:22 +02:00
Florian Rival
98f97f7b17 Add Monaco editor for JavaScript code events, with autocompletion support 2018-08-17 18:03:06 +02:00
Florian Rival
a60eee9924 Add Content-Security-Policy to newIDE index.html 2018-08-16 17:04:27 +02:00
Florian Rival
6b6cd0b61d Code split between local/browser specific code for slightly faster startup/loading 2018-08-16 17:04:27 +02:00
Florian Rival
5c19c9bb14 Update newIDE to Electron 2.0.7 2018-08-16 17:04:27 +02:00
Florian Rival
3f4d1d66ef Merge branch 'master' of github.com:4ian/GD 2018-08-16 17:04:00 +02:00
Florian Rival
c17fcaf9ac Improve layout of InstancePropertiesEditor (by adding support for grouping by rows) 2018-08-16 17:03:40 +02:00
Bouh
687758a41f Update links to Discord to send users to #announces channel (#583) 2018-08-14 10:37:11 +01:00
Florian Rival
bbb541ce48 Add accelerator shortcut in the tooltip for searching events panel 2018-08-13 21:21:02 +02:00
Florian Rival
10ef38978d Allow to open search panel with Ctrl+F 2018-08-13 21:13:56 +02:00
Florian Rival
c70604f196 Update flow to v0.78 2018-08-13 20:37:39 +02:00
Florian Rival
c5ffa44aa2 Fix tests 2018-08-13 20:33:34 +02:00
Florian Rival
bf69037e46 Fix broken stories in Storybook 2018-08-13 20:26:35 +02:00
Florian Rival
2c422a5927 Reduce margins of newIDE to 4px 2018-08-13 20:12:02 +02:00
Florian Rival
f5149d7c61 Add search/replace panel (SearchPanel) to EventsSheet (#581) 2018-08-13 17:46:37 +01:00
Florian Rival
a1a56f1b3b Add help links for Facebook Instant Games actions 2018-08-10 08:10:59 +01:00
Florian Rival
dcec81519b Bump newIDE version 2018-08-09 22:19:33 +01:00
Florian Rival
c9c2e41bd9 Delay check for updates to 10 seconds after start and fix default theme preference 2018-08-09 22:05:40 +01:00
Florian Rival
39a6aa2a90 Bump Electron version of exported GDJS games to 2.0.7 2018-08-09 17:48:57 +01:00
Florian Rival
f4532e7e4c Rework preferences to allow users to disable auto-updates (#578) 2018-08-09 17:45:28 +01:00
Florian Rival
9a551673e8 Add explicit dependency on electron with a pinned version for GDJS Electron export 2018-08-07 23:04:44 +01:00
Florian Rival
39887ccc80 Add help links in actions/conditions editor (#576)
* Add support for help links in InstructionParametersEditor.
* Add help paths for extensions/objects/behaviors/instructions
2018-08-07 23:03:50 +01:00
Bouh
97c0761288 Change TextField to SemiControlledTextField in TiledSpriteEditor (#577) 2018-08-07 22:22:51 +01:00
Wend1go
edb33e805f Fix object being selected for insertion on scene after double click #574 (#575)
Clicking the canvas after opening and closing the edit object window via double click no longer adds an object
2018-08-05 11:01:26 +01:00
Florian Rival
e1cfca6930 Bump newIDE version 2018-08-02 20:52:02 +01:00
Florian Rival
26ffcda159 Update Bomb The Crate example 2018-08-02 20:43:51 +01:00
Florian Rival
ee905f4f04 Increase timing before sending HelpFinder analytics 2018-08-02 20:19:01 +01:00
Florian Rival
e4b2fe677b Fix Debugger with Pathfinding behavior (fix #570)
This was due to the HSHG grid being serialized.
Also removed unnecessary circular serialization of behavior owners
2018-08-01 08:52:35 +01:00
Lizard-13
2ed9b058be Add minor fixes on Skeleton extension (#568) 2018-07-31 09:24:39 +01:00
Wend1go
35e3015d66 Fix Pixi flickering on some mobile phones (#566)
* Fix flickering on some mobile devices (Android/Ubuntu Touch)
2018-07-30 16:55:58 +01:00
Florian Rival
b6707d62b2 Fix default font loading for Text object 2018-07-28 12:59:50 +01:00
Florian Rival
76466af778 Bump newIDE version 2018-07-25 22:18:29 +01:00
Florian Rival
193b8fa36e Add/update 7 examples 2018-07-25 22:07:03 +01:00
Florian Rival
1c24e4f14d Fix RuntimeObject::PutAroundAPosition and gdjs.RuntimeObject.prototype.putAround
Positioning was not made using center of object which was making it inconsistent
with other related actions/expressions (like the expression to get distance).
2018-07-25 22:06:34 +01:00
Florian Rival
d0bfb37680 Merge branch 'master' of github.com:4ian/GD 2018-07-23 23:11:53 +01:00
Florian Rival
db480f09d8 Add analytics to help links 2018-07-23 22:35:47 +01:00
Lizard-13
b2b3307ff7 Add RandomInRange, RandomFloat and other random functions (#558) 2018-07-21 19:06:26 +01:00
Florian Rival
17754d4fe5 Add bomb-the-crate example 2018-07-20 17:20:34 +01:00
Florian Rival
0f912472ce Fix opening of HelpIcon links in browser 2018-07-20 17:00:30 +01:00
Florian Rival
8c13b051ad Fix ProjectTitlebar not updating according to the project file path/url 2018-07-20 13:48:11 +01:00
Florian Rival
268075b8bc Don't display intro dialog if a project is opened at startup 2018-07-20 13:37:30 +01:00
Florian Rival
23e899d93d Add support for opening a file from command line option or from url "project" option 2018-07-20 13:26:02 +01:00
Florian Rival
1a76ad9069 Add center-object-within-another example 2018-07-20 08:53:16 +01:00
Florian Rival
1ac26ab8ce Add isometric game example (thanks Mickael Hoarau!) 2018-07-19 20:57:03 +01:00
Wend1go
69fa249db5 Allow to double click to edit object and add Duplicate item menu (#545)
* Open "edit Object" dialog via double click on object
* Add "Duplicate" option to context menu of object list
2018-07-19 14:10:58 +01:00
Florian Rival
f31b46cb14 Update links in README 2018-07-18 14:39:37 +01:00
Todor Imreorov
9e5ca5fb0b Add text field to rename object from object editor (#547) 2018-07-16 23:25:49 +01:00
Lizard-13
b64eeebcbe Add missing functions and bugfix for particles (#555)
* Add missing functions and bugfix for particles

* parseInt in base 10
2018-07-16 23:03:45 +01:00
Lizard-13
c9ae252ae8 Avoid potential errors by using parseInt in base 10 on sprite color (#557) 2018-07-16 23:02:41 +01:00
Florian Rival
ca789c7b0b Fix PlatformerObject behavior not properly staying on floor after object resize 2018-07-12 23:11:24 +01:00
Florian Rival
a142472ea6 Bump newIDE version 2018-07-11 23:29:17 +01:00
Florian Rival
d0c1f7fe03 Fix Facebook Instant Games extension icons and action groups 2018-07-11 23:28:59 +01:00
Florian Rival
6680682001 Bump newIDE version 2018-07-11 22:32:28 +01:00
Florian Rival
91ff59e846 Switch back to ES5 for JsExtension.js 2018-07-11 22:28:31 +01:00
Florian Rival
65aa60e726 Bump newIDE version 2018-07-11 22:17:04 +01:00
Florian Rival
5bb6150861 Add various help links 2018-07-11 22:16:29 +01:00
Florian Rival
6b850e82e7 Add extensions sanity tests 2018-07-11 19:33:47 +01:00
Florian Rival
400c956c2a Expose more features of Facebook Instant Games 2018-07-10 23:31:56 +01:00
Florian Rival
896446f640 Fix missing calls to t("...") in ExampleJsExtension 2018-07-09 22:21:20 +01:00
Wend1go
c8f526e726 Fix getting stuck in camera panning mode bug (#549) 2018-07-08 22:11:25 +01:00
Florian Rival
8bc6ea0744 Exclude extensions named *Example* from newIDE (only in non dev environment) 2018-07-08 19:00:32 +01:00
Florian Rival
215cb0b859 Merge pull request #544 from 4ian/feature/js-extension-dot-js
Add support for extensions declared in JavaScript
2018-07-06 19:39:21 +01:00
Florian Rival
0d9e31f986 Remove console.log 2018-07-06 19:36:39 +01:00
Florian Rival
0019da90c7 Update documentation about implementing JavaScript extensions 2018-07-05 23:38:51 +01:00
Florian Rival
dc870d55ac Update documentation about declaring JavaScript extensions 2018-07-05 00:15:22 +01:00
Florian Rival
df1fff36e4 Update GDJS documentation to add a index page and generate it from GenerateAllDocs script 2018-07-04 23:24:37 +01:00
Florian Rival
5da334a38e Remove yuidoc 2018-07-04 22:37:05 +01:00
Florian Rival
3be5d85733 Update GDJS docs to use JSDoc 2018-07-04 22:26:02 +01:00
Florian Rival
4c62bc2f33 Add comments about GetCodeExtraInformation 2018-07-04 00:32:37 +01:00
Florian Rival
57fbe470b7 Add ExampleJsExtension 2018-07-04 00:20:03 +01:00
Florian Rival
25abff997e Add InitialInstance.SetRaw(Float|String)Property and fix ObjectMetadata constructed with object blueprint 2018-07-04 00:16:42 +01:00
Florian Rival
97ced4145f Add alternative way to call AddObject on an extension using a blueprint object
Also remove dead code
2018-07-01 22:52:18 +01:00
Todor Imreorov
1d7f8958fc Add set folder button in Piskel (#543) 2018-06-29 11:19:47 +01:00
Florian Rival
373c55ddc5 Fix flowtyping 2018-06-29 00:17:16 +01:00
Florian Rival
8e0783e45f Load JsExtensions.js in BrowserJsExtensionsLoader 2018-06-29 00:09:46 +01:00
Florian Rival
22b977fd0e [WIP] Add supports for full JS extensions (JsExtension.js)
Convert FacebookInstantGames to it
2018-06-29 00:08:55 +01:00
Florian Rival
f9925943a3 Fix FacebookInstantGames extension 2018-06-28 22:26:17 +01:00
Florian Rival
26b6c8c6aa Fix test 2018-06-27 09:45:19 +01:00
Florian Rival
ff1fec7c5c Merge pull request #535 from 4ian/feature/profiler
Add basic Profiler for GDevelop 5
2018-06-25 22:25:41 +01:00
Nnarol
97aeafc4c3 Fix compilation issue on Windows due to a windows.h macro (#538)
windows.h defines "Yield" to be empty, which invalidates the definition of wxThread::Yield().
2018-06-25 22:24:57 +01:00
Florian Rival
5468ea19b3 Fix profiler not stopped (and user unable to get results) when changing scene 2018-06-25 21:50:55 +01:00
Florian Rival
4ce2ba08ef Add EventsContextAnalyzer and EventsContextAnalyzerDialog to use it in newIDE 2018-06-25 21:15:12 +01:00
Florian Rival
561ef0434f Refactor parameters type testing into ParameterMetadata::IsExpression 2018-06-24 19:13:37 +01:00
Florian Rival
d229d01aa9 Enable button to open profiler and listen to start/stop messages 2018-06-24 00:33:30 +01:00
Florian Rival
5fc9a4a51a Improve Profiler 2018-06-24 00:06:04 +01:00
Florian Rival
9f05a4e190 Fix gdjs.Profiler for sections appearing more than once 2018-06-23 11:43:33 +01:00
Florian Rival
ac7f681947 Add EmptyMessage explanation when Profiler was not started 2018-06-23 11:43:33 +01:00
Florian Rival
f7ae28bea9 Fix PlatformerObjectRuntimeBehavior using too much potential platforms for collision detection 2018-06-23 11:43:33 +01:00
Florian Rival
3104eeb415 Fix a crash in newIDE when resizing a MosaicWindow 2018-06-23 11:43:33 +01:00
Florian Rival
cdf95811b9 Refactor ingame profiling display & remove profiling at begining of scene 2018-06-23 11:43:33 +01:00
Florian Rival
731356b791 Move Profiler section code generation to EventsCodeGenerator 2018-06-23 11:43:33 +01:00
Florian Rival
8dd13180fd Fix flow typing 2018-06-23 11:43:32 +01:00
Florian Rival
81421907a5 Ensure codegeneration is adapted to preview/export (no profiling in exported games) for GDJS 2018-06-23 11:43:32 +01:00
Florian Rival
bb23e2c018 Add Prettier configuration file for GDJS 2018-06-23 11:43:32 +01:00
Florian Rival
eb6461c819 Refactor serialization in websocket-debugger-client 2018-06-23 11:43:32 +01:00
Florian Rival
1a3bd2423d [WIP] Add support for profiler in GDJS 2018-06-23 11:43:32 +01:00
Florian Rival
c22934d46f Add ThemeConsumer to avoid relying on muiThemeable HOC 2018-06-23 11:43:32 +01:00
Todor Imreorov
6cdee3b977 Add Piskel related improvements (#522)
* Show Resize prompt on Piskel for any new animations
* Add ability to set Piskel animation name
2018-06-23 11:22:39 +01:00
Lizard-13
88d102620a Add support for audio dynamic pitch (GDJS/Howler.js) (#533) 2018-06-21 18:33:12 +01:00
Florian Rival
3c5280a0f0 Merge branch 'master' of github.com:4ian/GD 2018-06-20 21:02:58 +01:00
Florian Rival
ad9abd971c Make Table themable and fix the styling of InstancesList in dark theme 2018-06-20 21:02:32 +01:00
Lizard-13
48465425e4 Fix include order (#527) 2018-06-18 23:51:26 +01:00
Lizard-13
02ddea17ea Add raycast-to-position condition (#526) 2018-06-18 23:50:03 +01:00
Florian Rival
24b68f75b8 Add 2 new examples 2018-06-17 22:45:15 +01:00
Florian Rival
bed9c77c8c Fix link in GDJS/Readme.md 2018-06-17 18:18:53 +01:00
Florian Rival
0a6f810695 Bump newIDE version 2018-06-17 14:37:22 +01:00
Florian Rival
a70f5df386 Add/update 9 examples 2018-06-17 14:33:50 +01:00
Florian Rival
83951c952f Fix icons generation on Windows 2018-06-17 12:46:00 +01:00
Florian Rival
5b0758a035 Bump newIDE version 2018-06-16 18:15:25 +01:00
Florian Rival
058a2e6c82 Add Windows/macOS/Linux to list of exports in web-app 2018-06-16 15:19:30 +01:00
Florian Rival
78b00f8c36 Add 8 examples to GDevelop 5 2018-06-16 15:10:29 +01:00
Florian Rival
2de67eae57 Remove LocalIntroDialog and reference to beta in BrowserIntroDialog 2018-06-16 12:55:37 +01:00
Florian Rival
4b6e8454de Merge pull request #521 from 4ian/feature/online-electron-export
Online (or manual) export for Windows/macOS/Linux for GD5
2018-06-16 12:53:22 +01:00
Florian Rival
b3d9a773b0 Add links to help page 2018-06-16 12:51:25 +01:00
Florian Rival
796937ba5d Update subscriptions details 2018-06-16 12:09:22 +01:00
Florian Rival
977095fb36 Add targets to build for in LocalOnlineElectronExport 2018-06-14 23:52:22 +01:00
Florian Rival
f1f1123dad Improve error message in exporters and reset build when launching new export 2018-06-14 08:39:14 +01:00
ddabrahim
d8e87cd976 Updated the magnet example (#520)
Changed the position of the center and origin point of the big magnet to improve touch experience
2018-06-13 17:31:22 +01:00
Florian Rival
663336c4ee Ensure .DS_Store is not shown in examples list in LocalExamples 2018-06-13 00:08:22 +01:00
Florian Rival
96c993e057 Add 6 examples to GDevelop 5 2018-06-13 00:00:53 +01:00
Florian Rival
5742dcfbf8 Add beta to online electron export 2018-06-12 21:21:36 +01:00
Florian Rival
bf231c6c07 Factor exporter Progress into BuildStepsProgress 2018-06-12 17:28:03 +01:00
Florian Rival
fdbc91137c Factor build progress watching between BuildsList and exporters 2018-06-12 00:28:58 +01:00
Florian Rival
3e409681c2 Add a window showing list of previous builds (no auto-refresh) 2018-06-11 22:36:45 +01:00
Florian Rival
c23642e78c Prevent any error due to quotes or invalid characters when exporting to Electron 2018-06-11 22:36:45 +01:00
Florian Rival
7845a3577c Fix Electron export 2018-06-11 22:36:45 +01:00
Florian Rival
60484ee464 Add Visual Studio code settings for auto-formatting of C++ files 2018-06-11 22:36:44 +01:00
Florian Rival
06b54e277a Add version in properties of a project 2018-06-11 22:36:44 +01:00
Florian Rival
daa683f492 [WIP] Add LocalOnlineElectronExport and LocalElectronExport 2018-06-11 22:36:44 +01:00
Florian Rival
f3a43e8739 Update Asteroids example 2018-06-11 21:48:07 +01:00
Florian Rival
4fb830529a Add Asteroids, Brakeout and Type on text effect examples 2018-06-11 00:06:05 +01:00
Florian Rival
9b7b02fab2 Fix flow typing 2018-06-10 20:25:39 +01:00
Florian Rival
ae3b25f8c0 Add .watchmanconfig file 2018-06-10 10:18:30 +01:00
Florian Rival
c59204ce04 Add contributors list 2018-06-10 10:17:22 +01:00
Florian Rival
fd63f7bc96 Add Examples tab in CreateProjectDialog with new examples
Add a script to update web-app examples from the examples in resources/examples folder (used by IDE running on Electron
runtime).
2018-06-09 16:34:39 +01:00
Florian Rival
147dc321f1 Fix formatting 2018-06-04 16:03:00 +01:00
Florian Rival
fd72c6efe9 Ensure there is only a single Once instructions at the end of an instruction list 2018-05-29 14:35:19 -07:00
Florian Rival
ff1891bb3a Avoid killing CPU by throttling updates to scrollbars while scrolling in scene editors 2018-05-28 23:13:46 -07:00
Florian Rival
ec32788b4c Update newIDE Readme 2018-05-28 21:41:35 -07:00
Florian Rival
95622169a3 Update GDJS Readme 2018-05-28 21:21:51 -07:00
Bouh
e89de02fa6 Move Window mask button to Grid submenu (#507) 2018-05-28 20:36:04 -07:00
Nnarol
63a5734f32 Resolve compilation issue due to incomplete wxBitmap type (#506)
Include wx/bitmap.h in FileProperty.h .
Remove redundant inclusion of wx/control.h .
2018-05-28 00:07:14 -07:00
Florian Rival
d66eeeced2 Bump newIDE version 2018-05-27 23:42:02 -07:00
Florian Rival
6d9b96d0e8 Fix game not launching with the specified scene 2018-05-27 23:41:01 -07:00
Florian Rival
a8196c383f Fix tests 2018-05-27 19:51:43 -07:00
Florian Rival
9891f0d7e6 Update download link of libGD.js which was referencing an old version 2018-05-27 19:19:26 -07:00
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
Lizard-13
46279e7762 Add JS events functions and hitboxes debug draw 2018-03-10 14:54:17 -03: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
2699 changed files with 500123 additions and 135325 deletions

1
.clang_format Normal file
View File

@@ -0,0 +1 @@
{BasedOnStyle: Google, BinPackParameters: false, BinPackArguments: false}

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.

View File

@@ -4,6 +4,11 @@ compiler:
- gcc
- clang
# Cache .npm folder for faster npm install
cache:
directories:
- $HOME/.npm
git:
depth: 999999
@@ -53,17 +58,19 @@ install:
- cd ..
script:
#newIDE tests:
- cd newIDE/app
- npm test
- npm run flow
- cd ../..
#GDJS game engine tests:
- cd GDJS/tests && npm test
- cd ../..
#GDCore and GDCpp game engine tests:
- cd .build-tests
- 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 ../..

View File

@@ -24,9 +24,9 @@
"__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 *\/",
"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",
@@ -45,7 +45,10 @@
"macFrameworkPath": [
"/System/Library/Frameworks",
"/Library/Frameworks"
]
],
"compilerPath": "/usr/bin/clang",
"cStandard": "c11",
"cppStandard": "c++17"
},
{
"name": "Linux",
@@ -66,9 +69,9 @@
"__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 *\/",
"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",
@@ -102,9 +105,9 @@
"__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 *\/",
"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",
@@ -118,5 +121,5 @@
}
}
],
"version": 3
}
"version": 4
}

13
.vscode/settings.json vendored
View File

@@ -71,7 +71,12 @@
"atomic": "cpp",
"locale": "cpp",
"string_view": "cpp",
"__string": "cpp"
"__string": "cpp",
"cstring": "cpp",
"iomanip": "cpp",
"cstdint": "cpp",
"forward_list": "cpp",
"mutex": "cpp"
},
"files.exclude": {
"Binaries/*build*": true,
@@ -89,5 +94,9 @@
"newIDE/electron-app/app/www": true
},
// Support for Flowtype:
"javascript.validate.enable": false
"javascript.validate.enable": false,
"flow.useNPMPackagedFlow": true,
// Clang format styling (duplicated in scripts/CMakeClangUtils.txt)
"C_Cpp.clang_format_style": "{BasedOnStyle: Google, BinPackParameters: false, BinPackArguments: false}"
}

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

View File

@@ -0,0 +1,241 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="32"
height="32"
viewBox="0 0 31.999999 32.000001"
id="svg2"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="orientation_active.svg"
inkscape:export-filename="/home/matthias/Programme/GD_MyFork/orientation_icons/orientation_active_32px.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90">
<defs
id="defs4">
<inkscape:path-effect
effect="skeletal"
id="path-effect6855"
is_visible="true"
pattern="M 0,5 C 0,2.24 2.24,0 5,0 7.76,0 10,2.24 10,5 10,7.76 7.76,10 5,10 2.24,10 0,7.76 0,5 Z"
copytype="single_stretched"
prop_scale="1"
scale_y_rel="false"
spacing="0"
normal_offset="0"
tang_offset="0"
prop_units="false"
vertical_pattern="false"
fuse_tolerance="0" />
<inkscape:path-effect
effect="skeletal"
id="path-effect6842"
is_visible="true"
pattern="M 0,5 C 0,2.24 2.24,0 5,0 7.76,0 10,2.24 10,5 10,7.76 7.76,10 5,10 2.24,10 0,7.76 0,5 Z"
copytype="single_stretched"
prop_scale="1"
scale_y_rel="false"
spacing="0"
normal_offset="0"
tang_offset="0"
prop_units="false"
vertical_pattern="false"
fuse_tolerance="0" />
<inkscape:path-effect
effect="skeletal"
id="path-effect4583"
is_visible="true"
pattern="M 0,5 C 0,2.24 2.24,0 5,0 7.76,0 10,2.24 10,5 10,7.76 7.76,10 5,10 2.24,10 0,7.76 0,5 Z"
copytype="single_stretched"
prop_scale="1"
scale_y_rel="false"
spacing="0"
normal_offset="0"
tang_offset="0"
prop_units="false"
vertical_pattern="false"
fuse_tolerance="0" />
<marker
inkscape:stockid="Arrow1Lend"
orient="auto"
refY="0"
refX="0"
id="Arrow1Lend"
style="overflow:visible"
inkscape:isstock="true">
<path
id="path4234"
d="M 0,0 5,-5 -12.5,0 5,5 0,0 Z"
style="fill:#617da1;fill-opacity:1;fill-rule:evenodd;stroke:#617da1;stroke-width:1pt;stroke-opacity:1"
transform="matrix(-0.8,0,0,-0.8,-10,0)"
inkscape:connector-curvature="0" />
</marker>
<marker
inkscape:stockid="Arrow1Lstart"
orient="auto"
refY="0"
refX="0"
id="Arrow1Lstart"
style="overflow:visible"
inkscape:isstock="true">
<path
id="path4231"
d="M 0,0 5,-5 -12.5,0 5,5 0,0 Z"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1"
transform="matrix(0.8,0,0,0.8,10,0)"
inkscape:connector-curvature="0" />
</marker>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="3.959798"
inkscape:cx="20.233951"
inkscape:cy="7.2727048"
inkscape:document-units="px"
inkscape:current-layer="layer2"
showgrid="false"
inkscape:snap-bbox="true"
inkscape:bbox-paths="true"
inkscape:bbox-nodes="true"
inkscape:snap-bbox-edge-midpoints="true"
inkscape:snap-bbox-midpoints="true"
inkscape:window-width="1920"
inkscape:window-height="1026"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:snap-global="false"
inkscape:object-paths="true"
inkscape:snap-intersection-paths="false"
inkscape:object-nodes="false"
inkscape:snap-smooth-nodes="false"
inkscape:snap-midpoints="false"
inkscape:snap-nodes="true"
units="px">
<inkscape:grid
type="xygrid"
id="grid6838" />
</sodipodi:namedview>
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="bg"
inkscape:groupmode="layer"
id="layer1"
style="opacity:0"
sodipodi:insensitive="true"
transform="translate(0,-1020.3622)">
<rect
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0.48900003;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#5d3b0b;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
id="rect4136"
width="537.14288"
height="537.14288"
x="108.57143"
y="232.3622"
ry="0" />
</g>
<g
inkscape:groupmode="layer"
id="layer2"
inkscape:label="vg"
transform="translate(0,-1020.3622)">
<path
inkscape:connector-curvature="0"
id="path4260"
d="M 17.705339,1047.9202 3.8554509,1034.0703 a 9.8935231,9.8935231 0 0 0 0.865828,12.9857 9.8935231,9.8935231 0 0 0 12.9840601,0.8642 z"
style="opacity:1;fill:#617da1;fill-opacity:1;stroke:none;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path4262"
d="m 15.476114,1045.691 -9.3874081,-9.3874 a 6.7720372,6.7720372 0 0 0 0.839681,8.5453 6.7720372,6.7720372 0 0 0 8.5477271,0.8421 z"
style="opacity:1;fill:#55687f;fill-opacity:1;stroke:none;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path4264"
d="m 13.104478,1043.3194 -4.6473891,-4.6474 a 3.5447378,3.5447378 0 0 0 0.752875,3.8953 3.5447378,3.5447378 0 0 0 3.8945141,0.7521 z"
style="opacity:1;fill:#45505d;fill-opacity:1;stroke:none;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<g
id="g4271">
<path
inkscape:connector-curvature="0"
id="path4193"
d="m 14.330666,1025.0237 13.849888,13.8499 a 9.8935231,9.8935231 0 0 0 -0.865828,-12.9857 9.8935231,9.8935231 0 0 0 -12.98406,-0.8642 z"
style="opacity:1;fill:#617da1;fill-opacity:1;stroke:none;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="circle4209"
d="m 16.559891,1027.2529 9.387408,9.3874 a 6.7720372,6.7720372 0 0 0 -0.839681,-8.5453 6.7720372,6.7720372 0 0 0 -8.547727,-0.8421 z"
style="opacity:1;fill:#55687f;fill-opacity:1;stroke:none;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="circle4211"
d="m 18.931527,1029.6245 4.647389,4.6474 a 3.5447378,3.5447378 0 0 0 -0.752875,-3.8953 3.5447378,3.5447378 0 0 0 -3.894514,-0.7521 z"
style="opacity:1;fill:#45505d;fill-opacity:1;stroke:none;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</g>
<g
id="g4185"
transform="matrix(0,1,-1,0,1052.3622,1020.3622)">
<g
transform="matrix(-0.70710678,-0.70710678,-0.70710678,0.70710678,761.06108,315.93318)"
id="g4164">
<rect
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#2d2d2d;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
id="rect4139"
width="29.490231"
height="13.97627"
x="1021.5129"
y="-24.405632"
ry="1.9309319"
transform="matrix(0,1,-1,0,0,0)" />
<path
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0.9;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#4c4c4c;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="m 23.516546,1048.5704 c -0.04767,-8.3635 0.05771,-16.73 -0.05645,-25.0917 -0.235339,-0.805 -1.013989,-0.9207 -1.576996,-0.7735 -3.050625,0.074 -6.121697,-0.1942 -9.156515,0.1468 -0.564763,0.4707 -0.49652,1.4656 -0.445964,2.2244 0.02634,7.9894 -0.06398,15.9823 0.04892,23.9695 0.230948,0.7665 0.973094,0.9226 1.519542,0.7675 3.04799,-0.056 6.10727,0.141 9.14698,-0.1067 0.315625,-0.2087 0.529513,-0.6681 0.519728,-1.1359 z"
id="rect4181"
inkscape:connector-curvature="0" />
<g
id="g4177"
transform="matrix(0,0.07409604,-0.0615007,0,50.235037,1008.3136)">
<path
inkscape:connector-curvature="0"
id="path4159"
d="m 293.62058,434.43653 c -16.41699,0.21869 -32.83277,0.54314 -49.24609,0.9982 40.22318,60.65317 80.41322,121.37951 120.66406,181.98201 16.66541,0.0638 33.3307,0.12377 49.99609,0.17961 -40.50006,-61.0078 -80.91528,-122.15931 -121.41406,-183.15982 z"
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#616161;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
<path
inkscape:connector-curvature="0"
id="path4163"
d="m 368.01511,434.63361 c -9.86715,-0.003 -19.73317,0.02 -29.59961,0.0587 40.58372,60.98623 81.13273,122.04569 121.7461,182.97743 16.59016,-0.003 33.17905,-0.0421 49.76562,-0.16726 -40.56648,-60.89249 -81.04682,-121.93216 -121.60937,-182.82191 -6.76751,-0.0159 -13.53548,-0.0448 -20.30274,-0.0469 z"
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#5e5e5e;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
</g>
</g>
</g>
<path
style="fill:#80b03e;fill-opacity:1;fill-rule:evenodd;stroke:#676767;stroke-width:0.48377252;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 8.967328,1032.9255 -5.0968894,2.4621 8.2068554,10.928 17.536753,-22.2017 -7.083812,0.086 -10.107389,12.699 z"
id="path4181"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccc" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 861 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -0,0 +1,223 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="32"
height="32"
viewBox="0 0 31.999999 32.000001"
id="svg2"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="orientation_alpha.svg"
inkscape:export-filename="/home/svisor/Dokumente/orientation/orientation_alpha_16px.png"
inkscape:export-xdpi="45"
inkscape:export-ydpi="45">
<defs
id="defs4">
<inkscape:path-effect
effect="skeletal"
id="path-effect6855"
is_visible="true"
pattern="M 0,5 C 0,2.24 2.24,0 5,0 7.76,0 10,2.24 10,5 10,7.76 7.76,10 5,10 2.24,10 0,7.76 0,5 Z"
copytype="single_stretched"
prop_scale="1"
scale_y_rel="false"
spacing="0"
normal_offset="0"
tang_offset="0"
prop_units="false"
vertical_pattern="false"
fuse_tolerance="0" />
<inkscape:path-effect
effect="skeletal"
id="path-effect6842"
is_visible="true"
pattern="M 0,5 C 0,2.24 2.24,0 5,0 7.76,0 10,2.24 10,5 10,7.76 7.76,10 5,10 2.24,10 0,7.76 0,5 Z"
copytype="single_stretched"
prop_scale="1"
scale_y_rel="false"
spacing="0"
normal_offset="0"
tang_offset="0"
prop_units="false"
vertical_pattern="false"
fuse_tolerance="0" />
<inkscape:path-effect
effect="skeletal"
id="path-effect4583"
is_visible="true"
pattern="M 0,5 C 0,2.24 2.24,0 5,0 7.76,0 10,2.24 10,5 10,7.76 7.76,10 5,10 2.24,10 0,7.76 0,5 Z"
copytype="single_stretched"
prop_scale="1"
scale_y_rel="false"
spacing="0"
normal_offset="0"
tang_offset="0"
prop_units="false"
vertical_pattern="false"
fuse_tolerance="0" />
<marker
inkscape:stockid="Arrow1Lend"
orient="auto"
refY="0"
refX="0"
id="Arrow1Lend"
style="overflow:visible"
inkscape:isstock="true">
<path
id="path4234"
d="M 0,0 5,-5 -12.5,0 5,5 0,0 Z"
style="fill:#617da1;fill-opacity:1;fill-rule:evenodd;stroke:#617da1;stroke-width:1pt;stroke-opacity:1"
transform="matrix(-0.8,0,0,-0.8,-10,0)"
inkscape:connector-curvature="0" />
</marker>
<marker
inkscape:stockid="Arrow1Lstart"
orient="auto"
refY="0"
refX="0"
id="Arrow1Lstart"
style="overflow:visible"
inkscape:isstock="true">
<path
id="path4231"
d="M 0,0 5,-5 -12.5,0 5,5 0,0 Z"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1"
transform="matrix(0.8,0,0,0.8,10,0)"
inkscape:connector-curvature="0" />
</marker>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="7.9195959"
inkscape:cx="-10.727491"
inkscape:cy="13.240628"
inkscape:document-units="px"
inkscape:current-layer="layer2"
showgrid="false"
inkscape:snap-bbox="true"
inkscape:bbox-paths="true"
inkscape:bbox-nodes="true"
inkscape:snap-bbox-edge-midpoints="true"
inkscape:snap-bbox-midpoints="true"
inkscape:window-width="1784"
inkscape:window-height="965"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:snap-global="false"
inkscape:object-paths="true"
inkscape:snap-intersection-paths="false"
inkscape:object-nodes="false"
inkscape:snap-smooth-nodes="false"
inkscape:snap-midpoints="false"
inkscape:snap-nodes="true"
units="px">
<inkscape:grid
type="xygrid"
id="grid6838" />
</sodipodi:namedview>
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="bg"
inkscape:groupmode="layer"
id="layer1"
style="opacity:0"
sodipodi:insensitive="true"
transform="translate(0,-1020.3622)">
<rect
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0.48900003;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#5d3b0b;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
id="rect4136"
width="537.14288"
height="537.14288"
x="108.57143"
y="232.3622"
ry="0" />
</g>
<g
inkscape:groupmode="layer"
id="layer2"
inkscape:label="vg"
transform="translate(0,-1020.3622)">
<path
sodipodi:type="spiral"
style="fill:none;fill-rule:evenodd;stroke:#617da1;stroke-width:117.59577179;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path4225"
sodipodi:cx="381.83768"
sodipodi:cy="500.81891"
sodipodi:expansion="2"
sodipodi:revolution="39.947353"
sodipodi:radius="263.47296"
sodipodi:argument="-251.55106"
sodipodi:t0="0.98124301"
d="M 514.43027,717.09103 C 396.34495,790.81298 236.37332,752.97207 162.79805,635.10821 88.142361,515.51357 126.46914,353.5023 245.84088,278.99418 366.57474,203.63587 530.09521,241.93425 605.84226,362.11077"
transform="matrix(-0.01300789,-0.04848619,0.0485461,-0.01299183,-3.1820691,1060.7591)" />
<rect
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#2d2d2d;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
id="rect4139"
width="23.508087"
height="11.14116"
x="4.2458982"
y="1031.1785"
ry="1.5392392" />
<path
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0.9;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#4c4c4c;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="m 25.814829,1031.8872 c -6.667001,0.038 -13.336293,-0.046 -20.0018744,0.045 -0.6416148,0.1876 -0.7339823,0.8083 -0.6166024,1.2571 0.059129,2.4318 -0.1547636,4.8799 0.1170802,7.2991 0.37515,0.4502 1.1682938,0.3958 1.7731176,0.3555 6.36877,-0.021 12.74023,0.051 19.107241,-0.039 0.61102,-0.1841 0.735486,-0.7757 0.611786,-1.2113 -0.04476,-2.4297 0.112409,-4.8684 -0.08527,-7.2915 -0.166424,-0.2516 -0.532577,-0.4221 -0.905478,-0.4143 z"
id="rect4181"
inkscape:connector-curvature="0" />
<g
id="g4177"
transform="matrix(0.05906553,0,0,0.04902518,-6.2759034,1010.5886)">
<path
inkscape:connector-curvature="0"
id="path4159"
d="m 293.62058,434.43653 c -16.41699,0.21869 -32.83277,0.54314 -49.24609,0.9982 40.22318,60.65317 80.41322,121.37951 120.66406,181.98201 16.66541,0.0638 33.3307,0.12377 49.99609,0.17961 -40.50006,-61.0078 -80.91528,-122.15931 -121.41406,-183.15982 z"
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#616161;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
<path
inkscape:connector-curvature="0"
id="path4163"
d="m 368.01511,434.63361 c -9.86715,-0.003 -19.73317,0.02 -29.59961,0.0587 40.58372,60.98623 81.13273,122.04569 121.7461,182.97743 16.59016,-0.003 33.17905,-0.0421 49.76562,-0.16726 -40.56648,-60.89249 -81.04682,-121.93216 -121.60937,-182.82191 -6.76751,-0.0159 -13.53548,-0.0448 -20.30274,-0.0469 z"
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#5e5e5e;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
</g>
<path
style="fill:#617da1;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 13.198999,1021.0966 0.01639,12.0632 -12.99441834,-11.989 z"
id="path6840"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccc" />
<path
sodipodi:nodetypes="cccc"
inkscape:connector-curvature="0"
id="path6846"
d="m 18.75867,1021.0966 -0.01639,12.0632 12.994419,-11.989 z"
style="fill:#617da1;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
style="fill:none;fill-rule:evenodd;stroke:#b54d4d;stroke-width:2.95327663;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 16.084308,1037.0443 0,-10.6452"
id="path6853"
inkscape:connector-curvature="0" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 724 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -0,0 +1,232 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="32"
height="32"
viewBox="0 0 31.999999 32.000001"
id="svg2"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="orientation_beta.svg"
inkscape:export-filename="/home/svisor/Dokumente/orientation/orientation_beta_32px.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90">
<defs
id="defs4">
<inkscape:path-effect
effect="skeletal"
id="path-effect6933"
is_visible="true"
pattern="m -9.5367432e-7,1025.3622 c 0,-2.76 2.23999995367432,-5 4.99999995367432,-5 2.76,0 5,2.24 5,5 0,2.76 -2.24,5 -5,5 -2.76,0 -4.99999995367432,-2.24 -4.99999995367432,-5 z"
copytype="single_stretched"
prop_scale="1"
scale_y_rel="false"
spacing="0"
normal_offset="0"
tang_offset="0"
prop_units="false"
vertical_pattern="false"
fuse_tolerance="0" />
<inkscape:path-effect
effect="skeletal"
id="path-effect6855"
is_visible="true"
pattern="M 0,5 C 0,2.24 2.24,0 5,0 7.76,0 10,2.24 10,5 10,7.76 7.76,10 5,10 2.24,10 0,7.76 0,5 Z"
copytype="single_stretched"
prop_scale="1"
scale_y_rel="false"
spacing="0"
normal_offset="0"
tang_offset="0"
prop_units="false"
vertical_pattern="false"
fuse_tolerance="0" />
<inkscape:path-effect
effect="skeletal"
id="path-effect6842"
is_visible="true"
pattern="M 0,5 C 0,2.24 2.24,0 5,0 7.76,0 10,2.24 10,5 10,7.76 7.76,10 5,10 2.24,10 0,7.76 0,5 Z"
copytype="single_stretched"
prop_scale="1"
scale_y_rel="false"
spacing="0"
normal_offset="0"
tang_offset="0"
prop_units="false"
vertical_pattern="false"
fuse_tolerance="0" />
<inkscape:path-effect
effect="skeletal"
id="path-effect4583"
is_visible="true"
pattern="M 0,5 C 0,2.24 2.24,0 5,0 7.76,0 10,2.24 10,5 10,7.76 7.76,10 5,10 2.24,10 0,7.76 0,5 Z"
copytype="single_stretched"
prop_scale="1"
scale_y_rel="false"
spacing="0"
normal_offset="0"
tang_offset="0"
prop_units="false"
vertical_pattern="false"
fuse_tolerance="0" />
<marker
inkscape:stockid="Arrow1Lend"
orient="auto"
refY="0"
refX="0"
id="Arrow1Lend"
style="overflow:visible"
inkscape:isstock="true">
<path
id="path4234"
d="M 0,0 5,-5 -12.5,0 5,5 0,0 Z"
style="fill:#617da1;fill-opacity:1;fill-rule:evenodd;stroke:#617da1;stroke-width:1pt;stroke-opacity:1"
transform="matrix(-0.8,0,0,-0.8,-10,0)"
inkscape:connector-curvature="0" />
</marker>
<marker
inkscape:stockid="Arrow1Lstart"
orient="auto"
refY="0"
refX="0"
id="Arrow1Lstart"
style="overflow:visible"
inkscape:isstock="true">
<path
id="path4231"
d="M 0,0 5,-5 -12.5,0 5,5 0,0 Z"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1"
transform="matrix(0.8,0,0,0.8,10,0)"
inkscape:connector-curvature="0" />
</marker>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="5.6568543"
inkscape:cx="46.575938"
inkscape:cy="27.265886"
inkscape:document-units="px"
inkscape:current-layer="layer2"
showgrid="true"
inkscape:snap-bbox="true"
inkscape:bbox-paths="true"
inkscape:bbox-nodes="true"
inkscape:snap-bbox-edge-midpoints="true"
inkscape:snap-bbox-midpoints="true"
inkscape:window-width="1784"
inkscape:window-height="965"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:snap-global="false"
inkscape:object-paths="true"
inkscape:snap-intersection-paths="false"
inkscape:object-nodes="false"
inkscape:snap-smooth-nodes="false"
inkscape:snap-midpoints="false"
inkscape:snap-nodes="true"
units="px">
<inkscape:grid
type="xygrid"
id="grid6838" />
</sodipodi:namedview>
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="bg"
inkscape:groupmode="layer"
id="layer1"
style="opacity:0"
sodipodi:insensitive="true"
transform="translate(0,-1020.3622)">
<rect
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0.48900003;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#5d3b0b;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
id="rect4136"
width="537.14288"
height="537.14288"
x="108.57143"
y="232.3622"
ry="0" />
</g>
<g
inkscape:groupmode="layer"
id="layer2"
inkscape:label="vg"
transform="translate(0,-1020.3622)">
<path
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#617da1;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="m 1.1903085,1030.3763 7.9884604,1.0094 7.7057061,2.0649 7.705714,2.0646 7.422963,3.1201 -1.004649,3.7494 -7.988449,-1.0095 -7.705717,-2.0648 -7.7057052,-2.0647 -7.42297142,-3.12 z"
id="rect6929"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccccccc" />
<g
id="g6920"
transform="matrix(0.96592583,0.25881905,-0.25881905,0.96592583,268.87497,31.190367)">
<rect
ry="1.5392392"
y="1031.1785"
x="4.2458982"
height="11.14116"
width="23.508087"
id="rect4139"
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#2d2d2d;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
<path
inkscape:connector-curvature="0"
id="rect4181"
d="m 25.814829,1031.8872 c -6.667001,0.038 -13.336293,-0.046 -20.0018744,0.045 -0.6416148,0.1876 -0.7339823,0.8083 -0.6166024,1.2571 0.059129,2.4318 -0.1547636,4.8799 0.1170802,7.2991 0.37515,0.4502 1.1682938,0.3958 1.7731176,0.3555 6.36877,-0.021 12.74023,0.051 19.107241,-0.039 0.61102,-0.1841 0.735486,-0.7757 0.611786,-1.2113 -0.04476,-2.4297 0.112409,-4.8684 -0.08527,-7.2915 -0.166424,-0.2516 -0.532577,-0.4221 -0.905478,-0.4143 z"
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0.9;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#4c4c4c;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
<g
transform="matrix(0.05906553,0,0,0.04902518,-6.2759034,1010.5886)"
id="g4177">
<path
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#616161;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="m 293.62058,434.43653 c -16.41699,0.21869 -32.83277,0.54314 -49.24609,0.9982 40.22318,60.65317 80.41322,121.37951 120.66406,181.98201 16.66541,0.0638 33.3307,0.12377 49.99609,0.17961 -40.50006,-61.0078 -80.91528,-122.15931 -121.41406,-183.15982 z"
id="path4159"
inkscape:connector-curvature="0" />
<path
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#5e5e5e;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="m 368.01511,434.63361 c -9.86715,-0.003 -19.73317,0.02 -29.59961,0.0587 40.58372,60.98623 81.13273,122.04569 121.7461,182.97743 16.59016,-0.003 33.17905,-0.0421 49.76562,-0.16726 -40.56648,-60.89249 -81.04682,-121.93216 -121.60937,-182.82191 -6.76751,-0.0159 -13.53548,-0.0448 -20.30274,-0.0469 z"
id="path4163"
inkscape:connector-curvature="0" />
</g>
</g>
<path
style="fill:none;fill-rule:evenodd;stroke:#b54d4d;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 12.288338,1050.5605 7.59194,-28.3336"
id="path6853"
inkscape:connector-curvature="0" />
<path
style="fill:#617da1;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 11.341431,1034.9779 -8.3653553,4.8296 3.535615,-13.195 z"
id="path6931"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path6937"
d="m 20.954687,1037.7169 4.982679,8.6302 3.647574,-13.6128 z"
style="fill:#617da1;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 716 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -0,0 +1,266 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="32"
height="32"
viewBox="0 0 31.999999 32.000001"
id="svg2"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="orientation_gamma.svg"
inkscape:export-filename="/home/svisor/Dokumente/orientation/orientation_gamma_32px.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90">
<defs
id="defs4">
<linearGradient
inkscape:collect="always"
id="linearGradient4173">
<stop
style="stop-color:#465b76;stop-opacity:1;"
offset="0"
id="stop4175" />
<stop
id="stop4193"
offset="0.11647766"
style="stop-color:#617da1;stop-opacity:1" />
<stop
style="stop-color:#090f1a;stop-opacity:0.62352943"
offset="0.48119751"
id="stop4201" />
<stop
style="stop-color:#617da1;stop-opacity:1"
offset="0.84591734"
id="stop4199" />
<stop
style="stop-color:#35465e;stop-opacity:0.81176472"
offset="1"
id="stop4177" />
</linearGradient>
<inkscape:path-effect
effect="skeletal"
id="path-effect6933"
is_visible="true"
pattern="m -9.5367432e-7,1025.3622 c 0,-2.76 2.23999995367432,-5 4.99999995367432,-5 2.76,0 5,2.24 5,5 0,2.76 -2.24,5 -5,5 -2.76,0 -4.99999995367432,-2.24 -4.99999995367432,-5 z"
copytype="single_stretched"
prop_scale="1"
scale_y_rel="false"
spacing="0"
normal_offset="0"
tang_offset="0"
prop_units="false"
vertical_pattern="false"
fuse_tolerance="0" />
<inkscape:path-effect
effect="skeletal"
id="path-effect6855"
is_visible="true"
pattern="M 0,5 C 0,2.24 2.24,0 5,0 7.76,0 10,2.24 10,5 10,7.76 7.76,10 5,10 2.24,10 0,7.76 0,5 Z"
copytype="single_stretched"
prop_scale="1"
scale_y_rel="false"
spacing="0"
normal_offset="0"
tang_offset="0"
prop_units="false"
vertical_pattern="false"
fuse_tolerance="0" />
<inkscape:path-effect
effect="skeletal"
id="path-effect6842"
is_visible="true"
pattern="M 0,5 C 0,2.24 2.24,0 5,0 7.76,0 10,2.24 10,5 10,7.76 7.76,10 5,10 2.24,10 0,7.76 0,5 Z"
copytype="single_stretched"
prop_scale="1"
scale_y_rel="false"
spacing="0"
normal_offset="0"
tang_offset="0"
prop_units="false"
vertical_pattern="false"
fuse_tolerance="0" />
<inkscape:path-effect
effect="skeletal"
id="path-effect4583"
is_visible="true"
pattern="M 0,5 C 0,2.24 2.24,0 5,0 7.76,0 10,2.24 10,5 10,7.76 7.76,10 5,10 2.24,10 0,7.76 0,5 Z"
copytype="single_stretched"
prop_scale="1"
scale_y_rel="false"
spacing="0"
normal_offset="0"
tang_offset="0"
prop_units="false"
vertical_pattern="false"
fuse_tolerance="0" />
<marker
inkscape:stockid="Arrow1Lend"
orient="auto"
refY="0"
refX="0"
id="Arrow1Lend"
style="overflow:visible"
inkscape:isstock="true">
<path
id="path4234"
d="M 0,0 5,-5 -12.5,0 5,5 0,0 Z"
style="fill:#617da1;fill-opacity:1;fill-rule:evenodd;stroke:#617da1;stroke-width:1pt;stroke-opacity:1"
transform="matrix(-0.8,0,0,-0.8,-10,0)"
inkscape:connector-curvature="0" />
</marker>
<marker
inkscape:stockid="Arrow1Lstart"
orient="auto"
refY="0"
refX="0"
id="Arrow1Lstart"
style="overflow:visible"
inkscape:isstock="true">
<path
id="path4231"
d="M 0,0 5,-5 -12.5,0 5,5 0,0 Z"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1"
transform="matrix(0.8,0,0,0.8,10,0)"
inkscape:connector-curvature="0" />
</marker>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient4173"
id="linearGradient4179"
x1="11.697108"
y1="1052.0363"
x2="20.611916"
y2="1020.3048"
gradientUnits="userSpaceOnUse" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="5.6568543"
inkscape:cx="6.0834191"
inkscape:cy="25.653468"
inkscape:document-units="px"
inkscape:current-layer="layer2"
showgrid="true"
inkscape:snap-bbox="true"
inkscape:bbox-paths="true"
inkscape:bbox-nodes="true"
inkscape:snap-bbox-edge-midpoints="true"
inkscape:snap-bbox-midpoints="true"
inkscape:window-width="1784"
inkscape:window-height="965"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:snap-global="false"
inkscape:object-paths="true"
inkscape:snap-intersection-paths="false"
inkscape:object-nodes="false"
inkscape:snap-smooth-nodes="false"
inkscape:snap-midpoints="false"
inkscape:snap-nodes="true"
units="px">
<inkscape:grid
type="xygrid"
id="grid6838" />
</sodipodi:namedview>
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="bg"
inkscape:groupmode="layer"
id="layer1"
style="opacity:0"
sodipodi:insensitive="true"
transform="translate(0,-1020.3622)">
<rect
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0.48900003;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#5d3b0b;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
id="rect4136"
width="537.14288"
height="537.14288"
x="108.57143"
y="232.3622"
ry="0" />
</g>
<g
inkscape:groupmode="layer"
id="layer2"
inkscape:label="vg"
transform="translate(0,-1020.3622)">
<path
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#linearGradient4179);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="m 21.937741,1021.5707 -1.0094,7.9885 -2.0649,7.7057 -2.0646,7.7057 -3.1201,7.4229 -3.7494,-1.0046 1.0095,-7.9885 2.0648,-7.7057 2.0647,-7.7057 3.12,-7.4229 z"
id="rect6929"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccccccc" />
<g
id="g6920"
transform="matrix(0.96592583,0.25881905,-0.25881905,0.96592583,268.87497,31.190367)">
<rect
ry="1.5392392"
y="1031.1785"
x="4.2458982"
height="11.14116"
width="23.508087"
id="rect4139"
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#2d2d2d;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
<path
inkscape:connector-curvature="0"
id="rect4181"
d="m 25.814829,1031.8872 c -6.667001,0.038 -13.336293,-0.046 -20.0018744,0.045 -0.6416148,0.1876 -0.7339823,0.8083 -0.6166024,1.2571 0.059129,2.4318 -0.1547636,4.8799 0.1170802,7.2991 0.37515,0.4502 1.1682938,0.3958 1.7731176,0.3555 6.36877,-0.021 12.74023,0.051 19.107241,-0.039 0.61102,-0.1841 0.735486,-0.7757 0.611786,-1.2113 -0.04476,-2.4297 0.112409,-4.8684 -0.08527,-7.2915 -0.166424,-0.2516 -0.532577,-0.4221 -0.905478,-0.4143 z"
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0.9;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#4c4c4c;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
<g
transform="matrix(0.05906553,0,0,0.04902518,-6.2759034,1010.5886)"
id="g4177">
<path
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#616161;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="m 293.62058,434.43653 c -16.41699,0.21869 -32.83277,0.54314 -49.24609,0.9982 40.22318,60.65317 80.41322,121.37951 120.66406,181.98201 16.66541,0.0638 33.3307,0.12377 49.99609,0.17961 -40.50006,-61.0078 -80.91528,-122.15931 -121.41406,-183.15982 z"
id="path4159"
inkscape:connector-curvature="0" />
<path
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#5e5e5e;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="m 368.01511,434.63361 c -9.86715,-0.003 -19.73317,0.02 -29.59961,0.0587 40.58372,60.98623 81.13273,122.04569 121.7461,182.97743 16.59016,-0.003 33.17905,-0.0421 49.76562,-0.16726 -40.56648,-60.89249 -81.04682,-121.93216 -121.60937,-182.82191 -6.76751,-0.0159 -13.53548,-0.0448 -20.30274,-0.0469 z"
id="path4163"
inkscape:connector-curvature="0" />
</g>
</g>
<path
style="fill:none;fill-rule:evenodd;stroke:#b54d4d;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 1.917508,1032.5977 28.3336,7.592"
id="path6853"
inkscape:connector-curvature="0" />
<path
style="fill:#617da1;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 17.336141,1031.7218 -4.8296,-8.3653 13.195,3.5356 z"
id="path6931"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path6937"
d="m 14.597141,1041.3351 -8.6302,4.9827 13.6128,3.6475 z"
style="fill:#617da1;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 780 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -0,0 +1,257 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="32"
height="32"
viewBox="0 0 31.999999 32.000001"
id="svg2"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="orientation_inactive.svg"
inkscape:export-filename="/home/matthias/Programme/GD_MyFork/orientation_icons/orientation_inactive32.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90">
<defs
id="defs4">
<inkscape:path-effect
effect="skeletal"
id="path-effect6855"
is_visible="true"
pattern="M 0,5 C 0,2.24 2.24,0 5,0 7.76,0 10,2.24 10,5 10,7.76 7.76,10 5,10 2.24,10 0,7.76 0,5 Z"
copytype="single_stretched"
prop_scale="1"
scale_y_rel="false"
spacing="0"
normal_offset="0"
tang_offset="0"
prop_units="false"
vertical_pattern="false"
fuse_tolerance="0" />
<inkscape:path-effect
effect="skeletal"
id="path-effect6842"
is_visible="true"
pattern="M 0,5 C 0,2.24 2.24,0 5,0 7.76,0 10,2.24 10,5 10,7.76 7.76,10 5,10 2.24,10 0,7.76 0,5 Z"
copytype="single_stretched"
prop_scale="1"
scale_y_rel="false"
spacing="0"
normal_offset="0"
tang_offset="0"
prop_units="false"
vertical_pattern="false"
fuse_tolerance="0" />
<inkscape:path-effect
effect="skeletal"
id="path-effect4583"
is_visible="true"
pattern="M 0,5 C 0,2.24 2.24,0 5,0 7.76,0 10,2.24 10,5 10,7.76 7.76,10 5,10 2.24,10 0,7.76 0,5 Z"
copytype="single_stretched"
prop_scale="1"
scale_y_rel="false"
spacing="0"
normal_offset="0"
tang_offset="0"
prop_units="false"
vertical_pattern="false"
fuse_tolerance="0" />
<marker
inkscape:stockid="Arrow1Lend"
orient="auto"
refY="0"
refX="0"
id="Arrow1Lend"
style="overflow:visible"
inkscape:isstock="true">
<path
id="path4234"
d="M 0,0 5,-5 -12.5,0 5,5 0,0 Z"
style="fill:#617da1;fill-opacity:1;fill-rule:evenodd;stroke:#617da1;stroke-width:1pt;stroke-opacity:1"
transform="matrix(-0.8,0,0,-0.8,-10,0)"
inkscape:connector-curvature="0" />
</marker>
<marker
inkscape:stockid="Arrow1Lstart"
orient="auto"
refY="0"
refX="0"
id="Arrow1Lstart"
style="overflow:visible"
inkscape:isstock="true">
<path
id="path4231"
d="M 0,0 5,-5 -12.5,0 5,5 0,0 Z"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1"
transform="matrix(0.8,0,0,0.8,10,0)"
inkscape:connector-curvature="0" />
</marker>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="7.919596"
inkscape:cx="-3.4987609"
inkscape:cy="15.215408"
inkscape:document-units="px"
inkscape:current-layer="layer2"
showgrid="false"
inkscape:snap-bbox="true"
inkscape:bbox-paths="true"
inkscape:bbox-nodes="true"
inkscape:snap-bbox-edge-midpoints="true"
inkscape:snap-bbox-midpoints="true"
inkscape:window-width="1920"
inkscape:window-height="1026"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:snap-global="false"
inkscape:object-paths="true"
inkscape:snap-intersection-paths="false"
inkscape:object-nodes="false"
inkscape:snap-smooth-nodes="false"
inkscape:snap-midpoints="false"
inkscape:snap-nodes="true"
units="px">
<inkscape:grid
type="xygrid"
id="grid6838" />
</sodipodi:namedview>
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="bg"
inkscape:groupmode="layer"
id="layer1"
style="opacity:0"
sodipodi:insensitive="true"
transform="translate(0,-1020.3622)">
<rect
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0.48900003;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#5d3b0b;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
id="rect4136"
width="537.14288"
height="537.14288"
x="108.57143"
y="232.3622"
ry="0" />
</g>
<g
inkscape:groupmode="layer"
id="layer2"
inkscape:label="vg"
transform="translate(0,-1020.3622)">
<g
id="g4182">
<path
style="opacity:1;fill:#617da1;fill-opacity:1;stroke:none;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 17.705339,1047.9202 3.8554509,1034.0703 a 9.8935231,9.8935231 0 0 0 0.865828,12.9857 9.8935231,9.8935231 0 0 0 12.9840601,0.8642 z"
id="path4260"
inkscape:connector-curvature="0" />
<path
style="opacity:1;fill:#55687f;fill-opacity:1;stroke:none;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 15.476114,1045.691 -9.3874081,-9.3874 a 6.7720372,6.7720372 0 0 0 0.839681,8.5453 6.7720372,6.7720372 0 0 0 8.5477271,0.8421 z"
id="path4262"
inkscape:connector-curvature="0" />
<path
style="opacity:1;fill:#45505d;fill-opacity:1;stroke:none;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 13.104478,1043.3194 -4.6473891,-4.6474 a 3.5447378,3.5447378 0 0 0 0.752875,3.8953 3.5447378,3.5447378 0 0 0 3.8945141,0.7521 z"
id="path4264"
inkscape:connector-curvature="0" />
</g>
<g
id="g4271">
<path
inkscape:connector-curvature="0"
id="path4193"
d="m 14.330666,1025.0237 13.849888,13.8499 a 9.8935231,9.8935231 0 0 0 -0.865828,-12.9857 9.8935231,9.8935231 0 0 0 -12.98406,-0.8642 z"
style="opacity:1;fill:#617da1;fill-opacity:1;stroke:none;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="circle4209"
d="m 16.559891,1027.2529 9.387408,9.3874 a 6.7720372,6.7720372 0 0 0 -0.839681,-8.5453 6.7720372,6.7720372 0 0 0 -8.547727,-0.8421 z"
style="opacity:1;fill:#55687f;fill-opacity:1;stroke:none;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="circle4211"
d="m 18.931527,1029.6245 4.647389,4.6474 a 3.5447378,3.5447378 0 0 0 -0.752875,-3.8953 3.5447378,3.5447378 0 0 0 -3.894514,-0.7521 z"
style="opacity:1;fill:#45505d;fill-opacity:1;stroke:none;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</g>
<g
id="g4185"
transform="matrix(0,1,-1,0,1052.3622,1020.3622)">
<g
transform="matrix(-0.70710678,-0.70710678,-0.70710678,0.70710678,761.06108,315.93318)"
id="g4164">
<rect
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#2d2d2d;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
id="rect4139"
width="29.490231"
height="13.97627"
x="1021.5129"
y="-24.405632"
ry="1.9309319"
transform="matrix(0,1,-1,0,0,0)" />
<path
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0.9;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#4c4c4c;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="m 23.516546,1048.5704 c -0.04767,-8.3635 0.05771,-16.73 -0.05645,-25.0917 -0.235339,-0.805 -1.013989,-0.9207 -1.576996,-0.7735 -3.050625,0.074 -6.121697,-0.1942 -9.156515,0.1468 -0.564763,0.4707 -0.49652,1.4656 -0.445964,2.2244 0.02634,7.9894 -0.06398,15.9823 0.04892,23.9695 0.230948,0.7665 0.973094,0.9226 1.519542,0.7675 3.04799,-0.056 6.10727,0.141 9.14698,-0.1067 0.315625,-0.2087 0.529513,-0.6681 0.519728,-1.1359 z"
id="rect4181"
inkscape:connector-curvature="0" />
<g
id="g4177"
transform="matrix(0,0.07409604,-0.0615007,0,50.235037,1008.3136)">
<path
inkscape:connector-curvature="0"
id="path4159"
d="m 293.62058,434.43653 c -16.41699,0.21869 -32.83277,0.54314 -49.24609,0.9982 40.22318,60.65317 80.41322,121.37951 120.66406,181.98201 16.66541,0.0638 33.3307,0.12377 49.99609,0.17961 -40.50006,-61.0078 -80.91528,-122.15931 -121.41406,-183.15982 z"
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#616161;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
<path
inkscape:connector-curvature="0"
id="path4163"
d="m 368.01511,434.63361 c -9.86715,-0.003 -19.73317,0.02 -29.59961,0.0587 40.58372,60.98623 81.13273,122.04569 121.7461,182.97743 16.59016,-0.003 33.17905,-0.0421 49.76562,-0.16726 -40.56648,-60.89249 -81.04682,-121.93216 -121.60937,-182.82191 -6.76751,-0.0159 -13.53548,-0.0448 -20.30274,-0.0469 z"
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#5e5e5e;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
</g>
</g>
</g>
<g
id="g4178"
transform="matrix(0.77902994,0,0,0.77902994,51.018309,218.11381)">
<rect
transform="matrix(0.70710678,-0.70710678,0.70710678,0.70710678,0,0)"
ry="0"
y="708.63794"
x="-794.39429"
height="6.3392859"
width="37.767857"
id="rect4176"
style="opacity:1;fill:#aa6056;fill-opacity:1;stroke:none;stroke-width:2.61800003;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.88922155" />
<path
id="path4170"
transform="translate(-9.5367432e-7,1020.3622)"
d="M -44.951172,9.7773438 A 20.203051,20.203051 0 0 0 -65.154297,29.980469 20.203051,20.203051 0 0 0 -44.951172,50.183594 20.203051,20.203051 0 0 0 -24.748047,29.980469 20.203051,20.203051 0 0 0 -44.951172,9.7773438 Z m 0,4.3750002 a 15.828051,15.828051 0 0 1 15.828125,15.828125 15.828051,15.828051 0 0 1 -15.828125,15.828125 15.828051,15.828051 0 0 1 -15.828125,-15.828125 15.828051,15.828051 0 0 1 15.828125,-15.828125 z"
style="opacity:1;fill:#aa6056;fill-opacity:1;stroke:none;stroke-width:2.61800003;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.88922155"
inkscape:connector-curvature="0" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 882 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1005 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1006 B

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
)

View File

@@ -13,17 +13,17 @@ AllowNoIcons=yes
LicenseFile=..\Output\Release_Windows\License-en.rtf
InfoBeforeFile=..\Output\Release_Windows\Informations-en.rtf
OutputDir=.\
OutputBaseFilename=gd4096
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-2017 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})

View File

@@ -72,6 +72,10 @@ 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)

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

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,74 +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); }
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 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 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 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_;
}
const gd::String & GetComment() const { return com1; }
void SetComment(const gd::String & comment) { com1 = comment; }
const gd::String& GetComment() const { return com1; }
void SetComment(const gd::String& comment) { com1 = comment; }
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);
int r; ///< Background color Red component
int v; ///< Background color Green component
int b; ///< Background color Blue component
int r; ///< Background color Red component
int v; ///< Background color Green component
int b; ///< Background color Blue component
int textR; ///< Text color Red component
int textG; ///< Text color Green component
int textB; ///< Text color Blue component
int textR; ///< Text color Red component
int textG; ///< Text color Green component
int textB; ///< Text color Blue component
gd::String com1; ///< Comment
gd::String com2; ///< Optional second column comment, deprecated
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 & );
/**
* 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;
/**
* 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_);
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,167 +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::SerializeInstructionsTo(conditions, element.AddChild("conditions"));
gd::EventsListSerialization::SerializeInstructionsTo(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::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"));
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() );
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 );
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,166 +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::SerializeInstructionsTo(conditions, element.AddChild("conditions"));
gd::EventsListSerialization::SerializeInstructionsTo(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::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"));
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() );
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 );
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::SerializeInstructionsTo(conditions, element.AddChild("conditions"));
gd::EventsListSerialization::SerializeInstructionsTo(actions, element.AddChild("actions"));
gd::EventsListSerialization::SerializeEventsTo(events, element.AddChild("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"));
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,177 +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::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::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::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"));
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() );
if ( !IsDisabled() )
dc.SetTextForeground( wxColour( 0, 0, 0 ) );
else
dc.SetTextForeground( wxColour( 160, 160, 160 ) );
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() );
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;
//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,80 +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::Reuse(const EventsCodeGenerationContext & parent_)
{
InheritsFrom(parent_);
if (parent_.CanReuse())
contextDepth = parent_.GetContextDepth(); // Keep same context depth
void EventsCodeGenerationContext::Reuse(
const EventsCodeGenerationContext& parent_) {
InheritsFrom(parent_);
if (parent_.CanReuse())
contextDepth = parent_.GetContextDepth(); // Keep same context depth
}
void EventsCodeGenerationContext::ObjectsListNeeded(const gd::String & objectName)
{
if ( emptyObjectsListsToBeDeclared.find(objectName) == emptyObjectsListsToBeDeclared.end() )
objectsListsToBeDeclared.insert(objectName);
void EventsCodeGenerationContext::ObjectsListNeeded(
const gd::String& objectName) {
if (emptyObjectsListsToBeDeclared.find(objectName) ==
emptyObjectsListsToBeDeclared.end())
objectsListsToBeDeclared.insert(objectName);
depthOfLastUse[objectName] = GetContextDepth();
depthOfLastUse[objectName] = GetContextDepth();
}
void EventsCodeGenerationContext::EmptyObjectsListNeeded(const gd::String & objectName)
{
if ( objectsListsToBeDeclared.find(objectName) == objectsListsToBeDeclared.end() )
emptyObjectsListsToBeDeclared.insert(objectName);
void EventsCodeGenerationContext::EmptyObjectsListNeeded(
const gd::String& objectName) {
if (objectsListsToBeDeclared.find(objectName) ==
objectsListsToBeDeclared.end())
emptyObjectsListsToBeDeclared.insert(objectName);
depthOfLastUse[objectName] = GetContextDepth();
depthOfLastUse[objectName] = GetContextDepth();
}
std::set<gd::String> EventsCodeGenerationContext::GetAllObjectsToBeDeclared() const
{
std::set <gd::String> allObjectListsToBeDeclared(objectsListsToBeDeclared.begin(), objectsListsToBeDeclared.end());
allObjectListsToBeDeclared.insert(emptyObjectsListsToBeDeclared.begin(), emptyObjectsListsToBeDeclared.end());
std::set<gd::String> EventsCodeGenerationContext::GetAllObjectsToBeDeclared()
const {
std::set<gd::String> allObjectListsToBeDeclared(
objectsListsToBeDeclared.begin(), objectsListsToBeDeclared.end());
allObjectListsToBeDeclared.insert(emptyObjectsListsToBeDeclared.begin(),
emptyObjectsListsToBeDeclared.end());
return allObjectListsToBeDeclared;
return allObjectListsToBeDeclared;
}
unsigned int EventsCodeGenerationContext::GetLastDepthObjectListWasNeeded(const gd::String & name) const
{
if ( depthOfLastUse.count(name) != 0 )
return depthOfLastUse.find(name)->second;
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;
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);
bool EventsCodeGenerationContext::IsSameObjectsList(
const gd::String& objectName,
const EventsCodeGenerationContext& otherContext) const {
return GetLastDepthObjectListWasNeeded(objectName) ==
otherContext.GetLastDepthObjectListWasNeeded(objectName);
}
}
} // namespace gd

View File

@@ -1,192 +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),
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),
reuseExplicitlyForbidden(false)
{};
virtual ~EventsCodeGenerationContext() {};
reuseExplicitlyForbidden(false){};
virtual ~EventsCodeGenerationContext(){};
/**
* 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);
/**
* 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 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);
/**
* \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);
/**
* \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; }
/**
* \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; }
/**
* \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; }
/**
* \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;
}
/**
* \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 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 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 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; }
/**
* Mark the object has being the object being handled by the instruction
*/
void SetCurrentObject(const gd::String & objectName) { currentObject = objectName; };
/**
* Mark the object has being the object being handled by the instruction
*/
void SetCurrentObject(const gd::String& objectName) {
currentObject = objectName;
};
/**
* Set that no particular object is being handled by an instruction
*/
void SetNoCurrentObject() { currentObject = ""; };
/**
* Set that no particular object is being handled by an instruction
*/
void SetNoCurrentObject() { currentObject = ""; };
/**
* Get the object being handled by the instruction
*/
const gd::String & GetCurrentObject() const { return currentObject; };
/**
* Get the object being handled by the instruction
*/
const gd::String& GetCurrentObject() const { return currentObject; };
/**
* \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 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);
/**
* 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);
/**
* 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 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 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());
};
/**
* \brief Consider that \a objectName is now declared in the context.
*/
void SetObjectDeclared(const gd::String & objectName) { alreadyDeclaredObjectsLists.insert(objectName); }
/**
* \brief Consider that \a objectName is now declared in the context.
*/
void SetObjectDeclared(const gd::String& objectName) {
alreadyDeclaredObjectsLists.insert(objectName);
}
/**
* 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;
/**
* 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;
/**
* Return the objects lists which will be declared by the current context
*/
const std::set<gd::String> & GetObjectsListsToBeDeclared() const { return objectsListsToBeDeclared; };
/**
* Return the objects lists which will be declared by the current context
*/
const std::set<gd::String>& GetObjectsListsToBeDeclared() const {
return objectsListsToBeDeclared;
};
/**
* 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 the objects lists which will be declared, but no filled, by the
* current context
*/
const std::set<gd::String>& GetObjectsListsToBeDeclaredEmpty() const {
return emptyObjectsListsToBeDeclared;
};
/**
* 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; };
/**
* 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 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 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 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 is generated.
*/
void EnterCustomCondition() { customConditionDepth++; };
/**
* \brief Called when a custom condition code generation is over.
*/
void LeaveCustomCondition() { 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; }
/**
* \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.
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.GetFirstError();
firstErrorPos = callbacks.GetFirstErrorPosition();
#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.GetFirstError();
firstErrorPos = callbacks.GetFirstErrorPosition();
#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

View File

@@ -1,24 +1,37 @@
/*
* 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 EXPRESSIONSCODEGENERATION_H
#define EXPRESSIONSCODEGENERATION_H
#include <vector>
#include "GDCore/String.h"
#include "GDCore/Events/Parsers/ExpressionParser.h"
namespace gd { class ExpressionMetadata; }
namespace gd { class Expression; }
namespace gd { class Project; }
namespace gd { class Layout; }
namespace gd { class Layout; }
namespace gd { class EventsCodeGenerationContext; }
namespace gd { class EventsCodeGenerator; }
#include "GDCore/String.h"
namespace gd {
class ExpressionMetadata;
}
namespace gd {
class Expression;
}
namespace gd {
class Project;
}
namespace gd {
class Layout;
}
namespace gd {
class Layout;
}
namespace gd {
class EventsCodeGenerationContext;
}
namespace gd {
class EventsCodeGenerator;
}
namespace gd
{
namespace gd {
/**
* \brief Used to generate code from expressions.
@@ -27,33 +40,48 @@ namespace gd
* \code
* gd::String expressionOutputCppCode;
*
* CallbacksForGeneratingExpressionCode callbacks(expressionOutputCppCode, codeGenerator, context);
* gd::ExpressionParser parser(theOriginalGameDevelopExpression);
* CallbacksForGeneratingExpressionCode callbacks(expressionOutputCppCode,
* codeGenerator, context); gd::ExpressionParser
* parser(theOriginalGameDevelopExpression);
* parser.ParseStringExpression(platform, project, scene, callbacks);
*
* if (expressionOutputCppCode.empty()) expressionOutputCppCode = "\"\""; //If generation failed, we make sure output code is not empty.
* \endcode
* \see EventsCodeGenerator
* if (expressionOutputCppCode.empty()) expressionOutputCppCode = "\"\""; //If
* generation failed, we make sure output code is not empty. \endcode \see
* EventsCodeGenerator
*/
class GD_CORE_API CallbacksForGeneratingExpressionCode : public gd::ParserCallbacks
{
public:
CallbacksForGeneratingExpressionCode(gd::String & output, EventsCodeGenerator & codeGenerator_, EventsCodeGenerationContext & context_);
virtual ~CallbacksForGeneratingExpressionCode() {};
class GD_CORE_API CallbacksForGeneratingExpressionCode
: public gd::ParserCallbacks {
public:
CallbacksForGeneratingExpressionCode(gd::String& output,
EventsCodeGenerator& codeGenerator_,
EventsCodeGenerationContext& context_);
virtual ~CallbacksForGeneratingExpressionCode(){};
void OnConstantToken(gd::String text);
void OnStaticFunction(gd::String functionName, const std::vector<gd::Expression> & parameters, const gd::ExpressionMetadata & expressionInfo);
void OnObjectFunction(gd::String functionName, const std::vector<gd::Expression> & parameters, const gd::ExpressionMetadata & expressionInfo);
void OnObjectBehaviorFunction(gd::String functionName, const std::vector<gd::Expression> & parameters, const gd::ExpressionMetadata & expressionInfo);
bool OnSubMathExpression(const gd::Platform & platform, const gd::Project & project, const gd::Layout & layout, gd::Expression & expression);
bool OnSubTextExpression(const gd::Platform & platform, const gd::Project & project, const gd::Layout & layout, gd::Expression & expression);
void OnConstantToken(gd::String text);
void OnStaticFunction(gd::String functionName,
const std::vector<gd::Expression>& parameters,
const gd::ExpressionMetadata& expressionInfo);
void OnObjectFunction(gd::String functionName,
const std::vector<gd::Expression>& parameters,
const gd::ExpressionMetadata& expressionInfo);
void OnObjectBehaviorFunction(gd::String functionName,
const std::vector<gd::Expression>& parameters,
const gd::ExpressionMetadata& expressionInfo);
bool OnSubMathExpression(const gd::Platform& platform,
const gd::Project& project,
const gd::Layout& layout,
gd::Expression& expression);
bool OnSubTextExpression(const gd::Platform& platform,
const gd::Project& project,
const gd::Layout& layout,
gd::Expression& expression);
private:
gd::String & plainExpression;
EventsCodeGenerator & codeGenerator;
EventsCodeGenerationContext & context;
private:
gd::String& plainExpression;
EventsCodeGenerator& codeGenerator;
EventsCodeGenerationContext& context;
};
}
} // namespace gd
#endif // EXPRESSIONSCODEGENERATION_H
#endif // EXPRESSIONSCODEGENERATION_H

View File

@@ -1,120 +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.
*/
#include "GDCore/Events/Event.h"
#include "GDCore/Events/CodeGeneration/EventsCodeGenerator.h"
#include "GDCore/Events/EventsList.h"
#include "GDCore/Extensions/Platform.h"
#include "GDCore/Extensions/PlatformExtension.h"
#include "GDCore/Events/CodeGeneration/EventsCodeGenerator.h"
namespace gd
{
namespace gd {
EventsList BaseEvent::badSubEvents;
std::vector< gd::String > BaseEvent::emptyDependencies;
std::vector<gd::String> BaseEvent::emptyDependencies;
gd::String BaseEvent::emptySourceFile;
BaseEvent::BaseEvent() :
eventHeightNeedUpdate(true),
totalTimeDuringLastSession(0),
percentDuringLastSession(0),
disabled(false),
folded(false)
{
}
BaseEvent::BaseEvent()
: eventHeightNeedUpdate(true),
totalTimeDuringLastSession(0),
percentDuringLastSession(0),
disabled(false),
folded(false) {}
bool BaseEvent::HasSubEvents() const
{
return !GetSubEvents().IsEmpty();
}
bool BaseEvent::HasSubEvents() const { return !GetSubEvents().IsEmpty(); }
gd::String BaseEvent::GenerateEventCode(gd::EventsCodeGenerator & codeGenerator, gd::EventsCodeGenerationContext & context)
{
if ( IsDisabled() ) return "";
gd::String BaseEvent::GenerateEventCode(
gd::EventsCodeGenerator& codeGenerator,
gd::EventsCodeGenerationContext& context) {
if (IsDisabled()) return "";
try
{
if ( type.empty() ) return "";
try {
if (type.empty()) return "";
const gd::Platform & platform = codeGenerator.GetPlatform();
const gd::Platform& platform = codeGenerator.GetPlatform();
//First try to guess the extension used
gd::String eventNamespace = type.substr(0, type.find("::"));
std::shared_ptr<gd::PlatformExtension> guessedExtension = platform.GetExtension(eventNamespace);
if ( guessedExtension )
{
std::map<gd::String, gd::EventMetadata > & allEvents = guessedExtension->GetAllEvents();
if ( allEvents.find(type) != allEvents.end() )
return allEvents[type].codeGeneration(*this, codeGenerator, context);
}
//Else make a search in all the extensions
for (std::size_t i = 0; i < platform.GetAllPlatformExtensions().size(); ++i)
{
std::shared_ptr<gd::PlatformExtension> extension = platform.GetAllPlatformExtensions()[i];
if ( !extension ) continue;
std::map<gd::String, gd::EventMetadata > & allEvents = extension->GetAllEvents();
if ( allEvents.find(type) != allEvents.end() )
return allEvents[type].codeGeneration(*this, codeGenerator, context);
}
}
catch(...)
{
std::cout << "ERROR: Exception caught during code generation for event \"" << type <<"\"." << std::endl;
// First try to guess the extension used
gd::String eventNamespace = type.substr(0, type.find("::"));
std::shared_ptr<gd::PlatformExtension> guessedExtension =
platform.GetExtension(eventNamespace);
if (guessedExtension) {
std::map<gd::String, gd::EventMetadata>& allEvents =
guessedExtension->GetAllEvents();
if (allEvents.find(type) != allEvents.end())
return allEvents[type].codeGeneration(*this, codeGenerator, context);
}
return "";
}
// Else make a search in all the extensions
for (std::size_t i = 0; i < platform.GetAllPlatformExtensions().size();
++i) {
std::shared_ptr<gd::PlatformExtension> extension =
platform.GetAllPlatformExtensions()[i];
if (!extension) continue;
void BaseEvent::Preprocess(gd::EventsCodeGenerator & codeGenerator, gd::EventsList & eventList, std::size_t indexOfTheEventInThisList)
{
if ( IsDisabled() || !MustBePreprocessed() ) return;
try
{
if ( type.empty() ) return;
const gd::Platform & platform = codeGenerator.GetPlatform();
//First try to guess the extension used
gd::String eventNamespace = type.substr(0, type.find("::"));
std::shared_ptr<gd::PlatformExtension> guessedExtension = platform.GetExtension(eventNamespace);
if ( guessedExtension )
{
std::map<gd::String, gd::EventMetadata > & allEvents = guessedExtension->GetAllEvents();
if ( allEvents.find(type) != allEvents.end() )
return allEvents[type].preprocessing(*this, codeGenerator, eventList, indexOfTheEventInThisList);
}
//Else make a search in all the extensions
for (std::size_t i = 0;i<platform.GetAllPlatformExtensions().size();++i)
{
std::shared_ptr<gd::PlatformExtension> extension = platform.GetAllPlatformExtensions()[i];
if ( !extension ) continue;
std::map<gd::String, gd::EventMetadata > & allEvents = extension->GetAllEvents();
if ( allEvents.find(type) != allEvents.end() )
return allEvents[type].preprocessing(*this, codeGenerator, eventList, indexOfTheEventInThisList);
}
std::map<gd::String, gd::EventMetadata>& allEvents =
extension->GetAllEvents();
if (allEvents.find(type) != allEvents.end())
return allEvents[type].codeGeneration(*this, codeGenerator, context);
}
catch(...)
{
std::cout << "ERROR: Exception caught during preprocessing of event \"" << type <<"\"." << std::endl;
} catch (...) {
std::cout << "ERROR: Exception caught during code generation for event \""
<< type << "\"." << std::endl;
}
return "";
}
void BaseEvent::Preprocess(gd::EventsCodeGenerator& codeGenerator,
gd::EventsList& eventList,
std::size_t indexOfTheEventInThisList) {
if (IsDisabled() || !MustBePreprocessed()) return;
try {
if (type.empty()) return;
const gd::Platform& platform = codeGenerator.GetPlatform();
// First try to guess the extension used
gd::String eventNamespace = type.substr(0, type.find("::"));
std::shared_ptr<gd::PlatformExtension> guessedExtension =
platform.GetExtension(eventNamespace);
if (guessedExtension) {
std::map<gd::String, gd::EventMetadata>& allEvents =
guessedExtension->GetAllEvents();
if (allEvents.find(type) != allEvents.end())
return allEvents[type].preprocessing(
*this, codeGenerator, eventList, indexOfTheEventInThisList);
}
// Else make a search in all the extensions
for (std::size_t i = 0; i < platform.GetAllPlatformExtensions().size();
++i) {
std::shared_ptr<gd::PlatformExtension> extension =
platform.GetAllPlatformExtensions()[i];
if (!extension) continue;
std::map<gd::String, gd::EventMetadata>& allEvents =
extension->GetAllEvents();
if (allEvents.find(type) != allEvents.end())
return allEvents[type].preprocessing(
*this, codeGenerator, eventList, indexOfTheEventInThisList);
}
} catch (...) {
std::cout << "ERROR: Exception caught during preprocessing of event \""
<< type << "\"." << std::endl;
}
}
BaseEventSPtr GD_CORE_API CloneRememberingOriginalEvent(BaseEventSPtr event)
{
gd::BaseEventSPtr copy(event->Clone());
//Original event is either the original event of the copied event, or the event copied.
copy->originalEvent = event->originalEvent.expired() ? event : event->originalEvent;
BaseEventSPtr GD_CORE_API CloneRememberingOriginalEvent(BaseEventSPtr event) {
gd::BaseEventSPtr copy(event->Clone());
// Original event is either the original event of the copied event, or the
// event copied.
copy->originalEvent =
event->originalEvent.expired() ? event : event->originalEvent;
return copy;
return copy;
}
}
} // namespace gd

View File

@@ -1,36 +1,55 @@
/*
* 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_EVENT_H
#define GDCORE_EVENT_H
#include <iostream>
#include <vector>
#include "GDCore/String.h"
#include <vector>
#include <memory>
#include <memory>
#include <vector>
#include "GDCore/Events/Instruction.h"
#include "GDCore/Events/InstructionsList.h"
namespace gd { class EventsList; }
namespace gd { class MainFrameWrapper; }
namespace gd { class Project; }
namespace gd { class Layout; }
namespace gd { class EventsCodeGenerator; }
namespace gd { class EventsCodeGenerationContext; }
namespace gd { class Platform; }
#include "GDCore/String.h"
namespace gd {
class EventsList;
}
namespace gd {
class MainFrameWrapper;
}
namespace gd {
class Project;
}
namespace gd {
class Layout;
}
namespace gd {
class EventsCodeGenerator;
}
namespace gd {
class EventsCodeGenerationContext;
}
namespace gd {
class Platform;
}
class wxWindow;
namespace gd { class EventsEditorItemsAreas; }
namespace gd { class EventsEditorSelection; }
namespace gd { class SerializerElement; }
namespace gd { class Instruction; }
namespace gd {
class EventsEditorItemsAreas;
}
namespace gd {
class EventsEditorSelection;
}
namespace gd {
class SerializerElement;
}
namespace gd {
class Instruction;
}
class wxDC;
namespace gd
{
namespace gd {
class BaseEvent;
typedef std::shared_ptr<BaseEvent> BaseEventSPtr;
@@ -38,256 +57,326 @@ typedef std::shared_ptr<BaseEvent> BaseEventSPtr;
/**
* \brief Base class defining an event.
*
* Events are usually not instance of Base Event, but instance of a derived class.
* Events are usually not instance of Base Event, but instance of a derived
* class.
*
* \ingroup Events
*/
class GD_CORE_API BaseEvent
{
public:
BaseEvent();
virtual ~BaseEvent() {};
class GD_CORE_API BaseEvent {
public:
BaseEvent();
virtual ~BaseEvent(){};
/**
* Must return a pointer to a copy of the event.
* A such method is needed as the IDE may want to store copies of some events and so need a way to do polymorphic copies.
*
* Typical implementation example:
* \code
* return new MyEventClass(*this);
* \endcode
*/
virtual gd::BaseEvent * Clone() const { return new BaseEvent(*this);}
/**
* Must return a pointer to a copy of the event.
* A such method is needed as the IDE may want to store copies of some events
* and so need a way to do polymorphic copies.
*
* Typical implementation example:
* \code
* return new MyEventClass(*this);
* \endcode
*/
virtual gd::BaseEvent* Clone() const { return new BaseEvent(*this); }
/** \name Event properties
* Members functions to be overridden by derived classes to expose the event properties
*/
///@{
/** \name Event properties
* Members functions to be overridden by derived classes to expose the event
* properties
*/
///@{
/**
* Derived class have to redefine this function, so as to return true, if they are executable.
*/
virtual bool IsExecutable() const {return false;};
/**
* Derived class have to redefine this function, so as to return true, if they
* are executable.
*/
virtual bool IsExecutable() const { return false; };
/**
* Derived class have to redefine this function, so as to return true, if they have sub events.
*/
virtual bool CanHaveSubEvents() const {return false;}
/**
* Derived class have to redefine this function, so as to return true, if they
* have sub events.
*/
virtual bool CanHaveSubEvents() const { return false; }
/**
* Return the sub events, if applicable.
*/
virtual const gd::EventsList & GetSubEvents() const {return badSubEvents;};
/**
* Return the sub events, if applicable.
*/
virtual const gd::EventsList& GetSubEvents() const { return badSubEvents; };
/**
* Return the sub events, if applicable.
*/
virtual gd::EventsList & GetSubEvents() {return badSubEvents;};
/**
* Return the sub events, if applicable.
*/
virtual gd::EventsList& GetSubEvents() { return badSubEvents; };
/**
* \brief Return true if the events has sub events.
* \warning This is only applicable when CanHaveSubEvents() return true.
*/
bool HasSubEvents() const;
/**
* \brief Return true if the events has sub events.
* \warning This is only applicable when CanHaveSubEvents() return true.
*/
bool HasSubEvents() const;
/**
* Event must be able to return all conditions std::vector they have.
* Used to preprocess the conditions.
*/
virtual std::vector < gd::InstructionsList* > GetAllConditionsVectors() { std::vector < gd::InstructionsList* > noConditions; return noConditions; };
virtual std::vector < const gd::InstructionsList* > GetAllConditionsVectors() const { std::vector < const gd::InstructionsList* > noConditions; return noConditions; };
/**
* Event must be able to return all conditions std::vector they have.
* Used to preprocess the conditions.
*/
virtual std::vector<gd::InstructionsList*> GetAllConditionsVectors() {
std::vector<gd::InstructionsList*> noConditions;
return noConditions;
};
virtual std::vector<const gd::InstructionsList*> GetAllConditionsVectors()
const {
std::vector<const gd::InstructionsList*> noConditions;
return noConditions;
};
/**
* Event must be able to return all actions std::vector they have.
* Used to preprocess the actions.
*/
virtual std::vector < gd::InstructionsList* > GetAllActionsVectors() { std::vector < gd::InstructionsList* > noActions; return noActions; };
virtual std::vector < const gd::InstructionsList* > GetAllActionsVectors() const { std::vector < const gd::InstructionsList* > noActions; return noActions; };
/**
* Event must be able to return all actions std::vector they have.
* Used to preprocess the actions.
*/
virtual std::vector<gd::InstructionsList*> GetAllActionsVectors() {
std::vector<gd::InstructionsList*> noActions;
return noActions;
};
virtual std::vector<const gd::InstructionsList*> GetAllActionsVectors()
const {
std::vector<const gd::InstructionsList*> noActions;
return noActions;
};
/**
* Event must be able to return all expressions they have.
* Used to preprocess the expressions.
*/
virtual std::vector < gd::Expression* > GetAllExpressions() { std::vector < gd::Expression* > noExpr; return noExpr;};
virtual std::vector < const gd::Expression* > GetAllExpressions() const { std::vector < const gd::Expression* > noExpr; return noExpr;};
/**
* Event must be able to return all expressions they have.
* Used to preprocess the expressions.
*/
virtual std::vector<gd::Expression*> GetAllExpressions() {
std::vector<gd::Expression*> noExpr;
return noExpr;
};
virtual std::vector<const gd::Expression*> GetAllExpressions() const {
std::vector<const gd::Expression*> noExpr;
return noExpr;
};
/**
* \brief Returns the dependencies on source files of the project.
* \note Default implementation returns an empty list of dependencies. This is fine for most events that
* are not related to adding custom user source code.
*/
virtual const std::vector<gd::String> & GetSourceFileDependencies() const { return emptyDependencies; };
/**
* \brief Returns the dependencies on source files of the project.
* \note Default implementation returns an empty list of dependencies. This is
* fine for most events that are not related to adding custom user source
* code.
*/
virtual const std::vector<gd::String>& GetSourceFileDependencies() const {
return emptyDependencies;
};
/**
* \brief Returns the name of the source file associated with the event
* \note Default implementation returns an empty string. This is fine for most events that
* are not related to adding custom user source code.
*/
virtual const gd::String & GetAssociatedGDManagedSourceFile(gd::Project & project) const { return emptySourceFile; };
///@}
/**
* \brief Returns the name of the source file associated with the event
* \note Default implementation returns an empty string. This is fine for most
* events that are not related to adding custom user source code.
*/
virtual const gd::String& GetAssociatedGDManagedSourceFile(
gd::Project& project) const {
return emptySourceFile;
};
///@}
/** \name Code generation
* Members functions used to generate code from the event
*/
///@{
/** \name Code generation
* Members functions used to generate code from the event
*/
///@{
/**
* \brief Generate the code event: the platform provided by \a codeGenerator is asked for the EventMetadata associated to the event,
* which is then used to generate the code event.
*
* \warning Even if this method is virtual, you should never redefine it: always provide the code generation using gd::EventMetadata.
* This method is virtual as some platforms could have hidden events ( such as profiling events ) needing code generation without declaring
* the event as a part of an extension.
*
* \see gd::EventMetadata
*/
virtual gd::String GenerateEventCode(gd::EventsCodeGenerator & codeGenerator, gd::EventsCodeGenerationContext & context);
/**
* \brief Generate the code event: the platform provided by \a codeGenerator
* is asked for the EventMetadata associated to the event, which is then used
* to generate the code event.
*
* \warning Even if this method is virtual, you should never redefine it:
* always provide the code generation using gd::EventMetadata. This method is
* virtual as some platforms could have hidden events ( such as profiling
* events ) needing code generation without declaring the event as a part of
* an extension.
*
* \see gd::EventMetadata
*/
virtual gd::String GenerateEventCode(
gd::EventsCodeGenerator& codeGenerator,
gd::EventsCodeGenerationContext& context);
/**
* Called before events are compiled: the platform provided by \a codeGenerator is asked for the EventMetadata associated to the event,
* which is then used to preprocess the event.
*
* This is only done if the event MustBePreprocessed() return true.
*
* \warning Be careful if you're iterating over a list of event, a call to Preprocess can remove the event from the list!
*
* \see gd::EventMetadata
* \see gd::BaseEvent::MustBePreprocessed
*/
virtual void Preprocess(gd::EventsCodeGenerator & codeGenerator, gd::EventsList & eventList, std::size_t indexOfTheEventInThisList);
/**
* Called before events are compiled: the platform provided by \a
* codeGenerator is asked for the EventMetadata associated to the event, which
* is then used to preprocess the event.
*
* This is only done if the event MustBePreprocessed() return true.
*
* \warning Be careful if you're iterating over a list of event, a call to
* Preprocess can remove the event from the list!
*
* \see gd::EventMetadata
* \see gd::BaseEvent::MustBePreprocessed
*/
virtual void Preprocess(gd::EventsCodeGenerator& codeGenerator,
gd::EventsList& eventList,
std::size_t indexOfTheEventInThisList);
/**
* \brief If MustBePreprocessed is redefined to return true, the gd::EventMetadata::preprocessing associated to the event will be called
* to preprocess the event.
*
* \see gd::BaseEvent::Preprocess
* \see gd::EventMetadata
*/
virtual bool MustBePreprocessed() { return false;}
///@}
/**
* \brief If MustBePreprocessed is redefined to return true, the
* gd::EventMetadata::preprocessing associated to the event will be called to
* preprocess the event.
*
* \see gd::BaseEvent::Preprocess
* \see gd::EventMetadata
*/
virtual bool MustBePreprocessed() { return false; }
///@}
/** \name Serialization
*/
///@{
/**
* \brief Serialize event.
*/
virtual void SerializeTo(SerializerElement & element) const {};
/** \name Serialization
*/
///@{
/**
* \brief Serialize event.
*/
virtual void SerializeTo(SerializerElement& element) const {};
/**
* \brief Unserialize the event.
*/
virtual void UnserializeFrom(gd::Project & project, const SerializerElement & element) {};
///@}
/**
* \brief Unserialize the event.
*/
virtual void UnserializeFrom(gd::Project& project,
const SerializerElement& element){};
///@}
/** \name Common properties
* Common method shared by all events. ( No need for them to be overridden by derived classes ).
*/
///@{
/** \name Common properties
* Common method shared by all events. ( No need for them to be overridden by
* derived classes ).
*/
///@{
/**
* \brief Return the event type
*/
const gd::String & GetType() const { return type; };
/**
* \brief Return the event type
*/
const gd::String& GetType() const { return type; };
/**
* \brief Change the event type
*/
void SetType(gd::String type_) { type = type_; };
/**
* \brief Change the event type
*/
void SetType(gd::String type_) { type = type_; };
/**
* \brief Set if the event if disabled or not
*/
void SetDisabled(bool disable = true) { disabled = disable; }
/**
* \brief Set if the event if disabled or not
*/
void SetDisabled(bool disable = true) { disabled = disable; }
/**
* \brief True if event is disabled
*/
bool IsDisabled() const { return disabled; }
/**
* \brief True if event is disabled
*/
bool IsDisabled() const { return disabled; }
/**
* \brief Set if the event must be folded (i.e: sub events must
* be hidden in the events editor).
*/
void SetFolded(bool fold = true) { folded = fold; }
/**
* \brief Set if the event must be folded (i.e: sub events must
* be hidden in the events editor).
*/
void SetFolded(bool fold = true) { folded = fold; }
/**
* \brief True if the event should be folded in the events editor.
*/
bool IsFolded() const { return folded; }
/**
* \brief True if the event should be folded in the events editor.
*/
bool IsFolded() const { return folded; }
///@}
///@}
/** \name Event rendering
* Method and members used to render the event
*/
///@{
/** \name Event rendering
* Method and members used to render the event
*/
///@{
/**
* Redefine this method to draw the event.
*
* \param dc The wxWidgets drawing context to be used.
* \param x The x position where the events must be drawn.
* \param y The y position where the events must be drawn.
* \param width The width available for drawing.
* \param areas Use this object to indicate the areas where items have been drawn
* \param selection Give access to the current selection(s), to draw for example hovering or selecting effects.
*
* \note The height of the drawing must be the same as the height returned by BaseEvent::GetRenderedHeight
*
* \see gd::EventsRenderingHelper
* \see EventsEditorSelection
* \see EventsEditorItemsAreas
*/
virtual void Render(wxDC & dc, int x, int y, unsigned int width, gd::EventsEditorItemsAreas & areas, gd::EventsEditorSelection & selection, const gd::Platform & platform) {return;}
/**
* Redefine this method to draw the event.
*
* \param dc The wxWidgets drawing context to be used.
* \param x The x position where the events must be drawn.
* \param y The y position where the events must be drawn.
* \param width The width available for drawing.
* \param areas Use this object to indicate the areas where items have been
* drawn \param selection Give access to the current selection(s), to draw for
* example hovering or selecting effects.
*
* \note The height of the drawing must be the same as the height returned by
* BaseEvent::GetRenderedHeight
*
* \see gd::EventsRenderingHelper
* \see EventsEditorSelection
* \see EventsEditorItemsAreas
*/
virtual void Render(wxDC& dc,
int x,
int y,
unsigned int width,
gd::EventsEditorItemsAreas& areas,
gd::EventsEditorSelection& selection,
const gd::Platform& platform) {
return;
}
/**
* Must return the height of the event when rendered.
*
* \note The height of the drawing must be the same as the height of the drawing made by BaseEvent::Render
*/
virtual unsigned int GetRenderedHeight(unsigned int width, const gd::Platform & platform) const {return 0;};
/**
* Must return the height of the event when rendered.
*
* \note The height of the drawing must be the same as the height of the
* drawing made by BaseEvent::Render
*/
virtual unsigned int GetRenderedHeight(unsigned int width,
const gd::Platform& platform) const {
return 0;
};
/**
* Used by EditEvent to describe what sort of changes have been made to the event.
* \see BaseEvent::EditEvent
*/
enum EditEventReturnType
{
ChangesMade,
Cancelled,
ChangesMadeButNoNeedForEventsRecompilation
};
/**
* Used by EditEvent to describe what sort of changes have been made to the
* event. \see BaseEvent::EditEvent
*/
enum EditEventReturnType {
ChangesMade,
Cancelled,
ChangesMadeButNoNeedForEventsRecompilation
};
/**
* Called when the user want to edit the event.
*/
virtual EditEventReturnType EditEvent(wxWindow* parent_, gd::Project & game_, gd::Layout & scene_, gd::MainFrameWrapper & mainFrameWrapper_) { return ChangesMade; };
/**
* Called when the user want to edit the event.
*/
virtual EditEventReturnType EditEvent(
wxWindow* parent_,
gd::Project& game_,
gd::Layout& scene_,
gd::MainFrameWrapper& mainFrameWrapper_) {
return ChangesMade;
};
///@}
///@}
mutable bool eventHeightNeedUpdate; ///<Automatically set to true/false by the events editor
mutable bool eventHeightNeedUpdate; ///< Automatically set to true/false by
///< the events editor
std::weak_ptr<gd::BaseEvent> originalEvent; ///< Pointer only used for profiling events, so as to remember the original event from which it has been copied.
signed long long totalTimeDuringLastSession; ///< Total time, in microseconds, used by the event during the last run. Used for profiling.
float percentDuringLastSession; ///< Total time used by the event during the last run. Used for profiling.
std::weak_ptr<gd::BaseEvent>
originalEvent; ///< Pointer only used for profiling events, so as to
///< remember the original event from which it has been
///< copied.
signed long long
totalTimeDuringLastSession; ///< Total time, in microseconds, used by the
///< event during the last run. Used for
///< profiling.
float percentDuringLastSession; ///< Total time used by the event during the
///< last run. Used for profiling.
protected:
mutable unsigned int renderedHeight;
protected:
mutable unsigned int renderedHeight;
private:
bool folded; ///< True if the subevents should be hidden in the events editor
bool disabled; ///<True if the event is disabled and must not be executed
gd::String type; ///<Type of the event. Must be assigned at the creation. Used for saving the event for instance.
private:
bool folded; ///< True if the subevents should be hidden in the events editor
bool disabled; ///< True if the event is disabled and must not be executed
gd::String type; ///< Type of the event. Must be assigned at the creation.
///< Used for saving the event for instance.
static gd::EventsList badSubEvents;
static std::vector< gd::String > emptyDependencies;
static gd::String emptySourceFile;
static gd::EventsList badSubEvents;
static std::vector<gd::String> emptyDependencies;
static gd::String emptySourceFile;
};
/**
* Clone an event and insert a reference to the original event into the newly created event.
* Used for profiling events for example.
* Clone an event and insert a reference to the original event into the newly
* created event. Used for profiling events for example.
*
* \see BaseEvent
* \ingroup Events
@@ -298,14 +387,13 @@ BaseEventSPtr GD_CORE_API CloneRememberingOriginalEvent(BaseEventSPtr event);
* \brief Empty event doing nothing.
* \see gd::BaseEvent
*/
class EmptyEvent : public BaseEvent
{
public:
EmptyEvent() : BaseEvent() {};
virtual ~EmptyEvent() {};
class EmptyEvent : public BaseEvent {
public:
EmptyEvent() : BaseEvent(){};
virtual ~EmptyEvent(){};
};
}
} // namespace gd
#endif // GDCORE_EVENT_H
#endif // GDCORE_EVENT_H
#endif

View File

@@ -1,127 +1,116 @@
/*
* 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 "EventsList.h"
#include "GDCore/Events/Event.h"
#include "GDCore/Tools/Log.h"
#include "GDCore/Project/Project.h"
#include "GDCore/Tools/Log.h"
#include "Serialization.h"
namespace gd
{
namespace gd {
EventsList::EventsList()
{
}
EventsList::EventsList() {}
void EventsList::InsertEvents(const EventsList& otherEvents,
size_t begin,
size_t end,
size_t position) {
if (begin >= otherEvents.size()) return;
if (end < begin) return;
if (end >= otherEvents.size()) end = otherEvents.size() - 1;
void EventsList::InsertEvents(const EventsList & otherEvents, size_t begin, size_t end, size_t position)
{
if (begin >= otherEvents.size()) return;
if (end < begin) return;
if (end >= otherEvents.size()) end = otherEvents.size()-1;
for (std::size_t insertPos = 0;insertPos <= (end-begin);insertPos++)
{
if (position != (size_t)-1 && position+insertPos < events.size())
events.insert(events.begin()+position+insertPos, CloneRememberingOriginalEvent(otherEvents.events[begin+insertPos]));
else
events.push_back(CloneRememberingOriginalEvent(otherEvents.events[begin+insertPos]));
}
}
gd::BaseEvent & EventsList::InsertEvent(const gd::BaseEvent & evt, size_t position)
{
std::shared_ptr<gd::BaseEvent> event(evt.Clone());
if (position<events.size())
events.insert(events.begin()+position, event);
for (std::size_t insertPos = 0; insertPos <= (end - begin); insertPos++) {
if (position != (size_t)-1 && position + insertPos < events.size())
events.insert(
events.begin() + position + insertPos,
CloneRememberingOriginalEvent(otherEvents.events[begin + insertPos]));
else
events.push_back(event);
return *event;
events.push_back(
CloneRememberingOriginalEvent(otherEvents.events[begin + insertPos]));
}
}
void EventsList::InsertEvent(std::shared_ptr<gd::BaseEvent> event, size_t position)
{
if (position<events.size())
events.insert(events.begin()+position, event);
else
events.push_back(event);
gd::BaseEvent& EventsList::InsertEvent(const gd::BaseEvent& evt,
size_t position) {
std::shared_ptr<gd::BaseEvent> event(evt.Clone());
if (position < events.size())
events.insert(events.begin() + position, event);
else
events.push_back(event);
return *event;
}
gd::BaseEvent & EventsList::InsertNewEvent(gd::Project & project, const gd::String & eventType, size_t position)
{
gd::BaseEventSPtr event = project.CreateEvent(eventType);
if ( event == std::shared_ptr<gd::BaseEvent>())
{
std::cout << "Unknown event of type " << eventType;
event = std::make_shared<EmptyEvent>();
void EventsList::InsertEvent(std::shared_ptr<gd::BaseEvent> event,
size_t position) {
if (position < events.size())
events.insert(events.begin() + position, event);
else
events.push_back(event);
}
gd::BaseEvent& EventsList::InsertNewEvent(gd::Project& project,
const gd::String& eventType,
size_t position) {
gd::BaseEventSPtr event = project.CreateEvent(eventType);
if (event == std::shared_ptr<gd::BaseEvent>()) {
std::cout << "Unknown event of type " << eventType;
event = std::make_shared<EmptyEvent>();
}
InsertEvent(event, position);
return *event;
}
void EventsList::RemoveEvent(size_t index) {
events.erase(events.begin() + index);
}
void EventsList::RemoveEvent(const gd::BaseEvent& event) {
for (size_t i = 0; i < events.size(); ++i) {
if (events[i].get() == &event) {
events.erase(events.begin() + i);
return;
}
InsertEvent(event, position);
return *event;
}
}
void EventsList::RemoveEvent(size_t index)
{
events.erase(events.begin()+index);
void EventsList::SerializeTo(SerializerElement& element) const {
EventsListSerialization::SerializeEventsTo(*this, element);
}
void EventsList::RemoveEvent(const gd::BaseEvent & event)
{
for (size_t i = 0; i < events.size(); ++i)
{
if (events[i].get() == &event)
{
events.erase(events.begin()+i);
return;
}
}
void EventsList::UnserializeFrom(gd::Project& project,
const SerializerElement& element) {
EventsListSerialization::UnserializeEventsFrom(project, *this, element);
}
void EventsList::SerializeTo(SerializerElement & element) const
{
EventsListSerialization::SerializeEventsTo(*this, element);
bool EventsList::Contains(const gd::BaseEvent& eventToSearch,
bool recursive) const {
for (std::size_t i = 0; i < GetEventsCount(); ++i) {
if (&GetEvent(i) == &eventToSearch) return true;
if (recursive && GetEvent(i).CanHaveSubEvents() &&
GetEvent(i).GetSubEvents().Contains(eventToSearch))
return true;
}
return false;
}
void EventsList::UnserializeFrom(gd::Project & project, const SerializerElement & element)
{
EventsListSerialization::UnserializeEventsFrom(project, *this, element);
EventsList::EventsList(const EventsList& other) { Init(other); }
EventsList& EventsList::operator=(const EventsList& other) {
if (this != &other) Init(other);
return *this;
}
bool EventsList::Contains(const gd::BaseEvent & eventToSearch, bool recursive) const
{
for (std::size_t i = 0;i<GetEventsCount();++i)
{
if ( &GetEvent(i) == &eventToSearch) return true;
if ( recursive && GetEvent(i).CanHaveSubEvents() && GetEvent(i).GetSubEvents().Contains(eventToSearch) )
return true;
}
return false;
void EventsList::Init(const gd::EventsList& other) {
events.clear();
for (size_t i = 0; i < other.events.size(); ++i)
events.push_back(CloneRememberingOriginalEvent(other.events[i]));
}
EventsList::EventsList(const EventsList & other)
{
Init(other);
}
EventsList & EventsList::operator=(const EventsList & other)
{
if ( this != &other )
Init(other);
return *this;
}
void EventsList::Init(const gd::EventsList & other)
{
events.clear();
for(size_t i = 0;i<other.events.size();++i)
events.push_back(CloneRememberingOriginalEvent(other.events[i]));
}
}
} // namespace gd

View File

@@ -1,23 +1,28 @@
/*
* 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_EVENTSLIST_H
#define GDCORE_EVENTSLIST_H
#include <vector>
#include <memory>
#include <vector>
#include "GDCore/String.h"
namespace gd { class Project; }
namespace gd { class BaseEvent; }
namespace gd { class SerializerElement; }
namespace gd {
class Project;
}
namespace gd {
class BaseEvent;
}
namespace gd {
class SerializerElement;
}
class TiXmlElement;
#undef CreateEvent
namespace gd
{
namespace gd {
/**
* \brief A list of events.
@@ -25,154 +30,174 @@ namespace gd
* \see BaseEvent
* \ingroup Events
*/
class GD_CORE_API EventsList
{
public:
EventsList();
EventsList(const EventsList&);
virtual ~EventsList() {};
EventsList& operator=(const EventsList & rhs);
class GD_CORE_API EventsList {
public:
EventsList();
EventsList(const EventsList&);
virtual ~EventsList(){};
EventsList& operator=(const EventsList& rhs);
/**
* \brief Insert the specified event to the list
* \note The event passed by parameter is copied.
* \param event The event that must be copied and inserted into the list
* \param position Insertion position. If the position is invalid, the object is inserted at the end of the objects list.
* \return A reference to the event in the list
*/
gd::BaseEvent & InsertEvent(const gd::BaseEvent & event, size_t position = (size_t)-1);
/**
* \brief Insert the specified event to the list
* \note The event passed by parameter is copied.
* \param event The event that must be copied and inserted into the list
* \param position Insertion position. If the position is invalid, the object
* is inserted at the end of the objects list. \return A reference to the
* event in the list
*/
gd::BaseEvent& InsertEvent(const gd::BaseEvent& event,
size_t position = (size_t)-1);
/**
* \brief Insert the specified event to the list.
* \note The event passed by parameter is not copied.
* \param event The smart pointer to the event that must be inserted into the list
* \param position Insertion position. If the position is invalid, the object is inserted at the end of the objects list.
*/
void InsertEvent(std::shared_ptr<gd::BaseEvent> event, size_t position = (size_t)-1);
/**
* \brief Insert the specified event to the list.
* \note The event passed by parameter is not copied.
* \param event The smart pointer to the event that must be inserted into the
* list \param position Insertion position. If the position is invalid, the
* object is inserted at the end of the objects list.
*/
void InsertEvent(std::shared_ptr<gd::BaseEvent> event,
size_t position = (size_t)-1);
/**
* \brief Insert a new event to the list.
* \note The event is created using the project current platform.
* \param project The project the events list belongs to.
* \param eventType The type of the event
* \param position Insertion position. If the position is invalid, the object is inserted at the end of the objects list.
*/
gd::BaseEvent & InsertNewEvent(gd::Project & project, const gd::String & eventType, size_t position = (size_t)-1);
/**
* \brief Insert a new event to the list.
* \note The event is created using the project current platform.
* \param project The project the events list belongs to.
* \param eventType The type of the event
* \param position Insertion position. If the position is invalid, the object
* is inserted at the end of the objects list.
*/
gd::BaseEvent& InsertNewEvent(gd::Project& project,
const gd::String& eventType,
size_t position = (size_t)-1);
/**
* \brief Copy events from another list
*/
void InsertEvents(const EventsList & otherEvents, size_t begin, size_t end, size_t position = (size_t)-1);
/**
* \brief Copy events from another list
*/
void InsertEvents(const EventsList& otherEvents,
size_t begin,
size_t end,
size_t position = (size_t)-1);
/**
* \brief Return the number of events.
*/
size_t GetEventsCount() const { return events.size(); };
/**
* \brief Return the number of events.
*/
size_t GetEventsCount() const { return events.size(); };
/**
* \brief Return the smart pointer to the event at position \a index in the events list.
*/
std::shared_ptr<BaseEvent> GetEventSmartPtr(size_t index) { return events[index]; };
/**
* \brief Return the smart pointer to the event at position \a index in the
* events list.
*/
std::shared_ptr<BaseEvent> GetEventSmartPtr(size_t index) {
return events[index];
};
/**
* \brief Return the smart pointer to the event at position \a index in the events list.
*/
std::shared_ptr<const BaseEvent> GetEventSmartPtr(size_t index) const { return events[index]; };
/**
* \brief Return the smart pointer to the event at position \a index in the
* events list.
*/
std::shared_ptr<const BaseEvent> GetEventSmartPtr(size_t index) const {
return events[index];
};
/**
* \brief Return a reference to the event at position \a index in the events list.
*/
gd::BaseEvent & GetEvent(size_t index) { return *events[index]; };
/**
* \brief Return a reference to the event at position \a index in the events
* list.
*/
gd::BaseEvent& GetEvent(size_t index) { return *events[index]; };
/**
* \brief Return a reference to the event at position \a index in the events list.
*/
const gd::BaseEvent & GetEvent(size_t index) const { return *events[index]; };
/**
* \brief Return a reference to the event at position \a index in the events
* list.
*/
const gd::BaseEvent& GetEvent(size_t index) const { return *events[index]; };
/**
* \brief Remove the specified event.
*/
void RemoveEvent(const gd::BaseEvent & event);
/**
* \brief Remove the specified event.
*/
void RemoveEvent(const gd::BaseEvent& event);
/**
* \brief Remove the event at the specified index in the list.
*/
void RemoveEvent(size_t index);
/**
* \brief Remove the event at the specified index in the list.
*/
void RemoveEvent(size_t index);
/**
* \brief Return true if there isn't any event in the list
*/
bool IsEmpty() const { return events.empty(); };
/**
* \brief Return true if there isn't any event in the list
*/
bool IsEmpty() const { return events.empty(); };
/**
* \brief Clear the list of events.
*/
void Clear() { return events.clear(); };
/**
* \brief Clear the list of events.
*/
void Clear() { return events.clear(); };
/** \name Utilities
* Utility methods
*/
///@{
/**
* Return true if the specified event exists in the list.
* \param event The event to searched for
* \param recursive Set it to false to prevent sub events to be inspected.
*/
bool Contains(const gd::BaseEvent & eventToSearch, bool recursive = true) const;
///@}
/** \name Utilities
* Utility methods
*/
///@{
/**
* Return true if the specified event exists in the list.
* \param event The event to searched for
* \param recursive Set it to false to prevent sub events to be inspected.
*/
bool Contains(const gd::BaseEvent& eventToSearch,
bool recursive = true) const;
///@}
/** \name std::vector API compatibility
* These functions ensure that the class can be used just like a std::vector.
*/
///@{
/** \name std::vector API compatibility
* These functions ensure that the class can be used just like a std::vector.
*/
///@{
/**
* \brief Alias for GetEventsCount()
* \see EventsList::GetEventsCount.
*/
size_t size() const { return GetEventsCount(); }
/**
* \brief Alias for GetEventsCount()
* \see EventsList::GetEventsCount.
*/
size_t size() const { return GetEventsCount(); }
/**
* \brief Alias for GetEvent()
* \see EventsList::GetEvent.
*/
gd::BaseEvent & operator[](size_t index) { return GetEvent(index); };
/**
* \brief Alias for GetEvent()
* \see EventsList::GetEvent.
*/
gd::BaseEvent& operator[](size_t index) { return GetEvent(index); };
/**
* \brief Alias for GetEvent()
* \see EventsList::GetEvent.
*/
const gd::BaseEvent & operator[](size_t index) const { return GetEvent(index); };
///@}
/**
* \brief Alias for GetEvent()
* \see EventsList::GetEvent.
*/
const gd::BaseEvent& operator[](size_t index) const {
return GetEvent(index);
};
///@}
/** \name Saving and loading
* Members functions related to saving and loading the events list.
*/
///@{
/**
* \brief Serialize the events to the specified element
* \see EventsListSerialization
*/
void SerializeTo(SerializerElement & element) const;
/** \name Saving and loading
* Members functions related to saving and loading the events list.
*/
///@{
/**
* \brief Serialize the events to the specified element
* \see EventsListSerialization
*/
void SerializeTo(SerializerElement& element) const;
/**
* \brief Load the events from the specified element
* \see EventsListSerialization
*/
void UnserializeFrom(gd::Project & project, const SerializerElement & element);
///@}
/**
* \brief Load the events from the specified element
* \see EventsListSerialization
*/
void UnserializeFrom(gd::Project& project, const SerializerElement& element);
///@}
private:
std::vector< std::shared_ptr<BaseEvent> > events;
private:
std::vector<std::shared_ptr<BaseEvent> > events;
/**
* Initialize from another list of events, copying events. Used by copy-ctor and assign-op.
* Don't forget to update me if members were changed !
*/
void Init(const gd::EventsList & other);
/**
* Initialize from another list of events, copying events. Used by copy-ctor
* and assign-op. Don't forget to update me if members were changed!
*/
void Init(const gd::EventsList& other);
};
}
} // namespace gd
#endif
#endif

View File

@@ -1,60 +1,57 @@
/*
* 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_EXPRESSION_H
#define GDCORE_EXPRESSION_H
#include "GDCore/String.h"
namespace gd
{
namespace gd {
/**
* \brief Class representing an expression used as a parameter of a gd::Instruction.
* This class is nothing more than a wrapper around a gd::String.
* \brief Class representing an expression used as a parameter of a
* gd::Instruction. This class is nothing more than a wrapper around a
* gd::String.
*
* \see gd::Instruction
*
* \ingroup Events
*/
class GD_CORE_API Expression
{
public:
class GD_CORE_API Expression {
public:
/**
* \brief Construct an empty expression
*/
Expression(){};
/**
* \brief Construct an empty expression
*/
Expression() {};
/**
* \brief Construct an expression from a string
*/
Expression(gd::String plainString_) : plainString(plainString_){};
/**
* \brief Construct an expression from a string
*/
Expression(gd::String plainString_) : plainString(plainString_) {};
/**
* \brief Construct an expression from a const char *
*/
Expression(const char* plainString_) : plainString(plainString_){};
/**
* \brief Construct an expression from a const char *
*/
Expression(const char * plainString_) : plainString(plainString_) {};
/**
* \brief Get the plain string representing the expression
*/
inline const gd::String& GetPlainString() const { return plainString; };
/**
* \brief Get the plain string representing the expression
*/
inline const gd::String & GetPlainString() const { return plainString; };
/**
* \brief Mimics std::string::c_str
*/
inline const char* c_str() const { return plainString.c_str(); };
/**
* \brief Mimics std::string::c_str
*/
inline const char * c_str() const { return plainString.c_str(); };
virtual ~Expression(){};
virtual ~Expression() {};
private:
gd::String plainString; ///<The expression string
private:
gd::String plainString; ///< The expression string
};
}
} // namespace gd
#endif // GDCORE_EXPRESSION_H
#endif // GDCORE_EXPRESSION_H

View File

@@ -1,74 +1,66 @@
/*
* 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/Instruction.h"
#include "GDCore/Events/InstructionsList.h"
#include "GDCore/Events/Expression.h"
#include "GDCore/String.h"
#include <assert.h>
#include <iostream>
#include <vector>
#include <assert.h>
#include "GDCore/Events/Expression.h"
#include "GDCore/Events/InstructionsList.h"
#include "GDCore/String.h"
namespace gd
{
namespace gd {
gd::Expression Instruction::badExpression("");
Instruction::Instruction(gd::String type_) :
renderedHeightNeedUpdate(true),
renderedHeight(0),
selected(false),
type(type_),
inverted(false)
{
//ctor
parameters.reserve(8);
Instruction::Instruction(gd::String type_)
: renderedHeightNeedUpdate(true),
renderedHeight(0),
selected(false),
type(type_),
inverted(false) {
// ctor
parameters.reserve(8);
}
Instruction::Instruction(gd::String type_, const std::vector<gd::Expression> & parameters_, bool inverted_) :
renderedHeightNeedUpdate(true),
renderedHeight(0),
selected(false),
type(type_),
inverted(inverted_),
parameters(parameters_)
{
parameters.reserve(8);
Instruction::Instruction(gd::String type_,
const std::vector<gd::Expression>& parameters_,
bool inverted_)
: renderedHeightNeedUpdate(true),
renderedHeight(0),
selected(false),
type(type_),
inverted(inverted_),
parameters(parameters_) {
parameters.reserve(8);
}
const gd::Expression & Instruction::GetParameter(std::size_t index) const
{
if ( index >= parameters.size() ) return badExpression;
const gd::Expression& Instruction::GetParameter(std::size_t index) const {
if (index >= parameters.size()) return badExpression;
return parameters[index];
return parameters[index];
}
gd::Expression & Instruction::GetParameter(std::size_t index)
{
if ( index >= parameters.size() ) return badExpression;
gd::Expression& Instruction::GetParameter(std::size_t index) {
if (index >= parameters.size()) return badExpression;
return parameters[index];
return parameters[index];
}
void Instruction::SetParametersCount(std::size_t size)
{
while(size < parameters.size())
parameters.erase(parameters.begin()+parameters.size()-1);
while(size > parameters.size())
parameters.push_back(gd::Expression(""));
void Instruction::SetParametersCount(std::size_t size) {
while (size < parameters.size())
parameters.erase(parameters.begin() + parameters.size() - 1);
while (size > parameters.size()) parameters.push_back(gd::Expression(""));
}
void Instruction::SetParameter(std::size_t nb, const gd::Expression & val)
{
if ( nb >= parameters.size() )
{
std::cout << "Trying to write an out of bound parameter.\n\n" << std::endl;
return;
}
parameters[nb] = val;
void Instruction::SetParameter(std::size_t nb, const gd::Expression& val) {
if (nb >= parameters.size()) {
std::cout << "Trying to write an out of bound parameter.\n\n" << std::endl;
return;
}
parameters[nb] = val;
}
}
} // namespace gd

View File

@@ -1,149 +1,161 @@
/*
* 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 INSTRUCTION_H
#define INSTRUCTION_H
#include "GDCore/String.h"
#include <vector>
#include "GDCore/Events/Expression.h"
#include "GDCore/Events/InstructionsList.h"
#include "GDCore/String.h"
namespace gd
{
namespace gd {
/**
* \brief An instruction is a member of an event: It can be a condition or an action.
* \brief An instruction is a member of an event: It can be a condition or an
* action.
*
* An instruction has a type, which define what it does, and some parameters. It can also be set as inverted ( when the instruction is a condition ) and
* it can have sub instructions.
* This class does nothing particular except storing these data.
* An instruction has a type, which define what it does, and some parameters. It
* can also be set as inverted ( when the instruction is a condition ) and it
* can have sub instructions. This class does nothing particular except storing
* these data.
*
* \see gd::BaseEvent
*
* \ingroup Events
*/
class GD_CORE_API Instruction
{
public:
class GD_CORE_API Instruction {
public:
/**
* \brief Default constructor
* \param type The type of the instruction
*/
Instruction(gd::String type_ = "");
/**
* \brief Default constructor
* \param type The type of the instruction
*/
Instruction(gd::String type_ = "");
/**
* \brief Constructor
* \param type The type of the instruction
* \param parameters A vector containing the parameters of the instruction
* \param inverted true to set the instruction as inverted (used for condition
* instructions).
*/
Instruction(gd::String type_,
const std::vector<gd::Expression>& parameters_,
bool inverted = false);
/**
* \brief Constructor
* \param type The type of the instruction
* \param parameters A vector containing the parameters of the instruction
* \param inverted true to set the instruction as inverted (used for condition instructions).
*/
Instruction(gd::String type_, const std::vector <gd::Expression> & parameters_, bool inverted = false);
virtual ~Instruction(){};
virtual ~Instruction() {};
/**
* \brief Return the type of the instruction.
* \return The type of the instruction
*/
const gd::String& GetType() const { return type; }
/**
* \brief Return the type of the instruction.
* \return The type of the instruction
*/
const gd::String & GetType() const { return type; }
/**
* \brief Change the instruction type
* \param val The new type of the instruction
*/
void SetType(const gd::String& newType) { type = newType; }
/**
* \brief Change the instruction type
* \param val The new type of the instruction
*/
void SetType(const gd::String & newType) { type = newType; }
/**
* \brief Return true if the condition is inverted
* \return true if the condition is inverted
*/
bool IsInverted() const { return inverted; }
/**
* \brief Return true if the condition is inverted
* \return true if the condition is inverted
*/
bool IsInverted() const { return inverted; }
/**
* \brief Set if the instruction is inverted or not.
* \param inverted true if the condition must be set as inverted
*/
void SetInverted(bool inverted_) { inverted = inverted_; }
/**
* \brief Set if the instruction is inverted or not.
* \param inverted true if the condition must be set as inverted
*/
void SetInverted(bool inverted_) { inverted = inverted_; }
/**
* \brief Return the number of parameters of the instruction.
*/
std::size_t GetParametersCount() const { return parameters.size(); }
/**
* \brief Return the number of parameters of the instruction.
*/
std::size_t GetParametersCount() const { return parameters.size(); }
/**
* \brief Change the number of parameter of the instruction.
*
* If the new size if larger than the previous, new blank parameters are
* added.
*/
void SetParametersCount(std::size_t size);
/**
* \brief Change the number of parameter of the instruction.
*
* If the new size if larger than the previous, new blank parameters are added.
*/
void SetParametersCount(std::size_t size);
/**
* \brief Get the value of a parameter.
*
* Return an empty expression if the parameter requested does not exists.
* \return The current value of the parameter.
*/
const gd::Expression& GetParameter(std::size_t index) const;
/**
* \brief Get the value of a parameter.
*
* Return an empty expression if the parameter requested does not exists.
* \return The current value of the parameter.
*/
const gd::Expression & GetParameter(std::size_t index) const;
/**
* \brief Get the value of a parameter.
*
* Return an empty expression if the parameter requested does not exists.
* \return The current value of the parameter.
*/
gd::Expression& GetParameter(std::size_t index);
/**
* \brief Get the value of a parameter.
*
* Return an empty expression if the parameter requested does not exists.
* \return The current value of the parameter.
*/
gd::Expression & GetParameter(std::size_t index);
/** Change the specified parameter
* \param nb The parameter number
* \param val The new value of the parameter
*/
void SetParameter(std::size_t nb, const gd::Expression& val);
/** Change the specified parameter
* \param nb The parameter number
* \param val The new value of the parameter
*/
void SetParameter(std::size_t nb, const gd::Expression & val);
/** \brief Get a reference to the std::vector containing the parameters.
* \return A std::vector containing the parameters
*/
inline const std::vector<gd::Expression>& GetParameters() const {
return parameters;
}
/** \brief Get a reference to the std::vector containing the parameters.
* \return A std::vector containing the parameters
*/
inline const std::vector < gd::Expression > & GetParameters() const { return parameters; }
/** \brief Replace all the parameters by new ones.
* \param val A vector containing the new parameters.
*/
inline void SetParameters(const std::vector<gd::Expression>& val) {
parameters = val;
}
/** \brief Replace all the parameters by new ones.
* \param val A vector containing the new parameters.
*/
inline void SetParameters(const std::vector < gd::Expression > & val) { parameters = val; }
/**
* \brief Return a reference to the vector containing sub instructions
*/
inline const gd::InstructionsList& GetSubInstructions() const {
return subInstructions;
};
/**
* \brief Return a reference to the vector containing sub instructions
*/
inline const gd::InstructionsList & GetSubInstructions() const { return subInstructions; };
/**
* \brief Return a reference to the vector containing sub instructions
*/
inline gd::InstructionsList& GetSubInstructions() { return subInstructions; };
/**
* \brief Return a reference to the vector containing sub instructions
*/
inline gd::InstructionsList & GetSubInstructions() { return subInstructions; };
/** \name Rendering
* Members related to the instruction rendering in an event editor.
*/
///@{
/** \name Rendering
* Members related to the instruction rendering in an event editor.
*/
///@{
mutable bool
renderedHeightNeedUpdate; ///< True if the instruction height may have
///< changed and must be computed again.
mutable unsigned int renderedHeight; ///< Height of the instruction rendered
///< in an event editor.
mutable bool selected; ///< True if selected in an event editor.
mutable bool renderedHeightNeedUpdate; ///< True if the instruction height may have changed and must be computed again.
mutable unsigned int renderedHeight; ///<Height of the instruction rendered in an event editor.
mutable bool selected; ///<True if selected in an event editor.
///@}
///@}
private:
gd::String type; ///< Instruction type
bool inverted; ///< True if the instruction if inverted. Only applicable for
///< instruction used as conditions by events
mutable std::vector<gd::Expression>
parameters; ///< Vector containing the parameters
gd::InstructionsList subInstructions; ///< Sub instructions, if applicable.
private:
gd::String type; ///< Instruction type
bool inverted; ///< True if the instruction if inverted. Only applicable for instruction used as conditions by events
mutable std::vector < gd::Expression > parameters; ///< Vector containing the parameters
gd::InstructionsList subInstructions; ///< Sub instructions, if applicable.
static gd::Expression badExpression;
static gd::Expression badExpression;
};
}
} // namespace gd
#endif // INSTRUCTION_H
#endif // INSTRUCTION_H

View File

@@ -1,42 +1,43 @@
/*
* 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 "InstructionsList.h"
#include "GDCore/Project/Project.h"
#include "GDCore/Events/Instruction.h"
#include "GDCore/Project/Project.h"
#include "Serialization.h"
namespace gd
{
namespace gd {
void InstructionsList::InsertInstructions(const InstructionsList & list, size_t begin, size_t end, size_t position)
{
if (begin >= list.size()) return;
if (end < begin) return;
if (end >= list.size()) end = list.size()-1;
void InstructionsList::InsertInstructions(const InstructionsList& list,
size_t begin,
size_t end,
size_t position) {
if (begin >= list.size()) return;
if (end < begin) return;
if (end >= list.size()) end = list.size() - 1;
for (std::size_t insertPos = 0;insertPos <= (end-begin);insertPos++)
{
const Instruction & instruction = *list.elements[begin+insertPos];
std::shared_ptr<Instruction> copiedInstruction = std::make_shared<Instruction>(instruction);
if (position != (size_t)-1 && position+insertPos < elements.size())
elements.insert(elements.begin()+position+insertPos, copiedInstruction);
else
elements.push_back(copiedInstruction);
}
for (std::size_t insertPos = 0; insertPos <= (end - begin); insertPos++) {
const Instruction& instruction = *list.elements[begin + insertPos];
std::shared_ptr<Instruction> copiedInstruction =
std::make_shared<Instruction>(instruction);
if (position != (size_t)-1 && position + insertPos < elements.size())
elements.insert(elements.begin() + position + insertPos,
copiedInstruction);
else
elements.push_back(copiedInstruction);
}
}
void InstructionsList::SerializeTo(SerializerElement & element) const
{
EventsListSerialization::SerializeInstructionsTo(*this, element);
void InstructionsList::SerializeTo(SerializerElement& element) const {
EventsListSerialization::SerializeInstructionsTo(*this, element);
}
void InstructionsList::UnserializeFrom(gd::Project & project, const SerializerElement & element)
{
EventsListSerialization::UnserializeInstructionsFrom(project, *this, element);
void InstructionsList::UnserializeFrom(gd::Project& project,
const SerializerElement& element) {
EventsListSerialization::UnserializeInstructionsFrom(project, *this, element);
}
}
} // namespace gd

View File

@@ -9,35 +9,43 @@
#include <memory>
#include <vector>
#include "GDCore/Tools/SPtrList.h"
namespace gd { class Instruction; }
namespace gd { class Project; }
namespace gd { class SerializerElement; }
namespace gd
{
class InstructionsList : public SPtrList<gd::Instruction> {
public:
void InsertInstructions(const InstructionsList & list, size_t begin, size_t end, size_t position = (size_t)-1);
/** \name Serialization
*/
///@{
/**
* \brief Serialize the instructions to the specified element
* \see EventsListSerialization
*/
void SerializeTo(gd::SerializerElement & element) const;
/**
* \brief Load the instructions from the specified element
* \see EventsListSerialization
*/
void UnserializeFrom(gd::Project & project, const gd::SerializerElement & element);
///@}
};
namespace gd {
class Instruction;
}
namespace gd {
class Project;
}
namespace gd {
class SerializerElement;
}
namespace gd {
class InstructionsList : public SPtrList<gd::Instruction> {
public:
void InsertInstructions(const InstructionsList& list,
size_t begin,
size_t end,
size_t position = (size_t)-1);
/** \name Serialization
*/
///@{
/**
* \brief Serialize the instructions to the specified element
* \see EventsListSerialization
*/
void SerializeTo(gd::SerializerElement& element) const;
/**
* \brief Load the instructions from the specified element
* \see EventsListSerialization
*/
void UnserializeFrom(gd::Project& project,
const gd::SerializerElement& element);
///@}
};
} // namespace gd
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -1,144 +1,192 @@
/*
* 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_EXPRESSIONPARSER_H
#define GDCORE_EXPRESSIONPARSER_H
#include "GDCore/String.h"
#include <vector>
namespace gd { class Expression; }
namespace gd { class ParserCallbacks; }
namespace gd { class Layout; }
namespace gd { class Project; }
namespace gd { class Platform; }
namespace gd { class ParameterMetadata; }
namespace gd { class ExpressionMetadata; }
#include "GDCore/String.h"
namespace gd {
class Expression;
}
namespace gd {
class ParserCallbacks;
}
namespace gd {
class Layout;
}
namespace gd {
class Project;
}
namespace gd {
class Platform;
}
namespace gd {
class ParameterMetadata;
}
namespace gd {
class ExpressionMetadata;
}
namespace gd
{
namespace gd {
/** \brief Parse an expression
*
* Parse an expression, calling callbacks when a token is reached
* \see gd::ParserCallbacks
*/
class GD_CORE_API ExpressionParser
{
public:
ExpressionParser(const gd::String & expressionPlainString_);
virtual ~ExpressionParser() {};
class GD_CORE_API ExpressionParser {
public:
ExpressionParser(const gd::String &expressionPlainString_);
virtual ~ExpressionParser(){};
/**
* \brief Parse the expression, calling each functor when necessary
* \return True if expression was correctly parsed.
*/
bool ParseMathExpression(const gd::Platform & platform, const gd::Project & project, const gd::Layout & layout, gd::ParserCallbacks & callbacks);
/**
* \brief Parse the expression, calling each functor when necessary
* \return True if expression was correctly parsed.
*/
bool ParseMathExpression(const gd::Platform &platform,
const gd::Project &project,
const gd::Layout &layout,
gd::ParserCallbacks &callbacks);
/**
* \brief Parse the expression, calling each functor when necessary
* \return True if expression was correctly parsed.
*/
bool ParseStringExpression(const gd::Platform & platform, const gd::Project & project, const gd::Layout & layout, gd::ParserCallbacks & callbacks);
/**
* \brief Parse the expression, calling each functor when necessary
* \return True if expression was correctly parsed.
*/
bool ParseStringExpression(const gd::Platform &platform,
const gd::Project &project,
const gd::Layout &layout,
gd::ParserCallbacks &callbacks);
/**
* \brief Return the description of the error that was found
*/
const gd::String & GetFirstError() { return firstErrorStr; }
/**
* \brief Return the description of the error that was found
*/
const gd::String &GetFirstError() { return firstErrorStr; }
/**
* \brief Return the position of the error that was found
* \return The position, or gd::String::npos if no error is found
*/
size_t GetFirstErrorPosition() { return firstErrorPos; }
/**
* \brief Return the position of the error that was found
* \return The position, or gd::String::npos if no error is found
*/
size_t GetFirstErrorPosition() { return firstErrorPos; }
private:
gd::String firstErrorStr;
size_t firstErrorPos;
private:
gd::String firstErrorStr;
size_t firstErrorPos;
/**
* Tool function to add a parameter
*/
bool AddParameterToList(const gd::Project & project, const gd::Layout & layout, ParserCallbacks &, std::vector < gd::Expression > & parameters, gd::String parameterStr, std::vector < gd::ParameterMetadata > parametersInfos, const size_t positionInExpression);
/**
* Tool function to add a parameter
*/
bool AddParameterToList(const gd::Project &project,
const gd::Layout &layout,
ParserCallbacks &,
std::vector<gd::Expression> &parameters,
gd::String parameterStr,
std::vector<gd::ParameterMetadata> parametersInfos,
const size_t positionInExpression);
/**
* Tool function to prepare a parameter
*/
bool PrepareParameter(const gd::Platform & platform,const gd::Project & project, const gd::Layout & layout, ParserCallbacks &, gd::Expression & parameter, const gd::ParameterMetadata & parametersInfo, const size_t positionInExpression);
/**
* Tool function to prepare a parameter
*/
bool PrepareParameter(const gd::Platform &platform,
const gd::Project &project,
const gd::Layout &layout,
ParserCallbacks &,
gd::Expression &parameter,
const gd::ParameterMetadata &parametersInfo,
const size_t positionInExpression);
/**
* Return the minimal number of parameters which can be used when calling an expression ( i.e. ParametersCount-OptionalParameters-CodeOnlyParameters )
*/
size_t GetMinimalParametersNumber(const std::vector < gd::ParameterMetadata > & parametersInfos);
/**
* Return the minimal number of parameters which can be used when calling an
* expression ( i.e. ParametersCount-OptionalParameters-CodeOnlyParameters )
*/
size_t GetMinimalParametersNumber(
const std::vector<gd::ParameterMetadata> &parametersInfos);
/**
* Return the maximal number of parameters which can be used when calling an expression ( i.e. ParametersCount-CodeOnlyParameters )
*/
size_t GetMaximalParametersNumber(const std::vector < gd::ParameterMetadata > & parametersInfos);
/**
* Return the maximal number of parameters which can be used when calling an
* expression ( i.e. ParametersCount-CodeOnlyParameters )
*/
size_t GetMaximalParametersNumber(
const std::vector<gd::ParameterMetadata> &parametersInfos);
bool ValidSyntax(const gd::String & str);
bool ValidSyntax(const gd::String &str);
gd::String expressionPlainString;
static gd::String parserSeparators;
gd::String expressionPlainString;
static gd::String parserSeparators;
};
/** \brief Callbacks called by parser during parsing
*
* Parser will call the appropriate functions during parsing, allowing to do special works.
* \see gd::ExpressionParser
* Parser will call the appropriate functions during parsing, allowing to do
* special works. \see gd::ExpressionParser
*/
class GD_CORE_API ParserCallbacks
{
friend class ExpressionParser;
public:
class GD_CORE_API ParserCallbacks {
friend class ExpressionParser;
ParserCallbacks() : returnType("expression") {};
virtual ~ParserCallbacks() {};
public:
ParserCallbacks() : returnType("expression"){};
virtual ~ParserCallbacks(){};
/**
* \brief Get the type of the expression for which callbacks are used:
* "expression" or "string".
*/
const gd::String & GetReturnType() { return returnType; }
/**
* \brief Get the type of the expression for which callbacks are used:
* "expression" or "string".
*/
const gd::String &GetReturnType() { return returnType; }
virtual void OnConstantToken(gd::String text) = 0;
virtual void OnConstantToken(gd::String text) = 0;
virtual void OnStaticFunction(gd::String functionName, const std::vector<gd::Expression> & parameters, const gd::ExpressionMetadata & expressionInfo) = 0;
virtual void OnStaticFunction(
gd::String functionName,
const std::vector<gd::Expression> &parameters,
const gd::ExpressionMetadata &expressionInfo) = 0;
virtual void OnObjectFunction(gd::String functionName, const std::vector<gd::Expression> & parameters, const gd::ExpressionMetadata & expressionInfo) = 0;
virtual void OnObjectFunction(
gd::String functionName,
const std::vector<gd::Expression> &parameters,
const gd::ExpressionMetadata &expressionInfo) = 0;
virtual void OnObjectBehaviorFunction(gd::String functionName, const std::vector<gd::Expression> & parameters, const gd::ExpressionMetadata & expressionInfo) = 0;
virtual void OnObjectBehaviorFunction(
gd::String functionName,
const std::vector<gd::Expression> &parameters,
const gd::ExpressionMetadata &expressionInfo) = 0;
virtual bool OnSubMathExpression(const gd::Platform & platform, const gd::Project & project, const gd::Layout & layout, gd::Expression & expression) = 0;
virtual bool OnSubTextExpression(const gd::Platform & platform, const gd::Project & project, const gd::Layout & layout, gd::Expression & expression) = 0;
virtual bool OnSubMathExpression(const gd::Platform &platform,
const gd::Project &project,
const gd::Layout &layout,
gd::Expression &expression) = 0;
virtual bool OnSubTextExpression(const gd::Platform &platform,
const gd::Project &project,
const gd::Layout &layout,
gd::Expression &expression) = 0;
/**
* \brief Return the description of the error that was found
*/
const gd::String & GetFirstError() { return firstErrorStr; }
/**
* \brief Return the description of the error that was found
*/
const gd::String &GetFirstError() { return firstErrorStr; }
/**
* \brief Return the position of the error that was found
* \return The position, or gd::String::npos if no error is found
*/
size_t GetFirstErrorPosition() { return firstErrorPos; }
/**
* \brief Return the position of the error that was found
* \return The position, or gd::String::npos if no error is found
*/
size_t GetFirstErrorPosition() { return firstErrorPos; }
protected:
gd::String firstErrorStr;
size_t firstErrorPos;
protected:
gd::String firstErrorStr;
size_t firstErrorPos;
private:
/**
* \brief Set the return type of the expression: Done by ExpressionParser according to
* which Parse* method is called.
* \see gd::ExpressionParser
*/
void SetReturnType(gd::String type) { returnType = type; }
private:
/**
* \brief Set the return type of the expression: Done by ExpressionParser
* according to which Parse* method is called. \see gd::ExpressionParser
*/
void SetReturnType(gd::String type) { returnType = type; }
gd::String returnType; //The type of the expression ("expression" (default), "string"...)
gd::String returnType; // The type of the expression ("expression" (default),
// "string"...)
};
}
} // namespace gd
#endif // GDEXPRESSIONPARSER_H
#endif // GDEXPRESSIONPARSER_H

View File

@@ -1,155 +1,141 @@
/*
* 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/String.h"
#include <vector>
#include "GDCore/Events/Parsers/VariableParser.h"
namespace gd { class Layout; }
namespace gd { class Project; }
namespace gd { class Platform; }
#include <vector>
#include "GDCore/String.h"
namespace gd {
class Layout;
}
namespace gd {
class Project;
}
namespace gd {
class Platform;
}
#include "GDCore/Tools/Localization.h"
namespace gd
{
namespace gd {
VariableParser::~VariableParser()
{
VariableParser::~VariableParser() {}
bool VariableParser::Parse(VariableParserCallbacks& callbacks_) {
callbacks = &callbacks_;
rootVariableParsed = false;
firstErrorStr.clear();
firstErrorPos = 0;
currentPositionIt = expression.begin();
currentTokenType = TS_INVALID;
currentToken.clear();
S();
return firstErrorStr == "";
}
bool VariableParser::Parse(VariableParserCallbacks & callbacks_)
{
callbacks = &callbacks_;
rootVariableParsed = false;
firstErrorStr.clear();
firstErrorPos = 0;
currentPositionIt = expression.begin();
currentTokenType = TS_INVALID;
currentToken.clear();
S();
void VariableParser::ReadToken() {
currentTokenType = TS_INVALID;
currentToken.clear();
while (currentPositionIt != expression.end()) {
char32_t currentChar = *currentPositionIt;
if (currentChar == U'[' || currentChar == U']' || currentChar == U'.') {
if (currentTokenType == TS_VARNAME)
return; // We've parsed a variable name.
}
return firstErrorStr == "";
if (currentChar == U'[') {
currentTokenType = TS_OPENING_BRACKET;
currentToken.clear();
++currentPositionIt;
return;
} else if (currentChar == U']') {
currentTokenType = TS_CLOSING_BRACKET;
currentToken.clear();
++currentPositionIt;
return;
} else if (currentChar == U'.') {
currentTokenType = TS_PERIOD;
currentToken.clear();
++currentPositionIt;
return;
}
currentTokenType = TS_VARNAME; // We're parsing a variable name.
currentToken.push_back(currentChar);
++currentPositionIt;
}
// Can be reached if we are at the end of the expression. In this case,
// currentTokenType will be either TS_VARNAME or TS_INVALID.
}
void VariableParser::ReadToken()
{
currentTokenType = TS_INVALID;
currentToken.clear();
while ( currentPositionIt != expression.end() )
{
char32_t currentChar = *currentPositionIt;
if ( currentChar == U'[' ||
currentChar == U']' ||
currentChar == U'.' )
{
if ( currentTokenType == TS_VARNAME )
return; //We've parsed a variable name.
}
void VariableParser::S() {
ReadToken();
if (currentTokenType != TS_VARNAME) {
firstErrorStr = _("Expecting a variable name.");
firstErrorPos = std::distance<gd::String::const_iterator>(
expression.begin(), currentPositionIt);
return;
}
if ( currentChar == U'[' ) {
currentTokenType = TS_OPENING_BRACKET;
currentToken.clear();
++currentPositionIt;
return;
}
else if ( currentChar == U']' ) {
currentTokenType = TS_CLOSING_BRACKET;
currentToken.clear();
++currentPositionIt;
return;
}
else if ( currentChar == U'.' ) {
currentTokenType = TS_PERIOD;
currentToken.clear();
++currentPositionIt;
return;
}
if (!rootVariableParsed) {
rootVariableParsed = true;
if (callbacks) callbacks->OnRootVariable(currentToken);
} else if (callbacks)
callbacks->OnChildVariable(currentToken);
currentTokenType = TS_VARNAME; //We're parsing a variable name.
currentToken.push_back(currentChar);
++currentPositionIt;
}
//Can be reached if we are at the end of the expression. In this case,
//currentTokenType will be either TS_VARNAME or TS_INVALID.
X();
}
void VariableParser::S()
{
ReadToken();
if (currentTokenType != TS_VARNAME)
{
firstErrorStr = _("Expecting a variable name.");
firstErrorPos = std::distance<gd::String::const_iterator>(expression.begin(), currentPositionIt);
return;
}
void VariableParser::X() {
ReadToken();
if (currentTokenType == TS_INVALID)
return; // Ended parsing.
else if (currentTokenType == TS_PERIOD)
S();
else if (currentTokenType == TS_OPENING_BRACKET) {
gd::String strExpr = SkipStringExpression();
if (!rootVariableParsed)
{
rootVariableParsed = true;
if ( callbacks ) callbacks->OnRootVariable(currentToken);
}
else
if ( callbacks ) callbacks->OnChildVariable(currentToken);
X();
ReadToken();
if (currentTokenType != TS_CLOSING_BRACKET) {
firstErrorStr = _("Expecting ]");
firstErrorPos = std::distance<gd::String::const_iterator>(
expression.begin(), currentPositionIt);
return;
}
if (callbacks) callbacks->OnChildSubscript(strExpr);
X();
}
}
void VariableParser::X()
{
ReadToken();
if (currentTokenType == TS_INVALID)
return; //Ended parsing.
else if (currentTokenType == TS_PERIOD)
S();
else if (currentTokenType == TS_OPENING_BRACKET)
{
gd::String strExpr = SkipStringExpression();
gd::String VariableParser::SkipStringExpression() {
gd::String stringExpression;
bool insideStringLiteral = false;
bool lastCharacterWasBackslash = false;
unsigned int nestedBracket = 0;
while (currentPositionIt != expression.end()) {
char32_t currentChar = *currentPositionIt;
if (currentChar == U'\"') {
if (!insideStringLiteral)
insideStringLiteral = true;
else if (!lastCharacterWasBackslash)
insideStringLiteral = false;
} else if (currentChar == U'[' && !insideStringLiteral) {
nestedBracket++;
} else if (currentChar == U']' && !insideStringLiteral) {
if (nestedBracket == 0)
return stringExpression; // Found the end of the string litteral.
nestedBracket--;
}
ReadToken();
if (currentTokenType != TS_CLOSING_BRACKET)
{
firstErrorStr = _("Expecting ]");
firstErrorPos = std::distance<gd::String::const_iterator>(expression.begin(), currentPositionIt);
return;
}
if ( callbacks ) callbacks->OnChildSubscript(strExpr);
X();
}
lastCharacterWasBackslash = currentChar == U'\\';
stringExpression.push_back(currentChar);
++currentPositionIt;
}
// End of the expression reached ( So expression is invalid by the way )
return stringExpression;
}
gd::String VariableParser::SkipStringExpression()
{
gd::String stringExpression;
bool insideStringLiteral = false;
bool lastCharacterWasBackslash = false;
unsigned int nestedBracket = 0;
while ( currentPositionIt != expression.end() )
{
char32_t currentChar = *currentPositionIt;
if ( currentChar == U'\"' ) {
if ( !insideStringLiteral )
insideStringLiteral = true;
else if ( !lastCharacterWasBackslash )
insideStringLiteral = false;
}
else if ( currentChar == U'[' && !insideStringLiteral ) {
nestedBracket++;
}
else if ( currentChar == U']' && !insideStringLiteral ) {
if ( nestedBracket == 0 ) return stringExpression; //Found the end of the string litteral.
nestedBracket--;
}
lastCharacterWasBackslash = currentChar == U'\\';
stringExpression.push_back(currentChar);
++currentPositionIt;
}
//End of the expression reached ( So expression is invalid by the way )
return stringExpression;
}
}
} // namespace gd

View File

@@ -1,137 +1,147 @@
/*
* 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_VARIABLEPARSER_H
#define GDCORE_VARIABLEPARSER_H
#include "GDCore/String.h"
#include <vector>
namespace gd { class Layout; }
namespace gd { class Project; }
namespace gd { class Platform; }
namespace gd { class VariableParserCallbacks; }
#include "GDCore/String.h"
namespace gd {
class Layout;
}
namespace gd {
class Project;
}
namespace gd {
class Platform;
}
namespace gd {
class VariableParserCallbacks;
}
namespace gd
{
namespace gd {
/** \brief Parse a variable expression.
*
* Parse an variable expression ( like myVariable.child["subchild"+ToString(i)].subsubchild ),
* Parse an variable expression ( like
myVariable.child["subchild"+ToString(i)].subsubchild ),
* calling callbacks when a token is reached.
*
* Usage example:
\code
//...
//VariableCodeGenerationCallbacks is a class inheriting from gd::VariableParserCallbacks
VariableCodeGenerationCallbacks callbacks(output, *this, context, VariableCodeGenerationCallbacks::PROJECT_VARIABLE);
//VariableCodeGenerationCallbacks is a class inheriting from
gd::VariableParserCallbacks VariableCodeGenerationCallbacks callbacks(output,
*this, context, VariableCodeGenerationCallbacks::PROJECT_VARIABLE);
gd::VariableParser parser(parameter);
if ( !parser.Parse(callbacks) )
cout << "Error :" << parser.GetFirstError() << " in: "<< parameter << endl;
\endcode
cout << "Error :" << parser.GetFirstError() << " in: "<< parameter <<
endl; \endcode
*
* Here is the parsed grammar: <br>
* S -> VarName X <br>
* X -> e | . S | [StringExpression] X <br>
*
* where e = nothing ( end of expression ), StringExpression = A valid string expression and
* where e = nothing ( end of expression ), StringExpression = A valid string
expression and
* S is the start.
*
* \see gd::VariableParserCallbacks
*/
class GD_CORE_API VariableParser
{
public:
class GD_CORE_API VariableParser {
public:
/**
* \brief Default constructor
* \param expressionPlainString The string representing the expression to be
* parsed.
*/
VariableParser(const gd::String& expressionPlainString_)
: currentPositionIt(), expression(expressionPlainString_){};
virtual ~VariableParser();
/**
* \brief Default constructor
* \param expressionPlainString The string representing the expression to be parsed.
*/
VariableParser(const gd::String & expressionPlainString_) : currentPositionIt(), expression(expressionPlainString_) {};
virtual ~VariableParser();
/**
* Parse the expression, calling each callback when necessary.
* \param callbacks The callbacks to be called.
* \return true if expression was correctly parsed.
* \see gd::VariableParserCallbacks
*/
bool Parse(VariableParserCallbacks& callbacks);
/**
* Parse the expression, calling each callback when necessary.
* \param callbacks The callbacks to be called.
* \return true if expression was correctly parsed.
* \see gd::VariableParserCallbacks
*/
bool Parse(VariableParserCallbacks & callbacks);
/**
* \brief Return the description of the error that was found
*/
const gd::String& GetFirstError() { return firstErrorStr; }
/**
* \brief Return the description of the error that was found
*/
const gd::String & GetFirstError() { return firstErrorStr; }
/**
* \brief Return the position of the error that was found
* \return The position, or gd::String::npos if no error is found
*/
size_t GetFirstErrorPosition() { return firstErrorPos; }
/**
* \brief Return the position of the error that was found
* \return The position, or gd::String::npos if no error is found
*/
size_t GetFirstErrorPosition() { return firstErrorPos; }
gd::String firstErrorStr;
size_t firstErrorPos;
gd::String firstErrorStr;
size_t firstErrorPos;
private:
void S();
void X();
private:
/**
* \brief Skip the string expression, starting from the current position.
* \return The string expression skipped. currentPosition is now put on the
* closing bracket.
*/
gd::String SkipStringExpression();
void S();
void X();
void ReadToken();
/**
* \brief Skip the string expression, starting from the current position.
* \return The string expression skipped. currentPosition is now put on the closing bracket.
*/
gd::String SkipStringExpression();
enum TokenType {
TS_PERIOD,
TS_OPENING_BRACKET,
TS_CLOSING_BRACKET,
TS_VARNAME,
TS_INVALID
};
void ReadToken();
TokenType currentTokenType;
gd::String currentToken;
gd::String::const_iterator currentPositionIt;
gd::String expression;
enum TokenType {
TS_PERIOD,
TS_OPENING_BRACKET,
TS_CLOSING_BRACKET,
TS_VARNAME,
TS_INVALID
};
TokenType currentTokenType;
gd::String currentToken;
gd::String::const_iterator currentPositionIt;
gd::String expression;
VariableParserCallbacks * callbacks;
bool rootVariableParsed;
VariableParserCallbacks* callbacks;
bool rootVariableParsed;
};
/**
* \brief Callbacks called by VariableParser when parsing a variable expression.
*/
class GD_CORE_API VariableParserCallbacks
{
public:
/**
* \brief Called when the first variable has been parsed. ( varName1 in varName1.child for example. )
* \param variableName The variable name.
*/
virtual void OnRootVariable(gd::String variableName) = 0;
class GD_CORE_API VariableParserCallbacks {
public:
/**
* \brief Called when the first variable has been parsed. ( varName1 in
* varName1.child for example. ) \param variableName The variable name.
*/
virtual void OnRootVariable(gd::String variableName) = 0;
/**
* \brief Called when accessing the child of a structure variable. ( child in varName1.child for example. )
* \param variableName The child variable name.
*/
virtual void OnChildVariable(gd::String variableName) = 0;
/**
* \brief Called when accessing the child of a structure variable. ( child in
* varName1.child for example. ) \param variableName The child variable name.
*/
virtual void OnChildVariable(gd::String variableName) = 0;
/**
* \brief Called when accessing the child of a structure variable using a string expression
* in square brackets. ( "subscript" in varName1["subscript"] for example. )
*
* \param variableName The expression used to access the child variable.
*/
virtual void OnChildSubscript(gd::String stringExpression) = 0;
/**
* \brief Called when accessing the child of a structure variable using a
* string expression in square brackets. ( "subscript" in
* varName1["subscript"] for example. )
*
* \param variableName The expression used to access the child variable.
*/
virtual void OnChildSubscript(gd::String stringExpression) = 0;
};
}
} // namespace gd
#endif // GDEXPRESSIONPARSER_H
#endif // GDEXPRESSIONPARSER_H

View File

@@ -1,288 +1,285 @@
/*
* 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/Project/Project.h"
#include "GDCore/Extensions/Platform.h"
#include "GDCore/Extensions/Metadata/InstructionMetadata.h"
#include "GDCore/Events/InstructionsList.h"
#include "GDCore/Events/EventsList.h"
#include "GDCore/Events/Event.h"
#include "GDCore/Events/Serialization.h"
#include "GDCore/CommonTools.h"
#include "GDCore/Events/Event.h"
#include "GDCore/Events/EventsList.h"
#include "GDCore/Events/Instruction.h"
#include "GDCore/Events/InstructionsList.h"
#include "GDCore/Extensions/Metadata/InstructionMetadata.h"
#include "GDCore/Extensions/Metadata/MetadataProvider.h"
#include "GDCore/Extensions/Platform.h"
#include "GDCore/Project/Project.h"
#include "GDCore/Serialization/Serializer.h"
#include "GDCore/Serialization/SerializerElement.h"
#include "GDCore/Events/Instruction.h"
#include "GDCore/Extensions/Metadata/MetadataProvider.h"
#include "GDCore/Tools/Log.h"
#include "GDCore/CommonTools.h"
using namespace std;
namespace gd
{
namespace gd {
void EventsListSerialization::UpdateInstructionsFromGD31x(gd::Project & project, gd::InstructionsList & list)
{
for (std::size_t i = 0;i<list.size();++i)
{
gd::Instruction & instr = list[i];
void EventsListSerialization::UpdateInstructionsFromGD31x(
gd::Project& project, gd::InstructionsList& list) {
for (std::size_t i = 0; i < list.size(); ++i) {
gd::Instruction& instr = list[i];
if (instr.GetType() == "VarScene" ||
instr.GetType() == "VarSceneTxt" ||
instr.GetType() == "VarGlobal" ||
instr.GetType() == "VarGlobalTxt" ||
instr.GetType() == "ModVarScene" ||
instr.GetType() == "ModVarSceneTxt" ||
instr.GetType() == "ModVarGlobal" ||
instr.GetType() == "ModVarGlobalTxt" )
{
std::vector< gd::Expression > parameters = instr.GetParameters();
if ( parameters.size() >= 1 ) parameters.erase(parameters.begin()+0);
instr.SetParameters(parameters);
}
if (instr.GetType() == "VarSceneDef" ||
instr.GetType() == "VarGlobalDef" ||
instr.GetType() == "VarObjetDef" )
{
instr.SetParameter(1, gd::Expression("\""+instr.GetParameter(1).GetPlainString()+"\""));
}
if (instr.GetType() == "VarScene" || instr.GetType() == "VarSceneTxt" ||
instr.GetType() == "VarGlobal" || instr.GetType() == "VarGlobalTxt" ||
instr.GetType() == "ModVarScene" ||
instr.GetType() == "ModVarSceneTxt" ||
instr.GetType() == "ModVarGlobal" ||
instr.GetType() == "ModVarGlobalTxt") {
std::vector<gd::Expression> parameters = instr.GetParameters();
if (parameters.size() >= 1) parameters.erase(parameters.begin() + 0);
instr.SetParameters(parameters);
}
if (instr.GetType() == "VarSceneDef" || instr.GetType() == "VarGlobalDef" ||
instr.GetType() == "VarObjetDef") {
instr.SetParameter(
1,
gd::Expression("\"" + instr.GetParameter(1).GetPlainString() + "\""));
}
}
}
void EventsListSerialization::UpdateInstructionsFromGD2x(gd::Project & project, gd::InstructionsList & list, bool instructionsAreActions)
{
for (std::size_t i = 0;i<list.size();++i)
{
gd::Instruction & instr = list[i];
void EventsListSerialization::UpdateInstructionsFromGD2x(
gd::Project& project,
gd::InstructionsList& list,
bool instructionsAreActions) {
for (std::size_t i = 0; i < list.size(); ++i) {
gd::Instruction& instr = list[i];
const gd::InstructionMetadata & metadata = instructionsAreActions ?
MetadataProvider::GetActionMetadata(project.GetCurrentPlatform(), instr.GetType()) :
MetadataProvider::GetConditionMetadata(project.GetCurrentPlatform(), instr.GetType());
const gd::InstructionMetadata& metadata =
instructionsAreActions
? MetadataProvider::GetActionMetadata(project.GetCurrentPlatform(),
instr.GetType())
: MetadataProvider::GetConditionMetadata(
project.GetCurrentPlatform(), instr.GetType());
//Specific updates for some instructions
if ( instr.GetType() == "LinkedObjects::LinkObjects" || instr.GetType() == "LinkedObjects::RemoveLinkBetween" )
{
instr.SetParameter(1, instr.GetParameter(3));
instr.SetParameter(2, instr.GetParameter(4));
}
else if (instr.GetType() == "LinkedObjects::RemoveAllLinksOf")
{
instr.SetParameter(1, instr.GetParameter(2));
}
else if (instr.GetType() == "LinkedObjects::PickObjectsLinkedTo")
{
instr.SetParameter(1, instr.GetParameter(5));
instr.SetParameter(2, instr.GetParameter(3));
}
else if (instr.GetType() == "PhysicsBehavior::AddRevoluteJointBetweenObjects")
{
instr.SetParameter(4, instr.GetParameter(5));
instr.SetParameter(5, instr.GetParameter(6));
}
else if (instr.GetType() == "FixCamera" || instr.GetType() == "CentreCamera")
{
std::vector< gd::Expression > parameters = instr.GetParameters();
if ( parameters.size() >= 3 ) parameters.erase(parameters.begin()+2);
instr.SetParameters(parameters);
}
else if (instr.GetType() == "AjoutObjConcern" || instr.GetType() == "AjoutHasard")
{
instr.SetParameter(1, instr.GetParameter(3));
}
else if (instr.GetType() == "SeDirige" || instr.GetType() == "EstTourne" )
{
std::vector< gd::Expression > parameters = instr.GetParameters();
if ( parameters.size() >= 3 ) parameters.erase(parameters.begin()+2);
if ( parameters.size() >= 3 ) parameters.erase(parameters.begin()+2);
instr.SetParameters(parameters);
}
else if (instr.GetType() == "Create")
{
std::vector< gd::Expression > parameters = instr.GetParameters();
if ( parameters.size() >= 2 ) parameters.erase(parameters.begin()+1);
if ( parameters.size() >= 2 ) parameters.erase(parameters.begin()+1);
instr.SetParameters(parameters);
}
else if (instr.GetType() == "CreateByName")
{
std::vector< gd::Expression > parameters = instr.GetParameters();
if ( parameters.size() >= 2 ) parameters.erase(parameters.begin()+1);
instr.SetParameters(parameters);
}
else if (instr.GetType() == "NbObjet")
{
std::vector< gd::Expression > parameters = instr.GetParameters();
if ( parameters.size() >= 2 ) parameters.erase(parameters.begin()+1);
instr.SetParameters(parameters);
}
else if (instr.GetType() == "Distance")
{
std::vector< gd::Expression > parameters = instr.GetParameters();
if ( parameters.size() >= 3 ) parameters.erase(parameters.begin()+2);
if ( parameters.size() >= 3 ) parameters.erase(parameters.begin()+2);
if ( parameters.size() >= 4 && (parameters[3].GetPlainString() == ">=" || parameters[3].GetPlainString() == ">") )
{
instr.SetInverted(true);
}
else
{
instr.SetInverted(false);
}
instr.SetParameters(parameters);
}
//Common updates for some parameters
const std::vector< gd::Expression > & parameters = instr.GetParameters();
for (std::size_t j = 0;j<parameters.size() && j<metadata.parameters.size();++j)
{
if ( metadata.parameters[j].type == "relationalOperator" ||
metadata.parameters[j].type == "operator" )
{
if ( j == parameters.size()-1 )
{
std::cout << "ERROR: No more parameters after a [relational]operator when trying to update an instruction from GD2.x";
}
else
{
//Exchange parameters
gd::String op = parameters[j+1].GetPlainString();
instr.SetParameter(j+1, parameters[j] );
instr.SetParameter(j, gd::Expression(op));
}
}
}
//UpdateInstructionsFromGD2x(project, instr.GetSubInstructions(), instructionsAreActions);
// Specific updates for some instructions
if (instr.GetType() == "LinkedObjects::LinkObjects" ||
instr.GetType() == "LinkedObjects::RemoveLinkBetween") {
instr.SetParameter(1, instr.GetParameter(3));
instr.SetParameter(2, instr.GetParameter(4));
} else if (instr.GetType() == "LinkedObjects::RemoveAllLinksOf") {
instr.SetParameter(1, instr.GetParameter(2));
} else if (instr.GetType() == "LinkedObjects::PickObjectsLinkedTo") {
instr.SetParameter(1, instr.GetParameter(5));
instr.SetParameter(2, instr.GetParameter(3));
} else if (instr.GetType() ==
"PhysicsBehavior::AddRevoluteJointBetweenObjects") {
instr.SetParameter(4, instr.GetParameter(5));
instr.SetParameter(5, instr.GetParameter(6));
} else if (instr.GetType() == "FixCamera" ||
instr.GetType() == "CentreCamera") {
std::vector<gd::Expression> parameters = instr.GetParameters();
if (parameters.size() >= 3) parameters.erase(parameters.begin() + 2);
instr.SetParameters(parameters);
} else if (instr.GetType() == "AjoutObjConcern" ||
instr.GetType() == "AjoutHasard") {
instr.SetParameter(1, instr.GetParameter(3));
} else if (instr.GetType() == "SeDirige" ||
instr.GetType() == "EstTourne") {
std::vector<gd::Expression> parameters = instr.GetParameters();
if (parameters.size() >= 3) parameters.erase(parameters.begin() + 2);
if (parameters.size() >= 3) parameters.erase(parameters.begin() + 2);
instr.SetParameters(parameters);
} else if (instr.GetType() == "Create") {
std::vector<gd::Expression> parameters = instr.GetParameters();
if (parameters.size() >= 2) parameters.erase(parameters.begin() + 1);
if (parameters.size() >= 2) parameters.erase(parameters.begin() + 1);
instr.SetParameters(parameters);
} else if (instr.GetType() == "CreateByName") {
std::vector<gd::Expression> parameters = instr.GetParameters();
if (parameters.size() >= 2) parameters.erase(parameters.begin() + 1);
instr.SetParameters(parameters);
} else if (instr.GetType() == "NbObjet") {
std::vector<gd::Expression> parameters = instr.GetParameters();
if (parameters.size() >= 2) parameters.erase(parameters.begin() + 1);
instr.SetParameters(parameters);
} else if (instr.GetType() == "Distance") {
std::vector<gd::Expression> parameters = instr.GetParameters();
if (parameters.size() >= 3) parameters.erase(parameters.begin() + 2);
if (parameters.size() >= 3) parameters.erase(parameters.begin() + 2);
if (parameters.size() >= 4 && (parameters[3].GetPlainString() == ">=" ||
parameters[3].GetPlainString() == ">")) {
instr.SetInverted(true);
} else {
instr.SetInverted(false);
}
instr.SetParameters(parameters);
}
// Common updates for some parameters
const std::vector<gd::Expression>& parameters = instr.GetParameters();
for (std::size_t j = 0;
j < parameters.size() && j < metadata.parameters.size();
++j) {
if (metadata.parameters[j].type == "relationalOperator" ||
metadata.parameters[j].type == "operator") {
if (j == parameters.size() - 1) {
std::cout << "ERROR: No more parameters after a [relational]operator "
"when trying to update an instruction from GD2.x";
} else {
// Exchange parameters
gd::String op = parameters[j + 1].GetPlainString();
instr.SetParameter(j + 1, parameters[j]);
instr.SetParameter(j, gd::Expression(op));
}
}
}
// UpdateInstructionsFromGD2x(project, instr.GetSubInstructions(),
// instructionsAreActions);
}
}
void EventsListSerialization::UnserializeEventsFrom(gd::Project & project, EventsList & list, const SerializerElement & events)
{
list.Clear();
events.ConsiderAsArrayOf("event", "Event");
for(std::size_t i = 0; i<events.GetChildrenCount(); ++i)
{
SerializerElement & eventElem = events.GetChild(i);
gd::String type = eventElem.GetChild("type", 0, "Type").GetValue().GetString();
gd::BaseEventSPtr event = project.CreateEvent(type);
if ( event != std::shared_ptr<gd::BaseEvent>())
event->UnserializeFrom(project, eventElem);
else
{
std::cout << "WARNING: Unknown event of type " << type << std::endl;
event = std::make_shared<EmptyEvent>();
}
event->SetDisabled(eventElem.GetBoolAttribute("disabled"));
event->SetFolded(eventElem.GetBoolAttribute("folded"));
list.InsertEvent(event, list.GetEventsCount());
void EventsListSerialization::UnserializeEventsFrom(
gd::Project& project, EventsList& list, const SerializerElement& events) {
list.Clear();
events.ConsiderAsArrayOf("event", "Event");
for (std::size_t i = 0; i < events.GetChildrenCount(); ++i) {
SerializerElement& eventElem = events.GetChild(i);
gd::String type =
eventElem.GetChild("type", 0, "Type").GetValue().GetString();
gd::BaseEventSPtr event = project.CreateEvent(type);
if (event != std::shared_ptr<gd::BaseEvent>())
event->UnserializeFrom(project, eventElem);
else {
std::cout << "WARNING: Unknown event of type " << type << std::endl;
event = std::make_shared<EmptyEvent>();
}
event->SetDisabled(eventElem.GetBoolAttribute("disabled"));
event->SetFolded(eventElem.GetBoolAttribute("folded"));
list.InsertEvent(event, list.GetEventsCount());
}
}
void EventsListSerialization::SerializeEventsTo(const EventsList & list, SerializerElement & events)
{
events.ConsiderAsArrayOf("event");
for ( std::size_t j = 0;j < list.size();j++ )
{
const gd::BaseEvent & event = list.GetEvent(j);
SerializerElement & eventElem = events.AddChild("event");
void EventsListSerialization::SerializeEventsTo(const EventsList& list,
SerializerElement& events) {
events.ConsiderAsArrayOf("event");
for (std::size_t j = 0; j < list.size(); j++) {
const gd::BaseEvent& event = list.GetEvent(j);
SerializerElement& eventElem = events.AddChild("event");
eventElem.SetAttribute("disabled", event.IsDisabled());
eventElem.SetAttribute("folded", event.IsFolded());
eventElem.AddChild("type").SetValue(event.GetType());
eventElem.SetAttribute("disabled", event.IsDisabled());
eventElem.SetAttribute("folded", event.IsFolded());
eventElem.AddChild("type").SetValue(event.GetType());
event.SerializeTo(eventElem);
}
event.SerializeTo(eventElem);
}
}
using namespace std;
void gd::EventsListSerialization::UnserializeInstructionsFrom(gd::Project & project, gd::InstructionsList & instructions, const SerializerElement & elem)
{
elem.ConsiderAsArrayOf("instruction");
//Compatibility with GD <= 4.0.95
if (elem.HasChild("condition", "Condition"))
elem.ConsiderAsArrayOf("condition", "Condition");
else if (elem.HasChild("action", "Action"))
elem.ConsiderAsArrayOf("action", "Action");
//end of compatibility code
void gd::EventsListSerialization::UnserializeInstructionsFrom(
gd::Project& project,
gd::InstructionsList& instructions,
const SerializerElement& elem) {
elem.ConsiderAsArrayOf("instruction");
// Compatibility with GD <= 4.0.95
if (elem.HasChild("condition", "Condition"))
elem.ConsiderAsArrayOf("condition", "Condition");
else if (elem.HasChild("action", "Action"))
elem.ConsiderAsArrayOf("action", "Action");
// end of compatibility code
for(std::size_t i = 0; i<elem.GetChildrenCount(); ++i)
{
gd::Instruction instruction;
const SerializerElement & instrElement = elem.GetChild(i);
for (std::size_t i = 0; i < elem.GetChildrenCount(); ++i) {
gd::Instruction instruction;
const SerializerElement& instrElement = elem.GetChild(i);
instruction.SetType(instrElement.GetChild("type", 0, "Type").GetStringAttribute("value")
.FindAndReplace("Automatism", "Behavior")); //Compatibility with GD <= 4
instruction.SetInverted(instrElement.GetChild("type", 0, "Type").GetBoolAttribute("inverted", false, "Contraire"));
instruction.SetType(
instrElement.GetChild("type", 0, "Type")
.GetStringAttribute("value")
.FindAndReplace("Automatism",
"Behavior")); // Compatibility with GD <= 4
instruction.SetInverted(
instrElement.GetChild("type", 0, "Type")
.GetBoolAttribute("inverted", false, "Contraire"));
//Read parameters
vector < gd::Expression > parameters;
// Read parameters
vector<gd::Expression> parameters;
//Compatibility with GD <= 3.3
if (instrElement.HasChild("Parametre")) {
// Compatibility with GD <= 3.3
if (instrElement.HasChild("Parametre")) {
for (std::size_t j = 0; j < instrElement.GetChildrenCount("Parametre");
++j)
parameters.push_back(gd::Expression(
instrElement.GetChild("Parametre", j).GetValue().GetString()));
for (std::size_t j = 0;j<instrElement.GetChildrenCount("Parametre");++j)
parameters.push_back(gd::Expression(instrElement.GetChild("Parametre", j).GetValue().GetString()));
}
//end of compatibility code
else
{
const SerializerElement & parametersElem = instrElement.GetChild("parameters");
parametersElem.ConsiderAsArrayOf("parameter");
for (std::size_t j = 0;j<parametersElem.GetChildrenCount();++j)
parameters.push_back(gd::Expression(parametersElem.GetChild(j).GetValue().GetString()));
}
instruction.SetParameters( parameters );
//Read sub instructions
if ( instrElement.HasChild("subInstructions") )
UnserializeInstructionsFrom(project, instruction.GetSubInstructions(), instrElement.GetChild("subInstructions"));
//Compatibility with GD <= 4.0.95
if ( instrElement.HasChild("subConditions", "SubConditions") )
UnserializeInstructionsFrom(project, instruction.GetSubInstructions(), instrElement.GetChild("subConditions", 0, "SubConditions" ));
if ( instrElement.HasChild("subActions", "SubActions") )
UnserializeInstructionsFrom(project, instruction.GetSubInstructions(), instrElement.GetChild("subActions", 0, "SubActions" ));
//end of compatibility code
instructions.Insert( instruction );
}
// end of compatibility code
else {
const SerializerElement& parametersElem =
instrElement.GetChild("parameters");
parametersElem.ConsiderAsArrayOf("parameter");
for (std::size_t j = 0; j < parametersElem.GetChildrenCount(); ++j)
parameters.push_back(
gd::Expression(parametersElem.GetChild(j).GetValue().GetString()));
}
//Compatibility with GD <= 3.1
if ( project.GetLastSaveGDMajorVersion() < 3 ||
(project.GetLastSaveGDMajorVersion() == 3 && project.GetLastSaveGDMinorVersion() <= 1 ) )
UpdateInstructionsFromGD31x(project, instructions);
instruction.SetParameters(parameters);
if ( project.GetLastSaveGDMajorVersion() < 3 )
UpdateInstructionsFromGD2x(project, instructions, elem.HasChild("action", "Action"));
//end of compatibility code
// Read sub instructions
if (instrElement.HasChild("subInstructions"))
UnserializeInstructionsFrom(project,
instruction.GetSubInstructions(),
instrElement.GetChild("subInstructions"));
// Compatibility with GD <= 4.0.95
if (instrElement.HasChild("subConditions", "SubConditions"))
UnserializeInstructionsFrom(
project,
instruction.GetSubInstructions(),
instrElement.GetChild("subConditions", 0, "SubConditions"));
if (instrElement.HasChild("subActions", "SubActions"))
UnserializeInstructionsFrom(
project,
instruction.GetSubInstructions(),
instrElement.GetChild("subActions", 0, "SubActions"));
// end of compatibility code
instructions.Insert(instruction);
}
// Compatibility with GD <= 3.1
if (project.GetLastSaveGDMajorVersion() < 3 ||
(project.GetLastSaveGDMajorVersion() == 3 &&
project.GetLastSaveGDMinorVersion() <= 1))
UpdateInstructionsFromGD31x(project, instructions);
if (project.GetLastSaveGDMajorVersion() < 3)
UpdateInstructionsFromGD2x(
project, instructions, elem.HasChild("action", "Action"));
// end of compatibility code
}
void gd::EventsListSerialization::SerializeInstructionsTo(const gd::InstructionsList & list, SerializerElement & instructions)
{
instructions.ConsiderAsArrayOf("instruction");
for ( std::size_t k = 0;k < list.size();k++ )
{
SerializerElement & instruction = instructions.AddChild("instruction");
instruction.AddChild("type")
.SetAttribute("value", list[k].GetType())
.SetAttribute("inverted", list[k].IsInverted());
void gd::EventsListSerialization::SerializeInstructionsTo(
const gd::InstructionsList& list, SerializerElement& instructions) {
instructions.ConsiderAsArrayOf("instruction");
for (std::size_t k = 0; k < list.size(); k++) {
SerializerElement& instruction = instructions.AddChild("instruction");
instruction.AddChild("type")
.SetAttribute("value", list[k].GetType())
.SetAttribute("inverted", list[k].IsInverted());
//Parameters
SerializerElement & parameters = instruction.AddChild("parameters");
parameters.ConsiderAsArrayOf("parameter");
for ( std::size_t l = 0;l < list[k].GetParameters().size();l++ )
parameters.AddChild("parameter").SetValue(list[k].GetParameter(l).GetPlainString());
// Parameters
SerializerElement& parameters = instruction.AddChild("parameters");
parameters.ConsiderAsArrayOf("parameter");
for (std::size_t l = 0; l < list[k].GetParameters().size(); l++)
parameters.AddChild("parameter")
.SetValue(list[k].GetParameter(l).GetPlainString());
//Sub instructions
SerializerElement & subInstructions = instruction.AddChild("subInstructions");
SerializeInstructionsTo(list[k].GetSubInstructions(), subInstructions);
}
// Sub instructions
SerializerElement& subInstructions =
instruction.AddChild("subInstructions");
SerializeInstructionsTo(list[k].GetSubInstructions(), subInstructions);
}
}
}
} // namespace gd

View File

@@ -1,66 +1,79 @@
/*
* 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_EVENTS_SERIALIZATION_H
#define GDCORE_EVENTS_SERIALIZATION_H
#include "GDCore/Serialization/Serializer.h"
#include <vector>
namespace gd { class InstructionsList; }
namespace gd { class Project; }
namespace gd { class EventsList; }
#include "GDCore/Serialization/Serializer.h"
namespace gd {
class InstructionsList;
}
namespace gd {
class Project;
}
namespace gd {
class EventsList;
}
namespace gd
{
namespace gd {
/**
* \brief Contains tools for loading and saving events to SerializerElement.
*/
class GD_CORE_API EventsListSerialization
{
public:
/**
* \brief Load an events list from a SerializerElement
* \param project The project the events belongs to.
* \param list The event list in which the events must be loaded.
* \param events The SerializerElement containing the events
*/
static void UnserializeEventsFrom(gd::Project & project, gd::EventsList & list, const SerializerElement & events);
class GD_CORE_API EventsListSerialization {
public:
/**
* \brief Load an events list from a SerializerElement
* \param project The project the events belongs to.
* \param list The event list in which the events must be loaded.
* \param events The SerializerElement containing the events
*/
static void UnserializeEventsFrom(gd::Project& project,
gd::EventsList& list,
const SerializerElement& events);
/**
* \brief Save an events list to a SerializerElement
* \param list The event list to be saved.
* \param events The SerializerElement in which the events must be serialized.
*/
static void SerializeEventsTo(const gd::EventsList & list, SerializerElement & events);
/**
* \brief Save an events list to a SerializerElement
* \param list The event list to be saved.
* \param events The SerializerElement in which the events must be serialized.
*/
static void SerializeEventsTo(const gd::EventsList& list,
SerializerElement& events);
/**
* \brief Unserialize a list of instructions
*/
static void UnserializeInstructionsFrom(gd::Project & project, gd::InstructionsList & list, const SerializerElement & elem);
/**
* \brief Unserialize a list of instructions
*/
static void UnserializeInstructionsFrom(gd::Project& project,
gd::InstructionsList& list,
const SerializerElement& elem);
/**
* \brief Serialize a list of instructions
*/
static void SerializeInstructionsTo(const gd::InstructionsList & list, SerializerElement & elem);
/**
* \brief Serialize a list of instructions
*/
static void SerializeInstructionsTo(const gd::InstructionsList& list,
SerializerElement& elem);
private:
/**
* \brief Internal method called when opening events created with GD2.x
*
* Some instructions names have been changed as well as parameters since GD 3.
*/
static void UpdateInstructionsFromGD2x(gd::Project & project, gd::InstructionsList & list, bool instructionsAreActions);
private:
/**
* \brief Internal method called when opening events created with GD2.x
*
* Some instructions names have been changed as well as parameters since GD 3.
*/
static void UpdateInstructionsFromGD2x(gd::Project& project,
gd::InstructionsList& list,
bool instructionsAreActions);
/**
* \brief Internal method called when opening events created with GD 3.1.x
*
* Variables related and some storage instructions have been changed.
*/
static void UpdateInstructionsFromGD31x(gd::Project & project, gd::InstructionsList & list);
/**
* \brief Internal method called when opening events created with GD 3.1.x
*
* Variables related and some storage instructions have been changed.
*/
static void UpdateInstructionsFromGD31x(gd::Project& project,
gd::InstructionsList& list);
};
}
} // namespace gd
#endif // GDCORE_EVENTS_SERIALIZATION_H
#endif // GDCORE_EVENTS_SERIALIZATION_H

View File

@@ -1,69 +1,70 @@
/*
* 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)
#include "GDCore/CommonTools.h"
#include "EventsCodeNameMangler.h"
#include "GDCore/CommonTools.h"
#include "GDCore/String.h"
EventsCodeNameMangler *EventsCodeNameMangler::_singleton = NULL;
gd::String EventsCodeNameMangler::GetMangledObjectsListName(const gd::String & originalObjectName)
{
gd::String partiallyMangledName = originalObjectName;
static const gd::String allowedCharacters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
gd::String EventsCodeNameMangler::GetMangledObjectsListName(
const gd::String &originalObjectName) {
gd::String partiallyMangledName = originalObjectName;
static const gd::String allowedCharacters =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
for (size_t i = 0;i<partiallyMangledName.size();++i) //Replace all unallowed letter by an underscore and the ascii number of the letter
{
if ( allowedCharacters.find_first_of(std::u32string(1, partiallyMangledName[i])) == gd::String::npos)
{
char32_t unallowedChar = partiallyMangledName[i];
partiallyMangledName.replace(i, 1, "_"+gd::String::From(unallowedChar));
}
for (size_t i = 0; i < partiallyMangledName.size();
++i) // Replace all unallowed letter by an underscore and the ascii
// number of the letter
{
if (allowedCharacters.find_first_of(
std::u32string(1, partiallyMangledName[i])) == gd::String::npos) {
char32_t unallowedChar = partiallyMangledName[i];
partiallyMangledName.replace(i, 1, "_" + gd::String::From(unallowedChar));
}
}
return "GD"+partiallyMangledName+"Objects";
return "GD" + partiallyMangledName + "Objects";
}
gd::String EventsCodeNameMangler::GetExternalEventsFunctionMangledName(const gd::String & externalEventsName)
{
gd::String partiallyMangledName = externalEventsName;
static const gd::String allowedCharacters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
gd::String EventsCodeNameMangler::GetExternalEventsFunctionMangledName(
const gd::String &externalEventsName) {
gd::String partiallyMangledName = externalEventsName;
static const gd::String allowedCharacters =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
for (size_t i = 0;i<partiallyMangledName.size();++i) //Replace all unallowed letter by an underscore and the ascii number of the letter
{
if ( allowedCharacters.find_first_of(std::u32string(1, partiallyMangledName[i])) == gd::String::npos)
{
char32_t unallowedChar = partiallyMangledName[i];
partiallyMangledName.replace(i, 1, "_"+gd::String::From(unallowedChar));
}
for (size_t i = 0; i < partiallyMangledName.size();
++i) // Replace all unallowed letter by an underscore and the ascii
// number of the letter
{
if (allowedCharacters.find_first_of(
std::u32string(1, partiallyMangledName[i])) == gd::String::npos) {
char32_t unallowedChar = partiallyMangledName[i];
partiallyMangledName.replace(i, 1, "_" + gd::String::From(unallowedChar));
}
}
return "GDExternalEvents"+partiallyMangledName;
return "GDExternalEvents" + partiallyMangledName;
}
gd::String ManObjListName(const gd::String & objectName)
{
return EventsCodeNameMangler::Get()->GetMangledObjectsListName(objectName);
gd::String ManObjListName(const gd::String &objectName) {
return EventsCodeNameMangler::Get()->GetMangledObjectsListName(objectName);
}
EventsCodeNameMangler * EventsCodeNameMangler::Get()
{
if ( NULL == _singleton )
_singleton = new EventsCodeNameMangler;
EventsCodeNameMangler *EventsCodeNameMangler::Get() {
if (NULL == _singleton) _singleton = new EventsCodeNameMangler;
return ( static_cast<EventsCodeNameMangler*>( _singleton ) );
return (static_cast<EventsCodeNameMangler *>(_singleton));
}
void EventsCodeNameMangler::DestroySingleton()
{
if ( NULL != _singleton )
{
delete _singleton;
_singleton = NULL;
}
void EventsCodeNameMangler::DestroySingleton() {
if (NULL != _singleton) {
delete _singleton;
_singleton = NULL;
}
}
#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)
#ifndef EVENTSCODENAMEMANGLER_H
@@ -13,36 +13,36 @@
*
* \see ManObjListName
*/
class GD_CORE_API EventsCodeNameMangler
{
public:
class GD_CORE_API EventsCodeNameMangler {
public:
/**
* Get the mangled name from a name : All characters that are not 0-9, a-z,
* A-Z or _ are replaced by "_"+AsciiCodeOfTheCharacter.
*/
gd::String GetMangledObjectsListName(const gd::String &originalObjectName);
/**
* Get the mangled name from a name : All characters that are not 0-9, a-z, A-Z or _ are replaced by "_"+AsciiCodeOfTheCharacter.
*/
gd::String GetMangledObjectsListName(const gd::String & originalObjectName);
/**
* Get the mangled function name to be used to call external events named \a
* externalEventsName.
*/
gd::String GetExternalEventsFunctionMangledName(
const gd::String &externalEventsName);
/**
* Get the mangled function name to be used to call external events named \a externalEventsName.
*/
gd::String GetExternalEventsFunctionMangledName(const gd::String & externalEventsName);
static EventsCodeNameMangler *Get();
static void DestroySingleton();
static EventsCodeNameMangler *Get();
static void DestroySingleton();
private:
EventsCodeNameMangler() {};
virtual ~EventsCodeNameMangler() {};
static EventsCodeNameMangler *_singleton;
private:
EventsCodeNameMangler(){};
virtual ~EventsCodeNameMangler(){};
static EventsCodeNameMangler *_singleton;
};
/**
* Shortcut to EventsCodeNameMangler::Get()->GetMangledObjectsListName(objectName).
* \see EventsCodeNameMangler
* \return Mangled object name
* Shortcut to
* EventsCodeNameMangler::Get()->GetMangledObjectsListName(objectName). \see
* EventsCodeNameMangler \return Mangled object name
*/
gd::String GD_CORE_API ManObjListName(const gd::String & objectName);
gd::String GD_CORE_API ManObjListName(const gd::String &objectName);
#endif // EVENTSCODENAMEMANGLER_H
#endif // EVENTSCODENAMEMANGLER_H
#endif

View File

@@ -1,34 +1,38 @@
/*
* 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 "AllBuiltinExtensions.h"
#include "GDCore/Tools/Localization.h"
using namespace std;
namespace gd
{
namespace gd {
void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAdvancedExtension(gd::PlatformExtension & extension)
{
extension.SetExtensionInformation("BuiltinAdvanced",
_("Advanced control features"),
_("Built-in extension providing advanced control features."),
"Florian Rival",
"Open source (MIT License)");
void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAdvancedExtension(
gd::PlatformExtension& extension) {
extension
.SetExtensionInformation(
"BuiltinAdvanced",
_("Advanced control features"),
_("Built-in extension providing advanced control features."),
"Florian Rival",
"Open source (MIT License)")
.SetExtensionHelpPath("" /*TODO: Add a documentation page for this */);
#if defined(GD_IDE_ONLY)
extension.AddCondition("Toujours",
_("Always"),
_("This condition always returns true (or always false, if the condition is inverted)."),
_("Always"),
_("Other"),
"res/conditions/toujours24.png",
"res/conditions/toujours.png")
.AddCodeOnlyParameter("conditionInverted", "")
.MarkAsAdvanced();
#endif
#if defined(GD_IDE_ONLY)
extension
.AddCondition("Toujours",
_("Always"),
_("This condition always returns true (or always false, if "
"the condition is inverted)."),
_("Always"),
_("Other"),
"res/conditions/toujours24.png",
"res/conditions/toujours.png")
.AddCodeOnlyParameter("conditionInverted", "")
.MarkAsAdvanced();
#endif
}
}
} // namespace gd

View File

@@ -1,15 +1,14 @@
/*
* 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_COMMONINSTRUCTIONSEXTENSION_H
#define GDCORE_COMMONINSTRUCTIONSEXTENSION_H
#include "GDCore/Extensions/PlatformExtension.h"
namespace gd
{
namespace gd {
/**
* \brief Tool class containing static methods to setup an extension
@@ -20,30 +19,34 @@ namespace gd
*
* \ingroup BuiltinExtensions
*/
class GD_CORE_API BuiltinExtensionsImplementer
{
public:
static void ImplementsAdvancedExtension(gd::PlatformExtension & extension);
static void ImplementsAudioExtension(gd::PlatformExtension & extension);
static void ImplementsBaseObjectExtension(gd::PlatformExtension & extension);
static void ImplementsCameraExtension(gd::PlatformExtension & extension);
static void ImplementsCommonConversionsExtension(gd::PlatformExtension & extension);
static void ImplementsCommonInstructionsExtension(gd::PlatformExtension & extension);
static void ImplementsExternalLayoutsExtension(gd::PlatformExtension & extension);
static void ImplementsFileExtension(gd::PlatformExtension & extension);
static void ImplementsJoystickExtension(gd::PlatformExtension & extension);
static void ImplementsKeyboardExtension(gd::PlatformExtension & extension);
static void ImplementsMathematicalToolsExtension(gd::PlatformExtension & extension);
static void ImplementsMouseExtension(gd::PlatformExtension & extension);
static void ImplementsNetworkExtension(gd::PlatformExtension & extension);
static void ImplementsSceneExtension(gd::PlatformExtension & extension);
static void ImplementsSpriteExtension(gd::PlatformExtension & extension);
static void ImplementsStringInstructionsExtension(gd::PlatformExtension & extension);
static void ImplementsTimeExtension(gd::PlatformExtension & extension);
static void ImplementsVariablesExtension(gd::PlatformExtension & extension);
static void ImplementsWindowExtension(gd::PlatformExtension & extension);
class GD_CORE_API BuiltinExtensionsImplementer {
public:
static void ImplementsAdvancedExtension(gd::PlatformExtension& extension);
static void ImplementsAudioExtension(gd::PlatformExtension& extension);
static void ImplementsBaseObjectExtension(gd::PlatformExtension& extension);
static void ImplementsCameraExtension(gd::PlatformExtension& extension);
static void ImplementsCommonConversionsExtension(
gd::PlatformExtension& extension);
static void ImplementsCommonInstructionsExtension(
gd::PlatformExtension& extension);
static void ImplementsExternalLayoutsExtension(
gd::PlatformExtension& extension);
static void ImplementsFileExtension(gd::PlatformExtension& extension);
static void ImplementsJoystickExtension(gd::PlatformExtension& extension);
static void ImplementsKeyboardExtension(gd::PlatformExtension& extension);
static void ImplementsMathematicalToolsExtension(
gd::PlatformExtension& extension);
static void ImplementsMouseExtension(gd::PlatformExtension& extension);
static void ImplementsNetworkExtension(gd::PlatformExtension& extension);
static void ImplementsSceneExtension(gd::PlatformExtension& extension);
static void ImplementsSpriteExtension(gd::PlatformExtension& extension);
static void ImplementsStringInstructionsExtension(
gd::PlatformExtension& extension);
static void ImplementsTimeExtension(gd::PlatformExtension& extension);
static void ImplementsVariablesExtension(gd::PlatformExtension& extension);
static void ImplementsWindowExtension(gd::PlatformExtension& extension);
};
}
} // namespace gd
#endif // GDCORE_COMMONINSTRUCTIONSEXTENSION_H
#endif // GDCORE_COMMONINSTRUCTIONSEXTENSION_H

View File

@@ -1,435 +1,547 @@
/*
* 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 "AllBuiltinExtensions.h"
#include "GDCore/Tools/Localization.h"
using namespace std;
namespace gd
{
namespace gd {
void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(gd::PlatformExtension & extension)
{
extension.SetExtensionInformation("BuiltinAudio",
_("Audio"),
_("Builtin audio extension"),
"Florian Rival",
"Open source (MIT License)");
void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
gd::PlatformExtension& extension) {
extension
.SetExtensionInformation("BuiltinAudio",
_("Audio"),
_("Builtin audio extension"),
"Florian Rival",
"Open source (MIT License)")
.SetExtensionHelpPath("/all-features/audio");
#if defined(GD_IDE_ONLY)
extension.AddAction("PlaySoundCanal",
_("Play a sound on a channel"),
_("Play a sound (small audio file) on a specific channel,\nso you'll be able to manipulate it."),
_("Play the sound _PARAM1_ on the channel _PARAM2_, vol.: _PARAM4_, loop: _PARAM3_"),
_("Audio/Sounds on channels"),
"res/actions/son24.png",
"res/actions/son.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("soundfile", _("Audio file (or audio resource name)"))
.AddParameter("expression", _("Channel identifier"))
.AddParameter("yesorno", _("Repeat the sound"), "",true).SetDefaultValue("no")
.AddParameter("expression", _("Volume (from 0 to 100, 100 by default)"), "",true).SetDefaultValue("100")
.AddParameter("expression", _("Pitch (speed) (1 by default)"), "",true).SetDefaultValue("1")
.MarkAsAdvanced();
#if defined(GD_IDE_ONLY)
extension
.AddAction("PlaySoundCanal",
_("Play a sound on a channel"),
_("Play a sound (small audio file) on a specific channel,\nso "
"you'll be able to manipulate it."),
_("Play the sound _PARAM1_ on the channel _PARAM2_, vol.: "
"_PARAM4_, loop: _PARAM3_"),
_("Audio/Sounds on channels"),
"res/actions/son24.png",
"res/actions/son.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("soundfile", _("Audio file (or audio resource name)"))
.AddParameter("expression", _("Channel identifier"))
.AddParameter("yesorno", _("Repeat the sound"), "", true)
.SetDefaultValue("no")
.AddParameter(
"expression", _("Volume (from 0 to 100, 100 by default)"), "", true)
.SetDefaultValue("100")
.AddParameter("expression", _("Pitch (speed) (1 by default)"), "", true)
.SetDefaultValue("1")
.MarkAsAdvanced();
extension.AddAction("StopSoundCanal",
_("Stop the sound of a channel"),
_("Stop the sound on the specified channel."),
_("Stop the sound of channel _PARAM1_"),
_("Audio/Sounds on channels"),
"res/actions/son24.png",
"res/actions/son.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.MarkAsAdvanced();
extension
.AddAction("StopSoundCanal",
_("Stop the sound of a channel"),
_("Stop the sound on the specified channel."),
_("Stop the sound of channel _PARAM1_"),
_("Audio/Sounds on channels"),
"res/actions/son24.png",
"res/actions/son.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.MarkAsAdvanced();
extension.AddAction("PauseSoundCanal",
_("Pause the sound of a channel"),
_("Pause the sound played on the specified channel."),
_("Pause the sound of channel _PARAM1_"),
_("Audio/Sounds on channels"),
"res/actions/son24.png",
"res/actions/son.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.MarkAsAdvanced();
extension
.AddAction("PauseSoundCanal",
_("Pause the sound of a channel"),
_("Pause the sound played on the specified channel."),
_("Pause the sound of channel _PARAM1_"),
_("Audio/Sounds on channels"),
"res/actions/son24.png",
"res/actions/son.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.MarkAsAdvanced();
extension.AddAction("RePlaySoundCanal",
_("Play the sound of a channel"),
_("Play the sound of the channel."),
_("Play the sound of channel _PARAM1_"),
_("Audio/Sounds on channels"),
"res/actions/son24.png",
"res/actions/son.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.MarkAsAdvanced();
extension
.AddAction("RePlaySoundCanal",
_("Play the sound of a channel"),
_("Play the sound of the channel."),
_("Play the sound of channel _PARAM1_"),
_("Audio/Sounds on channels"),
"res/actions/son24.png",
"res/actions/son.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.MarkAsAdvanced();
extension.AddAction("PlayMusicCanal",
_("Play a music file on a channel"),
_("Play a music file on a specific channel,\nso you'll be able to interact with it later."),
_("Play the music _PARAM1_ on channel _PARAM2_, vol.: _PARAM4_, loop: _PARAM3_"),
_("Audio/Music on channels"),
"res/actions/music24.png",
"res/actions/music.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("musicfile", _("Audio file (or audio resource name)"))
.AddParameter("expression", _("Channel identifier"))
.AddParameter("yesorno", _("Repeat the sound"), "",true).SetDefaultValue("no")
.AddParameter("expression", _("Volume (from 0 to 100, 100 by default)"), "",true).SetDefaultValue("100")
.AddParameter("expression", _("Pitch (speed) (1 by default)"), "",true).SetDefaultValue("1")
.MarkAsAdvanced();
extension
.AddAction("PlayMusicCanal",
_("Play a music file on a channel"),
_("Play a music file on a specific channel,\nso you'll be "
"able to interact with it later."),
_("Play the music _PARAM1_ on channel _PARAM2_, vol.: "
"_PARAM4_, loop: _PARAM3_"),
_("Audio/Music on channels"),
"res/actions/music24.png",
"res/actions/music.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("musicfile", _("Audio file (or audio resource name)"))
.AddParameter("expression", _("Channel identifier"))
.AddParameter("yesorno", _("Repeat the sound"), "", true)
.SetDefaultValue("no")
.AddParameter(
"expression", _("Volume (from 0 to 100, 100 by default)"), "", true)
.SetDefaultValue("100")
.AddParameter("expression", _("Pitch (speed) (1 by default)"), "", true)
.SetDefaultValue("1")
.MarkAsAdvanced();
extension.AddAction("StopMusicCanal",
_("Stop the music on a channel"),
_("Stop the music on the specified channel"),
_("Stop the music of channel _PARAM1_"),
_("Audio/Music on channels"),
"res/actions/music24.png",
"res/actions/music.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.MarkAsAdvanced();
extension
.AddAction("StopMusicCanal",
_("Stop the music on a channel"),
_("Stop the music on the specified channel"),
_("Stop the music of channel _PARAM1_"),
_("Audio/Music on channels"),
"res/actions/music24.png",
"res/actions/music.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.MarkAsAdvanced();
extension.AddAction("PauseMusicCanal",
_("Pause the music of a channel"),
_("Pause the music on the specified channel."),
_("Pause the music of channel _PARAM1_"),
_("Audio/Music on channels"),
"res/actions/music24.png",
"res/actions/music.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.MarkAsAdvanced();
extension
.AddAction("PauseMusicCanal",
_("Pause the music of a channel"),
_("Pause the music on the specified channel."),
_("Pause the music of channel _PARAM1_"),
_("Audio/Music on channels"),
"res/actions/music24.png",
"res/actions/music.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.MarkAsAdvanced();
extension.AddAction("RePlayMusicCanal",
_("Play the music of a channel"),
_("Play the music of the channel."),
_("Play the music of channel _PARAM1_"),
_("Audio/Music on channels"),
"res/actions/music24.png",
"res/actions/music.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.MarkAsAdvanced();
extension
.AddAction("RePlayMusicCanal",
_("Play the music of a channel"),
_("Play the music of the channel."),
_("Play the music of channel _PARAM1_"),
_("Audio/Music on channels"),
"res/actions/music24.png",
"res/actions/music.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.MarkAsAdvanced();
extension.AddAction("ModVolumeSoundCanal",
_("Volume of the sound on a channel"),
_("This action modifies the volume of the sound on the specified channel. The volume is between 0 and 100."),
_("Do _PARAM2__PARAM3_ to the volume of the sound on channel _PARAM1_"),
_("Audio/Sounds on channels"),
"res/actions/sonVolume24.png",
"res/actions/sonVolume.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.AddParameter("operator", _("Modification's sign"))
.AddParameter("expression", _("Value"))
.MarkAsAdvanced()
.SetManipulatedType("number");
extension
.AddAction("ModVolumeSoundCanal",
_("Volume of the sound on a channel"),
_("This action modifies the volume of the sound on the "
"specified channel. The volume is between 0 and 100."),
_("Do _PARAM2__PARAM3_ to the volume of the sound on channel "
"_PARAM1_"),
_("Audio/Sounds on channels"),
"res/actions/sonVolume24.png",
"res/actions/sonVolume.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.AddParameter("operator", _("Modification's sign"))
.AddParameter("expression", _("Value"))
.MarkAsAdvanced()
.SetManipulatedType("number");
extension.AddAction("ModVolumeMusicCanal",
_("Volume of the music on a channel"),
_("This action modifies the volume of the music on the specified channel. The volume is between 0 and 100."),
_("Do _PARAM2__PARAM3_ to the volume of the music on channel _PARAM1_"),
_("Audio/Music on channels"),
"res/actions/musicVolume24.png",
"res/actions/musicVolume.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.AddParameter("operator", _("Modification's sign"))
.AddParameter("expression", _("Value"))
.MarkAsAdvanced()
.SetManipulatedType("number");
extension
.AddAction("ModVolumeMusicCanal",
_("Volume of the music on a channel"),
_("This action modifies the volume of the music on the "
"specified channel. The volume is between 0 and 100."),
_("Do _PARAM2__PARAM3_ to the volume of the music on channel "
"_PARAM1_"),
_("Audio/Music on channels"),
"res/actions/musicVolume24.png",
"res/actions/musicVolume.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.AddParameter("operator", _("Modification's sign"))
.AddParameter("expression", _("Value"))
.MarkAsAdvanced()
.SetManipulatedType("number");
extension.AddAction("ModGlobalVolume",
_("Game global volume"),
_("This action modifies the global volume of the game. The volume is between 0 and 100."),
_("Do _PARAM1__PARAM2_ to global sound level"),
_("Audio"),
"res/actions/volume24.png",
"res/actions/volume.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("operator", _("Modification's sign"))
.AddParameter("expression", _("Value"))
.MarkAsSimple()
.SetManipulatedType("number");
extension
.AddAction("ModGlobalVolume",
_("Game global volume"),
_("This action modifies the global volume of the game. The "
"volume is between 0 and 100."),
_("Do _PARAM1__PARAM2_ to global sound level"),
_("Audio"),
"res/actions/volume24.png",
"res/actions/volume.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("operator", _("Modification's sign"))
.AddParameter("expression", _("Value"))
.MarkAsSimple()
.SetManipulatedType("number");
extension.AddAction("ModPitchSoundChannel",
_("Pitch of the sound of a channel"),
_("This action modifies the pitch (speed) of the sound on a channel.\n1 is the default pitch."),
_("Do _PARAM2__PARAM3_ to the pitch of the sound on channel _PARAM1_"),
_("Audio/Sounds on channels"),
"res/actions/son24.png",
"res/actions/son.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.AddParameter("operator", _("Modification's sign"))
.AddParameter("expression", _("Value"))
.MarkAsAdvanced()
.SetManipulatedType("number");
extension
.AddAction("ModPitchSoundChannel",
_("Pitch of the sound of a channel"),
_("This action modifies the pitch (speed) of the sound on a "
"channel.\n1 is the default pitch."),
_("Do _PARAM2__PARAM3_ to the pitch of the sound on channel "
"_PARAM1_"),
_("Audio/Sounds on channels"),
"res/actions/son24.png",
"res/actions/son.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.AddParameter("operator", _("Modification's sign"))
.AddParameter("expression", _("Value"))
.MarkAsAdvanced()
.SetManipulatedType("number");
extension.AddAction("ModPitchMusicChannel",
_("Pitch of the music on a channel"),
_("This action modifies the pitch of the music on the specified channel. 1 is the default pitch"),
_("Do _PARAM2__PARAM3_ to the pitch of the music on channel _PARAM1_"),
_("Audio/Music on channels"),
"res/actions/music24.png",
"res/actions/music.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.AddParameter("operator", _("Modification's sign"))
.AddParameter("expression", _("Value"))
.MarkAsAdvanced()
.SetManipulatedType("number");
extension
.AddAction("ModPitchMusicChannel",
_("Pitch of the music on a channel"),
_("This action modifies the pitch of the music on the "
"specified channel. 1 is the default pitch"),
_("Do _PARAM2__PARAM3_ to the pitch of the music on channel "
"_PARAM1_"),
_("Audio/Music on channels"),
"res/actions/music24.png",
"res/actions/music.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.AddParameter("operator", _("Modification's sign"))
.AddParameter("expression", _("Value"))
.MarkAsAdvanced()
.SetManipulatedType("number");
extension.AddAction("ModPlayingOffsetSoundChannel",
_("Playing offset of the sound on a channel"),
_("This action modifies the playing offset of the sound on a channel"),
_("Do _PARAM2__PARAM3_ to the playing offset of the sound on channel _PARAM1_"),
_("Audio/Sounds on channels"),
"res/actions/son24.png",
"res/actions/son.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.AddParameter("operator", _("Modification's sign"))
.AddParameter("expression", _("Value"))
.MarkAsAdvanced()
.SetManipulatedType("number");
extension
.AddAction("ModPlayingOffsetSoundChannel",
_("Playing offset of the sound on a channel"),
_("This action modifies the playing offset of the sound on a "
"channel"),
_("Do _PARAM2__PARAM3_ to the playing offset of the sound on "
"channel _PARAM1_"),
_("Audio/Sounds on channels"),
"res/actions/son24.png",
"res/actions/son.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.AddParameter("operator", _("Modification's sign"))
.AddParameter("expression", _("Value"))
.MarkAsAdvanced()
.SetManipulatedType("number");
extension.AddAction("ModPlayingOffsetMusicChannel",
_("Playing offset of the music on a channel"),
_("This action modifies the playing offset of the music on the specified channel"),
_("Do _PARAM2__PARAM3_ to the playing offset of the music on channel _PARAM1_"),
_("Audio/Music on channels"),
"res/actions/music24.png",
"res/actions/music.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.AddParameter("operator", _("Modification's sign"))
.AddParameter("expression", _("Value"))
.MarkAsAdvanced()
.SetManipulatedType("number");
extension
.AddAction("ModPlayingOffsetMusicChannel",
_("Playing offset of the music on a channel"),
_("This action modifies the playing offset of the music on "
"the specified channel"),
_("Do _PARAM2__PARAM3_ to the playing offset of the music on "
"channel _PARAM1_"),
_("Audio/Music on channels"),
"res/actions/music24.png",
"res/actions/music.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.AddParameter("operator", _("Modification's sign"))
.AddParameter("expression", _("Value"))
.MarkAsAdvanced()
.SetManipulatedType("number");
extension.AddAction("PlaySound",
_("Play a sound"),
_("Play a sound."),
_("Play the sound _PARAM1_, vol.: _PARAM3_, loop: _PARAM2_)"),
_("Audio"),
"res/actions/son24.png",
"res/actions/son.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("soundfile", _("Audio file (or audio resource name)"))
.AddParameter("yesorno", _("Repeat the sound"), "",true).SetDefaultValue("no")
.AddParameter("expression", _("Volume (from 0 to 100, 100 by default)"), "",true).SetDefaultValue("100")
.AddParameter("expression", _("Pitch (speed) (1 by default)"), "",true).SetDefaultValue("1")
.MarkAsSimple();
extension
.AddAction("PlaySound",
_("Play a sound"),
_("Play a sound."),
_("Play the sound _PARAM1_, vol.: _PARAM3_, loop: _PARAM2_)"),
_("Audio"),
"res/actions/son24.png",
"res/actions/son.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("soundfile", _("Audio file (or audio resource name)"))
.AddParameter("yesorno", _("Repeat the sound"), "", true)
.SetDefaultValue("no")
.AddParameter(
"expression", _("Volume (from 0 to 100, 100 by default)"), "", true)
.SetDefaultValue("100")
.AddParameter("expression", _("Pitch (speed) (1 by default)"), "", true)
.SetDefaultValue("1")
.MarkAsSimple();
extension.AddAction("PlayMusic",
_("Play a music file"),
_("Play a music file."),
_("Play the music _PARAM1_, vol.: _PARAM3_, loop: _PARAM2_)"),
_("Audio"),
"res/actions/music24.png",
"res/actions/music.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("musicfile", _("Audio file (or audio resource name)"))
.AddParameter("yesorno", _("Repeat the sound"), "",true).SetDefaultValue("no")
.AddParameter("expression", _("Volume (from 0 to 100, 100 by default)"), "",true).SetDefaultValue("100")
.AddParameter("expression", _("Pitch (speed) (1 by default)"), "",true).SetDefaultValue("1")
.MarkAsSimple();
extension
.AddAction("PlayMusic",
_("Play a music file"),
_("Play a music file."),
_("Play the music _PARAM1_, vol.: _PARAM3_, loop: _PARAM2_)"),
_("Audio"),
"res/actions/music24.png",
"res/actions/music.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("musicfile", _("Audio file (or audio resource name)"))
.AddParameter("yesorno", _("Repeat the sound"), "", true)
.SetDefaultValue("no")
.AddParameter(
"expression", _("Volume (from 0 to 100, 100 by default)"), "", true)
.SetDefaultValue("100")
.AddParameter("expression", _("Pitch (speed) (1 by default)"), "", true)
.SetDefaultValue("1")
.MarkAsSimple();
extension.AddCondition("MusicPlaying",
_("A music file is being played"),
_("Test if the music on a channel is being played"),
_("Music on channel _PARAM1_ is being played"),
_("Audio/Music on channels"),
"res/conditions/musicplaying24.png",
"res/conditions/musicplaying.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel"))
.MarkAsAdvanced();
extension
.AddCondition("MusicPlaying",
_("A music file is being played"),
_("Test if the music on a channel is being played"),
_("Music on channel _PARAM1_ is being played"),
_("Audio/Music on channels"),
"res/conditions/musicplaying24.png",
"res/conditions/musicplaying.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel"))
.MarkAsAdvanced();
extension.AddCondition("MusicPaused",
_("A music file is paused"),
_("Test if the music on the specified channel is paused."),
_("Music on channel _PARAM1_ is paused"),
_("Audio/Music on channels"),
"res/conditions/musicpaused24.png",
"res/conditions/musicpaused.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel"))
.MarkAsAdvanced();
extension
.AddCondition("MusicPaused",
_("A music file is paused"),
_("Test if the music on the specified channel is paused."),
_("Music on channel _PARAM1_ is paused"),
_("Audio/Music on channels"),
"res/conditions/musicpaused24.png",
"res/conditions/musicpaused.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel"))
.MarkAsAdvanced();
extension.AddCondition("MusicStopped",
_("A music file is stopped"),
_("Test if the music on the specified channel is stopped."),
_("Music on channel _PARAM1_ is stopped"),
_("Audio/Music on channels"),
"res/conditions/musicstopped24.png",
"res/conditions/musicstopped.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel"))
.MarkAsAdvanced();
extension
.AddCondition("MusicStopped",
_("A music file is stopped"),
_("Test if the music on the specified channel is stopped."),
_("Music on channel _PARAM1_ is stopped"),
_("Audio/Music on channels"),
"res/conditions/musicstopped24.png",
"res/conditions/musicstopped.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel"))
.MarkAsAdvanced();
extension.AddCondition("SoundPlaying",
_("A sound is being played"),
_("Test if the sound on a channel is being played."),
_("Sound on channel _PARAM1_ is being played"),
_("Audio/Sounds on channels"),
"res/conditions/sonplaying24.png",
"res/conditions/sonplaying.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel"))
.MarkAsAdvanced();
extension
.AddCondition("SoundPlaying",
_("A sound is being played"),
_("Test if the sound on a channel is being played."),
_("Sound on channel _PARAM1_ is being played"),
_("Audio/Sounds on channels"),
"res/conditions/sonplaying24.png",
"res/conditions/sonplaying.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel"))
.MarkAsAdvanced();
extension.AddCondition("SoundPaused",
_("A sound is paused"),
_("Test if the sound on the specified channel is paused."),
_("Sound on channel _PARAM1_ is paused"),
_("Audio/Sounds on channels"),
"res/conditions/sonpaused24.png",
"res/conditions/sonpaused.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel"))
.MarkAsAdvanced();
extension
.AddCondition("SoundPaused",
_("A sound is paused"),
_("Test if the sound on the specified channel is paused."),
_("Sound on channel _PARAM1_ is paused"),
_("Audio/Sounds on channels"),
"res/conditions/sonpaused24.png",
"res/conditions/sonpaused.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel"))
.MarkAsAdvanced();
extension.AddCondition("SoundStopped",
_("A sound is stopped"),
_("Test if the sound on the specified channel is stopped."),
_("Sound on channel _PARAM1_ is stopped"),
_("Audio/Sounds on channels"),
"res/conditions/sonstopped24.png",
"res/conditions/sonstopped.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel"))
.MarkAsAdvanced();
extension
.AddCondition("SoundStopped",
_("A sound is stopped"),
_("Test if the sound on the specified channel is stopped."),
_("Sound on channel _PARAM1_ is stopped"),
_("Audio/Sounds on channels"),
"res/conditions/sonstopped24.png",
"res/conditions/sonstopped.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel"))
.MarkAsAdvanced();
extension.AddCondition("SoundCanalVolume",
_("Volume of the sound on a channel"),
_("Test the volume of the sound on the specified channel. The volume is between 0 and 100."),
_("The volume of the sound on channel _PARAM1_ is _PARAM2__PARAM3_"),
_("Audio/Sounds on channels"),
"res/conditions/sonVolume24.png",
"res/conditions/sonVolume.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("Volume to test"))
.MarkAsAdvanced()
.SetManipulatedType("number");
extension
.AddCondition(
"SoundCanalVolume",
_("Volume of the sound on a channel"),
_("Test the volume of the sound on the specified channel. The volume "
"is between 0 and 100."),
_("The volume of the sound on channel _PARAM1_ is _PARAM2__PARAM3_"),
_("Audio/Sounds on channels"),
"res/conditions/sonVolume24.png",
"res/conditions/sonVolume.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("Volume to test"))
.MarkAsAdvanced()
.SetManipulatedType("number");
extension.AddCondition("MusicCanalVolume",
_("Volume of the music on a channel"),
_("Test the volume of the music on a specified channel. The volume is between 0 and 100."),
_("The volume of the music on channel _PARAM1_ is _PARAM2__PARAM3_"),
_("Audio/Music on channels"),
"res/conditions/musicVolume24.png",
"res/conditions/musicVolume.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("Volume to test"))
.MarkAsAdvanced()
.SetManipulatedType("number");
extension
.AddCondition(
"MusicCanalVolume",
_("Volume of the music on a channel"),
_("Test the volume of the music on a specified channel. The volume "
"is between 0 and 100."),
_("The volume of the music on channel _PARAM1_ is _PARAM2__PARAM3_"),
_("Audio/Music on channels"),
"res/conditions/musicVolume24.png",
"res/conditions/musicVolume.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("Volume to test"))
.MarkAsAdvanced()
.SetManipulatedType("number");
extension.AddCondition("GlobalVolume",
_("Global volume"),
_("Test the global sound level. The volume is between 0 and 100."),
_("The global game volume is _PARAM1__PARAM2_"),
_("Audio"),
"res/conditions/volume24.png",
"res/conditions/volume.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("Volume to test"))
.SetManipulatedType("number");
extension
.AddCondition(
"GlobalVolume",
_("Global volume"),
_("Test the global sound level. The volume is between 0 and 100."),
_("The global game volume is _PARAM1__PARAM2_"),
_("Audio"),
"res/conditions/volume24.png",
"res/conditions/volume.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("Volume to test"))
.SetManipulatedType("number");
extension.AddCondition("SoundChannelPitch",
_("Pitch of the sound of a channel"),
_("Test the pitch of the sound on the specified channel. 1 is the default pitch."),
_("The pitch of the sound on channel _PARAM1_ is _PARAM2__PARAM3_"),
_("Audio/Sounds on channels"),
"res/conditions/sonVolume24.png",
"res/conditions/sonVolume.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("Pitch to test"))
.MarkAsAdvanced()
.SetManipulatedType("number");
extension
.AddCondition(
"SoundChannelPitch",
_("Pitch of the sound of a channel"),
_("Test the pitch of the sound on the specified channel. 1 is the "
"default pitch."),
_("The pitch of the sound on channel _PARAM1_ is _PARAM2__PARAM3_"),
_("Audio/Sounds on channels"),
"res/conditions/sonVolume24.png",
"res/conditions/sonVolume.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("Pitch to test"))
.MarkAsAdvanced()
.SetManipulatedType("number");
extension.AddCondition("MusicChannelPitch",
_("Pitch of the music on a channel"),
_("Test the pitch (speed) of the music on a specified channel. 1 is the default pitch."),
_("The pitch of the music on channel _PARAM1_ is _PARAM2__PARAM3_"),
_("Audio/Music on channels"),
"res/conditions/musicVolume24.png",
"res/conditions/musicVolume.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("Pitch to test"))
.MarkAsAdvanced()
.SetManipulatedType("number");
extension
.AddCondition(
"MusicChannelPitch",
_("Pitch of the music on a channel"),
_("Test the pitch (speed) of the music on a specified channel. 1 is "
"the default pitch."),
_("The pitch of the music on channel _PARAM1_ is _PARAM2__PARAM3_"),
_("Audio/Music on channels"),
"res/conditions/musicVolume24.png",
"res/conditions/musicVolume.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("Pitch to test"))
.MarkAsAdvanced()
.SetManipulatedType("number");
extension.AddCondition("SoundChannelPlayingOffset",
_("Playing offset of the sound on a channel"),
_("Test the playing offset of the sound on the specified channel."),
_("The playing offset of the sound on channel _PARAM1_ is _PARAM2__PARAM3_"),
_("Audio/Sounds on channels"),
"res/conditions/sonVolume24.png",
"res/conditions/sonVolume.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("Playing position (in seconds)"))
.MarkAsAdvanced()
.SetManipulatedType("number");
extension
.AddCondition(
"SoundChannelPlayingOffset",
_("Playing offset of the sound on a channel"),
_("Test the playing offset of the sound on the specified channel."),
_("The playing offset of the sound on channel _PARAM1_ is "
"_PARAM2__PARAM3_"),
_("Audio/Sounds on channels"),
"res/conditions/sonVolume24.png",
"res/conditions/sonVolume.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("Playing position (in seconds)"))
.MarkAsAdvanced()
.SetManipulatedType("number");
extension.AddCondition("MusicChannelPlayingOffset",
_("Playing offset of the music on a channel"),
_("Test the playing offset of the music on the specified channel."),
_("The playing offset of the music on channel _PARAM1_ is _PARAM2__PARAM3_"),
_("Audio/Music on channels"),
"res/conditions/musicVolume24.png",
"res/conditions/musicVolume.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("Playing position (in seconds)"))
.MarkAsAdvanced()
.SetManipulatedType("number");
extension
.AddCondition(
"MusicChannelPlayingOffset",
_("Playing offset of the music on a channel"),
_("Test the playing offset of the music on the specified channel."),
_("The playing offset of the music on channel _PARAM1_ is "
"_PARAM2__PARAM3_"),
_("Audio/Music on channels"),
"res/conditions/musicVolume24.png",
"res/conditions/musicVolume.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("Playing position (in seconds)"))
.MarkAsAdvanced()
.SetManipulatedType("number");
extension.AddExpression("SoundChannelPlayingOffset", _("Sound playing offset"), _("Sound playing offset"), _("Sounds"), "res/actions/son.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel"));
extension
.AddExpression("SoundChannelPlayingOffset",
_("Sound playing offset"),
_("Sound playing offset"),
_("Sounds"),
"res/actions/son.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel"));
extension.AddExpression("MusicChannelPlayingOffset", _("Music playing offset"), _("Music playing offset"), _("Music"), "res/actions/music.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel"));
extension
.AddExpression("MusicChannelPlayingOffset",
_("Music playing offset"),
_("Music playing offset"),
_("Music"),
"res/actions/music.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel"));
extension.AddExpression("SoundChannelVolume", _("Sound volume"), _("Sound volume"), _("Sounds"), "res/actions/son.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel"));
extension
.AddExpression("SoundChannelVolume",
_("Sound volume"),
_("Sound volume"),
_("Sounds"),
"res/actions/son.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel"));
extension.AddExpression("MusicChannelVolume", _("Music volume"), _("Music volume"), _("Music"), "res/actions/music.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel"));
extension
.AddExpression("MusicChannelVolume",
_("Music volume"),
_("Music volume"),
_("Music"),
"res/actions/music.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel"));
extension.AddExpression("SoundChannelPitch", _("Sound's pitch"), _("Sound's pitch"), _("Sounds"), "res/actions/son.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel"));
extension
.AddExpression("SoundChannelPitch",
_("Sound's pitch"),
_("Sound's pitch"),
_("Sounds"),
"res/actions/son.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel"));
extension.AddExpression("MusicChannelPitch", _("Music's pitch"), _("Music's pitch"), _("Music"), "res/actions/music.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel"));
extension
.AddExpression("MusicChannelPitch",
_("Music's pitch"),
_("Music's pitch"),
_("Music"),
"res/actions/music.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel"));
extension.AddExpression("GlobalVolume", _("Global volume"), _("Global volume value"), _("Sound level"), "res/conditions/volume.png")
.AddCodeOnlyParameter("currentScene", "");
extension
.AddExpression("GlobalVolume",
_("Global volume"),
_("Global volume value"),
_("Sound level"),
"res/conditions/volume.png")
.AddCodeOnlyParameter("currentScene", "");
#endif
#endif
}
}
} // namespace gd

File diff suppressed because it is too large Load Diff

View File

@@ -1,385 +1,585 @@
/*
* 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 "AllBuiltinExtensions.h"
#include "GDCore/Tools/Localization.h"
using namespace std;
namespace gd
{
namespace gd {
void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(gd::PlatformExtension & extension)
{
extension.SetExtensionInformation("BuiltinCamera",
_("Cameras and layers features"),
_("Built-in camera extension"),
"Florian Rival",
"Open source (MIT License)");
void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
gd::PlatformExtension& extension) {
extension
.SetExtensionInformation("BuiltinCamera",
_("Cameras and layers features"),
_("Built-in camera extension"),
"Florian Rival",
"Open source (MIT License)")
.SetExtensionHelpPath("" /*TODO: Add a documentation page for this */);
#if defined(GD_IDE_ONLY)
extension.AddCondition("CameraX",
_("Camera center X position"),
_("Compare the X position of the center of a camera."),
_("X position of camera _PARAM4_ is _PARAM1__PARAM2_ (layer: _PARAM3_)"),
_("Layers and cameras"),
"res/conditions/camera24.png",
"res/conditions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("Value to test"))
.AddParameter("layer", _("Layer (base layer if empty)"), "",true).SetDefaultValue("\"\"")
.AddParameter("expression", _("Camera number (default : 0)"), "",true).SetDefaultValue("0")
.MarkAsAdvanced()
.SetManipulatedType("number");
#if defined(GD_IDE_ONLY)
extension
.AddCondition("CameraX",
_("Camera center X position"),
_("Compare the X position of the center of a camera."),
_("X position of camera _PARAM4_ is _PARAM1__PARAM2_ "
"(layer: _PARAM3_)"),
_("Layers and cameras"),
"res/conditions/camera24.png",
"res/conditions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("Value to test"))
.AddParameter("layer", _("Layer (base layer if empty)"), "", true)
.SetDefaultValue("\"\"")
.AddParameter("expression", _("Camera number (default : 0)"), "", true)
.SetDefaultValue("0")
.MarkAsAdvanced()
.SetManipulatedType("number");
extension.AddCondition("CameraY",
_("Camera center Y position"),
_("Compare the Y position of the center of a camera."),
_("The Y position of camera _PARAM4_ is _PARAM1__PARAM2_ (layer: _PARAM3_)"),
_("Layers and cameras"),
"res/conditions/camera24.png",
"res/conditions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("Value to test"))
.AddParameter("layer", _("Layer (base layer if empty)")).SetDefaultValue("\"\"")
.AddParameter("expression", _("Camera number (default : 0)")).SetDefaultValue("0")
.MarkAsAdvanced()
.SetManipulatedType("number");
extension
.AddCondition("CameraY",
_("Camera center Y position"),
_("Compare the Y position of the center of a camera."),
_("The Y position of camera _PARAM4_ is _PARAM1__PARAM2_ "
"(layer: _PARAM3_)"),
_("Layers and cameras"),
"res/conditions/camera24.png",
"res/conditions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("Value to test"))
.AddParameter("layer", _("Layer (base layer if empty)"))
.SetDefaultValue("\"\"")
.AddParameter("expression", _("Camera number (default : 0)"))
.SetDefaultValue("0")
.MarkAsAdvanced()
.SetManipulatedType("number");
extension.AddAction("CameraX",
_("Camera center X position"),
_("Change the X position of the center of the specified camera."),
_("Do _PARAM1__PARAM2_ to X position of camera _PARAM4_ (layer: _PARAM3_)"),
_("Layers and cameras"),
"res/conditions/camera24.png",
"res/conditions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("operator", _("Modification's sign"))
.AddParameter("expression", _("Value"))
.AddParameter("layer", _("Layer (base layer if empty)"), "",true).SetDefaultValue("\"\"")
.AddParameter("expression", _("Camera number (default : 0)"), "",true).SetDefaultValue("0")
.MarkAsAdvanced()
.SetManipulatedType("number");
extension
.AddAction(
"CameraX",
_("Camera center X position"),
_("Change the X position of the center of the specified camera."),
_("Do _PARAM1__PARAM2_ to X position of camera _PARAM4_ (layer: "
"_PARAM3_)"),
_("Layers and cameras"),
"res/conditions/camera24.png",
"res/conditions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("operator", _("Modification's sign"))
.AddParameter("expression", _("Value"))
.AddParameter("layer", _("Layer (base layer if empty)"), "", true)
.SetDefaultValue("\"\"")
.AddParameter("expression", _("Camera number (default : 0)"), "", true)
.SetDefaultValue("0")
.MarkAsAdvanced()
.SetManipulatedType("number");
extension.AddAction("CameraY",
_("Camera center Y position"),
_("Change the Y position of the center of the specified camera."),
_("Do _PARAM1__PARAM2_ to Y position of camera _PARAM4_ (layer: _PARAM3_)"),
_("Layers and cameras"),
"res/conditions/camera24.png",
"res/conditions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("operator", _("Modification's sign"))
.AddParameter("expression", _("Value"))
.AddParameter("layer", _("Layer (base layer if empty)"), "",true).SetDefaultValue("\"\"")
.AddParameter("expression", _("Camera number (default : 0)"), "",true).SetDefaultValue("0")
.MarkAsAdvanced()
.SetManipulatedType("number");
extension
.AddAction(
"CameraY",
_("Camera center Y position"),
_("Change the Y position of the center of the specified camera."),
_("Do _PARAM1__PARAM2_ to Y position of camera _PARAM4_ (layer: "
"_PARAM3_)"),
_("Layers and cameras"),
"res/conditions/camera24.png",
"res/conditions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("operator", _("Modification's sign"))
.AddParameter("expression", _("Value"))
.AddParameter("layer", _("Layer (base layer if empty)"), "", true)
.SetDefaultValue("\"\"")
.AddParameter("expression", _("Camera number (default : 0)"), "", true)
.SetDefaultValue("0")
.MarkAsAdvanced()
.SetManipulatedType("number");
extension.AddCondition("CameraWidth",
_("Width of a camera"),
_("Test the width of a camera of a layer"),
_("The width of camera _PARAM2_ of layer _PARAM1_ is _PARAM3__PARAM4_"),
_("Layers and cameras"),
"res/conditions/camera24.png",
"res/conditions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer")).SetDefaultValue("\"\"")
.AddParameter("expression", _("Camera number"))
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("Value to test"))
.MarkAsAdvanced()
.SetManipulatedType("number");
extension
.AddCondition("CameraWidth",
_("Width of a camera"),
_("Test the width of a camera of a layer"),
_("The width of camera _PARAM2_ of layer _PARAM1_ is "
"_PARAM3__PARAM4_"),
_("Layers and cameras"),
"res/conditions/camera24.png",
"res/conditions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer"))
.SetDefaultValue("\"\"")
.AddParameter("expression", _("Camera number"))
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("Value to test"))
.MarkAsAdvanced()
.SetManipulatedType("number");
extension.AddCondition("CameraHeight",
_("Height of a camera"),
_("Test the height of a camera of a layer"),
_("The height of camera _PARAM2_ of layer _PARAM1_ is _PARAM3__PARAM4_"),
_("Layers and cameras"),
"res/conditions/camera24.png",
"res/conditions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer (base layer if empty)")).SetDefaultValue("\"\"")
.AddParameter("expression", _("Camera number"))
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("Value to test"))
.MarkAsAdvanced()
.SetManipulatedType("number");
extension
.AddCondition("CameraHeight",
_("Height of a camera"),
_("Test the height of a camera of a layer"),
_("The height of camera _PARAM2_ of layer _PARAM1_ is "
"_PARAM3__PARAM4_"),
_("Layers and cameras"),
"res/conditions/camera24.png",
"res/conditions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer (base layer if empty)"))
.SetDefaultValue("\"\"")
.AddParameter("expression", _("Camera number"))
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("Value to test"))
.MarkAsAdvanced()
.SetManipulatedType("number");
extension.AddCondition("CameraAngle",
_("Angle of a camera of a layer"),
_("Test a camera angle."),
_("Angle of camera is _PARAM1__PARAM2_ (layer: _PARAM3_, camera: _PARAM4_)"),
_("Layers and cameras"),
"res/conditions/camera24.png",
"res/conditions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("Value to test"))
.AddParameter("layer", _("Layer (base layer if empty)"), "",true).SetDefaultValue("\"\"")
.AddParameter("expression", _("Camera number (default : 0)"), "",true).SetDefaultValue("0")
.MarkAsAdvanced()
.SetManipulatedType("number");
extension
.AddCondition("CameraAngle",
_("Angle of a camera of a layer"),
_("Test a camera angle."),
_("Angle of camera is _PARAM1__PARAM2_ (layer: _PARAM3_, "
"camera: _PARAM4_)"),
_("Layers and cameras"),
"res/conditions/camera24.png",
"res/conditions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("Value to test"))
.AddParameter("layer", _("Layer (base layer if empty)"), "", true)
.SetDefaultValue("\"\"")
.AddParameter("expression", _("Camera number (default : 0)"), "", true)
.SetDefaultValue("0")
.MarkAsAdvanced()
.SetManipulatedType("number");
extension.AddAction("RotateCamera",
_("Change camera angle"),
_("This action modifies the angle of a camera in the specified layer."),
_("Do _PARAM1__PARAM2_ to angle of camera (layer: _PARAM3_, camera: _PARAM4_)"),
_("Layers and cameras"),
"res/actions/camera24.png",
"res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("operator", _("Modification's sign"))
.AddParameter("expression", _("Value"))
.AddParameter("layer", _("Layer (base layer if empty)"), "",true).SetDefaultValue("\"\"")
.AddParameter("expression", _("Camera number (default : 0)"), "",true).SetDefaultValue("0")
.SetManipulatedType("number");
extension
.AddAction("RotateCamera",
_("Change camera angle"),
_("This action modifies the angle of a camera in the "
"specified layer."),
_("Do _PARAM1__PARAM2_ to angle of camera (layer: _PARAM3_, "
"camera: _PARAM4_)"),
_("Layers and cameras"),
"res/actions/camera24.png",
"res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("operator", _("Modification's sign"))
.AddParameter("expression", _("Value"))
.AddParameter("layer", _("Layer (base layer if empty)"), "", true)
.SetDefaultValue("\"\"")
.AddParameter("expression", _("Camera number (default : 0)"), "", true)
.SetDefaultValue("0")
.SetManipulatedType("number");
extension.AddAction("AddCamera",
_("Add a camera to a layer"),
_("This action adds a camera to a layer"),
_("Add a camera to layer _PARAM1_"),
_("Layers and cameras"),
"res/actions/camera24.png",
"res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer (base layer if empty)")).SetDefaultValue("\"\"")
.AddParameter("expression", _("Width"), "",true)
.AddParameter("expression", _("Height"), "",true)
.AddParameter("expression", _("Render zone: Top left side: X Position (between 0 and 1)"), "",true)
.AddParameter("expression", _("Render zone: Top left side: Y Position (between 0 and 1)"), "",true)
.AddParameter("expression", _("Render zone: Bottom right side: X Position (between 0 and 1)"), "",true)
.AddParameter("expression", _("Render zone: Bottom right side: Y Position (between 0 and 1)"), "",true)
.MarkAsComplex();
extension
.AddAction("AddCamera",
_("Add a camera to a layer"),
_("This action adds a camera to a layer"),
_("Add a camera to layer _PARAM1_"),
_("Layers and cameras"),
"res/actions/camera24.png",
"res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer (base layer if empty)"))
.SetDefaultValue("\"\"")
.AddParameter("expression", _("Width"), "", true)
.AddParameter("expression", _("Height"), "", true)
.AddParameter(
"expression",
_("Render zone: Top left side: X Position (between 0 and 1)"),
"",
true)
.AddParameter(
"expression",
_("Render zone: Top left side: Y Position (between 0 and 1)"),
"",
true)
.AddParameter(
"expression",
_("Render zone: Bottom right side: X Position (between 0 and 1)"),
"",
true)
.AddParameter(
"expression",
_("Render zone: Bottom right side: Y Position (between 0 and 1)"),
"",
true)
.MarkAsComplex();
extension.AddAction("DeleteCamera",
_("Delete a camera of a layer"),
_("Remove the specified camera from a layer"),
_("Delete camera _PARAM2_ from layer _PARAM1_"),
_("Layers and cameras"),
"res/actions/camera24.png",
"res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer (base layer if empty)")).SetDefaultValue("\"\"")
.AddParameter("expression", _("Camera number"))
.MarkAsComplex();
extension
.AddAction("DeleteCamera",
_("Delete a camera of a layer"),
_("Remove the specified camera from a layer"),
_("Delete camera _PARAM2_ from layer _PARAM1_"),
_("Layers and cameras"),
"res/actions/camera24.png",
"res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer (base layer if empty)"))
.SetDefaultValue("\"\"")
.AddParameter("expression", _("Camera number"))
.MarkAsComplex();
extension.AddAction("CameraSize",
_("Modify the size of a camera"),
_("This action modifies the size of a camera of the specified layer. The zoom will be reset."),
_("Change the size of camera _PARAM2_ of _PARAM1_ to _PARAM3_*_PARAM4_"),
_("Layers and cameras"),
"res/actions/camera24.png",
"res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer (base layer if empty)")).SetDefaultValue("\"\"")
.AddParameter("expression", _("Camera number"))
.AddParameter("expression", _("Width"))
.AddParameter("expression", _("Height"))
.MarkAsComplex();
extension
.AddAction("CameraSize",
_("Modify the size of a camera"),
_("This action modifies the size of a camera of the specified "
"layer. The zoom will be reset."),
_("Change the size of camera _PARAM2_ of _PARAM1_ to "
"_PARAM3_*_PARAM4_"),
_("Layers and cameras"),
"res/actions/camera24.png",
"res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer (base layer if empty)"))
.SetDefaultValue("\"\"")
.AddParameter("expression", _("Camera number"))
.AddParameter("expression", _("Width"))
.AddParameter("expression", _("Height"))
.MarkAsComplex();
extension.AddAction("CameraViewport",
_("Modify the render zone of a camera"),
_("This action modifies the render zone of a camera of the specified layer."),
_("Set the render zone of camera _PARAM2_ from layer _PARAM1_ to _PARAM3_;_PARAM4_ _PARAM5_;_PARAM6_"),
_("Layers and cameras"),
"res/actions/camera24.png",
"res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer (base layer if empty)")).SetDefaultValue("\"\"")
.AddParameter("expression", _("Camera number"))
.AddParameter("expression", _("Render zone: Top left side: X Position (between 0 and 1)"))
.AddParameter("expression", _("Render zone: Top left side: Y Position (between 0 and 1)"))
.AddParameter("expression", _("Render zone: Bottom right side: X Position (between 0 and 1)"))
.AddParameter("expression", _("Render zone: Bottom right side: Y Position (between 0 and 1)"))
.MarkAsComplex();
extension
.AddAction("CameraViewport",
_("Modify the render zone of a camera"),
_("This action modifies the render zone of a camera of the "
"specified layer."),
_("Set the render zone of camera _PARAM2_ from layer _PARAM1_ "
"to _PARAM3_;_PARAM4_ _PARAM5_;_PARAM6_"),
_("Layers and cameras"),
"res/actions/camera24.png",
"res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer (base layer if empty)"))
.SetDefaultValue("\"\"")
.AddParameter("expression", _("Camera number"))
.AddParameter(
"expression",
_("Render zone: Top left side: X Position (between 0 and 1)"))
.AddParameter(
"expression",
_("Render zone: Top left side: Y Position (between 0 and 1)"))
.AddParameter(
"expression",
_("Render zone: Bottom right side: X Position (between 0 and 1)"))
.AddParameter(
"expression",
_("Render zone: Bottom right side: Y Position (between 0 and 1)"))
.MarkAsComplex();
extension.AddAction("ZoomCamera",
_("Change camera zoom."),
_("Change camera zoom."),
_("Change camera zoom to _PARAM1_ (layer : _PARAM2_, camera : _PARAM3_)"),
_("Layers and cameras"),
"res/actions/camera24.png",
"res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Value (1:Initial zoom, 2:Zoom x2, 0.5:Unzoom x2...)"))
.AddParameter("layer", _("Layer (base layer if empty)"), "",true).SetDefaultValue("\"\"")
.AddParameter("expression", _("Camera number (default : 0)"), "",true).SetDefaultValue("0");
extension
.AddAction("ZoomCamera",
_("Change camera zoom."),
_("Change camera zoom."),
_("Change camera zoom to _PARAM1_ (layer : _PARAM2_, camera : "
"_PARAM3_)"),
_("Layers and cameras"),
"res/actions/camera24.png",
"res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression",
_("Value (1:Initial zoom, 2:Zoom x2, 0.5:Unzoom x2...)"))
.AddParameter("layer", _("Layer (base layer if empty)"), "", true)
.SetDefaultValue("\"\"")
.AddParameter("expression", _("Camera number (default : 0)"), "", true)
.SetDefaultValue("0");
extension.AddAction("FixCamera",
_("Center the camera on an object within limits"),
_("Center the camera on the specified object, without leaving the specified limits."),
_("Center the camera on _PARAM1_ (limit : from _PARAM2_;_PARAM3_ to _PARAM4_;_PARAM5_) (layer: _PARAM7_, camera: _PARAM8_)"),
_("Layers and cameras"),
"res/actions/camera24.png",
"res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("objectPtr", _("Object"))
.AddParameter("expression", _("Top left side of the boundary: X Position"))
.AddParameter("expression", _("Top left side of the boundary: Y Position"))
.AddParameter("expression", _("Bottom right side of the boundary: X Position"))
.AddParameter("expression", _("Bottom right side of the boundary: Y Position"))
.AddParameter("yesorno", _("Anticipate the movement of the object (yes by default)"), "",true).SetDefaultValue("yes")
.AddParameter("layer", _("Layer (base layer if empty)"), "",true).SetDefaultValue("\"\"")
.AddParameter("expression", _("Camera number (default : 0)"), "",true).SetDefaultValue("0")
.MarkAsAdvanced();
extension
.AddAction(
"FixCamera",
_("Center the camera on an object within limits"),
_("Center the camera on the specified object, without leaving the "
"specified limits."),
_("Center the camera on _PARAM1_ (limit : from _PARAM2_;_PARAM3_ to "
"_PARAM4_;_PARAM5_) (layer: _PARAM7_, camera: _PARAM8_)"),
_("Layers and cameras"),
"res/actions/camera24.png",
"res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("objectPtr", _("Object"))
.AddParameter("expression",
_("Top left side of the boundary: X Position"))
.AddParameter("expression",
_("Top left side of the boundary: Y Position"))
.AddParameter("expression",
_("Bottom right side of the boundary: X Position"))
.AddParameter("expression",
_("Bottom right side of the boundary: Y Position"))
.AddParameter("yesorno",
_("Anticipate the movement of the object (yes by default)"),
"",
true)
.SetDefaultValue("yes")
.AddParameter("layer", _("Layer (base layer if empty)"), "", true)
.SetDefaultValue("\"\"")
.AddParameter("expression", _("Camera number (default : 0)"), "", true)
.SetDefaultValue("0")
.MarkAsAdvanced();
extension.AddAction("CentreCamera",
_("Center the camera on an object"),
_("Center the camera on the specified object."),
_("Center camera on _PARAM1_ (layer: _PARAM3_, camera: _PARAM4_)"),
_("Layers and cameras"),
"res/actions/camera24.png",
"res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("objectPtr", _("Object"))
.AddParameter("yesorno", _("Anticipate the movement of the object (yes by default)"), "",true).SetDefaultValue("yes")
.AddParameter("layer", _("Layer (base layer if empty)"), "",true).SetDefaultValue("\"\"")
.AddParameter("expression", _("Camera number (default : 0)"), "",true).SetDefaultValue("0")
.MarkAsSimple();
extension
.AddAction(
"CentreCamera",
_("Center the camera on an object"),
_("Center the camera on the specified object."),
_("Center camera on _PARAM1_ (layer: _PARAM3_, camera: _PARAM4_)"),
_("Layers and cameras"),
"res/actions/camera24.png",
"res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("objectPtr", _("Object"))
.AddParameter("yesorno",
_("Anticipate the movement of the object (yes by default)"),
"",
true)
.SetDefaultValue("yes")
.AddParameter("layer", _("Layer (base layer if empty)"), "", true)
.SetDefaultValue("\"\"")
.AddParameter("expression", _("Camera number (default : 0)"), "", true)
.SetDefaultValue("0")
.MarkAsSimple();
extension.AddAction("ShowLayer",
_("Show a layer"),
_("Show a layer."),
_("Show layer _PARAM1_"),
_("Layers and cameras"),
"res/actions/layer24.png",
"res/actions/layer.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer (base layer if empty)")).SetDefaultValue("\"\"")
.MarkAsAdvanced();
extension
.AddAction("ShowLayer",
_("Show a layer"),
_("Show a layer."),
_("Show layer _PARAM1_"),
_("Layers and cameras"),
"res/actions/layer24.png",
"res/actions/layer.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer (base layer if empty)"))
.SetDefaultValue("\"\"")
.MarkAsAdvanced();
extension.AddAction("HideLayer",
_("Hide a layer"),
_("Hide a layer."),
_("Hide layer _PARAM1_"),
_("Layers and cameras"),
"res/actions/layer24.png",
"res/actions/layer.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer (base layer if empty)")).SetDefaultValue("\"\"")
.MarkAsAdvanced();
extension
.AddAction("HideLayer",
_("Hide a layer"),
_("Hide a layer."),
_("Hide layer _PARAM1_"),
_("Layers and cameras"),
"res/actions/layer24.png",
"res/actions/layer.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer (base layer if empty)"))
.SetDefaultValue("\"\"")
.MarkAsAdvanced();
extension.AddCondition("LayerVisible",
_("Visibility of a layer"),
_("Test if a layer is set as visible."),
_("Layer _PARAM1_ is visible"),
_("Layers and cameras"),
"res/conditions/layer24.png",
"res/conditions/layer.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer (base layer if empty)")).SetDefaultValue("\"\"")
.MarkAsAdvanced();
extension
.AddCondition("LayerVisible",
_("Visibility of a layer"),
_("Test if a layer is set as visible."),
_("Layer _PARAM1_ is visible"),
_("Layers and cameras"),
"res/conditions/layer24.png",
"res/conditions/layer.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer (base layer if empty)"))
.SetDefaultValue("\"\"")
.MarkAsAdvanced();
extension.AddAction("SetLayerEffectParameter",
_("Effect parameter"),
_("Change the parameter of an effect"),
_("Set _PARAM3_ to _PARAM4_ for effect _PARAM2_ of layer _PARAM1_"),
_("Layers and cameras/Effects"),
"res/conditions/camera24.png",
"res/conditions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer (base layer if empty)"), "",true).SetDefaultValue("\"\"")
.AddParameter("string", _("Effect"))
.AddParameter("string", _("Parameter name"))
.AddParameter("expression", _("New value"))
.MarkAsAdvanced();
extension
.AddAction(
"SetLayerEffectParameter",
_("Effect parameter"),
_("Change the parameter of an effect"),
_("Set _PARAM3_ to _PARAM4_ for effect _PARAM2_ of layer _PARAM1_"),
_("Layers and cameras/Effects"),
"res/conditions/camera24.png",
"res/conditions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer (base layer if empty)"), "", true)
.SetDefaultValue("\"\"")
.AddParameter("string", _("Effect"))
.AddParameter("string", _("Parameter name"))
.AddParameter("expression", _("New value"))
.MarkAsAdvanced();
extension.AddCondition("LayerTimeScale",
_("Layer time scale"),
_("Compare the time scale applied to the objects of the layer."),
_("The time scale of layer _PARAM1_ is _PARAM2__PARAM3_"),
_("Layers and cameras/Time"),
"res/conditions/time24.png",
"res/conditions/time.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer (base layer if empty)"), "",true).SetDefaultValue("\"\"")
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("Value to test"))
.MarkAsAdvanced()
.SetManipulatedType("number");
extension
.AddCondition(
"LayerTimeScale",
_("Layer time scale"),
_("Compare the time scale applied to the objects of the layer."),
_("The time scale of layer _PARAM1_ is _PARAM2__PARAM3_"),
_("Layers and cameras/Time"),
"res/conditions/time24.png",
"res/conditions/time.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer (base layer if empty)"), "", true)
.SetDefaultValue("\"\"")
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("Value to test"))
.MarkAsAdvanced()
.SetManipulatedType("number");
extension.AddAction("ChangeLayerTimeScale",
_("Change layer time scale"),
_("Change the time scale applied to the objects of the layer."),
_("Set time scale of layer _PARAM1_ to _PARAM2_"),
_("Layers and cameras/Time"),
"res/actions/time24.png",
"res/actions/time.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer (base layer if empty)"), "",true).SetDefaultValue("\"\"")
.AddParameter("expression", _("Scale (1: Default, 2: 2x faster, 0.5: 2x slower...)"));
extension
.AddAction(
"ChangeLayerTimeScale",
_("Change layer time scale"),
_("Change the time scale applied to the objects of the layer."),
_("Set time scale of layer _PARAM1_ to _PARAM2_"),
_("Layers and cameras/Time"),
"res/actions/time24.png",
"res/actions/time.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer (base layer if empty)"), "", true)
.SetDefaultValue("\"\"")
.AddParameter("expression",
_("Scale (1: Default, 2: 2x faster, 0.5: 2x slower...)"));
extension.AddExpression("CameraWidth", _("Width of a camera of a layer"), _("Width of a camera of a layer"), _("Layers and cameras"), "res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer"))
.AddParameter("expression", _("Camera number (default : 0)")).SetDefaultValue("0");
extension
.AddExpression("CameraWidth",
_("Width of a camera of a layer"),
_("Width of a camera of a layer"),
_("Layers and cameras"),
"res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer"))
.AddParameter("expression", _("Camera number (default : 0)"))
.SetDefaultValue("0");
extension.AddExpression("CameraHeight", _("Height of a camera of a layer"), _("Height of a camera of a layer"), _("Layers and cameras"), "res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer"))
.AddParameter("expression", _("Camera number (default : 0)")).SetDefaultValue("0");
extension
.AddExpression("CameraHeight",
_("Height of a camera of a layer"),
_("Height of a camera of a layer"),
_("Layers and cameras"),
"res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer"))
.AddParameter("expression", _("Camera number (default : 0)"))
.SetDefaultValue("0");
extension.AddExpression("CameraViewportLeft", _("X position of the top left side point of a render zone"), _("X position of the top left side point of a render zone"), _("Layers and cameras"), "res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer"))
.AddParameter("expression", _("Camera number (default : 0)")).SetDefaultValue("0");
extension
.AddExpression(
"CameraViewportLeft",
_("X position of the top left side point of a render zone"),
_("X position of the top left side point of a render zone"),
_("Layers and cameras"),
"res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer"))
.AddParameter("expression", _("Camera number (default : 0)"))
.SetDefaultValue("0");
extension.AddExpression("CameraViewportTop", _("Y position of the top left side point of a render zone"), _("Y position of the top left side point of a render zone"), _("Layers and cameras"), "res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer"))
.AddParameter("expression", _("Camera number (default : 0)")).SetDefaultValue("0");
extension
.AddExpression(
"CameraViewportTop",
_("Y position of the top left side point of a render zone"),
_("Y position of the top left side point of a render zone"),
_("Layers and cameras"),
"res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer"))
.AddParameter("expression", _("Camera number (default : 0)"))
.SetDefaultValue("0");
extension.AddExpression("CameraViewportRight", _("X position of the bottom right side point of a render zone"), _("X position of the bottom right side point of a render zone"), _("Layers and cameras"), "res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer"))
.AddParameter("expression", _("Camera number (default : 0)")).SetDefaultValue("0");
extension
.AddExpression(
"CameraViewportRight",
_("X position of the bottom right side point of a render zone"),
_("X position of the bottom right side point of a render zone"),
_("Layers and cameras"),
"res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer"))
.AddParameter("expression", _("Camera number (default : 0)"))
.SetDefaultValue("0");
extension.AddExpression("CameraViewportBottom", _("Y position of the bottom right side point of a render zone"), _("Y position of the bottom right side point of a render zone"), _("Layers and cameras"), "res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer"))
.AddParameter("expression", _("Camera number (default : 0)")).SetDefaultValue("0");
extension
.AddExpression(
"CameraViewportBottom",
_("Y position of the bottom right side point of a render zone"),
_("Y position of the bottom right side point of a render zone"),
_("Layers and cameras"),
"res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer"))
.AddParameter("expression", _("Camera number (default : 0)"))
.SetDefaultValue("0");
extension.AddExpression("CameraX", _("Camera X position"), _("Camera X position"), _("Layers and cameras"), "res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer"), "",true).SetDefaultValue("\"\"")
.AddParameter("expression", _("Camera number (default : 0)"), "",true).SetDefaultValue("0");
extension
.AddExpression("CameraX",
_("Camera X position"),
_("Camera X position"),
_("Layers and cameras"),
"res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer"), "", true)
.SetDefaultValue("\"\"")
.AddParameter("expression", _("Camera number (default : 0)"), "", true)
.SetDefaultValue("0");
extension.AddExpression("VueX", _("Camera X position"), _("Camera X position"), _("Layers and cameras"), "res/actions/camera.png")
.SetHidden()
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer"), "",true).SetDefaultValue("\"\"")
.AddParameter("expression", _("Camera number (default : 0)"), "",true).SetDefaultValue("0");
extension
.AddExpression("VueX",
_("Camera X position"),
_("Camera X position"),
_("Layers and cameras"),
"res/actions/camera.png")
.SetHidden()
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer"), "", true)
.SetDefaultValue("\"\"")
.AddParameter("expression", _("Camera number (default : 0)"), "", true)
.SetDefaultValue("0");
extension.AddExpression("CameraY", _("Camera Y position"), _("Camera Y position"), _("Layers and cameras"), "res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer"), "",true).SetDefaultValue("\"\"")
.AddParameter("expression", _("Camera number (default : 0)"), "",true).SetDefaultValue("0");
extension
.AddExpression("CameraY",
_("Camera Y position"),
_("Camera Y position"),
_("Layers and cameras"),
"res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer"), "", true)
.SetDefaultValue("\"\"")
.AddParameter("expression", _("Camera number (default : 0)"), "", true)
.SetDefaultValue("0");
extension.AddExpression("VueY", _("Camera Y position"), _("Camera Y position"), _("Layers and cameras"), "res/actions/camera.png")
.SetHidden()
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer"), "",true).SetDefaultValue("\"\"")
.AddParameter("expression", _("Camera number (default : 0)"), "",true).SetDefaultValue("0");
extension
.AddExpression("VueY",
_("Camera Y position"),
_("Camera Y position"),
_("Layers and cameras"),
"res/actions/camera.png")
.SetHidden()
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer"), "", true)
.SetDefaultValue("\"\"")
.AddParameter("expression", _("Camera number (default : 0)"), "", true)
.SetDefaultValue("0");
extension.AddExpression("CameraRotation", _("Angle of a camera of a layer"), _("Angle of a camera of a layer"), _("Layers and cameras"), "res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer"), "",true).SetDefaultValue("\"\"")
.AddParameter("expression", _("Camera number (default : 0)"), "",true).SetDefaultValue("0");
extension
.AddExpression("CameraRotation",
_("Angle of a camera of a layer"),
_("Angle of a camera of a layer"),
_("Layers and cameras"),
"res/actions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer"), "", true)
.SetDefaultValue("\"\"")
.AddParameter("expression", _("Camera number (default : 0)"), "", true)
.SetDefaultValue("0");
extension.AddExpression("VueRotation", _("Angle of a camera of a layer"), _("Angle of a camera of a layer"), _("Layers and cameras"), "res/actions/camera.png")
.SetHidden()
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer"), "",true).SetDefaultValue("\"\"")
.AddParameter("expression", _("Camera number (default : 0)"), "",true).SetDefaultValue("0");
extension
.AddExpression("VueRotation",
_("Angle of a camera of a layer"),
_("Angle of a camera of a layer"),
_("Layers and cameras"),
"res/actions/camera.png")
.SetHidden()
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer"), "", true)
.SetDefaultValue("\"\"")
.AddParameter("expression", _("Camera number (default : 0)"), "", true)
.SetDefaultValue("0");
extension.AddExpression("LayerTimeScale", _("Time scale"), _("Time scale"), _("Layers and cameras"), "res/actions/time.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer"));
#endif
extension
.AddExpression("LayerTimeScale",
_("Time scale"),
_("Time scale"),
_("Layers and cameras"),
"res/actions/time.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer"));
#endif
}
}
} // namespace gd

View File

@@ -1,61 +1,71 @@
/*
* 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 "AllBuiltinExtensions.h"
#include "GDCore/Tools/Localization.h"
using namespace std;
namespace gd
{
namespace gd {
void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCommonConversionsExtension(gd::PlatformExtension & extension)
{
extension.SetExtensionInformation("BuiltinCommonConversions",
_("Standard Conversions"),
_("Built-in extension providing standard conversions expressions."),
"Florian Rival",
"Open source (MIT License)");
void GD_CORE_API
BuiltinExtensionsImplementer::ImplementsCommonConversionsExtension(
gd::PlatformExtension& extension) {
extension
.SetExtensionInformation(
"BuiltinCommonConversions",
_("Standard Conversions"),
_("Built-in extension providing standard conversions expressions."),
"Florian Rival",
"Open source (MIT License)")
.SetExtensionHelpPath("" /*TODO: Add a documentation page for this */);
#if defined(GD_IDE_ONLY)
#if defined(GD_IDE_ONLY)
extension.AddExpression("ToNumber",
_("Text > Number"),
_("Convert the text to a number"),
_("Conversion"),
"res/conditions/toujours24.png")
.AddParameter("string", _("Text to convert to a number"));
extension
.AddExpression("ToNumber",
_("Text > Number"),
_("Convert the text to a number"),
_("Conversion"),
"res/conditions/toujours24.png")
.AddParameter("string", _("Text to convert to a number"));
extension.AddStrExpression("ToString",
_("Number > Text"),
_("Convert the result of the expression to text"),
_("Conversion"),
"res/conditions/toujours24.png")
.AddParameter("expression", _("Expression to be converted to text"));
extension
.AddStrExpression("ToString",
_("Number > Text"),
_("Convert the result of the expression to text"),
_("Conversion"),
"res/conditions/toujours24.png")
.AddParameter("expression", _("Expression to be converted to text"));
extension.AddStrExpression("LargeNumberToString",
_("Number > Text ( without scientific notation )"),
_("Convert the result of the expression to text, without using the scientific notation"),
_("Conversion"),
"res/conditions/toujours24.png")
.AddParameter("expression", _("Expression to be converted to text"));
extension
.AddStrExpression("LargeNumberToString",
_("Number > Text ( without scientific notation )"),
_("Convert the result of the expression to text, "
"without using the scientific notation"),
_("Conversion"),
"res/conditions/toujours24.png")
.AddParameter("expression", _("Expression to be converted to text"));
extension.AddExpression("ToRad",
_("Degrees > Radians"),
_("Converts the angle, expressed in degrees, into radians"),
_("Conversion"),
"res/conditions/toujours24.png")
.AddParameter("expression", _("Angle, in degrees"));
extension
.AddExpression(
"ToRad",
_("Degrees > Radians"),
_("Converts the angle, expressed in degrees, into radians"),
_("Conversion"),
"res/conditions/toujours24.png")
.AddParameter("expression", _("Angle, in degrees"));
extension.AddExpression("ToDeg",
_("Radians > Degrees"),
_("Converts the angle, expressed in radians, into degrees"),
_("Conversion"),
"res/conditions/toujours24.png")
.AddParameter("expression", _("Angle, in radians"));
#endif
extension
.AddExpression(
"ToDeg",
_("Radians > Degrees"),
_("Converts the angle, expressed in radians, into degrees"),
_("Conversion"),
"res/conditions/toujours24.png")
.AddParameter("expression", _("Angle, in radians"));
#endif
}
}
} // namespace gd

View File

@@ -1,107 +1,130 @@
/*
* 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 "AllBuiltinExtensions.h"
#include "GDCore/Tools/Localization.h"
#if defined(GD_IDE_ONLY)
#include "GDCore/Events/Event.h"
#include "GDCore/Events/Builtin/StandardEvent.h"
#include "GDCore/Events/Builtin/CommentEvent.h"
#include "GDCore/Events/Builtin/ForEachEvent.h"
#include "GDCore/Events/Builtin/WhileEvent.h"
#include "GDCore/Events/Builtin/RepeatEvent.h"
#include "GDCore/Events/Builtin/LinkEvent.h"
#include "GDCore/Events/Builtin/GroupEvent.h"
#include "GDCore/Events/Builtin/LinkEvent.h"
#include "GDCore/Events/Builtin/RepeatEvent.h"
#include "GDCore/Events/Builtin/StandardEvent.h"
#include "GDCore/Events/Builtin/WhileEvent.h"
#include "GDCore/Events/Event.h"
#endif
using namespace std;
namespace gd
{
namespace gd {
void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCommonInstructionsExtension(gd::PlatformExtension & extension)
{
extension.SetExtensionInformation("BuiltinCommonInstructions",
_("Standard events"),
_("Built-in extension providing standard events."),
"Florian Rival",
"Open source (MIT License)");
void GD_CORE_API
BuiltinExtensionsImplementer::ImplementsCommonInstructionsExtension(
gd::PlatformExtension& extension) {
extension
.SetExtensionInformation(
"BuiltinCommonInstructions",
_("Standard events"),
_("Built-in extension providing standard events."),
"Florian Rival",
"Open source (MIT License)")
.SetExtensionHelpPath("" /*TODO: Add a documentation page for this */);
#if defined(GD_IDE_ONLY)
extension.AddCondition("Or",
_("Or"),
_("Return true if one of the sub conditions is true"),
_("If one of these conditions is true:"),
_("Advanced"),
"res/conditions/or24.png",
"res/conditions/or.png")
.SetCanHaveSubInstructions()
.MarkAsAdvanced();
extension
.AddCondition("Or",
_("Or"),
_("Return true if one of the sub conditions is true"),
_("If one of these conditions is true:"),
_("Advanced"),
"res/conditions/or24.png",
"res/conditions/or.png")
.SetCanHaveSubInstructions()
.MarkAsAdvanced();
extension.AddCondition("And",
_("And"),
_("Return true if all sub conditions are true"),
_("If all of these conditions are true:"),
_("Advanced"),
"res/conditions/and24.png",
"res/conditions/and.png")
.SetCanHaveSubInstructions()
.MarkAsAdvanced();
extension
.AddCondition("And",
_("And"),
_("Return true if all sub conditions are true"),
_("If all of these conditions are true:"),
_("Advanced"),
"res/conditions/and24.png",
"res/conditions/and.png")
.SetCanHaveSubInstructions()
.MarkAsAdvanced();
extension.AddCondition("Not",
_("Not"),
_("Return the contrary of the result of the sub conditions"),
_("Invert the logical result of these conditions:"),
_("Advanced"),
"res/conditions/not24.png",
"res/conditions/not.png")
.SetCanHaveSubInstructions()
.MarkAsAdvanced();
extension
.AddCondition(
"Not",
_("Not"),
_("Return the contrary of the result of the sub conditions"),
_("Invert the logical result of these conditions:"),
_("Advanced"),
"res/conditions/not24.png",
"res/conditions/not.png")
.SetCanHaveSubInstructions()
.MarkAsAdvanced();
extension.AddCondition("Once",
_("Trigger once while true"),
_("Run actions only once, for each time the conditions have been met."),
_("Trigger once"),
_("Advanced"),
"res/conditions/once24.png",
"res/conditions/once.png");
extension.AddCondition(
"Once",
_("Trigger once while true"),
_("Run actions only once, for each time the conditions have been met."),
_("Trigger once"),
_("Advanced"),
"res/conditions/once24.png",
"res/conditions/once.png");
extension.AddEvent("Standard", _("Standard event"),
_("Standard event: Actions are run if conditions are fulfilled."),
"", "res/eventaddicon.png",
std::make_shared<gd::StandardEvent>());
extension.AddEvent(
"Standard",
_("Standard event"),
_("Standard event: Actions are run if conditions are fulfilled."),
"",
"res/eventaddicon.png",
std::make_shared<gd::StandardEvent>());
extension.AddEvent("Link", _("Link"),
_("Link to some external events"),
"", "res/lienaddicon.png",
std::make_shared<gd::LinkEvent>());
extension.AddEvent("Link",
_("Link"),
_("Link to some external events"),
"",
"res/lienaddicon.png",
std::make_shared<gd::LinkEvent>());
extension.AddEvent("Comment", _("Comment"),
_("Event displaying a text in the events editor"),
"", "res/comment.png",
std::make_shared<gd::CommentEvent>());
extension.AddEvent("Comment",
_("Comment"),
_("Event displaying a text in the events editor"),
"",
"res/comment.png",
std::make_shared<gd::CommentEvent>());
extension.AddEvent("While", _("While"),
_("The event is repeated while the conditions are true"),
"", "res/while.png",
std::make_shared<gd::WhileEvent>());
extension.AddEvent("While",
_("While"),
_("The event is repeated while the conditions are true"),
"",
"res/while.png",
std::make_shared<gd::WhileEvent>());
extension.AddEvent("Repeat", _("Repeat"),
_("Event repeated a number of times"),
"", "res/repeat.png",
std::make_shared<gd::RepeatEvent>());
extension.AddEvent("Repeat",
_("Repeat"),
_("Event repeated a number of times"),
"",
"res/repeat.png",
std::make_shared<gd::RepeatEvent>());
extension.AddEvent("ForEach", _("For each object"),
_("Repeat the event for each specified object."),
"", "res/foreach.png",
std::make_shared<gd::ForEachEvent>());
extension.AddEvent("ForEach",
_("For each object"),
_("Repeat the event for each specified object."),
"",
"res/foreach.png",
std::make_shared<gd::ForEachEvent>());
extension.AddEvent("Group", _("Group"),
_("Group containing events"),
"", "res/foreach.png",
std::make_shared<gd::GroupEvent>());
extension.AddEvent("Group",
_("Group"),
_("Group containing events"),
"",
"res/foreach.png",
std::make_shared<gd::GroupEvent>());
#endif
}
}
} // namespace gd

View File

@@ -1,37 +1,44 @@
/*
* 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 "AllBuiltinExtensions.h"
#include "GDCore/Tools/Localization.h"
using namespace std;
namespace gd
{
namespace gd {
void GD_CORE_API BuiltinExtensionsImplementer::ImplementsExternalLayoutsExtension(gd::PlatformExtension & extension)
{
extension.SetExtensionInformation("BuiltinExternalLayouts",
_("External layouts"),
_("Built-in extension providing actions and conditions related to external layouts"),
"Florian Rival",
"Open source (MIT License)");
void GD_CORE_API
BuiltinExtensionsImplementer::ImplementsExternalLayoutsExtension(
gd::PlatformExtension& extension) {
extension
.SetExtensionInformation(
"BuiltinExternalLayouts",
_("External layouts"),
_("Built-in extension providing actions and conditions related to "
"external layouts"),
"Florian Rival",
"Open source (MIT License)")
.SetExtensionHelpPath("" /*TODO: Add a documentation page for this */);
#if defined(GD_IDE_ONLY)
extension.AddAction("CreateObjectsFromExternalLayout",
_("Create objects from an external layout"),
_("Create objects from an external layout."),
_("Create objects from the external layout named _PARAM1_"),
_("External layouts"),
"res/conditions/fichier24.png",
"res/conditions/fichier.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("string", _("Name of the external layout"))
.AddParameter("expression", _("X position of the origin"), "",true).SetDefaultValue("0")
.AddParameter("expression", _("Y position of the origin"), "",true).SetDefaultValue("0")
.MarkAsAdvanced();
#endif
#if defined(GD_IDE_ONLY)
extension
.AddAction("CreateObjectsFromExternalLayout",
_("Create objects from an external layout"),
_("Create objects from an external layout."),
_("Create objects from the external layout named _PARAM1_"),
_("External layouts"),
"res/conditions/fichier24.png",
"res/conditions/fichier.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("string", _("Name of the external layout"))
.AddParameter("expression", _("X position of the origin"), "", true)
.SetDefaultValue("0")
.AddParameter("expression", _("Y position of the origin"), "", true)
.SetDefaultValue("0")
.MarkAsAdvanced();
#endif
}
}
} // namespace gd

View File

@@ -1,151 +1,192 @@
/*
* 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 "AllBuiltinExtensions.h"
#include "GDCore/Tools/Localization.h"
using namespace std;
namespace gd
{
namespace gd {
void GD_CORE_API BuiltinExtensionsImplementer::ImplementsFileExtension(gd::PlatformExtension & extension)
{
extension.SetExtensionInformation("BuiltinFile",
_("Storage and files"),
_("Built-in extension providing functions to store data and manipulate files."),
"Florian Rival",
"Open source (MIT License)");
void GD_CORE_API BuiltinExtensionsImplementer::ImplementsFileExtension(
gd::PlatformExtension& extension) {
extension
.SetExtensionInformation("BuiltinFile",
_("Storage and files"),
_("Built-in extension providing functions "
"to store data and manipulate files."),
"Florian Rival",
"Open source (MIT License)")
.SetExtensionHelpPath("/all-features/storage");
#if defined(GD_IDE_ONLY)
extension.AddCondition("GroupExists",
_("Existence of a group"),
_("Check if an element (example : PlayerState/CurrentLevel) exists in the file.\nSpaces are forbidden in element names."),
_("_PARAM1_ exists in file _PARAM0_"),
_("Storage"),
"res/conditions/fichier24.png",
"res/conditions/fichier.png")
.AddParameter("file", _("Filename"))
.AddParameter("string", _("Group"))
.MarkAsAdvanced();
#if defined(GD_IDE_ONLY)
extension
.AddCondition(
"GroupExists",
_("Existence of a group"),
_("Check if an element (example : PlayerState/CurrentLevel) exists "
"in the file.\nSpaces are forbidden in element names."),
_("_PARAM1_ exists in file _PARAM0_"),
_("Storage"),
"res/conditions/fichier24.png",
"res/conditions/fichier.png")
.AddParameter("file", _("Filename"))
.AddParameter("string", _("Group"))
.MarkAsAdvanced();
extension.AddAction("LoadFile",
_("Load a structured file in memory"),
_("This action loads the structured file in memory, so you can write and read it.\nYou can open and write without using this action, but it will be slower.\nIf you use this action, do not forget to unload the file from memory.\n\nFor the native platform, the file format is XML."),
_("Load structured file _PARAM0_ in memory"),
_("Storage"),
"res/actions/fichier24.png",
"res/actions/fichier.png")
.AddParameter("file", _("File"))
.MarkAsAdvanced();
extension
.AddAction(
"LoadFile",
_("Load a structured file in memory"),
_("This action loads the structured file in memory, so you can write "
"and read it.\nYou can open and write without using this action, "
"but it will be slower.\nIf you use this action, do not forget to "
"unload the file from memory.\n\nFor the native platform, the file "
"format is XML."),
_("Load structured file _PARAM0_ in memory"),
_("Storage"),
"res/actions/fichier24.png",
"res/actions/fichier.png")
.AddParameter("file", _("File"))
.MarkAsAdvanced();
extension.AddAction("UnloadFile",
_("Close a structured file"),
_("This action closes the structured file previously loaded in memory, saving all changes made."),
_("Close structured file _PARAM0_"),
_("Storage"),
"res/actions/fichier24.png",
"res/actions/fichier.png")
.AddParameter("file", _("File"))
.MarkAsAdvanced();
extension
.AddAction("UnloadFile",
_("Close a structured file"),
_("This action closes the structured file previously loaded "
"in memory, saving all changes made."),
_("Close structured file _PARAM0_"),
_("Storage"),
"res/actions/fichier24.png",
"res/actions/fichier.png")
.AddParameter("file", _("File"))
.MarkAsAdvanced();
extension.AddAction("EcrireFichierExp",
_("Write a value"),
_("Write the result of the expression in the file, in the specified element.\nSpecify the structure leading to the element using / (example : Root/Level/Current)\nSpaces are forbidden in element names."),
_("Write _PARAM2_ in _PARAM1_ of file _PARAM0_"),
_("Storage"),
"res/actions/fichier24.png",
"res/actions/fichier.png")
.AddParameter("file", _("File"))
.AddParameter("string", _("Group"))
.AddParameter("expression", _("Expression"));
extension
.AddAction("EcrireFichierExp",
_("Write a value"),
_("Write the result of the expression in the file, in the "
"specified element.\nSpecify the structure leading to the "
"element using / (example : Root/Level/Current)\nSpaces are "
"forbidden in element names."),
_("Write _PARAM2_ in _PARAM1_ of file _PARAM0_"),
_("Storage"),
"res/actions/fichier24.png",
"res/actions/fichier.png")
.AddParameter("file", _("File"))
.AddParameter("string", _("Group"))
.AddParameter("expression", _("Expression"));
extension.AddAction("EcrireFichierTxt",
_("Write a text"),
_("Write the text in the file, in the specified element.\nSpecify the structure leading to the element using / (example : Root/Level/Current)\nSpaces are forbidden in element names."),
_("Write _PARAM2_ in _PARAM1_ of file _PARAM0_"),
_("Storage"),
"res/actions/fichier24.png",
"res/actions/fichier.png")
.AddParameter("file", _("File"))
.AddParameter("string", _("Group"))
.AddParameter("string", _("Text"));
extension
.AddAction(
"EcrireFichierTxt",
_("Write a text"),
_("Write the text in the file, in the specified element.\nSpecify "
"the structure leading to the element using / (example : "
"Root/Level/Current)\nSpaces are forbidden in element names."),
_("Write _PARAM2_ in _PARAM1_ of file _PARAM0_"),
_("Storage"),
"res/actions/fichier24.png",
"res/actions/fichier.png")
.AddParameter("file", _("File"))
.AddParameter("string", _("Group"))
.AddParameter("string", _("Text"));
extension.AddAction("LireFichierExp",
_("Read a value"),
_("Read the value saved in the specified element and store it in a variable.\nSpecify the structure leading to the element using / (example : Root/Level/Current)\nSpaces are forbidden in element names."),
_("Read _PARAM1_ from file _PARAM0_ and store value in _PARAM3_"),
_("Storage"),
"res/actions/fichier24.png",
"res/actions/fichier.png")
.AddParameter("file", _("File"))
.AddParameter("string", _("Group"))
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("scenevar", _("Scene variables"));
extension
.AddAction(
"LireFichierExp",
_("Read a value"),
_("Read the value saved in the specified element and store it in a "
"variable.\nSpecify the structure leading to the element using / "
"(example : Root/Level/Current)\nSpaces are forbidden in element "
"names."),
_("Read _PARAM1_ from file _PARAM0_ and store value in _PARAM3_"),
_("Storage"),
"res/actions/fichier24.png",
"res/actions/fichier.png")
.AddParameter("file", _("File"))
.AddParameter("string", _("Group"))
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("scenevar", _("Scene variables"));
extension.AddAction("LireFichierTxt",
_("Read a text"),
_("Read the text saved in the specified element and store it in a variable.\nSpecify the structure leading to the element using / (example : Root/Level/Current)\nSpaces are forbidden in element names."),
_("Read _PARAM1_ from file _PARAM0_ and store as text in _PARAM3_"),
_("Storage"),
"res/actions/fichier24.png",
"res/actions/fichier.png")
.AddParameter("file", _("File"))
.AddParameter("string", _("Group"))
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("scenevar", _("Scene variables"));
extension
.AddAction(
"LireFichierTxt",
_("Read a text"),
_("Read the text saved in the specified element and store it in a "
"variable.\nSpecify the structure leading to the element using / "
"(example : Root/Level/Current)\nSpaces are forbidden in element "
"names."),
_("Read _PARAM1_ from file _PARAM0_ and store as text in _PARAM3_"),
_("Storage"),
"res/actions/fichier24.png",
"res/actions/fichier.png")
.AddParameter("file", _("File"))
.AddParameter("string", _("Group"))
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("scenevar", _("Scene variables"));
extension.AddAction("DeleteGroupFichier",
_("Delete an element"),
_("This action deletes the specified element from the structured file.\nSpecify the structure leading to the element using / (example : Root/Level/Current)\nSpaces are forbidden in element names."),
_("Delete _PARAM1_ from the file _PARAM0_"),
_("Storage"),
"res/actions/delete24.png",
"res/actions/delete.png")
.AddParameter("file", _("Filename"))
.AddParameter("string", _("Group"))
.MarkAsAdvanced();
extension
.AddAction("DeleteGroupFichier",
_("Delete an element"),
_("This action deletes the specified element from the "
"structured file.\nSpecify the structure leading to the "
"element using / (example : Root/Level/Current)\nSpaces are "
"forbidden in element names."),
_("Delete _PARAM1_ from the file _PARAM0_"),
_("Storage"),
"res/actions/delete24.png",
"res/actions/delete.png")
.AddParameter("file", _("Filename"))
.AddParameter("string", _("Group"))
.MarkAsAdvanced();
extension.AddAction("DeleteFichier",
_("Delete a file"),
_("Delete the file."),
_("Delete the file _PARAM0_"),
_("Files"),
"res/actions/delete24.png",
"res/actions/delete.png")
.AddParameter("file", _("Filename"));
extension
.AddAction("DeleteFichier",
_("Delete a file"),
_("Delete the file."),
_("Delete the file _PARAM0_"),
_("Files"),
"res/actions/delete24.png",
"res/actions/delete.png")
.AddParameter("file", _("Filename"));
extension.AddCondition("FileExists",
_("A file exists"),
_("Test if the file exists."),
_("File _PARAM0_ exists"),
_("Files"),
"res/conditions/fichier24.png",
"res/conditions/fichier.png")
.AddParameter("file", _("Filename"))
.MarkAsAdvanced();
extension
.AddCondition("FileExists",
_("A file exists"),
_("Test if the file exists."),
_("File _PARAM0_ exists"),
_("Files"),
"res/conditions/fichier24.png",
"res/conditions/fichier.png")
.AddParameter("file", _("Filename"))
.MarkAsAdvanced();
extension.AddAction("LaunchFile",
_("Open a URL or a file"),
_("This action launches the specified file or URL, in a browser (or in a new tab if the game is using the Web platform and is launched inside a browser)."),
_("Open URL (or file) _PARAM0_"),
_("Files"),
"res/actions/launchFile24.png",
"res/actions/launchFile.png")
.AddParameter("string", _("URL (or filename)"))
.MarkAsAdvanced();
extension
.AddAction("LaunchFile",
_("Open a URL or a file"),
_("This action launches the specified file or URL, in a "
"browser (or in a new tab if the game is using the Web "
"platform and is launched inside a browser)."),
_("Open URL (or file) _PARAM0_"),
_("Files"),
"res/actions/launchFile24.png",
"res/actions/launchFile.png")
.AddParameter("string", _("URL (or filename)"))
.MarkAsAdvanced();
extension.AddAction("ExecuteCmd",
_("Execute a command"),
_("This action executes the specified command."),
_("Execute _PARAM0_"),
_("Files"),
"res/actions/launchFile24.png",
"res/actions/launchFile.png")
.AddParameter("string", _("Command"))
.MarkAsAdvanced();
#endif
extension
.AddAction("ExecuteCmd",
_("Execute a command"),
_("This action executes the specified command."),
_("Execute _PARAM0_"),
_("Files"),
"res/actions/launchFile24.png",
"res/actions/launchFile.png")
.AddParameter("string", _("Command"))
.MarkAsAdvanced();
#endif
}
}
} // namespace gd

View File

@@ -1,72 +1,80 @@
/*
* 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 "AllBuiltinExtensions.h"
#include "GDCore/Tools/Localization.h"
using namespace std;
namespace gd
{
namespace gd {
void GD_CORE_API BuiltinExtensionsImplementer::ImplementsJoystickExtension(gd::PlatformExtension & extension)
{
extension.SetExtensionInformation("BuiltinJoystick",
_("Joysticks features"),
_("Built-in extension that enables the use of joysticks"),
"Florian Rival",
"Open source (MIT License)");
void GD_CORE_API BuiltinExtensionsImplementer::ImplementsJoystickExtension(
gd::PlatformExtension& extension) {
extension
.SetExtensionInformation(
"BuiltinJoystick",
_("Joysticks features"),
_("Built-in extension that enables the use of joysticks"),
"Florian Rival",
"Open source (MIT License)")
.SetExtensionHelpPath("" /*TODO: Add a documentation page for this */);
#if defined(GD_IDE_ONLY)
extension.AddCondition("JoystickButtonDown",
_("A button on a joystick is pressed"),
_("Test if a button on a joystick is pressed."),
_("The button _PARAM2_ of joystick _PARAM1_ is pressed"),
_("Joystick"),
"res/conditions/joystick24.png",
"res/conditions/joystick.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Joystick number (first joystick: 0)"))
.AddParameter("expression", _("Button"));
#if defined(GD_IDE_ONLY)
extension
.AddCondition("JoystickButtonDown",
_("A button on a joystick is pressed"),
_("Test if a button on a joystick is pressed."),
_("The button _PARAM2_ of joystick _PARAM1_ is pressed"),
_("Joystick"),
"res/conditions/joystick24.png",
"res/conditions/joystick.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Joystick number (first joystick: 0)"))
.AddParameter("expression", _("Button"));
extension.AddCondition("JoystickAxis",
_("Value of an axis of a joystick"),
_("Test the value of an axis of a joystick."),
_("The value of the axis _PARAM2_ of joystick _PARAM1_ is _PARAM3__PARAM4_"),
_("Joystick"),
"res/conditions/joystick24.png",
"res/conditions/joystick.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Joystick number (first joystick: 0)"))
.AddParameter("joyaxis", _("Axis"))
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("Value to test"))
.SetManipulatedType("number");
extension
.AddCondition("JoystickAxis",
_("Value of an axis of a joystick"),
_("Test the value of an axis of a joystick."),
_("The value of the axis _PARAM2_ of joystick _PARAM1_ is "
"_PARAM3__PARAM4_"),
_("Joystick"),
"res/conditions/joystick24.png",
"res/conditions/joystick.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Joystick number (first joystick: 0)"))
.AddParameter("joyaxis", _("Axis"))
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("Value to test"))
.SetManipulatedType("number");
extension.AddAction("GetJoystickAxis",
_("Get the value of the axis of a joystick"),
_("Save the value of the axis of the joystick (from -100 to 100)."),
_("Save in _PARAM3_ the value of axis _PARAM2_ of joystick _PARAM1_"),
_("Joystick"),
"res/actions/joystick24.png",
"res/actions/joystick.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Joystick number (first joystick: 0)"))
.AddParameter("joyaxis", _("Axis"))
.AddParameter("scenevar", _("Save the result to the scene variable"))
.SetManipulatedType("number");
extension
.AddAction(
"GetJoystickAxis",
_("Get the value of the axis of a joystick"),
_("Save the value of the axis of the joystick (from -100 to 100)."),
_("Save in _PARAM3_ the value of axis _PARAM2_ of joystick _PARAM1_"),
_("Joystick"),
"res/actions/joystick24.png",
"res/actions/joystick.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Joystick number (first joystick: 0)"))
.AddParameter("joyaxis", _("Axis"))
.AddParameter("scenevar", _("Save the result to the scene variable"))
.SetManipulatedType("number");
extension.AddExpression("GetJoystickAxis",
_("Joystick axis"),
_("Value of an axis of a joystick"),
_("Joystick"),
"res/conditions/joystick.png")
extension
.AddExpression("GetJoystickAxis",
_("Joystick axis"),
_("Value of an axis of a joystick"),
_("Joystick"),
"res/conditions/joystick.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Joystick number (first joystick: 0)"))
.AddParameter("joyaxis", _("Axis"));
#endif
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Joystick number (first joystick: 0)"))
.AddParameter("joyaxis", _("Axis"));
#endif
}
}
} // namespace gd

View File

@@ -1,82 +1,93 @@
/*
* 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 "AllBuiltinExtensions.h"
#include "GDCore/Tools/Localization.h"
using namespace std;
namespace gd
{
namespace gd {
void GD_CORE_API BuiltinExtensionsImplementer::ImplementsKeyboardExtension(gd::PlatformExtension & extension)
{
extension.SetExtensionInformation("BuiltinKeyboard",
_("Keyboard features"),
_("Built-in extension that enables the use of a keyboard"),
"Florian Rival",
"Open source (MIT License)");
void GD_CORE_API BuiltinExtensionsImplementer::ImplementsKeyboardExtension(
gd::PlatformExtension& extension) {
extension
.SetExtensionInformation(
"BuiltinKeyboard",
_("Keyboard features"),
_("Built-in extension that enables the use of a keyboard"),
"Florian Rival",
"Open source (MIT License)")
.SetExtensionHelpPath("" /*TODO: Add a documentation page for this */);
#if defined(GD_IDE_ONLY)
extension.AddCondition("KeyPressed",
_("Key pressed"),
_("Test if a key is pressed"),
_("_PARAM1_ key is pressed"),
_("Keyboard"),
"res/conditions/keyboard24.png",
"res/conditions/keyboard.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("key", _("Key"));
#if defined(GD_IDE_ONLY)
extension
.AddCondition("KeyPressed",
_("Key pressed"),
_("Test if a key is pressed"),
_("_PARAM1_ key is pressed"),
_("Keyboard"),
"res/conditions/keyboard24.png",
"res/conditions/keyboard.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("key", _("Key"));
extension.AddCondition("KeyReleased",
_("Key released"),
_("Test if a key was just released"),
_("_PARAM1_ key is released"),
_("Keyboard"),
"res/conditions/keyboard24.png",
"res/conditions/keyboard.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("key", _("Key"));
extension
.AddCondition("KeyReleased",
_("Key released"),
_("Test if a key was just released"),
_("_PARAM1_ key is released"),
_("Keyboard"),
"res/conditions/keyboard24.png",
"res/conditions/keyboard.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("key", _("Key"));
extension.AddCondition("KeyFromTextPressed",
_("Key pressed (text expression)"),
_("Test if a key, retrieved from the result of the expression, is pressed"),
_("_PARAM1_ key is pressed"),
_("Keyboard"),
"res/conditions/keyboard24.png",
"res/conditions/keyboard.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("string", _("Expression generating the key to test"))
.MarkAsAdvanced();
extension
.AddCondition("KeyFromTextPressed",
_("Key pressed (text expression)"),
_("Test if a key, retrieved from the result of the "
"expression, is pressed"),
_("_PARAM1_ key is pressed"),
_("Keyboard"),
"res/conditions/keyboard24.png",
"res/conditions/keyboard.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("string", _("Expression generating the key to test"))
.MarkAsAdvanced();
extension.AddCondition("KeyFromTextReleased",
_("Key released (text expression)"),
_("Test if a key, retrieved from the result of the expression, was just released"),
_("_PARAM1_ key is released"),
_("Keyboard"),
"res/conditions/keyboard24.png",
"res/conditions/keyboard.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("string", _("Expression generating the key to test"))
.MarkAsAdvanced();
extension
.AddCondition("KeyFromTextReleased",
_("Key released (text expression)"),
_("Test if a key, retrieved from the result of the "
"expression, was just released"),
_("_PARAM1_ key is released"),
_("Keyboard"),
"res/conditions/keyboard24.png",
"res/conditions/keyboard.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("string", _("Expression generating the key to test"))
.MarkAsAdvanced();
extension.AddCondition("AnyKeyPressed",
_("Any key pressed"),
_("Test if any key is pressed"),
_("Any key is pressed"),
_("Keyboard"),
"res/conditions/keyboard24.png",
"res/conditions/keyboard.png")
.AddCodeOnlyParameter("currentScene", "");
extension
.AddCondition("AnyKeyPressed",
_("Any key pressed"),
_("Test if any key is pressed"),
_("Any key is pressed"),
_("Keyboard"),
"res/conditions/keyboard24.png",
"res/conditions/keyboard.png")
.AddCodeOnlyParameter("currentScene", "");
extension.AddStrExpression("LastPressedKey",
_("Last pressed key"),
_("Get the name of the latest key pressed on the keyboard"),
_("Keyboard"),
"res/conditions/keyboard.png")
.AddCodeOnlyParameter("currentScene", "");
#endif
extension
.AddStrExpression(
"LastPressedKey",
_("Last pressed key"),
_("Get the name of the latest key pressed on the keyboard"),
_("Keyboard"),
"res/conditions/keyboard.png")
.AddCodeOnlyParameter("currentScene", "");
#endif
}
}
} // namespace gd

View File

@@ -1,185 +1,343 @@
/*
* 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 "AllBuiltinExtensions.h"
#include "GDCore/Tools/Localization.h"
using namespace std;
namespace gd
{
void GD_CORE_API BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(gd::PlatformExtension & extension)
{
extension.SetExtensionInformation("BuiltinMathematicalTools",
_("Mathematical tools"),
_("Built-in extension providing mathematical tools"),
"Florian Rival",
"Open source (MIT License)");
#if defined(GD_IDE_ONLY)
extension.AddExpression("AngleDifference", _("Difference between two angles"), _("Difference between two angles"), _("Mathematical tools"), "res/mathfunction.png")
.AddParameter("expression", _("First angle"))
.AddParameter("expression", _("Second angle"));
extension.AddExpression("mod", _("Modulo"), _("x mod y"), _("Mathematical tools"), "res/mathfunction.png")
.AddParameter("expression", _("x (as in x mod y)"))
.AddParameter("expression", _("y (as in x mod y)"));
extension.AddExpression("min", _("Minimum of two numbers"), _("Minimum of two numbers"), _("Mathematical tools"), "res/mathfunction.png")
.AddParameter("expression", _("First expression"))
.AddParameter("expression", _("Second expression"));
extension.AddExpression("max", _("Maximum of two numbers"), _("Maximum of two numbers"), _("Mathematical tools"), "res/mathfunction.png")
.AddParameter("expression", _("First expression"))
.AddParameter("expression", _("Second expression"));
extension.AddExpression("abs", _("Absolute value"), _("Absolute value"), _("Mathematical tools"), "res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension.AddExpression("acos", _("Arccosine"), _("Arccosine"), _("Mathematical tools"), "res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension.AddExpression("acosh", _("Hyperbolic arccosine"), _("Hyperbolic arccosine"), _("Mathematical tools"), "res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension.AddExpression("asin", _("Arcsine"), _("Arcsine"), _("Mathematical tools"), "res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension.AddExpression("asinh", _("Arcsine"), _("Arcsine"), _("Mathematical tools"), "res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension.AddExpression("atan", _("Arctangent"), _("Arctangent"), _("Mathematical tools"), "res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension.AddExpression("atan2", _("2 argument arctangent"), _("2 argument arctangent (atan2)"), _("Mathematical tools"), "res/mathfunction.png")
.AddParameter("expression", _("Y"))
.AddParameter("expression", _("X"));
extension.AddExpression("atanh", _("Hyperbolic arctangent"), _("Hyperbolic arctangent"), _("Mathematical tools"), "res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension.AddExpression("cbrt", _("Cube root"), _("Cube root"), _("Mathematical tools"), "res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension.AddExpression("ceil", _("Ceil (round up)"), _("Round number up to an integer"), _("Mathematical tools"), "res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension.AddExpression("floor", _("Floor (round down)"), _("Round number down to an integer"), _("Mathematical tools"), "res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension.AddExpression("cos", _("Cosine"), _("Cosine of a number"), _("Mathematical tools"), "res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension.AddExpression("cosh", _("Hyperbolic cosine"), _("Hyperbolic cosine"), _("Mathematical tools"), "res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension.AddExpression("cot", _("Cotangent"), _("Cotangent of a number"), _("Mathematical tools"), "res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension.AddExpression("csc", _("Cosecant"), _("Cosecant of a number"), _("Mathematical tools"), "res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension.AddExpression("int", _("Round"), _("Round a number"), _("Mathematical tools"), "res/mathfunction.png")
.SetHidden()
.AddParameter("expression", _("Expression"));
extension.AddExpression("rint", _("Round"), _("Round a number"), _("Mathematical tools"), "res/mathfunction.png")
.SetHidden()
.AddParameter("expression", _("Expression"));
extension.AddExpression("round", _("Round"), _("Round a number"), _("Mathematical tools"), "res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension.AddExpression("exp", _("Exponential"), _("Exponential of a number"), _("Mathematical tools"), "res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension.AddExpression("log", _("Logarithm"), _("Logarithm"), _("Mathematical tools"), "res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension.AddExpression("ln", _("Logarithm"), _("Logarithm"), _("Mathematical tools"), "res/mathfunction.png")
.SetHidden()
.AddParameter("expression", _("Expression"));
extension.AddExpression("log2", _("Base-2 logarithm"), _("Base 2 Logarithm"), _("Mathematical tools"), "res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension.AddExpression("log10", _("Base-10 logarithm"), _("Base-10 logarithm"), _("Mathematical tools"), "res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension.AddExpression("nthroot", _("Nth root"), _("Nth root of a number"), _("Mathematical tools"), "res/mathfunction.png")
.AddParameter("expression", _("Number"))
.AddParameter("expression", _("N"));
extension.AddExpression("pow", _("Power"), _("Raise a number to power n"), _("Mathematical tools"), "res/mathfunction.png")
.AddParameter("expression", _("Number"))
.AddParameter("expression", _("The exponent (n in x^n)"));
extension.AddExpression("sec", _("Secant"), _("Secant"), _("Mathematical tools"), "res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension.AddExpression("sign", _("Sign of a number"), _("Return the sign of a number (1,-1 or 0)"), _("Mathematical tools"), "res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension.AddExpression("sin", _("Sine"), _("Sine of a number"), _("Mathematical tools"), "res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension.AddExpression("sinh", _("Hyperbolic sine"), _("Hyperbolic sine"), _("Mathematical tools"), "res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension.AddExpression("sqrt", _("Square root"), _("Square root of a number"), _("Mathematical tools"), "res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension.AddExpression("tan", _("Tangent"), _("Tangent of a number"), _("Mathematical tools"), "res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension.AddExpression("tanh", _("Hyperbolic tangent"), _("Hyperbolic tangent"), _("Mathematical tools"), "res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension.AddExpression("trunc", _("Truncation"), _("Troncate a number"), _("Mathematical tools"), "res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension.AddExpression("lerp", _("Lerp (Linear interpolation)"), _("Linearly interpolate a to b by x"), _("Mathematical tools"), "res/mathfunction.png")
.AddParameter("expression", _("a (in a+(b-a)*x)"))
.AddParameter("expression", _("b (in a+(b-a)*x)"))
.AddParameter("expression", _("x (in a+(b-a)*x)"));
#endif
namespace gd {
void GD_CORE_API
BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
gd::PlatformExtension& extension) {
extension.SetExtensionInformation(
"BuiltinMathematicalTools",
_("Mathematical tools"),
_("Built-in extension providing mathematical tools"),
"Florian Rival",
"Open source (MIT License)");
#if defined(GD_IDE_ONLY)
extension
.AddExpression("AngleDifference",
_("Difference between two angles"),
_("Difference between two angles"),
_("Mathematical tools"),
"res/mathfunction.png")
.AddParameter("expression", _("First angle"))
.AddParameter("expression", _("Second angle"));
extension
.AddExpression("mod",
_("Modulo"),
_("x mod y"),
_("Mathematical tools"),
"res/mathfunction.png")
.AddParameter("expression", _("x (as in x mod y)"))
.AddParameter("expression", _("y (as in x mod y)"));
extension
.AddExpression("min",
_("Minimum of two numbers"),
_("Minimum of two numbers"),
_("Mathematical tools"),
"res/mathfunction.png")
.AddParameter("expression", _("First expression"))
.AddParameter("expression", _("Second expression"));
extension
.AddExpression("max",
_("Maximum of two numbers"),
_("Maximum of two numbers"),
_("Mathematical tools"),
"res/mathfunction.png")
.AddParameter("expression", _("First expression"))
.AddParameter("expression", _("Second expression"));
extension
.AddExpression("abs",
_("Absolute value"),
_("Absolute value"),
_("Mathematical tools"),
"res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension
.AddExpression("acos",
_("Arccosine"),
_("Arccosine"),
_("Mathematical tools"),
"res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension
.AddExpression("acosh",
_("Hyperbolic arccosine"),
_("Hyperbolic arccosine"),
_("Mathematical tools"),
"res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension
.AddExpression("asin",
_("Arcsine"),
_("Arcsine"),
_("Mathematical tools"),
"res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension
.AddExpression("asinh",
_("Arcsine"),
_("Arcsine"),
_("Mathematical tools"),
"res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension
.AddExpression("atan",
_("Arctangent"),
_("Arctangent"),
_("Mathematical tools"),
"res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension
.AddExpression("atan2",
_("2 argument arctangent"),
_("2 argument arctangent (atan2)"),
_("Mathematical tools"),
"res/mathfunction.png")
.AddParameter("expression", _("Y"))
.AddParameter("expression", _("X"));
extension
.AddExpression("atanh",
_("Hyperbolic arctangent"),
_("Hyperbolic arctangent"),
_("Mathematical tools"),
"res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension
.AddExpression("cbrt",
_("Cube root"),
_("Cube root"),
_("Mathematical tools"),
"res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension
.AddExpression("ceil",
_("Ceil (round up)"),
_("Round number up to an integer"),
_("Mathematical tools"),
"res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension
.AddExpression("floor",
_("Floor (round down)"),
_("Round number down to an integer"),
_("Mathematical tools"),
"res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension
.AddExpression("cos",
_("Cosine"),
_("Cosine of a number"),
_("Mathematical tools"),
"res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension
.AddExpression("cosh",
_("Hyperbolic cosine"),
_("Hyperbolic cosine"),
_("Mathematical tools"),
"res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension
.AddExpression("cot",
_("Cotangent"),
_("Cotangent of a number"),
_("Mathematical tools"),
"res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension
.AddExpression("csc",
_("Cosecant"),
_("Cosecant of a number"),
_("Mathematical tools"),
"res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension
.AddExpression("int",
_("Round"),
_("Round a number"),
_("Mathematical tools"),
"res/mathfunction.png")
.SetHidden()
.AddParameter("expression", _("Expression"));
extension
.AddExpression("rint",
_("Round"),
_("Round a number"),
_("Mathematical tools"),
"res/mathfunction.png")
.SetHidden()
.AddParameter("expression", _("Expression"));
extension
.AddExpression("round",
_("Round"),
_("Round a number"),
_("Mathematical tools"),
"res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension
.AddExpression("exp",
_("Exponential"),
_("Exponential of a number"),
_("Mathematical tools"),
"res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension
.AddExpression("log",
_("Logarithm"),
_("Logarithm"),
_("Mathematical tools"),
"res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension
.AddExpression("ln",
_("Logarithm"),
_("Logarithm"),
_("Mathematical tools"),
"res/mathfunction.png")
.SetHidden()
.AddParameter("expression", _("Expression"));
extension
.AddExpression("log2",
_("Base-2 logarithm"),
_("Base 2 Logarithm"),
_("Mathematical tools"),
"res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension
.AddExpression("log10",
_("Base-10 logarithm"),
_("Base-10 logarithm"),
_("Mathematical tools"),
"res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension
.AddExpression("nthroot",
_("Nth root"),
_("Nth root of a number"),
_("Mathematical tools"),
"res/mathfunction.png")
.AddParameter("expression", _("Number"))
.AddParameter("expression", _("N"));
extension
.AddExpression("pow",
_("Power"),
_("Raise a number to power n"),
_("Mathematical tools"),
"res/mathfunction.png")
.AddParameter("expression", _("Number"))
.AddParameter("expression", _("The exponent (n in x^n)"));
extension
.AddExpression("sec",
_("Secant"),
_("Secant"),
_("Mathematical tools"),
"res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension
.AddExpression("sign",
_("Sign of a number"),
_("Return the sign of a number (1,-1 or 0)"),
_("Mathematical tools"),
"res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension
.AddExpression("sin",
_("Sine"),
_("Sine of a number"),
_("Mathematical tools"),
"res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension
.AddExpression("sinh",
_("Hyperbolic sine"),
_("Hyperbolic sine"),
_("Mathematical tools"),
"res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension
.AddExpression("sqrt",
_("Square root"),
_("Square root of a number"),
_("Mathematical tools"),
"res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension
.AddExpression("tan",
_("Tangent"),
_("Tangent of a number"),
_("Mathematical tools"),
"res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension
.AddExpression("tanh",
_("Hyperbolic tangent"),
_("Hyperbolic tangent"),
_("Mathematical tools"),
"res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension
.AddExpression("trunc",
_("Truncation"),
_("Troncate a number"),
_("Mathematical tools"),
"res/mathfunction.png")
.AddParameter("expression", _("Expression"));
extension
.AddExpression("lerp",
_("Lerp (Linear interpolation)"),
_("Linearly interpolate a to b by x"),
_("Mathematical tools"),
"res/mathfunction.png")
.AddParameter("expression", _("a (in a+(b-a)*x)"))
.AddParameter("expression", _("b (in a+(b-a)*x)"))
.AddParameter("expression", _("x (in a+(b-a)*x)"));
#endif
}
}
} // namespace gd

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