mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-22 07:28:14 +00:00
OK NOW ITS DONE I SWEAR
This commit is contained in:
@@ -117,13 +117,14 @@ func map_event_to_action(event, idx := 0) -> void:
|
|||||||
elif type == 1 and (i is InputEventJoypadButton or i is InputEventJoypadMotion):
|
elif type == 1 and (i is InputEventJoypadButton or i is InputEventJoypadMotion):
|
||||||
matching_type_events.append(i)
|
matching_type_events.append(i)
|
||||||
if matching_type_events.size() - 1 < idx or matching_type_events.is_empty():
|
if matching_type_events.size() - 1 < idx or matching_type_events.is_empty():
|
||||||
matching_type_events.append(event)
|
events.append(event)
|
||||||
replace_event = matching_type_events[clamp(idx, 0, matching_type_events.size() - 1)]
|
else:
|
||||||
var itr := 0
|
replace_event = matching_type_events[clamp(idx, 0, matching_type_events.size() - 1)]
|
||||||
for i in events:
|
var itr := 0
|
||||||
if i == replace_event:
|
for i in events:
|
||||||
events[itr] = event
|
if i == replace_event:
|
||||||
itr += 1
|
events[itr] = event
|
||||||
|
itr += 1
|
||||||
InputMap.action_erase_events(action)
|
InputMap.action_erase_events(action)
|
||||||
for i in events:
|
for i in events:
|
||||||
InputMap.action_add_event(action, i)
|
InputMap.action_add_event(action, i)
|
||||||
|
Reference in New Issue
Block a user