Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix tilemap multiline property #1476

Merged
merged 9 commits into from
Dec 5, 2023
Merged

Fix tilemap multiline property #1476

merged 9 commits into from
Dec 5, 2023

Conversation

lich426
Copy link
Contributor

@lich426 lich426 commented Dec 5, 2023

Which branch your pull-request should merge into?

  • dev: Current 2.x BugFixs or Features

Describe your changes

  • Multiline property issue, where obtaining values was not possible, has been resolved.
  • Single-line values and multiline values in XML are distinguished from each other.
1 2

  • test code
auto tilemap = TMXTiledMap::create("res/Tilemap/Test.tmx");
this->addChild(tilemap, 10, 10);

auto& properties = tilemap->getProperties();
auto it = properties.find("single_line");
if (it != properties.end())
{
    auto value = it->second;
    AXLOG("key : single_line, value : %s", value.asString().c_str());
}

it = properties.find("multi_line");
if (it != properties.end())
{
    auto value = it->second;
    AXLOG("key : multi_line, value : %s", value.asString().c_str());
}
3

Issue ticket number and link

Checklist before requesting a review

  • I have performed a self-review of my code.
  • If it is a core feature, I have added thorough tests.
  • I have checked readme and add important infos to this PR (if it needed).
  • I have added/adapted some tests too.

core/2d/TMXXMLParser.cpp Outdated Show resolved Hide resolved
core/2d/TMXXMLParser.cpp Outdated Show resolved Hide resolved
@halx99 halx99 merged commit 9b2699d into axmolengine:dev Dec 5, 2023
8 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants