From 3525f5f36c66ccdd90745a5771ed4aa820f81dda Mon Sep 17 00:00:00 2001 From: george-gca Date: Thu, 9 Feb 2023 04:42:16 +0000 Subject: [PATCH 1/3] Automated Extension submission for issue #775 --- extensions/community/SecretCode.json | 407 +++++++++++++++++++++++++++ 1 file changed, 407 insertions(+) create mode 100644 extensions/community/SecretCode.json diff --git a/extensions/community/SecretCode.json b/extensions/community/SecretCode.json new file mode 100644 index 000000000..f77834ff5 --- /dev/null +++ b/extensions/community/SecretCode.json @@ -0,0 +1,407 @@ +{ + "author": "", + "category": "Game mechanic", + "extensionNamespace": "", + "fullName": "Secret Code", + "helpPath": "", + "iconUrl": "", + "name": "SecretCode", + "previewIconUrl": "", + "shortDescription": "Allows to input a secret code for cheats and easter eggs.", + "version": "0.0.1", + "description": [ + "Allows to input a secret code for cheats and easter eggs.", + "", + "To use it, simply attach the behavior to any object in a scene and use the Secret Code condition in the editor to trigger your desired effects with events.", + "", + "Inspired by Konami Code extension." + ], + "tags": [ + "code", + "cheat", + "secret", + "konami", + "konami code", + "sequence", + "secret code", + "easter egg" + ], + "authorIds": [ + "5gByFNGtfFOapWi8AraDhgObyDS2" + ], + "dependencies": [], + "eventsFunctions": [ + { + "description": "Split given string and store the result in given object variable as a string list.", + "fullName": "Split string to object variable as string list", + "functionType": "Action", + "name": "StringToStringListObjectVar", + "sentence": "Split _PARAM1_ by _PARAM2_ and store result in _PARAM4_ variable _PARAM3_ as a string list", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const inputString = eventsFunctionContext.getArgument(\"inputString\");", + "const delimiter = eventsFunctionContext.getArgument(\"delimiter\");", + "const varName = eventsFunctionContext.getArgument(\"varName\");", + "let objectParam = eventsFunctionContext.getObjects(\"objectParam\")[0];", + "", + "const stringArray = inputString.split(delimiter);", + "let variable = objectParam.getVariables().get(varName);", + "", + "// https://forum.gdevelop.io/t/store-a-javascript-array/25104/2", + "// For saving the array;", + "for (let i = 0; i < stringArray.length; i++) {", + " variable.getChild(i).setString(stringArray[i]); // Assuming you store strings. ", + " // If you store an object you will have to make it a String using JSON. ", + " // If you want to store numbers use setNumber.", + "}" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "String to split", + "name": "inputString", + "type": "string" + }, + { + "description": "Delimiter to use when splitting", + "name": "delimiter", + "type": "string" + }, + { + "description": "Variable name to store the result", + "name": "varName", + "type": "string" + }, + { + "description": "Object where to store the resulting variable", + "name": "objectParam", + "type": "objectList" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [ + { + "description": "Allows to input a secret code for cheats and easter eggs.", + "fullName": "Secret Code", + "name": "SecretCode", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SecretCode::StringToStringListObjectVar" + }, + "parameters": [ + "", + "Object.Behavior::PropertyCode()", + "\" \"", + "\"CodeSequence\"", + "Object", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SecretCode::SecretCode", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "Object.Behavior::PropertyCount()", + "=", + "Object.VariableChildCount(CodeSequence)" + ] + } + ], + "actions": [ + { + "type": { + "value": "SecretCode::SecretCode::SetPropertyCodeEntered" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "SecretCode::SecretCode::PropertyCodeEntered" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "value": "AnyKeyReleased" + }, + "parameters": [ + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "KeyFromTextReleased" + }, + "parameters": [ + "", + "Object.VariableString(CodeSequence[Object.Behavior::PropertyCount()])" + ] + } + ], + "actions": [ + { + "type": { + "value": "SecretCode::SecretCode::SetPropertyCount" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "KeyFromTextReleased" + }, + "parameters": [ + "", + "Object.VariableString(CodeSequence[Object.Behavior::PropertyCount()])" + ] + } + ], + "actions": [ + { + "type": { + "value": "SecretCode::SecretCode::SetPropertyCount" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "1" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SecretCode::SecretCode", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Code entered correctly.", + "fullName": "Code entered", + "functionType": "Condition", + "name": "CodeEntered", + "sentence": "_PARAM0_ code entered correctly", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SecretCode::SecretCode::PropertyCodeEntered" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SecretCode::SecretCode", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Reset the code entered status.", + "fullName": "Reset code status", + "functionType": "Action", + "name": "ResetCodeEntered", + "sentence": "Reset _PARAM0_ code entered status", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SecretCode::SecretCode::SetPropertyCodeEntered" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + }, + { + "type": { + "value": "SecretCode::SecretCode::SetPropertyCount" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SecretCode::SecretCode", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "Up Up Down Down Left Right Left Right b a", + "type": "String", + "label": "Code to be entered", + "description": "", + "group": "", + "extraInformation": [], + "hidden": false, + "name": "Code" + }, + { + "value": "0", + "type": "Number", + "label": "Current correct steps", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "Count" + }, + { + "value": "", + "type": "Boolean", + "label": "Code entered correctly", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "CodeEntered" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [] +} \ No newline at end of file From ce5322174490079643ced21d02f2f3d10229e04a Mon Sep 17 00:00:00 2001 From: george-gca Date: Sun, 2 Jul 2023 21:11:39 +0000 Subject: [PATCH 2/3] Updated extension --- extensions/community/SecretCode.json | 977 ++++++++++++++++++++++++++- 1 file changed, 968 insertions(+), 9 deletions(-) diff --git a/extensions/community/SecretCode.json b/extensions/community/SecretCode.json index f77834ff5..7863d215b 100644 --- a/extensions/community/SecretCode.json +++ b/extensions/community/SecretCode.json @@ -3,7 +3,7 @@ "category": "Game mechanic", "extensionNamespace": "", "fullName": "Secret Code", - "helpPath": "", + "helpPath": "/extensions/secret-code", "iconUrl": "", "name": "SecretCode", "previewIconUrl": "", @@ -12,7 +12,11 @@ "description": [ "Allows to input a secret code for cheats and easter eggs.", "", - "To use it, simply attach the behavior to any object in a scene and use the Secret Code condition in the editor to trigger your desired effects with events.", + "There are two behaviors in this extension: `SecretCode` and `ManualSecretCode`.", + "", + "To use `SecretCode`, simply attach the behavior to any object in a scene and set the desired code. Use the `Code entered` condition in the editor to trigger your desired effects with events.", + "", + "To use `ManualSecretCode`, first attach the behavior to any object in a scene. To enter a key, use the `Input key` action, and use the `Code entered` condition in the editor to trigger your desired effects with events.", "", "Inspired by Konami Code extension." ], @@ -32,10 +36,11 @@ "dependencies": [], "eventsFunctions": [ { - "description": "Split given string and store the result in given object variable as a string list.", + "description": "Split given string and store the result in given object variable as a string list", "fullName": "Split string to object variable as string list", "functionType": "Action", "name": "StringToStringListObjectVar", + "private": true, "sentence": "Split _PARAM1_ by _PARAM2_ and store result in _PARAM4_ variable _PARAM3_ as a string list", "events": [ { @@ -107,7 +112,19 @@ "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], + "conditions": [ + { + "type": { + "value": "SecretCode::SecretCode::PropertyCode" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "\"\"" + ] + } + ], "actions": [ { "type": { @@ -158,6 +175,12 @@ "=", "Object.VariableChildCount(CodeSequence)" ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] } ], "actions": [ @@ -186,6 +209,15 @@ "Behavior" ] }, + { + "type": { + "value": "SecretCode::SecretCode::PropertyAcceptingCode" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, { "type": { "value": "AnyKeyReleased" @@ -272,7 +304,7 @@ }, { "description": "Code entered correctly.", - "fullName": "Code entered", + "fullName": "Code entered correctly", "functionType": "Condition", "name": "CodeEntered", "sentence": "_PARAM0_ code entered correctly", @@ -318,11 +350,11 @@ "objectGroups": [] }, { - "description": "Reset the code entered status.", - "fullName": "Reset code status", + "description": "Reset code entered correctly status.", + "fullName": "Reset code entered correctly status", "functionType": "Action", "name": "ResetCodeEntered", - "sentence": "Reset _PARAM0_ code entered status", + "sentence": "Reset _PARAM0_ code entered correctly status", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -366,6 +398,192 @@ } ], "objectGroups": [] + }, + { + "description": "Check if the object is accepting code.", + "fullName": "Is accepting code", + "functionType": "Condition", + "name": "IsAcceptingCode", + "sentence": "Is _PARAM0_ accepting code", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SecretCode::SecretCode::PropertyAcceptingCode" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SecretCode::SecretCode", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Accept code input.", + "fullName": "Accept code", + "functionType": "Action", + "name": "AcceptCode", + "sentence": "Make _PARAM0_ accept code: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Accepting\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SecretCode::SecretCode::SetPropertyAcceptingCode" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Accepting\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SecretCode::SecretCode::SetPropertyAcceptingCode" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SecretCode::SecretCode", + "type": "behavior" + }, + { + "defaultValue": "yes", + "description": "Accepting", + "name": "Accepting", + "optional": true, + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Change secret code.", + "fullName": "Change code", + "functionType": "Action", + "name": "ChangeCode", + "sentence": "Change _PARAM0_ code to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsString" + }, + "parameters": [ + "\"Code\"", + "!=", + "\"\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SecretCode::StringToStringListObjectVar" + }, + "parameters": [ + "", + "GetArgumentAsString(\"Code\")", + "\" \"", + "\"CodeSequence\"", + "Object", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SecretCode::SecretCode", + "type": "behavior" + }, + { + "description": "New code", + "name": "Code", + "type": "string" + } + ], + "objectGroups": [] } ], "propertyDescriptors": [ @@ -373,7 +591,7 @@ "value": "Up Up Down Down Left Right Left Right b a", "type": "String", "label": "Code to be entered", - "description": "", + "description": "List of keys separated by spaces", "group": "", "extraInformation": [], "hidden": false, @@ -398,6 +616,747 @@ "extraInformation": [], "hidden": true, "name": "CodeEntered" + }, + { + "value": "true", + "type": "Boolean", + "label": "Is accepting code input", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "AcceptingCode" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Allows to manually input a secret code for cheats and easter eggs.", + "fullName": "Manual Secret Code", + "name": "ManualSecretCode", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SecretCode::SecretCode::PropertyCode" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "\"\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SecretCode::StringToStringListObjectVar" + }, + "parameters": [ + "", + "Object.Behavior::PropertyCode()", + "\" \"", + "\"CodeSequence\"", + "Object", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SecretCode::ManualSecretCode", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "Object.Behavior::PropertyCount()", + "=", + "Object.VariableChildCount(CodeSequence)" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "SecretCode::SecretCode::SetPropertyCodeEntered" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SecretCode::ManualSecretCode", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Code entered correctly.", + "fullName": "Code entered correctly", + "functionType": "Condition", + "name": "CodeEntered", + "sentence": "_PARAM0_ code entered correctly", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SecretCode::SecretCode::PropertyCodeEntered" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SecretCode::ManualSecretCode", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Reset code entered correctly status.", + "fullName": "Reset code entered correctly status", + "functionType": "Action", + "name": "ResetCodeEntered", + "sentence": "Reset _PARAM0_ code entered correctly status", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SecretCode::SecretCode::SetPropertyCodeEntered" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + }, + { + "type": { + "value": "SecretCode::SecretCode::SetPropertyCount" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SecretCode::ManualSecretCode", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the object is accepting code.", + "fullName": "Is accepting code", + "functionType": "Condition", + "name": "IsAcceptingCode", + "sentence": "Is _PARAM0_ accepting code", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SecretCode::SecretCode::PropertyAcceptingCode" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SecretCode::ManualSecretCode", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Accept code input.", + "fullName": "Accept code", + "functionType": "Action", + "name": "AcceptCode", + "sentence": "Make _PARAM0_ accept code: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Accepting\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SecretCode::SecretCode::SetPropertyAcceptingCode" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Accepting\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SecretCode::SecretCode::SetPropertyAcceptingCode" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SecretCode::ManualSecretCode", + "type": "behavior" + }, + { + "defaultValue": "yes", + "description": "Accepting", + "name": "Accepting", + "optional": true, + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Change secret code.", + "fullName": "Change code", + "functionType": "Action", + "name": "ChangeCode", + "sentence": "Change _PARAM0_ code to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsString" + }, + "parameters": [ + "\"Code\"", + "!=", + "\"\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SecretCode::StringToStringListObjectVar" + }, + "parameters": [ + "", + "GetArgumentAsString(\"Code\")", + "\" \"", + "\"CodeSequence\"", + "Object", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SecretCode::ManualSecretCode", + "type": "behavior" + }, + { + "description": "New code", + "name": "Code", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the code is currently being entered.", + "fullName": "Is the code currently being entered", + "functionType": "Condition", + "name": "CodeBeingEntered", + "sentence": "Is _PARAM0_ code currently being entered", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SecretCode::ManualSecretCode::PropertyCount" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SecretCode::ManualSecretCode", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Reset currently inputted code.", + "fullName": "Reset inputted code", + "functionType": "Action", + "name": "ResetInputtedCode", + "sentence": "Reset _PARAM0_ inputted code", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SecretCode::ManualSecretCode::SetPropertyCount" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SecretCode::ManualSecretCode", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Input key.", + "fullName": "Input key", + "functionType": "Action", + "name": "InputKey", + "sentence": "Input _PARAM2_ on _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "SecretCode::SecretCode::PropertyCodeEntered" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "value": "SecretCode::SecretCode::PropertyAcceptingCode" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "KeyFromTextReleased" + }, + "parameters": [ + "", + "Object.VariableString(CodeSequence[Object.Behavior::PropertyCount()])" + ] + } + ], + "actions": [ + { + "type": { + "value": "SecretCode::SecretCode::SetPropertyCount" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "1" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SecretCode::ManualSecretCode", + "type": "behavior" + }, + { + "description": "Key", + "name": "Key", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Return the last valid key.", + "fullName": "Last valid key", + "functionType": "StringExpression", + "name": "LastValidKey", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SecretCode::ManualSecretCode::PropertyCount" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "Object.VariableString(CodeSequence[Object.Behavior::PropertyCount()-1])" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SecretCode::ManualSecretCode::PropertyCount" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "\"\"" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SecretCode::ManualSecretCode", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return the last valid index.", + "fullName": "Last valid index", + "functionType": "Expression", + "name": "LastValidIndex", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyCount()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SecretCode::ManualSecretCode", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "Up Up Down Down Left Right Left Right b a", + "type": "String", + "label": "Code to be entered", + "description": "List of keys separated by spaces", + "group": "", + "extraInformation": [], + "hidden": false, + "name": "Code" + }, + { + "value": "0", + "type": "Number", + "label": "Current correct steps", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "Count" + }, + { + "value": "", + "type": "Boolean", + "label": "Code entered correctly", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "CodeEntered" + }, + { + "value": "true", + "type": "Boolean", + "label": "Is accepting code input", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "AcceptingCode" } ], "sharedPropertyDescriptors": [] From 4b4bb93ef903c3bf4347e8e9a95bda7a598fb449 Mon Sep 17 00:00:00 2001 From: Arthur Pacaud Date: Thu, 28 Sep 2023 19:54:33 +0200 Subject: [PATCH 3/3] Add icon --- extensions/community/SecretCode.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/extensions/community/SecretCode.json b/extensions/community/SecretCode.json index 7863d215b..3b5832b23 100644 --- a/extensions/community/SecretCode.json +++ b/extensions/community/SecretCode.json @@ -3,10 +3,10 @@ "category": "Game mechanic", "extensionNamespace": "", "fullName": "Secret Code", - "helpPath": "/extensions/secret-code", - "iconUrl": "", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWtleS1jaGFpbi12YXJpYW50IiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTEyLjY2IDEzLjY3QzEyLjMyIDE0IDExLjkzIDE0LjI5IDExLjUgMTQuNVYyMUw5LjUgMjNMNy41IDIxTDkuNSAxOS4yOUw4IDE4TDkuNSAxNi43MUw3LjUgMTVWMTQuNUM2IDEzLjc3IDUgMTIuMjYgNSAxMC41QzUgOCA3IDYgOS41IDZDOS41NCA2IDkuNTggNiA5LjYxIDZDOS41OSA2LjA3IDkuNTQgNi4xMiA5LjUgNi4xOEM5LjIzIDYuNzkgOS4wOCA3LjQzIDkuMDMgOC4wOEM4LjQzIDguMjggOCA4Ljg0IDggOS41QzggMTAuMzMgOC42NyAxMSA5LjUgMTFDOS41MyAxMSA5LjU3IDExIDkuNiAxMUMxMC4yNCAxMi4yNSAxMS4zNCAxMy4yIDEyLjY2IDEzLjY3TTE2IDZDMTYgNS4zNyAxNS45IDQuNzUgMTUuNzIgNC4xOEMxNy4wNiA0LjU2IDE4LjIxIDUuNTUgMTguNzMgNi45NkMxOS4zMyA4LjYyIDE4Ljg5IDEwLjM5IDE3Ljc1IDExLjU5TDIwIDE3LjY4TDE4Ljc4IDIwLjI1TDE2LjIyIDE5LjA1TDE3LjUgMTYuNzZMMTUuNjYgMTYuMDZMMTYuNjMgMTQuMzRMMTQuMTYgMTMuNDFMMTQgMTIuOTVDMTIuMzYgMTIuNzcgMTAuODggMTEuNyAxMC4yNyAxMC4wNEM5LjQyIDcuNzEgMTAuNjMgNS4xMiAxMi45NiA0LjI3QzEzLjE0IDQuMjEgMTMuMzMgNC4xNyAxMy41IDQuMTNDMTIuODQgMi44NyAxMS41MyAyIDEwIDJDNy43OSAyIDYgMy43OSA2IDZDNiA2LjA5IDYgNi4xNyA2LjAzIDYuMjZDNS43IDYuNTMgNS40IDYuODIgNS4xNSA3LjE1QzUuMDYgNi43OCA1IDYuNCA1IDZDNSAzLjI0IDcuMjQgMSAxMCAxUzE1IDMuMjQgMTUgNkMxNSA3LjE2IDE0LjYgOC4yMSAxMy45NCA5LjA2QzE2LjA4IDguODggMTYgNiAxNiA2TTEyLjgxIDguMUMxMi44NyA4LjI3IDEyLjk2IDguNDEgMTMuMDYgOC41NEMxMy42MiA3Ljg4IDEzLjk3IDcuMDQgMTQgNi4xMUMxMy44OSA2LjEzIDEzLjggNi4xNSAxMy43IDYuMThDMTIuOTIgNi40NyAxMi41IDcuMzMgMTIuODEgOC4xWiIgLz48L3N2Zz4=", "name": "SecretCode", - "previewIconUrl": "", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/16ec515c053b629042bd78e6098a05fb1bcc3172361820f7b2a2ce934a874aa7_key-chain-variant.svg", "shortDescription": "Allows to input a secret code for cheats and easter eggs.", "version": "0.0.1", "description": [