GodotModding / GodotModding/godot-mod-tool

context menu items not being added

Open
#141 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
GDScript
Stars
69
Forks
12
PR merge metrics
No merged PRs in 30d

Description

ERROR: res://addons/mod_loader/resources/mod_manifest.gd:116 - Invalid access to property or key 'ml_options' on a base object of type 'Node (mod_loader_store.gd)'.
ModTool: Loaded manifest from res://mods-unpacked/rssaromeo-test/manifest.json
WARNING: editor/editor_file_system.cpp:1376 - UID duplicate detected between res://mods-unpacked/rssaromeo-test/mod_main.gd and res://addons/mod_tool/templates/default/mod_main.gd.
ERROR: core/object/object.cpp:1300 - Error calling from signal 'about_to_popup' to callable: 'Control(file_system_context_actions.gd)::_on_file_list_context_actions_about_to_popup': Cannot convert argument 2 from Object to Object.

at
```gdscript
func _on_file_list_context_actions_about_to_popup(context_menu: PopupMenu, list: ItemList) -> void:
if not list.get_selected_items().size() > 0: # Empty space was clicked
return

var file_paths := []
for item_index in list.get_selected_items():
var file_path = list.get_item_metadata(item_index)
if file_path is String:
file_paths.append(file_path)

add_custom_context_actions(context_menu, file_paths)
```
list should be a Tree not an ItemList as that is what is passed in to this function.

godot version v4.5.beta1.official [46c495ca2]

Contributor guide

No contributing guide indexed for this repository

Research direction

Read file_system_context_actions.gd and the _on_file_list_context_actions_about_to_popup function, then reproduce the issue on Godot v4.5.beta1. Update the list handling to match the Tree passed by the signal; done means the context menu items are added without the signal argument conversion error.

Written by the indexing model from the issue text.

Assessment

Tech stack
godot
Domain
tooling
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.