File tree Expand file tree Collapse file tree
app/aneko-builder/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -101,11 +101,11 @@ export default function StateList({ onEditState }: StateListProps) {
101101 < div className = { styles . panelContent } >
102102 { state . skinData . states . length > 0 ? (
103103 < div className = { styles . stateList } >
104- { state . skinData . states . map ( ( motionState ) => {
104+ { state . skinData . states . map ( ( motionState , index ) => {
105105 const isRequired = isRequiredState ( motionState . state ) ;
106106 return (
107107 < div
108- key = { motionState . state }
108+ key = { ` ${ motionState . state } - ${ index } ` }
109109 className = { `${ styles . stateItem } ${ state . selectedStateId === motionState . state ? styles . selected : '' } ` }
110110 onClick = { ( ) => selectState ( motionState . state ) }
111111 >
Original file line number Diff line number Diff line change @@ -25,12 +25,14 @@ function generateSkinXml(skinData: SkinData): string {
2525
2626 // Build motion elements
2727 const motions = states . map ( state => {
28- const motionAttrs : Record < string , unknown > = {
28+ const motionAttrs : Record < string , string > = {
2929 '@_state' : state . state ,
3030 } ;
3131
32- if ( state . checkMove ) motionAttrs [ '@_checkMove' ] = 'true' ;
33- if ( state . checkWall ) motionAttrs [ '@_checkWall' ] = 'true' ;
32+ // Only add boolean attributes if they are truthy
33+ // Use Boolean() to handle any edge cases from various data sources
34+ if ( Boolean ( state . checkMove ) ) motionAttrs [ '@_checkMove' ] = 'true' ;
35+ if ( Boolean ( state . checkWall ) ) motionAttrs [ '@_checkWall' ] = 'true' ;
3436 if ( state . nextState ) motionAttrs [ '@_nextState' ] = state . nextState ;
3537
3638 const children = buildAnimationItems ( state . items ) ;
@@ -66,6 +68,7 @@ function generateSkinXml(skinData: SkinData): string {
6668 format : true ,
6769 indentBy : ' ' ,
6870 suppressEmptyNode : true ,
71+ suppressBooleanAttributes : false ,
6972 } ) ;
7073
7174 return builder . build ( xmlObj ) ;
You can’t perform that action at this time.
0 commit comments