-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: basic (tho buggy) control editing in place
- Loading branch information
1 parent
672784c
commit ce14eba
Showing
4 changed files
with
78 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,37 @@ | ||
@tool | ||
extends CanvasLayer | ||
|
||
@onready var edit_action_scene = preload("res://src/menus/EditActionRow.tscn") | ||
## vars ###############################################3 | ||
|
||
@onready var edit_action_scene = preload("res://src/menus/EditActionRow.tscn") | ||
@onready var action_rows = $%EditActionRows | ||
@onready var reset_all_button = $%ResetButton | ||
|
||
var displayed_actions = [ | ||
"ui_accept", "ui_undo", "pause", "close", "restart", | ||
"ui_left", "ui_right", "ui_up", "ui_down" | ||
] | ||
|
||
## ready ###############################################3 | ||
|
||
func _ready(): | ||
Log.pr("displayed actions", displayed_actions) | ||
|
||
render_action_rows() | ||
reset_all_button.pressed.connect(on_reset_all_pressed) | ||
|
||
## render ###############################################3 | ||
|
||
func render_action_rows(): | ||
U.remove_children(action_rows) | ||
for action in displayed_actions: | ||
var row = edit_action_scene.instantiate() | ||
row.action_name = action | ||
action_rows.add_child(row) | ||
|
||
## reset all ###############################################3 | ||
|
||
func on_reset_all_pressed(): | ||
Log.pr("resetting all actions!") | ||
InputHelper.reset_all_actions() | ||
render_action_rows() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters