mirror of
https://github.com/4ian/GDevelop.git
synced 2025-10-15 10:19:04 +00:00
Compare commits
183 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
db074c7f57 | ||
![]() |
5b1fed4d9e | ||
![]() |
447106b7fb | ||
![]() |
91cfff6e84 | ||
![]() |
db3a107e0f | ||
![]() |
23dab62ad5 | ||
![]() |
3dd5c0f997 | ||
![]() |
517ef5fc57 | ||
![]() |
1d539968bb | ||
![]() |
4879bfe1b1 | ||
![]() |
e83d2a2b48 | ||
![]() |
cd84f6c43c | ||
![]() |
7bcc3dc6bb | ||
![]() |
1a995ba55c | ||
![]() |
622fcdcc62 | ||
![]() |
b933ab24dd | ||
![]() |
7fe4a5c5ff | ||
![]() |
3b36e16256 | ||
![]() |
b620737b18 | ||
![]() |
bcb9b03eab | ||
![]() |
e20f66909e | ||
![]() |
667d0a1f4a | ||
![]() |
de9d6bd103 | ||
![]() |
ba625133f1 | ||
![]() |
44ce216894 | ||
![]() |
0bcf3475b0 | ||
![]() |
09b35c9dd8 | ||
![]() |
0123128206 | ||
![]() |
7a728d370d | ||
![]() |
6bb426ecf6 | ||
![]() |
459b395ee9 | ||
![]() |
943401d8bf | ||
![]() |
020348e3b0 | ||
![]() |
347ee2a74e | ||
![]() |
c7cd582152 | ||
![]() |
6625e3fd00 | ||
![]() |
1710aacb17 | ||
![]() |
c88f7e53c0 | ||
![]() |
4c62c8c046 | ||
![]() |
ab2a347f97 | ||
![]() |
2a90e9bd5e | ||
![]() |
08a9a856a7 | ||
![]() |
ad2e85be49 | ||
![]() |
71f6cd529f | ||
![]() |
70c804e34a | ||
![]() |
8d92dd818e | ||
![]() |
7af76081d0 | ||
![]() |
3e31081e88 | ||
![]() |
c5b5819edf | ||
![]() |
6820a3eb10 | ||
![]() |
727b34df75 | ||
![]() |
bdb5461847 | ||
![]() |
c41537bcac | ||
![]() |
cd05c57e20 | ||
![]() |
c432378c78 | ||
![]() |
b650ba33b1 | ||
![]() |
f67206940e | ||
![]() |
bb69871c93 | ||
![]() |
6abfa19dd8 | ||
![]() |
f8cbd788a1 | ||
![]() |
5516c85f1d | ||
![]() |
dfc4f524fc | ||
![]() |
0b9728030a | ||
![]() |
8aeb7bfacb | ||
![]() |
966105fcc4 | ||
![]() |
51a6c935d9 | ||
![]() |
0d34568afc | ||
![]() |
b68d24e8e4 | ||
![]() |
13d5069bd3 | ||
![]() |
01372c9589 | ||
![]() |
e7498fd8f3 | ||
![]() |
846eceabdf | ||
![]() |
64692e405e | ||
![]() |
1adb4febb1 | ||
![]() |
ff24bf7af6 | ||
![]() |
d705f7503a | ||
![]() |
61b01aa1a1 | ||
![]() |
0296162cda | ||
![]() |
c11ffca94a | ||
![]() |
2fce1fc16f | ||
![]() |
2a3657abef | ||
![]() |
da4dc223f7 | ||
![]() |
eeb0dc8a63 | ||
![]() |
f6f56d77a0 | ||
![]() |
749c383fd7 | ||
![]() |
98c822bfb4 | ||
![]() |
2ed48d302d | ||
![]() |
7e7e93b94c | ||
![]() |
848df5aa5b | ||
![]() |
7a6f3ffe7c | ||
![]() |
21012c3445 | ||
![]() |
5485b28b19 | ||
![]() |
d313f13475 | ||
![]() |
a4e88bd504 | ||
![]() |
f446a75fd8 | ||
![]() |
e64bb8a6f7 | ||
![]() |
1cd4226427 | ||
![]() |
817fba1114 | ||
![]() |
37a0c3c919 | ||
![]() |
fc4b12803d | ||
![]() |
51f09d1bb6 | ||
![]() |
8ce9afff6b | ||
![]() |
84711a25c3 | ||
![]() |
d33042cece | ||
![]() |
719032f91d | ||
![]() |
73c0bf56c8 | ||
![]() |
acd8d54c5e | ||
![]() |
99b0c8345c | ||
![]() |
c97fea1a9e | ||
![]() |
cd7457eba8 | ||
![]() |
c9a0cc9afd | ||
![]() |
0f990cc913 | ||
![]() |
656921b9c8 | ||
![]() |
246bde6dec | ||
![]() |
d54eadf39d | ||
![]() |
3a2f6a2ac7 | ||
![]() |
feb243d2f7 | ||
![]() |
aea43b96d5 | ||
![]() |
64f077bcb2 | ||
![]() |
9e5893883f | ||
![]() |
99681bb89b | ||
![]() |
13dcc9a1bd | ||
![]() |
7eb96d97af | ||
![]() |
8e8b49f27d | ||
![]() |
226f67f114 | ||
![]() |
0c2600ccf4 | ||
![]() |
d3d37afea6 | ||
![]() |
507c23f401 | ||
![]() |
961513f81b | ||
![]() |
de45e12245 | ||
![]() |
746bdd0114 | ||
![]() |
8a0d0d332d | ||
![]() |
40be4153c2 | ||
![]() |
9bae415530 | ||
![]() |
fad17d7901 | ||
![]() |
35f857060c | ||
![]() |
90b8854ecf | ||
![]() |
cbb79a2d52 | ||
![]() |
116411a300 | ||
![]() |
7f3ef4002d | ||
![]() |
7ad5358451 | ||
![]() |
acd08be06a | ||
![]() |
12071e8645 | ||
![]() |
9aad6a89df | ||
![]() |
927632cd0f | ||
![]() |
f44d2ec219 | ||
![]() |
1006cf3fcb | ||
![]() |
fd8b6ce4ba | ||
![]() |
2dac7b12bb | ||
![]() |
cab91ebb8b | ||
![]() |
95709fbd4d | ||
![]() |
72a5d32979 | ||
![]() |
dca642ebb1 | ||
![]() |
d1b486f3cf | ||
![]() |
35c7328a48 | ||
![]() |
e68e814853 | ||
![]() |
117722621a | ||
![]() |
ce1c1c3cea | ||
![]() |
18626964eb | ||
![]() |
f2f40a4275 | ||
![]() |
77e4a1a614 | ||
![]() |
bec51c705b | ||
![]() |
3df427fb7c | ||
![]() |
7a6d549f53 | ||
![]() |
34981bd794 | ||
![]() |
c499817bed | ||
![]() |
f1be2948cf | ||
![]() |
976ea58f6b | ||
![]() |
12323965e0 | ||
![]() |
804e8c8718 | ||
![]() |
a549f220cb | ||
![]() |
452a4ec616 | ||
![]() |
1af2bb6023 | ||
![]() |
21dcb391b4 | ||
![]() |
8602bbfa51 | ||
![]() |
99e4c394fe | ||
![]() |
dc85bbacea | ||
![]() |
b24060f8d0 | ||
![]() |
40ba9526c4 | ||
![]() |
12106192b9 | ||
![]() |
d306c8f3fd | ||
![]() |
57c1b66a25 | ||
![]() |
54b6a7f295 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -50,6 +50,7 @@ Binaries/Packaging/logs
|
||||
!/Binaries/Output/Release_Linux/CppPlatform/
|
||||
/Binaries/**/MinGW32
|
||||
/Binaries/**/CppPlatform/Runtime
|
||||
/Binaries/**/CppPlatform/Sources
|
||||
/Binaries/**/CppPlatform/include
|
||||
/Binaries/**/CppPlatform/Extensions/include
|
||||
/Binaries/**/JsPlatform/Runtime
|
||||
|
@@ -55,7 +55,7 @@
|
||||
<resource alwaysLoaded="false" file="mur 6.png" kind="image" name="mur 6.png" smoothed="true" userAdded="true" />
|
||||
<resource alwaysLoaded="false" file="mur 7.png" kind="image" name="mur 7.png" smoothed="true" userAdded="true" />
|
||||
<resource alwaysLoaded="false" file="mur 8.png" kind="image" name="mur 8.png" smoothed="true" userAdded="true" />
|
||||
<resource alwaysLoaded="false" file="lumière.png" kind="image" name="lumière.png" smoothed="true" userAdded="true" />
|
||||
<resource alwaysLoaded="false" file="lumiere.png" kind="image" name="lumiere.png" smoothed="true" userAdded="true" />
|
||||
<resource alwaysLoaded="false" file="towerground.png" kind="image" name="towerground.png" smoothed="true" userAdded="true" />
|
||||
</resources>
|
||||
<resourceFolders />
|
||||
@@ -282,7 +282,7 @@
|
||||
<directions>
|
||||
<direction looping="false" timeBetweenFrames="1.000000">
|
||||
<sprites>
|
||||
<sprite hasCustomCollisionMask="false" image="lumière.png">
|
||||
<sprite hasCustomCollisionMask="false" image="lumiere.png">
|
||||
<points />
|
||||
<originPoint name="origine" x="0.000000" y="0.000000" />
|
||||
<centerPoint automatic="true" name="centre" x="4.000000" y="4.000000" />
|
||||
|
@@ -1,4 +1,4 @@
|
||||
#include "GDCpp/RuntimeScene.h"
|
||||
#include "GDCpp/Runtime/RuntimeScene.h"
|
||||
#include "TextObject/TextObject.h" //but do not forget extensions includes
|
||||
#include <iostream>
|
||||
|
||||
|
Before Width: | Height: | Size: 130 B After Width: | Height: | Size: 130 B |
@@ -26,4 +26,18 @@
|
||||
/>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||
<application>
|
||||
<!-- Windows 10 -->
|
||||
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
|
||||
<!-- Windows 8.1 -->
|
||||
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
|
||||
<!-- Windows 8 -->
|
||||
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
|
||||
<!-- Windows 7 -->
|
||||
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
|
||||
<!-- Windows Vista -->
|
||||
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
|
||||
</application>
|
||||
</compatibility>
|
||||
</assembly>
|
||||
|
Binary file not shown.
14824
Binaries/Output/Release_Windows/locale/de_DE/GD.po
Executable file → Normal file
14824
Binaries/Output/Release_Windows/locale/de_DE/GD.po
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
13425
Binaries/Output/Release_Windows/locale/es_ES/GD.po
Executable file → Normal file
13425
Binaries/Output/Release_Windows/locale/es_ES/GD.po
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
13255
Binaries/Output/Release_Windows/locale/fi_FI/GD.po
Executable file → Normal file
13255
Binaries/Output/Release_Windows/locale/fi_FI/GD.po
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
14512
Binaries/Output/Release_Windows/locale/fr_FR/GD.po
Executable file → Normal file
14512
Binaries/Output/Release_Windows/locale/fr_FR/GD.po
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
12979
Binaries/Output/Release_Windows/locale/it_IT/GD.po
Executable file → Normal file
12979
Binaries/Output/Release_Windows/locale/it_IT/GD.po
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
13248
Binaries/Output/Release_Windows/locale/nl_NL/GD.po
Executable file → Normal file
13248
Binaries/Output/Release_Windows/locale/nl_NL/GD.po
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
17380
Binaries/Output/Release_Windows/locale/pl_PL/GD.po
Executable file → Normal file
17380
Binaries/Output/Release_Windows/locale/pl_PL/GD.po
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
13296
Binaries/Output/Release_Windows/locale/pt_PT/GD.po
Executable file → Normal file
13296
Binaries/Output/Release_Windows/locale/pt_PT/GD.po
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
13406
Binaries/Output/Release_Windows/locale/ru_RU/GD.po
Executable file → Normal file
13406
Binaries/Output/Release_Windows/locale/ru_RU/GD.po
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
17479
Binaries/Output/Release_Windows/locale/zh_CN/GD.po
Executable file → Normal file
17479
Binaries/Output/Release_Windows/locale/zh_CN/GD.po
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
@@ -40,9 +40,9 @@ IF "%SKIPINSTALLER%"=="1" echo (Skipped)
|
||||
|
||||
echo.
|
||||
echo --Creating archive...
|
||||
if exist Releases\gd3xxxx.zip (del Releases\gd3xxxx.zip)
|
||||
if exist Releases\gd4xxxx.7z (del Releases\gd4xxxx.7z)
|
||||
cd Output\Release_Windows\
|
||||
IF NOT "%SKIPINSTALLERANDARCHIVE%"=="1" "..\..\..\ExtLibs\7za.exe" a ..\..\Releases\gd3xxxx.zip * > ..\..\Packaging\logs\zipArchiveLog.txt
|
||||
IF NOT "%SKIPINSTALLERANDARCHIVE%"=="1" "..\..\..\ExtLibs\7za.exe" a ..\..\Releases\gd4xxxx.7z * > ..\..\Packaging\logs\7zArchiveLog.txt
|
||||
IF "%SKIPINSTALLERANDARCHIVE%"=="1" echo (Skipped)
|
||||
cd ..\..\..
|
||||
|
||||
@@ -50,4 +50,4 @@ echo. >CON
|
||||
echo Finished. Do not forget to : >CON
|
||||
echo -Update news.txt >CON
|
||||
echo -Update pad file >CON
|
||||
pause >CON
|
||||
pause >CON
|
||||
|
@@ -1,3 +1,4 @@
|
||||
#Files needed by the IDE to build games (they are not part of a devel package)
|
||||
addFilter("devel-file-in-non-devel-package.*/opt/gdevelop/CppPlatform/include/.*")
|
||||
addFilter("devel-file-in-non-devel-package.*/opt/gdevelop/CppPlatform/Extensions/include/.*")
|
||||
addFilter("devel-file-in-non-devel-package.*/opt/gdevelop/CppPlatform/Extensions/include/.*")
|
||||
addFilter("devel-file-in-non-devel-package.*/opt/gdevelop/CppPlatform/Sources/.*")
|
||||
|
@@ -13,7 +13,7 @@ AllowNoIcons=yes
|
||||
LicenseFile=..\Output\Release_Windows\License-en.rtf
|
||||
InfoBeforeFile=..\Output\Release_Windows\Informations-en.rtf
|
||||
OutputDir=.\
|
||||
OutputBaseFilename=gd4083
|
||||
OutputBaseFilename=gd4090
|
||||
Compression=lzma
|
||||
SolidCompression=yes
|
||||
SetupIconFile=..\Output\Release_Windows\res\icon.ico
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
||||
<News>
|
||||
<Version Major="4" Minor="0" Build="88" Revision="0"/>
|
||||
<Info Info="La version 4.0.88 est disponible.

Importants changements en interne pour supporter l'Unicode dans les jeux, c'est <20> dire la possibilit<69> de pouvoir utiliser des charact<63>res de d'autres alphabets.
Nouvel objet AdMob, pour afficher des banni<6E>res publicitaires (ou <20>crans interstitiels) dans les jeux HTML5 export<72>s sur Android/iOS avec Intel XDK.
Les automatismes sont maintenant appel<65>s des Comportements (Behavior en anglais).
Nouvelle fonctionnalit<69>, la 'pile de sc<73>nes' : une nouvelle action permet de mettre en pause la sc<73>ne courante et d'en lancer une autre. On peut ensuite revenir <20> la sc<73>ne pr<70>c<EFBFBD>dente avec une autre action. Id<49>al pour faire des menus de pause, des <20>crans de combats, des <20>crans d'int<6E>rieurs de batiments..
Am<41>lioration de l'export des jeux HTML5 pour Cordova/Intel XDK.
Nouvel <20>diteur pour les objets textes
Ajout de la fonctionnalit<69> 'Sauvegarder en tant que projet dossier': les projets peuvent <20>tre sauvegard<72>s avec les sc<73>nes, <20>v<EFBFBD>nements externes et agencements externes sauvegard<72>s dans diff<66>rents fichiers. Cela rend beaucoup plus facile la collaboration dans une <20>quipe.
L'appui sur Shift dans l'<27>diteur de sc<73>ne permet de redimensionner un objet en gardant ses proportions.
L'appui sur Shift dans l'<27>diteur de sc<73>ne permet de tourner un objet par incr<63>ment r<>guliers de 15 degr<67>s.
La grille aimant<6E>e de l'<27>diteur de sc<73>ne s'applique aussi lors du redimensionnement d'objets.
Am<41>lioration de l'objet Carte de Tuiles, notamment une baisse de la consommation m<>moire pour les grandes cartes.
Am<41>lioration pour les <20>crans haute d<>finition ('retina').
Plusieurs corrections de bugs pour la recherche de chemin, qui devrait maintenant fonctionner correctement dans tous les cas.
Correction de la recherche dans l'<27>diteur d'objets.
Correction de la condition sur la bordure suppl<70>mentaire du comportement 'D<>truire <20> la sortie de l'<27>cran'
Nouvel d<>mo utilisant les fonctionnalit<EFBFBD>s Javascript 'PIXI Particles'
Correction dans l'<27>diteur de sc<73>ne o<> les objets sur des calques cach<63>s pouvaient encore <20>tre selectionn<6E>s.
Am<41>lioration et nettoyage du code en interne.
Corrections pour Mac OS X dans l'<27>diteur de sc<73>ne.
Suppression de la compilation en un fichier unique (trop instable et detect<63> comme un virus par certains antivirus).
Ajout du support pour les molettes <20> d<>filement horizontal dans l'<27>diteur de sc<73>ne.
Divers bugs corrig<69>s." Lien="http://compilgames.net"/>
|
||||
<CommunityNews text="GDevApp est une web app de cr<EFBFBD>ation de jeux bas<EFBFBD>e sur GDevelop : venez essayer la plus avanc<EFBFBD>e des applications online de cr<EFBFBD>ation de jeux. Compatible avec les tablettes et fournie avec des superbes packs de graphismes pr<EFBFBD>-pr<EFBFBD>par<EFBFBD>s." link1="https://github.com/4ian/GD" linkLabel1="GDevelop sur GitHub" link2="https://gdevapp.com?utm_source=software&utm_medium=link_fr&utm_campaign=launch" linkLabel2="Tester GDevApp, la nouvelle app de cr<EFBFBD>ation de jeux"/>
|
||||
<Version Major="4" Minor="0" Build="89" Revision="0"/>
|
||||
<Info Info="La version 4.0.89 est disponible.

Ajout des traductions en Néerlandais et Finnois.
Correction de la position par défaut des bannières AdMob.
Amélioration et changements en interne.
Correction de la condition 'Toujours' pour les jeux HTML5
Correction d'un crash avec l'objet Carte de Tuiles lors de l'utilisation d'une image vide.
Support de l'importation des fichiers TMX (créés avec Tiled Map Editor: http://www.mapeditor.org/) pour les objets Carte de Tuiles.
Correction des actions de stockage qui n'enregistrait pas les données dans certaines conditions.
Amélioration des performances de l'objet Panneau pour les jeux HTML5.
Mise à jour du moteur de rendu des jeux HTML5 (pixi.js v3.0.8)
Les fichiers Audio peuvent maintenant être ajoutés comme des ressources pour les précharger dans les jeux HTML5.
Amélioration des performances des musiques des jeux HTML5 sur Android
Correction pour les jeux natifs qui ne se lançaient pas dans les répertoires avec des caractères spéciaux.
Correction de problèmes avec l'éditeur d'agencements externes.
Correction d'une erreur 404 lors de l'aperçu de jeux HTML5 sur les distributions linux récentes." Lien="http://compilgames.net"/>
|
||||
<CommunityNews text="GDevApp est une web app de création de jeux basée sur GDevelop : venez essayer la plus avancée des applications online de création de jeux. Compatible avec les tablettes et fournie avec des superbes packs de graphismes pré-préparés." link1="https://github.com/4ian/GD" linkLabel1="GDevelop sur GitHub" link2="https://gdevapp.com?utm_source=software&utm_medium=link_fr&utm_campaign=launch" linkLabel2="Tester GDevApp, la nouvelle app de création de jeux"/>
|
||||
</News>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
||||
<News>
|
||||
<Version Major="4" Minor="0" Build="88" Revision="0"/>
|
||||
<Info Info="Version 4.0.88 is available.

Huge internal changes to have multi-language support ('Unicode') in games.
New AdMob object, that can be used to display ad banners (or interstitial screens) in HTML5 games exported to iOS/Android with Intel XDK.
Automatisms are now called Behaviors for objects (more intuitive and easier to understand).
New scene stacking feature: a new action allows to pause the current scene and launch a new one. You can then go back to the previous one with another action. This makes it easy to create a pause menu, a RPG combat system, rooms/building that you enter from a map...
Improved export of HTML5 games to Cordova/Intel XDK.
New editor for text objects
Add 'Save as a folder project': projects can be saved with scenes, external events and external layouts stored in a different file for each. This makes it easier to collaborate on a game as a team.
Hold Shift in scene editor to resize object while keeping its aspect ratio.
Hold Shift in scene editor to rotate an object in increments.
'Snap to grid' now snaps objects when resizing them in scene editor.
Improvements on TileMap objects, including a reduced memory consumption for large maps.
Improvements for HDPI ('retina') screens.
Several bugfixes for pathfinding that should now work properly in all cases.
Fixed search not working in the objects editor.
Fixed extra border condition of Destroy Outside Behavior.
New PIXI Particles advanced Javascript demo.
Fixed objects from hidden layers could still be selected and moved in scene editor
Internal code cleaning and improvements.
Fixes for Mac OS X in the scene editor.
Removed compilation of native games to a single file executable (was too unstable and prone to antivirus blocking).
Add support for horizontal mouse wheel in the scene editor.
Fixed Vertical Synchronization and framerate limit not applied after changing the window resolution in native games
Fix small bug in Destroy Outside behavior of HTML5 games
Add an option to repeat borders and center textures of PanelSprite objects for HTML5 games
Improve performances of PanelSprite objects for HTML5 games
Fix hitboxes collision condition for HTML5 games
Fix conflicts when exporting a game using different images with the same file name.
Fix error when deactivating a behavior of an object that was just created.
Fix scene editor not properly refreshed after being resized on OS X." Lien="http://compilgames.net"/>
|
||||
<Version Major="4" Minor="0" Build="89" Revision="0"/>
|
||||
<Info Info="Version 4.0.89 is available.

Add complete Dutch translation
Add Finnish translation
Fix AdMob object banner default position being top of the screen
Internal changes and improvements
Fix 'Always' condition for HTML5 games
Fix tilemap object crash when using an empty image
Add support for importing TMX files (created with Tiled Map Editor: http://www.mapeditor.org/) in TiledMap objects.
Fix storage actions not properly persisting values in some cases
Improve performance of PanelSprite (9-patch) object for HTML5 games.
Update the rendering engine of HTML5 games, pixi.js, to v3.0.8
Audio files can be added as resources (like images) to preload them in HTML5 games
Enhance performance of musics on Android
Fix native games not launching properly when put in a directory containing unicode characters.
Fix issues with external layouts editors.
Wording fixes
Fix 404 error when previewing a HTML5 game on recent linux distributions." Lien="http://compilgames.net"/>
|
||||
<CommunityNews text="GDevelop has a new website! Help us to translate it to your language by going on the Crowdin project.

GDevApp is an online game creator based on GDevelop: Go try the most advanced game creation web app. Compatible with tablets and bundled with awesome graphics assets." link1="https://crowdin.com/project/gdevelop-website/" linkLabel1="Help translate GD website" link2="https://gdevapp.com?utm_source=software&utm_medium=link_en&utm_campaign=launch" linkLabel2="Try GDevApp, the online game creator based on GD"/>
|
||||
</News>
|
||||
|
@@ -510,7 +510,7 @@
|
||||
<wxDialog wxs="wxsmith/EditForEachEvent.wxs" src="GDCore/IDE/Dialogs/EditForEachEvent.cpp" hdr="GDCore/IDE/Dialogs/EditForEachEvent.h" fwddecl="0" i18n="1" name="EditForEachEvent" language="CPP" />
|
||||
<wxDialog wxs="wxsmith/EditRepeatEvent.wxs" src="GDCore/IDE/Dialogs/EditRepeatEvent.cpp" hdr="GDCore/IDE/Dialogs/EditRepeatEvent.h" fwddecl="0" i18n="1" name="EditRepeatEvent" language="CPP" />
|
||||
<wxDialog wxs="wxsmith/ProjectUpdateDialog.wxs" src="GDCore/IDE/Dialogs/ProjectUpdateDialog.cpp" hdr="GDCore/IDE/Dialogs/ProjectUpdateDialog.h" fwddecl="0" i18n="1" name="ProjectUpdateDialog" language="CPP" />
|
||||
<wxDialog wxs="wxsmith/SpriteObjectEditor.wxs" src="GDCore\Extensions\BuiltinExtensions\SpriteExtension\Dialogs\SpriteObjectEditor.cpp" hdr="GDCore\Extensions\BuiltinExtensions\SpriteExtension\Dialogs\SpriteObjectEditor.h" fwddecl="0" i18n="1" name="SpriteObjectEditor" language="CPP" />
|
||||
<wxDialog wxs="wxsmith/SpriteObjectEditor.wxs" src="GDCore/Extensions/Builtin/SpriteExtension/Dialogs/SpriteObjectEditor.cpp" hdr="GDCore/Extensions/Builtin/SpriteExtension/Dialogs/SpriteObjectEditor.h" fwddecl="0" i18n="1" name="SpriteObjectEditor" language="CPP" />
|
||||
<wxPanel wxs="wxsmith/ResourcesEditor.wxs" src="GDCore/IDE/Dialogs/ResourcesEditor.cpp" hdr="GDCore/IDE/Dialogs/ResourcesEditor.h" fwddecl="0" i18n="1" name="ResourcesEditor" language="CPP" />
|
||||
</resources>
|
||||
</wxsmith>
|
||||
|
@@ -71,7 +71,7 @@
|
||||
*
|
||||
* Download the current version of the compiler used by GDevelop on Windows here:
|
||||
*
|
||||
* http://sourceforge.net/projects/tdm-gcc/files/TDM-GCC%20Installer/tdm-gcc-4.9.2.exe/download
|
||||
* https://sourceforge.net/projects/tdm-gcc/files/TDM-GCC%20Installer/Previous/1.1309.0/tdm-gcc-4.9.2.exe/download
|
||||
*
|
||||
* \section installWinCompiler_install Installation
|
||||
*
|
||||
@@ -337,7 +337,7 @@ make -j4
|
||||
* \section platformstructure Structure of a platform
|
||||
*
|
||||
* A platform for GDevelop Core is a class inheriting from gd::Platform.<br>
|
||||
* They contains the extensions of the platform (see below) and offer various methods, like gd::Platform::GetProjectExporter which
|
||||
* They contains the extensions of the platform (see below) and offer various methods, like gd::Platform::GetProjectExporters which
|
||||
* is called by the IDE to export a gd::Project to a stand-alone game.
|
||||
*
|
||||
* \subsection platformloading Platforms loading
|
||||
@@ -406,7 +406,7 @@ str += " world";
|
||||
str += " " + gd::String::From(2);
|
||||
//str now contains "Hello world 2";
|
||||
|
||||
gd::string twopointfiveStr = "2.5";
|
||||
gd::String twopointfiveStr = "2.5";
|
||||
double twopointfive = twopointfive.To<double>();
|
||||
//twopointfive == 2.5
|
||||
\endcode
|
||||
@@ -499,30 +499,22 @@ Actions are declared like this :
|
||||
* Adding an object is made using gd::PlatformExtension::AddObject method.
|
||||
*
|
||||
* \code
|
||||
gd::ObjectMetadata & obj = AddObject("Name",
|
||||
gd::ObjectMetadata & obj = AddObject<MyObject>(
|
||||
"Name",
|
||||
_("Name displayed to users"),
|
||||
_("Description"),
|
||||
"path-to-a-32-by-32-icon.png",
|
||||
&FunctionForCreatingTheObject);
|
||||
* \endcode
|
||||
*
|
||||
* *FunctionForCreatingTheObject* is a function that must just create the object. It should look like this:
|
||||
*
|
||||
* \code
|
||||
gd::Object * CreateTextObject(std::string name)
|
||||
{
|
||||
return new TextObject(name);
|
||||
}
|
||||
"path-to-a-32-by-32-icon.png");
|
||||
* \endcode
|
||||
*
|
||||
* The *C++ platform* also requires that you call *AddRuntimeObject* to declare the RuntimeObject class associated to the object being declared:<br>
|
||||
* You must pass as parameter the name of the class inheriting from RuntimeObject and a function used to create an instance of the
|
||||
* RuntimeObject.
|
||||
* It has two template parameters: the first one is the corresponding object class declared with *AddObject* (class inheriting from *gd::Object*) and the
|
||||
* second one is the *RuntimeObject* class.
|
||||
* You must pass as parameter the metadata from the object previously declared and the name of the class inheriting from RuntimeObject.
|
||||
*
|
||||
* You will also want to specify the .h file associated to the object using gd::ObjectMetadata::SetIncludeFile. For example:
|
||||
* \code
|
||||
//obj is the gd::ObjectMetadata returned when you called AddObject.
|
||||
AddRuntimeObject(obj, "RuntimeTextObject", CreateRuntimeTextObject);
|
||||
AddRuntimeObject<TextObject, RuntimeTextObject>(obj, "RuntimeTextObject");
|
||||
obj.SetIncludeFile("TextObject/TextObject.h");
|
||||
* \endcode
|
||||
*
|
||||
@@ -785,5 +777,3 @@ extern "C" ExtensionBase * GD_EXTENSION_API CreateGDExtension() {
|
||||
* \brief Part of the tinyxml library
|
||||
* \ingroup TinyXml
|
||||
*/
|
||||
|
||||
|
||||
|
@@ -19,11 +19,10 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(gd:
|
||||
"Florian Rival",
|
||||
"Open source (MIT License)");
|
||||
|
||||
gd::ObjectMetadata & obj = extension.AddObject("",
|
||||
gd::ObjectMetadata & obj = extension.AddObject<gd::Object>("",
|
||||
_("Base object"),
|
||||
_("Base object"),
|
||||
"res/objeticon24.png",
|
||||
&CreateBaseObject);
|
||||
"res/objeticon24.png");
|
||||
|
||||
#if defined(GD_IDE_ONLY)
|
||||
obj.AddCondition("PosX",
|
||||
|
@@ -274,6 +274,20 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(gd::Pla
|
||||
.AddParameter("layer", _("Layer (base layer if empty)")).SetDefaultValue("\"\"")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
extension.AddAction("SetLayerEffectParameter",
|
||||
_("Effect parameter"),
|
||||
_("Change the parameter of an effect"),
|
||||
_("Set _PARAM3_ to _PARAM4_ for effect _PARAM2_ of layer _PARAM1_"),
|
||||
_("Layers and cameras/Effects"),
|
||||
"res/conditions/camera24.png",
|
||||
"res/conditions/camera.png")
|
||||
.AddCodeOnlyParameter("currentScene", "")
|
||||
.AddParameter("layer", _("Layer (base layer if empty)"), "",true).SetDefaultValue("\"\"")
|
||||
.AddParameter("string", _("Effect"))
|
||||
.AddParameter("string", _("Parameter name"))
|
||||
.AddParameter("expression", _("New value"))
|
||||
.MarkAsAdvanced();
|
||||
|
||||
extension.AddExpression("CameraWidth", _("Width of a camera of a layer"), _("Width of a camera of a layer"), _("Camera"), "res/actions/camera.png")
|
||||
.AddCodeOnlyParameter("currentScene", "")
|
||||
.AddParameter("layer", _("Layer"))
|
||||
|
@@ -7,6 +7,7 @@
|
||||
#ifndef GDCORE_ANIMATION_H
|
||||
#define GDCORE_ANIMATION_H
|
||||
#include <vector>
|
||||
#include "GDCore/String.h"
|
||||
namespace gd { class Direction; }
|
||||
|
||||
namespace gd
|
||||
@@ -25,6 +26,16 @@ public:
|
||||
Animation();
|
||||
virtual ~Animation();
|
||||
|
||||
/**
|
||||
* \brief Set the name of the animation
|
||||
*/
|
||||
const gd::String & GetName() const { return name; }
|
||||
|
||||
/**
|
||||
* \brief Change the name of the animation
|
||||
*/
|
||||
void SetName(const gd::String & name_) { name = name_; }
|
||||
|
||||
/**
|
||||
* \brief Return the n-th direction
|
||||
*/
|
||||
@@ -59,6 +70,7 @@ public:
|
||||
|
||||
private:
|
||||
std::vector < Direction > directions;
|
||||
gd::String name;
|
||||
|
||||
static Direction badDirection;
|
||||
};
|
||||
|
@@ -7,6 +7,7 @@
|
||||
#include "GDCore/Tools/Localization.h"
|
||||
//(*InternalHeaders(SpriteObjectEditor)
|
||||
#include <wx/bitmap.h>
|
||||
#include <wx/intl.h>
|
||||
#include <wx/image.h>
|
||||
#include <wx/string.h>
|
||||
//*)
|
||||
@@ -116,6 +117,14 @@ const long SpriteObjectEditor::ID_PANEL10 = wxNewId();
|
||||
const long SpriteObjectEditor::ID_MENUITEM5 = wxNewId();
|
||||
const long SpriteObjectEditor::ID_MENUITEM6 = wxNewId();
|
||||
const long SpriteObjectEditor::ID_MENUITEM4 = wxNewId();
|
||||
const long SpriteObjectEditor::ID_MENUIDLENAME = wxNewId();
|
||||
const long SpriteObjectEditor::ID_MENUWALKNAME = wxNewId();
|
||||
const long SpriteObjectEditor::ID_MENURUNNAME = wxNewId();
|
||||
const long SpriteObjectEditor::ID_MENUJUMPNAME = wxNewId();
|
||||
const long SpriteObjectEditor::ID_MENUSHOOTNAME = wxNewId();
|
||||
const long SpriteObjectEditor::ID_MENUDEADNAME = wxNewId();
|
||||
const long SpriteObjectEditor::ID_MENUCUSTOMNAME = wxNewId();
|
||||
const long SpriteObjectEditor::ID_MENUITEM15 = wxNewId();
|
||||
const long SpriteObjectEditor::ID_MENUTIMEBETWEENFRAMES = wxNewId();
|
||||
const long SpriteObjectEditor::ID_MENULOOP = wxNewId();
|
||||
const long SpriteObjectEditor::ID_MENUITEM1 = wxNewId();
|
||||
@@ -300,6 +309,23 @@ SpriteObjectEditor::SpriteObjectEditor(wxWindow* parent, gd::Project & game_, Sp
|
||||
multipleDirectionsItem = new wxMenuItem(MenuItem2, ID_MENUITEM6, _("8 Directions"), wxEmptyString, wxITEM_RADIO);
|
||||
MenuItem2->Append(multipleDirectionsItem);
|
||||
animationsMenu.Append(ID_MENUITEM4, _("Type"), MenuItem2, wxEmptyString);
|
||||
MenuItem13 = new wxMenu();
|
||||
MenuItem15 = new wxMenuItem(MenuItem13, ID_MENUIDLENAME, _("Idle"), wxEmptyString, wxITEM_NORMAL);
|
||||
MenuItem13->Append(MenuItem15);
|
||||
MenuItem14 = new wxMenuItem(MenuItem13, ID_MENUWALKNAME, _("Walk"), wxEmptyString, wxITEM_NORMAL);
|
||||
MenuItem13->Append(MenuItem14);
|
||||
MenuItem16 = new wxMenuItem(MenuItem13, ID_MENURUNNAME, _("Run"), wxEmptyString, wxITEM_NORMAL);
|
||||
MenuItem13->Append(MenuItem16);
|
||||
MenuItem17 = new wxMenuItem(MenuItem13, ID_MENUJUMPNAME, _("Jump"), wxEmptyString, wxITEM_NORMAL);
|
||||
MenuItem13->Append(MenuItem17);
|
||||
MenuItem18 = new wxMenuItem(MenuItem13, ID_MENUSHOOTNAME, _("Shoot"), wxEmptyString, wxITEM_NORMAL);
|
||||
MenuItem13->Append(MenuItem18);
|
||||
MenuItem20 = new wxMenuItem(MenuItem13, ID_MENUDEADNAME, _("Dead"), wxEmptyString, wxITEM_NORMAL);
|
||||
MenuItem13->Append(MenuItem20);
|
||||
MenuItem13->AppendSeparator();
|
||||
MenuItem19 = new wxMenuItem(MenuItem13, ID_MENUCUSTOMNAME, _("Custom name..."), wxEmptyString, wxITEM_NORMAL);
|
||||
MenuItem13->Append(MenuItem19);
|
||||
animationsMenu.Append(ID_MENUITEM15, _("Change the name"), MenuItem13, wxEmptyString);
|
||||
MenuItem7 = new wxMenuItem((&animationsMenu), ID_MENUTIMEBETWEENFRAMES, _("Time between each image :"), wxEmptyString, wxITEM_NORMAL);
|
||||
animationsMenu.Append(MenuItem7);
|
||||
MenuItem8 = new wxMenuItem((&animationsMenu), ID_MENULOOP, _("Loop the animation"), wxEmptyString, wxITEM_CHECK);
|
||||
@@ -380,9 +406,15 @@ SpriteObjectEditor::SpriteObjectEditor(wxWindow* parent, gd::Project & game_, Sp
|
||||
previewPanel->Connect(wxEVT_PAINT,(wxObjectEventFunction)&SpriteObjectEditor::OnpreviewPanelPaint,0,this);
|
||||
previewPanel->Connect(wxEVT_ERASE_BACKGROUND,(wxObjectEventFunction)&SpriteObjectEditor::OnpreviewPanelEraseBackground,0,this);
|
||||
previewPanel->Connect(wxEVT_SIZE,(wxObjectEventFunction)&SpriteObjectEditor::OnpreviewPanelResize,0,this);
|
||||
mgr->Connect(wxEVT_AUI_PANE_CLOSE,(wxObjectEventFunction)&SpriteObjectEditor::OnmgrPaneClose,0,this);
|
||||
Connect(ID_MENUITEM5,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&SpriteObjectEditor::OnautomaticRotationItemSelected);
|
||||
Connect(ID_MENUITEM6,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&SpriteObjectEditor::OnmultipleDirectionsItemSelected);
|
||||
Connect(ID_MENUIDLENAME,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&SpriteObjectEditor::OnSetAnimationNameIdleSelected);
|
||||
Connect(ID_MENUWALKNAME,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&SpriteObjectEditor::OnSetAnimationNameWalkSelected);
|
||||
Connect(ID_MENURUNNAME,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&SpriteObjectEditor::OnSetAnimationNameRunSelected);
|
||||
Connect(ID_MENUJUMPNAME,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&SpriteObjectEditor::OnSetAnimationNameJumpSelected);
|
||||
Connect(ID_MENUSHOOTNAME,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&SpriteObjectEditor::OnSetAnimationNameShootSelected);
|
||||
Connect(ID_MENUDEADNAME,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&SpriteObjectEditor::OnSetAnimationNameDeadSelected);
|
||||
Connect(ID_MENUCUSTOMNAME,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&SpriteObjectEditor::OnSetCustomAnimationNameSelected);
|
||||
Connect(ID_MENUTIMEBETWEENFRAMES,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&SpriteObjectEditor::OnTimeBetweenFramesSelected);
|
||||
Connect(ID_MENULOOP,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&SpriteObjectEditor::OnMenuLoopSelected);
|
||||
Connect(ID_MENUITEM1,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&SpriteObjectEditor::OnAddAnimationSelected);
|
||||
@@ -399,6 +431,7 @@ SpriteObjectEditor::SpriteObjectEditor(wxWindow* parent, gd::Project & game_, Sp
|
||||
Connect(ID_MENUITEM12,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&SpriteObjectEditor::OnAddImageFromFileSelected);
|
||||
Connect(ID_MENUITEM13,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&SpriteObjectEditor::OnAddFromImageBankSelected);
|
||||
//*)
|
||||
mgr->Connect(wxEVT_AUI_PANE_CLOSE,(wxObjectEventFunction)&SpriteObjectEditor::OnmgrPaneClose,0,this);
|
||||
imagesList->Connect(wxEVT_RIGHT_UP,(wxObjectEventFunction)&SpriteObjectEditor::OnimagesListRightClick,0,this);
|
||||
Connect(ID_TREELISTCTRL1,wxEVT_COMMAND_TREELIST_ITEM_ACTIVATED,(wxObjectEventFunction)&SpriteObjectEditor::OnmaskTreeItemActivated);
|
||||
Connect(ID_TREELISTCTRL1,wxEVT_COMMAND_TREELIST_ITEM_CONTEXT_MENU,(wxObjectEventFunction)&SpriteObjectEditor::OnmaskTreeItemRClick);
|
||||
@@ -526,7 +559,11 @@ void SpriteObjectEditor::RefreshAnimationTree()
|
||||
for (std::size_t i = 0;i<object.GetAnimationsCount();++i)
|
||||
{
|
||||
Animation & animation = object.GetAnimation(i);
|
||||
wxTreeItemId animationItem = animationsTree->AppendItem(root, _("Animation ") + gd::String::From(i), 0, -1,
|
||||
gd::String animationLabel = animation.GetName().empty() ?
|
||||
wxString::Format(wxString(_("Animation %d")), i) :
|
||||
wxString::Format(wxString(_("Animation %d \"%s\"")), i, animation.GetName().c_str());
|
||||
|
||||
wxTreeItemId animationItem = animationsTree->AppendItem(root, animationLabel, 0, -1,
|
||||
new gd::TreeItemStringData(gd::String::From(i), ""));
|
||||
|
||||
if ( animation.useMultipleDirections )
|
||||
@@ -1828,5 +1865,64 @@ void SpriteObjectEditor::OnxScrollBarScroll(wxScrollEvent& event)
|
||||
imagePanel->Update();
|
||||
}
|
||||
|
||||
void SpriteObjectEditor::OnSetAnimationNameIdleSelected(wxCommandEvent& event)
|
||||
{
|
||||
SetAnimationName(_("Idle"));
|
||||
}
|
||||
|
||||
void SpriteObjectEditor::OnSetAnimationNameWalkSelected(wxCommandEvent& event)
|
||||
{
|
||||
SetAnimationName(_("Walk"));
|
||||
}
|
||||
|
||||
void SpriteObjectEditor::OnSetAnimationNameRunSelected(wxCommandEvent& event)
|
||||
{
|
||||
SetAnimationName(_("Run"));
|
||||
}
|
||||
|
||||
void SpriteObjectEditor::OnSetAnimationNameJumpSelected(wxCommandEvent& event)
|
||||
{
|
||||
SetAnimationName(_("Jump"));
|
||||
}
|
||||
|
||||
void SpriteObjectEditor::OnSetAnimationNameShootSelected(wxCommandEvent& event)
|
||||
{
|
||||
SetAnimationName(_("Shoot"));
|
||||
}
|
||||
|
||||
void SpriteObjectEditor::OnSetAnimationNameDeadSelected(wxCommandEvent& event)
|
||||
{
|
||||
SetAnimationName(_("Dead"));
|
||||
}
|
||||
|
||||
void SpriteObjectEditor::OnSetCustomAnimationNameSelected(wxCommandEvent& event)
|
||||
{
|
||||
if (selectedAnimation >= object.GetAnimationsCount()) return;
|
||||
|
||||
const Animation & animation = object.GetAnimation(selectedAnimation);
|
||||
gd::String name = wxGetTextFromUser(_("Enter the name of the animation:"), _("Custom name"), animation.GetName());
|
||||
SetAnimationName(name);
|
||||
}
|
||||
|
||||
void SpriteObjectEditor::SetAnimationName(gd::String newName)
|
||||
{
|
||||
if (selectedAnimation >= object.GetAnimationsCount()) return;
|
||||
|
||||
for(std::size_t i = 0;i < object.GetAnimationsCount(); ++i)
|
||||
{
|
||||
if (i == selectedAnimation) continue;
|
||||
const gd::String & name = object.GetAnimation(i).GetName();
|
||||
if (!name.empty() && name == newName)
|
||||
{
|
||||
wxString msg = wxString::Format(wxString(_("Animation #%d already has this name: please use a different name for each animation")), i);
|
||||
wxLogWarning(msg);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
object.GetAnimation(selectedAnimation).SetName(newName);
|
||||
RefreshAnimationTree();
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
@@ -74,9 +74,13 @@ public:
|
||||
wxMenuItem* deleteItem;
|
||||
wxMenuItem* MenuItem1;
|
||||
wxMenuItem* MenuItem4;
|
||||
wxMenuItem* MenuItem14;
|
||||
wxMenuItem* MenuItem11;
|
||||
wxMenuItem* MenuItem15;
|
||||
wxPanel* Panel1;
|
||||
wxMenu animationsMenu;
|
||||
wxMenuItem* MenuItem17;
|
||||
wxMenu* MenuItem13;
|
||||
wxMenuItem* MenuItem10;
|
||||
wxAuiManager* AuiManager2;
|
||||
wxMenuItem* removeImageItem;
|
||||
@@ -88,6 +92,7 @@ public:
|
||||
wxTimer previewTimer;
|
||||
wxMenuItem* MenuItem3;
|
||||
wxAuiManager* AuiManager3;
|
||||
wxMenuItem* MenuItem20;
|
||||
wxPanel* imagePanel;
|
||||
wxScrollBar* yScrollBar;
|
||||
wxMenu emptyImagesMenu;
|
||||
@@ -98,14 +103,17 @@ public:
|
||||
wxMenuItem* moveRightItem;
|
||||
wxPanel* Panel2;
|
||||
wxMenuItem* automaticRotationItem;
|
||||
wxMenuItem* MenuItem16;
|
||||
wxPanel* pointsPanel;
|
||||
wxMenuItem* MenuItem9;
|
||||
wxMenuItem* multipleDirectionsItem;
|
||||
wxListCtrl* imagesList;
|
||||
wxMenuItem* MenuItem18;
|
||||
wxMenu imagesMenu;
|
||||
wxMenu maskMenu;
|
||||
wxPanel* imagesPanel;
|
||||
wxAuiToolBar* animationToolbar;
|
||||
wxMenuItem* MenuItem19;
|
||||
//*)
|
||||
ResourcesEditor * resourcesEditorPnl;
|
||||
|
||||
@@ -153,6 +161,14 @@ protected:
|
||||
static const long ID_MENUITEM5;
|
||||
static const long ID_MENUITEM6;
|
||||
static const long ID_MENUITEM4;
|
||||
static const long ID_MENUIDLENAME;
|
||||
static const long ID_MENUWALKNAME;
|
||||
static const long ID_MENURUNNAME;
|
||||
static const long ID_MENUJUMPNAME;
|
||||
static const long ID_MENUSHOOTNAME;
|
||||
static const long ID_MENUDEADNAME;
|
||||
static const long ID_MENUCUSTOMNAME;
|
||||
static const long ID_MENUITEM15;
|
||||
static const long ID_MENUTIMEBETWEENFRAMES;
|
||||
static const long ID_MENULOOP;
|
||||
static const long ID_MENUITEM1;
|
||||
@@ -224,6 +240,13 @@ private:
|
||||
void OnRotatePolygonSelected(wxCommandEvent& event);
|
||||
void OnyScrollBarScroll(wxScrollEvent& event);
|
||||
void OnxScrollBarScroll(wxScrollEvent& event);
|
||||
void OnSetAnimationNameIdleSelected(wxCommandEvent& event);
|
||||
void OnSetAnimationNameWalkSelected(wxCommandEvent& event);
|
||||
void OnSetAnimationNameRunSelected(wxCommandEvent& event);
|
||||
void OnSetAnimationNameJumpSelected(wxCommandEvent& event);
|
||||
void OnSetAnimationNameShootSelected(wxCommandEvent& event);
|
||||
void OnSetAnimationNameDeadSelected(wxCommandEvent& event);
|
||||
void OnSetCustomAnimationNameSelected(wxCommandEvent& event);
|
||||
//*)
|
||||
void OnmaskTreeItemRClick(wxTreeListEvent& event);
|
||||
void OnmaskTreeItemActivated(wxTreeListEvent& event);
|
||||
@@ -238,6 +261,7 @@ private:
|
||||
void RefreshCollisionMasks();
|
||||
void ResetPreview();
|
||||
wxBitmap GetwxBitmapFromImageResource(gd::Resource & resource);
|
||||
void SetAnimationName(gd::String newName);
|
||||
|
||||
/**
|
||||
* Return a vector containing the sprites which must be modified when editing a point
|
||||
|
@@ -20,11 +20,11 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSpriteExtension(gd::Pla
|
||||
"Florian Rival",
|
||||
"Open source (MIT License)");
|
||||
|
||||
gd::ObjectMetadata & obj = extension.AddObject("Sprite",
|
||||
gd::ObjectMetadata & obj = extension.AddObject<SpriteObject>(
|
||||
"Sprite",
|
||||
_("Sprite"),
|
||||
_("Animated object which can be used for most elements of a game"),
|
||||
"CppPlatform/Extensions/spriteicon.png",
|
||||
&CreateSpriteObject);
|
||||
"CppPlatform/Extensions/spriteicon.png");
|
||||
|
||||
#if defined(GD_IDE_ONLY)
|
||||
obj.AddAction("Opacity",
|
||||
@@ -43,7 +43,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSpriteExtension(gd::Pla
|
||||
|
||||
obj.AddAction("ChangeAnimation",
|
||||
_("Change the animation"),
|
||||
_("Modify the current animation of the object."),
|
||||
_("Change the animation of the object, using the animation number in the animations list."),
|
||||
_("Do _PARAM1__PARAM2_ to the number of current animation of _PARAM0_"),
|
||||
_("Animations and images"),
|
||||
"res/actions/animation24.png",
|
||||
@@ -55,6 +55,18 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSpriteExtension(gd::Pla
|
||||
.MarkAsSimple()
|
||||
.SetManipulatedType("number");
|
||||
|
||||
obj.AddAction("SetAnimationName",
|
||||
_("Change the animation (by name)"),
|
||||
_("Change the animation of the object, using the name of the animation."),
|
||||
_("Set animation of _PARAM0_ to _PARAM1_"),
|
||||
_("Animations and images"),
|
||||
"res/actions/animation24.png",
|
||||
"res/actions/animation.png")
|
||||
|
||||
.AddParameter("object", _("Object"), "Sprite")
|
||||
.AddParameter("string", _("Animation name"))
|
||||
.MarkAsAdvanced();
|
||||
|
||||
obj.AddAction("ChangeDirection",
|
||||
_("Change the direction"),
|
||||
_("Change the direction of the object.\nIf the object is set to automatically rotate, the direction is its angle.\nIf the object is in 8 directions mode, the valid directions are 0..7"),
|
||||
@@ -183,7 +195,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSpriteExtension(gd::Pla
|
||||
|
||||
obj.AddCondition("Animation",
|
||||
_("Current animation"),
|
||||
_("Test the number of the current animation of the object."),
|
||||
_("Compare the number of the current animation of the object."),
|
||||
_("The number of the current animation of _PARAM0_ is _PARAM1__PARAM2_"),
|
||||
_("Animations and images"),
|
||||
"res/conditions/animation24.png",
|
||||
@@ -195,6 +207,18 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSpriteExtension(gd::Pla
|
||||
.MarkAsAdvanced()
|
||||
.SetManipulatedType("number");
|
||||
|
||||
obj.AddCondition("AnimationName",
|
||||
_("Current animation name"),
|
||||
_("Check the current animation of the object."),
|
||||
_("The animation of _PARAM0_ is _PARAM1_"),
|
||||
_("Animations and images"),
|
||||
"res/conditions/animation24.png",
|
||||
"res/conditions/animation.png")
|
||||
|
||||
.AddParameter("object", _("Object"), "Sprite")
|
||||
.AddParameter("string", _("Animation name"))
|
||||
.MarkAsAdvanced();
|
||||
|
||||
obj.AddCondition("Direction",
|
||||
_("Current direction"),
|
||||
_("Compare the direction of the object. If 8 direction mode is activated for the sprite, the value taken for direction will be from 0 to 7. Otherwise, the direction is in degrees."),
|
||||
@@ -444,6 +468,9 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSpriteExtension(gd::Pla
|
||||
obj.AddExpression("Animation", _("Animation"), _("Animation of the object"), _("Animations and images"), "res/actions/animation.png")
|
||||
.AddParameter("object", _("Object"), "Sprite");
|
||||
|
||||
obj.AddStrExpression("AnimationName", _("Animation name"), _("Name of the animation of the object"), _("Animations and images"), "res/actions/animation.png")
|
||||
.AddParameter("object", _("Object"), "Sprite");
|
||||
|
||||
obj.AddExpression("Sprite", _("Image"), _("Animation frame of the object"), _("Animations and images"), "res/actions/sprite.png")
|
||||
.AddParameter("object", _("Object"), "Sprite");
|
||||
|
||||
|
@@ -53,6 +53,7 @@ void SpriteObject::DoUnserializeFrom(gd::Project & project, const gd::Serializer
|
||||
Animation newAnimation;
|
||||
|
||||
newAnimation.useMultipleDirections = animationElement.GetBoolAttribute("useMultipleDirections", false, "typeNormal");
|
||||
newAnimation.SetName(animationElement.GetStringAttribute("name", ""));
|
||||
|
||||
//Compatibility with GD <= 3.3
|
||||
if (animationElement.HasChild("Direction"))
|
||||
@@ -96,6 +97,7 @@ void SpriteObject::DoSerializeTo(gd::SerializerElement & element) const
|
||||
gd::SerializerElement & animationElement = animationsElement.AddChild("animation");
|
||||
|
||||
animationElement.SetAttribute( "useMultipleDirections", GetAnimation(k).useMultipleDirections);
|
||||
animationElement.SetAttribute( "name", GetAnimation(k).GetName());
|
||||
|
||||
gd::SerializerElement & directionsElement = animationElement.AddChild("directions");
|
||||
directionsElement.ConsiderAsArrayOf("direction");
|
||||
@@ -292,13 +294,4 @@ void SpriteObject::SwapAnimations(std::size_t firstIndex, std::size_t secondInde
|
||||
std::swap(animations[firstIndex], animations[secondIndex]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Function creating an extension Object.
|
||||
* GDevelop can not directly create an extension object
|
||||
*/
|
||||
gd::Object * CreateSpriteObject(gd::String name)
|
||||
{
|
||||
return new SpriteObject(name);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -105,7 +105,7 @@ public :
|
||||
bool HasNoAnimations() const { return animations.empty(); }
|
||||
|
||||
/**
|
||||
* \brief Swap the position of two sprites
|
||||
* \brief Swap the position of two animations
|
||||
*/
|
||||
void SwapAnimations(std::size_t firstIndex, std::size_t secondIndex);
|
||||
|
||||
@@ -128,7 +128,5 @@ private:
|
||||
static Animation badAnimation; //< Bad animation when an out of bound animation is requested.
|
||||
};
|
||||
|
||||
GD_CORE_API gd::Object * CreateSpriteObject(gd::String name);
|
||||
|
||||
}
|
||||
#endif // GDCORE_SPRITEOBJECT_H
|
||||
|
@@ -95,16 +95,16 @@ std::shared_ptr<gd::Object> Platform::CreateObject(gd::String type, const gd::St
|
||||
return std::shared_ptr<gd::Object> (object);
|
||||
}
|
||||
|
||||
gd::Behavior* Platform::CreateBehavior(const gd::String & behaviorType) const
|
||||
std::unique_ptr<gd::Behavior> Platform::CreateBehavior(const gd::String & behaviorType) const
|
||||
{
|
||||
for (std::size_t i =0;i<extensionsLoaded.size();++i)
|
||||
{
|
||||
Behavior* behavior = extensionsLoaded[i]->CreateBehavior(behaviorType);
|
||||
if ( behavior != NULL )
|
||||
std::unique_ptr<gd::Behavior> behavior = extensionsLoaded[i]->CreateBehavior(behaviorType);
|
||||
if ( behavior )
|
||||
return behavior;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<gd::BehaviorsSharedData> Platform::CreateBehaviorSharedDatas(const gd::String & behaviorType) const
|
||||
@@ -138,9 +138,9 @@ std::shared_ptr<gd::LayoutEditorPreviewer> Platform::GetLayoutPreviewer(gd::Layo
|
||||
return std::shared_ptr<gd::LayoutEditorPreviewer>(new gd::LayoutEditorPreviewer);
|
||||
}
|
||||
|
||||
std::shared_ptr<gd::ProjectExporter> Platform::GetProjectExporter() const
|
||||
std::vector<std::shared_ptr<gd::ProjectExporter>> Platform::GetProjectExporters() const
|
||||
{
|
||||
return std::shared_ptr<gd::ProjectExporter>(new gd::ProjectExporter);
|
||||
return std::vector<std::shared_ptr<gd::ProjectExporter>>{std::shared_ptr<gd::ProjectExporter>(new gd::ProjectExporter)};
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@@ -6,10 +6,10 @@
|
||||
|
||||
#ifndef GDCORE_PLATFORM_H
|
||||
#define GDCORE_PLATFORM_H
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include "GDCore/String.h"
|
||||
#include <map>
|
||||
#include "GDCore/Project/ChangesNotifier.h"
|
||||
#include "GDCore/Project/LayoutEditorPreviewer.h"
|
||||
namespace gd { class InstructionsMetadataHolder; }
|
||||
@@ -123,7 +123,7 @@ public:
|
||||
/**
|
||||
* \brief Create a behavior
|
||||
*/
|
||||
gd::Behavior* CreateBehavior(const gd::String & type) const;
|
||||
std::unique_ptr<gd::Behavior> CreateBehavior(const gd::String & type) const;
|
||||
|
||||
/**
|
||||
* \brief Create a behavior shared data object.
|
||||
@@ -169,12 +169,12 @@ public:
|
||||
virtual std::shared_ptr<gd::LayoutEditorPreviewer> GetLayoutPreviewer(gd::LayoutEditorCanvas & editor) const;
|
||||
|
||||
/**
|
||||
* \brief Must provide a gd::ProjectExporter object that will be used
|
||||
* \brief Must provide at least one gd::ProjectExporter object that will be used
|
||||
* by the IDE to export the project so as to be used without the IDE.
|
||||
*
|
||||
* The default implementation simply return a gd::ProjectExporter object doing nothing.
|
||||
* The default implementation simply return a vector containing a gd::ProjectExporter object doing nothing.
|
||||
*/
|
||||
virtual std::shared_ptr<gd::ProjectExporter> GetProjectExporter() const;
|
||||
virtual std::vector<std::shared_ptr<gd::ProjectExporter>> GetProjectExporters() const;
|
||||
#endif
|
||||
///@}
|
||||
|
||||
|
@@ -85,17 +85,6 @@ gd::ExpressionMetadata & PlatformExtension::AddStrExpression(const gd::String &
|
||||
#endif
|
||||
}
|
||||
|
||||
gd::ObjectMetadata & PlatformExtension::AddObject(const gd::String & name,
|
||||
const gd::String & fullname,
|
||||
const gd::String & informations,
|
||||
const gd::String & icon24x24,
|
||||
CreateFunPtr createFunPtrP)
|
||||
{
|
||||
gd::String nameWithNamespace = GetNameSpace().empty() ? name : GetNameSpace()+name;
|
||||
objectsInfos[nameWithNamespace] = ObjectMetadata(GetNameSpace(), nameWithNamespace, fullname, informations, icon24x24, createFunPtrP);
|
||||
return objectsInfos[nameWithNamespace];
|
||||
}
|
||||
|
||||
gd::BehaviorMetadata & PlatformExtension::AddBehavior(const gd::String & name,
|
||||
const gd::String & fullname,
|
||||
const gd::String & defaultName,
|
||||
@@ -294,12 +283,12 @@ CreateFunPtr PlatformExtension::GetObjectCreationFunctionPtr(gd::String objectTy
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Behavior* PlatformExtension::CreateBehavior(gd::String type) const
|
||||
std::unique_ptr<gd::Behavior> PlatformExtension::CreateBehavior(gd::String type) const
|
||||
{
|
||||
if ( behaviorsInfo.find(type) != behaviorsInfo.end())
|
||||
return behaviorsInfo.find(type)->second.Get()->Clone();
|
||||
return std::unique_ptr<gd::Behavior>(behaviorsInfo.find(type)->second.Get()->Clone());
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -1,6 +1,7 @@
|
||||
/*
|
||||
* GDevelop Core
|
||||
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights reserved.
|
||||
* Copyright 2016 Victor Levasseur (victorlevasseur52@gmail.com)
|
||||
* This project is released under the MIT License.
|
||||
*/
|
||||
|
||||
@@ -12,6 +13,7 @@
|
||||
#include "GDCore/Extensions/Metadata/ObjectMetadata.h"
|
||||
#include "GDCore/Extensions/Metadata/BehaviorMetadata.h"
|
||||
#include "GDCore/Extensions/Metadata/EventMetadata.h"
|
||||
#include "GDCore/CommonTools.h"
|
||||
#include "GDCore/String.h"
|
||||
namespace gd { class Instruction; }
|
||||
namespace gd { class InstructionMetadata; }
|
||||
@@ -138,26 +140,19 @@ public:
|
||||
/**
|
||||
* \brief Declare a new object as being part of the extension.
|
||||
* \note This method does nothing when used for GD C++ runtime.
|
||||
* \tparam T the declared class inherited from *gd::Object*
|
||||
* \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 createFunPtr The name of the function that create the object
|
||||
*
|
||||
* Example of the create function:
|
||||
\code
|
||||
gd::Object * CreateMyObject(gd::String name)
|
||||
{
|
||||
return new MyObject(name);
|
||||
}
|
||||
\endcode
|
||||
*/
|
||||
template<class T>
|
||||
gd::ObjectMetadata & AddObject(const gd::String & name_,
|
||||
const gd::String & fullname_,
|
||||
const gd::String & description_,
|
||||
const gd::String & icon24x24_,
|
||||
CreateFunPtr createFunPtrP);
|
||||
const gd::String & icon24x24_);
|
||||
|
||||
/**
|
||||
* \brief Declare a new behavior as being part of the extension.
|
||||
@@ -259,7 +254,7 @@ public:
|
||||
*
|
||||
* Return NULL if \a behaviorType is not provided by the extension.
|
||||
*/
|
||||
gd::Behavior* CreateBehavior(gd::String behaviorType) const;
|
||||
std::unique_ptr<gd::Behavior> CreateBehavior(gd::String behaviorType) const;
|
||||
|
||||
/**
|
||||
* \brief Create shared data for a behavior
|
||||
@@ -461,4 +456,6 @@ private:
|
||||
|
||||
#endif
|
||||
|
||||
#include "GDCore/Extensions/PlatformExtension.inl"
|
||||
|
||||
#endif // GDCORE_PLATFORMEXTENSION_H
|
||||
|
34
Core/GDCore/Extensions/PlatformExtension.inl
Normal file
34
Core/GDCore/Extensions/PlatformExtension.inl
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* GDevelop Core
|
||||
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights reserved.
|
||||
* Copyright 2016 Victor Levasseur (victorlevasseur52@gmail.com)
|
||||
* This project is released under the MIT License.
|
||||
*/
|
||||
|
||||
#ifndef GDCORE_PLATFORMEXTENSION_INL
|
||||
#define GDCORE_PLATFORMEXTENSION_INL
|
||||
|
||||
namespace gd
|
||||
{
|
||||
|
||||
template<class T>
|
||||
gd::ObjectMetadata & PlatformExtension::AddObject(const gd::String & name,
|
||||
const gd::String & fullname, const gd::String & description,
|
||||
const gd::String & icon24x24)
|
||||
{
|
||||
gd::String nameWithNamespace = GetNameSpace().empty() ? name : GetNameSpace()+name;
|
||||
objectsInfos[nameWithNamespace] = ObjectMetadata(
|
||||
GetNameSpace(),
|
||||
nameWithNamespace,
|
||||
fullname,
|
||||
informations,
|
||||
icon24x24,
|
||||
[](gd::String name) -> gd::Object* { return new T(name); }
|
||||
);
|
||||
|
||||
return objectsInfos[nameWithNamespace];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
@@ -466,11 +466,18 @@ void ChooseVariableDialog::OnEditValueSelected(wxCommandEvent& event)
|
||||
UpdateSelectedAndParentVariable();
|
||||
if ( !selectedVariable || selectedVariable->IsStructure() ) return;
|
||||
|
||||
gd::String value = wxGetTextFromUser(_("Enter the initial value of the variable"), _("Initial value"), selectedVariable->GetString());
|
||||
selectedVariable->SetString(value);
|
||||
RefreshVariable(variablesList->GetSelection(), selectedVariableName, *selectedVariable);
|
||||
wxTextEntryDialog editDialog(this,
|
||||
_("Enter the initial value of the variable"), _("Initial value"),
|
||||
selectedVariable->GetString(), wxTextEntryDialogStyle | wxTE_MULTILINE);
|
||||
|
||||
modificationCount++;
|
||||
if (editDialog.ShowModal() == wxID_OK)
|
||||
{
|
||||
gd::String value = editDialog.GetValue();
|
||||
selectedVariable->SetString(value);
|
||||
|
||||
RefreshVariable(variablesList->GetSelection(), selectedVariableName, *selectedVariable);
|
||||
modificationCount++;
|
||||
}
|
||||
}
|
||||
|
||||
void ChooseVariableDialog::OnRenameSelected(wxCommandEvent& event)
|
||||
|
@@ -1,432 +0,0 @@
|
||||
/*
|
||||
* GDevelop Core
|
||||
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights reserved.
|
||||
* This project is released under the MIT License.
|
||||
*/
|
||||
#if defined(GD_IDE_ONLY) && !defined(GD_NO_WX_GUI)
|
||||
#include "EditLayerDialog.h"
|
||||
|
||||
//(*InternalHeaders(EditLayerDialog)
|
||||
#include <wx/bitmap.h>
|
||||
#include <wx/font.h>
|
||||
#include "GDCore/Tools/Localization.h"
|
||||
#include <wx/image.h>
|
||||
#include <wx/string.h>
|
||||
//*)
|
||||
#include "GDCore/Tools/Log.h"
|
||||
#include "GDCore/IDE/wxTools/SkinHelper.h"
|
||||
#include "GDCore/Tools/HelpFileAccess.h"
|
||||
#include "GDCore/CommonTools.h"
|
||||
|
||||
namespace gd
|
||||
{
|
||||
|
||||
//(*IdInit(EditLayerDialog)
|
||||
const long EditLayerDialog::ID_STATICTEXT1 = wxNewId();
|
||||
const long EditLayerDialog::ID_TEXTCTRL1 = wxNewId();
|
||||
const long EditLayerDialog::ID_CHECKBOX1 = wxNewId();
|
||||
const long EditLayerDialog::ID_STATICTEXT2 = wxNewId();
|
||||
const long EditLayerDialog::ID_CHOICE1 = wxNewId();
|
||||
const long EditLayerDialog::ID_BUTTON5 = wxNewId();
|
||||
const long EditLayerDialog::ID_BUTTON3 = wxNewId();
|
||||
const long EditLayerDialog::ID_CHECKBOX2 = wxNewId();
|
||||
const long EditLayerDialog::ID_TEXTCTRL2 = wxNewId();
|
||||
const long EditLayerDialog::ID_STATICTEXT4 = wxNewId();
|
||||
const long EditLayerDialog::ID_TEXTCTRL3 = wxNewId();
|
||||
const long EditLayerDialog::ID_CHECKBOX3 = wxNewId();
|
||||
const long EditLayerDialog::ID_STATICTEXT7 = wxNewId();
|
||||
const long EditLayerDialog::ID_TEXTCTRL4 = wxNewId();
|
||||
const long EditLayerDialog::ID_STATICTEXT6 = wxNewId();
|
||||
const long EditLayerDialog::ID_TEXTCTRL5 = wxNewId();
|
||||
const long EditLayerDialog::ID_STATICTEXT8 = wxNewId();
|
||||
const long EditLayerDialog::ID_TEXTCTRL6 = wxNewId();
|
||||
const long EditLayerDialog::ID_STATICTEXT9 = wxNewId();
|
||||
const long EditLayerDialog::ID_TEXTCTRL7 = wxNewId();
|
||||
const long EditLayerDialog::ID_STATICTEXT3 = wxNewId();
|
||||
const long EditLayerDialog::ID_STATICLINE1 = wxNewId();
|
||||
const long EditLayerDialog::ID_STATICBITMAP2 = wxNewId();
|
||||
const long EditLayerDialog::ID_HYPERLINKCTRL1 = wxNewId();
|
||||
const long EditLayerDialog::ID_BUTTON2 = wxNewId();
|
||||
const long EditLayerDialog::ID_BUTTON1 = wxNewId();
|
||||
//*)
|
||||
|
||||
BEGIN_EVENT_TABLE(EditLayerDialog,wxDialog)
|
||||
//(*EventTable(EditLayerDialog)
|
||||
//*)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
EditLayerDialog::EditLayerDialog(wxWindow* parent, Layer & layer_) :
|
||||
layer(layer_),
|
||||
tempLayer(layer_)
|
||||
{
|
||||
//(*Initialize(EditLayerDialog)
|
||||
wxStaticBoxSizer* StaticBoxSizer2;
|
||||
wxFlexGridSizer* FlexGridSizer4;
|
||||
wxFlexGridSizer* FlexGridSizer3;
|
||||
wxFlexGridSizer* FlexGridSizer5;
|
||||
wxFlexGridSizer* FlexGridSizer9;
|
||||
wxFlexGridSizer* FlexGridSizer2;
|
||||
wxFlexGridSizer* FlexGridSizer7;
|
||||
wxFlexGridSizer* FlexGridSizer8;
|
||||
wxFlexGridSizer* FlexGridSizer6;
|
||||
wxStaticBoxSizer* StaticBoxSizer1;
|
||||
wxFlexGridSizer* FlexGridSizer1;
|
||||
wxFlexGridSizer* FlexGridSizer17;
|
||||
|
||||
Create(parent, wxID_ANY, _("Modify the parameters of the layer"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE, _T("wxID_ANY"));
|
||||
FlexGridSizer1 = new wxFlexGridSizer(0, 1, 0, 0);
|
||||
FlexGridSizer2 = new wxFlexGridSizer(0, 3, 0, 0);
|
||||
StaticText1 = new wxStaticText(this, ID_STATICTEXT1, _("Name :"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT1"));
|
||||
FlexGridSizer2->Add(StaticText1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
|
||||
nameEdit = new wxTextCtrl(this, ID_TEXTCTRL1, wxEmptyString, wxDefaultPosition, wxSize(129,-1), 0, wxDefaultValidator, _T("ID_TEXTCTRL1"));
|
||||
FlexGridSizer2->Add(nameEdit, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
|
||||
visibilityCheck = new wxCheckBox(this, ID_CHECKBOX1, _("Visible"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX1"));
|
||||
visibilityCheck->SetValue(false);
|
||||
FlexGridSizer2->Add(visibilityCheck, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
|
||||
FlexGridSizer1->Add(FlexGridSizer2, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
|
||||
StaticBoxSizer1 = new wxStaticBoxSizer(wxHORIZONTAL, this, _("Cameras"));
|
||||
FlexGridSizer4 = new wxFlexGridSizer(0, 1, 0, 0);
|
||||
FlexGridSizer5 = new wxFlexGridSizer(0, 4, 0, 0);
|
||||
StaticText2 = new wxStaticText(this, ID_STATICTEXT2, _("Camera No."), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT2"));
|
||||
FlexGridSizer5->Add(StaticText2, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
|
||||
cameraChoice = new wxChoice(this, ID_CHOICE1, wxDefaultPosition, wxSize(50,-1), 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE1"));
|
||||
cameraChoice->Append("00");
|
||||
cameraChoice->SetSelection(0);
|
||||
FlexGridSizer5->Add(cameraChoice, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
|
||||
deleteCameraBt = new wxButton(this, ID_BUTTON5, _("Delete"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON5"));
|
||||
FlexGridSizer5->Add(deleteCameraBt, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
|
||||
addCameraBt = new wxButton(this, ID_BUTTON3, _("Add another camera"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON3"));
|
||||
FlexGridSizer5->Add(addCameraBt, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
|
||||
FlexGridSizer4->Add(FlexGridSizer5, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 0);
|
||||
StaticBoxSizer2 = new wxStaticBoxSizer(wxHORIZONTAL, this, _("Editing the camera"));
|
||||
FlexGridSizer6 = new wxFlexGridSizer(0, 1, 0, 0);
|
||||
FlexGridSizer6->AddGrowableCol(0);
|
||||
FlexGridSizer8 = new wxFlexGridSizer(0, 4, 0, 0);
|
||||
sizeCheck = new wxCheckBox(this, ID_CHECKBOX2, _("Custom size :"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX2"));
|
||||
sizeCheck->SetValue(false);
|
||||
FlexGridSizer8->Add(sizeCheck, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
|
||||
cameraWidthEdit = new wxTextCtrl(this, ID_TEXTCTRL2, wxEmptyString, wxDefaultPosition, wxSize(60,-1), 0, wxDefaultValidator, _T("ID_TEXTCTRL2"));
|
||||
cameraWidthEdit->Disable();
|
||||
FlexGridSizer8->Add(cameraWidthEdit, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
|
||||
StaticText4 = new wxStaticText(this, ID_STATICTEXT4, _("x"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT4"));
|
||||
FlexGridSizer8->Add(StaticText4, 1, wxTOP|wxBOTTOM|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
|
||||
cameraHeightEdit = new wxTextCtrl(this, ID_TEXTCTRL3, wxEmptyString, wxDefaultPosition, wxSize(60,-1), 0, wxDefaultValidator, _T("ID_TEXTCTRL3"));
|
||||
cameraHeightEdit->Disable();
|
||||
FlexGridSizer8->Add(cameraHeightEdit, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
|
||||
FlexGridSizer6->Add(FlexGridSizer8, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
|
||||
FlexGridSizer7 = new wxFlexGridSizer(0, 2, 0, 0);
|
||||
viewportCheck = new wxCheckBox(this, ID_CHECKBOX3, _("Custom viewport :"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX3"));
|
||||
viewportCheck->SetValue(false);
|
||||
FlexGridSizer7->Add(viewportCheck, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
|
||||
FlexGridSizer9 = new wxFlexGridSizer(0, 8, 0, 0);
|
||||
StaticText7 = new wxStaticText(this, ID_STATICTEXT7, _("From"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT7"));
|
||||
FlexGridSizer9->Add(StaticText7, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
|
||||
viewportX1Edit = new wxTextCtrl(this, ID_TEXTCTRL4, _("0"), wxDefaultPosition, wxSize(40,-1), 0, wxDefaultValidator, _T("ID_TEXTCTRL4"));
|
||||
viewportX1Edit->Disable();
|
||||
FlexGridSizer9->Add(viewportX1Edit, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
|
||||
StaticText6 = new wxStaticText(this, ID_STATICTEXT6, _(";"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT6"));
|
||||
FlexGridSizer9->Add(StaticText6, 1, wxTOP|wxBOTTOM|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
|
||||
viewportY1Edit = new wxTextCtrl(this, ID_TEXTCTRL5, _("0"), wxDefaultPosition, wxSize(40,-1), 0, wxDefaultValidator, _T("ID_TEXTCTRL5"));
|
||||
viewportY1Edit->Disable();
|
||||
FlexGridSizer9->Add(viewportY1Edit, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
|
||||
StaticText8 = new wxStaticText(this, ID_STATICTEXT8, _("to"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT8"));
|
||||
FlexGridSizer9->Add(StaticText8, 1, wxTOP|wxBOTTOM|wxRIGHT|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
|
||||
viewportX2Edit = new wxTextCtrl(this, ID_TEXTCTRL6, _("1"), wxDefaultPosition, wxSize(40,-1), 0, wxDefaultValidator, _T("ID_TEXTCTRL6"));
|
||||
viewportX2Edit->Disable();
|
||||
FlexGridSizer9->Add(viewportX2Edit, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
|
||||
StaticText9 = new wxStaticText(this, ID_STATICTEXT9, _(";"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT9"));
|
||||
FlexGridSizer9->Add(StaticText9, 1, wxTOP|wxBOTTOM|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
|
||||
viewportY2Edit = new wxTextCtrl(this, ID_TEXTCTRL7, _("1"), wxDefaultPosition, wxSize(40,-1), 0, wxDefaultValidator, _T("ID_TEXTCTRL7"));
|
||||
viewportY2Edit->Disable();
|
||||
FlexGridSizer9->Add(viewportY2Edit, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
|
||||
FlexGridSizer7->Add(FlexGridSizer9, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
|
||||
FlexGridSizer6->Add(FlexGridSizer7, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
|
||||
StaticText3 = new wxStaticText(this, ID_STATICTEXT3, _("For example, a camera which takes the left side of the window would be defined with 0, 0, 0.5, 1.\nBy default, a camera has a viewport which covers the entire window."), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT, _T("ID_STATICTEXT3"));
|
||||
wxFont StaticText3Font(wxDEFAULT,wxFONTFAMILY_DEFAULT,wxFONTSTYLE_ITALIC,wxFONTWEIGHT_NORMAL,false,wxEmptyString,wxFONTENCODING_DEFAULT);
|
||||
StaticText3->SetFont(StaticText3Font);
|
||||
FlexGridSizer6->Add(StaticText3, 1, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5);
|
||||
StaticBoxSizer2->Add(FlexGridSizer6, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
|
||||
FlexGridSizer4->Add(StaticBoxSizer2, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
|
||||
StaticBoxSizer1->Add(FlexGridSizer4, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
|
||||
FlexGridSizer1->Add(StaticBoxSizer1, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
|
||||
StaticLine1 = new wxStaticLine(this, ID_STATICLINE1, wxDefaultPosition, wxSize(10,-1), wxLI_HORIZONTAL, _T("ID_STATICLINE1"));
|
||||
FlexGridSizer1->Add(StaticLine1, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
|
||||
FlexGridSizer3 = new wxFlexGridSizer(0, 3, 0, 0);
|
||||
FlexGridSizer3->AddGrowableCol(1);
|
||||
FlexGridSizer17 = new wxFlexGridSizer(0, 3, 0, 0);
|
||||
FlexGridSizer17->AddGrowableRow(0);
|
||||
StaticBitmap2 = new wxStaticBitmap(this, ID_STATICBITMAP2, gd::SkinHelper::GetIcon("help", 16), wxDefaultPosition, wxDefaultSize, wxNO_BORDER, _T("ID_STATICBITMAP2"));
|
||||
FlexGridSizer17->Add(StaticBitmap2, 1, wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
|
||||
helpBt = new wxHyperlinkCtrl(this, ID_HYPERLINKCTRL1, _("Help"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_CONTEXTMENU|wxHL_ALIGN_CENTRE|wxNO_BORDER, _T("ID_HYPERLINKCTRL1"));
|
||||
helpBt->SetToolTip(_("Display help about this window"));
|
||||
FlexGridSizer17->Add(helpBt, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
|
||||
FlexGridSizer3->Add(FlexGridSizer17, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
|
||||
okBt = new wxButton(this, ID_BUTTON2, _("Ok"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON2"));
|
||||
FlexGridSizer3->Add(okBt, 1, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5);
|
||||
cancelBt = new wxButton(this, ID_BUTTON1, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON1"));
|
||||
FlexGridSizer3->Add(cancelBt, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
|
||||
FlexGridSizer1->Add(FlexGridSizer3, 1, wxALL|wxEXPAND|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 0);
|
||||
SetSizer(FlexGridSizer1);
|
||||
FlexGridSizer1->Fit(this);
|
||||
FlexGridSizer1->SetSizeHints(this);
|
||||
|
||||
Connect(ID_CHOICE1,wxEVT_COMMAND_CHOICE_SELECTED,(wxObjectEventFunction)&EditLayerDialog::OncameraChoiceSelect);
|
||||
Connect(ID_BUTTON5,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&EditLayerDialog::OndeleteCameraBtClick);
|
||||
Connect(ID_BUTTON3,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&EditLayerDialog::OnaddCameraBtClick);
|
||||
Connect(ID_CHECKBOX2,wxEVT_COMMAND_CHECKBOX_CLICKED,(wxObjectEventFunction)&EditLayerDialog::OnsizeCheckClick);
|
||||
Connect(ID_TEXTCTRL2,wxEVT_COMMAND_TEXT_UPDATED,(wxObjectEventFunction)&EditLayerDialog::OncameraWidthEditText);
|
||||
Connect(ID_TEXTCTRL3,wxEVT_COMMAND_TEXT_UPDATED,(wxObjectEventFunction)&EditLayerDialog::OncameraHeightEditText);
|
||||
Connect(ID_CHECKBOX3,wxEVT_COMMAND_CHECKBOX_CLICKED,(wxObjectEventFunction)&EditLayerDialog::OnviewportCheckClick);
|
||||
Connect(ID_TEXTCTRL4,wxEVT_COMMAND_TEXT_UPDATED,(wxObjectEventFunction)&EditLayerDialog::OnviewportX1EditText);
|
||||
Connect(ID_TEXTCTRL5,wxEVT_COMMAND_TEXT_UPDATED,(wxObjectEventFunction)&EditLayerDialog::OnviewportX1EditText);
|
||||
Connect(ID_TEXTCTRL6,wxEVT_COMMAND_TEXT_UPDATED,(wxObjectEventFunction)&EditLayerDialog::OnviewportX1EditText);
|
||||
Connect(ID_TEXTCTRL7,wxEVT_COMMAND_TEXT_UPDATED,(wxObjectEventFunction)&EditLayerDialog::OnviewportX1EditText);
|
||||
Connect(ID_HYPERLINKCTRL1,wxEVT_COMMAND_HYPERLINK,(wxObjectEventFunction)&EditLayerDialog::OnhelpBtClick);
|
||||
Connect(ID_BUTTON2,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&EditLayerDialog::OnokBtClick);
|
||||
Connect(ID_BUTTON1,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&EditLayerDialog::OncancelBtClick);
|
||||
//*)
|
||||
|
||||
nameEdit->ChangeValue(layer.GetName());
|
||||
visibilityCheck->SetValue(layer.GetVisibility());
|
||||
|
||||
//Can't edit the base layer's name
|
||||
if ( layer.GetName() == "" )
|
||||
{
|
||||
nameEdit->Disable();
|
||||
nameEdit->SetValue(_("Base layer"));
|
||||
}
|
||||
|
||||
cameraChoice->Clear();
|
||||
for (std::size_t i = 0;i<layer.GetCameraCount();++i)
|
||||
cameraChoice->Append(gd::String::From(i));
|
||||
|
||||
cameraChoice->SetSelection(0);
|
||||
RefreshCameraSettings();
|
||||
}
|
||||
|
||||
EditLayerDialog::~EditLayerDialog()
|
||||
{
|
||||
//(*Destroy(EditLayerDialog)
|
||||
//*)
|
||||
}
|
||||
|
||||
|
||||
void EditLayerDialog::OncancelBtClick(wxCommandEvent& event)
|
||||
{
|
||||
EndModal(0);
|
||||
}
|
||||
|
||||
void EditLayerDialog::OnokBtClick(wxCommandEvent& event)
|
||||
{
|
||||
//Obligation d'avoir un nom sauf pour le calque de base
|
||||
if ( nameEdit->GetValue() == "" && nameEdit->IsEnabled() )
|
||||
{
|
||||
gd::LogWarning(_("The name is incorrect"));
|
||||
return;
|
||||
}
|
||||
|
||||
if( layer.GetName() != "")
|
||||
tempLayer.SetName(nameEdit->GetValue());
|
||||
|
||||
tempLayer.SetVisibility(visibilityCheck->GetValue());
|
||||
|
||||
layer = tempLayer;
|
||||
EndModal(1);
|
||||
}
|
||||
|
||||
void EditLayerDialog::OnaddCameraBtClick(wxCommandEvent& event)
|
||||
{
|
||||
cameraChoice->Append(gd::String::From(tempLayer.GetCameraCount()));
|
||||
tempLayer.SetCameraCount(tempLayer.GetCameraCount()+1);
|
||||
}
|
||||
|
||||
void EditLayerDialog::OncameraChoiceSelect(wxCommandEvent& event)
|
||||
{
|
||||
RefreshCameraSettings();
|
||||
}
|
||||
|
||||
void EditLayerDialog::RefreshCameraSettings()
|
||||
{
|
||||
std::size_t selection = cameraChoice->GetSelection();
|
||||
if (selection >= tempLayer.GetCameraCount()) return;
|
||||
|
||||
const Camera & camera = tempLayer.GetCamera(selection);
|
||||
|
||||
if ( camera.UseDefaultSize() )
|
||||
{
|
||||
sizeCheck->SetValue(false);
|
||||
cameraWidthEdit->Enable(false);
|
||||
cameraHeightEdit->Enable(false);
|
||||
|
||||
cameraWidthEdit->ChangeValue("");
|
||||
cameraHeightEdit->ChangeValue("");
|
||||
}
|
||||
else
|
||||
{
|
||||
sizeCheck->SetValue(true);
|
||||
cameraWidthEdit->Enable(true);
|
||||
cameraHeightEdit->Enable(true);
|
||||
|
||||
cameraWidthEdit->ChangeValue(gd::String::From(camera.GetWidth()));
|
||||
cameraHeightEdit->ChangeValue(gd::String::From(camera.GetHeight()));
|
||||
}
|
||||
|
||||
viewportX1Edit->SetBackgroundColour(wxColour(255,255,255));
|
||||
viewportY1Edit->SetBackgroundColour(wxColour(255,255,255));
|
||||
viewportX2Edit->SetBackgroundColour(wxColour(255,255,255));
|
||||
viewportY2Edit->SetBackgroundColour(wxColour(255,255,255));
|
||||
if ( camera.UseDefaultViewport() )
|
||||
{
|
||||
viewportCheck->SetValue(false);
|
||||
viewportX1Edit->Enable(false);
|
||||
viewportX2Edit->Enable(false);
|
||||
viewportY1Edit->Enable(false);
|
||||
viewportY2Edit->Enable(false);
|
||||
|
||||
viewportX1Edit->ChangeValue("0");
|
||||
viewportY1Edit->ChangeValue("0");
|
||||
viewportX2Edit->ChangeValue("1");
|
||||
viewportY2Edit->ChangeValue("1");
|
||||
}
|
||||
else
|
||||
{
|
||||
viewportCheck->SetValue(true);
|
||||
viewportX1Edit->Enable(true);
|
||||
viewportX2Edit->Enable(true);
|
||||
viewportY1Edit->Enable(true);
|
||||
viewportY2Edit->Enable(true);
|
||||
|
||||
viewportX1Edit->ChangeValue(gd::String::From(camera.GetViewportX1()));
|
||||
viewportX2Edit->ChangeValue(gd::String::From(camera.GetViewportX2()));
|
||||
viewportY1Edit->ChangeValue(gd::String::From(camera.GetViewportY1()));
|
||||
viewportY2Edit->ChangeValue(gd::String::From(camera.GetViewportY2()));
|
||||
}
|
||||
}
|
||||
|
||||
void EditLayerDialog::OnsizeCheckClick(wxCommandEvent& event)
|
||||
{
|
||||
std::size_t selection = cameraChoice->GetSelection();
|
||||
if (selection >= tempLayer.GetCameraCount()) return;
|
||||
|
||||
Camera & camera = tempLayer.GetCamera(selection);
|
||||
camera.SetUseDefaultSize(!sizeCheck->GetValue());
|
||||
|
||||
RefreshCameraSettings();
|
||||
}
|
||||
|
||||
void EditLayerDialog::OncameraWidthEditText(wxCommandEvent& event)
|
||||
{
|
||||
std::size_t selection = cameraChoice->GetSelection();
|
||||
if (selection >= tempLayer.GetCameraCount()) return;
|
||||
|
||||
Camera & camera = tempLayer.GetCamera(selection);
|
||||
camera.SetSize(gd::String(cameraWidthEdit->GetValue()).To<float>(), camera.GetHeight());
|
||||
}
|
||||
|
||||
void EditLayerDialog::OncameraHeightEditText(wxCommandEvent& event)
|
||||
{
|
||||
std::size_t selection = cameraChoice->GetSelection();
|
||||
if (selection >= tempLayer.GetCameraCount()) return;
|
||||
|
||||
Camera & camera = tempLayer.GetCamera(selection);
|
||||
camera.SetSize(camera.GetWidth(), gd::String(cameraHeightEdit->GetValue()).To<float>());
|
||||
}
|
||||
|
||||
void EditLayerDialog::OnviewportCheckClick(wxCommandEvent& event)
|
||||
{
|
||||
std::size_t selection = cameraChoice->GetSelection();
|
||||
if (selection >= tempLayer.GetCameraCount()) return;
|
||||
|
||||
Camera & camera = tempLayer.GetCamera(selection);
|
||||
camera.SetUseDefaultViewport(!viewportCheck->GetValue());
|
||||
|
||||
RefreshCameraSettings();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update viewport coordinates
|
||||
*/
|
||||
void EditLayerDialog::OnviewportX1EditText(wxCommandEvent& event)
|
||||
{
|
||||
std::size_t selection = cameraChoice->GetSelection();
|
||||
if (selection >= tempLayer.GetCameraCount()) return;
|
||||
|
||||
Camera & camera = tempLayer.GetCamera(selection);
|
||||
float x1 = camera.GetViewportX1();
|
||||
float x2 = camera.GetViewportX2();
|
||||
float y1 = camera.GetViewportY1();
|
||||
float y2 = camera.GetViewportY2();
|
||||
|
||||
{
|
||||
float newValue = gd::String(viewportX1Edit->GetValue()).To<float>();
|
||||
if ( newValue >= 0 && newValue <= 1)
|
||||
{
|
||||
x1 = newValue;
|
||||
viewportX1Edit->SetBackgroundColour(wxColour(255,255,255));
|
||||
}
|
||||
else
|
||||
viewportX1Edit->SetBackgroundColour(wxColour(254,231,231));
|
||||
}
|
||||
|
||||
{
|
||||
float newValue = gd::String(viewportY1Edit->GetValue()).To<float>();
|
||||
if ( newValue >= 0 && newValue <= 1)
|
||||
{
|
||||
y1 = newValue;
|
||||
viewportY1Edit->SetBackgroundColour(wxColour(255,255,255));
|
||||
}
|
||||
else
|
||||
viewportY1Edit->SetBackgroundColour(wxColour(254,231,231));
|
||||
}
|
||||
|
||||
{
|
||||
float newValue = gd::String(viewportX2Edit->GetValue()).To<float>();
|
||||
if ( newValue >= 0 && newValue <= 1)
|
||||
{
|
||||
x2 = newValue;
|
||||
viewportX2Edit->SetBackgroundColour(wxColour(255,255,255));
|
||||
}
|
||||
else
|
||||
viewportX2Edit->SetBackgroundColour(wxColour(254,231,231));
|
||||
}
|
||||
|
||||
{
|
||||
float newValue = gd::String(viewportY2Edit->GetValue()).To<float>();
|
||||
if ( newValue >= 0 && newValue <= 1)
|
||||
{
|
||||
y2 = newValue;
|
||||
viewportY2Edit->SetBackgroundColour(wxColour(255,255,255));
|
||||
}
|
||||
else
|
||||
viewportY2Edit->SetBackgroundColour(wxColour(254,231,231));
|
||||
}
|
||||
|
||||
camera.SetViewport(x1,y1,x2,y2);
|
||||
}
|
||||
|
||||
void EditLayerDialog::OndeleteCameraBtClick(wxCommandEvent& event)
|
||||
{
|
||||
std::size_t selection = cameraChoice->GetSelection();
|
||||
if (selection >= tempLayer.GetCameraCount()) return;
|
||||
|
||||
if ( tempLayer.GetCameraCount() == 1 )
|
||||
{
|
||||
gd::LogMessage(_("The layer must have at least one camera."));
|
||||
return;
|
||||
}
|
||||
|
||||
tempLayer.DeleteCamera(selection);
|
||||
cameraChoice->Delete(cameraChoice->GetSelection());
|
||||
cameraChoice->SetSelection(tempLayer.GetCameraCount());
|
||||
|
||||
RefreshCameraSettings();
|
||||
}
|
||||
|
||||
|
||||
void EditLayerDialog::OnhelpBtClick(wxCommandEvent& event)
|
||||
{
|
||||
gd::HelpFileAccess::Get()->OpenPage("en/game_develop/documentation/manual/editors/scene_editor/edit_layer");
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
@@ -1,132 +0,0 @@
|
||||
/*
|
||||
* GDevelop Core
|
||||
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights reserved.
|
||||
* This project is released under the MIT License.
|
||||
*/
|
||||
|
||||
#if defined(GD_IDE_ONLY) && !defined(GD_NO_WX_GUI)
|
||||
#ifndef GDCORE_EDITLAYER_H
|
||||
#define GDCORE_EDITLAYER_H
|
||||
|
||||
//(*Headers(EditLayerDialog)
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/checkbox.h>
|
||||
#include <wx/statline.h>
|
||||
#include <wx/hyperlink.h>
|
||||
#include <wx/choice.h>
|
||||
#include <wx/statbmp.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/dialog.h>
|
||||
//*)
|
||||
#include "GDCore/Project/Layer.h"
|
||||
|
||||
namespace gd
|
||||
{
|
||||
|
||||
/**
|
||||
* \brief Dialog used to edit a layer
|
||||
* \todo Use a property grid to edit layers
|
||||
*
|
||||
* \ingroup IDEDialogs
|
||||
*/
|
||||
class EditLayerDialog: public wxDialog
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* Default constructor
|
||||
* \param parent The wxWidgets parent window
|
||||
* \param layer The layer to edit
|
||||
*/
|
||||
EditLayerDialog(wxWindow* parent, Layer & layer_);
|
||||
virtual ~EditLayerDialog();
|
||||
|
||||
protected:
|
||||
|
||||
//(*Declarations(EditLayerDialog)
|
||||
wxStaticText* StaticText9;
|
||||
wxStaticBitmap* StaticBitmap2;
|
||||
wxTextCtrl* viewportX2Edit;
|
||||
wxStaticText* StaticText2;
|
||||
wxCheckBox* sizeCheck;
|
||||
wxStaticText* StaticText6;
|
||||
wxCheckBox* visibilityCheck;
|
||||
wxStaticText* StaticText8;
|
||||
wxStaticText* StaticText1;
|
||||
wxStaticText* StaticText3;
|
||||
wxButton* cancelBt;
|
||||
wxTextCtrl* nameEdit;
|
||||
wxTextCtrl* viewportY1Edit;
|
||||
wxStaticText* StaticText7;
|
||||
wxTextCtrl* cameraWidthEdit;
|
||||
wxStaticLine* StaticLine1;
|
||||
wxTextCtrl* viewportX1Edit;
|
||||
wxButton* deleteCameraBt;
|
||||
wxHyperlinkCtrl* helpBt;
|
||||
wxButton* addCameraBt;
|
||||
wxChoice* cameraChoice;
|
||||
wxStaticText* StaticText4;
|
||||
wxCheckBox* viewportCheck;
|
||||
wxButton* okBt;
|
||||
wxTextCtrl* viewportY2Edit;
|
||||
wxTextCtrl* cameraHeightEdit;
|
||||
//*)
|
||||
|
||||
//(*Identifiers(EditLayerDialog)
|
||||
static const long ID_STATICTEXT1;
|
||||
static const long ID_TEXTCTRL1;
|
||||
static const long ID_CHECKBOX1;
|
||||
static const long ID_STATICTEXT2;
|
||||
static const long ID_CHOICE1;
|
||||
static const long ID_BUTTON5;
|
||||
static const long ID_BUTTON3;
|
||||
static const long ID_CHECKBOX2;
|
||||
static const long ID_TEXTCTRL2;
|
||||
static const long ID_STATICTEXT4;
|
||||
static const long ID_TEXTCTRL3;
|
||||
static const long ID_CHECKBOX3;
|
||||
static const long ID_STATICTEXT7;
|
||||
static const long ID_TEXTCTRL4;
|
||||
static const long ID_STATICTEXT6;
|
||||
static const long ID_TEXTCTRL5;
|
||||
static const long ID_STATICTEXT8;
|
||||
static const long ID_TEXTCTRL6;
|
||||
static const long ID_STATICTEXT9;
|
||||
static const long ID_TEXTCTRL7;
|
||||
static const long ID_STATICTEXT3;
|
||||
static const long ID_STATICLINE1;
|
||||
static const long ID_STATICBITMAP2;
|
||||
static const long ID_HYPERLINKCTRL1;
|
||||
static const long ID_BUTTON2;
|
||||
static const long ID_BUTTON1;
|
||||
//*)
|
||||
|
||||
private:
|
||||
|
||||
//(*Handlers(EditLayerDialog)
|
||||
void OncancelBtClick(wxCommandEvent& event);
|
||||
void OnokBtClick(wxCommandEvent& event);
|
||||
void OnaddCameraBtClick(wxCommandEvent& event);
|
||||
void OncameraChoiceSelect(wxCommandEvent& event);
|
||||
void OnsizeCheckClick(wxCommandEvent& event);
|
||||
void OncameraWidthEditText(wxCommandEvent& event);
|
||||
void OncameraHeightEditText(wxCommandEvent& event);
|
||||
void OnviewportCheckClick(wxCommandEvent& event);
|
||||
void OnviewportX1EditText(wxCommandEvent& event);
|
||||
void OndeleteCameraBtClick(wxCommandEvent& event);
|
||||
void OnhelpBtClick(wxCommandEvent& event);
|
||||
//*)
|
||||
void RefreshCameraSettings();
|
||||
|
||||
Layer & layer;
|
||||
Layer tempLayer;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
#endif
|
||||
#endif
|
367
Core/GDCore/IDE/Dialogs/LayerPropgridHelper.cpp
Normal file
367
Core/GDCore/IDE/Dialogs/LayerPropgridHelper.cpp
Normal file
@@ -0,0 +1,367 @@
|
||||
/*
|
||||
* GDevelop Core
|
||||
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights reserved.
|
||||
* This project is released under the MIT License.
|
||||
*/
|
||||
#if defined(GD_IDE_ONLY) && !defined(GD_NO_WX_GUI)
|
||||
#include "LayerPropgridHelper.h"
|
||||
#include "GDCore/IDE/Dialogs/PropertyDescriptor.h"
|
||||
#include "GDCore/IDE/Dialogs/ChooseVariableDialog.h"
|
||||
#include "GDCore/Tools/HelpFileAccess.h"
|
||||
#include "GDCore/Project/Layer.h"
|
||||
#include "GDCore/Project/Effect.h"
|
||||
#include "GDCore/CommonTools.h"
|
||||
#include "GDCore/Tools/Log.h"
|
||||
#include <wx/propgrid/propgrid.h>
|
||||
#include <wx/settings.h>
|
||||
#include <wx/choicdlg.h>
|
||||
#include <map>
|
||||
|
||||
namespace {
|
||||
void SetDefaultParameters(gd::Effect & effect)
|
||||
{
|
||||
//Hardcoded default parameters of the available effects
|
||||
if (effect.GetEffectName() == "Sepia") {
|
||||
effect.SetParameter("opacity", 0.8);
|
||||
} else if (effect.GetEffectName() == "Night") {
|
||||
effect.SetParameter("intensity", 0.3);
|
||||
effect.SetParameter("opacity", 1);
|
||||
} else if (effect.GetEffectName() == "LightNight") {
|
||||
effect.SetParameter("opacity", 1);
|
||||
}
|
||||
}
|
||||
|
||||
int GetIndexFromPropertyName(wxString propertyName)
|
||||
{
|
||||
if (propertyName.Find(":") == wxNOT_FOUND) return -1;
|
||||
|
||||
wxString cameraId = propertyName.Mid(propertyName.Find(":") + 1);
|
||||
return gd::String(cameraId).To<int>();
|
||||
}
|
||||
}
|
||||
|
||||
namespace gd
|
||||
{
|
||||
|
||||
LayerPropgridHelper::LayerPropgridHelper(gd::Project & project_, gd::Layout & layout_) :
|
||||
grid(NULL),
|
||||
project(project_),
|
||||
layout(layout_)
|
||||
{
|
||||
// For now, effect names are hardcoded here.
|
||||
effectNames.push_back("Night");
|
||||
effectNames.push_back("LightNight");
|
||||
effectNames.push_back("Sepia");
|
||||
};
|
||||
|
||||
void LayerPropgridHelper::RefreshFrom(const Layer & layer)
|
||||
{
|
||||
if (!grid) return;
|
||||
grid->Clear();
|
||||
|
||||
grid->Append(new wxPropertyCategory(_("Layer properties")) );
|
||||
grid->Append(new wxStringProperty(_("Name"), "LAYER_NAME", layer.GetName()));
|
||||
if (layer.GetName().empty())
|
||||
{
|
||||
grid->EnableProperty(grid->GetProperty("LAYER_NAME"), false);
|
||||
grid->SetPropertyValue("LAYER_NAME", _("(Base layer)"));
|
||||
}
|
||||
grid->Append(new wxBoolProperty(_("Visible"), "LAYER_VISIBLE", layer.GetVisibility()));
|
||||
grid->Append(new wxStringProperty(_("Help"), "HELP", _("Click to see help...")) );
|
||||
grid->SetPropertyCell("HELP", 1, _("Help"), wxNullBitmap, wxSystemSettings::GetColour(wxSYS_COLOUR_HOTLIGHT));
|
||||
grid->SetPropertyReadOnly("HELP");
|
||||
|
||||
//Cameras
|
||||
grid->Append(new wxPropertyCategory(_("Cameras"), "CAMERAS") );
|
||||
grid->Append(new wxStringProperty(_("Add a camera"), "CAMERA_ADD", _("Add...")) );
|
||||
grid->SetPropertyCell("CAMERA_ADD", 1, _("Add..."), wxNullBitmap, wxSystemSettings::GetColour(wxSYS_COLOUR_HOTLIGHT));
|
||||
grid->SetPropertyReadOnly("CAMERA_ADD");
|
||||
|
||||
for (std::size_t i = 0;i<layer.GetCameraCount();++i)
|
||||
{
|
||||
const gd::Camera & camera = layer.GetCamera(i);
|
||||
wxString suffix = ":" + gd::String::From(i);
|
||||
|
||||
grid->AppendIn("CAMERAS", new wxPropertyCategory(wxString::Format(
|
||||
wxString(i == 0 ? _("Camera %d") : _("Camera %d (native games only)")), i), "CAMERA" + suffix)
|
||||
);
|
||||
|
||||
grid->Append(new wxStringProperty(_(""), "CAMERA_REMOVE" + suffix, _("Remove")) );
|
||||
grid->SetPropertyCell("CAMERA_REMOVE" + suffix, 1, _("Remove"), wxNullBitmap, wxSystemSettings::GetColour(wxSYS_COLOUR_HOTLIGHT));
|
||||
grid->SetPropertyReadOnly("CAMERA_REMOVE" + suffix);
|
||||
|
||||
grid->AppendIn(suffix, new wxBoolProperty(_("Custom size"), "CAMERA_CUSTOM_SIZE" + suffix, !camera.UseDefaultSize()));
|
||||
grid->EnableProperty(grid->Append(
|
||||
new wxStringProperty(_("Width"), "CAMERA_SIZE_WIDTH" + suffix, gd::String::From(camera.GetWidth()))),
|
||||
!camera.UseDefaultSize());
|
||||
grid->EnableProperty(grid->Append(
|
||||
new wxStringProperty(_("Height"), "CAMERA_SIZE_HEIGHT" + suffix, gd::String::From(camera.GetHeight()))),
|
||||
!camera.UseDefaultSize());
|
||||
grid->AppendIn(suffix, new wxBoolProperty(_("Custom viewport (native games only)"), "CAMERA_CUSTOM_VIEWPORT" + suffix, !camera.UseDefaultViewport()));
|
||||
grid->EnableProperty(grid->Append(
|
||||
new wxStringProperty(_("Top-left x"), "CAMERA_VIEWPORT_X1" + suffix, gd::String::From(camera.GetViewportX1()))),
|
||||
!camera.UseDefaultViewport());
|
||||
grid->EnableProperty(grid->Append(
|
||||
new wxStringProperty(_("Top-left y"), "CAMERA_VIEWPORT_Y1" + suffix, gd::String::From(camera.GetViewportY1()))),
|
||||
!camera.UseDefaultViewport());
|
||||
grid->EnableProperty(grid->Append(
|
||||
new wxStringProperty(_("Bottom-right x"), "CAMERA_VIEWPORT_X2" + suffix, gd::String::From(camera.GetViewportX2()))),
|
||||
!camera.UseDefaultViewport());
|
||||
grid->EnableProperty(grid->Append(
|
||||
new wxStringProperty(_("Bottom-right y"), "CAMERA_VIEWPORT_Y2" + suffix, gd::String::From(camera.GetViewportY2()))),
|
||||
!camera.UseDefaultViewport());
|
||||
}
|
||||
|
||||
//Effects
|
||||
grid->Append(new wxPropertyCategory(_("Effects"), "EFFECTS") );
|
||||
grid->Append(new wxStringProperty(_("Add an effect"), "EFFECT_ADD", _("Add...")) );
|
||||
grid->SetPropertyCell("EFFECT_ADD", 1, _("Add..."), wxNullBitmap, wxSystemSettings::GetColour(wxSYS_COLOUR_HOTLIGHT));
|
||||
grid->SetPropertyReadOnly("EFFECT_ADD");
|
||||
|
||||
for (std::size_t i = 0;i<layer.GetEffectsCount();++i)
|
||||
{
|
||||
const gd::Effect & effect = layer.GetEffect(i);
|
||||
wxString suffix = ":" + gd::String::From(i);
|
||||
|
||||
grid->AppendIn("EFFECTS", new wxPropertyCategory(wxString::Format(wxString(_("Effect %d")), i), "EFFECT" + suffix));
|
||||
|
||||
grid->Append(new wxStringProperty(_(""), "EFFECT_REMOVE" + suffix, _("Remove")) );
|
||||
grid->SetPropertyCell("EFFECT_REMOVE" + suffix, 1, _("Remove"), wxNullBitmap, wxSystemSettings::GetColour(wxSYS_COLOUR_HOTLIGHT));
|
||||
grid->SetPropertyReadOnly("EFFECT_REMOVE" + suffix);
|
||||
grid->Append(new wxStringProperty(_("Name"), "EFFECT_NAME" + suffix, effect.GetName()));
|
||||
|
||||
wxEnumProperty * prop = new wxEnumProperty(_("Effect"), "EFFECT_EFFECT" + suffix, effectNames);
|
||||
prop->SetChoiceSelection(effectNames.Index(effect.GetEffectName()));
|
||||
grid->Append(prop);
|
||||
|
||||
for(auto parameter : effect.GetAllParameters())
|
||||
{
|
||||
auto & name = parameter.first;
|
||||
auto value = parameter.second;
|
||||
grid->Append(new wxStringProperty(name, "EFFECT_PARAMETER_" + name + suffix, gd::String::From(value)));
|
||||
}
|
||||
}
|
||||
|
||||
grid->SetPropertyAttributeAll(wxPG_BOOL_USE_CHECKBOX, true);
|
||||
}
|
||||
|
||||
bool LayerPropgridHelper::OnPropertySelected(Layer & layer, wxPropertyGridEvent& event)
|
||||
{
|
||||
if (!grid) return false;
|
||||
|
||||
std::map<wxString, std::function<bool(int)>> camerasProperties = {
|
||||
{"CAMERA_REMOVE", [&](int cameraIndex) {
|
||||
if (layer.GetCameraCount() <= 1)
|
||||
{
|
||||
gd::LogMessage(_("The layer must have at least one camera."));
|
||||
return false;
|
||||
}
|
||||
|
||||
layer.DeleteCamera(cameraIndex);
|
||||
return true;
|
||||
}},
|
||||
};
|
||||
std::map<wxString, std::function<bool(int)>> effectsProperties = {
|
||||
{"EFFECT_REMOVE", [&](int effectIndex) {
|
||||
layer.RemoveEffect(layer.GetEffect(effectIndex).GetName());
|
||||
return true;
|
||||
}},
|
||||
};
|
||||
|
||||
if (event.GetColumn() == 1) //Manage button-like properties
|
||||
{
|
||||
if (event.GetPropertyName() == "CAMERA_ADD")
|
||||
{
|
||||
layer.SetCameraCount(layer.GetCameraCount() + 1);
|
||||
return true;
|
||||
}
|
||||
else if (event.GetPropertyName() == "EFFECT_ADD")
|
||||
{
|
||||
if (layer.GetEffectsCount() >= 1)
|
||||
{
|
||||
gd::LogWarning(_("For now, only one effect by layer is supported."));
|
||||
return false;
|
||||
}
|
||||
|
||||
gd::String effectName = wxGetSingleChoice(_("Choose an effect to add to the layer"), _("Effects"), effectNames);
|
||||
if (effectName.empty()) return false;
|
||||
|
||||
//TODO: Effect with an already existing name could be created.
|
||||
SetDefaultParameters(layer.InsertNewEffect(effectName, 0));
|
||||
return true;
|
||||
}
|
||||
else if (event.GetPropertyName() == "HELP")
|
||||
{
|
||||
gd::HelpFileAccess::Get()->OpenPage("en/game_develop/documentation/manual/editors/scene_editor/edit_layer");
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
for(auto it : camerasProperties)
|
||||
{
|
||||
if (event.GetPropertyName().StartsWith(it.first))
|
||||
{
|
||||
int cameraId = GetIndexFromPropertyName(event.GetPropertyName());
|
||||
if (cameraId < 0 || cameraId >= layer.GetCameraCount())
|
||||
return false;
|
||||
|
||||
return it.second(cameraId);
|
||||
}
|
||||
}
|
||||
for(auto it : effectsProperties)
|
||||
{
|
||||
if (event.GetPropertyName().StartsWith(it.first))
|
||||
{
|
||||
int effectId = GetIndexFromPropertyName(event.GetPropertyName());
|
||||
if (effectId < 0 || effectId >= layer.GetEffectsCount())
|
||||
return false;
|
||||
|
||||
return it.second(effectId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool LayerPropgridHelper::OnPropertyChanged(Layer & layer, wxPropertyGridEvent& event)
|
||||
{
|
||||
if (!grid) return false;
|
||||
|
||||
auto validateViewportValue = [&event]() {
|
||||
float value = event.GetValue().GetReal();
|
||||
if (value < 0 || value > 1)
|
||||
{
|
||||
gd::LogMessage(_("Viewport values are a factor of the window size, and must be between 0 and 1."));
|
||||
event.Veto();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
auto validateCameraSize = [&event]() {
|
||||
int value = event.GetValue().GetInteger();
|
||||
if (value <= 0)
|
||||
{
|
||||
gd::LogMessage(_("A camera should have a size that is at least 1 pixel."));
|
||||
event.Veto();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
std::map<wxString, std::function<bool(int)>> camerasProperties = {
|
||||
{"CAMERA_CUSTOM_SIZE", [&](int id) {
|
||||
layer.GetCamera(id).SetUseDefaultSize(!event.GetValue().GetBool());
|
||||
return true;
|
||||
}},
|
||||
{"CAMERA_SIZE_WIDTH", [&](int id) {
|
||||
if (validateCameraSize())
|
||||
{
|
||||
layer.GetCamera(id).SetSize(
|
||||
event.GetValue().GetInteger(),
|
||||
layer.GetCamera(id).GetHeight()
|
||||
);
|
||||
}
|
||||
return false;
|
||||
}},
|
||||
{"CAMERA_SIZE_HEIGHT", [&](int id) {
|
||||
if (validateCameraSize())
|
||||
{
|
||||
layer.GetCamera(id).SetSize(
|
||||
layer.GetCamera(id).GetWidth(),
|
||||
event.GetValue().GetInteger()
|
||||
);
|
||||
}
|
||||
return false;
|
||||
}},
|
||||
{"CAMERA_CUSTOM_VIEWPORT", [&](int id) {
|
||||
layer.GetCamera(id).SetUseDefaultViewport(!event.GetValue().GetBool());
|
||||
return true;
|
||||
}},
|
||||
{"CAMERA_VIEWPORT_X1", [&](int id) {
|
||||
if (validateViewportValue())
|
||||
layer.GetCamera(id).SetViewportX1(event.GetValue().GetReal());
|
||||
|
||||
return false;
|
||||
}},
|
||||
{"CAMERA_VIEWPORT_Y1", [&](int id) {
|
||||
if (validateViewportValue())
|
||||
layer.GetCamera(id).SetViewportY1(event.GetValue().GetReal());
|
||||
|
||||
return false;
|
||||
}},
|
||||
{"CAMERA_VIEWPORT_X2", [&](int id) {
|
||||
if (validateViewportValue())
|
||||
layer.GetCamera(id).SetViewportX2(event.GetValue().GetReal());
|
||||
|
||||
return false;
|
||||
}},
|
||||
{"CAMERA_VIEWPORT_Y2", [&](int id) {
|
||||
if (validateViewportValue())
|
||||
layer.GetCamera(id).SetViewportY2(event.GetValue().GetReal());
|
||||
|
||||
return false;
|
||||
}}
|
||||
};
|
||||
|
||||
std::map<wxString, std::function<bool(int)>> effectsProperties = {
|
||||
{"EFFECT_NAME", [&](int id) {
|
||||
layer.GetEffect(id).SetName(event.GetValue().GetString());
|
||||
return false;
|
||||
}},
|
||||
{"EFFECT_EFFECT", [&](int id) {
|
||||
unsigned int effectNameId = event.GetPropertyValue().GetLong();
|
||||
if (effectNameId >= effectNames.size())
|
||||
return false;
|
||||
|
||||
layer.GetEffect(id).SetEffectName(effectNames[effectNameId]);
|
||||
return false;
|
||||
}},
|
||||
{"EFFECT_PARAMETER_", [&](int id) {
|
||||
gd::String name = event.GetPropertyName();
|
||||
size_t pos = gd::String("EFFECT_PARAMETER_").length();
|
||||
name = name.substr(pos, name.find(":") - pos);
|
||||
|
||||
layer.GetEffect(id).SetParameter(name,
|
||||
gd::String(event.GetValue().GetString()).To<float>()
|
||||
);
|
||||
return false;
|
||||
}}
|
||||
};
|
||||
|
||||
if (event.GetPropertyName() == "LAYER_VISIBLE")
|
||||
layer.SetVisibility(event.GetValue().GetBool());
|
||||
else
|
||||
{
|
||||
for(auto it : camerasProperties)
|
||||
{
|
||||
if (event.GetPropertyName().StartsWith(it.first))
|
||||
{
|
||||
int cameraId = GetIndexFromPropertyName(event.GetPropertyName());
|
||||
if (cameraId < 0 || cameraId >= layer.GetCameraCount())
|
||||
return false;
|
||||
|
||||
return it.second(cameraId);
|
||||
}
|
||||
}
|
||||
for(auto it : effectsProperties)
|
||||
{
|
||||
if (event.GetPropertyName().StartsWith(it.first))
|
||||
{
|
||||
int effectId = GetIndexFromPropertyName(event.GetPropertyName());
|
||||
if (effectId < 0 || effectId >= layer.GetEffectsCount())
|
||||
return false;
|
||||
|
||||
return it.second(effectId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
55
Core/GDCore/IDE/Dialogs/LayerPropgridHelper.h
Normal file
55
Core/GDCore/IDE/Dialogs/LayerPropgridHelper.h
Normal file
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* GDevelop Core
|
||||
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights reserved.
|
||||
* This project is released under the MIT License.
|
||||
*/
|
||||
#if defined(GD_IDE_ONLY) && !defined(GD_NO_WX_GUI)
|
||||
#ifndef LAYERSPROPGRIDHELPER_H
|
||||
#define LAYERSPROPGRIDHELPER_H
|
||||
#include <wx/propgrid/propgrid.h>
|
||||
#include <vector>
|
||||
namespace gd { class Layer; }
|
||||
namespace gd { class Project; }
|
||||
namespace gd { class Layout; }
|
||||
|
||||
namespace gd
|
||||
{
|
||||
|
||||
/**
|
||||
* \brief Helper class used to easily use a wxPropertyGrid so as to view and edit the properties of
|
||||
* a gd::Layer
|
||||
*
|
||||
* \ingroup IDEdialogs
|
||||
*/
|
||||
class GD_CORE_API LayerPropgridHelper
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* \brief Default constructor.
|
||||
* \param grid A pointer to the wxPropertyGrid to be used.
|
||||
* \param project The project edited
|
||||
* \param layout The layout being edited
|
||||
*/
|
||||
LayerPropgridHelper(gd::Project & project_, gd::Layout & layout_);
|
||||
virtual ~LayerPropgridHelper() {};
|
||||
|
||||
void RefreshFrom(const Layer & layer);
|
||||
|
||||
bool OnPropertySelected(Layer & layer, wxPropertyGridEvent& event);
|
||||
|
||||
bool OnPropertyChanged(Layer & layer, wxPropertyGridEvent& event);
|
||||
|
||||
void SetGrid(wxPropertyGrid * grid_) { grid = grid_; }
|
||||
|
||||
private:
|
||||
wxPropertyGrid * grid; ///< The grid used for diplaying and editing properties.
|
||||
gd::Project & project;
|
||||
gd::Layout & layout;
|
||||
wxArrayString effectNames; ///< Hardcoded names of the available effects
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // LAYERSPROPGRIDHELPER_H
|
||||
#endif
|
@@ -149,15 +149,15 @@ LayoutEditorCanvas::LayoutEditorCanvas(wxWindow* parent, gd::Project & project_,
|
||||
|
||||
//...and pass it to the sf::RenderWindow.
|
||||
#if GTK_CHECK_VERSION(3, 0, 0)
|
||||
sf::RenderWindow::create(GDK_WINDOW_XID(win));
|
||||
sf::RenderWindow::create(GDK_WINDOW_XID(win), sf::ContextSettings(24, 8));
|
||||
#else
|
||||
sf::RenderWindow::create(GDK_WINDOW_XWINDOW(win));
|
||||
sf::RenderWindow::create(GDK_WINDOW_XWINDOW(win), sf::ContextSettings(24, 8));
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
// Tested under Windows XP only (should work with X11 and other Windows versions - no idea about MacOS)
|
||||
sf::RenderWindow::create(static_cast<sf::WindowHandle>(GetHandle()));
|
||||
sf::RenderWindow::create(static_cast<sf::WindowHandle>(GetHandle()), sf::ContextSettings(24, 8));
|
||||
|
||||
#endif
|
||||
|
||||
@@ -575,6 +575,14 @@ void LayoutEditorCanvas::UpdateContextMenu()
|
||||
if ( selectedInstances.empty() ) return;
|
||||
|
||||
//Can we send the objects on a higher layer ?
|
||||
std::size_t highestLayer = 0;
|
||||
for (auto & it : selectedInstances)
|
||||
{
|
||||
if (it.first == NULL) continue;
|
||||
highestLayer = std::max(highestLayer, layout.GetLayerPosition(it.first->GetLayer()));
|
||||
}
|
||||
|
||||
//Can we send the objects on a lower layer ?
|
||||
std::size_t lowestLayer = layout.GetLayersCount()-1;
|
||||
for (auto & it : selectedInstances)
|
||||
{
|
||||
@@ -585,29 +593,21 @@ void LayoutEditorCanvas::UpdateContextMenu()
|
||||
if (wxMenuItem * layerUpItem = contextMenu.FindItem(ID_LAYERUPMENU))
|
||||
{
|
||||
layerUpItem->Enable(false);
|
||||
if ( lowestLayer+1 < layout.GetLayersCount() )
|
||||
if ( highestLayer+1 < layout.GetLayersCount() )
|
||||
{
|
||||
gd::String name = layout.GetLayer(lowestLayer+1).GetName();
|
||||
gd::String name = layout.GetLayer(highestLayer+1).GetName();
|
||||
if ( name == "" ) name = _("Base layer");
|
||||
layerUpItem->Enable(true);
|
||||
layerUpItem->SetItemLabel(_("Put the object(s) on the layer \"") + name + "\"");
|
||||
}
|
||||
}
|
||||
|
||||
//Can we send the objects on a lower layer ?
|
||||
std::size_t highestLayer = 0;
|
||||
for (auto & it : selectedInstances)
|
||||
{
|
||||
if (it.first == NULL) continue;
|
||||
highestLayer = std::max(highestLayer, layout.GetLayerPosition(it.first->GetLayer()));
|
||||
}
|
||||
|
||||
if (wxMenuItem * layerDownItem = contextMenu.FindItem(ID_LAYERUPMENU))
|
||||
if (wxMenuItem * layerDownItem = contextMenu.FindItem(ID_LAYERDOWNMENU))
|
||||
{
|
||||
layerDownItem->Enable(false);
|
||||
if ( highestLayer >= 1 )
|
||||
if ( lowestLayer >= 1 )
|
||||
{
|
||||
gd::String name = layout.GetLayer(highestLayer-1).GetName();
|
||||
gd::String name = layout.GetLayer(lowestLayer-1).GetName();
|
||||
if ( name == "" ) name = _("Base layer");
|
||||
|
||||
layerDownItem->Enable(true);
|
||||
|
22
Core/GDCore/IDE/Events/EventsListUnfolder.h
Normal file
22
Core/GDCore/IDE/Events/EventsListUnfolder.h
Normal file
@@ -0,0 +1,22 @@
|
||||
#include "GDCore/Events/EventsList.h"
|
||||
#include "GDCore/Events/Event.h"
|
||||
|
||||
class GD_CORE_API EventsListUnfolder
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* \brief Recursively unfold all the event lists containing the specified event.
|
||||
* \note This is a quick and naive implementation, complexity is pretty high.
|
||||
*/
|
||||
static void UnfoldWhenContaining(gd::EventsList & list, const gd::BaseEvent & eventToContain) {
|
||||
for(size_t i = 0;i < list.size();++i)
|
||||
{
|
||||
gd::BaseEvent & event = list[i];
|
||||
if (event.CanHaveSubEvents() && event.GetSubEvents().Contains(eventToContain))
|
||||
{
|
||||
event.SetFolded(false);
|
||||
UnfoldWhenContaining(event.GetSubEvents(), eventToContain);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
38
Core/GDCore/Project/Effect.cpp
Normal file
38
Core/GDCore/Project/Effect.cpp
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* GDevelop Core
|
||||
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights reserved.
|
||||
* This project is released under the MIT License.
|
||||
*/
|
||||
#include "GDCore/Project/Effect.h"
|
||||
#include "GDCore/Serialization/SerializerElement.h"
|
||||
#include "GDCore/CommonTools.h"
|
||||
|
||||
namespace gd
|
||||
{
|
||||
|
||||
#if defined(GD_IDE_ONLY)
|
||||
void Effect::SerializeTo(SerializerElement & element) const
|
||||
{
|
||||
element.SetAttribute("name", GetName());
|
||||
element.SetAttribute("effectName", GetEffectName());
|
||||
SerializerElement & parametersElement = element.AddChild("parameters");
|
||||
for (auto & parameter : parameters)
|
||||
parametersElement.AddChild(parameter.first).SetValue(parameter.second);
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \brief Unserialize the layer.
|
||||
*/
|
||||
void Effect::UnserializeFrom(const SerializerElement & element)
|
||||
{
|
||||
SetName(element.GetStringAttribute("name"));
|
||||
SetEffectName(element.GetStringAttribute("effectName"));
|
||||
|
||||
parameters.clear();
|
||||
const SerializerElement & parametersElement = element.GetChild("parameters");
|
||||
for (auto & child : parametersElement.GetAllChildren())
|
||||
SetParameter(child.first, child.second->GetValue().GetDouble());
|
||||
}
|
||||
|
||||
}
|
56
Core/GDCore/Project/Effect.h
Normal file
56
Core/GDCore/Project/Effect.h
Normal file
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* GDevelop Core
|
||||
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights reserved.
|
||||
* This project is released under the MIT License.
|
||||
*/
|
||||
#ifndef GDCORE_EFFECT_H
|
||||
#define GDCORE_EFFECT_H
|
||||
#include <map>
|
||||
namespace gd { class SerializerElement; }
|
||||
#include "GDCore/String.h"
|
||||
|
||||
namespace gd
|
||||
{
|
||||
|
||||
/**
|
||||
* \brief Represents an effect that can be applied on a layer.
|
||||
*
|
||||
* \see gd::Layer
|
||||
* \ingroup PlatformDefinition
|
||||
*/
|
||||
class GD_CORE_API Effect
|
||||
{
|
||||
public:
|
||||
Effect() {};
|
||||
virtual ~Effect() {};
|
||||
|
||||
void SetName(const gd::String & name_) { name = name_; }
|
||||
const gd::String & GetName() const { return name; }
|
||||
|
||||
void SetEffectName(const gd::String & effectName_) { effectName = effectName_; }
|
||||
const gd::String & GetEffectName() const { return effectName; }
|
||||
|
||||
void SetParameter(const gd::String & name, float value) { parameters[name] = value; }
|
||||
float GetParameter(const gd::String & name) { return parameters[name]; }
|
||||
const std::map<gd::String, float> & GetAllParameters() const { return parameters; }
|
||||
|
||||
#if defined(GD_IDE_ONLY)
|
||||
/**
|
||||
* \brief Serialize layer.
|
||||
*/
|
||||
void SerializeTo(SerializerElement & element) const;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \brief Unserialize the layer.
|
||||
*/
|
||||
void UnserializeFrom(const SerializerElement & element);
|
||||
|
||||
private:
|
||||
gd::String name; ///< The name of the layer
|
||||
gd::String effectName; ///< The name of the effect to apply
|
||||
std::map<gd::String, float> parameters;
|
||||
};
|
||||
|
||||
}
|
||||
#endif
|
@@ -189,14 +189,18 @@ OpenGLTextureWrapper::OpenGLTextureWrapper(std::shared_ptr<SFMLTextureWrapper> s
|
||||
{
|
||||
sfmlTexture = sfmlTexture_;
|
||||
|
||||
#if !defined(ANDROID) //TODO: OpenGL
|
||||
glGenTextures(1, &texture);
|
||||
glBindTexture(GL_TEXTURE_2D, texture);
|
||||
gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, sfmlTexture->image.getSize().x, sfmlTexture->image.getSize().y, GL_RGBA, GL_UNSIGNED_BYTE, sfmlTexture->image.getPixelsPtr());
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
|
||||
#endif
|
||||
}
|
||||
|
||||
OpenGLTextureWrapper::~OpenGLTextureWrapper()
|
||||
{
|
||||
#if !defined(ANDROID) //TODO: OpenGL
|
||||
glDeleteTextures(1, &texture);
|
||||
#endif
|
||||
};
|
||||
|
@@ -4,7 +4,7 @@
|
||||
* This project is released under the MIT License.
|
||||
*/
|
||||
#include "GDCore/Project/Layer.h"
|
||||
#include "GDCore/IDE/Dialogs/EditLayerDialog.h"
|
||||
#include "GDCore/Project/Effect.h"
|
||||
#include "GDCore/Serialization/SerializerElement.h"
|
||||
#include "GDCore/CommonTools.h"
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace gd
|
||||
{
|
||||
|
||||
Camera Layer::badCamera;
|
||||
Effect Layer::badEffect;
|
||||
|
||||
Layer::Layer() :
|
||||
isVisible(true)
|
||||
@@ -52,6 +53,13 @@ void Layer::SerializeTo(SerializerElement & element) const
|
||||
cameraElement.SetAttribute("viewportBottom", GetCamera(c).GetViewportY2());
|
||||
}
|
||||
|
||||
SerializerElement & effectsElement = element.AddChild("effects");
|
||||
effectsElement.ConsiderAsArrayOf("effect");
|
||||
for (std::size_t i = 0;i<GetEffectsCount();++i)
|
||||
{
|
||||
SerializerElement & effectElement = effectsElement.AddChild("effect");
|
||||
GetEffect(i).SerializeTo(effectElement);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -105,18 +113,112 @@ void Layer::UnserializeFrom(const SerializerElement & element)
|
||||
cameraElement.GetDoubleAttribute("viewportBottom")); // (sf::Rect used Right and Bottom instead of Width and Height before)
|
||||
}
|
||||
}
|
||||
|
||||
effects.clear();
|
||||
SerializerElement & effectsElement = element.GetChild("effects");
|
||||
effectsElement.ConsiderAsArrayOf("effect");
|
||||
for (std::size_t i = 0; i < effectsElement.GetChildrenCount(); ++i)
|
||||
{
|
||||
const SerializerElement & effectElement = effectsElement.GetChild(i);
|
||||
|
||||
auto effect = std::shared_ptr<gd::Effect>(new Effect);
|
||||
effect->UnserializeFrom(effectElement);
|
||||
effects.push_back(effect);
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(GD_IDE_ONLY) && !defined(GD_NO_WX_GUI)
|
||||
/**
|
||||
* Display a window to edit the layer
|
||||
*/
|
||||
void Layer::EditLayer()
|
||||
|
||||
gd::Effect & Layer::GetEffect(const gd::String & name)
|
||||
{
|
||||
EditLayerDialog dialog(NULL, *this);
|
||||
dialog.ShowModal();
|
||||
auto effect = find_if(effects.begin(), effects.end(), [&name](std::shared_ptr<gd::Effect> & effect) {
|
||||
return effect->GetName() == name;
|
||||
});
|
||||
|
||||
if ( effect != effects.end())
|
||||
return **effect;
|
||||
|
||||
return badEffect;
|
||||
}
|
||||
const gd::Effect & Layer::GetEffect(const gd::String & name) const
|
||||
{
|
||||
auto effect = find_if(effects.begin(), effects.end(), [&name](const std::shared_ptr<gd::Effect> & effect) {
|
||||
return effect->GetName() == name;
|
||||
});
|
||||
|
||||
if ( effect != effects.end())
|
||||
return **effect;
|
||||
|
||||
return badEffect;
|
||||
}
|
||||
gd::Effect & Layer::GetEffect(std::size_t index)
|
||||
{
|
||||
return *effects[index];
|
||||
}
|
||||
const gd::Effect & Layer::GetEffect (std::size_t index) const
|
||||
{
|
||||
return *effects[index];
|
||||
}
|
||||
std::size_t Layer::GetEffectsCount() const
|
||||
{
|
||||
return effects.size();
|
||||
}
|
||||
|
||||
bool Layer::HasEffectNamed(const gd::String & name) const
|
||||
{
|
||||
return ( find_if(effects.begin(), effects.end(), [&name](const std::shared_ptr<gd::Effect> & effect) {
|
||||
return effect->GetName() == name;
|
||||
}) != effects.end() );
|
||||
}
|
||||
std::size_t Layer::GetEffectPosition(const gd::String & name) const
|
||||
{
|
||||
for (std::size_t i = 0;i<effects.size();++i)
|
||||
{
|
||||
if ( effects[i]->GetName() == name ) return i;
|
||||
}
|
||||
return gd::String::npos;
|
||||
}
|
||||
|
||||
gd::Effect & Layer::InsertNewEffect(const gd::String & name, std::size_t position)
|
||||
{
|
||||
auto newEffect = std::shared_ptr<gd::Effect>(new Effect);
|
||||
newEffect->SetName(name);
|
||||
newEffect->SetEffectName(name);
|
||||
if (position<effects.size())
|
||||
effects.insert(effects.begin()+position, newEffect);
|
||||
else
|
||||
effects.push_back(newEffect);
|
||||
|
||||
return *newEffect;
|
||||
}
|
||||
|
||||
void Layer::InsertEffect(const gd::Effect & effect, std::size_t position)
|
||||
{
|
||||
auto newEffect = std::shared_ptr<gd::Effect>(new Effect(effect));
|
||||
if (position<effects.size())
|
||||
effects.insert(effects.begin()+position, newEffect);
|
||||
else
|
||||
effects.push_back(newEffect);
|
||||
}
|
||||
|
||||
void Layer::RemoveEffect(const gd::String & name)
|
||||
{
|
||||
auto effect = find_if(effects.begin(), effects.end(), [&name](const std::shared_ptr<gd::Effect> & effect) {
|
||||
return effect->GetName() == name;
|
||||
});
|
||||
if ( effect == effects.end() ) return;
|
||||
|
||||
effects.erase(effect);
|
||||
}
|
||||
|
||||
void Layer::SwapEffects(std::size_t firstEffectIndex, std::size_t secondEffectIndex)
|
||||
{
|
||||
if ( firstEffectIndex >= effects.size() || secondEffectIndex >= effects.size() )
|
||||
return;
|
||||
|
||||
auto temp = effects[firstEffectIndex];
|
||||
effects[firstEffectIndex] = effects[secondEffectIndex];
|
||||
effects[secondEffectIndex] = temp;
|
||||
}
|
||||
#endif
|
||||
|
||||
Camera::Camera() :
|
||||
defaultSize(true),
|
||||
|
@@ -7,6 +7,8 @@
|
||||
#define GDCORE_LAYER_H
|
||||
#include "GDCore/String.h"
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
namespace gd { class Effect; }
|
||||
namespace gd { class Camera; }
|
||||
namespace gd { class SerializerElement; }
|
||||
|
||||
@@ -45,6 +47,10 @@ public:
|
||||
*/
|
||||
bool GetVisibility() const { return isVisible; }
|
||||
|
||||
/** \name Cameras
|
||||
*/
|
||||
///@{
|
||||
|
||||
/**
|
||||
* \brief Change the number of cameras inside the layer.
|
||||
*/
|
||||
@@ -75,12 +81,71 @@ public:
|
||||
*/
|
||||
inline void AddCamera(const Camera & camera) { cameras.push_back(camera); };
|
||||
|
||||
#if defined(GD_IDE_ONLY)
|
||||
/**
|
||||
* \brief Display a window to edit the layer
|
||||
*/
|
||||
void EditLayer();
|
||||
///@}
|
||||
|
||||
/** \name Effects
|
||||
*/
|
||||
///@{
|
||||
/**
|
||||
* \brief Return true if the effect called "name" exists.
|
||||
*/
|
||||
bool HasEffectNamed(const gd::String & name) const;
|
||||
|
||||
/**
|
||||
* \brief Return a reference to the effect called "name".
|
||||
*/
|
||||
Effect & GetEffect(const gd::String & name);
|
||||
|
||||
/**
|
||||
* \brief Return a reference to the effect called "name".
|
||||
*/
|
||||
const Effect & GetEffect(const gd::String & name) const;
|
||||
|
||||
/**
|
||||
* Return a reference to the effect at position "index" in the effects list
|
||||
*/
|
||||
Effect & GetEffect(std::size_t index);
|
||||
|
||||
/**
|
||||
* Return a reference to the effect at position "index" in the effects list
|
||||
*/
|
||||
const Effect & GetEffect (std::size_t index) const;
|
||||
|
||||
/**
|
||||
* Return the position of the effect called "name" in the effects list
|
||||
*/
|
||||
std::size_t GetEffectPosition(const gd::String & name) const;
|
||||
|
||||
/**
|
||||
* Return the number of effecst.
|
||||
*/
|
||||
std::size_t GetEffectsCount() const;
|
||||
|
||||
/**
|
||||
* Add a new effect at the specified position in the effects list.
|
||||
*/
|
||||
gd::Effect & InsertNewEffect(const gd::String & name, std::size_t position);
|
||||
|
||||
/**
|
||||
* \brief Add the a copy of the specified effect in the effects list.
|
||||
* \note No pointer or reference must be kept on the layer passed as parameter.
|
||||
* \param theEffect The effect that must be copied and inserted into the effects list
|
||||
* \param position Insertion position.
|
||||
*/
|
||||
void InsertEffect(const Effect & theEffect, std::size_t position);
|
||||
|
||||
/**
|
||||
* Remove the specified effect.
|
||||
*/
|
||||
void RemoveEffect(const gd::String & name);
|
||||
|
||||
/**
|
||||
* Swap the position of two effects.
|
||||
*/
|
||||
void SwapEffects(std::size_t firstEffectIndex, std::size_t secondEffectIndex);
|
||||
///@}
|
||||
|
||||
#if defined(GD_IDE_ONLY)
|
||||
/**
|
||||
* \brief Serialize layer.
|
||||
*/
|
||||
@@ -96,9 +161,11 @@ private:
|
||||
|
||||
gd::String name; ///< The name of the layer
|
||||
bool isVisible; ///< True if the layer is visible
|
||||
std::vector < gd::Camera > cameras; ///< The camera displayed by the layer
|
||||
std::vector<gd::Camera> cameras; ///< The camera displayed by the layer
|
||||
std::vector<std::shared_ptr<gd::Effect>> effects; ///< The effects applied to the layer.
|
||||
|
||||
static gd::Camera badCamera;
|
||||
static gd::Effect badEffect;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -124,17 +191,21 @@ public:
|
||||
~Camera() {};
|
||||
|
||||
/**
|
||||
* Change the viewport, i.e the area of the window where the camera will be displayed
|
||||
* The coordinates must be between 0 and 1.
|
||||
* \brief Change the viewport, i.e the area of the window where the camera will be displayed.
|
||||
* \note The coordinates must be between 0 and 1.
|
||||
*/
|
||||
void SetViewport(float x1_, float y1_, float x2_, float y2_) { x1 = x1_; x2 = x2_; y1 = y1_; y2 = y2_; };
|
||||
void SetViewportX1(float x1_) { x1 = x1_; };
|
||||
void SetViewportY1(float y1_) { y1 = y1_; };
|
||||
void SetViewportX2(float x2_) { x2 = x2_; };
|
||||
void SetViewportY2(float y2_) { y2 = y2_; };
|
||||
float GetViewportX1() const { return x1; };
|
||||
float GetViewportY1() const { return y1; };
|
||||
float GetViewportX2() const { return x2; };
|
||||
float GetViewportY2() const { return y2; };
|
||||
|
||||
/**
|
||||
* Change the size of the rendered area of the scene.
|
||||
* \brief Change the size of the rendered area of the scene, in pixels.
|
||||
*/
|
||||
void SetSize(float width_, float height_) { width = width_; height = height_; };
|
||||
float GetWidth() const { return width; };
|
||||
|
@@ -21,9 +21,7 @@ namespace gd
|
||||
|
||||
Object::~Object()
|
||||
{
|
||||
//Do not forget to delete behaviors which are managed using raw pointers.
|
||||
for (std::map<gd::String, Behavior* >::const_iterator it = behaviors.begin() ; it != behaviors.end(); ++it )
|
||||
delete it->second;
|
||||
|
||||
}
|
||||
|
||||
Object::Object(const gd::String & name_) :
|
||||
@@ -37,13 +35,9 @@ void Object::Init(const gd::Object & object)
|
||||
type = object.type;
|
||||
objectVariables = object.objectVariables;
|
||||
|
||||
//Do not forget to delete behaviors which are managed using raw pointers.
|
||||
for (std::map<gd::String, Behavior* >::const_iterator it = behaviors.begin() ; it != behaviors.end(); ++it )
|
||||
delete it->second;
|
||||
|
||||
behaviors.clear();
|
||||
for (std::map<gd::String, Behavior* >::const_iterator it = object.behaviors.begin() ; it != object.behaviors.end(); ++it )
|
||||
behaviors[it->first] = it->second->Clone();
|
||||
for (auto it = object.behaviors.cbegin() ; it != object.behaviors.cend(); ++it )
|
||||
behaviors[it->first] = std::unique_ptr<Behavior>(it->second->Clone());
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +45,7 @@ std::vector < gd::String > Object::GetAllBehaviorNames() const
|
||||
{
|
||||
std::vector < gd::String > allNameIdentifiers;
|
||||
|
||||
for (std::map<gd::String, Behavior* >::const_iterator it = behaviors.begin() ; it != behaviors.end(); ++it )
|
||||
for (std::map<gd::String, std::unique_ptr<gd::Behavior> >::const_iterator it = behaviors.begin() ; it != behaviors.end(); ++it )
|
||||
allNameIdentifiers.push_back(it->first);
|
||||
|
||||
return allNameIdentifiers;
|
||||
@@ -59,9 +53,6 @@ std::vector < gd::String > Object::GetAllBehaviorNames() const
|
||||
|
||||
void Object::RemoveBehavior(const gd::String & name)
|
||||
{
|
||||
//Do not forget to delete behaviors which are managed using raw pointers.
|
||||
delete(behaviors[name]);
|
||||
|
||||
behaviors.erase(name);
|
||||
}
|
||||
|
||||
@@ -70,10 +61,10 @@ bool Object::RenameBehavior(const gd::String & name, const gd::String & newName)
|
||||
if ( behaviors.find(name) == behaviors.end()
|
||||
|| behaviors.find(newName) != behaviors.end() ) return false;
|
||||
|
||||
Behavior * aut = behaviors.find(name)->second;
|
||||
std::unique_ptr<Behavior> aut = std::move(behaviors.find(name)->second);
|
||||
behaviors.erase(name);
|
||||
behaviors[newName] = aut;
|
||||
aut->SetName(newName);
|
||||
behaviors[newName] = std::move(aut);
|
||||
behaviors[newName]->SetName(newName);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -95,8 +86,9 @@ bool Object::HasBehaviorNamed(const gd::String & name) const
|
||||
|
||||
bool Object::AddBehavior(Behavior * behavior)
|
||||
{
|
||||
if (behavior && !HasBehaviorNamed(behavior->GetName())) {
|
||||
behaviors[behavior->GetName()] = behavior;
|
||||
if (behavior && !HasBehaviorNamed(behavior->GetName()))
|
||||
{
|
||||
behaviors[behavior->GetName()] = std::unique_ptr<Behavior>(behavior);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -112,14 +104,18 @@ std::map<gd::String, gd::PropertyDescriptor> Object::GetProperties(gd::Project &
|
||||
|
||||
gd::Behavior * Object::AddNewBehavior(gd::Project & project, const gd::String & type, const gd::String & name)
|
||||
{
|
||||
Behavior * behavior = project.GetCurrentPlatform().CreateBehavior(type);
|
||||
std::unique_ptr<gd::Behavior> behavior = project.GetCurrentPlatform().CreateBehavior(type);
|
||||
|
||||
if ( behavior != NULL ) {
|
||||
if ( behavior )
|
||||
{
|
||||
behavior->SetName(name);
|
||||
behaviors[behavior->GetName()] = behavior;
|
||||
behaviors[name] = std::move(behavior);
|
||||
return behaviors[name].get();
|
||||
}
|
||||
else
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return behavior;
|
||||
}
|
||||
|
||||
sf::Vector2f Object::GetInitialInstanceDefaultSize(gd::InitialInstance & instance, gd::Project & project, gd::Layout & layout) const
|
||||
@@ -170,12 +166,12 @@ void Object::UnserializeFrom(gd::Project & project, const SerializerElement & el
|
||||
.FindAndReplace("Automatism", "Behavior");
|
||||
gd::String autoName = behaviorElement.GetStringAttribute("name", "", "Name");
|
||||
|
||||
Behavior* behavior = project.CreateBehavior(autoType);
|
||||
if ( behavior != NULL )
|
||||
std::unique_ptr<Behavior> behavior = project.CreateBehavior(autoType);
|
||||
if ( behavior )
|
||||
{
|
||||
behavior->SetName(autoName);
|
||||
behavior->UnserializeFrom(behaviorElement);
|
||||
behaviors[behavior->GetName()] = behavior;
|
||||
behaviors[autoName] = std::move(behavior);
|
||||
}
|
||||
else
|
||||
std::cout << "WARNING: Unknown behavior " << autoType << std::endl;
|
||||
@@ -194,12 +190,12 @@ void Object::UnserializeFrom(gd::Project & project, const SerializerElement & el
|
||||
.FindAndReplace("Automatism", "Behavior"); //Compatibility with GD <= 4
|
||||
gd::String autoName = behaviorElement.GetStringAttribute("name");
|
||||
|
||||
Behavior* behavior = project.CreateBehavior(autoType);
|
||||
if ( behavior != NULL )
|
||||
std::unique_ptr<Behavior> behavior = project.CreateBehavior(autoType);
|
||||
if ( behavior )
|
||||
{
|
||||
behavior->SetName(autoName);
|
||||
behavior->UnserializeFrom(behaviorElement);
|
||||
behaviors[behavior->GetName()] = behavior;
|
||||
behaviors[autoName] = std::move(behavior);
|
||||
}
|
||||
else
|
||||
std::cout << "WARNING: Unknown behavior " << autoType << std::endl;
|
||||
@@ -233,8 +229,3 @@ void Object::SerializeTo(SerializerElement & element) const
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
gd::Object * CreateBaseObject(gd::String name)
|
||||
{
|
||||
return new gd::Object(name);
|
||||
}
|
||||
|
@@ -9,10 +9,10 @@
|
||||
#include "GDCore/String.h"
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include "GDCore/Project/Behavior.h"
|
||||
#include "GDCore/Project/VariablesContainer.h"
|
||||
#include <SFML/System/Vector2.hpp>
|
||||
namespace gd { class PropertyDescriptor; }
|
||||
namespace gd { class Behavior; }
|
||||
namespace gd { class Project; }
|
||||
namespace gd { class Layout; }
|
||||
namespace gd { class MainFrameWrapper; }
|
||||
@@ -262,7 +262,7 @@ public:
|
||||
/**
|
||||
* \brief Get a read-only access to the map containing the behaviors.
|
||||
*/
|
||||
const std::map<gd::String, gd::Behavior* > & GetAllBehaviors() const {return behaviors;};
|
||||
const std::map<gd::String, std::unique_ptr<gd::Behavior> > & GetAllBehaviors() const {return behaviors;};
|
||||
///@}
|
||||
|
||||
/** \name Variable management
|
||||
@@ -302,7 +302,7 @@ public:
|
||||
protected:
|
||||
gd::String name; ///< The full name of the object
|
||||
gd::String type; ///< Which type is the object. ( To test if we can do something reserved to some objects with it )
|
||||
std::map<gd::String, gd::Behavior* > behaviors; ///<Contains all behaviors of the object. Behaviors are the ownership of the object
|
||||
std::map<gd::String, std::unique_ptr<gd::Behavior> > behaviors; ///<Contains all behaviors of the object. Behaviors are the ownership of the object
|
||||
gd::VariablesContainer objectVariables; ///<List of the variables of the object
|
||||
|
||||
/**
|
||||
@@ -345,6 +345,4 @@ typedef std::vector < std::shared_ptr<gd::Object> > ObjList;
|
||||
*/
|
||||
typedef std::shared_ptr<gd::Object> ObjSPtr;
|
||||
|
||||
gd::Object * GD_CORE_API CreateBaseObject(gd::String name);
|
||||
|
||||
#endif // GDCORE_OBJECT_H
|
||||
|
@@ -121,17 +121,17 @@ std::shared_ptr<gd::Object> Project::CreateObject(const gd::String & type, const
|
||||
return std::shared_ptr<gd::Object>();
|
||||
}
|
||||
|
||||
gd::Behavior* Project::CreateBehavior(const gd::String & type, const gd::String & platformName)
|
||||
std::unique_ptr<gd::Behavior> Project::CreateBehavior(const gd::String & type, const gd::String & platformName)
|
||||
{
|
||||
for (std::size_t i = 0;i<platforms.size();++i)
|
||||
{
|
||||
if ( !platformName.empty() && platforms[i]->GetName() != platformName ) continue;
|
||||
|
||||
gd::Behavior* behavior = platforms[i]->CreateBehavior(type);
|
||||
std::unique_ptr<gd::Behavior> behavior = platforms[i]->CreateBehavior(type);
|
||||
if ( behavior ) return behavior;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<gd::BehaviorsSharedData> Project::CreateBehaviorSharedDatas(const gd::String & type, const gd::String & platformName)
|
||||
|
@@ -6,8 +6,9 @@
|
||||
|
||||
#ifndef GDCORE_PROJECT_H
|
||||
#define GDCORE_PROJECT_H
|
||||
#include "GDCore/String.h"
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include "GDCore/String.h"
|
||||
class wxPropertyGrid;
|
||||
class wxPropertyGridEvent;
|
||||
class TiXmlElement;
|
||||
@@ -243,7 +244,7 @@ public:
|
||||
* \param type The type of the behavior
|
||||
* \param platformName The name of the platform to be used. If empty, the first platform supporting the object is used.
|
||||
*/
|
||||
gd::Behavior* CreateBehavior(const gd::String & type, const gd::String & platformName = "");
|
||||
std::unique_ptr<gd::Behavior> CreateBehavior(const gd::String & type, const gd::String & platformName = "");
|
||||
|
||||
/**
|
||||
* Create behavior shared data of the given type.
|
||||
|
@@ -140,7 +140,10 @@ String String::FromLocale( const std::string &localizedString )
|
||||
#elif defined(EMSCRIPTEN)
|
||||
return FromUTF8(localizedString); //Assume UTF8 is the current locale
|
||||
#else
|
||||
if(std::locale("").name().find("UTF-8") != std::string::npos)
|
||||
if(std::locale("").name().find("utf-8") != std::string::npos ||
|
||||
std::locale("").name().find("UTF-8") != std::string::npos ||
|
||||
std::locale("").name().find("utf8") != std::string::npos ||
|
||||
std::locale("").name().find("UTF8") != std::string::npos)
|
||||
return FromUTF8(localizedString); //UTF8 is already the current locale
|
||||
else
|
||||
return FromSfString(sf::String(localizedString, std::locale(""))); //Use the current locale (std::locale("")) for conversion
|
||||
@@ -189,7 +192,10 @@ std::string String::ToLocale() const
|
||||
#elif defined(EMSCRIPTEN)
|
||||
return m_string;
|
||||
#else
|
||||
if(std::locale("").name().find("UTF-8") != std::string::npos)
|
||||
if(std::locale("").name().find("utf-8") != std::string::npos ||
|
||||
std::locale("").name().find("UTF-8") != std::string::npos ||
|
||||
std::locale("").name().find("utf8") != std::string::npos ||
|
||||
std::locale("").name().find("UTF8") != std::string::npos)
|
||||
return m_string; //UTF8 is already the current locale on Linux
|
||||
else
|
||||
return ToSfString().toAnsiString(std::locale("")); //Use the current locale for conversion
|
||||
@@ -440,7 +446,7 @@ String String::FindAndReplace(String search, String replacement, bool all) const
|
||||
do {
|
||||
pos = result.find(search, lastPos);
|
||||
lastPos = pos;
|
||||
if (pos != npos)
|
||||
if (pos != npos)
|
||||
{
|
||||
result.replace(pos, search.size(), replacement);
|
||||
lastPos += replacement.size();
|
||||
|
@@ -51,6 +51,11 @@ namespace gd
|
||||
}
|
||||
#else
|
||||
#warning System not supported for dynamic libraries loading
|
||||
Handle OpenLibrary(const char* path) {return nullptr;}
|
||||
void* GetSymbol(Handle library, const char* name) { return nullptr;}
|
||||
void CloseLibrary(Handle library) {}
|
||||
gd::String DynamicLibraryLastError() {return "";}
|
||||
Handle SetLibraryGlobal(const char* path) { return nullptr; }
|
||||
#endif
|
||||
|
||||
}
|
||||
|
@@ -4,8 +4,8 @@
|
||||
namespace AutoVersion{
|
||||
|
||||
//Date Version Types
|
||||
static const char GDCore_DATE[] = "17";
|
||||
static const char GDCore_MONTH[] = "01";
|
||||
static const char GDCore_DATE[] = "27";
|
||||
static const char GDCore_MONTH[] = "06";
|
||||
static const char GDCore_YEAR[] = "2016";
|
||||
|
||||
//Software Status
|
||||
@@ -15,12 +15,12 @@ namespace AutoVersion{
|
||||
//Standard Version Type
|
||||
static const long GDCore_MAJOR = 4;
|
||||
static const long GDCore_MINOR = 0;
|
||||
static const long GDCore_BUILD = 89;
|
||||
static const long GDCore_BUILD = 92;
|
||||
static const long GDCore_REVISION = 0;
|
||||
|
||||
//Miscellaneous Version Types
|
||||
#define GDCore_RC_FILEVERSION 4,0,89,0
|
||||
#define GDCore_RC_FILEVERSION_STRING "4, 0, 89, 0\0"
|
||||
static const char GDCore_FULLVERSION_STRING[] = "4.0.89.0";
|
||||
#define GDCore_RC_FILEVERSION 4,0,92,0
|
||||
#define GDCore_RC_FILEVERSION_STRING "4, 0, 92, 0\0"
|
||||
static const char GDCore_FULLVERSION_STRING[] = "4.0.92.0";
|
||||
}
|
||||
#endif //GDCORE_VERSION_H
|
||||
|
@@ -5,7 +5,6 @@
|
||||
<id_arg>0</id_arg>
|
||||
<style>wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxMAXIMIZE_BOX</style>
|
||||
<object class="wxAuiManager" variable="mgr" member="yes">
|
||||
<handler function="OnmgrPaneClose" entry="EVT_AUI_PANE_CLOSE" />
|
||||
<object class="AuiManagerItem">
|
||||
<object class="wxPanel" name="ID_PANEL1" variable="centerPanel" member="yes">
|
||||
<pos>107,155</pos>
|
||||
@@ -26,7 +25,7 @@
|
||||
<object class="wxAuiToolBar" name="ID_AUITOOLBAR1" variable="toolbar" member="yes">
|
||||
<object class="AuiToolBarItem">
|
||||
<object class="wxAuiToolBarItem" name="ID_MASKITEM" variable="maskItem_" member="yes">
|
||||
<bitmap code="gd::CommonBitmapProvider::GetInstance()->maskEdit16" />
|
||||
<bitmap code="gd::CommonBitmapProvider::Get()->maskEdit16" />
|
||||
<shorthelp>Edit the collision masks (hitbox)</shorthelp>
|
||||
<itemkind>Check</itemkind>
|
||||
<handler function="OnMaskEditClick" entry="EVT_TOOL" />
|
||||
@@ -35,7 +34,7 @@
|
||||
</object>
|
||||
<object class="AuiToolBarItem">
|
||||
<object class="wxAuiToolBarItem" name="ID_POINTSITEM" variable="pointsItem_" member="yes">
|
||||
<bitmap code="gd::CommonBitmapProvider::GetInstance()->pointEdit16" />
|
||||
<bitmap code="gd::CommonBitmapProvider::Get()->pointEdit16" />
|
||||
<shorthelp>Edit the image's point</shorthelp>
|
||||
<itemkind>Check</itemkind>
|
||||
<handler function="OnPointEditClick" entry="EVT_TOOL" />
|
||||
@@ -48,7 +47,7 @@
|
||||
</object>
|
||||
<object class="AuiToolBarItem">
|
||||
<object class="wxAuiToolBarItem" name="ID_AUITOOLBARITEM4" variable="AuiToolBarItem9" member="yes">
|
||||
<bitmap code="gd::SkinHelper::GetIcon("preview", 16)" />
|
||||
<bitmap code='gd::SkinHelper::GetIcon("preview", 16)' />
|
||||
<shorthelp>Preview</shorthelp>
|
||||
<handler function="OnPreviewClick" entry="EVT_TOOL" />
|
||||
</object>
|
||||
@@ -181,7 +180,7 @@
|
||||
<object class="wxAuiToolBar" name="ID_AUITOOLBAR4" variable="animationToolbar" member="yes">
|
||||
<object class="AuiToolBarItem">
|
||||
<object class="wxAuiToolBarItem" name="ID_AUITOOLBARITEM5" variable="AuiToolBarItem10" member="yes">
|
||||
<bitmap code="gd::SkinHelper::GetIcon("add", 16)" />
|
||||
<bitmap code='gd::SkinHelper::GetIcon("add", 16)' />
|
||||
<shorthelp>Add an animation</shorthelp>
|
||||
<handler function="OnAddAnimationSelected" entry="EVT_TOOL" />
|
||||
</object>
|
||||
@@ -189,7 +188,7 @@
|
||||
</object>
|
||||
<object class="AuiToolBarItem">
|
||||
<object class="wxAuiToolBarItem" name="ID_AUITOOLBARITEM8" variable="AuiToolBarItem11" member="yes">
|
||||
<bitmap code="gd::SkinHelper::GetIcon("remove", 16)" />
|
||||
<bitmap code='gd::SkinHelper::GetIcon("remove", 16)' />
|
||||
<shorthelp>Delete an animation</shorthelp>
|
||||
<handler function="OnDeleteAnimationSelected" entry="EVT_TOOL" />
|
||||
</object>
|
||||
@@ -337,7 +336,7 @@
|
||||
</object>
|
||||
<object class="AuiToolBarItem">
|
||||
<object class="wxAuiToolBarItem" name="ID_AUITOOLBARITEM7" variable="AuiToolBarItem7" member="yes">
|
||||
<bitmap code="gd::SkinHelper::GetIcon("remove", 16)" />
|
||||
<bitmap code='gd::SkinHelper::GetIcon("remove", 16)' />
|
||||
<handler function="OnDeleteMaskClick" entry="EVT_TOOL" />
|
||||
</object>
|
||||
<label>Item label</label>
|
||||
@@ -348,7 +347,7 @@
|
||||
</object>
|
||||
<object class="AuiToolBarItem">
|
||||
<object class="wxAuiToolBarItem" name="ID_AUITOOLBARITEM1" variable="AuiToolBarItem1" member="yes">
|
||||
<bitmap code="gd::CommonBitmapProvider::GetInstance()->defaultMask16" />
|
||||
<bitmap code="gd::CommonBitmapProvider::Get()->defaultMask16" />
|
||||
<shorthelp>Go back to default mask</shorthelp>
|
||||
<handler function="OnDefaultMaskClick" entry="EVT_TOOL" />
|
||||
</object>
|
||||
@@ -360,7 +359,7 @@
|
||||
</object>
|
||||
<object class="AuiToolBarItem">
|
||||
<object class="wxAuiToolBarItem" name="ID_MASKAPPLYWHOLEANIMITEM" variable="AuiToolBarItem8" member="yes">
|
||||
<bitmap code="gd::SkinHelper::GetIcon("copy", 16)" />
|
||||
<bitmap code='gd::SkinHelper::GetIcon("copy", 16)' />
|
||||
<itemkind>Check</itemkind>
|
||||
<handler function="OnPointEditClick" entry="EVT_TOOL" />
|
||||
</object>
|
||||
@@ -388,7 +387,7 @@
|
||||
</object>
|
||||
<object class="sizeritem">
|
||||
<object class="Custom" name="ID_TREELISTCTRL1" subclass="wxTreeListCtrl" variable="maskTree" member="yes">
|
||||
<creating_code>$(THIS) = new $(CLASS)($(PARENT),$(ID),$(POS),$(SIZE),$(STYLE),$(NAME));</creating_code>
|
||||
<creating_code>$(THIS) = new $(CLASS)($(PARENT),$(ID),$(POS),$(SIZE),0,$(NAME));</creating_code>
|
||||
<include_file>wx/treelist.h</include_file>
|
||||
<style></style>
|
||||
</object>
|
||||
@@ -422,14 +421,14 @@
|
||||
<object class="wxAuiToolBar" name="ID_AUITOOLBAR2" variable="pointToolbar" member="yes">
|
||||
<object class="AuiToolBarItem">
|
||||
<object class="wxAuiToolBarItem" name="ID_AUITOOLBARITEM3" variable="AuiToolBarItem3" member="yes">
|
||||
<bitmap code="gd::SkinHelper::GetIcon("add", 16)" />
|
||||
<bitmap code='gd::SkinHelper::GetIcon("add", 16)' />
|
||||
<handler function="OnAddPointClick" entry="EVT_TOOL" />
|
||||
</object>
|
||||
<label>Item label</label>
|
||||
</object>
|
||||
<object class="AuiToolBarItem">
|
||||
<object class="wxAuiToolBarItem" name="ID_DELETEPOINTITEM" variable="AuiToolBarItem5" member="yes">
|
||||
<bitmap code="gd::SkinHelper::GetIcon("remove", 16)" />
|
||||
<bitmap code='gd::SkinHelper::GetIcon("remove", 16)' />
|
||||
<handler function="OnDeletePointClick" entry="EVT_TOOL" />
|
||||
</object>
|
||||
<label>Item label</label>
|
||||
@@ -440,7 +439,7 @@
|
||||
</object>
|
||||
<object class="AuiToolBarItem">
|
||||
<object class="wxAuiToolBarItem" name="ID_POINTAPPLYWHOLEANIMITEM" variable="AuiToolBarItem4" member="yes">
|
||||
<bitmap code="gd::SkinHelper::GetIcon("copy", 16)" />
|
||||
<bitmap code='gd::SkinHelper::GetIcon("copy", 16)' />
|
||||
<shorthelp>Apply changes to the whole animation</shorthelp>
|
||||
<itemkind>Check</itemkind>
|
||||
</object>
|
||||
@@ -522,6 +521,38 @@
|
||||
<radio>1</radio>
|
||||
</object>
|
||||
</object>
|
||||
<object class="wxMenu" name="ID_MENUITEM15" variable="MenuItem13" member="yes">
|
||||
<label>Change the name</label>
|
||||
<object class="wxMenuItem" name="ID_MENUIDLENAME" variable="MenuItem15" member="yes">
|
||||
<label>Idle</label>
|
||||
<handler function="OnSetAnimationNameIdleSelected" entry="EVT_MENU" />
|
||||
</object>
|
||||
<object class="wxMenuItem" name="ID_MENUWALKNAME" variable="MenuItem14" member="yes">
|
||||
<label>Walk</label>
|
||||
<handler function="OnSetAnimationNameWalkSelected" entry="EVT_MENU" />
|
||||
</object>
|
||||
<object class="wxMenuItem" name="ID_MENURUNNAME" variable="MenuItem16" member="yes">
|
||||
<label>Run</label>
|
||||
<handler function="OnSetAnimationNameRunSelected" entry="EVT_MENU" />
|
||||
</object>
|
||||
<object class="wxMenuItem" name="ID_MENUJUMPNAME" variable="MenuItem17" member="yes">
|
||||
<label>Jump</label>
|
||||
<handler function="OnSetAnimationNameJumpSelected" entry="EVT_MENU" />
|
||||
</object>
|
||||
<object class="wxMenuItem" name="ID_MENUSHOOTNAME" variable="MenuItem18" member="yes">
|
||||
<label>Shoot</label>
|
||||
<handler function="OnSetAnimationNameShootSelected" entry="EVT_MENU" />
|
||||
</object>
|
||||
<object class="wxMenuItem" name="ID_MENUDEADNAME" variable="MenuItem20" member="yes">
|
||||
<label>Dead</label>
|
||||
<handler function="OnSetAnimationNameDeadSelected" entry="EVT_MENU" />
|
||||
</object>
|
||||
<object class="separator" />
|
||||
<object class="wxMenuItem" name="ID_MENUCUSTOMNAME" variable="MenuItem19" member="yes">
|
||||
<label>Custom name...</label>
|
||||
<handler function="OnSetCustomAnimationNameSelected" entry="EVT_MENU" />
|
||||
</object>
|
||||
</object>
|
||||
<object class="wxMenuItem" name="ID_MENUTIMEBETWEENFRAMES" variable="MenuItem7" member="yes">
|
||||
<label>Time between each image :</label>
|
||||
<handler function="OnTimeBetweenFramesSelected" entry="EVT_MENU" />
|
||||
@@ -534,13 +565,13 @@
|
||||
<object class="separator" />
|
||||
<object class="wxMenuItem" name="ID_MENUITEM1" variable="MenuItem1" member="yes">
|
||||
<label>Add an animation</label>
|
||||
<bitmap code="gd::SkinHelper::GetIcon("add", 16)" />
|
||||
<bitmap code='gd::SkinHelper::GetIcon("add", 16)' />
|
||||
<handler function="OnAddAnimationSelected" entry="EVT_MENU" />
|
||||
</object>
|
||||
<object class="separator" />
|
||||
<object class="wxMenuItem" name="ID_MENUITEM2" variable="deleteItem" member="yes">
|
||||
<label>Delete</label>
|
||||
<bitmap code="gd::SkinHelper::GetIcon("remove", 16)" />
|
||||
<bitmap code='gd::SkinHelper::GetIcon("remove", 16)' />
|
||||
<handler function="OnDeleteAnimationSelected" entry="EVT_MENU" />
|
||||
</object>
|
||||
<object class="wxMenuItem" name="ID_MENUITEM3" variable="MenuItem3" member="yes">
|
||||
@@ -550,7 +581,7 @@
|
||||
<object class="wxMenu" variable="imagesMenu" member="yes">
|
||||
<object class="wxMenuItem" name="ID_MENUITEM7" variable="MenuItem4" member="yes">
|
||||
<label>Add an image from a file</label>
|
||||
<bitmap code="gd::SkinHelper::GetIcon("add", 16)" />
|
||||
<bitmap code='gd::SkinHelper::GetIcon("add", 16)' />
|
||||
<handler function="OnAddImageFromFileSelected" entry="EVT_MENU" />
|
||||
</object>
|
||||
<object class="wxMenuItem" name="ID_MENUITEM11" variable="MenuItem9" member="yes">
|
||||
@@ -566,13 +597,13 @@
|
||||
<object class="wxMenuItem" name="ID_MENUITEM9" variable="moveLeftItem" member="yes">
|
||||
<label>Move left</label>
|
||||
<accel>J</accel>
|
||||
<bitmap code="gd::SkinHelper::GetIcon("left", 16)" />
|
||||
<bitmap code='gd::SkinHelper::GetIcon("left", 16)' />
|
||||
<handler function="OnMoveLeftSelected" entry="EVT_MENU" />
|
||||
</object>
|
||||
<object class="wxMenuItem" name="ID_MENUITEM10" variable="moveRightItem" member="yes">
|
||||
<label>Move right</label>
|
||||
<accel>K</accel>
|
||||
<bitmap code="gd::SkinHelper::GetIcon("right", 16)" />
|
||||
<bitmap code='gd::SkinHelper::GetIcon("right", 16)' />
|
||||
<handler function="OnMoveRightSelected" entry="EVT_MENU" />
|
||||
</object>
|
||||
</object>
|
||||
@@ -598,7 +629,7 @@
|
||||
<object class="wxMenu" variable="emptyImagesMenu" member="yes">
|
||||
<object class="wxMenuItem" name="ID_MENUITEM12" variable="MenuItem10" member="yes">
|
||||
<label>Add an image from a file</label>
|
||||
<bitmap code="gd::SkinHelper::GetIcon("add", 16)" />
|
||||
<bitmap code='gd::SkinHelper::GetIcon("add", 16)' />
|
||||
<handler function="OnAddImageFromFileSelected" entry="EVT_MENU" />
|
||||
</object>
|
||||
<object class="wxMenuItem" name="ID_MENUITEM13" variable="MenuItem11" member="yes">
|
||||
|
@@ -7,7 +7,7 @@ This project is released under the MIT License.
|
||||
|
||||
#include "AESTools.h"
|
||||
|
||||
#include "GDCpp/Tools/AES.h"
|
||||
#include "GDCpp/Runtime/Tools/AES.h"
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
|
@@ -8,7 +8,7 @@ This project is released under the MIT License.
|
||||
#ifndef AESACTIONS_H_INCLUDED
|
||||
#define AESACTIONS_H_INCLUDED
|
||||
|
||||
#include "GDCpp/String.h"
|
||||
#include "GDCpp/Runtime/String.h"
|
||||
|
||||
namespace GDpriv
|
||||
{
|
||||
|
@@ -6,14 +6,14 @@ This project is released under the MIT License.
|
||||
*/
|
||||
|
||||
#include <SFML/Graphics.hpp>
|
||||
#include "GDCpp/Project/Object.h"
|
||||
#include "GDCpp/Runtime/Project/Object.h"
|
||||
#include "GDCore/Tools/Localization.h"
|
||||
#include "GDCore/IDE/Project/ArbitraryResourceWorker.h"
|
||||
#include "GDCore/IDE/Dialogs/PropertyDescriptor.h"
|
||||
#include "GDCpp/ImageManager.h"
|
||||
#include "GDCpp/Serialization/SerializerElement.h"
|
||||
#include "GDCpp/Project/InitialInstance.h"
|
||||
#include "GDCpp/CommonTools.h"
|
||||
#include "GDCpp/Runtime/ImageManager.h"
|
||||
#include "GDCpp/Runtime/Serialization/SerializerElement.h"
|
||||
#include "GDCpp/Runtime/Project/InitialInstance.h"
|
||||
#include "GDCpp/Runtime/CommonTools.h"
|
||||
#include "AdMobObject.h"
|
||||
|
||||
#if defined(GD_IDE_ONLY) && !defined(GD_NO_WX_GUI)
|
||||
|
@@ -8,8 +8,8 @@ This project is released under the MIT License.
|
||||
#ifndef ADMOBOBJECT_H
|
||||
#define ADMOBOBJECT_H
|
||||
|
||||
#include "GDCpp/Project/Object.h"
|
||||
#include "GDCpp/String.h"
|
||||
#include "GDCpp/Runtime/Project/Object.h"
|
||||
#include "GDCpp/Runtime/String.h"
|
||||
namespace gd { class InitialInstance; }
|
||||
namespace gd { class Project; }
|
||||
namespace sf { class Texture; }
|
||||
|
@@ -18,11 +18,11 @@ void DeclareAdMobObjectExtension(gd::PlatformExtension & extension)
|
||||
"Florian Rival",
|
||||
"Open source (MIT License)");
|
||||
|
||||
gd::ObjectMetadata & obj = extension.AddObject("AdMob",
|
||||
gd::ObjectMetadata & obj = extension.AddObject<AdMobObject>(
|
||||
"AdMob",
|
||||
_("AdMob banner"),
|
||||
_("Display an ad banner or interstitial screen using AdMob"),
|
||||
"JsPlatform/Extensions/admobicon.png",
|
||||
&CreateAdMobObject);
|
||||
"JsPlatform/Extensions/admobicon.png");
|
||||
|
||||
obj.SetHelpUrl("/gdevelop/documentation/manual/built_admob");
|
||||
|
||||
|
@@ -10,8 +10,8 @@ This project is released under the MIT License.
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
|
||||
#include "GDCpp/CommonTools.h"
|
||||
#include "GDCpp/TinyXml/tinyxml.h"
|
||||
#include "GDCpp/Runtime/CommonTools.h"
|
||||
#include "GDCpp/Runtime/TinyXml/tinyxml.h"
|
||||
|
||||
namespace AdvancedXML
|
||||
{
|
||||
|
@@ -9,7 +9,7 @@ This project is released under the MIT License.
|
||||
#define ADVANCEDXMLREFMANAGER_H_INCLUDED
|
||||
|
||||
#include <map>
|
||||
#include "GDCpp/String.h"
|
||||
#include "GDCpp/Runtime/String.h"
|
||||
|
||||
class TiXmlNode;
|
||||
class RuntimeScene;
|
||||
|
@@ -6,8 +6,8 @@ This project is released under the MIT License.
|
||||
*/
|
||||
|
||||
#include "AdvancedXMLTools.h"
|
||||
#include "GDCpp/RuntimeScene.h"
|
||||
#include "GDCpp/TinyXml/tinyxml.h"
|
||||
#include "GDCpp/Runtime/RuntimeScene.h"
|
||||
#include "GDCpp/Runtime/TinyXml/tinyxml.h"
|
||||
#include "AdvancedXMLRefManager.h"
|
||||
|
||||
#include <iostream>
|
||||
|
@@ -9,7 +9,7 @@ This project is released under the MIT License.
|
||||
#define ADVANCEDXMLACTIONS_H_INCLUDED
|
||||
|
||||
#include <string>
|
||||
#include "GDCpp/String.h"
|
||||
#include "GDCpp/Runtime/String.h"
|
||||
|
||||
class RuntimeScene;
|
||||
|
||||
|
@@ -13,19 +13,19 @@ This project is released under the MIT License.
|
||||
#include "Box3DObject.h"
|
||||
#include <SFML/Graphics.hpp>
|
||||
#include <SFML/OpenGL.hpp>
|
||||
#include "GDCpp/Project/Project.h"
|
||||
#include "GDCpp/RuntimeScene.h"
|
||||
#include "GDCpp/RuntimeGame.h"
|
||||
#include "GDCpp/Project/Object.h"
|
||||
#include "GDCpp/ImageManager.h"
|
||||
#include "GDCpp/FontManager.h"
|
||||
#include "GDCpp/Project/InitialInstance.h"
|
||||
#include "GDCpp/Polygon2d.h"
|
||||
#include "GDCpp/Runtime/Project/Project.h"
|
||||
#include "GDCpp/Runtime/RuntimeScene.h"
|
||||
#include "GDCpp/Runtime/RuntimeGame.h"
|
||||
#include "GDCpp/Runtime/Project/Object.h"
|
||||
#include "GDCpp/Runtime/ImageManager.h"
|
||||
#include "GDCpp/Runtime/FontManager.h"
|
||||
#include "GDCpp/Runtime/Project/InitialInstance.h"
|
||||
#include "GDCpp/Runtime/Polygon2d.h"
|
||||
#include "GDCore/Serialization/SerializerElement.h"
|
||||
#include "GDCore/Tools/Localization.h"
|
||||
|
||||
#if defined(GD_IDE_ONLY)
|
||||
#include "GDCpp/CommonTools.h"
|
||||
#include "GDCpp/Runtime/CommonTools.h"
|
||||
#include "Box3DObjectEditor.h"
|
||||
#include "GDCore/IDE/Dialogs/MainFrameWrapper.h"
|
||||
#include "GDCore/IDE/Dialogs/PropertyDescriptor.h"
|
||||
@@ -196,14 +196,13 @@ bool RuntimeBox3DObject::Draw( sf::RenderTarget& window )
|
||||
return true;
|
||||
}
|
||||
|
||||
RuntimeBox3DObject::RuntimeBox3DObject(RuntimeScene & scene, const gd::Object & object) :
|
||||
RuntimeObject(scene, object),
|
||||
RuntimeBox3DObject::RuntimeBox3DObject(RuntimeScene & scene, const Box3DObject & box3DObject) :
|
||||
RuntimeObject(scene, box3DObject),
|
||||
zPosition(0),
|
||||
yaw(0),
|
||||
pitch(0),
|
||||
roll(0)
|
||||
{
|
||||
const Box3DObject & box3DObject = static_cast<const Box3DObject&>(object);
|
||||
|
||||
SetWidth(box3DObject.GetWidth());
|
||||
SetHeight(box3DObject.GetHeight());
|
||||
@@ -413,13 +412,3 @@ std::size_t RuntimeBox3DObject::GetNumberOfProperties() const
|
||||
return 7;
|
||||
}
|
||||
#endif
|
||||
|
||||
RuntimeObject * CreateRuntimeBox3DObject(RuntimeScene & scene, const gd::Object & object)
|
||||
{
|
||||
return new RuntimeBox3DObject(scene, object);
|
||||
}
|
||||
|
||||
gd::Object * CreateBox3DObject(gd::String name)
|
||||
{
|
||||
return new Box3DObject(name);
|
||||
}
|
||||
|
@@ -8,8 +8,8 @@ This project is released under the MIT License.
|
||||
#ifndef BOX3DOBJECT_H
|
||||
#define BOX3DOBJECT_H
|
||||
|
||||
#include "GDCpp/Project/Object.h"
|
||||
#include "GDCpp/RuntimeObject.h"
|
||||
#include "GDCpp/Runtime/Project/Object.h"
|
||||
#include "GDCpp/Runtime/RuntimeObject.h"
|
||||
#include <memory>
|
||||
class SFMLTextureWrapper;
|
||||
class RuntimeScene;
|
||||
@@ -85,7 +85,7 @@ class GD_EXTENSION_API RuntimeBox3DObject : public RuntimeObject
|
||||
{
|
||||
public :
|
||||
|
||||
RuntimeBox3DObject(RuntimeScene & scene, const gd::Object & object);
|
||||
RuntimeBox3DObject(RuntimeScene & scene, const Box3DObject & box3DObject);
|
||||
virtual ~RuntimeBox3DObject() {};
|
||||
virtual RuntimeObject * Clone() const { return new RuntimeBox3DObject(*this);}
|
||||
|
||||
@@ -142,8 +142,4 @@ private:
|
||||
std::shared_ptr<SFMLTextureWrapper> backTexture;
|
||||
};
|
||||
|
||||
RuntimeObject * CreateRuntimeBox3DObject(RuntimeScene & scene, const gd::Object & object);
|
||||
gd::Object * CreateBox3DObject(gd::String name);
|
||||
|
||||
#endif // BOX3DOBJECT_H
|
||||
|
||||
|
@@ -15,8 +15,8 @@ This project is released under the MIT License.
|
||||
#include <wx/string.h>
|
||||
//*)
|
||||
#include "GDCore/Tools/Log.h"
|
||||
#include "GDCpp/Project/Project.h"
|
||||
#include "GDCpp/CommonTools.h"
|
||||
#include "GDCpp/Runtime/Project/Project.h"
|
||||
#include "GDCpp/Runtime/CommonTools.h"
|
||||
#include "GDCore/IDE/Dialogs/MainFrameWrapper.h"
|
||||
#include "GDCore/IDE/wxTools/SkinHelper.h"
|
||||
#include "GDCore/IDE/Dialogs/ResourcesEditor.h"
|
||||
|
@@ -30,13 +30,14 @@ public:
|
||||
"Open source (MIT License)");
|
||||
|
||||
{
|
||||
gd::ObjectMetadata & obj = AddObject("Box3D",
|
||||
gd::ObjectMetadata & obj = AddObject<Box3DObject>(
|
||||
"Box3D",
|
||||
_("3D Box"),
|
||||
_("Displays a 3D Box"),
|
||||
"CppPlatform/Extensions/Box3Dicon.png",
|
||||
&CreateBox3DObject);
|
||||
"CppPlatform/Extensions/Box3Dicon.png");
|
||||
|
||||
AddRuntimeObject(obj, "RuntimeBox3DObject", &CreateRuntimeBox3DObject);
|
||||
AddRuntimeObject<Box3DObject, RuntimeBox3DObject>(
|
||||
obj, "RuntimeBox3DObject");
|
||||
|
||||
#if defined(GD_IDE_ONLY)
|
||||
|
||||
|
@@ -12,9 +12,9 @@ This project is released under the MIT License.
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
|
||||
#include "GDCpp/Project/Object.h"
|
||||
#include "GDCpp/RuntimeScene.h"
|
||||
#include "GDCpp/Project/Variable.h"
|
||||
#include "GDCpp/Runtime/Project/Object.h"
|
||||
#include "GDCpp/Runtime/RuntimeScene.h"
|
||||
#include "GDCpp/Runtime/Project/Variable.h"
|
||||
|
||||
//Windows build uses native windows-dialogs
|
||||
#if defined(WINDOWS)
|
||||
|
@@ -8,7 +8,7 @@ This project is released under the MIT License.
|
||||
#ifndef COMMONDIALOGS_H_INCLUDED
|
||||
#define COMMONDIALOGS_H_INCLUDED
|
||||
|
||||
#include "GDCpp/String.h"
|
||||
#include "GDCpp/Runtime/String.h"
|
||||
|
||||
class RuntimeScene;
|
||||
namespace gd { class Variable; }
|
||||
|
@@ -9,12 +9,12 @@ This project is released under the MIT License.
|
||||
#include <iostream>
|
||||
#include <SFML/Graphics.hpp>
|
||||
#include "DestroyOutsideBehavior.h"
|
||||
#include "GDCpp/Project/Layout.h"
|
||||
#include "GDCpp/RuntimeLayer.h"
|
||||
#include "GDCpp/Serialization/SerializerElement.h"
|
||||
#include "GDCpp/RuntimeScene.h"
|
||||
#include "GDCpp/RuntimeObject.h"
|
||||
#include "GDCpp/CommonTools.h"
|
||||
#include "GDCpp/Runtime/Project/Layout.h"
|
||||
#include "GDCpp/Runtime/RuntimeLayer.h"
|
||||
#include "GDCpp/Runtime/Serialization/SerializerElement.h"
|
||||
#include "GDCpp/Runtime/RuntimeScene.h"
|
||||
#include "GDCpp/Runtime/RuntimeObject.h"
|
||||
#include "GDCpp/Runtime/CommonTools.h"
|
||||
|
||||
DestroyOutsideBehavior::DestroyOutsideBehavior() :
|
||||
extraBorder(0)
|
||||
|
@@ -7,8 +7,8 @@ This project is released under the MIT License.
|
||||
|
||||
#ifndef DRAGGABLEBEHAVIOR_H
|
||||
#define DRAGGABLEBEHAVIOR_H
|
||||
#include "GDCpp/Project/Behavior.h"
|
||||
#include "GDCpp/Project/Object.h"
|
||||
#include "GDCpp/Runtime/Project/Behavior.h"
|
||||
#include "GDCpp/Runtime/Project/Object.h"
|
||||
#include <SFML/System/Vector2.hpp>
|
||||
#include <map>
|
||||
class RuntimeScene;
|
||||
|
@@ -67,26 +67,30 @@ void DeclareDestroyOutsideBehaviorExtension(gd::PlatformExtension & extension)
|
||||
/**
|
||||
* \brief This class declares information about the extension.
|
||||
*/
|
||||
class Extension : public ExtensionBase
|
||||
class DestroyOutsideBehaviorCppExtension : public ExtensionBase
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* Constructor of an extension declares everything the extension contains: objects, actions, conditions and expressions.
|
||||
*/
|
||||
Extension()
|
||||
DestroyOutsideBehaviorCppExtension()
|
||||
{
|
||||
DeclareDestroyOutsideBehaviorExtension(*this);
|
||||
GD_COMPLETE_EXTENSION_COMPILATION_INFORMATION();
|
||||
};
|
||||
};
|
||||
|
||||
#if !defined(EMSCRIPTEN)
|
||||
#if defined(ANDROID)
|
||||
extern "C" ExtensionBase * CreateGDCppDestroyOutsideBehaviorExtension() {
|
||||
return new DestroyOutsideBehaviorCppExtension;
|
||||
}
|
||||
#elif !defined(EMSCRIPTEN)
|
||||
/**
|
||||
* Used by GDevelop to create the extension class
|
||||
* -- Do not need to be modified. --
|
||||
*/
|
||||
extern "C" ExtensionBase * GD_EXTENSION_API CreateGDExtension() {
|
||||
return new Extension;
|
||||
return new DestroyOutsideBehaviorCppExtension;
|
||||
}
|
||||
#endif
|
||||
|
@@ -9,12 +9,12 @@ This project is released under the MIT License.
|
||||
#include <iostream>
|
||||
#include <SFML/Graphics.hpp>
|
||||
#include "DraggableBehavior.h"
|
||||
#include "GDCpp/Project/Layout.h"
|
||||
#include "GDCpp/RuntimeLayer.h"
|
||||
#include "GDCpp/Serialization/SerializerElement.h"
|
||||
#include "GDCpp/RuntimeScene.h"
|
||||
#include "GDCpp/RuntimeObject.h"
|
||||
#include "GDCpp/CommonTools.h"
|
||||
#include "GDCpp/Runtime/Project/Layout.h"
|
||||
#include "GDCpp/Runtime/RuntimeLayer.h"
|
||||
#include "GDCpp/Runtime/Serialization/SerializerElement.h"
|
||||
#include "GDCpp/Runtime/RuntimeScene.h"
|
||||
#include "GDCpp/Runtime/RuntimeObject.h"
|
||||
#include "GDCpp/Runtime/CommonTools.h"
|
||||
|
||||
bool DraggableBehavior::somethingDragged = false;
|
||||
bool DraggableBehavior::leftPressedLastFrame = false;
|
||||
|
@@ -7,8 +7,8 @@ This project is released under the MIT License.
|
||||
|
||||
#ifndef DRAGGABLEBEHAVIOR_H
|
||||
#define DRAGGABLEBEHAVIOR_H
|
||||
#include "GDCpp/Project/Behavior.h"
|
||||
#include "GDCpp/Project/Object.h"
|
||||
#include "GDCpp/Runtime/Project/Behavior.h"
|
||||
#include "GDCpp/Runtime/Project/Object.h"
|
||||
#include <SFML/System/Vector2.hpp>
|
||||
#include <map>
|
||||
class RuntimeScene;
|
||||
|
@@ -1,7 +1,7 @@
|
||||
|
||||
describe('gdjs.DraggableRuntimeBehavior', function() {
|
||||
var runtimeGame = new gdjs.RuntimeGame({variables: [], properties: {windowWidth: 800, windowHeight: 600}});
|
||||
var runtimeScene = new gdjs.RuntimeScene(runtimeGame, null);
|
||||
var runtimeScene = new gdjs.RuntimeScene(runtimeGame);
|
||||
runtimeScene.loadFromScene({
|
||||
layers:[{name:"", visibility: true}],
|
||||
variables: [],
|
||||
|
@@ -12,9 +12,9 @@ This project is released under the MIT License.
|
||||
#include "GDCore/Events/CodeGeneration/EventsCodeGenerator.h"
|
||||
#include "GDCore/Events/Tools/EventsCodeNameMangler.h"
|
||||
#include "GDCpp/Extensions/CppPlatform.h"
|
||||
#include "GDCpp/Project/Project.h"
|
||||
#include "GDCpp/Project/Layout.h"
|
||||
#include "GDCpp/CommonTools.h"
|
||||
#include "GDCpp/Runtime/Project/Project.h"
|
||||
#include "GDCpp/Runtime/Project/Layout.h"
|
||||
#include "GDCpp/Runtime/CommonTools.h"
|
||||
#if defined(GD_IDE_ONLY)
|
||||
#include "GDCore/Events/Parsers/ExpressionParser.h"
|
||||
#include "GDCore/Events/Instruction.h"
|
||||
|
@@ -9,14 +9,14 @@ This project is released under the MIT License.
|
||||
|
||||
#include "GDCore/Events/Serialization.h"
|
||||
#include "FunctionEvent.h"
|
||||
#include "GDCpp/RuntimeScene.h"
|
||||
#include "GDCpp/CommonTools.h"
|
||||
#include "GDCpp/Runtime/RuntimeScene.h"
|
||||
#include "GDCpp/Runtime/CommonTools.h"
|
||||
#include "GDCore/Events/Builtin/LinkEvent.h"
|
||||
#include "GDCore/Events/CodeGeneration/EventsCodeGenerationContext.h"
|
||||
#include "GDCore/Events/CodeGeneration/EventsCodeGenerator.h"
|
||||
#include "GDCore/Events/Tools/EventsCodeNameMangler.h"
|
||||
#include "GDCore/Serialization/SerializerElement.h"
|
||||
#include "GDCpp/TinyXml/tinyxml.h"
|
||||
#include "GDCpp/Runtime/TinyXml/tinyxml.h"
|
||||
#include "GDCore/IDE/Dialogs/EventsEditor/EventsRenderingHelper.h"
|
||||
#include "GDCore/IDE/Dialogs/EventsEditor/EventsEditorItemsAreas.h"
|
||||
#include "GDCore/IDE/Dialogs/EventsEditor/EventsEditorSelection.h"
|
||||
|
@@ -11,8 +11,8 @@ This project is released under the MIT License.
|
||||
#define FUNCTIONEVENT_H
|
||||
#include "GDCore/Events/EventsList.h"
|
||||
#include "GDCore/Events/Event.h"
|
||||
#include "GDCpp/CommonTools.h"
|
||||
#include "GDCpp/SceneNameMangler.h"
|
||||
#include "GDCpp/Runtime/CommonTools.h"
|
||||
#include "GDCpp/Runtime/SceneNameMangler.h"
|
||||
class RuntimeScene;
|
||||
namespace gd { class Instruction; }
|
||||
namespace gd { class SerializerElement; }
|
||||
|
@@ -10,9 +10,9 @@
|
||||
#include <wx/string.h>
|
||||
//*)
|
||||
#include "GDCore/IDE/Dialogs/ChooseObjectDialog.h"
|
||||
#include "GDCpp/CommonTools.h"
|
||||
#include "GDCpp/Project/Project.h"
|
||||
#include "GDCpp/Project/Layout.h"
|
||||
#include "GDCpp/Runtime/CommonTools.h"
|
||||
#include "GDCpp/Runtime/Project/Project.h"
|
||||
#include "GDCpp/Runtime/Project/Layout.h"
|
||||
#include "FunctionEvent.h"
|
||||
|
||||
//(*IdInit(FunctionEventEditorDlg)
|
||||
|
@@ -5,7 +5,7 @@ Copyright (c) 2008-2016 Florian Rival (Florian.Rival@gmail.com)
|
||||
This project is released under the MIT License.
|
||||
*/
|
||||
#include "FunctionTools.h"
|
||||
#include "GDCpp/profile.h"
|
||||
#include "GDCpp/Runtime/profile.h"
|
||||
|
||||
namespace GDpriv
|
||||
{
|
||||
|
@@ -9,7 +9,7 @@ This project is released under the MIT License.
|
||||
#define FUNCTIONTOOLS_H
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "GDCpp/String.h"
|
||||
#include "GDCpp/Runtime/String.h"
|
||||
|
||||
namespace GDpriv
|
||||
{
|
||||
|
@@ -30,13 +30,14 @@ public:
|
||||
"Florian Rival",
|
||||
"Open source (MIT License)");
|
||||
|
||||
gd::ObjectMetadata & obj = AddObject("Light",
|
||||
gd::ObjectMetadata & obj = AddObject<LightObject>(
|
||||
"Light",
|
||||
_("Light"),
|
||||
_("Emits light that can be stopped by objects"),
|
||||
"CppPlatform/Extensions/lightIcon32.png",
|
||||
&CreateLightObject);
|
||||
"CppPlatform/Extensions/lightIcon32.png");
|
||||
|
||||
AddRuntimeObject(obj, "RuntimeLightObject", CreateRuntimeLightObject);
|
||||
AddRuntimeObject<LightObject, RuntimeLightObject>(
|
||||
obj, "RuntimeLightObject");
|
||||
|
||||
#if defined(GD_IDE_ONLY)
|
||||
LightObject::LoadEdittimeIcon();
|
||||
|
@@ -10,20 +10,20 @@ This project is released under the MIT License.
|
||||
#endif
|
||||
#include <SFML/Graphics.hpp>
|
||||
#include "GDCore/Tools/Localization.h"
|
||||
#include "GDCpp/Project/Object.h"
|
||||
#include "GDCpp/RuntimeScene.h"
|
||||
#include "GDCpp/ImageManager.h"
|
||||
#include "GDCpp/Serialization/SerializerElement.h"
|
||||
#include "GDCpp/FontManager.h"
|
||||
#include "GDCpp/Project/InitialInstance.h"
|
||||
#include "GDCpp/Polygon2d.h"
|
||||
#include "GDCpp/CommonTools.h"
|
||||
#include "GDCpp/Runtime/Project/Object.h"
|
||||
#include "GDCpp/Runtime/RuntimeScene.h"
|
||||
#include "GDCpp/Runtime/ImageManager.h"
|
||||
#include "GDCpp/Runtime/Serialization/SerializerElement.h"
|
||||
#include "GDCpp/Runtime/FontManager.h"
|
||||
#include "GDCpp/Runtime/Project/InitialInstance.h"
|
||||
#include "GDCpp/Runtime/Polygon2d.h"
|
||||
#include "GDCpp/Runtime/CommonTools.h"
|
||||
#include "GDCore/Tools/Localization.h"
|
||||
#include "LightObject.h"
|
||||
#include "LightManager.h"
|
||||
|
||||
#if defined(GD_IDE_ONLY)
|
||||
#include "GDCpp/CommonTools.h"
|
||||
#include "GDCpp/Runtime/CommonTools.h"
|
||||
#include "GDCore/IDE/Project/ArbitraryResourceWorker.h"
|
||||
#include "GDCore/IDE/Dialogs/MainFrameWrapper.h"
|
||||
#include "LightObjectEditor.h"
|
||||
@@ -89,12 +89,10 @@ void LightObject::DoSerializeTo(gd::SerializerElement & element) const
|
||||
}
|
||||
#endif
|
||||
|
||||
RuntimeLightObject::RuntimeLightObject(RuntimeScene & scene, const gd::Object & object) :
|
||||
RuntimeObject(scene, object),
|
||||
RuntimeLightObject::RuntimeLightObject(RuntimeScene & scene, const LightObject & lightObject) :
|
||||
RuntimeObject(scene, lightObject),
|
||||
angle(0)
|
||||
{
|
||||
const LightObject & lightObject = static_cast<const LightObject&>(object);
|
||||
|
||||
globalLight = lightObject.IsGlobalLight();
|
||||
globalLightColor = lightObject.GetGlobalColor();
|
||||
light = Light(sf::Vector2f(GetX(),GetY()), lightObject.GetIntensity(), lightObject.GetRadius(), lightObject.GetQuality(), lightObject.GetColor());
|
||||
@@ -297,13 +295,3 @@ void RuntimeLightObject::SetGlobalColor(const gd::String & colorStr)
|
||||
|
||||
SetGlobalColor(sf::Color( colors[0].To<int>(),colors[1].To<int>(),colors[2].To<int>() ));
|
||||
}
|
||||
|
||||
RuntimeObject * CreateRuntimeLightObject(RuntimeScene & scene, const gd::Object & object)
|
||||
{
|
||||
return new RuntimeLightObject(scene, object);
|
||||
}
|
||||
|
||||
gd::Object * CreateLightObject(gd::String name)
|
||||
{
|
||||
return new LightObject(name);
|
||||
}
|
||||
|
@@ -8,8 +8,8 @@ This project is released under the MIT License.
|
||||
#ifndef LightObject_H
|
||||
#define LightObject_H
|
||||
|
||||
#include "GDCpp/Project/Object.h"
|
||||
#include "GDCpp/RuntimeObject.h"
|
||||
#include "GDCpp/Runtime/Project/Object.h"
|
||||
#include "GDCpp/Runtime/RuntimeObject.h"
|
||||
|
||||
#include <memory>
|
||||
#include <SFML/Graphics/Color.hpp>
|
||||
@@ -92,7 +92,7 @@ class GD_EXTENSION_API RuntimeLightObject : public RuntimeObject
|
||||
{
|
||||
public :
|
||||
|
||||
RuntimeLightObject(RuntimeScene & scene, const gd::Object & object);
|
||||
RuntimeLightObject(RuntimeScene & scene, const LightObject & lightObject);
|
||||
virtual ~RuntimeLightObject() {};
|
||||
virtual RuntimeObject * Clone() const { return new RuntimeLightObject(*this);}
|
||||
|
||||
@@ -154,8 +154,4 @@ private:
|
||||
sf::Color globalLightColor;
|
||||
};
|
||||
|
||||
gd::Object * CreateLightObject(gd::String name);
|
||||
RuntimeObject * CreateRuntimeLightObject(RuntimeScene & scene, const gd::Object & object);
|
||||
|
||||
#endif // LightObject_H
|
||||
|
||||
|
@@ -16,8 +16,8 @@ This project is released under the MIT License.
|
||||
#include <wx/colordlg.h>
|
||||
#include <wx/filedlg.h>
|
||||
#include "GDCore/IDE/Dialogs/MainFrameWrapper.h"
|
||||
#include "GDCpp/CommonTools.h"
|
||||
#include "GDCpp/Project/Project.h"
|
||||
#include "GDCpp/Runtime/CommonTools.h"
|
||||
#include "GDCpp/Runtime/Project/Project.h"
|
||||
#include "LightObject.h"
|
||||
#include "SceneLightObstacleDatas.h"
|
||||
|
||||
|
@@ -8,8 +8,8 @@ This project is released under the MIT License.
|
||||
#include "LightObstacleBehavior.h"
|
||||
#include "LightObstacleBehaviorEditor.h"
|
||||
#include "LightObject.h"
|
||||
#include "GDCpp/Project/Layout.h"
|
||||
#include "GDCpp/Serialization/SerializerElement.h"
|
||||
#include "GDCpp/Runtime/Project/Layout.h"
|
||||
#include "GDCpp/Runtime/Serialization/SerializerElement.h"
|
||||
#include <SFML/Graphics.hpp>
|
||||
#include <iostream>
|
||||
#include <cmath>
|
||||
|
@@ -27,13 +27,13 @@ freely, subject to the following restrictions:
|
||||
#ifndef LIGHTOBSTACLEBEHAVIOR_H
|
||||
#define LIGHTOBSTACLEBEHAVIOR_H
|
||||
|
||||
#include "GDCpp/Project/Behavior.h"
|
||||
#include "GDCpp/RuntimeObject.h"
|
||||
#include "GDCpp/Runtime/Project/Behavior.h"
|
||||
#include "GDCpp/Runtime/RuntimeObject.h"
|
||||
#include "Light.h"
|
||||
#include "LightManager.h"
|
||||
#include <map>
|
||||
#include <set>
|
||||
#include "GDCpp/RuntimeScene.h"
|
||||
#include "GDCpp/Runtime/RuntimeScene.h"
|
||||
namespace gd { class SerializerElement; }
|
||||
namespace gd { class Layout; }
|
||||
class LightObstacleBehaviorEditor;
|
||||
|
@@ -12,11 +12,11 @@ This project is released under the MIT License.
|
||||
#include <wx/intl.h>
|
||||
#include <wx/string.h>
|
||||
//*)
|
||||
#include "GDCpp/Project/Project.h"
|
||||
#include "GDCpp/Runtime/Project/Project.h"
|
||||
#include "LightObstacleBehavior.h"
|
||||
#include "GDCore/IDE/Dialogs/MainFrameWrapper.h"
|
||||
#include "GDCpp/CommonTools.h"
|
||||
#include "GDCpp/Project/Layout.h"
|
||||
#include "GDCpp/Runtime/CommonTools.h"
|
||||
#include "GDCpp/Runtime/Project/Layout.h"
|
||||
|
||||
//(*IdInit(LightObstacleBehaviorEditor)
|
||||
//*)
|
||||
|
@@ -8,7 +8,7 @@ This project is released under the MIT License.
|
||||
#ifndef RUNTIMESCENELIGHTOBSTACLEDATAS_H
|
||||
#define RUNTIMESCENELIGHTOBSTACLEDATAS_H
|
||||
#include <vector>
|
||||
#include "GDCpp/BehaviorsRuntimeSharedData.h"
|
||||
#include "GDCpp/Runtime/BehaviorsRuntimeSharedData.h"
|
||||
class SceneLightObstacleDatas;
|
||||
class LightObstacleBehavior;
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user