@@ -82,8 +82,8 @@ int CurrentUIImagePageNumber
82
82
const string ApplicationName = "OpenLoco Object Editor" ;
83
83
84
84
const string GithubApplicationName = "ObjectEditor" ;
85
- const string GithubLatestReleaseDownloadPage = @ "https://github.com/OpenLoco/ObjectEditor/releases";
86
- const string GithubLatestReleaseAPI = @ "https://api.github.com/repos/OpenLoco/ObjectEditor/releases/latest";
85
+ const string GithubLatestReleaseDownloadPage = "https://github.com/OpenLoco/ObjectEditor/releases" ;
86
+ const string GithubLatestReleaseAPI = "https://api.github.com/repos/OpenLoco/ObjectEditor/releases/latest" ;
87
87
88
88
string SettingsPath => Path . Combine ( Environment . GetFolderPath ( Environment . SpecialFolder . ApplicationData ) , ApplicationName ) ;
89
89
string SettingsFile => Path . Combine ( SettingsPath , "settings.json" ) ;
@@ -535,7 +535,6 @@ void LoadDataDump(string path, bool isG1 = false)
535
535
536
536
void LoadDataDumpCore ( string path , bool isG1 = false )
537
537
{
538
-
539
538
if ( File . Exists ( path ) )
540
539
{
541
540
var byteList = File . ReadAllBytes ( path ) ;
@@ -612,7 +611,7 @@ void LoadAndPlaySound(byte[] data, string soundName)
612
611
if ( ! header . Validate ( ) )
613
612
{
614
613
// invalid file
615
- logger ? . Warning ( $ "Invalid music track") ;
614
+ logger ? . Warning ( "Invalid music track" ) ;
616
615
return ;
617
616
}
618
617
}
@@ -714,7 +713,6 @@ public void ImportImages()
714
713
currentUIObjectImages = CreateImages ( uiObjHasGraphics . G1Elements , model . PaletteMap ) . ToList ( ) ;
715
714
RefreshImageControls ( ) ;
716
715
}
717
-
718
716
}
719
717
}
720
718
}
@@ -749,7 +747,7 @@ public string GetImageName(IUiObject? uiObj, int counter)
749
747
ILocoImageTableNames ? its = null ;
750
748
var objectName = string . Empty ;
751
749
752
- if ( uiObj is UiLocoObject uiLocoObj && uiLocoObj . LocoObject != null && uiLocoObj . LocoObject . Object is ILocoImageTableNames itss )
750
+ if ( uiObj is UiLocoObject uiLocoObj && uiLocoObj ? . LocoObject != null && uiLocoObj . LocoObject . Object is ILocoImageTableNames itss )
753
751
{
754
752
its = itss ;
755
753
objectName = uiLocoObj . DatFileInfo . S5Header . Name ;
@@ -769,7 +767,6 @@ public string GetImageName(IUiObject? uiObj, int counter)
769
767
}
770
768
771
769
return $ "{ counter } -{ value } ";
772
-
773
770
}
774
771
775
772
return $ "{ counter } -image";
@@ -793,7 +790,6 @@ public void ExportMusic(UiSoundObject uiSoundObj)
793
790
{
794
791
SawyerStreamWriter . ExportMusicAsWave ( sfDialog . FileName , uiSoundObj . Header , uiSoundObj . Data ) ;
795
792
logger . Info ( $ "Saved music to { sfDialog . FileName } ") ;
796
-
797
793
}
798
794
}
799
795
}
@@ -1053,7 +1049,7 @@ IEnumerable<Control> CreateImageControls(IEnumerable<Bitmap> images)
1053
1049
1054
1050
var uiObjHasGraphics = CurrentUIObject as IUiObjectWithGraphics ;
1055
1051
1056
- int counter = 0 ;
1052
+ var counter = 0 ;
1057
1053
foreach ( var img in images )
1058
1054
{
1059
1055
var ele = uiObjHasGraphics . G1Elements [ counter ++ ] ;
@@ -1330,7 +1326,7 @@ void btnPageNext_Click(object sender, EventArgs e)
1330
1326
}
1331
1327
1332
1328
void btnPageLast_Click ( object sender , EventArgs e )
1333
- => CurrentUIImagePageNumber = ( CurrentUIImages . Count / ImagesPerPage ) ;
1329
+ => CurrentUIImagePageNumber = CurrentUIImages . Count / ImagesPerPage ;
1334
1330
1335
1331
void dataDumpAnnotations_AfterSelect ( object sender , TreeViewEventArgs e )
1336
1332
{
@@ -1441,7 +1437,7 @@ void btnSave_Click(object sender, EventArgs e)
1441
1437
var validation = obji . LocoObject . Object . Validate ( ) ;
1442
1438
if ( ! validation )
1443
1439
{
1444
- logger . Error ( $ "Object failed validation checks; cannot save") ;
1440
+ logger . Error ( "Object failed validation checks; cannot save" ) ;
1445
1441
return ;
1446
1442
}
1447
1443
}
@@ -1465,7 +1461,7 @@ void btnSave_Click(object sender, EventArgs e)
1465
1461
{
1466
1462
if ( tvObjType . SelectedNode . Name == "css1.dat" )
1467
1463
{
1468
- var rawBytes = SawyerStreamWriter . SaveSoundEffectsToCSS ( uiSoundObjList . Audio . Select ( uis => ( uis . Header , uis . Data ) ) . ToList ( ) ) ;
1464
+ var rawBytes = SawyerStreamWriter . SaveSoundEffectsToCSS ( uiSoundObjList . Audio . ConvertAll ( uis => ( uis . Header , uis . Data ) ) ) ;
1469
1465
File . WriteAllBytes ( filename , rawBytes ) ;
1470
1466
}
1471
1467
else
0 commit comments