mirror of
https://github.com/Heretek-AI/GDevelop.git
synced 2026-07-25 04:15:49 -04:00
66 lines
2.2 KiB
C++
66 lines
2.2 KiB
C++
/**
|
|
|
|
GDevelop - Draggable Automatism Extension
|
|
Copyright (c) 2014 Florian Rival (Florian.Rival@gmail.com)
|
|
This project is released under the MIT License.
|
|
*/
|
|
#if defined(GD_IDE_ONLY)
|
|
#include "GDCore/PlatformDefinition/PlatformExtension.h"
|
|
#include "GDCore/Tools/Localization.h"
|
|
#include "GDCore/Tools/Version.h"
|
|
#include <boost/version.hpp>
|
|
#include <iostream>
|
|
|
|
void DeclareDraggableAutomatismExtension(gd::PlatformExtension & extension);
|
|
|
|
/**
|
|
* \brief This class declares information about the JS extension.
|
|
*/
|
|
class DraggableAutomatismJsExtension : public gd::PlatformExtension
|
|
{
|
|
public:
|
|
|
|
/**
|
|
* \brief Constructor of an extension declares everything the extension contains : Objects, actions, conditions and expressions.
|
|
*/
|
|
DraggableAutomatismJsExtension()
|
|
{
|
|
SetExtensionInformation("DraggableAutomatism",
|
|
_("Draggable Automatism"),
|
|
_("Automatism allowing to move objects with the mouse"),
|
|
"Florian Rival",
|
|
"Open source (MIT License)");
|
|
|
|
DeclareDraggableAutomatismExtension(*this);
|
|
|
|
GetAutomatismMetadata("DraggableAutomatism::Draggable").SetIncludeFile("DraggableAutomatism/draggableruntimeautomatism.js");
|
|
GetAllConditionsForAutomatism("DraggableAutomatism::Draggable")["DraggableAutomatism::Dragged"].codeExtraInformation
|
|
.SetFunctionName("isDragged").SetIncludeFile("DraggableAutomatism/draggableruntimeautomatism.js");
|
|
GD_COMPLETE_EXTENSION_COMPILATION_INFORMATION();
|
|
};
|
|
virtual ~DraggableAutomatismJsExtension() {};
|
|
};
|
|
|
|
#if defined(EMSCRIPTEN)
|
|
extern "C" gd::PlatformExtension * CreateGDJSDraggableAutomatismExtension() {
|
|
return new DraggableAutomatismJsExtension;
|
|
}
|
|
#else
|
|
/**
|
|
* Used by GDevelop to create the extension class
|
|
* -- Do not need to be modified. --
|
|
*/
|
|
extern "C" gd::PlatformExtension * GD_EXTENSION_API CreateGDJSExtension() {
|
|
return new DraggableAutomatismJsExtension;
|
|
}
|
|
|
|
/**
|
|
* Used by GDevelop to destroy the extension class
|
|
* -- Do not need to be modified. --
|
|
*/
|
|
extern "C" void GD_EXTENSION_API DestroyGDJSExtension(gd::PlatformExtension * p) {
|
|
delete p;
|
|
}
|
|
#endif
|
|
#endif
|