Skip to content

Hide PROPERTY_USAGE_NO_EDITOR exports in Portrait Settings #2251

Open
@firedfromlife

Description

@firedfromlife

Is your feature request related to a problem? Please describe.
I am confused as to why the Portrait Settings don't function as expected. So I have my custom portrait setup to use "_validate_property" function and the "PROPERTY_USAGE_NO_EDITOR" constant as a way to hide irrelevant variables based on my character's base pose. This works perfectly in the editor. When it comes to making changes in the Portrait settings though, no matter what it always shows every export that isn't a group.

Describe the solution you'd like
I would like Dialogic to ignore properties with the PROPERTY_USAGE_NO_EDITOR as their usage. I would like to be able to hide settings based on other settings, which my current setup allows for in the Godot Editor just fine.

Describe alternatives you've considered
I have tried fiddling with "res://addons/dialogic/Editor/CharacterEditor/char_edit_p_section_exports.gd". When looking at it, it would appear that at no point, even when trying to manually call notify_property_list_changed on the scene does it fire that event. This makes the _validate_property not function as intend when using the Portrait Settings menu.

Additional context
This is the code that currently works for the editor. I will continue looking over "char_edit_p_section_exports.gd" to see if I can find a solution.


@export_group("Portrait")
@export var base := Bases.BASED_ON_PORTRAIT:
	set(value):
		base = value
		notify_property_list_changed()
@export_subgroup("Stand", "stand_")
@export var stand_mouth := Stand_Mouths.BASED_ON_PORTRAIT
@export var stand_eyes := Stand_Eyes.BASED_ON_PORTRAIT
@export_subgroup("Stern", "stern_")
@export var stern_mouth := Stern_Mouths.BASED_ON_PORTRAIT


func _validate_property(property: Dictionary):
	if property.name == "base":
		return
	if property.type == 0:
		return
	match self.base:
		Bases.Stand:
			var prefix = "stand_"
			if !property.name.begins_with(prefix):
				property.usage = PROPERTY_USAGE_NO_EDITOR
		Bases.Stern:
			var prefix = "stern_"
			if !property.name.begins_with(prefix):
				property.usage = PROPERTY_USAGE_NO_EDITOR

Metadata

Metadata

Assignees

No one assigned

    Labels

    Enhance ⚡Improve a feature's workflow.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions