Skip to content

Commit 315b50a

Browse files
committed
[Community] [Screen orientation checker] Handle hot-reload
1 parent 9877358 commit 315b50a

File tree

1 file changed

+179
-17
lines changed

1 file changed

+179
-17
lines changed

extensions/community/ScreenOrientationChecker.json

Lines changed: 179 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"name": "ScreenOrientationChecker",
1010
"previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/0126888931a4a4f82bb2824df9f096347ace1c47f510c44df42aa8dc9e49e24a_screen-rotation.svg",
1111
"shortDescription": "Display a customizable screen asking the user to rotate their phone/tablet if not in the right orientation.",
12-
"version": "0.1.2",
12+
"version": "0.2.0",
1313
"description": "Display a customizable screen asking the user to rotate their phone/tablet if not in the right orientation.",
1414
"origin": {
1515
"identifier": "ScreenOrientationChecker",
@@ -296,6 +296,7 @@
296296
"ambientLightColorB": 200,
297297
"ambientLightColorG": 200,
298298
"ambientLightColorR": 200,
299+
"camera2DPlaneMaxDrawingDistance": 5000,
299300
"camera3DFarPlaneDistance": 10000,
300301
"camera3DFieldOfView": 45,
301302
"camera3DNearPlaneDistance": 3,
@@ -372,13 +373,121 @@
372373
"initialVariables": []
373374
}
374375
],
376+
"editionSettings": {
377+
"grid": false,
378+
"gridType": "rectangular",
379+
"gridWidth": 32,
380+
"gridHeight": 32,
381+
"gridDepth": 32,
382+
"gridOffsetX": 0,
383+
"gridOffsetY": 0,
384+
"gridOffsetZ": 0,
385+
"gridColor": 10401023,
386+
"gridAlpha": 0.8,
387+
"snap": false,
388+
"zoomFactor": 1.75,
389+
"windowMask": false
390+
},
375391
"eventsFunctions": [
392+
{
393+
"fullName": "",
394+
"functionType": "Action",
395+
"name": "onCreated",
396+
"sentence": "",
397+
"events": [
398+
{
399+
"type": "BuiltinCommonInstructions::Standard",
400+
"conditions": [],
401+
"actions": [
402+
{
403+
"type": {
404+
"value": "TextContainerCapability::TextContainerBehavior::SetValue"
405+
},
406+
"parameters": [
407+
"Text",
408+
"Text",
409+
"=",
410+
"Message"
411+
]
412+
}
413+
]
414+
}
415+
],
416+
"parameters": [
417+
{
418+
"description": "Object",
419+
"name": "Object",
420+
"supplementaryInformation": "ScreenOrientationChecker::ScreenOrientationChecker",
421+
"type": "object"
422+
}
423+
],
424+
"objectGroups": []
425+
},
426+
{
427+
"fullName": "",
428+
"functionType": "Action",
429+
"name": "onHotReloading",
430+
"sentence": "",
431+
"events": [
432+
{
433+
"type": "BuiltinCommonInstructions::Standard",
434+
"conditions": [],
435+
"actions": [
436+
{
437+
"type": {
438+
"value": "TextContainerCapability::TextContainerBehavior::SetValue"
439+
},
440+
"parameters": [
441+
"Text",
442+
"Text",
443+
"=",
444+
"Message"
445+
]
446+
}
447+
]
448+
}
449+
],
450+
"parameters": [
451+
{
452+
"description": "Object",
453+
"name": "Object",
454+
"supplementaryInformation": "ScreenOrientationChecker::ScreenOrientationChecker",
455+
"type": "object"
456+
}
457+
],
458+
"objectGroups": []
459+
},
376460
{
377461
"fullName": "",
378462
"functionType": "Action",
379463
"name": "doStepPostEvents",
380464
"sentence": "",
381465
"events": [
466+
{
467+
"type": "BuiltinCommonInstructions::Standard",
468+
"conditions": [
469+
{
470+
"type": {
471+
"value": "ScreenOrientationChecker::IsInGameEdition"
472+
},
473+
"parameters": [
474+
"",
475+
""
476+
]
477+
}
478+
],
479+
"actions": [
480+
{
481+
"type": {
482+
"value": "ScreenOrientationChecker::ScreenOrientationChecker::DrawBackground"
483+
},
484+
"parameters": [
485+
"Object",
486+
""
487+
]
488+
}
489+
]
490+
},
382491
{
383492
"type": "BuiltinCommonInstructions::Standard",
384493
"conditions": [
@@ -612,24 +721,11 @@
612721
"actions": [
613722
{
614723
"type": {
615-
"value": "PrimitiveDrawing::FillColor"
616-
},
617-
"parameters": [
618-
"BackgroundPainter",
619-
"BackgroundColor"
620-
]
621-
},
622-
{
623-
"type": {
624-
"value": "PrimitiveDrawing::RoundedRectangle"
724+
"value": "ScreenOrientationChecker::ScreenOrientationChecker::DrawBackground"
625725
},
626726
"parameters": [
627-
"BackgroundPainter",
628-
"Padding",
629-
"Padding",
630-
"Object.Width()-Padding",
631-
"Object.Height()-Padding",
632-
"CornerRadius"
727+
"Object",
728+
""
633729
]
634730
},
635731
{
@@ -846,6 +942,53 @@
846942
],
847943
"objectGroups": []
848944
},
945+
{
946+
"description": "Draw the background.",
947+
"fullName": "Draw the background",
948+
"functionType": "Action",
949+
"name": "DrawBackground",
950+
"private": true,
951+
"sentence": "Draw the background of _PARAM0_",
952+
"events": [
953+
{
954+
"type": "BuiltinCommonInstructions::Standard",
955+
"conditions": [],
956+
"actions": [
957+
{
958+
"type": {
959+
"value": "PrimitiveDrawing::FillColor"
960+
},
961+
"parameters": [
962+
"BackgroundPainter",
963+
"BackgroundColor"
964+
]
965+
},
966+
{
967+
"type": {
968+
"value": "PrimitiveDrawing::RoundedRectangle"
969+
},
970+
"parameters": [
971+
"BackgroundPainter",
972+
"Padding",
973+
"Padding",
974+
"Object.Width()-Padding",
975+
"Object.Height()-Padding",
976+
"CornerRadius"
977+
]
978+
}
979+
]
980+
}
981+
],
982+
"parameters": [
983+
{
984+
"description": "Object",
985+
"name": "Object",
986+
"supplementaryInformation": "ScreenOrientationChecker::ScreenOrientationChecker",
987+
"type": "object"
988+
}
989+
],
990+
"objectGroups": []
991+
},
849992
{
850993
"description": "Check if the screen should be forced to be shown. Use this to test the screen in your game.",
851994
"fullName": "Force show the screen",
@@ -1010,6 +1153,25 @@
10101153
"label": "Background color",
10111154
"group": "Appearance",
10121155
"name": "BackgroundColor"
1156+
},
1157+
{
1158+
"value": "Rotate screen to play",
1159+
"type": "String",
1160+
"label": "Message",
1161+
"name": "Message"
1162+
},
1163+
{
1164+
"value": "",
1165+
"type": "Choice",
1166+
"label": "",
1167+
"choices": [
1168+
{
1169+
"label": "",
1170+
"value": "Text.Text=Message"
1171+
}
1172+
],
1173+
"hidden": true,
1174+
"name": "_PropertyMapping"
10131175
}
10141176
]
10151177
}

0 commit comments

Comments
 (0)