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

get_display_texts() in dialogue_node potentially not working correctly #30

Open
u8times3 opened this issue Dec 2, 2024 · 0 comments
Open

Comments

@u8times3
Copy link

u8times3 commented Dec 2, 2024

a bit of an odd one to report, since thit function doesn't seem to be used anywhere currently.

here's both get_display_texts() and get_parse() for context:

func get_parse() -> Array[DialogueCommand]:
	if _parsed.is_empty():
		_parsed = DialogueParser.new().parse(commands_raw)

	return _parsed.duplicate(true)

func get_display_texts():
	var text = ""
	for parseItem in get_parse():
		if parseItem.type == DialogueCommand.CommandType.DISPLAY_TEXT:
			text += parseItem.values[0]
	return text.strip_edges(true, true)

get_display_texts() needs a parsed array of DialogueCommands from the raw text of its node. get_parse() creates a new DialogueParser and calls its parse() function, which returns a nested array of DialogueCommands that always has exactly one element at the top level with CommandType.ROOT. the bit of code inside get_display_texts() that enumerates over the result of get_parse() doesn't seem to take this into account, always returning an empty string as a result.

i fixed this on my end (for now) by instead checking each child of parseItem for its type, but i am very unfamiliar with this add-on, so i don't know if it's possible there may be more nested commands inside those children depending on the node.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant