public static void Start(ShowroomProperties properties) {
if (_busy) return;
_busy = true;
try {
var filename = FileUtils.GetCfgShowroomFilename();
var originalShowroomFile = File.ReadAllText(filename);
var iniFile = IniFile.Parse(originalShowroomFile);
iniFile["SHOWROOM"].Set("CAR", (properties.CarId ?? "").ToLowerInvariant());
iniFile["SHOWROOM"].Set("SKIN", (properties.CarSkinId ?? "").ToLowerInvariant());
iniFile["SHOWROOM"].Set("TRACK", (properties.ShowroomId ?? "").ToLowerInvariant());
iniFile["SETTINGS"].Set("CAMERA_FOV", properties.CameraFov);
iniFile.Save(filename);
using (properties.UseBmp ? new ScreenshotFormatChange(properties.AcRoot, "BMP") : null)
using (properties.DisableWatermark ? new DisableShowroomWatermarkChange(properties.AcRoot) : null)
using (properties.DisableSweetFx ? new DisableSweetFxChange(properties.AcRoot) : null)
using (properties.Filter != null ? new VideoIniChange(properties.Filter, null, false, false) : null) {
var process = Process.Start(new ProcessStartInfo {
WorkingDirectory = properties.AcRoot,
FileName = "acShowroom.exe"
});
process?.WaitForExit();
}
} finally {
_busy = false;
}
}
}