gdharness 1.3.35 → 1.3.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cli.js +288 -78
- package/build/godot/addons/gdharness_editor/animation_reads.gd +17 -1
- package/build/godot/addons/gdharness_editor/reading.gd +10 -2
- package/build/godot/addons/gdharness_editor/scene_file.gd +12 -6
- package/build/godot/addons/gdharness_editor/tools/animation_tracks.gd +57 -0
- package/build/godot/addons/gdharness_editor/tools/filesystem_tools.gd +16 -0
- package/build/godot/addons/gdharness_editor/tools/navigation_bake.gd +81 -4
- package/build/godot/addons/gdharness_editor/tools/resource_tools.gd +3 -3
- package/build/godot/addons/gdharness_editor/tools/scene_kin.gd +4 -2
- package/build/godot/addons/gdharness_editor/tools/scene_paths.gd +59 -0
- package/build/godot/addons/gdharness_editor/tools/script_paths.gd +148 -0
- package/build/godot/addons/gdharness_editor/tools/script_paths.gd.uid +1 -0
- package/build/godot/addons/gdharness_runtime/reading.gd +10 -2
- package/build/godot/addons/gdharness_runtime/runtime_hover.gd +70 -0
- package/build/godot/addons/gdharness_runtime/runtime_input.gd +223 -248
- package/build/godot/addons/gdharness_runtime/runtime_mouse.gd +128 -5
- package/build/godot/addons/gdharness_runtime/runtime_screen.gd +107 -0
- package/build/godot/addons/gdharness_runtime/runtime_targets.gd +15 -1
- package/build/godot/addons/gdharness_runtime/runtime_waits.gd +8 -0
- package/build/godot/addons/gdharness_runtime/runtime_words.gd +22 -0
- package/build/godot/operations/animation_reads.gd +17 -1
- package/build/godot/operations/classdb_queries.gd +16 -0
- package/build/godot/operations/dependencies.gd +46 -4
- package/build/godot/operations/editor_tools.gd +5 -5
- package/build/godot/operations/gdscript_authoring.gd +7 -3
- package/build/godot/operations/input_actions.gd +105 -0
- package/build/godot/operations/project_diagnostics.gd +4 -0
- package/build/godot/operations/project_validation.gd +15 -0
- package/build/godot/operations/reading.gd +10 -2
- package/build/keeper.js +5 -5
- package/package.json +1 -1
|
@@ -27,6 +27,11 @@ var _supplied: Dictionary[int, Array] = {}
|
|
|
27
27
|
var _listened: Dictionary[int, bool] = {}
|
|
28
28
|
var _inside: Dictionary[int, bool] = {}
|
|
29
29
|
|
|
30
|
+
## The windows told here that the pointer is in them, and whether the telling is under way, since the
|
|
31
|
+
## window answers it with the same mouse_entered the platform's enter sends.
|
|
32
|
+
var _told: Dictionary[int, bool] = {}
|
|
33
|
+
var _telling: bool = false
|
|
34
|
+
|
|
30
35
|
## Whether a script on a control declares `_has_point`, per script, since the search asks it of
|
|
31
36
|
## every control it passes.
|
|
32
37
|
var _shapes: Dictionary[Script, bool] = {}
|
|
@@ -51,10 +56,26 @@ func follow(viewport: Viewport, point: Vector2) -> bool:
|
|
|
51
56
|
if not cannot_hover(window) or window.gui_get_hovered_control() != null:
|
|
52
57
|
_drop(window, 0)
|
|
53
58
|
return false
|
|
59
|
+
_tell_entered(window)
|
|
54
60
|
_hover(window, point)
|
|
55
61
|
return _supplied.has(window.get_instance_id())
|
|
56
62
|
|
|
57
63
|
|
|
64
|
+
## Tells [param window] the pointer is in it, as Viewport.notify_mouse_entered is documented for
|
|
65
|
+
## input pushed into a viewport. A native window hands a motion to the control under it only once
|
|
66
|
+
## told, and only the platform's enter tells it: a motion pushed there reached no control's
|
|
67
|
+
## _gui_input, so a control that draws its parts could be pressed and never hovered. Once a window,
|
|
68
|
+
## until the platform says the pointer left it, since telling it twice is a warning.
|
|
69
|
+
func _tell_entered(window: Window) -> void:
|
|
70
|
+
var id: int = window.get_instance_id()
|
|
71
|
+
if _told.get(id, false):
|
|
72
|
+
return
|
|
73
|
+
_told[id] = true
|
|
74
|
+
_telling = true
|
|
75
|
+
window.notify_mouse_entered()
|
|
76
|
+
_telling = false
|
|
77
|
+
|
|
78
|
+
|
|
58
79
|
## The control hovered in [param viewport], by the engine or by this.
|
|
59
80
|
func hovered_in(viewport: Viewport) -> Control:
|
|
60
81
|
var own: Control = viewport.gui_get_hovered_control()
|
|
@@ -82,12 +103,15 @@ func _listen(window: Window) -> void:
|
|
|
82
103
|
|
|
83
104
|
|
|
84
105
|
func _entered(window: Window) -> void:
|
|
106
|
+
if _telling:
|
|
107
|
+
return
|
|
85
108
|
_inside[window.get_instance_id()] = true
|
|
86
109
|
_drop(window, 0)
|
|
87
110
|
|
|
88
111
|
|
|
89
112
|
func _left(window: Window) -> void:
|
|
90
113
|
_inside[window.get_instance_id()] = false
|
|
114
|
+
_told[window.get_instance_id()] = false
|
|
91
115
|
|
|
92
116
|
|
|
93
117
|
## Viewport::_update_mouse_over for [param point]: the control under it entered, from the outermost
|
|
@@ -201,6 +225,52 @@ func control_at(viewport: Viewport, point: Vector2) -> Control:
|
|
|
201
225
|
return null
|
|
202
226
|
|
|
203
227
|
|
|
228
|
+
## What a pointer answer says of a press at [param position], in [param viewport]'s window pixels:
|
|
229
|
+
## press_went_to, the path of what the GUI hands it to or null, and for a press aimed at a control,
|
|
230
|
+
## landed, whether that is the control or inside it. Read before the press, which can free both. A
|
|
231
|
+
## press aimed at a slider that went to a button drawn over it answered the slider's path alone,
|
|
232
|
+
## and the caller read that as the slider having been pressed.
|
|
233
|
+
func press_of(aim: Dictionary, viewport: Viewport, position: Vector2) -> Dictionary:
|
|
234
|
+
var took: Node = _pressed_at(viewport, viewport.get_final_transform().affine_inverse() * position)
|
|
235
|
+
var said: Dictionary = {"press_went_to": null}
|
|
236
|
+
if took != null:
|
|
237
|
+
said["press_went_to"] = str(took.get_path())
|
|
238
|
+
var named: Object = aim.get("node")
|
|
239
|
+
var aimed: Control = named as Control
|
|
240
|
+
if aimed != null:
|
|
241
|
+
said["landed"] = took != null and (took == aimed or aimed.is_ancestor_of(took))
|
|
242
|
+
return said
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
## What a press at [param point], in [param viewport]'s own coordinates, goes to: the control the
|
|
246
|
+
## GUI picks, carried into a window embedded over the point and into what a SubViewportContainer
|
|
247
|
+
## shows, as the engine carries it; null when nothing there takes the pointer.
|
|
248
|
+
func _pressed_at(viewport: Viewport, point: Vector2) -> Node:
|
|
249
|
+
var windows: Array[Window] = viewport.get_embedded_subwindows()
|
|
250
|
+
for index: int in range(windows.size() - 1, -1, -1):
|
|
251
|
+
var window: Window = windows[index]
|
|
252
|
+
if Rect2(window.position, window.size).has_point(point):
|
|
253
|
+
var inward: Transform2D = window.get_final_transform().affine_inverse()
|
|
254
|
+
var within: Node = _pressed_at(window, inward * (point - Vector2(window.position)))
|
|
255
|
+
if within == null:
|
|
256
|
+
return window
|
|
257
|
+
return within
|
|
258
|
+
var over: Control = control_at(viewport, point)
|
|
259
|
+
var container: SubViewportContainer = over as SubViewportContainer
|
|
260
|
+
if container == null:
|
|
261
|
+
return over
|
|
262
|
+
var inside: Vector2 = container.get_global_transform_with_canvas().affine_inverse() * point
|
|
263
|
+
if container.stretch:
|
|
264
|
+
inside /= container.stretch_shrink
|
|
265
|
+
for child: Node in container.get_children():
|
|
266
|
+
var shown: SubViewport = child as SubViewport
|
|
267
|
+
if shown != null and not shown.gui_disable_input:
|
|
268
|
+
var within: Node = _pressed_at(shown, shown.get_final_transform().affine_inverse() * inside)
|
|
269
|
+
if within != null:
|
|
270
|
+
return within
|
|
271
|
+
return container
|
|
272
|
+
|
|
273
|
+
|
|
204
274
|
## The controls [param node] holds that the engine keeps as roots of [param node]'s viewport: drawn
|
|
205
275
|
## on their own, or with no control above them. Not into another viewport, a window or a
|
|
206
276
|
## SubViewport, whose controls are that one's.
|