-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1519 from Miepee/o
Revise UTSound and UTAudioGruop
- Loading branch information
Showing
2 changed files
with
103 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
using System; | ||
|
||
namespace UndertaleModLib.Models; | ||
|
||
/// <summary> | ||
/// Audio group entry in a data file. | ||
/// </summary> | ||
/// <remarks>Audio Groups allow you to manage a set sound entries easier. | ||
/// You can use these for memory management, volume control and more. <br/> | ||
/// Audio Groups are only available to use in the regular audio system</remarks> | ||
/// <seealso cref="UndertaleSound.AudioEntryFlags.Regular"/> | ||
/// <seealso cref="UndertaleSound"/> | ||
[PropertyChanged.AddINotifyPropertyChangedInterface] | ||
public class UndertaleAudioGroup : UndertaleNamedResource, IStaticChildObjectsSize, IDisposable | ||
{ | ||
/// <inheritdoc cref="IStaticChildObjectsSize.ChildObjectsSize" /> | ||
public static readonly uint ChildObjectsSize = 4; | ||
|
||
/// <summary> | ||
/// The name of the audio group. | ||
/// </summary> | ||
/// <remarks>This is how the audio group is referenced from code.</remarks> | ||
public UndertaleString Name { get; set; } | ||
|
||
/// <inheritdoc /> | ||
public void Serialize(UndertaleWriter writer) | ||
{ | ||
writer.WriteUndertaleString(Name); | ||
} | ||
|
||
/// <inheritdoc /> | ||
public void Unserialize(UndertaleReader reader) | ||
{ | ||
Name = reader.ReadUndertaleString(); | ||
} | ||
|
||
/// <inheritdoc /> | ||
public override string ToString() | ||
{ | ||
return $"{Name?.Content} ({GetType().Name})"; | ||
} | ||
|
||
/// <inheritdoc/> | ||
public void Dispose() | ||
{ | ||
GC.SuppressFinalize(this); | ||
|
||
Name = null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters