Compare commits

...

201 Commits

Author SHA1 Message Date
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
1782 changed files with 318059 additions and 20111 deletions

1
.clang_format Normal file
View File

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

View File

@@ -74,7 +74,9 @@
"__string": "cpp",
"cstring": "cpp",
"iomanip": "cpp",
"cstdint": "cpp"
"cstdint": "cpp",
"forward_list": "cpp",
"mutex": "cpp"
},
"files.exclude": {
"Binaries/*build*": true,
@@ -93,5 +95,8 @@
},
// Support for Flowtype:
"javascript.validate.enable": false,
"flow.useNPMPackagedFlow": true
"flow.useNPMPackagedFlow": true,
// Clang format styling (duplicated in scripts/CMakeClangUtils.txt)
"C_Cpp.clang_format_style": "{BasedOnStyle: Google, BinPackParameters: false, BinPackArguments: false}"
}

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

View File

@@ -586,7 +586,7 @@ gd::String EventsCodeGenerator::GenerateParameterCodes(
supplementaryParametersTypes) {
gd::String argOutput;
if (metadata.type == "expression" || metadata.type == "camera") {
if (ParameterMetadata::IsExpression("number", metadata.type)) {
CallbacksForGeneratingExpressionCode callbacks(argOutput, *this, context);
gd::ExpressionParser parser(parameter);
@@ -598,9 +598,7 @@ gd::String EventsCodeGenerator::GenerateParameterCodes(
}
if (argOutput.empty()) argOutput = "0";
} else if (metadata.type == "string" || metadata.type == "layer" ||
metadata.type == "color" || metadata.type == "file" ||
metadata.type == "joyaxis") {
} else if (ParameterMetadata::IsExpression("string", metadata.type)) {
CallbacksForGeneratingExpressionCode callbacks(argOutput, *this, context);
gd::ExpressionParser parser(parameter);
@@ -828,6 +826,7 @@ gd::String EventsCodeGenerator::ConvertToStringExplicit(
std::vector<gd::String> EventsCodeGenerator::ExpandObjectsName(
const gd::String& objectName,
const EventsCodeGenerationContext& context) const {
// Note: this logic is duplicated in EventsContextAnalyzer::ExpandObjectsName
std::vector<gd::String> realObjects;
if (project.GetObjectGroups().Has(objectName))
realObjects =

View File

@@ -374,6 +374,17 @@ class GD_CORE_API EventsCodeGenerator {
virtual gd::String GetObjectListName(
const gd::String& name, const gd::EventsCodeGenerationContext& context);
/**
* \brief Generate the code to notify the profiler of the beginning of a
* section.
*/
virtual gd::String GenerateProfilerSectionBegin(const gd::String& section) { return ""; };
/**
* \brief Generate the code to notify the profiler of the end of a section.
*/
virtual gd::String GenerateProfilerSectionEnd(const gd::String& section) { return ""; };
protected:
/**
* \brief Generate the code for a single parameter.

View File

@@ -867,7 +867,7 @@ bool ExpressionParser::PrepareParameter(
gd::Expression& parameter,
const gd::ParameterMetadata& parametersInfo,
const size_t positionInExpression) {
if (parametersInfo.type == "expression" || parametersInfo.type == "camera") {
if (ParameterMetadata::IsExpression("number", parametersInfo.type)) {
if (parametersInfo.optional && parameter.GetPlainString().empty())
parameter = parametersInfo.defaultValue.empty()
? gd::Expression("0")
@@ -879,10 +879,7 @@ bool ExpressionParser::PrepareParameter(
return false;
}
} else if (parametersInfo.type == "string" ||
parametersInfo.type == "layer" || parametersInfo.type == "color" ||
parametersInfo.type == "file" ||
parametersInfo.type == "joyaxis") {
} else if (ParameterMetadata::IsExpression("string", parametersInfo.type)) {
if (parametersInfo.optional && parameter.GetPlainString().empty())
parameter = parametersInfo.defaultValue.empty()
? gd::Expression("\"\"")

View File

@@ -11,12 +11,14 @@ 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)");
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

View File

@@ -11,11 +11,13 @@ namespace gd {
void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
gd::PlatformExtension& extension) {
extension.SetExtensionInformation("BuiltinAudio",
_("Audio"),
_("Builtin audio extension"),
"Florian Rival",
"Open source (MIT License)");
extension
.SetExtensionInformation("BuiltinAudio",
_("Audio"),
_("Builtin audio extension"),
"Florian Rival",
"Open source (MIT License)")
.SetExtensionHelpPath("/all-features/audio");
#if defined(GD_IDE_ONLY)
extension

View File

@@ -12,11 +12,13 @@ namespace gd {
void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
gd::PlatformExtension& extension) {
extension.SetExtensionInformation("BuiltinObject",
_("Base object"),
_("Base object"),
"Florian Rival",
"Open source (MIT License)");
extension
.SetExtensionInformation("BuiltinObject",
_("Base object"),
_("Base object"),
"Florian Rival",
"Open source (MIT License)")
.SetExtensionHelpPath("/objects/base_object");
gd::ObjectMetadata& obj = extension.AddObject<gd::Object>(
"", _("Base object"), _("Base object"), "res/objeticon24.png");
@@ -34,7 +36,6 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("X position"))
.MarkAsSimple()
.SetHelpPage("gdevelop/documentation/manual/base")
.SetManipulatedType("number");
obj.AddAction("MettreX",
@@ -49,7 +50,6 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
.AddParameter("operator", _("Modification's sign"))
.AddParameter("expression", _("Value"))
.MarkAsSimple()
.SetHelpPage("gdevelop/documentation/manual/base")
.SetManipulatedType("number");
obj.AddCondition("PosY",
@@ -64,7 +64,6 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("Y position"))
.MarkAsSimple()
.SetHelpPage("gdevelop/documentation/manual/base")
.SetManipulatedType("number");
obj.AddAction("MettreY",
@@ -79,7 +78,6 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
.AddParameter("operator", _("Modification's sign"))
.AddParameter("expression", _("Value"))
.MarkAsSimple()
.SetHelpPage("gdevelop/documentation/manual/base")
.SetManipulatedType("number");
obj.AddAction(
@@ -96,12 +94,12 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
.AddParameter("expression", _("X position"))
.AddParameter("operator", _("Modification's sign"))
.AddParameter("expression", _("Y position"))
.SetHelpPage("gdevelop/documentation/manual/base")
.MarkAsSimple();
obj.AddAction("MettreAutourPos",
_("Put an object around a position"),
_("Position an object around a position, with specified angle "
_("Position the center of the given object around a position, "
"using the specified angle "
"and distance."),
_("Put _PARAM0_ around _PARAM1_;_PARAM2_, with an angle of "
"_PARAM4_ degrees and _PARAM3_ pixels distance."),
@@ -114,7 +112,6 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
.AddParameter("expression", _("Y position"))
.AddParameter("expression", _("Distance"))
.AddParameter("expression", _("Angle, in degrees"))
.SetHelpPage("gdevelop/documentation/manual/base")
.MarkAsAdvanced();
obj.AddAction("SetAngle",
@@ -128,7 +125,6 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
.AddParameter("object", _("Object"))
.AddParameter("operator", _("Modification's sign"))
.AddParameter("expression", _("Value"))
.SetHelpPage("gdevelop/documentation/manual/base")
.SetManipulatedType("number");
obj.AddAction("Rotate",
@@ -143,7 +139,6 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
.AddParameter("object", _("Object"))
.AddParameter("expression", _("Angular speed (in degrees per second)"))
.AddCodeOnlyParameter("currentScene", "")
.SetHelpPage("gdevelop/documentation/manual/base")
.MarkAsSimple();
obj.AddAction(
@@ -160,7 +155,6 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
.AddParameter(
"expression",
_("Angular speed (in degrees per second) (0 for immediate rotation)"))
.SetHelpPage("gdevelop/documentation/manual/base")
.AddCodeOnlyParameter("currentScene", "");
obj.AddAction(
@@ -180,7 +174,6 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
"expression",
_("Angular speed (in degrees per second) (0 for immediate rotation)"))
.AddCodeOnlyParameter("currentScene", "")
.SetHelpPage("gdevelop/documentation/manual/base")
.MarkAsAdvanced();
obj.AddAction("AddForceXY",
@@ -196,8 +189,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
.AddParameter("object", _("Object"))
.AddParameter("expression", _("Speed on X axis (in pixels per second)"))
.AddParameter("expression", _("Speed on Y axis (in pixels per second)"))
.AddParameter("expression", _("Damping (Default: 0)"))
.SetHelpPage("gdevelop/documentation/manual/base");
.AddParameter("expression", _("Damping (Default: 0)"));
obj.AddAction("AddForceAL",
_("Add a force (angle)"),
@@ -214,7 +206,6 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
.AddParameter("expression", _("Angle"))
.AddParameter("expression", _("Speed (in pixels per second)"))
.AddParameter("expression", _("Damping (Default: 0)"))
.SetHelpPage("gdevelop/documentation/manual/base")
.MarkAsAdvanced();
obj.AddAction(
@@ -232,7 +223,6 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
.AddParameter("expression", _("Y position"))
.AddParameter("expression", _("Speed (in pixels per second)"))
.AddParameter("expression", _("Damping (Default: 0)"))
.SetHelpPage("gdevelop/documentation/manual/base#displacement")
.MarkAsAdvanced();
obj.AddAction(
@@ -265,7 +255,6 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
"res/actions/arreter.png")
.AddParameter("object", _("Object"))
.SetHelpPage("gdevelop/documentation/manual/base#displacement")
.MarkAsAdvanced();
obj.AddAction("Delete",
@@ -599,7 +588,8 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
obj.AddAction("MettreAutour",
_("Put an object around another"),
_("Position an object around another, with the specified angle "
"and distance."),
"and distance. The center of the objects are used for "
"positioning them."),
_("Put _PARAM0_ around _PARAM1_, with an angle of _PARAM3_ "
"degrees and _PARAM2_ pixels distance."),
_("Position"),
@@ -1026,6 +1016,34 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
.AddCodeOnlyParameter("conditionInverted", "")
.MarkAsAdvanced();
extension
.AddCondition(
"RaycastToPosition",
_("Raycast to position"),
_("Sends a ray from the given source position to the final point, "
"intersecting the closest object.\nThe instersected "
"object will become the only one taken into account.\nIf "
"the condition is inverted, the object to be intersected "
"will be the farthest one within the ray radius."),
_("Raycast _PARAM0_ from _PARAM1_;_PARAM2_, and save the "
"result in _PARAM5_, _PARAM6_"),
_("Collision"),
"res/conditions/raycast24.png",
"res/conditions/raycast.png")
.AddParameter("objectList", _("Objects to test against the ray"))
.AddParameter("expression", _("Ray source X position"))
.AddParameter("expression", _("Ray source Y position"))
.AddParameter("expression", _("Ray target X position"))
.AddParameter("expression", _("Ray target Y position"))
.AddParameter(
"scenevar",
_("Variable where to store the X position of the intersection"))
.AddParameter(
"scenevar",
_("Variable where to store the Y position of the intersection"))
.AddCodeOnlyParameter("conditionInverted", "")
.MarkAsAdvanced();
extension
.AddExpression(
"Count",

View File

@@ -11,11 +11,13 @@ 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)");
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

View File

@@ -12,12 +12,14 @@ 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)");
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)

View File

@@ -22,12 +22,14 @@ 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)");
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

View File

@@ -12,13 +12,15 @@ 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)");
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

View File

@@ -11,12 +11,14 @@ 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)");
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

View File

@@ -11,12 +11,14 @@ 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)");
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

View File

@@ -11,12 +11,14 @@ 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)");
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

View File

@@ -11,12 +11,14 @@ namespace gd {
void GD_CORE_API BuiltinExtensionsImplementer::ImplementsMouseExtension(
gd::PlatformExtension& extension) {
extension.SetExtensionInformation(
"BuiltinMouse",
_("Mouse features"),
_("Built-in extension that enables the use of a mouse"),
"Florian Rival",
"Open source (MIT License)");
extension
.SetExtensionInformation(
"BuiltinMouse",
_("Mouse features"),
_("Built-in extension that enables the use of a mouse"),
"Florian Rival",
"Open source (MIT License)")
.SetExtensionHelpPath("/events/mouse-touch");
#if defined(GD_IDE_ONLY)
extension

View File

@@ -11,12 +11,14 @@ namespace gd {
void GD_CORE_API BuiltinExtensionsImplementer::ImplementsNetworkExtension(
gd::PlatformExtension& extension) {
extension.SetExtensionInformation(
"BuiltinNetwork",
_("Basic internet features"),
_("Built-in extension providing network features."),
"Florian Rival",
"Open source (MIT License)");
extension
.SetExtensionInformation(
"BuiltinNetwork",
_("Basic internet features"),
_("Built-in extension providing network features."),
"Florian Rival",
"Open source (MIT License)")
.SetExtensionHelpPath("/all-features/network");
#if defined(GD_IDE_ONLY)
extension

View File

@@ -11,23 +11,61 @@ namespace gd {
void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSceneExtension(
gd::PlatformExtension& extension) {
extension.SetExtensionInformation(
"BuiltinScene",
_("Scene management features"),
_("This Built-in extension allows you to manipulate scenes"),
"Florian Rival",
"Open source (MIT License)");
extension
.SetExtensionInformation(
"BuiltinScene",
_("Scene management features"),
_("Built-in extension allowing to manipulate scenes and providing common features"),
"Florian Rival",
"Open source (MIT License)")
.SetExtensionHelpPath("" /*TODO: Add a documentation page for this */);
#if defined(GD_IDE_ONLY)
extension
.AddExpression("Random",
_("Random value"),
_("Random value"),
_("Random integer"),
_("Random integer"),
_("Random"),
"res/actions/position.png")
.AddParameter("expression", _("Maximum value"));
extension
.AddExpression("RandomInRange",
_("Random integer in range"),
_("Random integer in range"),
_("Random"),
"res/actions/position.png")
.AddParameter("expression", _("Minimum value"))
.AddParameter("expression", _("Maximum value"));
extension
.AddExpression("RandomFloat",
_("Random float"),
_("Random float"),
_("Random"),
"res/actions/position.png")
.AddParameter("expression", _("Maximum value"));
extension
.AddExpression("RandomFloatInRange",
_("Random float in range"),
_("Random float in range"),
_("Random"),
"res/actions/position.png")
.AddParameter("expression", _("Minimum value"))
.AddParameter("expression", _("Maximum value"));
extension
.AddExpression("RandomWithStep",
_("Random value in steps"),
_("Random value in steps"),
_("Random"),
"res/actions/position.png")
.AddParameter("expression", _("Minimum value"))
.AddParameter("expression", _("Maximum value"))
.AddParameter("expression", _("Step"));
extension
.AddStrExpression("CurrentSceneName",
_("Current scene name"),

View File

@@ -14,13 +14,13 @@ namespace gd {
void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSpriteExtension(
gd::PlatformExtension& extension) {
extension.SetExtensionInformation(
"Sprite",
_("Sprite"),
_("Extension for adding animated objects in the scene, which can contain "
"animations with directions within each."),
"Florian Rival",
"Open source (MIT License)");
extension
.SetExtensionInformation("Sprite",
_("Sprite"),
_("Sprite are animated object which can be used for most elements of a game."),
"Florian Rival",
"Open source (MIT License)")
.SetExtensionHelpPath("/objects/sprite");
gd::ObjectMetadata& obj = extension.AddObject<SpriteObject>(
"Sprite",

View File

@@ -12,13 +12,15 @@ namespace gd {
void GD_CORE_API
BuiltinExtensionsImplementer::ImplementsStringInstructionsExtension(
gd::PlatformExtension& extension) {
extension.SetExtensionInformation(
"BuiltinStringInstructions",
_("Text manipulation"),
_("Built-in extension providing expressions for manipulating text "
"objects."),
"Florian Rival",
"Open source (MIT License)");
extension
.SetExtensionInformation(
"BuiltinStringInstructions",
_("Text manipulation"),
_("Built-in extension providing expressions for manipulating text "
"objects."),
"Florian Rival",
"Open source (MIT License)")
.SetExtensionHelpPath("" /*TODO: Add a documentation page for this */);
#if defined(GD_IDE_ONLY)
extension.AddStrExpression("NewLine",

View File

@@ -11,12 +11,14 @@ namespace gd {
void GD_CORE_API BuiltinExtensionsImplementer::ImplementsTimeExtension(
gd::PlatformExtension& extension) {
extension.SetExtensionInformation(
"BuiltinTime",
_("Time"),
_("Built-in extension providing actions and conditions related to time."),
"Florian Rival",
"Open source (MIT License)");
extension
.SetExtensionInformation("BuiltinTime",
_("Time"),
_("Built-in extension providing actions and "
"conditions related to time."),
"Florian Rival",
"Open source (MIT License)")
.SetExtensionHelpPath("/all-features/timers");
#if defined(GD_IDE_ONLY)

View File

@@ -11,12 +11,14 @@ namespace gd {
void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
gd::PlatformExtension& extension) {
extension.SetExtensionInformation(
"BuiltinVariables",
_("Variable features"),
_("This Built-in extension allows the manipulation of variables"),
"Florian Rival",
"Open source (MIT License)");
extension
.SetExtensionInformation(
"BuiltinVariables",
_("Variable features"),
_("Built-in extension allowing to manipulate variables"),
"Florian Rival",
"Open source (MIT License)")
.SetExtensionHelpPath("/all-features/variables");
#if defined(GD_IDE_ONLY)
extension

View File

@@ -11,12 +11,14 @@ namespace gd {
void GD_CORE_API BuiltinExtensionsImplementer::ImplementsWindowExtension(
gd::PlatformExtension& extension) {
extension.SetExtensionInformation("BuiltinWindow",
_("Window features"),
_("This Built-in extension enables the "
"manipulation of the game's window"),
"Florian Rival",
"Open source (MIT License)");
extension
.SetExtensionInformation("BuiltinWindow",
_("Window features"),
_("Built-in extension allowing to manipulate "
"the game window and canvas"),
"Florian Rival",
"Open source (MIT License)")
.SetExtensionHelpPath("" /*TODO: Add a documentation page for this */);
#if defined(GD_IDE_ONLY)
extension

View File

@@ -75,7 +75,8 @@ gd::InstructionMetadata& BehaviorMetadata::AddCondition(
sentence,
group,
icon,
smallicon);
smallicon)
.SetHelpPath(GetHelpPath());
return conditionsInfos[nameWithNamespace];
#endif
}
@@ -98,7 +99,8 @@ gd::InstructionMetadata& BehaviorMetadata::AddAction(
sentence,
group,
icon,
smallicon);
smallicon)
.SetHelpPath(GetHelpPath());
return actionsInfos[nameWithNamespace];
#endif
}

View File

@@ -14,16 +14,10 @@
#endif
namespace gd {
class Behavior;
}
namespace gd {
class BehaviorsSharedData;
}
namespace gd {
class InstructionMetadata;
}
namespace gd {
class ExpressionMetadata;
}
} // namespace gd
class wxBitmap;
namespace gd {
@@ -110,6 +104,22 @@ class GD_CORE_API BehaviorMetadata {
*/
BehaviorMetadata& AddIncludeFile(const gd::String& includeFile);
/**
* Get the help path of the behavior, relative to the documentation root.
*/
const gd::String &GetHelpPath() const { return helpPath; }
/**
* Set the help path of the behavior, relative to the documentation root.
*
* The behavior instructions will have this help path set by
* default, unless you call SetHelpPath on them.
*/
BehaviorMetadata &SetHelpPath(const gd::String &path) {
helpPath = path;
return *this;
}
#if defined(GD_IDE_ONLY)
const gd::String& GetFullName() const { return fullname; }
const gd::String& GetDefaultName() const { return defaultName; }
@@ -136,6 +146,7 @@ class GD_CORE_API BehaviorMetadata {
#endif
private:
gd::String extensionNamespace;
gd::String helpPath;
#if defined(GD_IDE_ONLY)
gd::String fullname;
gd::String defaultName;

View File

@@ -181,6 +181,14 @@ class GD_CORE_API ExpressionMetadata {
return codeExtraInformation.SetFunctionName(functionName);
}
/**
* \brief Return the structure containing the information about code
* generation for the expression.
*/
ExpressionCodeGenerationInformation& GetCodeExtraInformation() {
return codeExtraInformation;
};
ExpressionCodeGenerationInformation codeExtraInformation;
/** Don't use this constructor. Only here to fullfil std::map requirements

View File

@@ -28,7 +28,7 @@ InstructionMetadata::InstructionMetadata(const gd::String& extensionNamespace_,
const gd::String& smallIcon_)
: fullname(fullname_),
description(description_),
helpPage(),
helpPath(""),
sentence(sentence_),
group(group_),
iconFilename(icon_),

View File

@@ -19,16 +19,10 @@
class wxBitmap;
namespace gd {
class Project;
}
namespace gd {
class Layout;
}
namespace gd {
class EventsCodeGenerator;
}
namespace gd {
class EventsCodeGenerationContext;
}
} // namespace gd
namespace gd {
@@ -91,9 +85,26 @@ class GD_CORE_API ParameterMetadata {
* \brief Return true if the type of the parameter is "object", "objectPtr" or
* "objectList". \see gd::ParameterMetadata::GetType
*/
static bool IsObject(const gd::String &type) {
return type == "object" || type == "objectPtr" || type == "objectList" ||
type == "objectListWithoutPicking";
static bool IsObject(const gd::String &parameterType) {
return parameterType == "object" || parameterType == "objectPtr" ||
parameterType == "objectList" ||
parameterType == "objectListWithoutPicking";
}
/**
* \brief Return true if the type of the parameter is "object", "objectPtr" or
* "objectList". \see gd::ParameterMetadata::GetType
*/
static bool IsExpression(const gd::String &type,
const gd::String &parameterType) {
if (type == "number") {
return parameterType == "expression" || parameterType == "camera";
} else if (type == "string") {
return parameterType == "string" || parameterType == "layer" ||
parameterType == "color" || parameterType == "file" ||
parameterType == "joyaxis";
}
return false;
}
};
@@ -132,15 +143,15 @@ class GD_CORE_API InstructionMetadata {
bool CanHaveSubInstructions() const { return canHaveSubInstructions; }
/**
* Get the help page of the instruction.
* Get the help path of the instruction, relative to the documentation root.
*/
const gd::String &GetHelpPage() const { return helpPage; }
const gd::String &GetHelpPath() const { return helpPath; }
/**
* Set the help page of the instruction.
* Set the help path of the instruction, relative to the documentation root.
*/
InstructionMetadata &SetHelpPage(const gd::String &page) {
helpPage = page;
InstructionMetadata &SetHelpPath(const gd::String &path) {
helpPath = path;
return *this;
}
@@ -374,6 +385,12 @@ class GD_CORE_API InstructionMetadata {
ExtraInformation codeExtraInformation; ///< Information about how generate
///< code for the instruction
/**
* \brief Return the structure containing the information about code
* generation for the instruction.
*/
ExtraInformation &GetCodeExtraInformation() { return codeExtraInformation; }
/**
* \brief Declare if the instruction being declared is somewhat manipulating
* in a standard way. \param type "number" or "string" \note Shortcut for
@@ -404,7 +421,7 @@ class GD_CORE_API InstructionMetadata {
private:
gd::String fullname;
gd::String description;
gd::String helpPage;
gd::String helpPath;
gd::String sentence;
gd::String group;
#if !defined(GD_NO_WX_GUI)

View File

@@ -21,252 +21,314 @@ gd::ObjectMetadata MetadataProvider::badObjectInfo;
gd::InstructionMetadata MetadataProvider::badInstructionMetadata;
gd::ExpressionMetadata MetadataProvider::badExpressionMetadata;
gd::ExpressionMetadata MetadataProvider::badStrExpressionMetadata;
gd::PlatformExtension MetadataProvider::badExtension;
/**
* Get the metadata about a behavior in a platform
*/
const BehaviorMetadata& MetadataProvider::GetBehaviorMetadata(
const gd::Platform& platform, gd::String behaviorType) {
for (std::size_t i = 0; i < platform.GetAllPlatformExtensions().size(); ++i) {
std::vector<gd::String> autosTypes =
platform.GetAllPlatformExtensions()[i]->GetBehaviorsTypes();
for (std::size_t j = 0; j < autosTypes.size(); ++j) {
if (autosTypes[j] == behaviorType)
return platform.GetAllPlatformExtensions()[i]->GetBehaviorMetadata(
behaviorType);
ExtensionAndMetadata<BehaviorMetadata>
MetadataProvider::GetExtensionAndBehaviorMetadata(const gd::Platform& platform,
gd::String behaviorType) {
for (auto& extension : platform.GetAllPlatformExtensions()) {
auto behaviorTypes = extension->GetBehaviorsTypes();
for (std::size_t j = 0; j < behaviorTypes.size(); ++j) {
if (behaviorTypes[j] == behaviorType)
return ExtensionAndMetadata<BehaviorMetadata>(
*extension, extension->GetBehaviorMetadata(behaviorType));
}
}
return badBehaviorInfo;
return ExtensionAndMetadata<BehaviorMetadata>(badExtension, badBehaviorInfo);
}
/**
* Get the metadata about an object in a platform
*/
const ObjectMetadata& MetadataProvider::GetObjectMetadata(
const gd::Platform& platform, gd::String objectType) {
for (std::size_t i = 0; i < platform.GetAllPlatformExtensions().size(); ++i) {
std::vector<gd::String> objectsTypes =
platform.GetAllPlatformExtensions()[i]->GetExtensionObjectsTypes();
const BehaviorMetadata& MetadataProvider::GetBehaviorMetadata(
const gd::Platform& platform, gd::String behaviorType) {
return GetExtensionAndBehaviorMetadata(platform, behaviorType).GetMetadata();
}
ExtensionAndMetadata<ObjectMetadata>
MetadataProvider::GetExtensionAndObjectMetadata(const gd::Platform& platform,
gd::String objectType) {
for (auto& extension : platform.GetAllPlatformExtensions()) {
auto objectsTypes = extension->GetExtensionObjectsTypes();
for (std::size_t j = 0; j < objectsTypes.size(); ++j) {
if (objectsTypes[j] == objectType)
return platform.GetAllPlatformExtensions()[i]->GetObjectMetadata(
objectType);
return ExtensionAndMetadata<ObjectMetadata>(
*extension, extension->GetObjectMetadata(objectType));
}
}
return badObjectInfo;
return ExtensionAndMetadata<ObjectMetadata>(badExtension, badObjectInfo);
}
const ObjectMetadata& MetadataProvider::GetObjectMetadata(
const gd::Platform& platform, gd::String objectType) {
return GetExtensionAndObjectMetadata(platform, objectType).GetMetadata();
}
ExtensionAndMetadata<InstructionMetadata>
MetadataProvider::GetExtensionAndActionMetadata(const gd::Platform& platform,
gd::String actionType) {
auto& extensions = platform.GetAllPlatformExtensions();
for (auto& extension : extensions) {
const auto& allActions = extension->GetAllActions();
if (allActions.find(actionType) != allActions.end())
return ExtensionAndMetadata<InstructionMetadata>(
*extension, allActions.find(actionType)->second);
const auto& objects = extension->GetExtensionObjectsTypes();
for (const gd::String& extObjectType : objects) {
const auto& allObjectsActions =
extension->GetAllActionsForObject(extObjectType);
if (allObjectsActions.find(actionType) != allObjectsActions.end())
return ExtensionAndMetadata<InstructionMetadata>(
*extension, allObjectsActions.find(actionType)->second);
}
const auto& autos = extension->GetBehaviorsTypes();
for (std::size_t j = 0; j < autos.size(); ++j) {
const auto& allAutosActions =
extension->GetAllActionsForBehavior(autos[j]);
if (allAutosActions.find(actionType) != allAutosActions.end())
return ExtensionAndMetadata<InstructionMetadata>(
*extension, allAutosActions.find(actionType)->second);
}
}
return ExtensionAndMetadata<InstructionMetadata>(badExtension,
badInstructionMetadata);
}
const gd::InstructionMetadata& MetadataProvider::GetActionMetadata(
const gd::Platform& platform, gd::String actionType) {
std::vector<std::shared_ptr<PlatformExtension> > extensions =
platform.GetAllPlatformExtensions();
for (std::size_t i = 0; i < extensions.size(); ++i) {
const std::map<gd::String, gd::InstructionMetadata>& allActions =
extensions[i]->GetAllActions();
if (allActions.find(actionType) != allActions.end())
return allActions.find(actionType)->second;
return GetExtensionAndActionMetadata(platform, actionType).GetMetadata();
}
const vector<gd::String>& objects =
extensions[i]->GetExtensionObjectsTypes();
for (std::size_t j = 0; j < objects.size(); ++j) {
const std::map<gd::String, gd::InstructionMetadata>& allObjectsActions =
extensions[i]->GetAllActionsForObject(objects[j]);
if (allObjectsActions.find(actionType) != allObjectsActions.end())
return allObjectsActions.find(actionType)->second;
ExtensionAndMetadata<InstructionMetadata>
MetadataProvider::GetExtensionAndConditionMetadata(const gd::Platform& platform,
gd::String conditionType) {
auto& extensions = platform.GetAllPlatformExtensions();
for (auto& extension : extensions) {
const auto& allConditions = extension->GetAllConditions();
if (allConditions.find(conditionType) != allConditions.end())
return ExtensionAndMetadata<InstructionMetadata>(
*extension, allConditions.find(conditionType)->second);
const auto& objects = extension->GetExtensionObjectsTypes();
for (const gd::String& extObjectType : objects) {
const auto& allObjetsConditions =
extension->GetAllConditionsForObject(extObjectType);
if (allObjetsConditions.find(conditionType) != allObjetsConditions.end())
return ExtensionAndMetadata<InstructionMetadata>(
*extension, allObjetsConditions.find(conditionType)->second);
}
const vector<gd::String>& autos = extensions[i]->GetBehaviorsTypes();
const auto& autos = extension->GetBehaviorsTypes();
for (std::size_t j = 0; j < autos.size(); ++j) {
const std::map<gd::String, gd::InstructionMetadata>& allAutosActions =
extensions[i]->GetAllActionsForBehavior(autos[j]);
if (allAutosActions.find(actionType) != allAutosActions.end())
return allAutosActions.find(actionType)->second;
const auto& allAutosConditions =
extension->GetAllConditionsForBehavior(autos[j]);
if (allAutosConditions.find(conditionType) != allAutosConditions.end())
return ExtensionAndMetadata<InstructionMetadata>(
*extension, allAutosConditions.find(conditionType)->second);
}
}
return badInstructionMetadata;
return ExtensionAndMetadata<InstructionMetadata>(badExtension,
badInstructionMetadata);
}
const gd::InstructionMetadata& MetadataProvider::GetConditionMetadata(
const gd::Platform& platform, gd::String conditionType) {
std::vector<std::shared_ptr<PlatformExtension> > extensions =
platform.GetAllPlatformExtensions();
for (std::size_t i = 0; i < extensions.size(); ++i) {
const std::map<gd::String, gd::InstructionMetadata>& allConditions =
extensions[i]->GetAllConditions();
if (allConditions.find(conditionType) != allConditions.end())
return allConditions.find(conditionType)->second;
return GetExtensionAndConditionMetadata(platform, conditionType)
.GetMetadata();
}
const vector<gd::String>& objects =
extensions[i]->GetExtensionObjectsTypes();
for (std::size_t j = 0; j < objects.size(); ++j) {
const std::map<gd::String, gd::InstructionMetadata>& allObjetsConditions =
extensions[i]->GetAllConditionsForObject(objects[j]);
if (allObjetsConditions.find(conditionType) != allObjetsConditions.end())
return allObjetsConditions.find(conditionType)->second;
}
const vector<gd::String>& autos = extensions[i]->GetBehaviorsTypes();
for (std::size_t j = 0; j < autos.size(); ++j) {
const std::map<gd::String, gd::InstructionMetadata>& allAutosConditions =
extensions[i]->GetAllConditionsForBehavior(autos[j]);
if (allAutosConditions.find(conditionType) != allAutosConditions.end())
return allAutosConditions.find(conditionType)->second;
ExtensionAndMetadata<ExpressionMetadata>
MetadataProvider::GetExtensionAndObjectExpressionMetadata(
const gd::Platform& platform, gd::String objectType, gd::String exprType) {
auto& extensions = platform.GetAllPlatformExtensions();
for (auto& extension : extensions) {
const auto& objects = extension->GetExtensionObjectsTypes();
if (find(objects.begin(), objects.end(), objectType) != objects.end()) {
const auto& allObjectExpressions =
extension->GetAllExpressionsForObject(objectType);
if (allObjectExpressions.find(exprType) != allObjectExpressions.end())
return ExtensionAndMetadata<ExpressionMetadata>(
*extension, allObjectExpressions.find(exprType)->second);
}
}
return badInstructionMetadata;
// Then check base
for (auto& extension : extensions) {
const auto& allObjectExpressions =
extension->GetAllExpressionsForObject("");
if (allObjectExpressions.find(exprType) != allObjectExpressions.end())
return ExtensionAndMetadata<ExpressionMetadata>(
*extension, allObjectExpressions.find(exprType)->second);
}
return ExtensionAndMetadata<ExpressionMetadata>(badExtension,
badExpressionMetadata);
}
const gd::ExpressionMetadata& MetadataProvider::GetObjectExpressionMetadata(
const gd::Platform& platform, gd::String objectType, gd::String exprType) {
std::vector<std::shared_ptr<PlatformExtension> > extensions =
platform.GetAllPlatformExtensions();
for (std::size_t i = 0; i < extensions.size(); ++i) {
const vector<gd::String>& objects =
extensions[i]->GetExtensionObjectsTypes();
if (find(objects.begin(), objects.end(), objectType) != objects.end()) {
const std::map<gd::String, gd::ExpressionMetadata>& allObjectExpressions =
extensions[i]->GetAllExpressionsForObject(objectType);
if (allObjectExpressions.find(exprType) != allObjectExpressions.end())
return allObjectExpressions.find(exprType)->second;
return GetExtensionAndObjectExpressionMetadata(platform, objectType, exprType)
.GetMetadata();
}
ExtensionAndMetadata<ExpressionMetadata>
MetadataProvider::GetExtensionAndBehaviorExpressionMetadata(
const gd::Platform& platform, gd::String autoType, gd::String exprType) {
auto& extensions = platform.GetAllPlatformExtensions();
for (auto& extension : extensions) {
const auto& autos = extension->GetBehaviorsTypes();
if (find(autos.begin(), autos.end(), autoType) != autos.end()) {
const auto& allAutoExpressions =
extension->GetAllExpressionsForBehavior(autoType);
if (allAutoExpressions.find(exprType) != allAutoExpressions.end())
return ExtensionAndMetadata<ExpressionMetadata>(
*extension, allAutoExpressions.find(exprType)->second);
}
}
// Then check base
for (std::size_t i = 0; i < extensions.size(); ++i) {
const std::map<gd::String, gd::ExpressionMetadata>& allObjectExpressions =
extensions[i]->GetAllExpressionsForObject("");
if (allObjectExpressions.find(exprType) != allObjectExpressions.end())
return allObjectExpressions.find(exprType)->second;
for (auto& extension : extensions) {
const auto& allAutoExpressions =
extension->GetAllExpressionsForBehavior("");
if (allAutoExpressions.find(exprType) != allAutoExpressions.end())
return ExtensionAndMetadata<ExpressionMetadata>(
*extension, allAutoExpressions.find(exprType)->second);
}
return badExpressionMetadata;
return ExtensionAndMetadata<ExpressionMetadata>(badExtension,
badExpressionMetadata);
}
const gd::ExpressionMetadata& MetadataProvider::GetBehaviorExpressionMetadata(
const gd::Platform& platform, gd::String autoType, gd::String exprType) {
std::vector<std::shared_ptr<PlatformExtension> > extensions =
platform.GetAllPlatformExtensions();
for (std::size_t i = 0; i < extensions.size(); ++i) {
const vector<gd::String>& autos = extensions[i]->GetBehaviorsTypes();
if (find(autos.begin(), autos.end(), autoType) != autos.end()) {
const std::map<gd::String, gd::ExpressionMetadata>& allAutoExpressions =
extensions[i]->GetAllExpressionsForBehavior(autoType);
if (allAutoExpressions.find(exprType) != allAutoExpressions.end())
return allAutoExpressions.find(exprType)->second;
}
return GetExtensionAndBehaviorExpressionMetadata(platform, autoType, exprType)
.GetMetadata();
}
ExtensionAndMetadata<ExpressionMetadata>
MetadataProvider::GetExtensionAndExpressionMetadata(
const gd::Platform& platform, gd::String exprType) {
auto& extensions = platform.GetAllPlatformExtensions();
for (auto& extension : extensions) {
const auto& allExpr = extension->GetAllExpressions();
if (allExpr.find(exprType) != allExpr.end())
return ExtensionAndMetadata<ExpressionMetadata>(
*extension, allExpr.find(exprType)->second);
}
// Then check base
for (std::size_t i = 0; i < extensions.size(); ++i) {
const std::map<gd::String, gd::ExpressionMetadata>& allAutoExpressions =
extensions[i]->GetAllExpressionsForBehavior("");
if (allAutoExpressions.find(exprType) != allAutoExpressions.end())
return allAutoExpressions.find(exprType)->second;
}
return badExpressionMetadata;
return ExtensionAndMetadata<ExpressionMetadata>(badExtension,
badExpressionMetadata);
}
const gd::ExpressionMetadata& MetadataProvider::GetExpressionMetadata(
const gd::Platform& platform, gd::String exprType) {
std::vector<std::shared_ptr<PlatformExtension> > extensions =
platform.GetAllPlatformExtensions();
for (std::size_t i = 0; i < extensions.size(); ++i) {
const std::map<gd::String, gd::ExpressionMetadata>& allExpr =
extensions[i]->GetAllExpressions();
if (allExpr.find(exprType) != allExpr.end())
return allExpr.find(exprType)->second;
}
return badExpressionMetadata;
return GetExtensionAndExpressionMetadata(platform, exprType).GetMetadata();
}
const gd::ExpressionMetadata& MetadataProvider::GetObjectStrExpressionMetadata(
ExtensionAndMetadata<ExpressionMetadata>
MetadataProvider::GetExtensionAndObjectStrExpressionMetadata(
const gd::Platform& platform, gd::String objectType, gd::String exprType) {
std::vector<std::shared_ptr<PlatformExtension> > extensions =
platform.GetAllPlatformExtensions();
for (std::size_t i = 0; i < extensions.size(); ++i) {
const vector<gd::String>& objects =
extensions[i]->GetExtensionObjectsTypes();
auto& extensions = platform.GetAllPlatformExtensions();
for (auto& extension : extensions) {
const auto& objects = extension->GetExtensionObjectsTypes();
if (find(objects.begin(), objects.end(), objectType) != objects.end()) {
const std::map<gd::String, gd::ExpressionMetadata>&
allObjectStrExpressions =
extensions[i]->GetAllStrExpressionsForObject(objectType);
const auto& allObjectStrExpressions =
extension->GetAllStrExpressionsForObject(objectType);
if (allObjectStrExpressions.find(exprType) !=
allObjectStrExpressions.end())
return allObjectStrExpressions.find(exprType)->second;
return ExtensionAndMetadata<ExpressionMetadata>(
*extension, allObjectStrExpressions.find(exprType)->second);
}
}
// Then check in functions of "Base object".
for (std::size_t i = 0; i < extensions.size(); ++i) {
const std::map<gd::String, gd::ExpressionMetadata>&
allObjectStrExpressions =
extensions[i]->GetAllStrExpressionsForObject("");
for (auto& extension : extensions) {
const auto& allObjectStrExpressions =
extension->GetAllStrExpressionsForObject("");
if (allObjectStrExpressions.find(exprType) != allObjectStrExpressions.end())
return allObjectStrExpressions.find(exprType)->second;
return ExtensionAndMetadata<ExpressionMetadata>(
*extension, allObjectStrExpressions.find(exprType)->second);
}
return badStrExpressionMetadata;
return ExtensionAndMetadata<ExpressionMetadata>(badExtension,
badStrExpressionMetadata);
}
const gd::ExpressionMetadata& MetadataProvider::GetObjectStrExpressionMetadata(
const gd::Platform& platform, gd::String objectType, gd::String exprType) {
return GetExtensionAndObjectStrExpressionMetadata(
platform, objectType, exprType)
.GetMetadata();
}
ExtensionAndMetadata<ExpressionMetadata>
MetadataProvider::GetExtensionAndBehaviorStrExpressionMetadata(
const gd::Platform& platform, gd::String autoType, gd::String exprType) {
auto& extensions = platform.GetAllPlatformExtensions();
for (auto& extension : extensions) {
const auto& autos = extension->GetBehaviorsTypes();
if (find(autos.begin(), autos.end(), autoType) != autos.end()) {
const auto& allBehaviorStrExpressions =
extension->GetAllStrExpressionsForBehavior(autoType);
if (allBehaviorStrExpressions.find(exprType) !=
allBehaviorStrExpressions.end())
return ExtensionAndMetadata<ExpressionMetadata>(
*extension, allBehaviorStrExpressions.find(exprType)->second);
}
}
// Then check in functions of "Base object".
for (auto& extension : extensions) {
const auto& allBehaviorStrExpressions =
extension->GetAllStrExpressionsForBehavior("");
if (allBehaviorStrExpressions.find(exprType) !=
allBehaviorStrExpressions.end())
return ExtensionAndMetadata<ExpressionMetadata>(
*extension, allBehaviorStrExpressions.find(exprType)->second);
}
return ExtensionAndMetadata<ExpressionMetadata>(badExtension,
badStrExpressionMetadata);
}
const gd::ExpressionMetadata&
MetadataProvider::GetBehaviorStrExpressionMetadata(const gd::Platform& platform,
gd::String autoType,
gd::String exprType) {
std::vector<std::shared_ptr<PlatformExtension> > extensions =
platform.GetAllPlatformExtensions();
for (std::size_t i = 0; i < extensions.size(); ++i) {
const vector<gd::String>& autos = extensions[i]->GetBehaviorsTypes();
if (find(autos.begin(), autos.end(), autoType) != autos.end()) {
const std::map<gd::String, gd::ExpressionMetadata>&
allBehaviorStrExpressions =
extensions[i]->GetAllStrExpressionsForBehavior(autoType);
if (allBehaviorStrExpressions.find(exprType) !=
allBehaviorStrExpressions.end())
return allBehaviorStrExpressions.find(exprType)->second;
}
return GetExtensionAndBehaviorStrExpressionMetadata(
platform, autoType, exprType)
.GetMetadata();
}
ExtensionAndMetadata<ExpressionMetadata>
MetadataProvider::GetExtensionAndStrExpressionMetadata(
const gd::Platform& platform, gd::String exprType) {
auto& extensions = platform.GetAllPlatformExtensions();
for (auto& extension : extensions) {
const auto& allExpr = extension->GetAllStrExpressions();
if (allExpr.find(exprType) != allExpr.end())
return ExtensionAndMetadata<ExpressionMetadata>(
*extension, allExpr.find(exprType)->second);
}
// Then check in functions of "Base object".
for (std::size_t i = 0; i < extensions.size(); ++i) {
const std::map<gd::String, gd::ExpressionMetadata>&
allBehaviorStrExpressions =
extensions[i]->GetAllStrExpressionsForBehavior("");
if (allBehaviorStrExpressions.find(exprType) !=
allBehaviorStrExpressions.end())
return allBehaviorStrExpressions.find(exprType)->second;
}
return badStrExpressionMetadata;
return ExtensionAndMetadata<ExpressionMetadata>(badExtension,
badStrExpressionMetadata);
}
const gd::ExpressionMetadata& MetadataProvider::GetStrExpressionMetadata(
const gd::Platform& platform, gd::String exprType) {
std::vector<std::shared_ptr<PlatformExtension> > extensions =
platform.GetAllPlatformExtensions();
for (std::size_t i = 0; i < extensions.size(); ++i) {
const std::map<gd::String, gd::ExpressionMetadata>& allExpr =
extensions[i]->GetAllStrExpressions();
if (allExpr.find(exprType) != allExpr.end())
return allExpr.find(exprType)->second;
}
return badStrExpressionMetadata;
return GetExtensionAndStrExpressionMetadata(platform, exprType).GetMetadata();
}
bool MetadataProvider::HasAction(const gd::Platform& platform,
gd::String name) {
std::vector<std::shared_ptr<PlatformExtension> > extensions =
platform.GetAllPlatformExtensions();
auto& extensions = platform.GetAllPlatformExtensions();
for (std::size_t i = 0; i < extensions.size(); ++i) {
const std::map<gd::String, gd::InstructionMetadata>& actions =
extensions[i]->GetAllActions();
for (auto& extension : extensions) {
const auto& actions = extension->GetAllActions();
if (actions.find(name) != actions.end()) return true;
}
@@ -276,18 +338,15 @@ bool MetadataProvider::HasAction(const gd::Platform& platform,
bool MetadataProvider::HasObjectAction(const gd::Platform& platform,
gd::String objectType,
gd::String name) {
std::vector<std::shared_ptr<PlatformExtension> > extensions =
platform.GetAllPlatformExtensions();
for (std::size_t i = 0; i < extensions.size(); ++i) {
const std::map<gd::String, gd::InstructionMetadata>& actions =
extensions[i]->GetAllActionsForObject(objectType);
auto& extensions = platform.GetAllPlatformExtensions();
for (auto& extension : extensions) {
const auto& actions = extension->GetAllActionsForObject(objectType);
if (actions.find(name) != actions.end()) return true;
}
// Then check in functions of "Base object".
for (std::size_t i = 0; i < extensions.size(); ++i) {
const std::map<gd::String, gd::InstructionMetadata>& actions =
extensions[i]->GetAllActionsForObject("");
for (auto& extension : extensions) {
const auto& actions = extension->GetAllActionsForObject("");
if (actions.find(name) != actions.end()) return true;
}
@@ -297,18 +356,15 @@ bool MetadataProvider::HasObjectAction(const gd::Platform& platform,
bool MetadataProvider::HasBehaviorAction(const gd::Platform& platform,
gd::String behaviorType,
gd::String name) {
std::vector<std::shared_ptr<PlatformExtension> > extensions =
platform.GetAllPlatformExtensions();
for (std::size_t i = 0; i < extensions.size(); ++i) {
const std::map<gd::String, gd::InstructionMetadata>& actions =
extensions[i]->GetAllActionsForBehavior(behaviorType);
auto& extensions = platform.GetAllPlatformExtensions();
for (auto& extension : extensions) {
const auto& actions = extension->GetAllActionsForBehavior(behaviorType);
if (actions.find(name) != actions.end()) return true;
}
// Then check in functions of "Base object".
for (std::size_t i = 0; i < extensions.size(); ++i) {
const std::map<gd::String, gd::InstructionMetadata>& actions =
extensions[i]->GetAllActionsForBehavior("");
for (auto& extension : extensions) {
const auto& actions = extension->GetAllActionsForBehavior("");
if (actions.find(name) != actions.end()) return true;
}
@@ -317,11 +373,9 @@ bool MetadataProvider::HasBehaviorAction(const gd::Platform& platform,
bool MetadataProvider::HasCondition(const gd::Platform& platform,
gd::String name) {
std::vector<std::shared_ptr<PlatformExtension> > extensions =
platform.GetAllPlatformExtensions();
for (std::size_t i = 0; i < extensions.size(); ++i) {
const std::map<gd::String, gd::InstructionMetadata>& conditions =
extensions[i]->GetAllConditions();
auto& extensions = platform.GetAllPlatformExtensions();
for (auto& extension : extensions) {
const auto& conditions = extension->GetAllConditions();
if (conditions.find(name) != conditions.end()) return true;
}
@@ -331,18 +385,15 @@ bool MetadataProvider::HasCondition(const gd::Platform& platform,
bool MetadataProvider::HasObjectCondition(const gd::Platform& platform,
gd::String objectType,
gd::String name) {
std::vector<std::shared_ptr<PlatformExtension> > extensions =
platform.GetAllPlatformExtensions();
for (std::size_t i = 0; i < extensions.size(); ++i) {
const std::map<gd::String, gd::InstructionMetadata>& conditions =
extensions[i]->GetAllConditionsForObject(objectType);
auto& extensions = platform.GetAllPlatformExtensions();
for (auto& extension : extensions) {
const auto& conditions = extension->GetAllConditionsForObject(objectType);
if (conditions.find(name) != conditions.end()) return true;
}
// Then check in functions of "Base object".
for (std::size_t i = 0; i < extensions.size(); ++i) {
const std::map<gd::String, gd::InstructionMetadata>& conditions =
extensions[i]->GetAllConditionsForObject("");
for (auto& extension : extensions) {
const auto& conditions = extension->GetAllConditionsForObject("");
if (conditions.find(name) != conditions.end()) return true;
}
@@ -352,18 +403,16 @@ bool MetadataProvider::HasObjectCondition(const gd::Platform& platform,
bool MetadataProvider::HasBehaviorCondition(const gd::Platform& platform,
gd::String behaviorType,
gd::String name) {
std::vector<std::shared_ptr<PlatformExtension> > extensions =
platform.GetAllPlatformExtensions();
for (std::size_t i = 0; i < extensions.size(); ++i) {
const std::map<gd::String, gd::InstructionMetadata>& conditions =
extensions[i]->GetAllConditionsForBehavior(behaviorType);
auto& extensions = platform.GetAllPlatformExtensions();
for (auto& extension : extensions) {
const auto& conditions =
extension->GetAllConditionsForBehavior(behaviorType);
if (conditions.find(name) != conditions.end()) return true;
}
// Then check in functions of "Base object".
for (std::size_t i = 0; i < extensions.size(); ++i) {
const std::map<gd::String, gd::InstructionMetadata>& conditions =
extensions[i]->GetAllConditionsForBehavior("");
for (auto& extension : extensions) {
const auto& conditions = extension->GetAllConditionsForBehavior("");
if (conditions.find(name) != conditions.end()) return true;
}
@@ -372,11 +421,9 @@ bool MetadataProvider::HasBehaviorCondition(const gd::Platform& platform,
bool MetadataProvider::HasExpression(const gd::Platform& platform,
gd::String name) {
std::vector<std::shared_ptr<PlatformExtension> > extensions =
platform.GetAllPlatformExtensions();
for (std::size_t i = 0; i < extensions.size(); ++i) {
const std::map<gd::String, gd::ExpressionMetadata>& expressions =
extensions[i]->GetAllExpressions();
auto& extensions = platform.GetAllPlatformExtensions();
for (auto& extension : extensions) {
const auto& expressions = extension->GetAllExpressions();
if (expressions.find(name) != expressions.end()) return true;
}
@@ -386,18 +433,15 @@ bool MetadataProvider::HasExpression(const gd::Platform& platform,
bool MetadataProvider::HasObjectExpression(const gd::Platform& platform,
gd::String objectType,
gd::String name) {
std::vector<std::shared_ptr<PlatformExtension> > extensions =
platform.GetAllPlatformExtensions();
for (std::size_t i = 0; i < extensions.size(); ++i) {
const std::map<gd::String, gd::ExpressionMetadata>& expressions =
extensions[i]->GetAllExpressionsForObject(objectType);
auto& extensions = platform.GetAllPlatformExtensions();
for (auto& extension : extensions) {
const auto& expressions = extension->GetAllExpressionsForObject(objectType);
if (expressions.find(name) != expressions.end()) return true;
}
// Then check in functions of "Base object".
for (std::size_t i = 0; i < extensions.size(); ++i) {
const std::map<gd::String, gd::ExpressionMetadata>& expressions =
extensions[i]->GetAllExpressionsForObject("");
for (auto& extension : extensions) {
const auto& expressions = extension->GetAllExpressionsForObject("");
if (expressions.find(name) != expressions.end()) return true;
}
@@ -407,18 +451,16 @@ bool MetadataProvider::HasObjectExpression(const gd::Platform& platform,
bool MetadataProvider::HasBehaviorExpression(const gd::Platform& platform,
gd::String behaviorType,
gd::String name) {
std::vector<std::shared_ptr<PlatformExtension> > extensions =
platform.GetAllPlatformExtensions();
for (std::size_t i = 0; i < extensions.size(); ++i) {
const std::map<gd::String, gd::ExpressionMetadata>& expressions =
extensions[i]->GetAllExpressionsForBehavior(behaviorType);
auto& extensions = platform.GetAllPlatformExtensions();
for (auto& extension : extensions) {
const auto& expressions =
extension->GetAllExpressionsForBehavior(behaviorType);
if (expressions.find(name) != expressions.end()) return true;
}
// Then check in functions of "Base object".
for (std::size_t i = 0; i < extensions.size(); ++i) {
const std::map<gd::String, gd::ExpressionMetadata>& expressions =
extensions[i]->GetAllExpressionsForBehavior("");
for (auto& extension : extensions) {
const auto& expressions = extension->GetAllExpressionsForBehavior("");
if (expressions.find(name) != expressions.end()) return true;
}
@@ -427,11 +469,9 @@ bool MetadataProvider::HasBehaviorExpression(const gd::Platform& platform,
bool MetadataProvider::HasStrExpression(const gd::Platform& platform,
gd::String name) {
std::vector<std::shared_ptr<PlatformExtension> > extensions =
platform.GetAllPlatformExtensions();
for (std::size_t i = 0; i < extensions.size(); ++i) {
const std::map<gd::String, gd::ExpressionMetadata>& expressions =
extensions[i]->GetAllStrExpressions();
auto& extensions = platform.GetAllPlatformExtensions();
for (auto& extension : extensions) {
const auto& expressions = extension->GetAllStrExpressions();
if (expressions.find(name) != expressions.end()) return true;
}
@@ -441,18 +481,16 @@ bool MetadataProvider::HasStrExpression(const gd::Platform& platform,
bool MetadataProvider::HasObjectStrExpression(const gd::Platform& platform,
gd::String objectType,
gd::String name) {
std::vector<std::shared_ptr<PlatformExtension> > extensions =
platform.GetAllPlatformExtensions();
for (std::size_t i = 0; i < extensions.size(); ++i) {
const std::map<gd::String, gd::ExpressionMetadata>& expressions =
extensions[i]->GetAllStrExpressionsForObject(objectType);
auto& extensions = platform.GetAllPlatformExtensions();
for (auto& extension : extensions) {
const auto& expressions =
extension->GetAllStrExpressionsForObject(objectType);
if (expressions.find(name) != expressions.end()) return true;
}
// Then check in functions of "Base object".
for (std::size_t i = 0; i < extensions.size(); ++i) {
const std::map<gd::String, gd::ExpressionMetadata>& expressions =
extensions[i]->GetAllStrExpressionsForObject("");
for (auto& extension : extensions) {
const auto& expressions = extension->GetAllStrExpressionsForObject("");
if (expressions.find(name) != expressions.end()) return true;
}
@@ -462,18 +500,16 @@ bool MetadataProvider::HasObjectStrExpression(const gd::Platform& platform,
bool MetadataProvider::HasBehaviorStrExpression(const gd::Platform& platform,
gd::String behaviorType,
gd::String name) {
std::vector<std::shared_ptr<PlatformExtension> > extensions =
platform.GetAllPlatformExtensions();
for (std::size_t i = 0; i < extensions.size(); ++i) {
const std::map<gd::String, gd::ExpressionMetadata>& expressions =
extensions[i]->GetAllStrExpressionsForBehavior(behaviorType);
auto& extensions = platform.GetAllPlatformExtensions();
for (auto& extension : extensions) {
const auto& expressions =
extension->GetAllStrExpressionsForBehavior(behaviorType);
if (expressions.find(name) != expressions.end()) return true;
}
// Then check in functions of "Base object".
for (std::size_t i = 0; i < extensions.size(); ++i) {
const std::map<gd::String, gd::ExpressionMetadata>& expressions =
extensions[i]->GetAllStrExpressionsForBehavior("");
for (auto& extension : extensions) {
const auto& expressions = extension->GetAllStrExpressionsForBehavior("");
if (expressions.find(name) != expressions.end()) return true;
}

View File

@@ -9,52 +9,159 @@
#include "GDCore/String.h"
namespace gd {
class BehaviorMetadata;
}
namespace gd {
class ObjectMetadata;
}
namespace gd {
class ExpressionMetadata;
}
namespace gd {
class ExpressionMetadata;
}
namespace gd {
class Platform;
}
class PlatformExtension;
} // namespace gd
namespace gd {
/**
* \brief A container for metadata about an object/behavior/instruction/expression
* and its associated extension.
*/
template <class T>
class ExtensionAndMetadata {
public:
ExtensionAndMetadata(const gd::PlatformExtension& extension_,
const T& metadata_)
: extension(&extension_), metadata(&metadata_){};
/**
* \brief Default constructor, only here to satisfy Emscripten bindings.
* \warning Please do not use.
* \private
*/
ExtensionAndMetadata()
: extension(nullptr), metadata(nullptr){};
/**
* \brief Get the associated extension.
*/
const gd::PlatformExtension& GetExtension() { return *extension; };
/**
* \brief Get the metadata.
*/
const T& GetMetadata() { return *metadata; };
private:
const gd::PlatformExtension* extension;
const T* metadata;
};
/**
* \brief Allow to easily get metadata for instructions (i.e actions and
* conditions), objects and behaviors.
* conditions), expressions, objects and behaviors.
*
* \ingroup PlatformDefinition
*/
class GD_CORE_API MetadataProvider {
public:
/**
* Get the metadata about a behavior in a project using a platform
* Get the metadata about a behavior, and its associated extension.
*/
static ExtensionAndMetadata<BehaviorMetadata> GetExtensionAndBehaviorMetadata(
const gd::Platform& platform, gd::String behaviorType);
/**
* Get the metadata about an object, and its associated extension.
*/
static ExtensionAndMetadata<ObjectMetadata> GetExtensionAndObjectMetadata(
const gd::Platform& platform, gd::String type);
/**
* Get the metadata of an action, and its associated extension.
* Works for object, behaviors and static actions.
*/
static ExtensionAndMetadata<InstructionMetadata>
GetExtensionAndActionMetadata(const gd::Platform& platform,
gd::String actionType);
/**
* Get the metadata of a condition, and its associated extension.
* Works for object, behaviors and static conditions.
*/
static ExtensionAndMetadata<InstructionMetadata>
GetExtensionAndConditionMetadata(const gd::Platform& platform,
gd::String conditionType);
/**
* Get information about an expression, and its associated extension.
* Works for static expressions.
*/
static ExtensionAndMetadata<ExpressionMetadata>
GetExtensionAndExpressionMetadata(const gd::Platform& platform,
gd::String exprType);
/**
* Get information about an expression, and its associated extension.
* Works for object expressions.
*/
static ExtensionAndMetadata<ExpressionMetadata>
GetExtensionAndObjectExpressionMetadata(const gd::Platform& platform,
gd::String objectType,
gd::String exprType);
/**
* Get information about an expression, and its associated extension.
* Works for behavior expressions.
*/
static ExtensionAndMetadata<ExpressionMetadata>
GetExtensionAndBehaviorExpressionMetadata(const gd::Platform& platform,
gd::String autoType,
gd::String exprType);
/**
* Get information about a string expression, and its associated extension.
* Works for static expressions.
*/
static ExtensionAndMetadata<ExpressionMetadata>
GetExtensionAndStrExpressionMetadata(const gd::Platform& platform,
gd::String exprType);
/**
* Get information about a string expression, and its associated extension.
* Works for object expressions.
*/
static ExtensionAndMetadata<ExpressionMetadata>
GetExtensionAndObjectStrExpressionMetadata(const gd::Platform& platform,
gd::String objectType,
gd::String exprType);
/**
* Get information about a string expression, and its associated extension.
* Works for behavior expressions.
*/
static ExtensionAndMetadata<ExpressionMetadata>
GetExtensionAndBehaviorStrExpressionMetadata(const gd::Platform& platform,
gd::String autoType,
gd::String exprType);
/**
* Get the metadata about a behavior.
*/
static const BehaviorMetadata& GetBehaviorMetadata(
const gd::Platform& platform, gd::String behaviorType);
/**
* Get the metadata about an object in a project using a platform
* Get the metadata about an object.
*/
static const ObjectMetadata& GetObjectMetadata(const gd::Platform& platform,
gd::String type);
/**
* Get the metadata of an action.
* Must work for object, behaviors and static actions.
* Works for object, behaviors and static actions.
*/
static const gd::InstructionMetadata& GetActionMetadata(
const gd::Platform& platform, gd::String actionType);
/**
* Get the metadata of a condition.
* Must Work for object, behaviors and static conditions.
* Works for object, behaviors and static conditions.
*/
static const gd::InstructionMetadata& GetConditionMetadata(
const gd::Platform& platform, gd::String conditionType);
@@ -81,109 +188,109 @@ class GD_CORE_API MetadataProvider {
const gd::Platform& platform, gd::String autoType, gd::String exprType);
/**
* Get information about a gd::String expression from its type
* Get information about a string expression from its type
* Works for static expressions.
*/
static const gd::ExpressionMetadata& GetStrExpressionMetadata(
const gd::Platform& platform, gd::String exprType);
/**
* Get information about a gd::String expression from its type
* Get information about a string expression from its type
* Works for object expressions.
*/
static const gd::ExpressionMetadata& GetObjectStrExpressionMetadata(
const gd::Platform& platform, gd::String objectType, gd::String exprType);
/**
* Get information about a gd::String expression from its type
* Get information about a string expression from its type
* Works for behavior expressions.
*/
static const gd::ExpressionMetadata& GetBehaviorStrExpressionMetadata(
const gd::Platform& platform, gd::String autoType, gd::String exprType);
/**
* Verifying if a ( static ) condition exists
* @return true if the ( static ) condition exists
* \brief Check if a (static) condition exists
* @return true if the (static) condition exists
*/
static bool HasCondition(const gd::Platform& platform, gd::String name);
/**
* Verifying if a ( static ) action exists
* @return true if the ( static ) action exists
* \brief Check if a (static) action exists
* @return true if the (static) action exists
*/
static bool HasAction(const gd::Platform& platform, gd::String name);
/**
* Verifying if a ( object ) action exists
* @return true if the ( object ) action exists
* \brief Check if a (object) action exists
* @return true if the (object) action exists
*/
static bool HasObjectAction(const gd::Platform& platform,
gd::String objectType,
gd::String name);
/**
* Verifying if a ( object ) condition exists
* @return true if the ( object ) condition exists
* \brief Check if a (object) condition exists
* @return true if the (object) condition exists
*/
static bool HasObjectCondition(const gd::Platform& platform,
gd::String objectType,
gd::String name);
/**
* Verifying if a ( Behavior ) action exists
* @return true if the ( Behavior ) action exists
* \brief Check if a (behavior) action exists
* @return true if the (behavior) action exists
*/
static bool HasBehaviorAction(const gd::Platform& platform,
gd::String behaviorType,
gd::String name);
/**
* Verifying if a ( Behavior ) condition exists
* @return true if the ( Behavior ) condition exists
* \brief Check if a (behavior) condition exists
* @return true if the (behavior) condition exists
*/
static bool HasBehaviorCondition(const gd::Platform& platform,
gd::String behaviorType,
gd::String name);
/**
* Verifying if a ( static ) expression exists
* @return true if the ( static ) expression exists
* \brief Check if a (static) expression exists
* @return true if the (static) expression exists
*/
static bool HasExpression(const gd::Platform& platform, gd::String name);
/**
* Verifying if a ( object ) expression exists
* @return true if the ( object ) expression exists
* \brief Check if a (object) expression exists
* @return true if the (object) expression exists
*/
static bool HasObjectExpression(const gd::Platform& platform,
gd::String objectType,
gd::String name);
/**
* Verifying if a ( behavior ) expression exists
* @return true if the ( behavior ) expression exists
* \brief Check if a (behavior) expression exists
* @return true if the (behavior) expression exists
*/
static bool HasBehaviorExpression(const gd::Platform& platform,
gd::String behaviorType,
gd::String name);
/**
* Verifying if a ( static ) gd::String expression exists
* @return true if the ( static ) gd::String expression exists
* \brief Check if a (static) string expression exists
* @return true if the (static) string expression exists
*/
static bool HasStrExpression(const gd::Platform& platform, gd::String name);
/**
* Verifying if a ( object ) gd::String expression exists
* @return true if the ( object ) gd::String expression exists
* \brief Check if a (object) string expression exists
* @return true if the (object) string expression exists
*/
static bool HasObjectStrExpression(const gd::Platform& platform,
gd::String objectType,
gd::String name);
/**
* Verifying if a ( object ) gd::String expression exists
* @return true if the ( object ) gd::String expression exists
* \brief Check if a (behavior) string expression exists
* @return true if the (behavior) string expression exists
*/
static bool HasBehaviorStrExpression(const gd::Platform& platform,
gd::String behaviorType,
@@ -194,6 +301,7 @@ class GD_CORE_API MetadataProvider {
private:
MetadataProvider();
static PlatformExtension badExtension;
static BehaviorMetadata badBehaviorInfo;
static ObjectMetadata badObjectInfo;
static gd::InstructionMetadata badInstructionMetadata;

View File

@@ -8,6 +8,7 @@
#include <iostream>
#include "GDCore/Extensions/Metadata/ExpressionMetadata.h"
#include "GDCore/Extensions/Metadata/InstructionMetadata.h"
#include "GDCore/Project/Object.h"
#if defined(GD_IDE_ONLY) && !defined(GD_NO_WX_GUI)
#include <wx/bitmap.h>
#include <wx/file.h>
@@ -19,14 +20,58 @@ namespace gd {
ObjectMetadata::ObjectMetadata(const gd::String& extensionNamespace_,
const gd::String& name_,
const gd::String& fullname_,
const gd::String& informations_,
const gd::String& description_,
const gd::String& icon24x24,
std::shared_ptr<gd::Object> blueprintObject_)
: extensionNamespace(extensionNamespace_),
blueprintObject(blueprintObject_) {
name = name_;
#if defined(GD_IDE_ONLY)
SetFullName(gd::String(fullname_));
SetDescription(gd::String(description_));
iconFilename = icon24x24;
#if !defined(GD_NO_WX_GUI)
if (!iconFilename.empty()) {
if (gd::SkinHelper::IconExists(icon24x24, 24))
SetBitmapIcon(gd::SkinHelper::GetIcon(icon24x24, 24));
else if (wxFile::Exists(icon24x24))
SetBitmapIcon(wxBitmap(icon24x24, wxBITMAP_TYPE_ANY));
else {
std::cout << "Warning: The icon file for object \"" << name_
<< " was not found in the current skin icons"
<< " and the specified name is not an existing filename.";
SetBitmapIcon(wxBitmap(24, 24));
}
}
#endif
#endif
createFunPtr =
[blueprintObject_](gd::String name) -> std::unique_ptr<gd::Object> {
if (blueprintObject_ == std::shared_ptr<gd::Object>()) {
std::cout
<< "Error: Unable to create object. Have you declared an extension "
"(or ObjectMetadata) without specifying an object as blueprint?"
<< std::endl;
return nullptr;
}
std::unique_ptr<gd::Object> newObject = blueprintObject_->Clone();
newObject->SetName(name);
return newObject;
};
}
ObjectMetadata::ObjectMetadata(const gd::String& extensionNamespace_,
const gd::String& name_,
const gd::String& fullname_,
const gd::String& description_,
const gd::String& icon24x24,
CreateFunPtr createFunPtrP)
: extensionNamespace(extensionNamespace_) {
name = name_;
#if defined(GD_IDE_ONLY)
SetFullName(gd::String(fullname_));
SetDescription(gd::String(informations_));
SetDescription(gd::String(description_));
iconFilename = icon24x24;
#if !defined(GD_NO_WX_GUI)
if (!iconFilename.empty()) {
@@ -64,7 +109,8 @@ gd::InstructionMetadata& ObjectMetadata::AddCondition(
sentence,
group,
icon,
smallicon);
smallicon)
.SetHelpPath(GetHelpPath());
return conditionsInfos[nameWithNamespace];
#endif
}
@@ -87,7 +133,8 @@ gd::InstructionMetadata& ObjectMetadata::AddAction(
sentence,
group,
icon,
smallicon);
smallicon)
.SetHelpPath(GetHelpPath());
return actionsInfos[nameWithNamespace];
#endif
}

View File

@@ -7,24 +7,21 @@
#define OBJECTMETADATA_H
#include <map>
#include <memory>
#include <functional>
#include "GDCore/Extensions/Metadata/ExpressionMetadata.h"
#include "GDCore/Extensions/Metadata/InstructionMetadata.h"
#include "GDCore/Project/Object.h"
#include "GDCore/String.h"
#if defined(GD_IDE_ONLY) && !defined(GD_NO_WX_GUI)
#include <wx/bitmap.h>
#endif
namespace gd {
class Object;
}
namespace gd {
class InstructionMetadata;
}
namespace gd {
class ExpressionMetadata;
}
} // namespace gd
class wxBitmap;
typedef std::unique_ptr<gd::Object> (*CreateFunPtr)(gd::String name);
typedef std::function<std::unique_ptr<gd::Object>(gd::String name)> CreateFunPtr;
namespace gd {
@@ -36,10 +33,25 @@ namespace gd {
*/
class GD_CORE_API ObjectMetadata {
public:
/**
* \brief Construct an object metadata, using a "blueprint" object that will
* be copied when a new object is asked.
*/
ObjectMetadata(const gd::String& extensionNamespace_,
const gd::String& name_,
const gd::String& fullname_,
const gd::String& informations_,
const gd::String& description_,
const gd::String& icon24x24_,
std::shared_ptr<gd::Object> blueprintObject_);
/**
* \brief Construct an object metadata, with a function that will be called
* to instanciate a new object.
*/
ObjectMetadata(const gd::String& extensionNamespace_,
const gd::String& name_,
const gd::String& fullname_,
const gd::String& description_,
const gd::String& icon24x24_,
CreateFunPtr createFunPtrP);
ObjectMetadata() : createFunPtr(NULL) {}
@@ -105,6 +117,22 @@ class GD_CORE_API ObjectMetadata {
*/
ObjectMetadata& SetBitmapIcon(const wxBitmap& bitmap_);
/**
* Get the help path of the object, relative to the documentation root.
*/
const gd::String &GetHelpPath() const { return helpPath; }
/**
* Set the help path of the object, relative to the documentation root.
*
* The object instructions will have this help path set by
* default, unless you call SetHelpPath on them.
*/
ObjectMetadata &SetHelpPath(const gd::String &path) {
helpPath = path;
return *this;
}
const gd::String& GetName() const { return name; }
#if defined(GD_IDE_ONLY)
const gd::String& GetFullName() const { return fullname; }
@@ -119,6 +147,7 @@ class GD_CORE_API ObjectMetadata {
/**
* \brief Set the URL pointing to the help page about this object
* \note The path to the page must be relative to the wiki url.
* \deprecated Use SetHelpPath instead
*/
ObjectMetadata& SetHelpUrl(const gd::String& url);
@@ -148,8 +177,9 @@ class GD_CORE_API ObjectMetadata {
private:
gd::String extensionNamespace;
gd::String name;
gd::String helpPath;
#if defined(GD_IDE_ONLY)
gd::String helpUrl;
gd::String helpUrl; ///< Deprecated. Use helpPath instead.
gd::String fullname;
gd::String description;
gd::String iconFilename;
@@ -157,6 +187,10 @@ class GD_CORE_API ObjectMetadata {
wxBitmap icon;
#endif
#endif
std::shared_ptr<gd::Object>
blueprintObject; ///< The "blueprint" object to be copied when a new
///< object is asked. Can be null in case a creation
///< function is passed.
};
} // namespace gd

View File

@@ -20,20 +20,21 @@ namespace gd {
gd::ChangesNotifier Platform::defaultEmptyChangesNotifier;
#endif
Platform::Platform() {
}
Platform::Platform() {}
Platform::~Platform() {
}
Platform::~Platform() {}
bool Platform::AddExtension(std::shared_ptr<gd::PlatformExtension> extension) {
std::cout << extension->GetName();
bool loaded = false;
for (std::size_t i = 0; i < extensionsLoaded.size(); ++i) {
if (extensionsLoaded[i]->GetName() == extension->GetName()) {
std::cout << "(Already loaded!)" << std::endl;
return false;
std::cout << "(replacing existing extension)" << std::endl;
extensionsLoaded[i] = extension;
loaded = true;
}
}
if (!loaded) extensionsLoaded.push_back(extension);
// Load all creation/destruction functions for objects provided by the
// extension
@@ -43,7 +44,6 @@ bool Platform::AddExtension(std::shared_ptr<gd::PlatformExtension> extension) {
extension->GetObjectCreationFunctionPtr(objectsTypes[i]);
}
extensionsLoaded.push_back(extension);
std::cout << ", ";
return true;
}

View File

@@ -25,9 +25,9 @@ class BehaviorsSharedData;
class PlatformExtension;
class LayoutEditorCanvas;
class ProjectExporter;
}
} // namespace gd
typedef std::unique_ptr<gd::Object> (*CreateFunPtr)(gd::String name);
typedef std::function<std::unique_ptr<gd::Object>(gd::String name)> CreateFunPtr;
#undef CreateEvent

View File

@@ -50,7 +50,8 @@ gd::InstructionMetadata& PlatformExtension::AddCondition(
sentence,
group,
icon,
smallicon);
smallicon)
.SetHelpPath(GetHelpPath());
return conditionsInfos[nameWithNamespace];
#endif
}
@@ -73,7 +74,8 @@ gd::InstructionMetadata& PlatformExtension::AddAction(
sentence,
group,
icon,
smallicon);
smallicon)
.SetHelpPath(GetHelpPath());
return actionsInfos[nameWithNamespace];
#endif
}
@@ -116,6 +118,25 @@ gd::ExpressionMetadata& PlatformExtension::AddStrExpression(
#endif
}
gd::ObjectMetadata& PlatformExtension::AddObject(
const gd::String& name,
const gd::String& fullname,
const gd::String& description,
const gd::String& icon24x24,
std::shared_ptr<gd::Object> instance) {
gd::String nameWithNamespace =
GetNameSpace().empty() ? name : GetNameSpace() + name;
objectsInfos[nameWithNamespace] = ObjectMetadata(GetNameSpace(),
nameWithNamespace,
fullname,
description,
icon24x24,
instance)
.SetHelpPath(GetHelpPath());
return objectsInfos[nameWithNamespace];
}
gd::BehaviorMetadata& PlatformExtension::AddBehavior(
const gd::String& name,
const gd::String& fullname,
@@ -137,7 +158,8 @@ gd::BehaviorMetadata& PlatformExtension::AddBehavior(
icon24x24,
className,
instance,
sharedDatasInstance);
sharedDatasInstance)
.SetHelpPath(GetHelpPath());
return behaviorsInfo[nameWithNamespace];
}
@@ -161,17 +183,19 @@ gd::EventMetadata& PlatformExtension::AddEvent(
#endif
}
void PlatformExtension::SetExtensionInformation(const gd::String& name_,
const gd::String& fullname_,
const gd::String& description_,
const gd::String& author_,
const gd::String& license_) {
PlatformExtension& PlatformExtension::SetExtensionInformation(
const gd::String& name_,
const gd::String& fullname_,
const gd::String& description_,
const gd::String& author_,
const gd::String& license_) {
name = name_;
fullname = fullname_;
informations = description_;
author = author_;
license = license_;
SetNameSpace(name_);
return *this;
}
std::vector<gd::String> PlatformExtension::GetExtensionObjectsTypes() const {
@@ -399,131 +423,6 @@ bool PlatformExtension::IsBuiltin() const {
}
#if defined(GD_IDE_ONLY)
void PlatformExtension::CloneExtension(
const gd::String& platformName,
const gd::String& extensionName,
bool stripFunctionsNameAndCodeGeneration) {
gd::Platform* platform =
gd::PlatformManager::Get()->GetPlatform(platformName);
if (!platform) {
std::cout << "Unable to clone extension \"" << extensionName << "\" from "
<< platformName << ": This platform doesn't exist.";
return;
}
std::shared_ptr<gd::PlatformExtension> extension =
platform->GetExtension(extensionName);
if (!extension) {
std::cout << "Unable to clone extension \"" << extensionName << "\" from "
<< platformName << ": This extension doesn't exist.";
return;
}
*this = *extension;
if (stripFunctionsNameAndCodeGeneration) {
for (std::map<gd::String, gd::InstructionMetadata>::iterator it =
GetAllActions().begin();
it != GetAllActions().end();
++it)
it->second.SetFunctionName("").SetGetter("").RemoveCustomCodeGenerator();
for (std::map<gd::String, gd::InstructionMetadata>::iterator it =
GetAllConditions().begin();
it != GetAllConditions().end();
++it)
it->second.SetFunctionName("").SetGetter("").RemoveCustomCodeGenerator();
for (std::map<gd::String, gd::ExpressionMetadata>::iterator it =
GetAllExpressions().begin();
it != GetAllExpressions().end();
++it)
it->second.SetFunctionName("").RemoveCustomCodeGenerator();
for (std::map<gd::String, gd::ExpressionMetadata>::iterator it =
GetAllStrExpressions().begin();
it != GetAllStrExpressions().end();
++it)
it->second.SetFunctionName("").RemoveCustomCodeGenerator();
for (std::map<gd::String, gd::ObjectMetadata>::iterator objIt =
objectsInfos.begin();
objIt != objectsInfos.end();
++objIt) {
gd::ObjectMetadata& obj = objIt->second;
for (std::map<gd::String, gd::InstructionMetadata>::iterator it =
obj.actionsInfos.begin();
it != obj.actionsInfos.end();
++it)
it->second.SetFunctionName("")
.SetGetter("")
.RemoveCustomCodeGenerator();
for (std::map<gd::String, gd::InstructionMetadata>::iterator it =
obj.conditionsInfos.begin();
it != obj.conditionsInfos.end();
++it)
it->second.SetFunctionName("")
.SetGetter("")
.RemoveCustomCodeGenerator();
for (std::map<gd::String, gd::ExpressionMetadata>::iterator it =
obj.expressionsInfos.begin();
it != obj.expressionsInfos.end();
++it)
it->second.SetFunctionName("").RemoveCustomCodeGenerator();
for (std::map<gd::String, gd::ExpressionMetadata>::iterator it =
obj.strExpressionsInfos.begin();
it != obj.strExpressionsInfos.end();
++it)
it->second.SetFunctionName("").RemoveCustomCodeGenerator();
}
for (std::map<gd::String, gd::BehaviorMetadata>::iterator objIt =
behaviorsInfo.begin();
objIt != behaviorsInfo.end();
++objIt) {
gd::BehaviorMetadata& obj = objIt->second;
for (std::map<gd::String, gd::InstructionMetadata>::iterator it =
obj.actionsInfos.begin();
it != obj.actionsInfos.end();
++it)
it->second.SetFunctionName("")
.SetGetter("")
.RemoveCustomCodeGenerator();
for (std::map<gd::String, gd::InstructionMetadata>::iterator it =
obj.conditionsInfos.begin();
it != obj.conditionsInfos.end();
++it)
it->second.SetFunctionName("")
.SetGetter("")
.RemoveCustomCodeGenerator();
for (std::map<gd::String, gd::ExpressionMetadata>::iterator it =
obj.expressionsInfos.begin();
it != obj.expressionsInfos.end();
++it)
it->second.SetFunctionName("").RemoveCustomCodeGenerator();
for (std::map<gd::String, gd::ExpressionMetadata>::iterator it =
obj.strExpressionsInfos.begin();
it != obj.strExpressionsInfos.end();
++it)
it->second.SetFunctionName("").RemoveCustomCodeGenerator();
}
for (std::map<gd::String, gd::EventMetadata>::iterator it =
eventsInfos.begin();
it != eventsInfos.end();
++it)
it->second.ClearCodeGenerationAndPreprocessing();
}
}
void PlatformExtension::StripUnimplementedInstructionsAndExpressions() {
for (std::map<gd::String, gd::InstructionMetadata>::iterator it =
GetAllActions().begin();

View File

@@ -19,42 +19,21 @@
namespace gd {
class Instruction;
}
namespace gd {
class InstructionMetadata;
}
namespace gd {
class ExpressionMetadata;
}
namespace gd {
class ObjectMetadata;
}
namespace gd {
class BehaviorMetadata;
}
namespace gd {
class BaseEvent;
}
namespace gd {
class EventMetadata;
}
namespace gd {
class EventCodeGenerator;
}
namespace gd {
class ArbitraryResourceWorker;
}
namespace gd {
class BehaviorsSharedData;
}
namespace gd {
class Behavior;
}
namespace gd {
class Object;
}
} // namespace gd
typedef std::unique_ptr<gd::Object> (*CreateFunPtr)(gd::String name);
typedef std::function<std::unique_ptr<gd::Object>(gd::String name)>
CreateFunPtr;
namespace gd {
@@ -107,11 +86,24 @@ class GD_CORE_API PlatformExtension {
/**
* \brief Must be called to declare the main information about the extension.
*/
void SetExtensionInformation(const gd::String& name_,
const gd::String& fullname_,
const gd::String& description_,
const gd::String& author_,
const gd::String& license_);
PlatformExtension& SetExtensionInformation(const gd::String& name_,
const gd::String& fullname_,
const gd::String& description_,
const gd::String& author_,
const gd::String& license_);
/**
* \brief Set the path to the help, relative to the wiki/documentation root.
* For example, "/all-features/collisions" for
* "http://wiki.compilgames.net/doku.php/gdevelop5/all-features/collisions".
*
* The instructions, objects and behaviors will have this help path set by
* default, unless you call SetHelpPath on them.
*/
PlatformExtension& SetExtensionHelpPath(const gd::String& helpPath_) {
helpPath = helpPath_;
return *this;
}
/**
* \brief Mark this extension as deprecated: the IDE will hide it from the
@@ -171,7 +163,6 @@ class GD_CORE_API PlatformExtension {
* \param icon The 24x24 icon of the object:
res/icons_[SkinName]/[iconName]24.png will be first tried,
* and then if it does not exists, the full entered name will be tried.
\endcode
*/
template <class T>
gd::ObjectMetadata& AddObject(const gd::String& name_,
@@ -179,6 +170,24 @@ class GD_CORE_API PlatformExtension {
const gd::String& description_,
const gd::String& icon24x24_);
/**
* \brief Declare a new object as being part of the extension.
* \note This method does nothing when used for GD C++ runtime.
* \param name The name of the object
* \param fullname The user friendly name of the object
* \param description The user friendly description of the object
* \param icon The 24x24 icon of the object:
res/icons_[SkinName]/[iconName]24.png will be first tried,
* and then if it does not exists, the full entered name will be tried.
* \param instance The "blueprint" object to be copied when a new object is
asked for.
*/
gd::ObjectMetadata& AddObject(const gd::String& name_,
const gd::String& fullname_,
const gd::String& description_,
const gd::String& icon24x24_,
std::shared_ptr<gd::Object> instance);
/**
* \brief Declare a new behavior as being part of the extension.
* \note This method does nothing when used for GD C++ runtime.
@@ -240,6 +249,12 @@ class GD_CORE_API PlatformExtension {
*/
const gd::String& GetLicense() const { return license; }
/**
* \brief Return the help path of extension, relative to the
* wiki/documentation root.
*/
const gd::String& GetHelpPath() const { return helpPath; }
/**
* \brief Check if the extension is flagged as being deprecated.
*/
@@ -404,24 +419,6 @@ class GD_CORE_API PlatformExtension {
virtual void ExposeActionsResources(Instruction& action,
gd::ArbitraryResourceWorker& worker){};
/**
* \brief Clone the extension of another platform.
*
* This can be used when you want a platform to conform to another.<br>
* It is still possible to make some changes after the cloning by using getter
* methods.<br> See also
* gd::PlatformExtension::StripUnimplementedInstructionsAndExpressions.
*
* \param platformName The name of the platform in which the source extension
* must be searched for. \param extensionName The name of the source extension
* to be copied. \param stripFunctionsNameAndCodeGeneration If set to true,
* all functions names and code generator of all
* instructions/expression/events will be removed.
*/
void CloneExtension(const gd::String& platformName,
const gd::String& extensionName,
bool stripFunctionsNameAndCodeGeneration = true);
/**
* \brief Delete all instructions having no functions name or custom code
* generator.
@@ -451,7 +448,10 @@ class GD_CORE_API PlatformExtension {
gd::String informations; ///< Description displayed to users at edittime
gd::String author; ///< Author displayed to users at edittime
gd::String license; ///< License name displayed to users at edittime
bool deprecated;
bool deprecated; ///< true if the extension is deprecated and shouldn't be
///< shown in IDE.
gd::String helpPath; ///< The relative path to the help for this extension in
///< the documentation.
std::map<gd::String, gd::ObjectMetadata> objectsInfos;
std::map<gd::String, gd::BehaviorMetadata> behaviorsInfo;

View File

@@ -27,7 +27,8 @@ gd::ObjectMetadata& PlatformExtension::AddObject(const gd::String& name,
icon24x24,
[](gd::String name) -> std::unique_ptr<gd::Object> {
return gd::make_unique<T>(name);
});
})
.SetHelpPath(GetHelpPath());
return objectsInfos[nameWithNamespace];
}

View File

@@ -6,6 +6,7 @@
#include "GDCore/IDE/Events/ArbitraryEventsWorker.h"
#include <map>
#include <memory>
#include <iostream>
#include <vector>
#include "GDCore/Events/Event.h"
#include "GDCore/Events/EventsList.h"

View File

@@ -12,11 +12,7 @@
#include "GDCore/String.h"
namespace gd {
class Instruction;
}
namespace gd {
class BaseEvent;
}
namespace gd {
class EventsList;
}

View File

@@ -0,0 +1,188 @@
/*
* GDevelop Core
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights
* reserved. This project is released under the MIT License.
*/
#include "GDCore/IDE/Events/EventsContextAnalyzer.h"
#include <map>
#include <memory>
#include <vector>
#include "GDCore/Events/Event.h"
#include "GDCore/Events/EventsList.h"
#include "GDCore/Events/Parsers/ExpressionParser.h"
#include "GDCore/Extensions/Metadata/ExpressionMetadata.h"
#include "GDCore/Extensions/Metadata/InstructionMetadata.h"
#include "GDCore/Extensions/Metadata/MetadataProvider.h"
#include "GDCore/Project/Layout.h"
#include "GDCore/Project/Project.h"
#include "GDCore/String.h"
namespace gd {
class CallbacksForListingObjects : public gd::ParserCallbacks {
public:
CallbacksForListingObjects(const gd::Platform& platform_,
const gd::Project& project_,
const gd::Layout& layout_,
EventsContext& context_)
: platform(platform_),
project(project_),
layout(layout_),
context(context_){};
virtual ~CallbacksForListingObjects(){};
virtual void OnConstantToken(gd::String text){};
virtual void OnStaticFunction(gd::String functionName,
const std::vector<gd::Expression>& parameters,
const gd::ExpressionMetadata& expressionInfo) {
for (std::size_t i = 0;
i < parameters.size() && i < expressionInfo.parameters.size();
++i) {
EventsContextAnalyzer::AnalyzeParameter(platform,
project,
layout,
expressionInfo.parameters[i],
parameters[i],
context);
}
};
virtual void OnObjectFunction(gd::String functionName,
const std::vector<gd::Expression>& parameters,
const gd::ExpressionMetadata& expressionInfo) {
for (std::size_t i = 0;
i < parameters.size() && i < expressionInfo.parameters.size();
++i) {
EventsContextAnalyzer::AnalyzeParameter(platform,
project,
layout,
expressionInfo.parameters[i],
parameters[i],
context);
}
};
virtual void OnObjectBehaviorFunction(
gd::String functionName,
const std::vector<gd::Expression>& parameters,
const gd::ExpressionMetadata& expressionInfo) {
for (std::size_t i = 0;
i < parameters.size() && i < expressionInfo.parameters.size();
++i) {
EventsContextAnalyzer::AnalyzeParameter(platform,
project,
layout,
expressionInfo.parameters[i],
parameters[i],
context);
}
};
virtual bool OnSubMathExpression(const gd::Platform& platform,
const gd::Project& project,
const gd::Layout& layout,
gd::Expression& expression) {
CallbacksForListingObjects callbacks(platform, project, layout, context);
gd::ExpressionParser parser(expression.GetPlainString());
parser.ParseMathExpression(platform, project, layout, callbacks);
return true;
}
virtual bool OnSubTextExpression(const gd::Platform& platform,
const gd::Project& project,
const gd::Layout& layout,
gd::Expression& expression) {
CallbacksForListingObjects callbacks(platform, project, layout, context);
gd::ExpressionParser parser(expression.GetPlainString());
parser.ParseStringExpression(platform, project, layout, callbacks);
return true;
}
private:
const gd::Platform& platform;
const gd::Project& project;
const gd::Layout& layout;
EventsContext& context;
};
bool EventsContextAnalyzer::DoVisitInstruction(gd::Instruction& instruction,
bool isCondition) {
const gd::InstructionMetadata& instrInfo =
isCondition ? MetadataProvider::GetConditionMetadata(
project.GetCurrentPlatform(), instruction.GetType())
: MetadataProvider::GetActionMetadata(
project.GetCurrentPlatform(), instruction.GetType());
for (int i = 0; i < instruction.GetParametersCount() &&
i < instrInfo.GetParametersCount();
++i) {
AnalyzeParameter(platform,
project,
layout,
instrInfo.GetParameter(i),
instruction.GetParameter(i),
context);
}
return false;
}
void EventsContextAnalyzer::AnalyzeParameter(
const gd::Platform& platform,
const gd::Project& project,
const gd::Layout& layout,
const gd::ParameterMetadata& metadata,
const gd::Expression& parameter,
EventsContext& context) {
const auto& value = parameter.GetPlainString();
const auto& type = metadata.GetType();
if (ParameterMetadata::IsObject(type)) {
context.AddObjectName(value);
} else if (ParameterMetadata::IsExpression("number", type)) {
CallbacksForListingObjects callbacks(platform, project, layout, context);
gd::ExpressionParser parser(value);
parser.ParseMathExpression(platform, project, layout, callbacks);
} else if (ParameterMetadata::IsExpression("string", type)) {
CallbacksForListingObjects callbacks(platform, project, layout, context);
gd::ExpressionParser parser(value);
parser.ParseStringExpression(platform, project, layout, callbacks);
}
}
void EventsContext::AddObjectName(const gd::String& objectName) {
for (auto& realObjectName : ExpandObjectsName(objectName)) {
objectNames.insert(realObjectName);
}
objectOrGroupNames.insert(objectName);
}
std::vector<gd::String> EventsContext::ExpandObjectsName(
const gd::String& objectName) {
// Note: this logic is duplicated in EventsCodeGenerator::ExpandObjectsName
std::vector<gd::String> realObjects;
if (project.GetObjectGroups().Has(objectName))
realObjects =
project.GetObjectGroups().Get(objectName).GetAllObjectsNames();
else if (layout.GetObjectGroups().Has(objectName))
realObjects = layout.GetObjectGroups().Get(objectName).GetAllObjectsNames();
else
realObjects.push_back(objectName);
// Ensure that all returned objects actually exists.
for (std::size_t i = 0; i < realObjects.size();) {
if (!layout.HasObjectNamed(realObjects[i]) &&
!project.HasObjectNamed(realObjects[i]))
realObjects.erase(realObjects.begin() + i);
else
++i;
}
return realObjects;
}
} // namespace gd

View File

@@ -0,0 +1,99 @@
/*
* GDevelop Core
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights
* reserved. This project is released under the MIT License.
*/
#ifndef EventsContextAnalyzer_H
#define EventsContextAnalyzer_H
#include <map>
#include <memory>
#include <set>
#include <vector>
#include "GDCore/IDE/Events/ArbitraryEventsWorker.h"
#include "GDCore/String.h"
namespace gd {
class BaseEvent;
class Platform;
class Project;
class Layout;
class EventsList;
class ParameterMetadata;
class Expression;
} // namespace gd
namespace gd {
/**
* \brief Store the results of a search done by EventsContextAnalyzer.
*/
class GD_CORE_API EventsContext {
public:
EventsContext(gd::Project& project_, gd::Layout& layout_)
: project(project_), layout(layout_){};
virtual ~EventsContext(){};
void AddObjectName(const gd::String& objectName);
std::vector<gd::String> ExpandObjectsName(const gd::String& objectName);
/**
* \brief Get object or group names being referenced in the events.
*/
const std::set<gd::String>& GetObjectOrGroupNames() {
return objectOrGroupNames;
}
/**
* \brief Get objects referenced in the events, without groups (all groups
* have been "expanded" to the real objects being referenced by the group).
*/
const std::set<gd::String>& GetObjectNames() { return objectNames; }
private:
std::set<gd::String> objectOrGroupNames;
std::set<gd::String> objectNames;
gd::Project& project;
gd::Layout& layout;
};
/**
* \brief Analyze events to list all the objects being used in them.
*
* \ingroup IDE
*/
class GD_CORE_API EventsContextAnalyzer : public ArbitraryEventsWorker {
public:
EventsContextAnalyzer(const gd::Platform& platform_,
gd::Project& project_,
gd::Layout& layout_)
: platform(platform_),
project(project_),
layout(layout_),
context(project, layout){};
virtual ~EventsContextAnalyzer(){};
/**
* Get the context containing the objects that are used in the events.
*/
const EventsContext& GetEventsContext() { return context; }
static void AnalyzeParameter(const gd::Platform& platform,
const gd::Project& project,
const gd::Layout& layout,
const gd::ParameterMetadata& metadata,
const gd::Expression& parameter,
EventsContext& context);
private:
virtual bool DoVisitInstruction(gd::Instruction& instruction,
bool isCondition);
const gd::Platform& platform;
gd::Project& project;
gd::Layout& layout;
EventsContext context;
};
} // namespace gd
#endif // EventsContextAnalyzer_H

View File

@@ -217,7 +217,7 @@ bool EventsRefactorer::RenameObjectInActions(const gd::Platform& platform,
actions[aId].GetParameter(pNb).GetPlainString() == oldName)
actions[aId].SetParameter(pNb, gd::Expression(newName));
// Replace object's name in expressions
else if (instrInfos.parameters[pNb].type == "expression") {
else if (ParameterMetadata::IsExpression("number", instrInfos.parameters[pNb].type)) {
gd::String newExpression;
gd::String oldExpression =
actions[aId].GetParameter(pNb).GetPlainString();
@@ -232,11 +232,7 @@ bool EventsRefactorer::RenameObjectInActions(const gd::Platform& platform,
}
}
// Replace object's name in text expressions
else if (instrInfos.parameters[pNb].type == "string" ||
instrInfos.parameters[pNb].type == "file" ||
instrInfos.parameters[pNb].type == "joyaxis" ||
instrInfos.parameters[pNb].type == "color" ||
instrInfos.parameters[pNb].type == "layer") {
else if (ParameterMetadata::IsExpression("string", instrInfos.parameters[pNb].type)) {
gd::String newExpression;
gd::String oldExpression =
actions[aId].GetParameter(pNb).GetPlainString();
@@ -285,7 +281,7 @@ bool EventsRefactorer::RenameObjectInConditions(
conditions[cId].GetParameter(pNb).GetPlainString() == oldName)
conditions[cId].SetParameter(pNb, gd::Expression(newName));
// Replace object's name in expressions
else if (instrInfos.parameters[pNb].type == "expression") {
else if (ParameterMetadata::IsExpression("number", instrInfos.parameters[pNb].type)) {
gd::String newExpression;
gd::String oldExpression =
conditions[cId].GetParameter(pNb).GetPlainString();
@@ -299,11 +295,7 @@ bool EventsRefactorer::RenameObjectInConditions(
}
}
// Replace object's name in text expressions
else if (instrInfos.parameters[pNb].type == "string" ||
instrInfos.parameters[pNb].type == "file" ||
instrInfos.parameters[pNb].type == "joyaxis" ||
instrInfos.parameters[pNb].type == "color" ||
instrInfos.parameters[pNb].type == "layer") {
else if (ParameterMetadata::IsExpression("string", instrInfos.parameters[pNb].type)) {
gd::String newExpression;
gd::String oldExpression =
conditions[cId].GetParameter(pNb).GetPlainString();
@@ -389,7 +381,7 @@ bool EventsRefactorer::RemoveObjectInActions(const gd::Platform& platform,
break;
}
// Replace object's name in expressions
else if (instrInfos.parameters[pNb].type == "expression") {
else if (ParameterMetadata::IsExpression("number", instrInfos.parameters[pNb].type)) {
CallbacksForRemovingObject callbacks(name);
gd::ExpressionParser parser(
@@ -401,11 +393,7 @@ bool EventsRefactorer::RemoveObjectInActions(const gd::Platform& platform,
}
}
// Replace object's name in text expressions
else if (instrInfos.parameters[pNb].type == "string" ||
instrInfos.parameters[pNb].type == "file" ||
instrInfos.parameters[pNb].type == "joyaxis" ||
instrInfos.parameters[pNb].type == "color" ||
instrInfos.parameters[pNb].type == "layer") {
else if (ParameterMetadata::IsExpression("string", instrInfos.parameters[pNb].type)) {
CallbacksForRemovingObject callbacks(name);
gd::ExpressionParser parser(
@@ -457,7 +445,7 @@ bool EventsRefactorer::RemoveObjectInConditions(
break;
}
// Replace object's name in expressions
else if (instrInfos.parameters[pNb].type == "expression") {
else if (ParameterMetadata::IsExpression("number", instrInfos.parameters[pNb].type)) {
CallbacksForRemovingObject callbacks(name);
gd::ExpressionParser parser(
@@ -469,11 +457,7 @@ bool EventsRefactorer::RemoveObjectInConditions(
}
}
// Replace object's name in text expressions
else if (instrInfos.parameters[pNb].type == "string" ||
instrInfos.parameters[pNb].type == "file" ||
instrInfos.parameters[pNb].type == "joyaxis" ||
instrInfos.parameters[pNb].type == "color" ||
instrInfos.parameters[pNb].type == "layer") {
else if (ParameterMetadata::IsExpression("string", instrInfos.parameters[pNb].type)) {
CallbacksForRemovingObject callbacks(name);
gd::ExpressionParser parser(

View File

@@ -11,26 +11,12 @@
#include "GDCore/String.h"
namespace gd {
class EventsList;
}
namespace gd {
class Layout;
}
namespace gd {
class Platform;
}
namespace gd {
class Project;
}
namespace gd {
class ExternalEvents;
}
namespace gd {
class BaseEvent;
}
namespace gd {
class Instruction;
}
namespace gd {
typedef std::shared_ptr<gd::BaseEvent> BaseEventSPtr;
}
@@ -53,6 +39,24 @@ class GD_CORE_API EventsSearchResult {
std::weak_ptr<gd::BaseEvent> event;
gd::EventsList* eventsList;
std::size_t positionInList;
bool IsEventsListValid() const { return eventsList != nullptr; }
/**
* \brief Get the events list containing the event pointed by the EventsSearchResult.
* \warning Only call this when IsEventsListValid returns true.
*/
const gd::EventsList & GetEventsList() const { return *eventsList; }
std::size_t GetPositionInList() const { return positionInList; }
bool IsEventValid() const { return !event.expired(); }
/**
* \brief Get the event pointed by the EventsSearchResult.
* \warning Only call this when IsEventValid returns true.
*/
const gd::BaseEvent & GetEvent() const { return *event.lock(); }
};
/**

View File

@@ -0,0 +1,37 @@
/*
* GDevelop Core
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights
* reserved. This project is released under the MIT License.
*/
#include "GDCore/IDE/Events/EventsTypesLister.h"
#include <iostream>
#include <map>
#include <memory>
#include <vector>
#include "GDCore/Events/Event.h"
#include "GDCore/Events/EventsList.h"
#include "GDCore/Project/Layout.h"
#include "GDCore/Project/Project.h"
#include "GDCore/String.h"
namespace gd {
bool EventsTypesLister::DoVisitEvent(gd::BaseEvent& event) {
allEventsTypes.push_back(event.GetType());
return false;
}
bool EventsTypesLister::DoVisitInstruction(gd::Instruction& instruction,
bool isCondition) {
if (isCondition)
allConditionsTypes.push_back(instruction.GetType());
else
allActionsTypes.push_back(instruction.GetType());
return false;
}
EventsTypesLister::~EventsTypesLister() {}
} // namespace gd

View File

@@ -0,0 +1,64 @@
/*
* GDevelop Core
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights
* reserved. This project is released under the MIT License.
*/
#ifndef EventsTypesLister_H
#define EventsTypesLister_H
#include <iostream>
#include <map>
#include <memory>
#include <vector>
#include "GDCore/IDE/Events/ArbitraryEventsWorker.h"
#include "GDCore/String.h"
namespace gd {
class BaseEvent;
class Project;
class EventsList;
} // namespace gd
namespace gd {
/**
* \brief List the values of the parameters of events and their type.
*
* \ingroup IDE
*/
class GD_CORE_API EventsTypesLister : public ArbitraryEventsWorker {
public:
EventsTypesLister(const gd::Project& project_) : project(project_){};
virtual ~EventsTypesLister();
/**
* Return the types of all events
*/
const std::vector<gd::String>& GetAllEventsTypes() { return allEventsTypes; }
/**
* Return the types of all conditions
*/
const std::vector<gd::String>& GetAllConditionsTypes() {
return allConditionsTypes;
}
/**
* Return the types of all actions
*/
const std::vector<gd::String>& GetAllActionsTypes() {
return allActionsTypes;
}
private:
bool DoVisitEvent(gd::BaseEvent& event) override;
bool DoVisitInstruction(gd::Instruction& instruction,
bool isCondition) override;
std::vector<gd::String> allEventsTypes;
std::vector<gd::String> allConditionsTypes;
std::vector<gd::String> allActionsTypes;
const gd::Project& project;
};
} // namespace gd
#endif // EventsTypesLister_H

View File

@@ -174,7 +174,7 @@ std::set<gd::String> EventsVariablesFinder::FindArgumentsInInstructions(
results.insert(instructions[aId].GetParameter(pNb).GetPlainString());
}
// Search in expressions
else if (instrInfos.parameters[pNb].type == "expression") {
else if (ParameterMetadata::IsExpression("number", instrInfos.parameters[pNb].type)) {
CallbacksForSearchingVariable callbacks(
results, parameterType, objectName);
@@ -183,11 +183,7 @@ std::set<gd::String> EventsVariablesFinder::FindArgumentsInInstructions(
parser.ParseMathExpression(platform, project, layout, callbacks);
}
// Search in gd::String expressions
else if (instrInfos.parameters[pNb].type == "string" ||
instrInfos.parameters[pNb].type == "file" ||
instrInfos.parameters[pNb].type == "joyaxis" ||
instrInfos.parameters[pNb].type == "color" ||
instrInfos.parameters[pNb].type == "layer") {
else if (ParameterMetadata::IsExpression("string", instrInfos.parameters[pNb].type)) {
CallbacksForSearchingVariable callbacks(
results, parameterType, objectName);

View File

@@ -17,8 +17,13 @@ namespace gd {
/**
* \brief Internal class loading static extensions.
*
* Class that load extensions and store them in ExtensionsManager
* \see ExtensionsManager
* Class that load extensions and store them in a Platform.
*
* \note This is for loading extensions declared in C++, usually in
* files called "Extension.cpp" or "JsExtension.cpp".
* GDevelop 5 extensions can also be declared directly in JavaScript.
* See newIDE/app/src/JsExtensionsLoader and "JsExtension.js" files
* for extensions declared in JavaScript.
*/
class GD_CORE_API ExtensionsLoader {
public:

View File

@@ -6,7 +6,7 @@
#if defined(GD_IDE_ONLY) && !defined(GD_NO_WX_GUI)
#ifndef GDCORE_FILEPROPERTY_H
#define GDCORE_FILEPROPERTY_H
#include <wx/control.h>
#include <wx/bitmap.h>
#include <wx/propgrid/propgrid.h>
#include <wx/propgrid/props.h>

View File

@@ -145,6 +145,16 @@ const gd::String& InitialInstance::GetRawStringProperty(
const auto& it = stringInfos.find(name);
return it != stringInfos.end() ? it->second : *badStringProperyValue;
}
void InitialInstance::SetRawFloatProperty(const gd::String& name, float value)
{
floatInfos[name] = value;
}
void InitialInstance::SetRawStringProperty(const gd::String& name, const gd::String& value)
{
stringInfos[name] = value;
}
#endif
} // namespace gd

View File

@@ -206,7 +206,8 @@ class GD_CORE_API InitialInstance {
/**
* \brief Get the value of a float property stored in the instance.
* \note Only use this when \a GetCustomProperties is too slow (when rendering
* instances for example). \return the value of the property, or 0 if it does
* instances for example).
* \return the value of the property, or 0 if it does
* not exists.
*/
float GetRawFloatProperty(const gd::String& name) const;
@@ -214,10 +215,21 @@ class GD_CORE_API InitialInstance {
/**
* \brief Get the value of a string property stored in the instance.
* \note Only use this when \a GetCustomProperties is too slow (when rendering
* instances for example). \return the value of the propety, or an empty
* instances for example).
* \return the value of the propety, or an empty
* string if it does not exists.
*/
const gd::String& GetRawStringProperty(const gd::String& name) const;
/**
* \brief Set the value of a float property stored in the instance.
*/
void SetRawFloatProperty(const gd::String& name, float value);
/**
* \brief Set the value of a string property stored in the instance.
*/
void SetRawStringProperty(const gd::String& name, const gd::String& value);
///@}
#endif

View File

@@ -1,6 +1,12 @@
#ifndef LAYOUTEDITORPREVIEWER_H
#define LAYOUTEDITORPREVIEWER_H
#if defined(GD_IDE_ONLY) && !defined(GD_NO_WX_GUI)
#ifdef WINDOWS
#include <wx/msw/winundef.h>
#endif
#include <wx/event.h>
namespace gd {
class LayoutEditorCanvas;

View File

@@ -61,6 +61,7 @@ Project::Project()
:
#if defined(GD_IDE_ONLY)
name(_("Project")),
version("1.0.0"),
packageName("com.example.gamename"),
orientation("landscape"),
folderProject(false),
@@ -524,6 +525,7 @@ void Project::UnserializeFrom(const SerializerElement& element) {
const SerializerElement& propElement =
element.GetChild("properties", 0, "Info");
SetName(propElement.GetChild("name", 0, "Nom").GetValue().GetString());
SetVersion(propElement.GetStringAttribute("version", "1.0.0"));
SetDefaultWidth(
propElement.GetChild("windowWidth", 0, "WindowW").GetValue().GetInt());
SetDefaultHeight(
@@ -782,6 +784,7 @@ void Project::SerializeTo(SerializerElement& element) const {
SerializerElement& propElement = element.AddChild("properties");
propElement.AddChild("name").SetValue(GetName());
propElement.SetAttribute("version", GetVersion());
propElement.AddChild("author").SetValue(GetAuthor());
propElement.AddChild("windowWidth").SetValue(GetMainWindowDefaultWidth());
propElement.AddChild("windowHeight").SetValue(GetMainWindowDefaultHeight());
@@ -1100,6 +1103,7 @@ Project& Project::operator=(const Project& other) {
void Project::Init(const gd::Project& game) {
// Some properties
name = game.name;
version = game.version;
windowWidth = game.windowWidth;
windowHeight = game.windowHeight;
maxFPS = game.maxFPS;

View File

@@ -21,44 +21,18 @@ class TiXmlElement;
#include "GDCore/Project/VariablesContainer.h"
namespace gd {
class Platform;
}
namespace gd {
class Layout;
}
namespace gd {
class ExternalEvents;
}
namespace gd {
class ResourcesManager;
}
namespace gd {
class ExternalLayout;
}
namespace gd {
class Object;
}
namespace gd {
class VariablesContainer;
}
namespace gd {
class ArbitraryResourceWorker;
}
namespace gd {
class SourceFile;
}
namespace gd {
class ImageManager;
}
namespace gd {
class Behavior;
}
namespace gd {
class BehaviorsSharedData;
}
namespace gd {
class BaseEvent;
}
namespace gd {
class SerializerElement;
}
#undef GetObject // Disable an annoying macro
@@ -92,6 +66,17 @@ class GD_CORE_API Project : public ClassWithObjects {
*/
const gd::String& GetName() const { return name; }
/**
* \brief Change the version of the project.
* This can be freely set, but should follow "X.Y.Z" format for compatibility with some exporters.
*/
void SetVersion(const gd::String& version_) { version = version_; };
/**
* \brief Get project version.
*/
const gd::String& GetVersion() const { return version; }
#if defined(GD_IDE_ONLY)
/**
* \brief Change the author of the project.
@@ -222,13 +207,16 @@ class GD_CORE_API Project : public ClassWithObjects {
/**
* \brief Get how the game size should be adapted to the screen.
*/
const gd::String & GetSizeOnStartupMode() const { return sizeOnStartupMode; }
const gd::String& GetSizeOnStartupMode() const { return sizeOnStartupMode; }
/**
* \brief Set how to adapt the game size to the screen.
* \param mode The size to be used. Can be "adaptWidth", "adaptHeight" or empty fpr no changes to game size.
* \brief Set how to adapt the game size to the screen.
* \param mode The size to be used. Can be "adaptWidth", "adaptHeight" or
* empty fpr no changes to game size.
*/
void SetSizeOnStartupMode(const gd::String & mode) { sizeOnStartupMode = mode; }
void SetSizeOnStartupMode(const gd::String& mode) {
sizeOnStartupMode = mode;
}
/**
* Change the default maximum number of frames allowed to be rendered per
@@ -874,13 +862,16 @@ class GD_CORE_API Project : public ClassWithObjects {
void LoadProjectInformationFromXml(const TiXmlElement* elem);
gd::String name; ///< Game name
gd::String version; ///< Game version number (used for some exports)
unsigned int windowWidth; ///< Window default width
unsigned int windowHeight; ///< Window default height
int maxFPS; ///< Maximum Frame Per Seconds, -1 for unlimited
unsigned int minFPS; ///< Minimum Frame Per Seconds ( slow down game if FPS
///< are below this number )
bool verticalSync; ///< If true, must activate vertical synchronization.
gd::String sizeOnStartupMode; ///< How to adapt the game size to the screen. Can be "adaptWidth", "adaptHeight" or empty
gd::String
sizeOnStartupMode; ///< How to adapt the game size to the screen. Can be
///< "adaptWidth", "adaptHeight" or empty
std::vector<std::unique_ptr<gd::Layout> > scenes; ///< List of all scenes
gd::VariablesContainer variables; ///< Initial global variables
std::vector<std::unique_ptr<gd::ExternalLayout> >

View File

@@ -8,6 +8,9 @@ SerializerElement SerializerElement::nullElement;
SerializerElement::SerializerElement() : valueUndefined(true) {}
SerializerElement::SerializerElement(const SerializerValue& value)
: valueUndefined(false), elementValue(value) {}
SerializerElement::~SerializerElement() {}
const SerializerValue& SerializerElement::GetValue() const {

View File

@@ -23,6 +23,7 @@ namespace gd {
class GD_CORE_API SerializerElement {
public:
SerializerElement();
SerializerElement(const SerializerValue & value);
virtual ~SerializerElement();
/** \name Value

View File

@@ -8,8 +8,8 @@
#include "stdlib.h"
#include "string.h"
#if defined(WINDOWS)
#include "psapi.h"
#include "windows.h"
#include "psapi.h"
#endif
namespace gd {

View File

@@ -1699,7 +1699,7 @@ HIDE_UNDOC_RELATIONS = YES
# toolkit from AT&T and Lucent Bell Labs. The other options in this section
# have no effect if this option is set to NO (the default)
HAVE_DOT = YES
HAVE_DOT = NO
# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
# allowed to run in parallel. When set to 0 (the default) doxygen will

View File

@@ -11,12 +11,14 @@ This project is released under the MIT License.
#include "AdMobObject.h"
void DeclareAdMobObjectExtension(gd::PlatformExtension& extension) {
extension.SetExtensionInformation(
"AdMobObject",
_("AdMob banners and interstitial screens"),
_("Display an ads banner and interstitial screens powered by AdMob."),
"Florian Rival",
"Open source (MIT License)");
extension
.SetExtensionInformation(
"AdMobObject",
_("AdMob banners and interstitial screens"),
_("Display an ads banner and interstitial screens powered by AdMob."),
"Florian Rival",
"Open source (MIT License)")
.SetExtensionHelpPath("/objects/admob");
gd::ObjectMetadata& obj = extension.AddObject<AdMobObject>(
"AdMob",

View File

@@ -12,10 +12,10 @@ if (typeof AdMob !== "undefined")
* The AdMobRuntimeObject displays an AdMob ad banner on screen.
* This works with Cordova compatible platforms with `cordova-plugin-admobpro` plugin installed.
*
* @namespace gdjs
* @memberof gdjs
* @class AdMobRuntimeObject
* @extends RuntimeObject
* @namespace gdjs
* @memberof gdjs
*/
gdjs.AdMobRuntimeObject = function(runtimeScene, objectData)
{

View File

@@ -10,11 +10,13 @@ This project is released under the MIT License.
#include "GDCpp/Runtime/Project/BehaviorsSharedData.h"
void DeclareAnchorBehaviorExtension(gd::PlatformExtension& extension) {
extension.SetExtensionInformation("AnchorBehavior",
_("Anchor"),
_("Anchor objects to the window's bounds."),
"Victor Levasseur",
"Open source (MIT License)");
extension
.SetExtensionInformation("AnchorBehavior",
_("Anchor"),
_("Anchor objects to the window's bounds."),
"Victor Levasseur",
"Open source (MIT License)")
.SetExtensionHelpPath("/behaviors/anchor");
gd::BehaviorMetadata& aut = extension.AddBehavior(
"AnchorBehavior",

View File

@@ -26,7 +26,8 @@ class Extension : public ExtensionBase {
_("3D Box Object"),
_("This Extension enables the use of 3D Box objects."),
"Florian Rival",
"Open source (MIT License)");
"Open source (MIT License)")
.SetExtensionHelpPath("" /*TODO: Add a documentation page for this */);
{
gd::ObjectMetadata& obj =

View File

@@ -20,7 +20,7 @@ IF (NOT EMSCRIPTEN)
ENDIF()
ADD_SUBDIRECTORY(DestroyOutsideBehavior)
ADD_SUBDIRECTORY(DraggableBehavior)
ADD_SUBDIRECTORY(FacebookInstantGames)
# ADD_SUBDIRECTORY(FacebookInstantGames) - Pure JS extension, see "JsExtension.js".
IF (NOT EMSCRIPTEN)
ADD_SUBDIRECTORY(Function)
ENDIF()

View File

@@ -7,96 +7,108 @@ This project is released under the MIT License.
#include "GDCpp/Extensions/ExtensionBase.h"
/**
* \brief This class declares information about the extension.
*/
class Extension : public ExtensionBase
{
public:
class Extension : public ExtensionBase {
public:
/**
* Constructor of an extension declares everything the extension contains:
* objects, actions, conditions and expressions.
*/
Extension() {
SetExtensionInformation("CommonDialogs",
_("Common dialogs"),
_("This Extension can display common dialogs ( "
"Message box, open file dialog... )"),
"Florian Rival",
"Open source (MIT License)")
.SetExtensionHelpPath("" /*TODO: Add a documentation page for this */);
#if defined(GD_IDE_ONLY)
/**
* Constructor of an extension declares everything the extension contains: objects, actions, conditions and expressions.
*/
Extension()
{
SetExtensionInformation("CommonDialogs",
_("Common dialogs"),
_("This Extension can display common dialogs ( Message box, open file dialog... )"),
"Florian Rival",
"Open source (MIT License)");
#if defined(GD_IDE_ONLY)
AddAction(
"ShowMsgBox",
_("Show a message box"),
_("Display a message box with the specified text and an Ok button."),
_("Display message \"_PARAM1_\" with title \"_PARAM2_\""),
_("Interfaces"),
"res/actions/msgbox24.png",
"res/actions/msgbox.png")
AddAction("ShowMsgBox",
_("Show a message box"),
_("Display a message box with the specified text and an Ok button."),
_("Display message \"_PARAM1_\" with title \"_PARAM2_\""),
_("Interfaces"),
"res/actions/msgbox24.png",
"res/actions/msgbox.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("string", _("Message"))
.AddParameter("string", _("Title"))
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("string", _("Message"))
.AddParameter("string", _("Title"))
.SetFunctionName("GDpriv::CommonDialogs::ShowMessageBox")
.SetIncludeFile("CommonDialogs/CommonDialogs.h");
.SetFunctionName("GDpriv::CommonDialogs::ShowMessageBox").SetIncludeFile("CommonDialogs/CommonDialogs.h");
AddAction(
"ShowOpenFile",
_("Show a window to choose a file"),
_("Display a window that allows a player to choose a file.\nThe name "
"and the directory of the file will be saved in the specified "
"variable."),
_("Open a window for choosing a file, and save the result in _PARAM1_"),
_("Interfaces"),
"res/actions/openfile24.png",
"res/actions/openfile.png")
AddAction("ShowOpenFile",
_("Show a window to choose a file"),
_("Display a window that allows a player to choose a file.\nThe name and the directory of the file will be saved in the specified variable."),
_("Open a window for choosing a file, and save the result in _PARAM1_"),
_("Interfaces"),
"res/actions/openfile24.png",
"res/actions/openfile.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("scenevar", _("Save result to scene variable"))
.AddParameter("string", _("Title"))
.AddParameter(
"string",
_("Wildcard filter ( \"FileType|*.ext;*.ext2|2ndFileType|*.ext3\" "
") ( Windows only ) "))
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("scenevar", _("Save result to scene variable"))
.AddParameter("string", _("Title"))
.AddParameter("string", _("Wildcard filter ( \"FileType|*.ext;*.ext2|2ndFileType|*.ext3\" ) ( Windows only ) "))
.SetFunctionName("GDpriv::CommonDialogs::ShowOpenFile")
.SetIncludeFile("CommonDialogs/CommonDialogs.h");
.SetFunctionName("GDpriv::CommonDialogs::ShowOpenFile").SetIncludeFile("CommonDialogs/CommonDialogs.h");
AddAction("ShowTextInput",
_("Show a window to enter a text"),
_("Show a window that allows a player to enter text.\nThe text "
"will be saved in the specified scene variable."),
_("Open a text input dialog, and save the result in _PARAM1_"),
_("Interfaces"),
"res/actions/textenter24.png",
"res/actions/textenter.png")
AddAction("ShowTextInput",
_("Show a window to enter a text"),
_("Show a window that allows a player to enter text.\nThe text will be saved in the specified scene variable."),
_("Open a text input dialog, and save the result in _PARAM1_"),
_("Interfaces"),
"res/actions/textenter24.png",
"res/actions/textenter.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("scenevar", _("Save result to scene variable"))
.AddParameter("string", _("Message"))
.AddParameter("string", _("Title"))
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("scenevar", _("Save result to scene variable"))
.AddParameter("string", _("Message"))
.AddParameter("string", _("Title"))
.SetFunctionName("GDpriv::CommonDialogs::ShowTextInput")
.SetIncludeFile("CommonDialogs/CommonDialogs.h");
.SetFunctionName("GDpriv::CommonDialogs::ShowTextInput").SetIncludeFile("CommonDialogs/CommonDialogs.h");
AddAction(
"ShowYesNoMsgBox",
_("Display a Yes/No message box"),
_("Open a message box that allows a player to choose Yes or No.\nThe "
"answer ( \"yes\"/\"no\" ) will be saved in the specified variable."),
_("Open a Yes/No message box, and save the result in _PARAM1_"),
_("Interfaces"),
"res/actions/msgbox24.png",
"res/actions/msgbox.png")
AddAction("ShowYesNoMsgBox",
_("Display a Yes/No message box"),
_("Open a message box that allows a player to choose Yes or No.\nThe answer ( \"yes\"/\"no\" ) will be saved in the specified variable."),
_("Open a Yes/No message box, and save the result in _PARAM1_"),
_("Interfaces"),
"res/actions/msgbox24.png",
"res/actions/msgbox.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("scenevar", _("Save result to scene variable"))
.AddParameter("string", _("Message"))
.AddParameter("string", _("Title"))
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("scenevar", _("Save result to scene variable"))
.AddParameter("string", _("Message"))
.AddParameter("string", _("Title"))
.SetFunctionName("GDpriv::CommonDialogs::ShowYesNoMsgBox")
.SetIncludeFile("CommonDialogs/CommonDialogs.h");
.SetFunctionName("GDpriv::CommonDialogs::ShowYesNoMsgBox").SetIncludeFile("CommonDialogs/CommonDialogs.h");
#endif
#endif
GD_COMPLETE_EXTENSION_COMPILATION_INFORMATION();
};
GD_COMPLETE_EXTENSION_COMPILATION_INFORMATION();
};
};
/**
* Used by GDevelop to create the extension class
* -- Do not need to be modified. --
*/
extern "C" ExtensionBase * GD_EXTENSION_API CreateGDExtension() {
return new Extension;
extern "C" ExtensionBase* GD_EXTENSION_API CreateGDExtension() {
return new Extension;
}

View File

@@ -16,7 +16,8 @@ void DeclareDestroyOutsideBehaviorExtension(gd::PlatformExtension& extension) {
_("This Extension can be used to destroy objects when they go outside of "
"the borders of the game's window."),
"Florian Rival",
"Open source (MIT License)");
"Open source (MIT License)")
.SetExtensionHelpPath("/behaviors/destroyoutside");
gd::BehaviorMetadata& aut =
extension.AddBehavior("DestroyOutside",

View File

@@ -22,12 +22,6 @@ class DestroyOutsideBehaviorJsExtension : public gd::PlatformExtension {
* contains: objects, actions, conditions and expressions.
*/
DestroyOutsideBehaviorJsExtension() {
SetExtensionInformation(
"DestroyOutsideBehavior",
_("Destroy Outside Screen Behavior"),
_("Behavior destroying object when they go outside the screen"),
"Florian Rival",
"Open source (MIT License)");
DeclareDestroyOutsideBehaviorExtension(*this);
GetBehaviorMetadata("DestroyOutsideBehavior::DestroyOutside")

View File

@@ -0,0 +1,204 @@
/**
* This is a declaration of an extension for GDevelop 5.
*
* Run `node import-GDJS-Runtime.js` (in newIDE/app/scripts) if you make any change
* to this extension file or to any other *.js file that you reference inside.
*
* The file must be named "JsExtension.js", otherwise GDevelop won't load it.
* ⚠️ If you make a change and the extension is not loaded, open the developer console
* and search for any errors.
*
* More information on https://github.com/4ian/GD/blob/master/newIDE/README-extensions.md
*/
module.exports = {
createExtension: function(t, gd) {
const extension = new gd.PlatformExtension();
extension.setExtensionInformation(
"DeviceSensors",
t("Device sensors"),
t(
"Allow the game to access the sensors of a mobile device."
),
"Matthias Meike",
"Open source (MIT License)"
).setExtensionHelpPath("/all-features/device-sensors");
extension
.addCondition(
"OrientationSensorActive",
t("Sensor active"),
t(
"The condition is true if the device orientation sensor is currently active"
),
t("Orientation sensor is active"),
t("Sensors/Orientation"),
"JsPlatform/Extensions/orientation_active24.png",
"JsPlatform/Extensions/orientation_active32.png"
)
.getCodeExtraInformation()
.setIncludeFile(
"Extensions/DeviceSensors/devicesensortools.js"
)
.setFunctionName("gdjs.evtTools.devicesensors.orientation.isActive");
extension
.addCondition(
"OrientationAlpha",
t("Compare the value of orientation alpha"),
t(
"Compare the value of orientation alpha. (Range: 0 to 360°)"
),
t("Orientation alpha is _PARAM0__PARAM1_"),
t("Sensors/Orientation"),
"JsPlatform/Extensions/orientation_alpha24.png",
"JsPlatform/Extensions/orientation_alpha32.png"
)
.addParameter("relationalOperator", t("Sign of the test"))
.addParameter("expression", t("Value"))
.getCodeExtraInformation()
.setIncludeFile(
"Extensions/DeviceSensors/devicesensortools.js"
)
.setFunctionName("gdjs.evtTools.devicesensors.orientation.getOrientationAlpha");
extension
.addCondition(
"OrientationBeta",
t("Compare the value of orientation beta"),
t(
"Compare the value of orientation beta. (Range: -180 to 180°)"
),
t("Orientation beta is _PARAM0__PARAM1_"),
t("Sensors/Orientation"),
"JsPlatform/Extensions/orientation_beta24.png",
"JsPlatform/Extensions/orientation_beta32.png"
)
.addParameter("relationalOperator", t("Sign of the test"))
.addParameter("expression", t("Value"))
.getCodeExtraInformation()
.setIncludeFile(
"Extensions/DeviceSensors/devicesensortools.js"
)
.setFunctionName("gdjs.evtTools.devicesensors.orientation.getOrientationBeta");
extension
.addCondition(
"OrientationGamma",
t("Compare the value of orientation gamma"),
t(
"Compare the value of orientation gamma. (Range: -90 to 90°)"
),
t("Orientation gamma is _PARAM0__PARAM1_"),
t("Sensors/Orientation"),
"JsPlatform/Extensions/orientation_gamma24.png",
"JsPlatform/Extensions/orientation_gamma32.png"
)
.addParameter("relationalOperator", t("Sign of the test"))
.addParameter("expression", t("Value"))
.getCodeExtraInformation()
.setIncludeFile(
"Extensions/DeviceSensors/devicesensortools.js"
)
.setFunctionName("gdjs.evtTools.devicesensors.orientation.getOrientationGamma");
extension
.addAction(
"ActivateOrientationListener",
t("Activate orientation sensor"),
t("Activate the orientation sensor. (remember to turn it off again)"),
t("Activate the orientation sensor."),
t("Sensors/Orientation"),
"JsPlatform/Extensions/orientation_active24.png",
"JsPlatform/Extensions/orientation_active32.png"
)
.getCodeExtraInformation()
.setIncludeFile(
"Extensions/DeviceSensors/devicesensortools.js"
)
.setFunctionName("gdjs.evtTools.devicesensors.orientation.activateOrientationSensor");
extension
.addAction(
"DeactivateOrientationListener",
t("Deactivate orientation sensor"),
t("Deactivate the orientation sensor."),
t("Deactivate the orientation sensor."),
t("Sensors/Orientation"),
"JsPlatform/Extensions/orientation_inactive24.png",
"JsPlatform/Extensions/orientation_inactive32.png"
)
.getCodeExtraInformation()
.setIncludeFile(
"Extensions/DeviceSensors/devicesensortools.js"
)
.setFunctionName("gdjs.evtTools.devicesensors.orientation.deactivateOrientationSensor");
extension
.addExpression(
"OrientationActive",
t("Sensor Active"),
t("The expression is true if the device orientation sensor is currently active"),
t("Sensors/Orientation")
)
.getCodeExtraInformation()
.setIncludeFile(
"Extensions/DeviceSensors/devicesensortools.js"
)
.setFunctionName("gdjs.evtTools.devicesensors.orientation.isActive");
extension
.addExpression(
"OrientationAbsolute",
t("Is Absolute"),
t("Get if the devices orientation is absolute and not relative"),
t("Sensors/Orientation")
)
.getCodeExtraInformation()
.setIncludeFile(
"Extensions/DeviceSensors/devicesensortools.js"
)
.setFunctionName("gdjs.evtTools.devicesensors.orientation.getOrientationAbsolute");
extension
.addExpression(
"OrientationAlpha",
t("Alpha value"),
t("Get the devices orientation Alpha (compass)"),
t("Sensors/Orientation")
)
.getCodeExtraInformation()
.setIncludeFile(
"Extensions/DeviceSensors/devicesensortools.js"
)
.setFunctionName("gdjs.evtTools.devicesensors.orientation.getOrientationAlpha");
extension
.addExpression(
"OrientationBeta",
t("Beta value"),
t("Get the devices orientation Beta"),
t("Sensors/Orientation")
)
.getCodeExtraInformation()
.setIncludeFile(
"Extensions/DeviceSensors/devicesensortools.js"
)
.setFunctionName("gdjs.evtTools.devicesensors.orientation.getOrientationBeta");
extension
.addExpression(
"OrientationGamma",
t("Gamma value"),
t("Get the devices orientation Gamma value"),
t("Sensors/Orientation")
)
.getCodeExtraInformation()
.setIncludeFile(
"Extensions/DeviceSensors/devicesensortools.js"
)
.setFunctionName("gdjs.evtTools.devicesensors.orientation.getOrientationGamma");
return extension;
},
runExtensionSanityTests: function(gd, extension) { return []; },
};

View File

@@ -0,0 +1,87 @@
/**
* @memberof gdjs.evtTools
* @class devicesensors
* @static
* @private
*/
gdjs.evtTools.devicesensors = {
orientation: {
_isActive: 0,
_absolute: 0,
_alpha: 0,
_beta: 0,
_gamma: 0
}
};
gdjs.evtTools.devicesensors.orientation._activateOrientationListener = function() {
window.addEventListener("deviceorientation", gdjs.evtTools.devicesensors.orientation._handleOrientation, true);
gdjs.evtTools.devicesensors.orientation._isActive = 1;
}
gdjs.evtTools.devicesensors.orientation._deactivateOrientationListener = function() {
window.removeEventListener('deviceorientation', gdjs.evtTools.devicesensors.orientation._handleOrientation, true);
gdjs.evtTools.devicesensors.orientation._isActive = 0;
}
gdjs.evtTools.devicesensors.orientation._handleOrientation = function(event) {
gdjs.evtTools.devicesensors.orientation._absolute = event.absolute ? Math.round(event.absolute) : 0;
gdjs.evtTools.devicesensors.orientation._alpha = event.alpha ? Math.round(event.alpha) : 0;
gdjs.evtTools.devicesensors.orientation._beta = event.beta ? Math.round(event.beta) : 0;
gdjs.evtTools.devicesensors.orientation._gamma = event.gamma ? Math.round(event.gamma) : 0;
}
/**
* Activate the orientation sensor
*/
gdjs.evtTools.devicesensors.orientation.activateOrientationSensor = function() {
gdjs.evtTools.devicesensors.orientation._activateOrientationListener();
}
/**
* Deactivate the orientation sensor
*/
gdjs.evtTools.devicesensors.orientation.deactivateOrientationSensor = function() {
gdjs.evtTools.devicesensors.orientation._deactivateOrientationListener();
}
/**
* Check if the orientation sensor is currently active
* @return {number} The activation state of the orientation sensor (0=false/1=true)
*/
gdjs.evtTools.devicesensors.orientation.isActive = function() {
return gdjs.evtTools.devicesensors.orientation._isActive;
}
/**
* Get the value of the device orientations absolute as a number
* @return {number} The device orientation's absolute value
*/
gdjs.evtTools.devicesensors.orientation.getOrientationAbsolute = function() {
return gdjs.evtTools.devicesensors.orientation._absolute;
};
/**
* Get the value of the device orientations alpha as a number
* @return {number} The device orientation's alpha value
*/
gdjs.evtTools.devicesensors.orientation.getOrientationAlpha = function() {
return gdjs.evtTools.devicesensors.orientation._alpha;
};
/**
* Get the value of the device orientations beta as a number
* @return {number} The device orientation's beta value
*/
gdjs.evtTools.devicesensors.orientation.getOrientationBeta = function() {
return gdjs.evtTools.devicesensors.orientation._beta;
};
/**
* Get the value of the device orientations gamma as a number
* @return {number} The device orientation's gamma value
*/
gdjs.evtTools.devicesensors.orientation.getOrientationGamma = function() {
return gdjs.evtTools.devicesensors.orientation._gamma;
};

View File

@@ -15,7 +15,8 @@ void DeclareDraggableBehaviorExtension(gd::PlatformExtension& extension) {
_("Draggable Behavior"),
_("This Extension enables the movement of objects with a mouse."),
"Florian Rival",
"Open source (MIT License)");
"Open source (MIT License)")
.SetExtensionHelpPath("behaviors/draggable");
gd::BehaviorMetadata& aut =
extension.AddBehavior("Draggable",

View File

@@ -0,0 +1,355 @@
/**
* This is a declaration of an extension for GDevelop 5.
*
* Run `node import-GDJS-Runtime.js` (in newIDE/app/scripts) if you make any change
* to this extension file or to any other *.js file that you reference inside.
*
* The file must be named "JsExtension.js", otherwise GDevelop won't load it.
* ⚠️ If you make a change and the extension is not loaded, open the developer console
* and search for any errors.
*
* More information on https://github.com/4ian/GD/blob/master/newIDE/README-extensions.md
*/
module.exports = {
createExtension: function(t, gd) {
const extension = new gd.PlatformExtension();
extension.setExtensionInformation(
"MyDummyExtension",
"My Dummy Extension",
"An example of a declaration of an extension",
"Florian Rival",
"MIT"
);
// Declare conditions, actions or expressions:
extension
.addCondition(
"MyNewCondition",
t("Dummy condition example"),
t(
"This is an example of a condition displayed in the events sheet. Will return true if the number is less than 10 and the length of the text is less than 5."
),
t("Call the example condition with _PARAM0_ and _PARAM1_"),
t("Dummy Extension"),
"res/conditions/camera24.png",
"res/conditions/camera.png"
)
.addParameter("expression", t("Number 1"), "", false)
.addParameter("string", t("Text 1"), "", false)
.getCodeExtraInformation()
.setIncludeFile(
"Extensions/ExampleJsExtension/examplejsextensiontools.js"
)
.setFunctionName("gdjs.evtTools.exampleJsExtension.myConditionFunction");
extension
.addExpression(
"DummyExpression",
t("Dummy expression example"),
t("This is an example of an expression"),
t("Dummy Extension"),
"res/actions/camera.png"
)
.addParameter("expression", t("Maximum"), "", false)
.getCodeExtraInformation()
.setFunctionName("gdjs.random");
extension
.addStrExpression(
"DummyStrExpression",
t("Dummy string expression example"),
t("This is an example of an expression returning a string"),
t("Dummy Extension"),
"res/actions/camera.png"
)
.getCodeExtraInformation()
.setIncludeFile(
"Extensions/ExampleJsExtension/examplejsextensiontools.js"
)
.setFunctionName("gdjs.evtTools.exampleJsExtension.getString");
// Declare a behavior.
// Create a new gd.BehaviorJsImplementation object and implement the methods
// that are called to get and set the properties of the behavior.
// Everything that is stored inside the behavior is in "behaviorContent" and is automatically
// saved/loaded to JSON.
var dummyBehavior = new gd.BehaviorJsImplementation();
dummyBehavior.updateProperty = function(
behaviorContent,
propertyName,
newValue
) {
if (propertyName === "My first property") {
behaviorContent.property1 = newValue;
return true;
}
if (propertyName === "My other property") {
behaviorContent.property2 = newValue === "1";
return true;
}
return false;
};
dummyBehavior.getProperties = function(behaviorContent) {
var behaviorProperties = new gd.MapStringPropertyDescriptor();
behaviorProperties.set(
"My first property",
new gd.PropertyDescriptor(behaviorContent.property1)
);
behaviorProperties.set(
"My other property",
new gd.PropertyDescriptor(
behaviorContent.property2 ? "true" : "false"
).setType("Boolean")
);
return behaviorProperties;
};
dummyBehavior.setRawJSONContent(
JSON.stringify({
property1: "Initial value 1",
property2: true
})
);
extension
.addBehavior(
"DummyBehavior",
t("Dummy behavior for testing"),
"DummyBehavior",
t("This dummy behavior does nothing"),
"",
"CppPlatform/Extensions/topdownmovementicon.png",
"DummyBehavior",
dummyBehavior,
new gd.BehaviorsSharedData()
)
.setIncludeFile("Extensions/ExampleJsExtension/dummyruntimebehavior.js")
// You can optionally include more than one file when the behavior is used:
.addIncludeFile(
"Extensions/ExampleJsExtension/examplejsextensiontools.js"
);
// Declare another behavior, with shared data between the behaviors
// In addition to the usual behavior:
// Create a new gd.BehaviorSharedDataJsImplementation object and implement the methods
// that are called to get and set the properties of the shared data.
var dummyBehaviorWithSharedData = new gd.BehaviorJsImplementation();
dummyBehaviorWithSharedData.updateProperty = function(
behaviorContent,
propertyName,
newValue
) {
if (propertyName === "My behavior property") {
behaviorContent.property1 = newValue;
return true;
}
return false;
};
dummyBehaviorWithSharedData.getProperties = function(behaviorContent) {
var behaviorProperties = new gd.MapStringPropertyDescriptor();
behaviorProperties.set(
"My behavior property",
new gd.PropertyDescriptor(behaviorContent.property1)
);
return behaviorProperties;
};
dummyBehaviorWithSharedData.setRawJSONContent(
JSON.stringify({
property1: "Initial value 1"
})
);
var sharedData = new gd.BehaviorSharedDataJsImplementation();
sharedData.updateProperty = function(
sharedContent,
propertyName,
newValue
) {
if (propertyName === "My shared property") {
sharedContent.sharedProperty1 = newValue;
return true;
}
return false;
};
sharedData.getProperties = function(sharedContent) {
var sharedProperties = new gd.MapStringPropertyDescriptor();
sharedProperties.set(
"My shared property",
new gd.PropertyDescriptor(sharedContent.sharedProperty1 || "")
);
return sharedProperties;
};
sharedData.setRawJSONContent(
JSON.stringify({
sharedProperty1: "Initial shared value 1"
})
);
extension
.addBehavior(
"DummyBehaviorWithSharedData",
t("Dummy behavior with shared data for testing"),
"DummyBehaviorWithSharedData",
t("This dummy behavior uses shared data and does nothing"),
"",
"CppPlatform/Extensions/topdownmovementicon.png",
"DummyBehaviorWithSharedData",
dummyBehaviorWithSharedData,
sharedData
)
.setIncludeFile(
"Extensions/ExampleJsExtension/dummywithshareddataruntimebehavior.js"
)
// You can optionally include more than one file when the behavior is used:
.addIncludeFile(
"Extensions/ExampleJsExtension/examplejsextensiontools.js"
);
// Declare an object.
// Create a new gd.ObjectJsImplementation object and implement the methods
// that are called to get and set the properties of the object, as well
// as the properties of the initial instances of this object
// Everything that is stored inside the object is in "content" and is automatically
// saved/loaded to JSON.
var dummyObject = new gd.ObjectJsImplementation();
dummyObject.updateProperty = function(
objectContent,
propertyName,
newValue
) {
if (propertyName === "My first property") {
objectContent.property1 = newValue;
return true;
}
if (propertyName === "My other property") {
objectContent.property2 = newValue === "1";
return true;
}
if (propertyName === "My third property") {
objectContent.property3 = newValue;
return true;
}
return false;
};
dummyObject.getProperties = function(objectContent) {
var objectProperties = new gd.MapStringPropertyDescriptor();
objectProperties.set(
"My first property",
new gd.PropertyDescriptor(objectContent.property1)
);
objectProperties.set(
"My other property",
new gd.PropertyDescriptor(
objectContent.property2 ? "true" : "false"
).setType("boolean")
);
objectProperties.set(
"My third property",
new gd.PropertyDescriptor(objectContent.property3.toString()).setType(
"number"
)
);
return objectProperties;
};
dummyObject.setRawJSONContent(
JSON.stringify({
property1: "Initial value",
property2: true,
property3: 123
})
);
dummyObject.updateInitialInstanceProperty = function(
objectContent,
instance,
propertyName,
newValue,
project,
layout
) {
if (propertyName === "My instance property") {
instance.setRawStringProperty("instanceprop1", newValue);
return true;
}
if (propertyName === "My other instance property") {
instance.setRawFloatProperty("instanceprop2", parseFloat(newValue));
return true;
}
return false;
};
dummyObject.getInitialInstanceProperties = function(
content,
instance,
project,
layout
) {
var instanceProperties = new gd.MapStringPropertyDescriptor();
instanceProperties.set(
"My instance property",
new gd.PropertyDescriptor(
instance.getRawStringProperty("instanceprop1")
)
);
instanceProperties.set(
"My other instance property",
new gd.PropertyDescriptor(
instance.getRawFloatProperty("instanceprop2").toString()
).setType("number")
);
return instanceProperties;
};
extension.addObject(
"DummyObject",
t("Dummy object for testing"),
t("This dummy object does nothing"),
"CppPlatform/Extensions/topdownmovementicon.png",
dummyObject
);
return extension;
},
/**
* You can optionally add sanity tests that will check the basic working
* of your extension behaviors/objects by instanciating behaviors/objects
* and setting the property to a given value.
*
* If you don't have any tests, you can simply return an empty array like this:
* `runExtensionSanityTests: function(gd, extension) { return []; }`
*
* But it is recommended to create tests for the behaviors/objects properties you created
* to avoid mistakes.
*/
runExtensionSanityTests: function(gd, extension) {
const dummyBehavior = extension
.getBehaviorMetadata("MyDummyExtension::DummyBehavior")
.get();
const sharedData = extension
.getBehaviorMetadata("MyDummyExtension::DummyBehaviorWithSharedData")
.getSharedDataInstance();
return [
gd.ProjectHelper.sanityCheckBehaviorProperty(
dummyBehavior,
"My first property",
"Testing value"
),
gd.ProjectHelper.sanityCheckBehaviorsSharedDataProperty(
sharedData,
"My shared property",
"Testing value"
)
];
}
};

View File

@@ -0,0 +1,35 @@
/**
* The DummyRuntimeBehavior changes a variable in the object that is owning
* it, at every tick before events are run, to set it to the string that was
* set in one of the behavior property.
*
* @class DummyRuntimeBehavior
* @extends gdjs.RuntimeBehavior
* @constructor
*/
gdjs.DummyRuntimeBehavior = function(runtimeScene, behaviorData, owner)
{
gdjs.RuntimeBehavior.call(this, runtimeScene, behaviorData, owner);
// Here you can access to the behavior data (JSON declared in JsExtension.js)
// using behaviorData.content:
this._textToSet = behaviorData.content.property1;
// You can also run arbitrary code at the creation of the behavior:
console.log("DummyRuntimeBehavior was created for object:", owner);
};
gdjs.DummyRuntimeBehavior.prototype = Object.create( gdjs.RuntimeBehavior.prototype );
gdjs.DummyRuntimeBehavior.thisIsARuntimeBehaviorConstructor = "MyDummyExtension::DummyBehavior";
gdjs.DummyRuntimeBehavior.prototype.onDeActivate = function() {
};
gdjs.DummyRuntimeBehavior.prototype.doStepPreEvents = function(runtimeScene) {
// This is run at every frame, before events are launched.
this.owner.getVariables().get("VariableSetFromBehavior").setString(this._textToSet);
};
gdjs.DummyRuntimeBehavior.prototype.doStepPostEvents = function(runtimeScene) {
// This is run at every frame, after events are launched.
};

View File

@@ -0,0 +1,36 @@
/**
* @class DummyWithSharedDataRuntimeBehavior
* @extends gdjs.RuntimeBehavior
* @constructor
*/
gdjs.DummyWithSharedDataRuntimeBehavior = function(runtimeScene, behaviorData, owner)
{
gdjs.RuntimeBehavior.call(this, runtimeScene, behaviorData, owner);
// Here you can access to the behavior data (JSON declared in JsExtension.js)
// using behaviorData.content:
this._textToSet = behaviorData.content.property1;
// You can also access to the shared data:
var sharedData = runtimeScene.getInitialSharedDataForBehavior(behaviorData.name);
this._textToSet = sharedData.content.sharedProperty1;
// You can also run arbitrary code at the creation of the behavior:
console.log("DummyWithSharedDataRuntimeBehavior was created for object:", owner);
console.log("The shared data are:", sharedData);
};
gdjs.DummyWithSharedDataRuntimeBehavior.prototype = Object.create( gdjs.RuntimeBehavior.prototype );
gdjs.DummyWithSharedDataRuntimeBehavior.thisIsARuntimeBehaviorConstructor = "MyDummyExtension::DummyBehaviorWithSharedData";
gdjs.DummyWithSharedDataRuntimeBehavior.prototype.onDeActivate = function() {
};
gdjs.DummyWithSharedDataRuntimeBehavior.prototype.doStepPreEvents = function(runtimeScene) {
// This is run at every frame, before events are launched.
this.owner.getVariables().get("VariableSetFromBehavior").setString(this._textToSet);
};
gdjs.DummyWithSharedDataRuntimeBehavior.prototype.doStepPostEvents = function(runtimeScene) {
// This is run at every frame, after events are launched.
};

View File

@@ -0,0 +1,73 @@
/**
* This is an example of some functions that can be used through events.
* They could live on any object but it's usual to store them in an object
* with the extension name in `gdjs.evtTools`.
*
* Functions are being passed the arguments that were declared in the extension.
*
* @memberof gdjs.evtTools
* @class exampleJsExtension
* @static
* @private
*/
gdjs.evtTools.exampleJsExtension = {};
gdjs.evtTools.exampleJsExtension.myConditionFunction = function(number, text) {
return number <= 10 && text.length < 5;
};
gdjs.evtTools.exampleJsExtension.getString = function() {
return "Hello World";
};
/**
* You can also attach an object to gdjs, that you can use to store more information
* or objects - even if you should have doing so as global state can make things harder
* to debug. Most of the time you can have all the logic in your functions, your gdjs.RuntimeBehavior
* or your gdjs.RuntimeObject.
*/
gdjs.exampleJsExtension = {
myGlobalString: "Hello World"
};
/**
* In **rare cases** you may want to run code at the start of the scene. You can define a callback
* that will be called at this moment. Name you callback gdjsCallbackRuntimeSceneLoaded.
* GDJS will scan anything declared inside gdjs for these names.
*/
gdjs.exampleJsExtension.gdjsCallbackRuntimeSceneLoaded = function(
runtimeScene
) {
console.log("A gdjs.RuntimeScene was loaded:", runtimeScene);
};
/**
* In **rare cases** you may want to run code at the end of a scene. You can define a callback
* that will be called at this moment. Name you callback gdjsCallbackRuntimeSceneLoaded.
* GDJS will scan anything declared inside gdjs for these names.
*/
gdjs.exampleJsExtension.callbacksRuntimeSceneUnloaded = function(runtimeScene) {
console.log("A gdjs.RuntimeScene was unloaded:", runtimeScene);
};
/**
* In **very rare cases** you may want to run code whenever an object is deleted.
* You can create a callback named "callbacksObjectDeletedFromScene" on your extension object.
* GDJS will scan anything declared inside gdjs for this name.
*/
gdjs.exampleJsExtension.callbacksObjectDeletedFromScene = function(
runtimeScene,
runtimeObject
) {
console.log(
"A gdjs.RuntimeObject was deleted from a gdjs.RuntimeScene:",
runtimeScene,
runtimeObject
);
};
// Finally, note that you can also simply run code here. Most of the time you shouldn't need it though.
console.log(
"gdjs.exampleJsExtension was created, with myGlobalString containing:" +
gdjs.exampleJsExtension.myGlobalString
);

View File

@@ -1,21 +0,0 @@
cmake_minimum_required(VERSION 2.6)
cmake_policy(SET CMP0015 NEW)
project(FacebookInstantGames)
gd_add_extension_includes()
#Defines
###
gd_add_extension_definitions(FacebookInstantGames)
#The targets
###
include_directories(.)
file(GLOB source_files *.cpp *.h)
gd_add_extension_target(FacebookInstantGames "${source_files}" "JsPlatform")
gd_add_clang_utils(FacebookInstantGames "${source_files}")
#Linker files for the IDE extension
###
gd_extension_link_libraries(FacebookInstantGames)

View File

@@ -1,74 +0,0 @@
/**
GDevelop - Facebook Instant Games Extension
Copyright (c)2018 Florian Rival (Florian.Rival@gmail.com)
This project is released under the MIT License.
*/
#if defined(GD_IDE_ONLY)
#include "GDCore/Extensions/PlatformExtension.h"
#include "GDCore/Tools/Localization.h"
void DeclareFacebookInstantGamesExtension(gd::PlatformExtension& extension) {
extension.SetExtensionInformation(
"FacebookInstantGames",
_("Facebook Instant Games"),
_("Allow your game to send scores and interact with Facebook Instant Games"),
"Florian Rival",
"Open source (MIT License)");
#if defined(GD_IDE_ONLY)
extension.AddStrExpression("PlayerId",
_("Player identifier"),
_("Get the player unique identifier"),
_("Facebook Instant Games"),
"JsPlatform/Extensions/Facebookicon16.png");
extension.AddStrExpression("PlayerName",
_("Player name"),
_("Get the player name"),
_("Facebook Instant Games"),
"JsPlatform/Extensions/Facebookicon16.png");
#endif
}
/**
* \brief This class declares information about the JS extension.
*/
class FacebookInstantGamesJsExtension : public gd::PlatformExtension {
public:
/**
* \brief Constructor of an extension declares everything the extension
* contains: objects, actions, conditions and expressions.
*/
FacebookInstantGamesJsExtension() {
DeclareFacebookInstantGamesExtension(*this);
GetAllStrExpressions()["FacebookInstantGames::PlayerId"]
.codeExtraInformation
.SetIncludeFile("Extensions/FacebookInstantGames/facebookinstantgamestools.js")
.SetFunctionName("gdjs.evtTools.facebookInstantGames.getPlayerId()");
GetAllStrExpressions()["FacebookInstantGames::PlayerName"]
.codeExtraInformation
.SetIncludeFile("Extensions/FacebookInstantGames/facebookinstantgamestools.js")
.SetFunctionName("gdjs.evtTools.facebookInstantGames.getPlayerName()");
StripUnimplementedInstructionsAndExpressions();
GD_COMPLETE_EXTENSION_COMPILATION_INFORMATION();
};
};
#if defined(EMSCRIPTEN)
extern "C" gd::PlatformExtension* CreateGDJSFacebookInstantGamesExtension() {
return new FacebookInstantGamesJsExtension;
}
#else
/**
* Used by GDevelop to create the extension class
* -- Do not need to be modified. --
*/
extern "C" gd::PlatformExtension* GD_EXTENSION_API CreateGDJSExtension() {
return new FacebookInstantGamesJsExtension;
}
#endif
#endif

View File

@@ -0,0 +1,219 @@
/**
* This is a declaration of an extension for GDevelop 5.
*
* Run `node import-GDJS-Runtime.js` (in newIDE/app/scripts) if you make any change
* to this extension file or to any other *.js file that you reference inside.
*
* The file must be named "JsExtension.js", otherwise GDevelop won't load it.
* ⚠️ If you make a change and the extension is not loaded, open the developer console
* and search for any errors.
*
* More information on https://github.com/4ian/GD/blob/master/newIDE/README-extensions.md
*/
module.exports = {
createExtension: function(t, gd) {
const extension = new gd.PlatformExtension();
extension
.setExtensionInformation(
"FacebookInstantGames",
t("Facebook Instant Games"),
t(
"Allow your game to send scores and interact with Facebook Instant Games"
),
"Florian Rival",
"Open source (MIT License)"
)
.setExtensionHelpPath("/publishing/publishing-to-facebook-instant-games");
extension
.addAction(
"SavePlayerData",
t("Save player data"),
t(
"Save the content of the given variable in the player data, stored on Facebook Instant Games servers"
),
t(
"Save the content of _PARAM1_ in key _PARAM1_ of player data (store success message in _PARAM2_ or error in _PARAM3_)"
),
t("Facebook Instant Games/Player data"),
"JsPlatform/Extensions/facebookicon24.png",
"JsPlatform/Extensions/facebookicon16.png"
)
.addParameter("string", 'Data key name (e.g: "Lives")', "", false)
.addParameter("scenevar", "Variable with the content to save", "", false)
.addParameter(
"scenevar",
t("Variable where to store the success message (optional)"),
"",
true
)
.addParameter(
"scenevar",
t("Variable where to error message (optional, if an error occurs)"),
"",
true
)
.getCodeExtraInformation()
.setIncludeFile(
"Extensions/FacebookInstantGames/facebookinstantgamestools.js"
)
.setFunctionName("gdjs.evtTools.facebookInstantGames.setPlayerData");
extension
.addAction(
"LoadPlayerData",
t("Load player data"),
t("Load the player data with the given key in a variable"),
t(
"Load player data with key _PARAM0_ in _PARAM1_ (or error in _PARAM2_)"
),
t("Facebook Instant Games/Player data"),
"JsPlatform/Extensions/facebookicon24.png",
"JsPlatform/Extensions/facebookicon16.png"
)
.addParameter("string", t('Data key name (e.g: "Lives")'), "", false)
.addParameter(
"scenevar",
t("Variable where to store loaded data"),
"",
false
)
.addParameter(
"scenevar",
t("Variable where to error message (optional, if an error occurs)"),
"",
true
)
.getCodeExtraInformation()
.setIncludeFile(
"Extensions/FacebookInstantGames/facebookinstantgamestools.js"
)
.setFunctionName("gdjs.evtTools.facebookInstantGames.loadPlayerData");
extension
.addAction(
"SavePlayerScore",
t("Save player score"),
t(
"Save the score, and optionally the content of the given variable in the player score, for the given metadata."
),
t(
"In leaderboard _PARAM0_, save score _PARAM1_ for the player and extra data from _PARAM2_ (store success message in _PARAM3_ or error in _PARAM4_)"
),
t("Facebook Instant Games/Leaderboards"),
"JsPlatform/Extensions/facebookicon24.png",
"JsPlatform/Extensions/facebookicon16.png"
)
.addParameter(
"string",
'Leaderboard name (e.g: "PlayersBestTimes")',
"",
false
)
.addParameter("expression", "Score to register for the player", "", false)
.addParameter(
"scenevar",
t("Optional variable with metadata to save"),
"",
true
)
.addParameter(
"scenevar",
t("Variable where to store the success message (optional)"),
"",
true
)
.addParameter(
"scenevar",
t("Variable where to error message (optional, if an error occurs)"),
"",
true
)
.getCodeExtraInformation()
.setIncludeFile(
"Extensions/FacebookInstantGames/facebookinstantgamestools.js"
)
.setFunctionName("gdjs.evtTools.facebookInstantGames.setPlayerScore");
extension
.addAction(
"LoadPlayerEntry",
t("Load player entry"),
t("Load the player entry in the given leaderboard"),
t(
"Load player entry from leaderboard _PARAM0_. Set rank in _PARAM1_, score in _PARAM2_ (extra data if any in _PARAM3_ and error in _PARAM4_)"
),
t("Facebook Instant Games/Leaderboards"),
"JsPlatform/Extensions/facebookicon24.png",
"JsPlatform/Extensions/facebookicon16.png"
)
.addParameter(
"string",
t('Leaderboard name (e.g: "PlayersBestTimes")'),
"",
false
)
.addParameter(
"scenevar",
t("Variable where to store the player rank (of -1 if not ranked)"),
"",
true
)
.addParameter(
"scenevar",
t("Variable where to store the player score (of -1 if no score)"),
"",
true
)
.addParameter(
"scenevar",
t("Variable where to store extra data (if any)"),
"",
true
)
.addParameter(
"scenevar",
t("Variable where to error message (optional, if an error occurs)"),
"",
true
)
.getCodeExtraInformation()
.setIncludeFile(
"Extensions/FacebookInstantGames/facebookinstantgamestools.js"
)
.setFunctionName("gdjs.evtTools.facebookInstantGames.getPlayerEntry");
extension
.addStrExpression(
"PlayerId",
t("Player identifier"),
t("Get the player unique identifier"),
t("Facebook Instant Games"),
"JsPlatform/Extensions/facebookicon16.png"
)
.getCodeExtraInformation()
.setIncludeFile(
"Extensions/FacebookInstantGames/facebookinstantgamestools.js"
)
.setFunctionName("gdjs.evtTools.facebookInstantGames.getPlayerId");
extension
.addStrExpression(
"PlayerName",
t("Player name"),
t("Get the player name"),
t("Facebook Instant Games"),
"JsPlatform/Extensions/facebookicon16.png"
)
.getCodeExtraInformation()
.setIncludeFile(
"Extensions/FacebookInstantGames/facebookinstantgamestools.js"
)
.setFunctionName("gdjs.evtTools.facebookInstantGames.getPlayerName");
return extension;
},
runExtensionSanityTests: function(gd, extension) {
return [];
}
};

View File

@@ -0,0 +1,183 @@
/**
* @memberof gdjs.evtTools
* @class facebookInstantGames
* @static
* @private
*/
gdjs.evtTools.facebookInstantGames = {};
gdjs.evtTools.facebookInstantGames.getPlayerId = function() {
if (typeof FBInstant === "undefined") return "";
return FBInstant.player.getID() || "";
};
gdjs.evtTools.facebookInstantGames.getPlayerName = function() {
if (typeof FBInstant === "undefined") return "";
return FBInstant.player.getName() || "";
};
gdjs.evtTools.facebookInstantGames.loadPlayerData = function(
key,
successVariable,
errorVariable
) {
if (typeof FBInstant === "undefined") return;
errorVariable.setString("");
successVariable.setString("");
FBInstant.player
.getDataAsync([key])
.then(function(data) {
gdjs.evtTools.network.jsonToVariableStructure(data[key], successVariable);
})
.catch(function(error) {
errorVariable.setString(error.message || "Unknown error");
});
};
gdjs.evtTools.facebookInstantGames.setPlayerData = function(
key,
variable,
successVariable,
errorVariable
) {
if (typeof FBInstant === "undefined") return;
errorVariable.setString("");
successVariable.setString("");
var data = {};
data[key] = gdjs.evtTools.network.variableStructureToJSON(variable);
FBInstant.player
.setDataAsync(data)
.then(function() {
successVariable.setString("Player data saved");
})
.catch(function(error) {
errorVariable.setString(error.message || "Unknown error");
});
};
gdjs.evtTools.facebookInstantGames.setPlayerScore = function(
leaderboardName,
score,
extraDataVariable,
successVariable,
errorVariable
) {
if (typeof FBInstant === "undefined") return;
errorVariable.setString("");
successVariable.setString("");
var data = gdjs.evtTools.network.variableStructureToJSON(extraDataVariable);
FBInstant.getLeaderboardAsync(leaderboardName)
.then(function(leaderboard) {
return leaderboard.setScoreAsync(score, data);
})
.then(function() {
successVariable.setString("Player score saved");
})
.catch(function(error) {
errorVariable.setString(error.message || "Unknown error");
});
};
gdjs.evtTools.facebookInstantGames.getPlayerEntry = function(
leaderboardName,
rankVariable,
scoreVariable,
extraDataVariable,
errorVariable
) {
if (typeof FBInstant === "undefined") return;
errorVariable.setString("");
extraDataVariable.setString("");
FBInstant.getLeaderboardAsync(leaderboardName)
.then(function(leaderboard) {
return leaderboard.getPlayerEntryAsync();
})
.then(function(entry) {
rankVariable.setNumber(entry.getRank() === null ? -1 : entry.getRank());
scoreVariable.setNumber(entry.getScore() === null ? -1 : entry.getScore());
gdjs.evtTools.network.jsonToVariableStructure(
entry.getExtraData(),
extraDataVariable
);
})
.catch(function(error) {
errorVariable.setString(error.message || "Unknown error");
});
};
if (typeof FBInstant === "undefined" && typeof window !== "undefined") {
console.log("Creating a mocked version of Facebook Instant Games");
function MockedLeaderboard() {
this._playerScore = null;
this._playerRank = null;
this._playerExtraData = null;
}
MockedLeaderboard.prototype.setScoreAsync = function(score, extraData) {
var that = this;
return new Promise(function(resolve) {
that._playerScore = score;
that._playerRank = 1;
that._playerExtraData = extraData;
resolve();
});
};
MockedLeaderboard.prototype.getPlayerEntryAsync = function() {
var that = this;
return new Promise(function(resolve) {
resolve({
getScore: function() {
return that._playerScore;
},
getRank: function() {
return that._playerRank;
},
getExtraData: function() {
return that._playerExtraData;
}
});
});
};
var FBInstantMock = {
_mockedPlayerData: {},
_mockedLeaderboards: {},
player: {
getName: function() {
return "Fake player name";
},
getID: function() {
return "12345678";
},
getDataAsync: function(key) {
return new Promise(function(resolve) {
resolve(FBInstantMock._mockedPlayerData);
});
},
setDataAsync: function(data) {
return new Promise(function(resolve) {
FBInstantMock._mockedPlayerData = data;
resolve();
});
}
},
getLeaderboardAsync: function(leaderboardName) {
return new Promise(function(resolve) {
FBInstantMock._mockedLeaderboards[leaderboardName] =
FBInstantMock._mockedLeaderboards[leaderboardName] ||
new MockedLeaderboard();
resolve(FBInstantMock._mockedLeaderboards[leaderboardName]);
});
}
};
window.FBInstant = FBInstantMock;
}

File diff suppressed because one or more lines are too long

View File

@@ -1,19 +0,0 @@
/**
* @namespace gdjs.evtTools
* @class facebookInstantGames
* @static
* @private
*/
gdjs.evtTools.facebookInstantGames = {};
gdjs.evtTools.facebookInstantGames.getPlayerId = function() {
if (typeof FBInstant === 'undefined') return;
return FBInstant.player.getID() || '';
};
gdjs.evtTools.facebookInstantGames.getPlayerName = function() {
if (typeof FBInstant === 'undefined') return;
return FBInstant.player.getName() || '';
};

View File

@@ -17,7 +17,8 @@ void DeclareInventoryExtension(gd::PlatformExtension& extension) {
_("Provides actions and conditions to add an inventory to your game, "
"with items in memory."),
"Florian Rival",
"Open source (MIT License)");
"Open source (MIT License)")
.SetExtensionHelpPath("all-features/inventory");
#if defined(GD_IDE_ONLY)
extension

View File

@@ -16,7 +16,7 @@ gdjs.InventoryManager.get = function(runtimeScene, name) {
}
/**
* @namespace gdjs.evtTools
* @memberof gdjs.evtTools
* @class inventory
* @static
* @private

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