/* * GDevelop Core * Copyright 2008-2016 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"), "Actions and conditions to store data (like the player progress or " "anything else to be persisted across game sessions). Data are " "stored on the device and erased when the game is uninstalled.", "Florian Rival", "Open source (MIT License)") .SetExtensionHelpPath("/all-features/storage") .SetCategory("Advanced"); extension.AddInstructionOrExpressionGroupMetadata(_("Storage")) .SetIcon("res/conditions/fichier24.png"); extension .AddCondition( "GroupExists", _("Existence of a group"), _("Check if an element (example : PlayerState/CurrentLevel) exists " "in the stored data.\nSpaces are forbidden in element names."), _("_PARAM1_ exists in storage _PARAM0_"), "", "res/conditions/fichier24.png", "res/conditions/fichier.png") .AddParameter("string", _("Storage name")) .AddParameter("string", _("Group")) .MarkAsAdvanced(); extension .AddAction( "LoadFile", _("Manually preload a storage in memory"), _("Forces the specified storage to be loaded and kept in " "memory, allowing faster reads/writes. " "However, it requires manual management: if you use this " "action, you *must* also unload the storage manually when " "it's no longer needed to ensure data is persisted.\n\n" "Unless you have a specific performance need, avoid using this " "action. The system already handles loading/unloading " "automatically."), _("Load data storage _PARAM0_ in memory"), _("Advanced"), "res/actions/fichier24.png", "res/actions/fichier.png") .AddParameter("string", _("Storage name")) .MarkAsAdvanced(); extension .AddAction("UnloadFile", _("Manually unload and persist a storage"), _("Close the specified storage previously loaded " "in memory, saving all changes made."), _("Unload and persist data storage _PARAM0_"), _("Advanced"), "res/actions/fichier24.png", "res/actions/fichier.png") .AddParameter("string", _("Storage name")) .MarkAsAdvanced(); extension .AddAction( "EcrireFichierExp", _("Save a value"), _("Save the result of the expression in the stored data, in the " "specified element.\nSpecify the structure leading to the " "element using / (example : Root/Level/Current)\nSpaces are " "forbidden in element names."), _("Save _PARAM2_ in _PARAM1_ of storage _PARAM0_"), "", "res/actions/fichier24.png", "res/actions/fichier.png") .AddParameter("string", _("Storage name")) .AddParameter("string", _("Group")) .AddParameter("expression", _("Expression")); extension .AddAction( "EcrireFichierTxt", _("Save a text"), _("Save the text in the specified storage, in the specified " "element.\nSpecify " "the structure leading to the element using / (example : " "Root/Level/Current)\nSpaces are forbidden in element names."), _("Save _PARAM2_ in _PARAM1_ of storage _PARAM0_"), "", "res/actions/fichier24.png", "res/actions/fichier.png") .AddParameter("string", _("Storage name")) .AddParameter("string", _("Group")) .AddParameter("string", _("Text")); // Deprecated extension .AddAction( "LireFichierExp", _("Load a value"), _("Load the value saved in the specified element and store it in a " "scene " "variable.\nSpecify the structure leading to the element using / " "(example : Root/Level/Current)\nSpaces are forbidden in element " "names."), _("Load _PARAM1_ from storage _PARAM0_ and store value in _PARAM3_"), "", "res/actions/fichier24.png", "res/actions/fichier.png") .AddParameter("string", _("Storage name")) .AddParameter("string", _("Group")) .AddCodeOnlyParameter("currentScene", "") .AddParameter("scenevar", _("Scene variable")) .SetHidden(); extension .AddAction( "ReadNumberFromStorage", _("Load a value"), _("Load the value saved in the specified element and store it in a " "variable.\nSpecify the structure leading to the element using / " "(example : Root/Level/Current)\nSpaces are forbidden in element " "names."), _("Load _PARAM1_ from storage _PARAM0_ and store value in _PARAM3_"), "", "res/actions/fichier24.png", "res/actions/fichier.png") .AddParameter("string", _("Storage name")) .AddParameter("string", _("Group")) .AddCodeOnlyParameter("currentScene", "") .AddParameter("variable", _("Variable")); // Deprecated extension .AddAction( "LireFichierTxt", _("Load a text"), _("Load the text saved in the specified element and store it in a " "scene " "variable.\nSpecify the structure leading to the element using / " "(example : Root/Level/Current)\nSpaces are forbidden in element " "names."), _("Load _PARAM1_ from storage _PARAM0_ and store as text in " "_PARAM3_"), "", "res/actions/fichier24.png", "res/actions/fichier.png") .AddParameter("string", _("Storage name")) .AddParameter("string", _("Group")) .AddCodeOnlyParameter("currentScene", "") .AddParameter("scenevar", _("Scene variable")) .SetHidden(); extension .AddAction( "ReadStringFromStorage", _("Load a text"), _("Load the text saved in the specified element and store it in a " "variable.\nSpecify the structure leading to the element using / " "(example : Root/Level/Current)\nSpaces are forbidden in element " "names."), _("Load _PARAM1_ from storage _PARAM0_ and store as text in " "_PARAM3_"), "", "res/actions/fichier24.png", "res/actions/fichier.png") .AddParameter("string", _("Storage name")) .AddParameter("string", _("Group")) .AddCodeOnlyParameter("currentScene", "") .AddParameter("variable", _("Variable")); extension .AddAction("DeleteGroupFichier", _("Delete an element"), _("This action deletes the specified element from the " "specified storage.\nSpecify the structure leading to the " "element using / (example : Root/Level/Current)\nSpaces are " "forbidden in element names."), _("Delete _PARAM1_ from storage _PARAM0_"), "", "res/actions/delete24.png", "res/actions/delete.png") .AddParameter("string", _("Storage name")) .AddParameter("string", _("Group")) .MarkAsAdvanced(); extension .AddAction( "DeleteFichier", _("Clear a storage"), _("Clear the specified storage, removing all data saved in it."), _("Delete storage _PARAM0_"), "", "res/actions/delete24.png", "res/actions/delete.png") .AddParameter("string", _("Storage name")); extension .AddCondition("FileExists", _("A storage exists"), _("Test if the specified storage exists."), _("Storage _PARAM0_ exists"), "", "res/conditions/fichier24.png", "res/conditions/fichier.png") .AddParameter("string", _("Storage name")) .MarkAsAdvanced(); extension .AddAction("ExecuteCmd", _("Execute a command"), _("This action executes the specified command."), _("Execute _PARAM0_"), _("Network"), "res/actions/launchFile24.png", "res/actions/launchFile.png") .AddParameter("string", _("Command")) .MarkAsAdvanced(); } } // namespace gd