/
FileExtension.cpp
151 lines (136 loc) · 7.42 KB
/
FileExtension.cpp
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
/*
* GDevelop Core
* Copyright 2008-2014 Florian Rival (Florian.Rival@gmail.com). All rights reserved.
* This project is released under the MIT License.
*/
#include "AllBuiltinExtensions.h"
#include "GDCore/Tools/Localization.h"
using namespace std;
namespace gd
{
void GD_CORE_API BuiltinExtensionsImplementer::ImplementsFileExtension(gd::PlatformExtension & extension)
{
extension.SetExtensionInformation("BuiltinFile",
_("Storage and files"),
_("Built-in extension providing functions to store data and manipulate files."),
"Florian Rival",
"Freeware");
#if defined(GD_IDE_ONLY)
extension.AddCondition("GroupExists",
_("Existence of a group"),
_("Test if an element ( Example : PlayerState/CurrentLevel ) exists in the file.\nWarning! Spaces are forbidden in element's names."),
_("_PARAM1_ exists in file _PARAM0_"),
_("Storage"),
"res/conditions/fichier24.png",
"res/conditions/fichier.png")
.AddParameter("file", _("Filename"), "",false)
.AddParameter("string", _("Group"), "",false)
.MarkAsAdvanced();
extension.AddAction("LoadFile",
_("Load a structured file in memory"),
_("This action load the structured file in memory, so as to write and read it.\nYou can open and write without using this action, but it will be slower.\nIf you use this action, do not forget to unload the file from memory.\n\nFor the native platform, the file format is XML."),
_("Load structured file _PARAM0_ in memory"),
_("Storage"),
"res/actions/fichier24.png",
"res/actions/fichier.png")
.AddParameter("file", _("File"), "",false)
.MarkAsAdvanced();
extension.AddAction("UnloadFile",
_("Close a structured file"),
_("This action close the structured file previously loaded in memory, saving all changes made."),
_("Close structured file _PARAM0_"),
_("Storage"),
"res/actions/fichier24.png",
"res/actions/fichier.png")
.AddParameter("file", _("File"), "",false)
.MarkAsAdvanced();
extension.AddAction("EcrireFichierExp",
_("Write a value"),
_("Write the result of the expression in the file, in the specified element.\nSpecify the structure leading to the element using / ( Example : Root/Level/Current)\nWarning ! Spaces are forbidden in elements' names."),
_("Write _PARAM2_ in _PARAM1_ of file _PARAM0_"),
_("Storage"),
"res/actions/fichier24.png",
"res/actions/fichier.png")
.AddParameter("file", _("File"), "",false)
.AddParameter("string", _("Group"), "",false)
.AddParameter("expression", _("Expression"), "",false);
extension.AddAction("EcrireFichierTxt",
_("Write a text"),
_("Write the text in the file, in the specified element.\nSpecify the structure leading to the element using / ( Example : Root/Level/Current)\nWarning ! Spaces are forbidden in elements' names."),
_("Write _PARAM2_ in _PARAM1_ of file _PARAM0_"),
_("Storage"),
"res/actions/fichier24.png",
"res/actions/fichier.png")
.AddParameter("file", _("File"), "",false)
.AddParameter("string", _("Group"), "",false)
.AddParameter("string", _("Text"), "",false);
extension.AddAction("LireFichierExp",
_("Read a value"),
_("Read the value saved in the specified element and\nstore it in a variable.\nSpecify the structure leading to the element using / ( Example : Root/Level/Current)\nWarning ! Spaces are forbidden in elements' names."),
_("Read _PARAM1_ from file _PARAM0_ and store value in _PARAM3_"),
_("Storage"),
"res/actions/fichier24.png",
"res/actions/fichier.png")
.AddParameter("file", _("File"), "",false)
.AddParameter("string", _("Group"), "",false)
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("scenevar", _("Scene variables"), "",false);
extension.AddAction("LireFichierTxt",
_("Read a text"),
_("Read the text saved in the specified element and\nstore it in a variable.\nSpecify the structure leading to the element using / ( Example : Root/Level/Current)\nWarning ! Spaces are forbidden in elements' names."),
_("Read _PARAM1_ from file _PARAM0_ and store as text in _PARAM3_"),
_("Storage"),
"res/actions/fichier24.png",
"res/actions/fichier.png")
.AddParameter("file", _("File"), "",false)
.AddParameter("string", _("Group"), "",false)
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("scenevar", _("Scene variables"), "",false);
extension.AddAction("DeleteGroupFichier",
_("Delete an element"),
_("This action delete the specified element from the structured file.\nSpecify the structure leading to the element using / ( Example : Root/Level/Current)\nWarning ! Spaces are forbidden in elements' names."),
_("Delete _PARAM1_ from the file _PARAM0_"),
_("Storage"),
"res/actions/delete24.png",
"res/actions/delete.png")
.AddParameter("file", _("Filename"), "",false)
.AddParameter("string", _("Group"), "",false)
.MarkAsAdvanced();
extension.AddAction("DeleteFichier",
_("Delete a file"),
_("Delete the file."),
_("Delete the file _PARAM0_"),
_("Files"),
"res/actions/delete24.png",
"res/actions/delete.png")
.AddParameter("file", _("Filename"), "",false);
extension.AddCondition("FileExists",
_("A file exists"),
_("Test if the file exists."),
_("File _PARAM0_ exists"),
_("Files"),
"res/conditions/fichier24.png",
"res/conditions/fichier.png")
.AddParameter("file", _("Filename"), "",false)
.MarkAsAdvanced();
extension.AddAction("LaunchFile",
_("Open an URL or a file"),
_("This action launch the specified file or URL, in a browser (or in a new tab if the game is using the Web platform and is launched inside a browser)."),
_("Open URL (or file) _PARAM0_"),
_("Files"),
"res/actions/launchFile24.png",
"res/actions/launchFile.png")
.AddParameter("string", _("URL (or filename)"), "",false)
.MarkAsAdvanced();
extension.AddAction("ExecuteCmd",
_("Execute a command"),
_("This action execute the specified command."),
_("Execute _PARAM0_"),
_("Files"),
"res/actions/launchFile24.png",
"res/actions/launchFile.png")
.AddParameter("string", _("Command"), "",false)
.MarkAsAdvanced();
#endif
}
}