@@ -17,6 +17,7 @@ string projFolder = GetFolder(FilePath) + GameName + ".gmx" + Path.DirectorySepa
17
17
TextureWorker worker = new TextureWorker ( ) ;
18
18
ThreadLocal < DecompileContext > DECOMPILE_CONTEXT = new ThreadLocal < DecompileContext > ( ( ) => new DecompileContext ( Data , false ) ) ;
19
19
string gmxDeclaration = "This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!" ;
20
+ string eol = "\n " ; // Linux: "\n", Windows: "\r\n"
20
21
21
22
if ( Directory . Exists ( projFolder ) )
22
23
{
@@ -135,7 +136,7 @@ void ExportSprite(UndertaleSprite sprite)
135
136
}
136
137
}
137
138
138
- File . WriteAllText ( projFolder + "/sprites/" + sprite . Name . Content + ".sprite.gmx" , gmx . ToString ( ) ) ;
139
+ File . WriteAllText ( projFolder + "/sprites/" + sprite . Name . Content + ".sprite.gmx" , gmx . ToString ( ) + eol ) ;
139
140
140
141
// Save sprite images
141
142
for ( int i = 0 ; i < sprite . Textures . Count ; i ++ )
@@ -180,7 +181,7 @@ void ExportBackground(UndertaleBackground background)
180
181
)
181
182
) ;
182
183
183
- File . WriteAllText ( projFolder + "/background/" + background . Name . Content + ".background.gmx" , gmx . ToString ( ) ) ;
184
+ File . WriteAllText ( projFolder + "/background/" + background . Name . Content + ".background.gmx" , gmx . ToString ( ) + eol ) ;
184
185
185
186
// Save background images
186
187
if ( background . Texture != null )
@@ -297,7 +298,7 @@ void ExportGameObject(UndertaleGameObject gameObject)
297
298
}
298
299
}
299
300
300
- File . WriteAllText ( projFolder + "/objects/" + gameObject . Name . Content + ".object.gmx" , gmx . ToString ( ) + " \n " ) ;
301
+ File . WriteAllText ( projFolder + "/objects/" + gameObject . Name . Content + ".object.gmx" , gmx . ToString ( ) + eol ) ;
301
302
}
302
303
303
304
// --------------- Export Room ---------------
@@ -323,6 +324,7 @@ void ExportRoom(UndertaleRoom room)
323
324
new XElement ( "speed" , room . Speed . ToString ( ) ) ,
324
325
new XElement ( "persistent" , BoolToString ( room . Persistent ) ) ,
325
326
new XElement ( "colour" , room . BackgroundColor . ToString ( ) ) ,
327
+ new XElement ( "showcolour" , BoolToString ( room . DrawBackgroundColor ) ) ,
326
328
new XElement ( "code" , room . CreationCodeId != null ? Decompiler . Decompile ( room . CreationCodeId , DECOMPILE_CONTEXT . Value ) : "" ) ,
327
329
new XElement ( "enableViews" , BoolToString ( room . Flags . HasFlag ( UndertaleRoom . RoomEntryFlags . EnableViews ) ) ) ,
328
330
new XElement ( "clearViewBackground" , BoolToString ( room . Flags . HasFlag ( UndertaleRoom . RoomEntryFlags . ShowColor ) ) ) ,
@@ -375,7 +377,8 @@ void ExportRoom(UndertaleRoom room)
375
377
new XAttribute ( "objName" , i . ObjectId is null ? "<undefined>" : i . ObjectId . Name . Content ) ,
376
378
new XAttribute ( "xview" , i . ViewX . ToString ( ) ) ,
377
379
new XAttribute ( "yview" , i . ViewY . ToString ( ) ) ,
378
- new XAttribute ( "wview" , i . ViewHeight . ToString ( ) ) ,
380
+ new XAttribute ( "wview" , i . ViewWidth . ToString ( ) ) ,
381
+ new XAttribute ( "hview" , i . ViewHeight . ToString ( ) ) ,
379
382
new XAttribute ( "xport" , i . PortX . ToString ( ) ) ,
380
383
new XAttribute ( "yport" , i . PortY . ToString ( ) ) ,
381
384
new XAttribute ( "wport" , i . PortWidth . ToString ( ) ) ,
@@ -446,7 +449,7 @@ void ExportRoom(UndertaleRoom room)
446
449
new XElement ( "PhysicsWorldPixToMeters" , room . MetersPerPixel )
447
450
) ;
448
451
449
- File . WriteAllText ( projFolder + "/rooms/" + room . Name . Content + ".room.gmx" , gmx . ToString ( ) + " \n " ) ;
452
+ File . WriteAllText ( projFolder + "/rooms/" + room . Name . Content + ".room.gmx" , gmx . ToString ( ) + eol ) ;
450
453
}
451
454
452
455
// --------------- Export Sound ---------------
@@ -492,7 +495,7 @@ void ExportSound(UndertaleSound sound)
492
495
)
493
496
) ;
494
497
495
- File . WriteAllText ( projFolder + "/sound/" + sound . Name . Content + ".sound.gmx" , gmx . ToString ( ) + " \n " ) ;
498
+ File . WriteAllText ( projFolder + "/sound/" + sound . Name . Content + ".sound.gmx" , gmx . ToString ( ) + eol ) ;
496
499
497
500
// Save sound files
498
501
if ( sound . AudioFile != null )
@@ -562,7 +565,7 @@ void ExportFont(UndertaleFont font)
562
565
glyphsNode . Add ( glyphNode ) ;
563
566
}
564
567
565
- File . WriteAllText ( projFolder + "/fonts/" + font . Name . Content + ".font.gmx" , gmx . ToString ( ) ) ;
568
+ File . WriteAllText ( projFolder + "/fonts/" + font . Name . Content + ".font.gmx" , gmx . ToString ( ) + eol ) ;
566
569
567
570
// Save font textures
568
571
worker . ExportAsPNG ( font . Texture , projFolder + "/fonts/" + font . Name . Content + ".png" ) ;
@@ -599,7 +602,7 @@ void ExportPath(UndertalePath path)
599
602
) ;
600
603
}
601
604
602
- File . WriteAllText ( projFolder + "/paths/" + path . Name . Content + ".path.gmx" , gmx . ToString ( ) ) ;
605
+ File . WriteAllText ( projFolder + "/paths/" + path . Name . Content + ".path.gmx" , gmx . ToString ( ) + eol ) ;
603
606
}
604
607
605
608
// --------------- Export Timelines ---------------
@@ -650,7 +653,7 @@ void ExportTimeline(UndertaleTimeline timeline)
650
653
gmx . Element ( "timeline" ) . Add ( entryNode ) ;
651
654
}
652
655
653
- File . WriteAllText ( projFolder + "/timelines/" + timeline . Name . Content + ".timeline.gmx" , gmx . ToString ( ) ) ;
656
+ File . WriteAllText ( projFolder + "/timelines/" + timeline . Name . Content + ".timeline.gmx" , gmx . ToString ( ) + eol ) ;
654
657
}
655
658
656
659
@@ -675,7 +678,7 @@ void GenerateProjectFile()
675
678
WriteIndexes < UndertalePath > ( gmx . Element ( "assets" ) , "paths" , "paths" , Data . Paths , "path" , "paths\\ " ) ;
676
679
WriteIndexes < UndertaleTimeline > ( gmx . Element ( "assets" ) , "timelines" , "timelines" , Data . Timelines , "timeline" , "timelines\\ " ) ;
677
680
678
- File . WriteAllText ( projFolder + GameName + ".project.gmx" , gmx . ToString ( ) ) ;
681
+ File . WriteAllText ( projFolder + GameName + ".project.gmx" , gmx . ToString ( ) + eol ) ;
679
682
}
680
683
681
684
void WriteIndexes < T > ( XElement rootNode , string elementName , string attributeName , IList < T > dataList , string oneName , string resourcePath , string fileExtension = "" )
0 commit comments