Files
GDevelop/Extensions/TextEntryObject/Extension.cpp
T
Victor Levasseur 0049b5c6fa Merge remote-tracking branch 'upstream/master' into utf8-tr-macro
Conflicts:
	Core/GDCore/BuiltinExtensions/SpriteExtension/SpriteExtension.cpp
	Core/GDCore/Events/ExpressionMetadata.h
	Extensions/Box3DObject/Extension.cpp
	Extensions/DraggableAutomatism/Extension.cpp
	Extensions/Light/Extension.cpp
	Extensions/Network/Extension.cpp
	Extensions/PanelSpriteObject/Extension.cpp
	Extensions/ParticleSystem/ExtensionSubDeclaration1.cpp
	Extensions/ParticleSystem/ExtensionSubDeclaration3.cpp
	Extensions/PathAutomatism/Extension.cpp
	Extensions/PathfindingAutomatism/Extension.cpp
	Extensions/PhysicsAutomatism/Extension.cpp
	Extensions/PlatformAutomatism/Extension.cpp
	Extensions/PrimitiveDrawing/Extension.cpp
	Extensions/SoundObject/Extension.cpp
	Extensions/TextEntryObject/Extension.cpp
	Extensions/TextObject/Extension.cpp
	Extensions/TileMapObject/Extension.cpp
	Extensions/TiledSpriteObject/Extension.cpp
	Extensions/TopDownMovementAutomatism/Extension.cpp
	GDCpp/GDCpp/DocMainPage.h
	GDCpp/docs/doxyfile
	GDJS/GDJS/BuiltinExtensions/AudioExtension.cpp
	GDJS/GDJS/BuiltinExtensions/BaseObjectExtension.cpp
	GDJS/GDJS/BuiltinExtensions/CameraExtension.cpp
	GDJS/GDJS/BuiltinExtensions/FileExtension.cpp
	GDJS/GDJS/BuiltinExtensions/JoystickExtension.cpp
	GDJS/GDJS/BuiltinExtensions/NetworkExtension.cpp
	GDJS/GDJS/BuiltinExtensions/SceneExtension.cpp
	GDJS/GDJS/BuiltinExtensions/SpriteExtension.cpp
	scripts/ExtractTranslations.sh
2015-04-28 20:03:27 +02:00

116 lines
4.5 KiB
C++

/**
GDevelop - TextEntry Object Extension
Copyright (c) 2011-2015 Florian Rival (Florian.Rival@gmail.com)
This project is released under the MIT License.
*/
#include "GDCpp/ExtensionBase.h"
#include "GDCore/Tools/Version.h"
#include "TextEntryObject.h"
void DeclareTextEntryObjectExtension(gd::PlatformExtension & extension)
{
extension.SetExtensionInformation("TextEntryObject",
GD_T("Text entry object"),
GD_T("Extension allowing to use an object capturing text entered with keyboard."),
"Florian Rival",
"Open source (MIT License)");
gd::ObjectMetadata & obj = extension.AddObject("TextEntry",
GD_T("Text entry"),
GD_T("Invisible object used to get the text entered with the keyboard"),
"CppPlatform/Extensions/textentry.png",
&CreateTextEntryObject);
#if defined(GD_IDE_ONLY)
TextEntryObject::LoadEdittimeIcon();
obj.SetIncludeFile("TextEntryObject/TextEntryObject.h");
obj.AddAction("String",
GD_T("Text in memory"),
GD_T("Modify text in memory of the object"),
GD_T("Do _PARAM1__PARAM2_ to the text in memory of _PARAM0_"),
"",
"CppPlatform/Extensions/textentry24.png",
"CppPlatform/Extensions/textentryicon.png")
.AddParameter("object", GD_T("Object"), "TextEntry", false)
.AddParameter("operator", GD_T("Modification's sign"))
.AddParameter("string", GD_T("Text"))
.SetFunctionName("SetString").SetManipulatedType("string").SetGetter("GetString").SetIncludeFile("TextEntryObject/TextEntryObject.h");
obj.AddCondition("String",
GD_T("Text in memory"),
GD_T("Test the text of a Text Entry object."),
GD_T("The text of _PARAM0_ is _PARAM1__PARAM2_"),
"",
"CppPlatform/Extensions/textentry24.png",
"CppPlatform/Extensions/textentryicon.png")
.AddParameter("object", GD_T("Object"), "TextEntry", false)
.AddParameter("relationalOperator", GD_T("Sign of the test"))
.AddParameter("string", GD_T("Text to test"))
.SetFunctionName("GetString").SetManipulatedType("string").SetIncludeFile("TextEntryObject/TextEntryObject.h");
obj.AddAction("Activate",
GD_T("De/activate capturing text input"),
GD_T("Activate or desactivate the capture of text entered with keyboard."),
GD_T("Activate capture by _PARAM0_ of the text entered with keyboard: _PARAM1_"),
GD_T("Setup"),
"CppPlatform/Extensions/textentry24.png",
"CppPlatform/Extensions/textentryicon.png")
.AddParameter("object", GD_T("Object"), "TextEntry", false)
.AddParameter("yesorno", GD_T("Activate"))
.SetFunctionName("Activate").SetIncludeFile("TextObject/TextObject.h");
obj.AddCondition("Activated",
GD_T("Text input"),
GD_T("Test if the object capture text entered with keyboard."),
GD_T("_PARAM0_ capture the text entered with keyboard"),
GD_T("Setup"),
"CppPlatform/Extensions/textentry24.png",
"CppPlatform/Extensions/textentryicon.png")
.AddParameter("object", GD_T("Object"), "TextEntry", false)
.SetFunctionName("IsActivated").SetIncludeFile("TextObject/TextObject.h");
obj.AddStrExpression("String", GD_T("Text entered with keyboard"), GD_T("Text entered with keyboard"), GD_T("Text entered with keyboard"), "res/texteicon.png")
.AddParameter("object", GD_T("Object"), "TextEntry", false)
.SetFunctionName("GetString").SetIncludeFile("TextObject/TextObject.h");
#endif
}
/**
* \brief This class declares information about the extension.
*/
class Extension : public ExtensionBase
{
public:
/**
* Constructor of an extension declares everything the extension contains: objects, actions, conditions and expressions.
*/
Extension()
{
DeclareTextEntryObjectExtension(*this);
AddRuntimeObject(GetObjectMetadata("TextEntryObject::TextEntry"),
"RuntimeTextEntryObject", CreateRuntimeTextEntryObject);
GD_COMPLETE_EXTENSION_COMPILATION_INFORMATION();
};
};
#if !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;
}
#endif