Skip to content

Commit e2c4692

Browse files
committed
Add support for <ScrollFrame> & <ScrollChild> XML structures
1 parent 0cb71d6 commit e2c4692

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/XmlFileParser.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
class XmlFileParser
1111
{
1212
private const string TYPE_ANIMATION_GROUP = 'AnimationGroup';
13+
private const string TYPE_SCROLL_FRAME = 'ScrollFrame';
1314
/**
1415
* @var array<string, string> [alias => type]
1516
*/
@@ -89,7 +90,6 @@ private function parseNode(SimpleXMLElement $node, Registry $fileRegistry, ?Fram
8990
if (isset(self::TYPE_ALIASSES[$type])) {
9091
$type = self::TYPE_ALIASSES[$type];
9192
}
92-
$frame = null;
9393
if ($isIntrinsic) {
9494
$frame = new Intrinsic($name, $type, $node, $parent);
9595
$this->intrinsicRegistry->register($frame->getClassName(), $frame);
@@ -105,6 +105,11 @@ private function parseNode(SimpleXMLElement $node, Registry $fileRegistry, ?Fram
105105
}
106106
$parent?->addChild($frame);
107107

108+
if (self::TYPE_SCROLL_FRAME === $type && isset($node->ScrollChild)) {
109+
foreach ($node->ScrollChild->children() as $scrollChild) {
110+
$this->parseNode($scrollChild, $fileRegistry, $frame);
111+
}
112+
}
108113
if (isset($node->Frames)) {
109114
foreach ($node->Frames->children() as $frameChild) {
110115
$this->parseNode($frameChild, $fileRegistry, $frame);

0 commit comments

Comments
 (0)