Skip to content

Commit da9ec09

Browse files
authored
Revise for audio, texture, globalinit (#1520)
* Redo documentation for audio, texture, globalinit * revert the one change * SPAAAAAAAAAAAAAAAAAAAACE
1 parent b47792f commit da9ec09

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

UndertaleModLib/Models/UndertaleEmbeddedAudio.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class UndertaleEmbeddedAudio : UndertaleNamedResource, PaddedObject, IDis
1212
/// <summary>
1313
/// The name of the embedded audio entry.
1414
/// </summary>
15-
/// <remarks>This is an UTMT only attribute. GameMaker does not store names for them.</remarks>
15+
/// <remarks>This is a UTMT only attribute. GameMaker does not store names for them.</remarks>
1616
public UndertaleString Name { get; set; }
1717

1818
/// <summary>
@@ -56,13 +56,13 @@ public override string ToString()
5656
try
5757
{
5858
// TODO: Does only the GUI set this?
59-
return Name.Content + " (" + GetType().Name + ")";
59+
return $"{Name.Content} ({GetType().Name})";
6060
}
6161
catch
6262
{
6363
Name = new UndertaleString("EmbeddedSound Unknown Index");
6464
}
65-
return Name.Content + " (" + GetType().Name + ")";
65+
return $"{Name.Content} ({GetType().Name})";
6666
}
6767

6868
/// <inheritdoc/>

UndertaleModLib/Models/UndertaleEmbeddedTexture.cs

+5-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ public class UndertaleEmbeddedTexture : UndertaleNamedResource, IDisposable
2020
/// <summary>
2121
/// The name of the embedded texture entry.
2222
/// </summary>
23+
/// <remarks>
24+
/// This is UTMT specific. The data file does not contain names for embedded textures.
25+
/// </remarks>
2326
public UndertaleString Name { get; set; }
2427

2528
/// <summary>
@@ -59,13 +62,13 @@ public TexData TextureData
5962
/// <summary>
6063
/// Helper variable for whether or not this texture is to be stored externally or not.
6164
/// </summary>
62-
public bool TextureExternal { get; set; } = false;
65+
public bool TextureExternal { get; set; }
6366

6467

6568
/// <summary>
6669
/// Helper variable for whether or not a texture was loaded yet.
6770
/// </summary>
68-
public bool TextureLoaded { get; set; } = false;
71+
public bool TextureLoaded { get; set; }
6972

7073
/// <summary>
7174
/// Width of the texture. 2022.9+ only.

UndertaleModLib/Models/UndertaleGlobalInit.cs

+5-3
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@ namespace UndertaleModLib.Models;
66
/// <summary>
77
/// A global initialization entry in a data file.
88
/// </summary>
9-
/// <remarks>Never seen in GMS1.4 so uncertain if the structure was the same.</remarks>
9+
/// <remarks></remarks>
10+
// TODO: Never seen in GMS1.4 so uncertain if the structure was the same.
1011
public class UndertaleGlobalInit : UndertaleObject, INotifyPropertyChanged, IDisposable
1112
{
1213
private UndertaleResourceById<UndertaleCode, UndertaleChunkCODE> _code = new();
1314

1415
/// <summary>
1516
/// The <see cref="UndertaleCode"/> object which contains the code.
1617
/// </summary>
18+
/// <remarks>This code is executed at a global scope, before the first room of the game executes.</remarks>
1719
public UndertaleCode Code { get => _code.Resource; set { _code.Resource = value; PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Code))); } }
1820

1921
/// <inheritdoc />
@@ -29,7 +31,7 @@ public void Serialize(UndertaleWriter writer)
2931
public void Unserialize(UndertaleReader reader)
3032
{
3133
_code = new UndertaleResourceById<UndertaleCode, UndertaleChunkCODE>();
32-
_code.Unserialize(reader); // TODO: reader.ReadUndertaleObject if one object starts with another one
34+
_code.Unserialize(reader); // Cannot use ReadUndertaleObject, as that messes things up.
3335
}
3436

3537
/// <inheritdoc/>
@@ -39,4 +41,4 @@ public void Dispose()
3941

4042
_code.Dispose();
4143
}
42-
}
44+
}

0 commit comments

Comments
 (0)