mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Promote Sound
This commit is contained in:
@@ -369,7 +369,21 @@ namespace SabreTools.Library.DatFiles
|
||||
});
|
||||
|
||||
reader.Read();
|
||||
break;
|
||||
|
||||
case "sound":
|
||||
datItems.Add(new Sound
|
||||
{
|
||||
Channels = reader.GetAttribute("channels"),
|
||||
|
||||
Source = new Source
|
||||
{
|
||||
Index = indexId,
|
||||
Name = filename,
|
||||
},
|
||||
});
|
||||
|
||||
reader.Read();
|
||||
break;
|
||||
|
||||
case "display":
|
||||
@@ -398,19 +412,6 @@ namespace SabreTools.Library.DatFiles
|
||||
reader.Read();
|
||||
break;
|
||||
|
||||
case "sound":
|
||||
var sound = new Sound();
|
||||
sound.Channels = reader.GetAttribute("channels");
|
||||
|
||||
// Ensure the list exists
|
||||
if (machine.Sounds == null)
|
||||
machine.Sounds = new List<Sound>();
|
||||
|
||||
machine.Sounds.Add(sound);
|
||||
|
||||
reader.Read();
|
||||
break;
|
||||
|
||||
case "condition":
|
||||
var condition = new Condition();
|
||||
condition.Tag = reader.GetAttribute("tag");
|
||||
@@ -1223,18 +1224,6 @@ namespace SabreTools.Library.DatFiles
|
||||
xtw.WriteEndElement();
|
||||
}
|
||||
}
|
||||
if (datItem.Machine.Sounds != null)
|
||||
{
|
||||
foreach (var sound in datItem.Machine.Sounds)
|
||||
{
|
||||
xtw.WriteStartElement("sound");
|
||||
|
||||
xtw.WriteOptionalAttributeString("channels", sound.Channels);
|
||||
|
||||
// End sound
|
||||
xtw.WriteEndElement();
|
||||
}
|
||||
}
|
||||
if (datItem.Machine.Conditions != null)
|
||||
{
|
||||
foreach (var condition in datItem.Machine.Conditions)
|
||||
@@ -1653,6 +1642,13 @@ namespace SabreTools.Library.DatFiles
|
||||
xtw.WriteOptionalAttributeString("filter", softwareList.Filter);
|
||||
xtw.WriteEndElement();
|
||||
break;
|
||||
|
||||
case ItemType.Sound:
|
||||
var sound = datItem as Sound;
|
||||
xtw.WriteStartElement("sound");
|
||||
xtw.WriteOptionalAttributeString("channels", sound.Channels);
|
||||
xtw.WriteEndElement();
|
||||
break;
|
||||
}
|
||||
|
||||
xtw.Flush();
|
||||
|
||||
Reference in New Issue
Block a user