Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No entity_type meta data in dropable_control in mobfactioneditor #510

Closed
snipercup opened this issue Dec 2, 2024 · 0 comments · Fixed by #524
Closed

No entity_type meta data in dropable_control in mobfactioneditor #510

snipercup opened this issue Dec 2, 2024 · 0 comments · Fixed by #524
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@snipercup
Copy link
Collaborator

In the mobfactions_editor.gd in the _on_save_button_button_up function it will complain that the dropable_control has no meta data of entity_type.

To fix this:
Go to add_relation_type function and add this line:
var entity_type: String = "mob" if relation.has("mob") else "mobgroup" if relation.has("mobgroup") else ""

And this line:
dropable_textedit_instance.set_meta("entity_type", entity_type)

So it looks like this:

func add_relation_type(relation: Dictionary) -> HBoxContainer:
	var hbox = HBoxContainer.new()

	# Add the label
	var label_instance: Label = Label.new()
	label_instance.text = "Relation type:"
	hbox.add_child(label_instance)

	# Add the dropable text edit for the mob or mobgroup ID
	var entity_type: String = "mob" if relation.has("mob") else "mobgroup" if relation.has("mobgroup") else ""
	var dropable_textedit_instance: HBoxContainer = dropabletextedit.instantiate()
	dropable_textedit_instance.set_text(relation.get("mob", relation.get("mobgroup", "")))
	dropable_textedit_instance.set_meta("entity_type", entity_type)
	dropable_textedit_instance.set_meta("relation_type", relation.get("relation_type"))
	dropable_textedit_instance.myplaceholdertext = "Drop a mob or mobgroup from the left menu"
	set_drop_functions(dropable_textedit_instance)
	hbox.add_child(dropable_textedit_instance)
	return hbox
@snipercup snipercup added bug Something isn't working good first issue Good for newcomers labels Dec 2, 2024
@Elshad19 Elshad19 self-assigned this Dec 4, 2024
Elshad19 added a commit to Elshad19/Dimensionfall19E that referenced this issue Dec 4, 2024
Fixes Khaligufzel#510

The terminal no longer complains when I hit save button within the content editor.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants