gdharness 1.3.0 → 1.3.2

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.
Files changed (72) hide show
  1. package/build/cli.js +322 -96
  2. package/build/godot/addons/gdharness_editor/animation_reads.gd +7 -19
  3. package/build/godot/addons/gdharness_editor/bridge_client.gd +8 -8
  4. package/build/godot/addons/gdharness_editor/declared_values.gd +116 -0
  5. package/build/godot/addons/gdharness_editor/declared_values.gd.uid +1 -0
  6. package/build/godot/addons/gdharness_editor/file_reads.gd +65 -25
  7. package/build/godot/addons/gdharness_editor/headless_check.gd +7 -7
  8. package/build/godot/addons/gdharness_editor/plugin.gd +6 -6
  9. package/build/godot/addons/gdharness_editor/property_values.gd +222 -59
  10. package/build/godot/addons/gdharness_editor/reading.gd +65 -0
  11. package/build/godot/addons/gdharness_editor/scene_file.gd +28 -23
  12. package/build/godot/addons/gdharness_editor/serialisation.gd +49 -94
  13. package/build/godot/addons/gdharness_editor/tool_executor.gd +24 -24
  14. package/build/godot/addons/gdharness_editor/tools/animation_tools.gd +52 -41
  15. package/build/godot/addons/gdharness_editor/tools/filesystem_tools.gd +4 -4
  16. package/build/godot/addons/gdharness_editor/tools/play_tools.gd +2 -2
  17. package/build/godot/addons/gdharness_editor/tools/profile_tools.gd +14 -14
  18. package/build/godot/addons/gdharness_editor/tools/resource_tools.gd +175 -74
  19. package/build/godot/addons/gdharness_editor/tools/scene_kin.gd +17 -17
  20. package/build/godot/addons/gdharness_editor/tools/scene_paths.gd +14 -12
  21. package/build/godot/addons/gdharness_editor/tools/scene_placing.gd +7 -7
  22. package/build/godot/addons/gdharness_editor/tools/scene_tools.gd +88 -84
  23. package/build/godot/addons/gdharness_editor/tools/settings_tools.gd +4 -4
  24. package/build/godot/addons/gdharness_editor/value_shapes.gd +118 -0
  25. package/build/godot/addons/gdharness_editor/value_shapes.gd.uid +1 -0
  26. package/build/godot/addons/gdharness_runtime/reading.gd +65 -0
  27. package/build/godot/addons/gdharness_runtime/runtime_accessibility.gd +18 -18
  28. package/build/godot/addons/gdharness_runtime/runtime_autoload.gd +29 -29
  29. package/build/godot/addons/gdharness_runtime/runtime_capture.gd +21 -18
  30. package/build/godot/addons/gdharness_runtime/runtime_changes.gd +86 -80
  31. package/build/godot/addons/gdharness_runtime/runtime_input.gd +65 -64
  32. package/build/godot/addons/gdharness_runtime/runtime_items.gd +6 -6
  33. package/build/godot/addons/gdharness_runtime/runtime_menus.gd +8 -8
  34. package/build/godot/addons/gdharness_runtime/runtime_mouse.gd +6 -6
  35. package/build/godot/addons/gdharness_runtime/runtime_pad.gd +10 -10
  36. package/build/godot/addons/gdharness_runtime/runtime_paths.gd +7 -7
  37. package/build/godot/addons/gdharness_runtime/runtime_queries.gd +41 -41
  38. package/build/godot/addons/gdharness_runtime/runtime_says.gd +3 -3
  39. package/build/godot/addons/gdharness_runtime/runtime_targets.gd +33 -33
  40. package/build/godot/addons/gdharness_runtime/runtime_typing.gd +20 -20
  41. package/build/godot/addons/gdharness_runtime/runtime_values.gd +52 -25
  42. package/build/godot/addons/gdharness_runtime/runtime_waits.gd +56 -50
  43. package/build/godot/addons/gdharness_runtime/serialisation.gd +49 -94
  44. package/build/godot/addons/gdharness_runtime/value_shapes.gd +118 -0
  45. package/build/godot/addons/gdharness_runtime/value_shapes.gd.uid +1 -0
  46. package/build/godot/operations/animation_reads.gd +7 -19
  47. package/build/godot/operations/audio_buses.gd +10 -10
  48. package/build/godot/operations/class_cache.gd +16 -16
  49. package/build/godot/operations/classdb_queries.gd +25 -15
  50. package/build/godot/operations/declared_values.gd +116 -0
  51. package/build/godot/operations/dependencies.gd +141 -33
  52. package/build/godot/operations/editor_tools.gd +12 -12
  53. package/build/godot/operations/export_presets.gd +14 -14
  54. package/build/godot/operations/file_reads.gd +65 -25
  55. package/build/godot/operations/file_walk.gd +34 -0
  56. package/build/godot/operations/gdscript_analysis.gd +27 -22
  57. package/build/godot/operations/gdscript_authoring.gd +122 -17
  58. package/build/godot/operations/godot_operations.gd +66 -63
  59. package/build/godot/operations/import_pipeline.gd +59 -20
  60. package/build/godot/operations/input_actions.gd +90 -18
  61. package/build/godot/operations/logger.gd +1 -1
  62. package/build/godot/operations/plugins.gd +8 -8
  63. package/build/godot/operations/project_config.gd +83 -20
  64. package/build/godot/operations/project_diagnostics.gd +36 -11
  65. package/build/godot/operations/property_values.gd +222 -59
  66. package/build/godot/operations/reading.gd +65 -0
  67. package/build/godot/operations/rename_checks.gd +3 -3
  68. package/build/godot/operations/resource_files.gd +9 -6
  69. package/build/godot/operations/script_check.gd +23 -7
  70. package/build/godot/operations/serialisation.gd +49 -94
  71. package/build/godot/operations/value_shapes.gd +118 -0
  72. package/package.json +1 -1
@@ -11,9 +11,9 @@ extends RefCounted
11
11
 
12
12
  enum { UNCHANGED, REWRITTEN, DELETED }
13
13
 
14
- const HeadlessCheck = preload("../headless_check.gd")
15
- const Read = preload("../reading.gd")
16
- const SceneFile = preload("../scene_file.gd")
14
+ const GdhHeadlessCheck = preload("../headless_check.gd")
15
+ const GdhRead = preload("../reading.gd")
16
+ const GdhSceneFile = preload("../scene_file.gd")
17
17
  ## PROPERTY_HINT_NO_NODEPATH, which marks a property the editor's rename skips. It is not bound for
18
18
  ## scripts, and follows PROPERTY_HINT_ONESHOT in the engine's list.
19
19
  const HINT_NO_NODEPATH: int = PROPERTY_HINT_ONESHOT + 1
@@ -30,7 +30,7 @@ var _homes: Dictionary = {}
30
30
  ## it had, its record, the file]. The editor shares such a resource with every scene using it, so a
31
31
  ## rewrite that is not saved is put back.
32
32
  var _outside: Array[Array] = []
33
- var _scene: SceneFile = null
33
+ var _scene: GdhSceneFile = null
34
34
  var _moves: Dictionary = {}
35
35
  var _back: Dictionary = {}
36
36
  var _seen: Dictionary = {}
@@ -50,7 +50,7 @@ static func moved(given: String, moves: Dictionary) -> String:
50
50
 
51
51
  ## Carries [param moves], from the root of [param scene], into the paths it holds. Called after the
52
52
  ## move and before the write. Answers how many paths it rewrote.
53
- func carry(scene: SceneFile, moves: Dictionary) -> int:
53
+ func carry(scene: GdhSceneFile, moves: Dictionary) -> int:
54
54
  if moves.is_empty():
55
55
  return 0
56
56
  _scene = scene
@@ -92,7 +92,7 @@ func carry(scene: SceneFile, moves: Dictionary) -> int:
92
92
  ## Opens [param scene_path], carries [param moves] into it, and writes it when that rewrote a path.
93
93
  ## Answers "" or why it was left as it was.
94
94
  func carry_into(scene_path: String, moves: Dictionary) -> String:
95
- var scene: SceneFile = SceneFile.new()
95
+ var scene: GdhSceneFile = GdhSceneFile.new()
96
96
  var refused: Dictionary = scene.open(scene_path, true)
97
97
  if not refused.is_empty():
98
98
  return str(refused.get("error", ""))
@@ -127,7 +127,7 @@ func put_back(scene_path: String, why: String = "") -> void:
127
127
  func answer() -> Dictionary:
128
128
  for file: String in _homes:
129
129
  var resource: Resource = _homes[file]
130
- var saving: Error = SceneFile.save_keeping_uid(resource, file)
130
+ var saving: Error = GdhSceneFile.save_keeping_uid(resource, file)
131
131
  if saving == OK:
132
132
  if Engine.is_editor_hint():
133
133
  EditorInterface.get_resource_filesystem().update_file(file)
@@ -181,11 +181,13 @@ static func _left(record: Dictionary, why: String) -> Dictionary:
181
181
  ## Whether [param property] can hold a node path the editor's rename would follow: one saved or
182
182
  ## shown, of a type that holds paths, and not marked as holding none.
183
183
  static func _may_hold_paths(property: Dictionary) -> bool:
184
- if not Read.as_int(property.get("usage")) & (PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_EDITOR):
184
+ if not GdhRead.as_int(property.get("usage")) & (PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_EDITOR):
185
185
  return false
186
- if Read.as_int(property.get("hint")) == HINT_NO_NODEPATH:
186
+ if GdhRead.as_int(property.get("hint")) == HINT_NO_NODEPATH:
187
187
  return false
188
- return [TYPE_OBJECT, TYPE_NODE_PATH, TYPE_ARRAY, TYPE_DICTIONARY].has(Read.as_int(property.get("type")))
188
+ return [TYPE_OBJECT, TYPE_NODE_PATH, TYPE_ARRAY, TYPE_DICTIONARY].has(
189
+ GdhRead.as_int(property.get("type"))
190
+ )
189
191
 
190
192
 
191
193
  ## [param value], held by the node that was at [param was] and is at [param now], with each path in
@@ -421,7 +423,7 @@ func _home_of(animation: Animation, library: AnimationLibrary) -> Dictionary:
421
423
  }
422
424
  if not Engine.is_editor_hint():
423
425
  var script: Script = home.get_script()
424
- if (script != null and not script.is_tool()) or HeadlessCheck.holds_scripted_embedded(home, {}):
426
+ if (script != null and not script.is_tool()) or GdhHeadlessCheck.holds_scripted_embedded(home, {}):
425
427
  return {
426
428
  "why":
427
429
  (
@@ -432,7 +434,7 @@ func _home_of(animation: Animation, library: AnimationLibrary) -> Dictionary:
432
434
  )
433
435
  % file
434
436
  )
435
- + HeadlessCheck.REMEDY
437
+ + GdhHeadlessCheck.REMEDY
436
438
  )
437
439
  }
438
440
  return {"file": file, "home": home, "why": ""}
@@ -4,8 +4,8 @@ extends RefCounted
4
4
  ## What a new node in a scene is made or copied from, what the scene owns of it, and where among its
5
5
  ## siblings a node may go.
6
6
 
7
- const Read = preload("../reading.gd")
8
- const PropertyValues = preload("../property_values.gd")
7
+ const GdhRead = preload("../reading.gd")
8
+ const GdhPropertyValues = preload("../property_values.gd")
9
9
 
10
10
 
11
11
  ## The scene to instance for an add, or null for a node of a class, beside why neither can be made
@@ -64,11 +64,11 @@ static func copied(source: Node, root: Node, copies: Dictionary) -> Node:
64
64
  return null
65
65
  copy = packed.instantiate(PackedScene.GEN_EDIT_STATE_INSTANCE)
66
66
  for declared: Dictionary in source.get_property_list():
67
- if not (Read.as_int(declared.get("usage", 0)) & PROPERTY_USAGE_STORAGE):
67
+ if not (GdhRead.as_int(declared.get("usage", 0)) & PROPERTY_USAGE_STORAGE):
68
68
  continue
69
69
  var property: String = str(declared.get("name", ""))
70
70
  var value: Variant = source.get(property)
71
- if not PropertyValues.same(copy.get(property), value):
71
+ if not GdhPropertyValues.same(copy.get(property), value):
72
72
  copy.set(property, value)
73
73
  for group: StringName in source.get_groups():
74
74
  if not copy.is_in_group(group):
@@ -100,7 +100,7 @@ static func reconnect(copies: Dictionary, top: Node) -> void:
100
100
  for info: Dictionary in source.get_signal_list():
101
101
  var signal_name: String = str(info.get("name", ""))
102
102
  for conn: Dictionary in source.get_signal_connection_list(signal_name):
103
- var flags: int = Read.as_int(conn.get("flags", 0))
103
+ var flags: int = GdhRead.as_int(conn.get("flags", 0))
104
104
  var callable: Callable = conn.get("callable", Callable())
105
105
  var target: Object = callable.get_object()
106
106
  if not flags & Object.CONNECT_PERSIST or target == null:
@@ -134,7 +134,7 @@ static func unplaceable(parent: Node, node: Node, asked: Variant) -> String:
134
134
  if asked == null:
135
135
  return ""
136
136
  var others: int = parent.get_child_count() - (1 if node != null and node.get_parent() == parent else 0)
137
- var at: int = Read.as_int(asked, -1)
137
+ var at: int = GdhRead.as_int(asked, -1)
138
138
  if at < 0 or at > others:
139
139
  return (
140
140
  "index %s is not a place among the %d other children of %s: give 0 to %d, 0 for first."
@@ -151,7 +151,7 @@ static func unplaceable(parent: Node, node: Node, asked: Variant) -> String:
151
151
  ## Moves [param node] to [param asked] among its siblings, when a place was asked for.
152
152
  static func place(node: Node, asked: Variant) -> void:
153
153
  if asked != null:
154
- node.get_parent().move_child(node, Read.as_int(asked))
154
+ node.get_parent().move_child(node, GdhRead.as_int(asked))
155
155
 
156
156
 
157
157
  ## Why [param instanced] cannot be instanced into [param scene_path], or "" when it can: a scene