gdharness 1.3.42 → 1.3.44
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 +383 -243
- package/build/godot/addons/auto_reload/auto_reload.gd +18 -19
- package/build/godot/addons/gdharness_editor/animation_reads.gd +55 -33
- package/build/godot/addons/gdharness_editor/bridge_client.gd +53 -58
- package/build/godot/addons/gdharness_editor/declared_values.gd +68 -32
- package/build/godot/addons/gdharness_editor/file_reads.gd +83 -42
- package/build/godot/addons/gdharness_editor/file_walk.gd +12 -5
- package/build/godot/addons/gdharness_editor/headless_check.gd +68 -44
- package/build/godot/addons/gdharness_editor/plugin.gd +2 -3
- package/build/godot/addons/gdharness_editor/property_paths.gd +22 -12
- package/build/godot/addons/gdharness_editor/property_values.gd +143 -78
- package/build/godot/addons/gdharness_editor/reading.gd +51 -17
- package/build/godot/addons/gdharness_editor/same_values.gd +4 -4
- package/build/godot/addons/gdharness_editor/scene_file.gd +127 -80
- package/build/godot/addons/gdharness_editor/scene_uids.gd +12 -6
- package/build/godot/addons/gdharness_editor/serialisation.gd +75 -51
- package/build/godot/addons/gdharness_editor/setting_reads.gd +7 -6
- package/build/godot/addons/gdharness_editor/tool_executor.gd +3 -6
- package/build/godot/addons/gdharness_editor/tools/animation_states.gd +37 -27
- package/build/godot/addons/gdharness_editor/tools/animation_tools.gd +79 -49
- package/build/godot/addons/gdharness_editor/tools/animation_tracks.gd +70 -40
- package/build/godot/addons/gdharness_editor/tools/class_tools.gd +65 -42
- package/build/godot/addons/gdharness_editor/tools/filesystem_tools.gd +24 -22
- package/build/godot/addons/gdharness_editor/tools/navigation_bake.gd +49 -29
- package/build/godot/addons/gdharness_editor/tools/play_tools.gd +26 -21
- package/build/godot/addons/gdharness_editor/tools/profile_tools.gd +40 -40
- package/build/godot/addons/gdharness_editor/tools/resource_tools.gd +166 -107
- package/build/godot/addons/gdharness_editor/tools/scene_groups.gd +16 -9
- package/build/godot/addons/gdharness_editor/tools/scene_kin.gd +68 -41
- package/build/godot/addons/gdharness_editor/tools/scene_paths.gd +35 -20
- package/build/godot/addons/gdharness_editor/tools/scene_placing.gd +28 -13
- package/build/godot/addons/gdharness_editor/tools/scene_sharing.gd +12 -5
- package/build/godot/addons/gdharness_editor/tools/scene_tools.gd +113 -67
- package/build/godot/addons/gdharness_editor/tools/script_paths.gd +20 -8
- package/build/godot/addons/gdharness_editor/tools/settings_tools.gd +11 -8
- package/build/godot/addons/gdharness_editor/tools/signal_tools.gd +47 -34
- package/build/godot/addons/gdharness_editor/tools/tileset_tools.gd +77 -50
- package/build/godot/addons/gdharness_editor/value_shapes.gd +5 -6
- package/build/godot/addons/gdharness_runtime/call_errors.gd +1 -2
- package/build/godot/addons/gdharness_runtime/declared_values.gd +68 -32
- package/build/godot/addons/gdharness_runtime/error_report.gd +1 -2
- package/build/godot/addons/gdharness_runtime/reading.gd +51 -17
- package/build/godot/addons/gdharness_runtime/runtime_accessibility.gd +84 -63
- package/build/godot/addons/gdharness_runtime/runtime_autoload.gd +149 -147
- package/build/godot/addons/gdharness_runtime/runtime_capture.gd +64 -42
- package/build/godot/addons/gdharness_runtime/runtime_changes.gd +184 -122
- package/build/godot/addons/gdharness_runtime/runtime_frames.gd +2 -2
- package/build/godot/addons/gdharness_runtime/runtime_hover.gd +24 -20
- package/build/godot/addons/gdharness_runtime/runtime_input.gd +134 -92
- package/build/godot/addons/gdharness_runtime/runtime_items.gd +29 -13
- package/build/godot/addons/gdharness_runtime/runtime_menus.gd +0 -1
- package/build/godot/addons/gdharness_runtime/runtime_mouse.gd +34 -17
- package/build/godot/addons/gdharness_runtime/runtime_pad.gd +17 -13
- package/build/godot/addons/gdharness_runtime/runtime_paths.gd +84 -46
- package/build/godot/addons/gdharness_runtime/runtime_queries.gd +117 -79
- package/build/godot/addons/gdharness_runtime/runtime_says.gd +14 -17
- package/build/godot/addons/gdharness_runtime/runtime_screen.gd +23 -16
- package/build/godot/addons/gdharness_runtime/runtime_targets.gd +117 -66
- package/build/godot/addons/gdharness_runtime/runtime_touch.gd +15 -15
- package/build/godot/addons/gdharness_runtime/runtime_typing.gd +44 -27
- package/build/godot/addons/gdharness_runtime/runtime_values.gd +108 -73
- package/build/godot/addons/gdharness_runtime/runtime_waits.gd +111 -84
- package/build/godot/addons/gdharness_runtime/runtime_words.gd +10 -7
- package/build/godot/addons/gdharness_runtime/serialisation.gd +75 -51
- package/build/godot/addons/gdharness_runtime/value_shapes.gd +5 -6
- package/build/godot/addons/gdharness_tests/bench.gd +4 -5
- package/build/godot/addons/gdharness_tests/event.gd +10 -5
- package/build/godot/addons/gdharness_tests/share.gd +38 -18
- package/build/godot/addons/gdharness_tests/suites.gd +3 -3
- package/build/godot/addons/gdharness_tests/wait.gd +3 -2
- package/build/godot/loader/loader.gd +9 -9
- package/build/godot/operations/animation_reads.gd +55 -33
- package/build/godot/operations/audio_buses.gd +48 -19
- package/build/godot/operations/class_cache.gd +16 -11
- package/build/godot/operations/classdb_queries.gd +89 -44
- package/build/godot/operations/declared_values.gd +68 -32
- package/build/godot/operations/dependencies.gd +190 -109
- package/build/godot/operations/editor_tools.gd +10 -10
- package/build/godot/operations/export_presets.gd +100 -54
- package/build/godot/operations/file_reads.gd +83 -42
- package/build/godot/operations/file_walk.gd +12 -5
- package/build/godot/operations/gdscript_analysis.gd +86 -65
- package/build/godot/operations/gdscript_authoring.gd +83 -36
- package/build/godot/operations/godot_operations.gd +17 -11
- package/build/godot/operations/import_pipeline.gd +110 -59
- package/build/godot/operations/input_actions.gd +62 -39
- package/build/godot/operations/patterns.gd +3 -1
- package/build/godot/operations/plugins.gd +36 -16
- package/build/godot/operations/project_config.gd +61 -32
- package/build/godot/operations/project_diagnostics.gd +24 -11
- package/build/godot/operations/project_file.gd +16 -16
- package/build/godot/operations/project_validation.gd +71 -44
- package/build/godot/operations/property_paths.gd +22 -12
- package/build/godot/operations/property_values.gd +143 -78
- package/build/godot/operations/reading.gd +51 -17
- package/build/godot/operations/rename_checks.gd +2 -2
- package/build/godot/operations/resource_files.gd +11 -9
- package/build/godot/operations/same_values.gd +4 -4
- package/build/godot/operations/scene_connections.gd +27 -13
- package/build/godot/operations/script_check.gd +52 -49
- package/build/godot/operations/serialisation.gd +75 -51
- package/build/godot/operations/setting_reads.gd +7 -6
- package/build/godot/operations/value_shapes.gd +5 -6
- package/build/godot/tests/listed.gd +321 -268
- package/build/keeper.js +43 -43
- package/package.json +1 -1
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
@tool
|
|
2
2
|
extends RefCounted
|
|
3
|
-
|
|
4
3
|
## What a property declares beyond its type: the values of its enum and the range it is exported
|
|
5
4
|
## with, for taking a value by name and for saying when a value written lies outside them.
|
|
6
5
|
|
|
7
6
|
const GdhRead = preload("reading.gd")
|
|
8
|
-
|
|
9
7
|
## The section of layer_names in project.godot naming the layers of each layers hint.
|
|
10
8
|
const LAYER_NAMES: Dictionary[int, String] = {
|
|
11
9
|
PROPERTY_HINT_LAYERS_2D_PHYSICS: "2d_physics",
|
|
@@ -27,7 +25,7 @@ static func layers_in(hint: int, mask: int) -> Array[Dictionary]:
|
|
|
27
25
|
for layer: int in range(1, MASK_LAYERS + 1):
|
|
28
26
|
if mask & (1 << (layer - 1)) == 0:
|
|
29
27
|
continue
|
|
30
|
-
var entry: Dictionary = {"layer": layer}
|
|
28
|
+
var entry: Dictionary = { "layer": layer }
|
|
31
29
|
var name: String = str(
|
|
32
30
|
ProjectSettings.get_setting("layer_names/%s/layer_%d" % [LAYER_NAMES[hint], layer], "")
|
|
33
31
|
)
|
|
@@ -119,10 +117,12 @@ static func engine_constants(target: Object, property: String) -> Dictionary:
|
|
|
119
117
|
## names by it, as [true, number], or [false, why] naming the values, with [param holder] naming the
|
|
120
118
|
## target in the refusal. [false, ""] for a word that is a number, which converts as one.
|
|
121
119
|
##
|
|
122
|
-
## An enum is written by the name of a value as well as its number, since the name is what the
|
|
123
|
-
## and the inspector show and the number is only where the value happens to sit. Tried as the
|
|
124
|
-
## spells it, then as the hint does, then as the engine's constant.
|
|
125
|
-
static func enum_by_name(
|
|
120
|
+
## An enum is written by the name of a value as well as its number, since the name is what the
|
|
121
|
+
## script and the inspector show and the number is only where the value happens to sit. Tried as the
|
|
122
|
+
## script spells it, then as the hint does, then as the engine's constant.
|
|
123
|
+
static func enum_by_name(
|
|
124
|
+
target: Object, declared: Dictionary, word: String, holder: String
|
|
125
|
+
) -> Array:
|
|
126
126
|
var property: String = str(declared.get("name", ""))
|
|
127
127
|
var choices: Dictionary = enum_of(target, declared)
|
|
128
128
|
var chosen: Variant = enum_named(choices, word)
|
|
@@ -144,7 +144,9 @@ static func enum_refusal(
|
|
|
144
144
|
) -> String:
|
|
145
145
|
var ways: String = "by name or by number"
|
|
146
146
|
if not constants.is_empty():
|
|
147
|
-
ways =
|
|
147
|
+
ways = (
|
|
148
|
+
"by name, by number or by the engine's constant, such as %s" % str(constants.keys()[0])
|
|
149
|
+
)
|
|
148
150
|
var said: String = (
|
|
149
151
|
"%s.%s is an enum, and %s is none of its values: send %s %s"
|
|
150
152
|
% [holder, property, word, _listed(choices), ways]
|
|
@@ -163,7 +165,10 @@ static func enum_argument_refusal(
|
|
|
163
165
|
called: String, index: int, named: String, word: String, choices: Dictionary
|
|
164
166
|
) -> String:
|
|
165
167
|
var said: String = (
|
|
166
|
-
|
|
168
|
+
(
|
|
169
|
+
"%s takes the enum %s as argument %d, and %s is none of its values: send %s by name or "
|
|
170
|
+
+ "by number"
|
|
171
|
+
)
|
|
167
172
|
% [called, named, index + 1, word, _listed(choices)]
|
|
168
173
|
)
|
|
169
174
|
var close: PackedStringArray = GdhRead.nearest(word, PackedStringArray(choices.keys()))
|
|
@@ -174,7 +179,9 @@ static func enum_argument_refusal(
|
|
|
174
179
|
|
|
175
180
|
## Why [param value], given as argument [param index] for the enum [param named], is none of its
|
|
176
181
|
## [param choices], or "" when it is one. The engine passes any number on.
|
|
177
|
-
static func outside_enum_argument(
|
|
182
|
+
static func outside_enum_argument(
|
|
183
|
+
index: int, named: String, value: Variant, choices: Dictionary
|
|
184
|
+
) -> String:
|
|
178
185
|
if typeof(value) != TYPE_INT or choices.values().has(value):
|
|
179
186
|
return ""
|
|
180
187
|
return (
|
|
@@ -235,7 +242,10 @@ static func outside(target: Object, declared: Dictionary, value: Variant, shown:
|
|
|
235
242
|
var hint: int = GdhRead.as_int(declared.get("hint", PROPERTY_HINT_NONE))
|
|
236
243
|
var hint_string: String = str(declared.get("hint_string", ""))
|
|
237
244
|
var property: String = str(declared.get("name", ""))
|
|
238
|
-
if
|
|
245
|
+
if (
|
|
246
|
+
hint == PROPERTY_HINT_ENUM
|
|
247
|
+
and (typeof(value) == TYPE_STRING or typeof(value) == TYPE_STRING_NAME)
|
|
248
|
+
):
|
|
239
249
|
var names: PackedStringArray = PackedStringArray(enum_values(hint_string).keys())
|
|
240
250
|
if names.is_empty() or names.has(str(value)):
|
|
241
251
|
return ""
|
|
@@ -308,15 +318,17 @@ static func _listed(choices: Dictionary) -> String:
|
|
|
308
318
|
return ", ".join(listed)
|
|
309
319
|
|
|
310
320
|
|
|
311
|
-
## A range's end as the script wrote it: the engine's hint gives @export_range(0, 10) as 0.0 and
|
|
321
|
+
## A range's end as the script wrote it: the engine's hint gives @export_range(0, 10) as 0.0 and
|
|
322
|
+
## 10.0.
|
|
312
323
|
static func _bound(end: float) -> String:
|
|
313
324
|
return str(int(end)) if end == floorf(end) and absf(end) < 1e15 else str(end)
|
|
314
325
|
|
|
315
326
|
|
|
316
327
|
## Puts back on [param built] what its script set as it was attached and was not among
|
|
317
|
-
## [param wanted], to the defaults it declares, outside the editor. Attaching runs the script's
|
|
318
|
-
## there, which the editor never runs for a script that is not a tool, so a resource_name
|
|
319
|
-
## was saved as if asked for. A property whose default the engine cannot report is left
|
|
328
|
+
## [param wanted], to the defaults it declares, outside the editor. Attaching runs the script's
|
|
329
|
+
## _init there, which the editor never runs for a script that is not a tool, so a resource_name
|
|
330
|
+
## _init chose was saved as if asked for. A property whose default the engine cannot report is left
|
|
331
|
+
## as made.
|
|
320
332
|
static func unmade(built: Resource, wanted: Dictionary) -> void:
|
|
321
333
|
var attached: Variant = built.get_script()
|
|
322
334
|
if Engine.is_editor_hint() or not attached is Script:
|
|
@@ -445,17 +457,25 @@ static func runs_script_code(target: Object, name: String) -> bool:
|
|
|
445
457
|
## the buses are read from the AudioServer, which holds the project's layout; "the engine changed or
|
|
446
458
|
## refused the value" left a caller to guess the bus did not exist.
|
|
447
459
|
static func not_held(
|
|
448
|
-
holder: String,
|
|
460
|
+
holder: String,
|
|
461
|
+
engine_class: String,
|
|
462
|
+
property: String,
|
|
463
|
+
declared: Dictionary,
|
|
464
|
+
given: Array,
|
|
465
|
+
held: String
|
|
449
466
|
) -> String:
|
|
450
467
|
var value: Variant = given[0]
|
|
451
|
-
var said: String =
|
|
468
|
+
var said: String = (
|
|
469
|
+
"%s.%s was given %s and holds %s after it was set" % [holder, property, given[1], held]
|
|
470
|
+
)
|
|
452
471
|
var type: int = GdhRead.as_int(declared.get("type", TYPE_NIL))
|
|
453
472
|
var hint: int = GdhRead.as_int(declared.get("hint", PROPERTY_HINT_NONE))
|
|
454
473
|
if hint in LAYER_NAMES and typeof(value) == TYPE_INT:
|
|
455
474
|
return (
|
|
456
475
|
(
|
|
457
|
-
"%s: it is a mask of the %s layers, one bit each from layer 1 (1) to layer %d
|
|
458
|
-
+ "takes 0 to %d and the engine keeps only those bits. Nothing was
|
|
476
|
+
"%s: it is a mask of the %s layers, one bit each from layer 1 (1) to layer %d "
|
|
477
|
+
+ "(%d), so it takes 0 to %d and the engine keeps only those bits. Nothing was "
|
|
478
|
+
+ "written."
|
|
459
479
|
)
|
|
460
480
|
% [
|
|
461
481
|
said,
|
|
@@ -477,22 +497,28 @@ static func not_held(
|
|
|
477
497
|
return said + ": the engine changed or refused the value, so nothing was written."
|
|
478
498
|
var close: PackedStringArray = GdhRead.nearest(str(value), names)
|
|
479
499
|
var nearest: String = (
|
|
480
|
-
"%s %s" % ["is" if close.size() == 1 else "are", ", ".join(close)]
|
|
500
|
+
"%s %s" % ["is" if close.size() == 1 else "are", ", ".join(close)]
|
|
501
|
+
if not close.is_empty()
|
|
502
|
+
else ""
|
|
481
503
|
)
|
|
482
504
|
if bus:
|
|
483
505
|
# Not "holds Master after it was set": the getter answers the first bus for any name the
|
|
484
506
|
# layout lacks, and nothing was kept.
|
|
485
507
|
return (
|
|
486
508
|
(
|
|
487
|
-
"%s.bus takes the name of one of the project's audio buses, and %s is none of
|
|
488
|
-
+ "would play on %s; %s. project_info include audio_buses lists them,
|
|
489
|
-
+ "project_settings add_audio_bus adds one. Nothing was written."
|
|
509
|
+
"%s.bus takes the name of one of the project's audio buses, and %s is none of "
|
|
510
|
+
+ "them, so it would play on %s; %s. project_info include audio_buses lists them, "
|
|
511
|
+
+ "and project_settings add_audio_bus adds one. Nothing was written."
|
|
490
512
|
)
|
|
491
513
|
% [
|
|
492
514
|
holder,
|
|
493
515
|
given[1],
|
|
494
516
|
AudioServer.get_bus_name(0),
|
|
495
|
-
|
|
517
|
+
(
|
|
518
|
+
"the buses are " + ", ".join(names)
|
|
519
|
+
if nearest.is_empty()
|
|
520
|
+
else "the nearest " + nearest
|
|
521
|
+
),
|
|
496
522
|
]
|
|
497
523
|
)
|
|
498
524
|
return (
|
|
@@ -500,7 +526,11 @@ static func not_held(
|
|
|
500
526
|
% [
|
|
501
527
|
said,
|
|
502
528
|
given[1],
|
|
503
|
-
|
|
529
|
+
(
|
|
530
|
+
"it lists " + ", ".join(names)
|
|
531
|
+
if nearest.is_empty()
|
|
532
|
+
else "the nearest it lists " + nearest
|
|
533
|
+
),
|
|
504
534
|
]
|
|
505
535
|
)
|
|
506
536
|
|
|
@@ -513,7 +543,9 @@ static func held_by_children(node: Node, property: String) -> String:
|
|
|
513
543
|
var holders: PackedStringArray = []
|
|
514
544
|
for child: Node in node.get_children():
|
|
515
545
|
if property in child:
|
|
516
|
-
var _added: bool = holders.append(
|
|
546
|
+
var _added: bool = holders.append(
|
|
547
|
+
"%s (a %s)" % [root.get_path_to(child), child.get_class()]
|
|
548
|
+
)
|
|
517
549
|
if holders.is_empty():
|
|
518
550
|
return ""
|
|
519
551
|
if holders.size() == 1:
|
|
@@ -523,14 +555,15 @@ static func held_by_children(node: Node, property: String) -> String:
|
|
|
523
555
|
|
|
524
556
|
|
|
525
557
|
## A sentence for each node path in [param given], by property, that names no node from
|
|
526
|
-
## [param node]. A path is written whatever it names, as the inspector writes one, since the node
|
|
527
|
-
## be added next; a joint whose node_a named nothing then joined nothing, and no answer said so.
|
|
558
|
+
## [param node]. A path is written whatever it names, as the inspector writes one, since the node
|
|
559
|
+
## may be added next; a joint whose node_a named nothing then joined nothing, and no answer said so.
|
|
528
560
|
static func naming_nothing(node: Node, given: Dictionary) -> Dictionary:
|
|
529
561
|
var said: Dictionary = {}
|
|
530
562
|
for property: String in given:
|
|
531
563
|
if "/" in property or ":" in property:
|
|
532
564
|
continue
|
|
533
|
-
# What the node holds, since a path given as text is held as text until the engine stores
|
|
565
|
+
# What the node holds, since a path given as text is held as text until the engine stores
|
|
566
|
+
# it.
|
|
534
567
|
var path: Variant = node.get(property)
|
|
535
568
|
if not path is NodePath:
|
|
536
569
|
continue
|
|
@@ -539,8 +572,8 @@ static func naming_nothing(node: Node, given: Dictionary) -> Dictionary:
|
|
|
539
572
|
continue
|
|
540
573
|
said[property] = (
|
|
541
574
|
(
|
|
542
|
-
"%s names no node from %s. It is written, as the editor writes one, since that
|
|
543
|
-
+ "be added next; until it is, %s finds nothing."
|
|
575
|
+
"%s names no node from %s. It is written, as the editor writes one, since that "
|
|
576
|
+
+ "node may be added next; until it is, %s finds nothing."
|
|
544
577
|
)
|
|
545
578
|
% [str(named), node.name, property]
|
|
546
579
|
)
|
|
@@ -553,7 +586,10 @@ static func naming_nothing(node: Node, given: Dictionary) -> Dictionary:
|
|
|
553
586
|
static func no_uniform(material: ShaderMaterial, property: String) -> String:
|
|
554
587
|
var uniform: String = property.trim_prefix("shader_parameter/")
|
|
555
588
|
if material.shader == null:
|
|
556
|
-
return
|
|
589
|
+
return (
|
|
590
|
+
"The ShaderMaterial has no shader, so it has no parameter %s yet; set shader first."
|
|
591
|
+
% uniform
|
|
592
|
+
)
|
|
557
593
|
var shader: String = material.shader.resource_path
|
|
558
594
|
var named: String = shader if not shader.is_empty() else "Its shader"
|
|
559
595
|
var uniforms: Array = []
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
extends Logger
|
|
2
|
-
|
|
3
2
|
## The console of a game the editor plays, errors and prints in the order the engine made them,
|
|
4
3
|
## written to a file beside the announcement in the lines the engine itself prints.
|
|
5
4
|
##
|
|
@@ -53,7 +52,7 @@ func _log_message(message: String, _error: bool) -> void:
|
|
|
53
52
|
|
|
54
53
|
|
|
55
54
|
# The engine's own signature for a Logger, eight parameters and not this project's to shape.
|
|
56
|
-
#
|
|
55
|
+
# gdstyle:ignore=quality/max-parameters
|
|
57
56
|
func _log_error(
|
|
58
57
|
function: String,
|
|
59
58
|
file: String,
|
|
@@ -124,7 +124,8 @@ static func json_or_null(text: String) -> Variant:
|
|
|
124
124
|
## [param said], the refusal for [param node_path] found nowhere in a scene whose root is called
|
|
125
125
|
## [param root_name], with how paths are read when the path starts with that name and the root has
|
|
126
126
|
## no child called that. Paths go from the root, so its own name there names a child of it, and a
|
|
127
|
-
## caller who read the root as Main in a tree wrote Main/Body and was told only that nothing is
|
|
127
|
+
## caller who read the root as Main in a tree wrote Main/Body and was told only that nothing is
|
|
128
|
+
## there.
|
|
128
129
|
static func from_the_root(said: String, node_path: String, root_name: String) -> String:
|
|
129
130
|
var first: String = node_path.get_slice("/", 0)
|
|
130
131
|
if root_name.is_empty() or first != root_name:
|
|
@@ -141,7 +142,11 @@ static func from_the_root(said: String, node_path: String, root_name: String) ->
|
|
|
141
142
|
## is empty; the name below it that is missing; and [param children], the names that node has, as
|
|
142
143
|
## after a node was moved or renamed. Names up to [constant NAMED_CHILDREN] of them.
|
|
143
144
|
static func missing_below(
|
|
144
|
-
said: String,
|
|
145
|
+
said: String,
|
|
146
|
+
root_name: String,
|
|
147
|
+
reached: PackedStringArray,
|
|
148
|
+
missing: String,
|
|
149
|
+
children: PackedStringArray
|
|
145
150
|
) -> String:
|
|
146
151
|
var shown: String = ", ".join(children.slice(0, NAMED_CHILDREN))
|
|
147
152
|
if children.size() > NAMED_CHILDREN:
|
|
@@ -167,9 +172,18 @@ static func not_of_kind(
|
|
|
167
172
|
) -> String:
|
|
168
173
|
var told: String = said + ("" if said.ends_with(".") else ".")
|
|
169
174
|
if not found.is_empty():
|
|
170
|
-
told +=
|
|
175
|
+
told += (
|
|
176
|
+
' The node at "%s" is %s, not %s.'
|
|
177
|
+
% [node_path, with_article(found), with_article(kind)]
|
|
178
|
+
)
|
|
171
179
|
if holders.is_empty():
|
|
172
|
-
return
|
|
180
|
+
return (
|
|
181
|
+
told
|
|
182
|
+
+ (
|
|
183
|
+
" The scene holds no %s; scene_node add with nodeType %s puts one in it."
|
|
184
|
+
% [kind, kind]
|
|
185
|
+
)
|
|
186
|
+
)
|
|
173
187
|
var quoted: PackedStringArray = []
|
|
174
188
|
for holder: String in holders.slice(0, NAMED_CHILDREN):
|
|
175
189
|
var _quoted: bool = quoted.append('"%s"' % holder)
|
|
@@ -209,7 +223,10 @@ static func offered(said: String, word: String, names: Array) -> String:
|
|
|
209
223
|
var close: PackedStringArray = nearest(word, every)
|
|
210
224
|
if close.is_empty():
|
|
211
225
|
return "%s; it has %s" % [said, ", ".join(every)]
|
|
212
|
-
return
|
|
226
|
+
return (
|
|
227
|
+
"%s; the nearest it has %s %s"
|
|
228
|
+
% [said, "is" if close.size() == 1 else "are", ", ".join(close)]
|
|
229
|
+
)
|
|
213
230
|
|
|
214
231
|
|
|
215
232
|
## [param said], the refusal for [param property], which [param target] does not declare, with the
|
|
@@ -233,14 +250,20 @@ static func near_property(said: String, target: Object, property: String) -> Str
|
|
|
233
250
|
scripted.append(str(declared.get("name", "")))
|
|
234
251
|
var close: PackedStringArray = nearest(property, PackedStringArray(names))
|
|
235
252
|
if not close.is_empty():
|
|
236
|
-
return
|
|
237
|
-
|
|
238
|
-
|
|
253
|
+
return (
|
|
254
|
+
"%s; the nearest it has %s %s"
|
|
255
|
+
% [said, "is" if close.size() == 1 else "are", ", ".join(close)]
|
|
256
|
+
)
|
|
257
|
+
# With a script that declares nothing readable, as one that does not compile, the name is
|
|
258
|
+
# likelier the script's than the class's, so the class's list would point the wrong way.
|
|
239
259
|
if scripted.is_empty() and target.get_script() != null:
|
|
240
260
|
return said
|
|
241
261
|
if scripted.is_empty():
|
|
242
262
|
return (
|
|
243
|
-
|
|
263
|
+
(
|
|
264
|
+
"%s; editor_classes info with className %s and includeInherited true lists the "
|
|
265
|
+
+ "ones it has"
|
|
266
|
+
)
|
|
244
267
|
% [said, target.get_class()]
|
|
245
268
|
)
|
|
246
269
|
scripted.sort()
|
|
@@ -264,11 +287,13 @@ static func _list_called(target: Object, count: Dictionary, property: String) ->
|
|
|
264
287
|
fields = _fields_at(fresh, first)
|
|
265
288
|
if not fresh is RefCounted:
|
|
266
289
|
fresh.free()
|
|
267
|
-
var each: String =
|
|
290
|
+
var each: String = (
|
|
291
|
+
"each one's fields" if fields.is_empty() else "each one's %s" % ", ".join(fields)
|
|
292
|
+
)
|
|
268
293
|
return (
|
|
269
294
|
(
|
|
270
|
-
"it keeps its %s as %s, how many there are, and %s under %s for the first, %s for the
|
|
271
|
-
+ "give %s before the fields of the entries it makes"
|
|
295
|
+
"it keeps its %s as %s, how many there are, and %s under %s for the first, %s for the "
|
|
296
|
+
+ "second and so on: give %s before the fields of the entries it makes"
|
|
272
297
|
)
|
|
273
298
|
% [parts[0].to_lower(), counted, each, first, parts[1] + "1/", counted]
|
|
274
299
|
)
|
|
@@ -287,16 +312,25 @@ static func _bare(word: String) -> String:
|
|
|
287
312
|
return word.to_lower().replace("_", "").replace(" ", "")
|
|
288
313
|
|
|
289
314
|
|
|
290
|
-
## The signals [param object] has that a caller can connect, its own class's first:
|
|
291
|
-
##
|
|
292
|
-
##
|
|
315
|
+
## The signals [param object] has that a caller can connect, its own class's first: its script's,
|
|
316
|
+
## as declared, then the engine's from the class down to Object. The engine lists its own from
|
|
317
|
+
## Object down, which puts a Button's pressed after thirty a Control has, and its script's ahead of
|
|
318
|
+
## those, so reversing the whole list put a game's own two signals after twenty-four of the
|
|
319
|
+
## engine's. Names starting with an underscore are the engine's own.
|
|
293
320
|
static func signals_of(object: Object) -> Array:
|
|
321
|
+
var declared: Array = []
|
|
322
|
+
var script: Script = object.get_script()
|
|
323
|
+
if script != null:
|
|
324
|
+
for entry: Dictionary in script.get_script_signal_list():
|
|
325
|
+
var name: String = str(entry["name"])
|
|
326
|
+
if not name.begins_with("_") and not name in declared:
|
|
327
|
+
declared.append(name)
|
|
294
328
|
var names: Array = []
|
|
295
329
|
for entry: Dictionary in object.get_signal_list():
|
|
296
330
|
var name: String = str(entry["name"])
|
|
297
|
-
if not name.begins_with("_"):
|
|
331
|
+
if not name.begins_with("_") and not name in declared:
|
|
298
332
|
names.push_front(name)
|
|
299
|
-
return names
|
|
333
|
+
return declared + names
|
|
300
334
|
|
|
301
335
|
|
|
302
336
|
## [param word] after the article it takes, "an AnimationTree" or "a Node2D".
|