Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New extension: OfflineTimeTracker #1093

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
273 changes: 273 additions & 0 deletions extensions/community/OfflineTimeTracker.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,273 @@
{
"author": "",
"category": "Advanced",
"extensionNamespace": "",
"fullName": "OfflineTimeTracker",
"helpPath": "",
"iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXRpbWVyLW91dGxpbmUiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTIsMjBBNyw3IDAgMCwxIDUsMTNBNyw3IDAgMCwxIDEyLDZBNyw3IDAgMCwxIDE5LDEzQTcsNyAwIDAsMSAxMiwyME0xOS4wMyw3LjM5TDIwLjQ1LDUuOTdDMjAsNS40NiAxOS41NSw1IDE5LjA0LDQuNTZMMTcuNjIsNkMxNi4wNyw0Ljc0IDE0LjEyLDQgMTIsNEE5LDkgMCAwLDAgMywxM0E5LDkgMCAwLDAgMTIsMjJDMTcsMjIgMjEsMTcuOTcgMjEsMTNDMjEsMTAuODggMjAuMjYsOC45MyAxOS4wMyw3LjM5TTExLDE0SDEzVjhIMTFNMTUsMUg5VjNIMTVWMVoiIC8+PC9zdmc+",
"name": "OfflineTimeTracker",
"previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/632ad4b4fbdffa09f26d1e73058989bd488b2441c4e85b125c6db16c39c1a1c3_timer-outline.svg",
"shortDescription": "For Calculating the time passed (in and out of the game).",
"version": "2.0.0",
"description": [
"For calculating the time between 2 points in time.",
"No matter the game/app is open or closed , if you have a timestamp saved when the game/app is open it will keep track of the time passed.",
"Good for making Clicker Games and Offline Reward Systems !"
],
"tags": [
"time",
"timestamp",
"tracker",
"offline"
],
"authorIds": [
"oc974hW1zSYZfAnRbpKoXizqc1D3"
],
"dependencies": [],
"eventsFunctions": [
{
"description": "Create a timestamp with a defined name that can later be reffered to.",
"fullName": "Create Timestamp",
"functionType": "Action",
"group": "Actions",
"name": "CreateTimestamp",
"sentence": "Create a timestamp named _PARAM1_",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"value": "EcrireFichierExp"
},
"parameters": [
"\"_OfflineTimeTracker\"",
"Name",
"Time(\"timestamp\")"
]
}
]
}
],
"parameters": [
{
"description": "Timestamp name",
"name": "Name",
"type": "string"
}
],
"objectGroups": []
},
{
"description": "Delete a saved timestamp.",
"fullName": "Delete a timestamp",
"functionType": "Action",
"group": "Actions",
"name": "DeleteTimestamp",
"sentence": "Delete a timestamp named _PARAM1_ ",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"value": "DeleteGroupFichier"
},
"parameters": [
"\"_OfflineTimeTracker\"",
"Name"
]
}
]
}
],
"parameters": [
{
"description": "Timestamp name",
"name": "Name",
"type": "string"
}
],
"objectGroups": []
},
{
"description": "Difference between a timestamp and the present time ( in seconds ).",
"fullName": "Timestamp difference",
"functionType": "Expression",
"group": "Functions",
"name": "DifferenceTillPresentTime",
"sentence": "",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"value": "LireFichierExp"
},
"parameters": [
"\"_OfflineTimeTracker\"",
"LoadedName",
"Time(\"timestamp\")",
"_OfflineTimeTracker.LoadedName"
]
},
{
"type": {
"value": "SetReturnNumber"
},
"parameters": [
"roundTo((Time(\"timestamp\")-Variable(_OfflineTimeTracker.LoadedName))/1000,0)"
]
}
]
}
],
"expressionType": {
"type": "expression"
},
"parameters": [
{
"description": "Timestamp name",
"name": "LoadedName",
"type": "string"
}
],
"objectGroups": []
},
{
"description": "Difference between two timestamps ( in seconds ).",
"fullName": "Two Timestamps difference",
"functionType": "Expression",
"group": "Functions",
"name": "DifferenceBetweenTimestamps",
"sentence": "",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"value": "LireFichierExp"
},
"parameters": [
"\"_OfflineTimeTracker\"",
"First",
"Time(\"timestamp\")",
"_OfflineTimeTracker.First"
]
},
{
"type": {
"value": "LireFichierExp"
},
"parameters": [
"\"_OfflineTimeTracker\"",
"Second",
"Time(\"timestamp\")",
"_OfflineTimeTracker.Second"
]
},
{
"type": {
"value": "SetReturnNumber"
},
"parameters": [
"roundTo(abs(Variable(_OfflineTimeTracker.Second)-Variable(_OfflineTimeTracker.First))/1000,0)"
]
}
]
}
],
"expressionType": {
"type": "expression"
},
"parameters": [
{
"description": "First Timestamp's name",
"name": "First",
"type": "string"
},
{
"description": "Seconds Timestamp's name",
"name": "Second",
"type": "string"
}
],
"objectGroups": []
},
{
"description": "Check if timestamp exists.",
"fullName": "Timestamp Existence",
"functionType": "Condition",
"group": "Conditions",
"name": "ExistenceOfTimestamp",
"sentence": "If timestamp _PARAM1_ Exists",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "GroupExists"
},
"parameters": [
"\"_OfflineTimeTracker\"",
"Name"
]
}
],
"actions": [
{
"type": {
"value": "SetReturnBoolean"
},
"parameters": [
"True"
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"inverted": true,
"value": "GroupExists"
},
"parameters": [
"\"_OfflineTimeTracker\"",
"Name"
]
}
],
"actions": [
{
"type": {
"value": "SetReturnBoolean"
},
"parameters": [
"False"
]
}
]
}
],
"parameters": [
{
"description": "Timestamp name",
"name": "Name",
"type": "string"
}
],
"objectGroups": []
}
],
"eventsBasedBehaviors": [],
"eventsBasedObjects": []
}