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

Fix multiline string properties #75

Merged

Conversation

KockaAdmiralac
Copy link
Contributor

On Tiled version 1.11.0 (and earlier), string properties spanning multiple lines are supported. Next to the property's value, a "..." button appears which opens a multiline textbox where these strings can be written. Here is a map I created with a multiline string property.

Regular string properties look like this:

    <property name="description" value="&quot;10 steps to the East - 2nd Sign&quot;"/>

Multiline string properties look like this:

    <property name="description">&quot;10 steps to the East - 3rd Sign
10 steps to the West - 1st Sign&quot;</property>

Their contents are stored in the node text, instead of an attribute.

The documentation also states (since 2017):

When a string property contains newlines, the current version of Tiled will write out the value as characters contained inside the property element rather than as the value attribute. It is possible that a future version of the TMX format will switch to always saving property values inside the element rather than as an attribute.

This pull request fixes this issue, and adds a test for it.

@Cleptomania Cleptomania merged commit dd4cd1d into pythonarcade:development Oct 3, 2024
@Cleptomania
Copy link
Member

Thanks for the fix, I've merged and included it in new 2.2.7 release. Sorry for the slow merge!

@KockaAdmiralac KockaAdmiralac deleted the fix_multiline_properties branch October 28, 2024 01:42
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

Successfully merging this pull request may close these issues.

2 participants