diff options
Diffstat (limited to 'logic')
| -rw-r--r-- | logic/database.gd | 1 | ||||
| -rw-r--r-- | logic/stage.gd | 25 |
2 files changed, 25 insertions, 1 deletions
diff --git a/logic/database.gd b/logic/database.gd index de978b7..3d74da3 100644 --- a/logic/database.gd +++ b/logic/database.gd @@ -151,7 +151,6 @@ func store_database(file_path: String = DATABASE_FILE_PATH): file.open(file_path, File.WRITE) var header := PoolStringArray(DatabaseEntry.ENTRY_PROTOTYPE.keys()) file.store_csv_line(header) - var entry := PoolStringArray() for it in db: # @DAM This approach depends on the order the dictionary fields are created. file.store_csv_line(it.values()) diff --git a/logic/stage.gd b/logic/stage.gd index 12457c9..e4627c2 100644 --- a/logic/stage.gd +++ b/logic/stage.gd @@ -69,6 +69,13 @@ func _ready(): save_button.connect("pressed", self, "save_action") discard_button.connect("pressed", self, "discard_action") + for it in get_node("controls").get_children(): + it = it as Control + if it is LineEdit: + it.connect("focus_entered", it, "set_cursor_position", [99999999]) # @DAM Use MAX_INT + it.connect("focus_exited", it, "deselect") + + var auto_place := place.get_node("auto") as Button auto_place.connect("pressed", self, "auto_populate", ["place"]) @@ -168,3 +175,21 @@ func clear_filters(save_changes: bool = false): store_filters() +func pointer_input_on_click_handler(pointer: PointerInputSensor.PointerInputData): + .pointer_input_on_click_handler(pointer) + + var target: Control = pointer.target.get_parent() + var button: Button + if target is Button: + button = target + elif target.get_node("auto") is Button: + button = target.get_node("auto") + + if button != null && button.get_global_rect().has_point(pointer.current_position): + if button is CheckBox || button is CheckButton: + button.pressed = !button.pressed + button.emit_signal("button_down") + button.emit_signal("pressed") + button.emit_signal("button_up") + + |
