gdharness 1.3.9 → 1.3.11
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 +4740 -3212
- package/build/godot/addons/gdharness_editor/animation_reads.gd +115 -4
- package/build/godot/addons/gdharness_editor/declared_values.gd +272 -0
- package/build/godot/addons/gdharness_editor/file_reads.gd +102 -18
- package/build/godot/addons/gdharness_editor/headless_check.gd +49 -2
- package/build/godot/addons/gdharness_editor/property_paths.gd +89 -16
- package/build/godot/addons/gdharness_editor/property_values.gd +180 -121
- package/build/godot/addons/gdharness_editor/reading.gd +51 -1
- package/build/godot/addons/gdharness_editor/scene_file.gd +77 -140
- package/build/godot/addons/gdharness_editor/scene_uids.gd +107 -0
- package/build/godot/addons/gdharness_editor/scene_uids.gd.uid +1 -0
- package/build/godot/addons/gdharness_editor/serialisation.gd +11 -22
- package/build/godot/addons/gdharness_editor/setting_reads.gd +121 -0
- package/build/godot/addons/gdharness_editor/setting_reads.gd.uid +1 -0
- package/build/godot/addons/gdharness_editor/tool_executor.gd +28 -5
- package/build/godot/addons/gdharness_editor/tools/animation_states.gd +39 -20
- package/build/godot/addons/gdharness_editor/tools/animation_tools.gd +49 -362
- package/build/godot/addons/gdharness_editor/tools/animation_tracks.gd +464 -0
- package/build/godot/addons/gdharness_editor/tools/animation_tracks.gd.uid +1 -0
- package/build/godot/addons/gdharness_editor/tools/class_tools.gd +37 -0
- package/build/godot/addons/gdharness_editor/tools/navigation_bake.gd +221 -0
- package/build/godot/addons/gdharness_editor/tools/navigation_bake.gd.uid +1 -0
- package/build/godot/addons/gdharness_editor/tools/resource_tools.gd +147 -492
- package/build/godot/addons/gdharness_editor/tools/scene_groups.gd +16 -0
- package/build/godot/addons/gdharness_editor/tools/scene_kin.gd +4 -3
- package/build/godot/addons/gdharness_editor/tools/scene_paths.gd +2 -1
- package/build/godot/addons/gdharness_editor/tools/scene_tools.gd +79 -5
- package/build/godot/addons/gdharness_editor/tools/settings_tools.gd +7 -30
- package/build/godot/addons/gdharness_editor/tools/signal_tools.gd +183 -37
- package/build/godot/addons/gdharness_editor/tools/tileset_tools.gd +485 -0
- package/build/godot/addons/gdharness_editor/tools/tileset_tools.gd.uid +1 -0
- package/build/godot/addons/gdharness_editor/value_shapes.gd +128 -1
- package/build/godot/addons/gdharness_runtime/declared_values.gd +272 -0
- package/build/godot/addons/gdharness_runtime/reading.gd +51 -1
- package/build/godot/addons/gdharness_runtime/runtime_autoload.gd +35 -3
- package/build/godot/addons/gdharness_runtime/runtime_changes.gd +185 -30
- package/build/godot/addons/gdharness_runtime/runtime_input.gd +86 -79
- package/build/godot/addons/gdharness_runtime/runtime_mouse.gd +17 -0
- package/build/godot/addons/gdharness_runtime/runtime_pad.gd +13 -4
- package/build/godot/addons/gdharness_runtime/runtime_paths.gd +309 -22
- package/build/godot/addons/gdharness_runtime/runtime_queries.gd +163 -20
- package/build/godot/addons/gdharness_runtime/runtime_screen.gd +49 -3
- package/build/godot/addons/gdharness_runtime/runtime_targets.gd +5 -2
- package/build/godot/addons/gdharness_runtime/runtime_values.gd +146 -5
- package/build/godot/addons/gdharness_runtime/runtime_waits.gd +279 -11
- package/build/godot/addons/gdharness_runtime/runtime_words.gd +27 -0
- package/build/godot/addons/gdharness_runtime/serialisation.gd +11 -22
- package/build/godot/addons/gdharness_runtime/value_shapes.gd +128 -1
- package/build/godot/operations/animation_reads.gd +115 -4
- package/build/godot/operations/audio_buses.gd +93 -7
- package/build/godot/operations/classdb_queries.gd +119 -7
- package/build/godot/operations/declared_values.gd +272 -0
- package/build/godot/operations/dependencies.gd +154 -41
- package/build/godot/operations/editor_tools.gd +22 -14
- package/build/godot/operations/export_presets.gd +602 -4
- package/build/godot/operations/file_reads.gd +102 -18
- package/build/godot/operations/gdscript_authoring.gd +11 -1
- package/build/godot/operations/godot_operations.gd +16 -2
- package/build/godot/operations/import_pipeline.gd +20 -221
- package/build/godot/operations/input_actions.gd +108 -47
- package/build/godot/operations/project_config.gd +83 -69
- package/build/godot/operations/project_diagnostics.gd +4 -0
- package/build/godot/operations/project_validation.gd +266 -0
- package/build/godot/operations/property_paths.gd +89 -16
- package/build/godot/operations/property_values.gd +180 -121
- package/build/godot/operations/reading.gd +51 -1
- package/build/godot/operations/scene_connections.gd +222 -0
- package/build/godot/operations/serialisation.gd +11 -22
- package/build/godot/operations/setting_reads.gd +121 -0
- package/build/godot/operations/value_shapes.gd +128 -1
- package/build/godot/tests/listed.gd +73 -13
- package/build/keeper.js +1371 -706
- package/package.json +1 -1
|
@@ -5,11 +5,14 @@ extends Node
|
|
|
5
5
|
## preloaded rather than looked up on disk at runtime, so a missing one fails to parse here
|
|
6
6
|
## instead of leaving a command silently unanswered.
|
|
7
7
|
|
|
8
|
+
const GdhSceneFile = preload("scene_file.gd")
|
|
8
9
|
const GdhSceneTools = preload("tools/scene_tools.gd")
|
|
9
10
|
const GdhSignalTools = preload("tools/signal_tools.gd")
|
|
10
11
|
const GdhResourceTools = preload("tools/resource_tools.gd")
|
|
12
|
+
const GdhTilesetTools = preload("tools/tileset_tools.gd")
|
|
11
13
|
const GdhAnimationStates = preload("tools/animation_states.gd")
|
|
12
14
|
const GdhAnimationTools = preload("tools/animation_tools.gd")
|
|
15
|
+
const GdhAnimationTracks = preload("tools/animation_tracks.gd")
|
|
13
16
|
const GdhPlayTools = preload("tools/play_tools.gd")
|
|
14
17
|
const GdhClassTools = preload("tools/class_tools.gd")
|
|
15
18
|
const GdhSettingsTools = preload("tools/settings_tools.gd")
|
|
@@ -21,8 +24,10 @@ var _editor_plugin: EditorPlugin = null
|
|
|
21
24
|
var _scene_tools: GdhSceneTools = null
|
|
22
25
|
var _signal_tools: GdhSignalTools = null
|
|
23
26
|
var _resource_tools: GdhResourceTools = null
|
|
27
|
+
var _tileset_tools: GdhTilesetTools = null
|
|
24
28
|
var _animation_states: GdhAnimationStates = null
|
|
25
29
|
var _animation_tools: GdhAnimationTools = null
|
|
30
|
+
var _animation_tracks: GdhAnimationTracks = null
|
|
26
31
|
var _play_tools: GdhPlayTools = null
|
|
27
32
|
var _class_tools: GdhClassTools = null
|
|
28
33
|
var _settings_tools: GdhSettingsTools = null
|
|
@@ -38,8 +43,10 @@ func set_editor_plugin(plugin: EditorPlugin) -> void:
|
|
|
38
43
|
_init_tools()
|
|
39
44
|
_scene_tools.set_editor_plugin(plugin)
|
|
40
45
|
_resource_tools.set_editor_plugin(plugin)
|
|
46
|
+
_tileset_tools.set_editor_plugin(plugin)
|
|
41
47
|
_animation_tools.set_editor_plugin(plugin)
|
|
42
48
|
_animation_states.set_editor_plugin(plugin)
|
|
49
|
+
_animation_tracks.set_editor_plugin(plugin)
|
|
43
50
|
_play_tools.set_editor_plugin(plugin)
|
|
44
51
|
_class_tools.set_editor_plugin(plugin)
|
|
45
52
|
_filesystem_tools.set_editor_plugin(plugin)
|
|
@@ -63,6 +70,10 @@ func _init_tools() -> void:
|
|
|
63
70
|
_resource_tools.name = "ResourceTools"
|
|
64
71
|
add_child(_resource_tools)
|
|
65
72
|
|
|
73
|
+
_tileset_tools = GdhTilesetTools.new()
|
|
74
|
+
_tileset_tools.name = "TilesetTools"
|
|
75
|
+
add_child(_tileset_tools)
|
|
76
|
+
|
|
66
77
|
_animation_tools = GdhAnimationTools.new()
|
|
67
78
|
_animation_tools.name = "AnimationTools"
|
|
68
79
|
add_child(_animation_tools)
|
|
@@ -71,6 +82,10 @@ func _init_tools() -> void:
|
|
|
71
82
|
_animation_states.name = "AnimationStates"
|
|
72
83
|
add_child(_animation_states)
|
|
73
84
|
|
|
85
|
+
_animation_tracks = GdhAnimationTracks.new()
|
|
86
|
+
_animation_tracks.name = "AnimationTracks"
|
|
87
|
+
add_child(_animation_tracks)
|
|
88
|
+
|
|
74
89
|
_play_tools = GdhPlayTools.new()
|
|
75
90
|
_play_tools.name = "PlayTools"
|
|
76
91
|
add_child(_play_tools)
|
|
@@ -101,6 +116,7 @@ func _init_tools() -> void:
|
|
|
101
116
|
"reparent_node": [_scene_tools, "reparent_node"],
|
|
102
117
|
"set_node_properties": [_scene_tools, "set_node_properties"],
|
|
103
118
|
"get_node_properties": [_scene_tools, "get_node_properties"],
|
|
119
|
+
"bake_navigation": [_scene_tools, "bake_navigation"],
|
|
104
120
|
"save_scene": [_scene_tools, "save_scene"],
|
|
105
121
|
"connect_signal": [_signal_tools, "connect_signal"],
|
|
106
122
|
"disconnect_signal": [_signal_tools, "disconnect_signal"],
|
|
@@ -111,6 +127,7 @@ func _init_tools() -> void:
|
|
|
111
127
|
"files_moved": [_filesystem_tools, "files_moved"],
|
|
112
128
|
"global_classes": [_class_tools, "global_classes"],
|
|
113
129
|
"reload_script": [_class_tools, "reload_script"],
|
|
130
|
+
"scripts_behind": [_class_tools, "scripts_behind"],
|
|
114
131
|
# Settings, for a caller that asked the editor rather than the file on disk
|
|
115
132
|
"get_project_setting": [_settings_tools, "get_project_setting"],
|
|
116
133
|
"adopt_project_settings": [_settings_tools, "adopt_project_settings"],
|
|
@@ -120,10 +137,11 @@ func _init_tools() -> void:
|
|
|
120
137
|
"modify_resource": [_resource_tools, "modify_resource"],
|
|
121
138
|
"read_resource": [_resource_tools, "read_resource"],
|
|
122
139
|
"create_shader": [_resource_tools, "create_shader"],
|
|
123
|
-
"create_tileset": [
|
|
124
|
-
"set_tilemap_cells": [
|
|
140
|
+
"create_tileset": [_tileset_tools, "create_tileset"],
|
|
141
|
+
"set_tilemap_cells": [_tileset_tools, "set_tilemap_cells"],
|
|
125
142
|
"set_theme_color": [_resource_tools, "set_theme_color"],
|
|
126
143
|
"set_theme_font_size": [_resource_tools, "set_theme_font_size"],
|
|
144
|
+
"remove_theme_item": [_resource_tools, "remove_theme_item"],
|
|
127
145
|
"play_scene": [_play_tools, "play_scene"],
|
|
128
146
|
"restart_editor": [_play_tools, "restart_editor"],
|
|
129
147
|
"quit_editor": [_play_tools, "quit_editor"],
|
|
@@ -137,8 +155,8 @@ func _init_tools() -> void:
|
|
|
137
155
|
"read_animations": [_animation_tools, "read_animations"],
|
|
138
156
|
"read_animation_states": [_animation_tools, "read_animation_states"],
|
|
139
157
|
"create_animation": [_animation_tools, "create_animation"],
|
|
140
|
-
"add_animation_track": [
|
|
141
|
-
"remove_animation_track": [
|
|
158
|
+
"add_animation_track": [_animation_tracks, "add_animation_track"],
|
|
159
|
+
"remove_animation_track": [_animation_tracks, "remove_animation_track"],
|
|
142
160
|
"set_animation": [_animation_tools, "set_animation"],
|
|
143
161
|
"rename_animation": [_animation_tools, "rename_animation"],
|
|
144
162
|
"remove_animation": [_animation_tools, "remove_animation"],
|
|
@@ -160,8 +178,13 @@ func execute_tool(tool_name: String, args: Dictionary) -> Dictionary:
|
|
|
160
178
|
if not node.has_method(method):
|
|
161
179
|
return {"ok": false, "error": "Tool method not found: %s.%s" % [node.name, method]}
|
|
162
180
|
|
|
181
|
+
GdhSceneFile.also_saved.clear()
|
|
163
182
|
var result: Variant = node.call(method, args)
|
|
164
183
|
if result is Dictionary:
|
|
165
|
-
|
|
184
|
+
var answered: Dictionary = result
|
|
185
|
+
if not GdhSceneFile.also_saved.is_empty():
|
|
186
|
+
answered["alsoSaved"] = GdhSceneFile.also_saved.duplicate(true)
|
|
187
|
+
GdhSceneFile.also_saved.clear()
|
|
188
|
+
return answered
|
|
166
189
|
|
|
167
190
|
return {"ok": false, "error": "Invalid tool result from: " + tool_name}
|
|
@@ -58,29 +58,13 @@ func add_animation_state(args: Dictionary) -> Dictionary:
|
|
|
58
58
|
# Written all the same, as the editor writes one: a state machine is often laid out before its
|
|
59
59
|
# animations are made, and refusing it stopped a tree being built in that order.
|
|
60
60
|
if player != null and not found:
|
|
61
|
-
answer["animationMissing"] =
|
|
61
|
+
answer["animationMissing"] = GdhAnimationReads.missing_animation(
|
|
62
|
+
player, scene.path_of(player), animation_name
|
|
63
|
+
)
|
|
62
64
|
var files: Dictionary = machine[2]
|
|
63
65
|
return _finish(scene, Callable(), files, answer)
|
|
64
66
|
|
|
65
67
|
|
|
66
|
-
## Why the state playing [param animation_name] plays nothing yet. The player is named by its path
|
|
67
|
-
## from the scene root, as playerNodePath takes it; anim_player is relative to the tree ("../Anim"),
|
|
68
|
-
## which no argument takes.
|
|
69
|
-
static func _missing_animation(
|
|
70
|
-
scene: GdhSceneFile, player: AnimationPlayer, animation_name: String
|
|
71
|
-
) -> String:
|
|
72
|
-
var said: String = (
|
|
73
|
-
"The AnimationPlayer at %s has no animation %s yet, so the state plays nothing until it has one."
|
|
74
|
-
% [str(scene.root.get_path_to(player)), animation_name]
|
|
75
|
-
)
|
|
76
|
-
var close: PackedStringArray = GdhRead.nearest(animation_name, player.get_animation_list())
|
|
77
|
-
if close.is_empty():
|
|
78
|
-
return said
|
|
79
|
-
return (
|
|
80
|
-
said + " The nearest %s %s." % ["it has is" if close.size() == 1 else "it has are", ", ".join(close)]
|
|
81
|
-
)
|
|
82
|
-
|
|
83
|
-
|
|
84
68
|
# =============================================================================
|
|
85
69
|
# connect_animation_states
|
|
86
70
|
# =============================================================================
|
|
@@ -89,9 +73,36 @@ func connect_animation_states(args: Dictionary) -> Dictionary:
|
|
|
89
73
|
var to_state: String = str(args.get("toState", ""))
|
|
90
74
|
var transition_type: String = str(args.get("transitionType", "immediate"))
|
|
91
75
|
var advance_condition: String = str(args.get("advanceCondition", ""))
|
|
76
|
+
# Auto where it is the only mode that does what was asked: a condition is checked only on an auto
|
|
77
|
+
# transition, and a machine leaves Start only through one. Written as the default enabled, both
|
|
78
|
+
# did nothing, and the machine sat in Start with its conditions true.
|
|
79
|
+
var auto: bool = not advance_condition.is_empty() or from_state == "Start"
|
|
80
|
+
var advance_mode: String = str(args.get("advanceMode", "auto" if auto else "enabled"))
|
|
92
81
|
|
|
93
82
|
if from_state.is_empty() or to_state.is_empty():
|
|
94
83
|
return {"ok": false, "error": "Missing fromState or toState"}
|
|
84
|
+
var advances: Dictionary = {
|
|
85
|
+
"auto": AnimationNodeStateMachineTransition.ADVANCE_MODE_AUTO,
|
|
86
|
+
"enabled": AnimationNodeStateMachineTransition.ADVANCE_MODE_ENABLED,
|
|
87
|
+
"disabled": AnimationNodeStateMachineTransition.ADVANCE_MODE_DISABLED,
|
|
88
|
+
}
|
|
89
|
+
if not advances.has(advance_mode):
|
|
90
|
+
return {
|
|
91
|
+
"ok": false,
|
|
92
|
+
"error": "Unsupported advanceMode: %s; it is auto, enabled or disabled" % advance_mode
|
|
93
|
+
}
|
|
94
|
+
if not advance_condition.is_empty() and advance_mode != "auto":
|
|
95
|
+
return {
|
|
96
|
+
"ok": false,
|
|
97
|
+
"error":
|
|
98
|
+
(
|
|
99
|
+
(
|
|
100
|
+
"advanceCondition %s would never advance a transition whose advanceMode is %s: the engine"
|
|
101
|
+
+ " checks a condition only on an auto one. Leave advanceMode out, or give auto"
|
|
102
|
+
)
|
|
103
|
+
% [advance_condition, advance_mode]
|
|
104
|
+
)
|
|
105
|
+
}
|
|
95
106
|
var modes: Dictionary = {
|
|
96
107
|
"sync": AnimationNodeStateMachineTransition.SWITCH_MODE_SYNC,
|
|
97
108
|
"at_end": AnimationNodeStateMachineTransition.SWITCH_MODE_AT_END,
|
|
@@ -103,6 +114,9 @@ func connect_animation_states(args: Dictionary) -> Dictionary:
|
|
|
103
114
|
transition.switch_mode = (
|
|
104
115
|
GdhRead.as_int(modes[transition_type]) as AnimationNodeStateMachineTransition.SwitchMode
|
|
105
116
|
)
|
|
117
|
+
transition.advance_mode = (
|
|
118
|
+
GdhRead.as_int(advances[advance_mode]) as AnimationNodeStateMachineTransition.AdvanceMode
|
|
119
|
+
)
|
|
106
120
|
if not advance_condition.is_empty():
|
|
107
121
|
transition.advance_condition = StringName(advance_condition)
|
|
108
122
|
|
|
@@ -119,7 +133,12 @@ func connect_animation_states(args: Dictionary) -> Dictionary:
|
|
|
119
133
|
if not sm.has_transition(StringName(from_state), StringName(to_state)):
|
|
120
134
|
return scene.refuse("The state machine did not take the transition.")
|
|
121
135
|
var files: Dictionary = found[2]
|
|
122
|
-
return _finish(
|
|
136
|
+
return _finish(
|
|
137
|
+
scene,
|
|
138
|
+
Callable(),
|
|
139
|
+
files,
|
|
140
|
+
{"ok": true, "from": from_state, "to": to_state, "advanceMode": advance_mode}
|
|
141
|
+
)
|
|
123
142
|
|
|
124
143
|
|
|
125
144
|
## Why [param sm] cannot take a transition from [param from_state] to [param to_state], or "".
|