Skip to content

Commit c7ac205

Browse files
committed
Revert using NodePath for input
Because it leads to heaps of problems because godot can't load absolute paths while outside of the scene tree. commit 4d8dc1a Author: Moritz Tim W <[email protected]> Date: Thu Nov 16 14:40:31 2023 +0100 bump version commit cc0a82e Author: Moritz Tim W <[email protected]> Date: Thu Nov 16 14:35:27 2023 +0100 Revert "update doc comment" This reverts commit 78839a8. commit 9e2ab58 Author: Moritz Tim W. <[email protected]> Date: Thu Nov 16 14:36:37 2023 +0100 Revert "Limit selectable inputs" This reverts commit 9d09a45. commit 323aed6 Author: Moritz Tim W. <[email protected]> Date: Thu Nov 16 14:36:22 2023 +0100 Revert "Document changes" This reverts commit 7b5b8ab. commit 7387fd8 Author: Moritz Tim W. <[email protected]> Date: Thu Nov 16 14:36:07 2023 +0100 Revert "backwards compatibility" This reverts commit 621a6a5. commit 8fced17 Author: Moritz Tim W. <[email protected]> Date: Thu Nov 16 14:35:58 2023 +0100 Revert "prevent input path recursion and edge cases" This reverts commit 438acfb. commit abd1669 Author: Moritz Tim W. <[email protected]> Date: Thu Nov 16 14:35:27 2023 +0100 Revert "update doc comment" This reverts commit 78839a8.
1 parent 7bc8139 commit c7ac205

File tree

4 files changed

+5
-30
lines changed

4 files changed

+5
-30
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Get a form up and running in 10 steps.
2727
5. Finally, add a [`Submit`](https://github.com/moritz-t-w/Godot-Form-AL/wiki/Code-Reference#submit) button.
2828
### Hooking everything up
2929
6. In the inspector of your [`Form`](https://github.com/moritz-t-w/Godot-Form-AL/wiki/Code-Reference#Form), set the [`Submit Button`](https://github.com/moritz-t-w/Godot-Form-AL/wiki/Code-Reference#submit_button-submit) property to your [`Submit`](https://github.com/moritz-t-w/Godot-Form-AL/wiki/Code-Reference#submit) button.
30-
7. In the inspector of each element, point the [`input_path`](https://github.com/moritz-t-w/Godot-Form-AL/wiki/Code-Reference#input_path-nodepath) property to the corresponding `Control` node.
30+
7. In the inspector of each element, set the [`input`](https://github.com/moritz-t-w/Godot-Form-AL/wiki/Code-Reference#input-control) property to the corresponding `Control` node.
3131
### Configuring the form
3232
8. In the inspector of your [`Form`](https://github.com/moritz-t-w/Godot-Form-AL/wiki/Code-Reference#Form), choose and set up a [`Protocol`](https://github.com/moritz-t-w/Godot-Form-AL/wiki/Code-Reference#protocol-resource).
3333
Currently supported protocols are:

addons/form/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Get a form up and running in 10 steps.
2727
5. Finally, add a [`Submit`](https://github.com/moritz-t-w/Godot-Form-AL/wiki/Code-Reference#submit) button.
2828
### Hooking everything up
2929
6. In the inspector of your [`Form`](https://github.com/moritz-t-w/Godot-Form-AL/wiki/Code-Reference#Form), set the [`Submit Button`](https://github.com/moritz-t-w/Godot-Form-AL/wiki/Code-Reference#submit_button-submit) property to your [`Submit`](https://github.com/moritz-t-w/Godot-Form-AL/wiki/Code-Reference#submit) button.
30-
7. In the inspector of each element, point the [`input_path`](https://github.com/moritz-t-w/Godot-Form-AL/wiki/Code-Reference#input_path-nodepath) property to the corresponding `Control` node.
30+
7. In the inspector of each element, set the [`input`](https://github.com/moritz-t-w/Godot-Form-AL/wiki/Code-Reference#input-control) property to the corresponding `Control` node.
3131
### Configuring the form
3232
8. In the inspector of your [`Form`](https://github.com/moritz-t-w/Godot-Form-AL/wiki/Code-Reference#Form), choose and set up a [`Protocol`](https://github.com/moritz-t-w/Godot-Form-AL/wiki/Code-Reference#protocol-resource).
3333
Currently supported protocols are:

addons/form/nodes/FormLabel.gd

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,9 @@
22
## Label for input controls
33
class_name FormLabel extends Label
44

5-
## Path to input control
6-
@export_node_path(
7-
"CheckBox",
8-
"CheckButton",
9-
"OptionButton",
10-
"Submit",
11-
"LineEdit",
12-
"TextEdit",
13-
"ItemList",
14-
"Slider",
15-
"SpinBox",
16-
"GraphEdit"
17-
) var input_path: NodePath:
18-
set(new_val):
19-
_input_path = new_val
20-
if is_inside_tree():
21-
input = get_node_or_null(_input_path)
22-
get:
23-
if _input_path not in [null, ""] && input != null:
24-
return input.get_path() # mainly for when u switched from a previous version that exported input.
25-
return _input_path #TODO can't return null here, maybe there's another way. This is fine tho, I can't imagine a situation where input is null but input_path is not.
26-
27-
## Internal storage for input_path
28-
var _input_path: NodePath
295

306
## Input control to label
31-
## Must be an input according to Form.is_input or null
32-
var input: Control:
7+
@export var input: Control:
338
set(new_val):
349
if new_val == null || Form.is_input(new_val):
3510
if input != null:
@@ -40,7 +15,7 @@ var input: Control:
4015
if validate_on_input && input != null:
4116
input.gui_input.connect(_on_gui_input)
4217
else:
43-
printerr(get_class(),": input must be a input button or input field.\nIf you set this using input_path, please report an issue because you should not have been able to select a non-input node.")
18+
printerr(get_class(),": input must be a input button or input field")
4419
## "Input value must not be empty"
4520
@export var input_required := false:
4621
set(new_val):

addons/form/plugin.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
name="GodotForm"
44
description="All the tools you need for serving and validating forms."
55
author="Moritz Tim Widmann @ TWEAKLAB"
6-
version="2.1.2-beta"
6+
version="3.0.0-beta"
77
script="plugin.gd"

0 commit comments

Comments
 (0)