forked from 4ian/GDevelop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExtension.cpp
More file actions
97 lines (84 loc) · 3.69 KB
/
Extension.cpp
File metadata and controls
97 lines (84 loc) · 3.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/**
GDevelop - TextEntry Object Extension
Copyright (c) 2011-2016 Florian Rival (Florian.Rival@gmail.com)
This project is released under the MIT License.
*/
#include "GDCore/Extensions/PlatformExtension.h"
#include "GDCore/Tools/Localization.h"
#include "TextEntryObject.h"
// Deprecated extension - so no translation markers and the object is hidden in the editor.
void DeclareTextEntryObjectExtension(gd::PlatformExtension& extension) {
extension
.SetExtensionInformation(
"TextEntryObject",
"Text entry object",
"Deprecated object that can be used to capture the text "
"entered with a keyboard by a player.",
"Florian Rival",
"Open source (MIT License)")
.SetShortDescription("Deprecated. Invisible object capturing keyboard text input into a string.")
.SetCategory("User interface")
.SetExtensionHelpPath("/objects/text_entry");
gd::ObjectMetadata& obj =
extension
.AddObject<TextEntryObject>("TextEntry",
"Text entry",
"Invisible object used to get the text "
"entered with the keyboard.",
"CppPlatform/Extensions/textentry.png")
.SetCategory("User interface")
.SetHidden(); // Deprecated
obj.AddAction("String",
"Text in memory",
"Modify text in memory of the object",
"the text in memory",
"",
"CppPlatform/Extensions/textentry24.png",
"CppPlatform/Extensions/textentryicon.png")
.AddParameter("object", "Object", "TextEntry")
.UseStandardOperatorParameters(
"string",
gd::ParameterOptions::MakeNewOptions().SetDescription("Text"))
.SetFunctionName("SetString")
.SetGetter("GetString");
obj.AddCondition("String",
"Text in memory",
"Test the text of a Text Entry object.",
"the text",
"",
"CppPlatform/Extensions/textentry24.png",
"CppPlatform/Extensions/textentryicon.png")
.AddParameter("object", "Object", "TextEntry")
.UseStandardRelationalOperatorParameters(
"string",
gd::ParameterOptions::MakeNewOptions().SetDescription("Text to compare to"))
.SetFunctionName("GetString");
obj.AddAction(
"Activate",
"De/activate capturing text input",
"Activate or deactivate the capture of text entered with keyboard.",
"Activate capture by _PARAM0_ of the text entered with keyboard: "
"_PARAM1_",
"Setup",
"CppPlatform/Extensions/textentry24.png",
"CppPlatform/Extensions/textentryicon.png")
.AddParameter("object", "Object", "TextEntry")
.AddParameter("yesorno", "Activate")
.SetFunctionName("Activate");
obj.AddCondition("Activated",
"Text input",
"Test if the object captured text entered with keyboard.",
"_PARAM0_ capture the text entered with keyboard",
"Setup",
"CppPlatform/Extensions/textentry24.png",
"CppPlatform/Extensions/textentryicon.png")
.AddParameter("object", "Object", "TextEntry")
.SetFunctionName("IsActivated");
obj.AddStrExpression("String",
"Text entered with keyboard",
"Text entered with keyboard",
"Text entered with keyboard",
"res/texteicon.png")
.AddParameter("object", "Object", "TextEntry")
.SetFunctionName("GetString");
}