Skip to content

Commit 5f1905e

Browse files
committed
Replace _input with _unhandled_input
1 parent d1ed6db commit 5f1905e

File tree

19 files changed

+91
-28
lines changed

19 files changed

+91
-28
lines changed

2d/finite_state_machine/player/bullet/bullet_spawner.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ extends Node2D
22

33
var bullet = preload("Bullet.tscn")
44

5-
func _input(event):
5+
func _unhandled_input(event):
66
if event.is_action_pressed("fire"):
77
fire(owner.look_direction)
88

2d/finite_state_machine/player/player_state_machine.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func _change_state(state_name):
2121
._change_state(state_name)
2222

2323

24-
func _input(event):
24+
func _unhandled_input(event):
2525
# Here we only handle input that can interrupt states, attacking in this case,
2626
# otherwise we let the state node handle it.
2727
if event.is_action_pressed("attack"):

2d/finite_state_machine/player/weapon/sword.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func _change_state(new_state):
5959
state = new_state
6060

6161

62-
func _input(event):
62+
func _unhandled_input(event):
6363
if not state == States.ATTACK:
6464
return
6565
if attack_input_state != AttackInputStates.LISTENING:

2d/finite_state_machine/state_machine/state_machine.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func set_active(value):
4141
current_state = null
4242

4343

44-
func _input(event):
44+
func _unhandled_input(event):
4545
current_state.handle_input(event)
4646

4747

2d/hdr/beach_cave.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const CAVE_LIMIT = 1000
44

55
onready var cave = $Cave
66

7-
func _input(event):
7+
func _unhandled_input(event):
88
if event is InputEventMouseMotion and event.button_mask > 0:
99
var rel_x = event.relative.x
1010
var cavepos = cave.position

2d/navigation/navigation.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ func _process(delta):
1010

1111
# The 'click' event is a custom input action defined in
1212
# Project > Project Settings > Input Map tab.
13-
func _input(event):
13+
func _unhandled_input(event):
1414
if not event.is_action_pressed("click"):
1515
return
1616
_update_navigation_path($Character.position, get_local_mouse_position())

2d/navigation_astar/character.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func _process(_delta):
2727
_target_point_world = _path[0]
2828

2929

30-
func _input(event):
30+
func _unhandled_input(event):
3131
if event.is_action_pressed("click"):
3232
var global_mouse_pos = get_global_mouse_position()
3333
if Input.is_key_pressed(KEY_SHIFT):

2d/navigation_astar/pathfind_astar.gd

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,6 @@ func _draw():
4242
last_point = current_point
4343

4444

45-
# Click and Shift force the start and end position of the path to update,
46-
# and the node to redraw everything.
47-
#func _input(event):
48-
# if event.is_action_pressed('click') and Input.is_key_pressed(KEY_SHIFT):
49-
# # To call the setter method from this script we have to use the explicit self.
50-
# self.path_start_position = world_to_map(get_global_mouse_position())
51-
# elif event.is_action_pressed('click'):
52-
# self.path_end_position = world_to_map(get_global_mouse_position())
53-
54-
5545
# Loops through all cells within the map's bounds and
5646
# adds all points to the astar_node, except the obstacles.
5747
func astar_add_walkable_cells(obstacle_list = []):

2d/platformer/assets/art/tileset/tileset.tres

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ points = PoolVector2Array( 0, 0, 28, 0, 28, 24, 0, 24 )
4747
0/tile_mode = 0
4848
0/occluder_offset = Vector2( 0, 0 )
4949
0/navigation_offset = Vector2( 0, 0 )
50+
0/shape_offset = Vector2( 0, 0 )
51+
0/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
52+
0/shape = SubResource( 1 )
53+
0/shape_one_way = false
54+
0/shape_one_way_margin = 1.0
5055
0/shapes = [ {
5156
"autotile_coord": Vector2( 0, 0 ),
5257
"one_way": false,
@@ -63,6 +68,11 @@ points = PoolVector2Array( 0, 0, 28, 0, 28, 24, 0, 24 )
6368
1/tile_mode = 0
6469
1/occluder_offset = Vector2( 0, 0 )
6570
1/navigation_offset = Vector2( 0, 0 )
71+
1/shape_offset = Vector2( 0, 0 )
72+
1/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
73+
1/shape = SubResource( 2 )
74+
1/shape_one_way = false
75+
1/shape_one_way_margin = 1.0
6676
1/shapes = [ {
6777
"autotile_coord": Vector2( 0, 0 ),
6878
"one_way": false,
@@ -79,6 +89,11 @@ points = PoolVector2Array( 0, 0, 28, 0, 28, 24, 0, 24 )
7989
2/tile_mode = 0
8090
2/occluder_offset = Vector2( 0, 0 )
8191
2/navigation_offset = Vector2( 0, 0 )
92+
2/shape_offset = Vector2( 0, 0 )
93+
2/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
94+
2/shape = SubResource( 5 )
95+
2/shape_one_way = false
96+
2/shape_one_way_margin = 1.0
8297
2/shapes = [ {
8398
"autotile_coord": Vector2( 0, 0 ),
8499
"one_way": false,
@@ -95,6 +110,11 @@ points = PoolVector2Array( 0, 0, 28, 0, 28, 24, 0, 24 )
95110
3/tile_mode = 0
96111
3/occluder_offset = Vector2( 0, 0 )
97112
3/navigation_offset = Vector2( 0, 0 )
113+
3/shape_offset = Vector2( 0, 0 )
114+
3/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
115+
3/shape = SubResource( 6 )
116+
3/shape_one_way = false
117+
3/shape_one_way_margin = 1.0
98118
3/shapes = [ {
99119
"autotile_coord": Vector2( 0, 0 ),
100120
"one_way": false,
@@ -111,6 +131,11 @@ points = PoolVector2Array( 0, 0, 28, 0, 28, 24, 0, 24 )
111131
4/tile_mode = 0
112132
4/occluder_offset = Vector2( 0, 0 )
113133
4/navigation_offset = Vector2( 0, 0 )
134+
4/shape_offset = Vector2( 0, 0 )
135+
4/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
136+
4/shape = SubResource( 7 )
137+
4/shape_one_way = false
138+
4/shape_one_way_margin = 1.0
114139
4/shapes = [ {
115140
"autotile_coord": Vector2( 0, 0 ),
116141
"one_way": false,
@@ -127,6 +152,11 @@ points = PoolVector2Array( 0, 0, 28, 0, 28, 24, 0, 24 )
127152
5/tile_mode = 0
128153
5/occluder_offset = Vector2( 0, 0 )
129154
5/navigation_offset = Vector2( 0, 0 )
155+
5/shape_offset = Vector2( 0, 0 )
156+
5/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
157+
5/shape = SubResource( 8 )
158+
5/shape_one_way = true
159+
5/shape_one_way_margin = 1.0
130160
5/shapes = [ {
131161
"autotile_coord": Vector2( 0, 0 ),
132162
"one_way": true,
@@ -143,6 +173,11 @@ points = PoolVector2Array( 0, 0, 28, 0, 28, 24, 0, 24 )
143173
6/tile_mode = 0
144174
6/occluder_offset = Vector2( 0, 0 )
145175
6/navigation_offset = Vector2( 0, 0 )
176+
6/shape_offset = Vector2( 0, 0 )
177+
6/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
178+
6/shape = SubResource( 9 )
179+
6/shape_one_way = true
180+
6/shape_one_way_margin = 1.0
146181
6/shapes = [ {
147182
"autotile_coord": Vector2( 0, 0 ),
148183
"one_way": true,
@@ -159,6 +194,11 @@ points = PoolVector2Array( 0, 0, 28, 0, 28, 24, 0, 24 )
159194
7/tile_mode = 0
160195
7/occluder_offset = Vector2( 0, 0 )
161196
7/navigation_offset = Vector2( 0, 0 )
197+
7/shape_offset = Vector2( 0, 0 )
198+
7/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
199+
7/shape = SubResource( 10 )
200+
7/shape_one_way = false
201+
7/shape_one_way_margin = 1.0
162202
7/shapes = [ {
163203
"autotile_coord": Vector2( 0, 0 ),
164204
"one_way": false,
@@ -175,6 +215,11 @@ points = PoolVector2Array( 0, 0, 28, 0, 28, 24, 0, 24 )
175215
8/tile_mode = 0
176216
8/occluder_offset = Vector2( 0, 0 )
177217
8/navigation_offset = Vector2( 0, 0 )
218+
8/shape_offset = Vector2( 0, 0 )
219+
8/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
220+
8/shape = SubResource( 11 )
221+
8/shape_one_way = false
222+
8/shape_one_way_margin = 1.0
178223
8/shapes = [ {
179224
"autotile_coord": Vector2( 0, 0 ),
180225
"one_way": false,
@@ -191,6 +236,11 @@ points = PoolVector2Array( 0, 0, 28, 0, 28, 24, 0, 24 )
191236
9/tile_mode = 0
192237
9/occluder_offset = Vector2( 0, 0 )
193238
9/navigation_offset = Vector2( 0, 0 )
239+
9/shape_offset = Vector2( 0, 0 )
240+
9/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
241+
9/shape = SubResource( 12 )
242+
9/shape_one_way = false
243+
9/shape_one_way_margin = 1.0
194244
9/shapes = [ {
195245
"autotile_coord": Vector2( 0, 0 ),
196246
"one_way": false,
@@ -207,6 +257,11 @@ points = PoolVector2Array( 0, 0, 28, 0, 28, 24, 0, 24 )
207257
10/tile_mode = 0
208258
10/occluder_offset = Vector2( 0, 0 )
209259
10/navigation_offset = Vector2( 0, 0 )
260+
10/shape_offset = Vector2( 0, 0 )
261+
10/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
262+
10/shape = SubResource( 3 )
263+
10/shape_one_way = false
264+
10/shape_one_way_margin = 1.0
210265
10/shapes = [ {
211266
"autotile_coord": Vector2( 0, 0 ),
212267
"one_way": false,
@@ -223,6 +278,10 @@ points = PoolVector2Array( 0, 0, 28, 0, 28, 24, 0, 24 )
223278
11/tile_mode = 0
224279
11/occluder_offset = Vector2( 0, 0 )
225280
11/navigation_offset = Vector2( 0, 0 )
281+
11/shape_offset = Vector2( 0, 0 )
282+
11/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
283+
11/shape_one_way = false
284+
11/shape_one_way_margin = 0.0
226285
11/shapes = [ ]
227286
11/z_index = 0
228287
12/name = "tree_trunk_1"
@@ -233,6 +292,10 @@ points = PoolVector2Array( 0, 0, 28, 0, 28, 24, 0, 24 )
233292
12/tile_mode = 0
234293
12/occluder_offset = Vector2( 0, 0 )
235294
12/navigation_offset = Vector2( 0, 0 )
295+
12/shape_offset = Vector2( 0, 0 )
296+
12/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
297+
12/shape_one_way = false
298+
12/shape_one_way_margin = 0.0
236299
12/shapes = [ ]
237300
12/z_index = 0
238301
13/name = "tree_base"
@@ -243,6 +306,11 @@ points = PoolVector2Array( 0, 0, 28, 0, 28, 24, 0, 24 )
243306
13/tile_mode = 0
244307
13/occluder_offset = Vector2( 0, 0 )
245308
13/navigation_offset = Vector2( 0, 0 )
309+
13/shape_offset = Vector2( 0, 0 )
310+
13/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
311+
13/shape = SubResource( 4 )
312+
13/shape_one_way = false
313+
13/shape_one_way_margin = 1.0
246314
13/shapes = [ {
247315
"autotile_coord": Vector2( 0, 0 ),
248316
"one_way": false,
@@ -259,5 +327,9 @@ points = PoolVector2Array( 0, 0, 28, 0, 28, 24, 0, 24 )
259327
14/tile_mode = 0
260328
14/occluder_offset = Vector2( 0, 0 )
261329
14/navigation_offset = Vector2( 0, 0 )
330+
14/shape_offset = Vector2( 0, 0 )
331+
14/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
332+
14/shape_one_way = false
333+
14/shape_one_way_margin = 0.0
262334
14/shapes = [ ]
263335
14/z_index = 0

2d/platformer/project.godot

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ shoot={
142142
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":2,"pressure":0.0,"pressed":false,"script":null)
143143
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":90,"unicode":0,"echo":false,"script":null)
144144
, Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":1,"pressed":false,"doubleclick":false,"script":null)
145+
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777350,"unicode":0,"echo":false,"script":null)
146+
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777238,"unicode":0,"echo":false,"script":null)
145147
]
146148
}
147149
toggle_fullscreen={

0 commit comments

Comments
 (0)