/** 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