Skip to content

Commit cfcc0f3

Browse files
committed
Port misc and plugin demos to Godot 3.1
1 parent a38b315 commit cfcc0f3

File tree

86 files changed

+703
-3205
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+703
-3205
lines changed

misc/android_iap/iap.gd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func request_purchased():
3838
if payment:
3939
payment.requestPurchased()
4040

41-
func has_purchased(receipt, signature, sku):
41+
func has_purchased(_receipt, _signature, sku):
4242
if sku == "":
4343
print("has_purchased : nothing")
4444
emit_signal("has_purchased", null)
@@ -54,7 +54,7 @@ func purchase(item_name):
5454
# transaction_id could be any string that used for validation internally in java
5555
payment.purchase(item_name, "transaction_id")
5656

57-
func purchase_success(receipt, signature, sku):
57+
func purchase_success(_receipt, _signature, sku):
5858
print("purchase_success : ", sku)
5959
emit_signal("purchase_success", sku)
6060

@@ -82,7 +82,7 @@ func consume_all():
8282
if payment:
8383
payment.consumeUnconsumedPurchases()
8484

85-
func consume_success(receipt, signature, sku):
85+
func consume_success(_receipt, _signature, sku):
8686
print("consume_success : ", sku)
8787
emit_signal("consume_success", sku)
8888

misc/android_iap/main.tscn

Lines changed: 0 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -3,140 +3,61 @@
33
[ext_resource path="res://iap_demo.gd" type="Script" id=1]
44

55
[node name="Control" type="Control"]
6-
7-
anchor_left = 0.0
8-
anchor_top = 0.0
96
anchor_right = 1.0
107
anchor_bottom = 1.0
11-
rect_pivot_offset = Vector2( 0, 0 )
12-
rect_clip_content = false
13-
mouse_filter = 0
148
size_flags_horizontal = 2
159
size_flags_vertical = 2
1610
script = ExtResource( 1 )
1711

1812
[node name="purchase" type="Button" parent="."]
19-
20-
anchor_left = 0.0
21-
anchor_top = 0.0
22-
anchor_right = 0.0
23-
anchor_bottom = 0.0
2413
margin_left = 40.0
2514
margin_top = 40.0
2615
margin_right = 250.0
2716
margin_bottom = 120.0
28-
rect_pivot_offset = Vector2( 0, 0 )
29-
rect_clip_content = false
30-
mouse_filter = 0
3117
size_flags_horizontal = 2
3218
size_flags_vertical = 2
33-
toggle_mode = false
34-
enabled_focus_mode = 2
35-
shortcut = null
36-
group = null
3719
text = "Purchase in app"
38-
flat = false
3920

4021
[node name="consume" type="Button" parent="."]
41-
42-
anchor_left = 0.0
43-
anchor_top = 0.0
44-
anchor_right = 0.0
45-
anchor_bottom = 0.0
4622
margin_left = 40.0
4723
margin_top = 150.0
4824
margin_right = 250.0
4925
margin_bottom = 230.0
50-
rect_pivot_offset = Vector2( 0, 0 )
51-
rect_clip_content = false
52-
mouse_filter = 0
5326
size_flags_horizontal = 2
5427
size_flags_vertical = 2
55-
toggle_mode = false
56-
enabled_focus_mode = 2
57-
shortcut = null
58-
group = null
5928
text = "Consume in app"
60-
flat = false
6129

6230
[node name="request" type="Button" parent="."]
63-
64-
anchor_left = 0.0
65-
anchor_top = 0.0
66-
anchor_right = 0.0
67-
anchor_bottom = 0.0
6831
margin_left = 40.0
6932
margin_top = 260.0
7033
margin_right = 250.0
7134
margin_bottom = 340.0
72-
rect_pivot_offset = Vector2( 0, 0 )
73-
rect_clip_content = false
74-
mouse_filter = 0
7535
size_flags_horizontal = 2
7636
size_flags_vertical = 2
77-
toggle_mode = false
78-
enabled_focus_mode = 2
79-
shortcut = null
80-
group = null
8137
text = "Request purchased"
82-
flat = false
8338

8439
[node name="query" type="Button" parent="."]
85-
86-
anchor_left = 0.0
87-
anchor_top = 0.0
88-
anchor_right = 0.0
89-
anchor_bottom = 0.0
9040
margin_left = 40.0
9141
margin_top = 370.0
9242
margin_right = 250.0
9343
margin_bottom = 450.0
94-
rect_pivot_offset = Vector2( 0, 0 )
95-
rect_clip_content = false
96-
mouse_filter = 0
9744
size_flags_horizontal = 2
9845
size_flags_vertical = 2
99-
toggle_mode = false
100-
enabled_focus_mode = 2
101-
shortcut = null
102-
group = null
10346
text = "Query in app items"
104-
flat = false
10547

10648
[node name="alert" type="AcceptDialog" parent="."]
107-
108-
visible = false
109-
anchor_left = 0.0
110-
anchor_top = 0.0
111-
anchor_right = 0.0
112-
anchor_bottom = 0.0
11349
margin_left = 290.0
11450
margin_top = 60.0
11551
margin_right = 700.0
11652
margin_bottom = 290.0
117-
rect_pivot_offset = Vector2( 0, 0 )
118-
rect_clip_content = false
119-
mouse_filter = 0
12053
size_flags_horizontal = 2
12154
size_flags_vertical = 2
122-
popup_exclusive = false
123-
window_title = "Alert!"
124-
resizable = false
125-
dialog_hide_on_ok = true
12655

12756
[node name="Label" type="Label" parent="."]
128-
129-
anchor_left = 0.0
130-
anchor_top = 0.0
131-
anchor_right = 0.0
132-
anchor_bottom = 0.0
13357
margin_left = 300.0
13458
margin_top = 40.0
13559
margin_right = 932.0
13660
margin_bottom = 207.0
137-
rect_pivot_offset = Vector2( 0, 0 )
138-
rect_clip_content = false
139-
mouse_filter = 2
14061
size_flags_horizontal = 2
14162
size_flags_vertical = 0
14263
text = "\"iap\" is located in Autoloads. See Project > Project Settings > AutoLoad
@@ -156,8 +77,4 @@ To test in-app purchase on android device,
15677
(It's not published to public, but you and tester can access it.)
15778
3. There should be activated in-app item
15879
4. Any changes on Developer console will take 2~3 hours to take effect"
159-
percent_visible = 1.0
160-
lines_skipped = 0
161-
max_lines_visible = -1
162-
16380

misc/android_iap/project.godot

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@
66
; [section] ; section goes between []
77
; param=value ; assign values to parameters
88

9-
config_version=3
9+
config_version=4
10+
11+
_global_script_classes=[ ]
12+
_global_script_class_icons={
13+
14+
}
1015

1116
[android]
1217

@@ -22,6 +27,10 @@ config/icon="res://icon.png"
2227

2328
iap="*res://iap.gd"
2429

30+
[debug]
31+
32+
gdscript/warnings/return_value_discarded=false
33+
2534
[gdnative]
2635

2736
singletons=[ ]

misc/autoload/project.godot

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@
66
; [section] ; section goes between []
77
; param=value ; assign values to parameters
88

9-
config_version=3
9+
config_version=4
10+
11+
_global_script_classes=[ ]
12+
_global_script_class_icons={
13+
14+
}
1015

1116
[application]
1217

misc/autoload/scene_a.tscn

Lines changed: 3 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,63 +2,28 @@
22

33
[ext_resource path="res://scene_a.gd" type="Script" id=1]
44

5-
[node name="scene_a" type="Panel" index="0"]
6-
7-
anchor_left = 0.0
8-
anchor_top = 0.0
5+
[node name="scene_a" type="Panel"]
96
anchor_right = 1.0
107
anchor_bottom = 1.0
11-
rect_pivot_offset = Vector2( 0, 0 )
12-
mouse_filter = 0
13-
mouse_default_cursor_shape = 0
148
size_flags_horizontal = 2
159
size_flags_vertical = 2
1610
script = ExtResource( 1 )
1711

18-
[node name="label" type="Label" parent="." index="0"]
19-
20-
anchor_left = 0.0
21-
anchor_top = 0.0
22-
anchor_right = 0.0
23-
anchor_bottom = 0.0
12+
[node name="label" type="Label" parent="."]
2413
margin_left = 64.0
2514
margin_top = 48.0
2615
margin_right = 104.0
2716
margin_bottom = 62.0
28-
rect_pivot_offset = Vector2( 0, 0 )
29-
mouse_filter = 2
30-
mouse_default_cursor_shape = 0
31-
size_flags_horizontal = 1
3217
size_flags_vertical = 0
3318
text = "This is scene A."
34-
percent_visible = 1.0
35-
lines_skipped = 0
36-
max_lines_visible = -1
37-
38-
[node name="goto_scene" type="Button" parent="." index="1"]
3919

40-
anchor_left = 0.0
41-
anchor_top = 0.0
42-
anchor_right = 0.0
43-
anchor_bottom = 0.0
20+
[node name="goto_scene" type="Button" parent="."]
4421
margin_left = 64.0
4522
margin_top = 128.0
4623
margin_right = 192.0
4724
margin_bottom = 160.0
48-
rect_pivot_offset = Vector2( 0, 0 )
49-
focus_mode = 2
50-
mouse_filter = 0
51-
mouse_default_cursor_shape = 0
5225
size_flags_horizontal = 2
5326
size_flags_vertical = 2
54-
toggle_mode = false
55-
enabled_focus_mode = 2
56-
shortcut = null
57-
group = null
5827
text = "Go to Scene B"
59-
flat = false
60-
align = 1
6128

6229
[connection signal="pressed" from="goto_scene" to="." method="_on_goto_scene_pressed"]
63-
64-

misc/autoload/scene_b.tscn

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,60 +3,27 @@
33
[ext_resource path="res://scene_b.gd" type="Script" id=1]
44

55
[node name="scene_b" type="Panel"]
6-
7-
anchor_left = 0.0
8-
anchor_top = 0.0
96
anchor_right = 1.0
107
anchor_bottom = 1.0
11-
rect_pivot_offset = Vector2( 0, 0 )
12-
rect_clip_content = false
13-
mouse_filter = 0
148
size_flags_horizontal = 2
159
size_flags_vertical = 2
1610
script = ExtResource( 1 )
1711

1812
[node name="label" type="Label" parent="."]
19-
20-
anchor_left = 0.0
21-
anchor_top = 0.0
22-
anchor_right = 0.0
23-
anchor_bottom = 0.0
2413
margin_left = 64.0
2514
margin_top = 48.0
2615
margin_right = 164.0
2716
margin_bottom = 62.0
28-
rect_pivot_offset = Vector2( 0, 0 )
29-
rect_clip_content = false
30-
mouse_filter = 2
31-
size_flags_horizontal = 1
3217
size_flags_vertical = 0
3318
text = "This is scene B."
34-
percent_visible = 1.0
35-
lines_skipped = 0
36-
max_lines_visible = -1
3719

3820
[node name="goto_scene" type="Button" parent="."]
39-
40-
anchor_left = 0.0
41-
anchor_top = 0.0
42-
anchor_right = 0.0
43-
anchor_bottom = 0.0
4421
margin_left = 64.0
4522
margin_top = 128.0
4623
margin_right = 192.0
4724
margin_bottom = 160.0
48-
rect_pivot_offset = Vector2( 0, 0 )
49-
rect_clip_content = false
50-
mouse_filter = 0
5125
size_flags_horizontal = 2
5226
size_flags_vertical = 2
53-
toggle_mode = false
54-
enabled_focus_mode = 2
55-
shortcut = null
56-
group = null
5727
text = "Go to Scene A"
58-
flat = false
5928

6029
[connection signal="pressed" from="goto_scene" to="." method="_on_goto_scene_pressed"]
61-
62-

0 commit comments

Comments
 (0)