Compare commits
201 Commits
v5.0.0-bet
...
v5.0.0-bet
Author | SHA1 | Date | |
---|---|---|---|
![]() |
38ae17595e | ||
![]() |
545caa1dbd | ||
![]() |
3be23212a6 | ||
![]() |
54b6bf969c | ||
![]() |
d449a478f5 | ||
![]() |
b410a1e1b3 | ||
![]() |
6d6d86a325 | ||
![]() |
291d6663f2 | ||
![]() |
4ab27e0954 | ||
![]() |
28ffcf923b | ||
![]() |
af5faa2e10 | ||
![]() |
4bfdc4a2a1 | ||
![]() |
c6141322c5 | ||
![]() |
59f8421a03 | ||
![]() |
b217f80c23 | ||
![]() |
70635d1655 | ||
![]() |
9dfbe94c13 | ||
![]() |
7244885fd6 | ||
![]() |
f8e5ac7828 | ||
![]() |
030f873433 | ||
![]() |
74e5b4862e | ||
![]() |
87f20b82f1 | ||
![]() |
992c00c096 | ||
![]() |
2673c1526d | ||
![]() |
2ddc451691 | ||
![]() |
0a77880dc3 | ||
![]() |
aefddd0bf4 | ||
![]() |
1e1b3a7a42 | ||
![]() |
e9a50f1146 | ||
![]() |
28957c5662 | ||
![]() |
303a489a41 | ||
![]() |
fe7d66dc1c | ||
![]() |
a287e24c6b | ||
![]() |
8ec191ebf5 | ||
![]() |
9e6a40a07e | ||
![]() |
b785b3d2fc | ||
![]() |
5bf75f8cd6 | ||
![]() |
e71e019415 | ||
![]() |
1bd73f3ff4 | ||
![]() |
f1148655d5 | ||
![]() |
cadfc98b47 | ||
![]() |
bda4a790b9 | ||
![]() |
be34bbc0af | ||
![]() |
da91917b40 | ||
![]() |
9c6978b70a | ||
![]() |
feec79d9de | ||
![]() |
ed872b8c95 | ||
![]() |
04ea7d16fe | ||
![]() |
7ae838bff4 | ||
![]() |
a324405695 | ||
![]() |
204f6cd1f1 | ||
![]() |
1a0dcc01df | ||
![]() |
bf125a3312 | ||
![]() |
747e2961b3 | ||
![]() |
011932ba27 | ||
![]() |
2037176b1e | ||
![]() |
525b99697b | ||
![]() |
69849cb7be | ||
![]() |
c8e56c60c5 | ||
![]() |
f182ed0704 | ||
![]() |
98f97f7b17 | ||
![]() |
a60eee9924 | ||
![]() |
6b6cd0b61d | ||
![]() |
5c19c9bb14 | ||
![]() |
3f4d1d66ef | ||
![]() |
c17fcaf9ac | ||
![]() |
687758a41f | ||
![]() |
bbb541ce48 | ||
![]() |
10ef38978d | ||
![]() |
c70604f196 | ||
![]() |
c5ffa44aa2 | ||
![]() |
bf69037e46 | ||
![]() |
2c422a5927 | ||
![]() |
f5149d7c61 | ||
![]() |
a1a56f1b3b | ||
![]() |
dcec81519b | ||
![]() |
c9c2e41bd9 | ||
![]() |
39a6aa2a90 | ||
![]() |
f4532e7e4c | ||
![]() |
9a551673e8 | ||
![]() |
39887ccc80 | ||
![]() |
97c0761288 | ||
![]() |
edb33e805f | ||
![]() |
e1cfca6930 | ||
![]() |
26ffcda159 | ||
![]() |
ee905f4f04 | ||
![]() |
e4b2fe677b | ||
![]() |
2ed9b058be | ||
![]() |
35e3015d66 | ||
![]() |
b6707d62b2 | ||
![]() |
76466af778 | ||
![]() |
193b8fa36e | ||
![]() |
1c24e4f14d | ||
![]() |
d0bfb37680 | ||
![]() |
db480f09d8 | ||
![]() |
b2b3307ff7 | ||
![]() |
17754d4fe5 | ||
![]() |
0f912472ce | ||
![]() |
8c13b051ad | ||
![]() |
268075b8bc | ||
![]() |
23e899d93d | ||
![]() |
1a76ad9069 | ||
![]() |
1ac26ab8ce | ||
![]() |
69fa249db5 | ||
![]() |
f31b46cb14 | ||
![]() |
9e5ca5fb0b | ||
![]() |
b64eeebcbe | ||
![]() |
c9ae252ae8 | ||
![]() |
ca789c7b0b | ||
![]() |
a142472ea6 | ||
![]() |
d0c1f7fe03 | ||
![]() |
6680682001 | ||
![]() |
91ff59e846 | ||
![]() |
65aa60e726 | ||
![]() |
5bb6150861 | ||
![]() |
6b850e82e7 | ||
![]() |
400c956c2a | ||
![]() |
896446f640 | ||
![]() |
c8f526e726 | ||
![]() |
8bc6ea0744 | ||
![]() |
215cb0b859 | ||
![]() |
0d9e31f986 | ||
![]() |
0019da90c7 | ||
![]() |
dc870d55ac | ||
![]() |
df1fff36e4 | ||
![]() |
5da334a38e | ||
![]() |
3be5d85733 | ||
![]() |
4c62bc2f33 | ||
![]() |
57fbe470b7 | ||
![]() |
25abff997e | ||
![]() |
97ced4145f | ||
![]() |
1d7f8958fc | ||
![]() |
373c55ddc5 | ||
![]() |
8e0783e45f | ||
![]() |
22b977fd0e | ||
![]() |
f9925943a3 | ||
![]() |
26b6c8c6aa | ||
![]() |
ff1fec7c5c | ||
![]() |
97aeafc4c3 | ||
![]() |
5468ea19b3 | ||
![]() |
4ce2ba08ef | ||
![]() |
561ef0434f | ||
![]() |
d229d01aa9 | ||
![]() |
5fc9a4a51a | ||
![]() |
9f05a4e190 | ||
![]() |
ac7f681947 | ||
![]() |
f7ae28bea9 | ||
![]() |
3104eeb415 | ||
![]() |
cdf95811b9 | ||
![]() |
731356b791 | ||
![]() |
8dd13180fd | ||
![]() |
81421907a5 | ||
![]() |
bb23e2c018 | ||
![]() |
eb6461c819 | ||
![]() |
1a3bd2423d | ||
![]() |
c22934d46f | ||
![]() |
6cdee3b977 | ||
![]() |
88d102620a | ||
![]() |
3c5280a0f0 | ||
![]() |
ad9abd971c | ||
![]() |
48465425e4 | ||
![]() |
02ddea17ea | ||
![]() |
24b68f75b8 | ||
![]() |
bed9c77c8c | ||
![]() |
0a6f810695 | ||
![]() |
a70f5df386 | ||
![]() |
83951c952f | ||
![]() |
5b0758a035 | ||
![]() |
058a2e6c82 | ||
![]() |
78b00f8c36 | ||
![]() |
2de67eae57 | ||
![]() |
4b6e8454de | ||
![]() |
b3d9a773b0 | ||
![]() |
796937ba5d | ||
![]() |
977095fb36 | ||
![]() |
f1f1123dad | ||
![]() |
d8e87cd976 | ||
![]() |
663336c4ee | ||
![]() |
96c993e057 | ||
![]() |
5742dcfbf8 | ||
![]() |
bf231c6c07 | ||
![]() |
fdbc91137c | ||
![]() |
3e409681c2 | ||
![]() |
c23642e78c | ||
![]() |
7845a3577c | ||
![]() |
60484ee464 | ||
![]() |
06b54e277a | ||
![]() |
daa683f492 | ||
![]() |
f3a43e8739 | ||
![]() |
4fb830529a | ||
![]() |
9b7b02fab2 | ||
![]() |
ae3b25f8c0 | ||
![]() |
c59204ce04 | ||
![]() |
fd63f7bc96 | ||
![]() |
147dc321f1 | ||
![]() |
fd72c6efe9 | ||
![]() |
ff1891bb3a | ||
![]() |
ec32788b4c | ||
![]() |
95622169a3 | ||
![]() |
e89de02fa6 | ||
![]() |
63a5734f32 |
1
.clang_format
Normal file
@@ -0,0 +1 @@
|
||||
{BasedOnStyle: Google, BinPackParameters: false, BinPackArguments: false}
|
9
.vscode/settings.json
vendored
@@ -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}"
|
||||
}
|
||||
|
@@ -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 |
After Width: | Height: | Size: 861 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.8 KiB |
@@ -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 |
After Width: | Height: | Size: 724 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.5 KiB |
@@ -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 |
After Width: | Height: | Size: 716 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.4 KiB |
@@ -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 |
After Width: | Height: | Size: 780 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.7 KiB |
@@ -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 |
After Width: | Height: | Size: 882 B |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.8 KiB |
@@ -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 =
|
||||
|
@@ -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.
|
||||
|
@@ -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("\"\"")
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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",
|
||||
|
@@ -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
|
||||
|
@@ -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)
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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"),
|
||||
|
@@ -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",
|
||||
|
@@ -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",
|
||||
|
@@ -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)
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
}
|
||||
|
@@ -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;
|
||||
|
@@ -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
|
||||
|
@@ -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_),
|
||||
|
@@ -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 ¶meterType) {
|
||||
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 ¶meterType) {
|
||||
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)
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
|
@@ -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
|
||||
}
|
||||
|
@@ -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
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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
|
||||
|
||||
|
@@ -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();
|
||||
|
@@ -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;
|
||||
|
@@ -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];
|
||||
}
|
||||
|
@@ -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"
|
||||
|
@@ -12,11 +12,7 @@
|
||||
#include "GDCore/String.h"
|
||||
namespace gd {
|
||||
class Instruction;
|
||||
}
|
||||
namespace gd {
|
||||
class BaseEvent;
|
||||
}
|
||||
namespace gd {
|
||||
class EventsList;
|
||||
}
|
||||
|
||||
|
188
Core/GDCore/IDE/Events/EventsContextAnalyzer.cpp
Normal 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
|
99
Core/GDCore/IDE/Events/EventsContextAnalyzer.h
Normal 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
|
@@ -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(
|
||||
|
@@ -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(); }
|
||||
};
|
||||
|
||||
/**
|
||||
|
37
Core/GDCore/IDE/Events/EventsTypesLister.cpp
Normal 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
|
64
Core/GDCore/IDE/Events/EventsTypesLister.h
Normal 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
|
@@ -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);
|
||||
|
||||
|
@@ -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:
|
||||
|
@@ -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>
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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> >
|
||||
|
@@ -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 {
|
||||
|
@@ -23,6 +23,7 @@ namespace gd {
|
||||
class GD_CORE_API SerializerElement {
|
||||
public:
|
||||
SerializerElement();
|
||||
SerializerElement(const SerializerValue & value);
|
||||
virtual ~SerializerElement();
|
||||
|
||||
/** \name Value
|
||||
|
@@ -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 {
|
||||
|
@@ -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
|
||||
|
@@ -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",
|
||||
|
@@ -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)
|
||||
{
|
||||
|
@@ -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",
|
||||
|
@@ -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 =
|
||||
|
@@ -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()
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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",
|
||||
|
@@ -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")
|
||||
|
204
Extensions/DeviceSensors/JsExtension.js
Normal 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 []; },
|
||||
};
|
87
Extensions/DeviceSensors/devicesensortools.js
Normal 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;
|
||||
};
|
@@ -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",
|
||||
|
355
Extensions/ExampleJsExtension/JsExtension.js
Normal 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"
|
||||
)
|
||||
];
|
||||
}
|
||||
};
|
35
Extensions/ExampleJsExtension/dummyruntimebehavior.js
Normal 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.
|
||||
};
|
@@ -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.
|
||||
};
|
73
Extensions/ExampleJsExtension/examplejsextensiontools.js
Normal 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
|
||||
);
|
@@ -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)
|
@@ -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
|
219
Extensions/FacebookInstantGames/JsExtension.js
Normal 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 [];
|
||||
}
|
||||
};
|
183
Extensions/FacebookInstantGames/facebookinstantgamestools.js
Normal 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;
|
||||
}
|
@@ -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() || '';
|
||||
};
|
@@ -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
|
||||
|
@@ -16,7 +16,7 @@ gdjs.InventoryManager.get = function(runtimeScene, name) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @namespace gdjs.evtTools
|
||||
* @memberof gdjs.evtTools
|
||||
* @class inventory
|
||||
* @static
|
||||
* @private
|
||||
|