Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnknownAlways2 -> TileOffset #2005

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions UndertaleModLib/Models/UndertaleBackground.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,10 @@ public void Unserialize(UndertaleReader reader)
/// </summary>
public UndertaleTexturePageItem Texture { get; set; }


/// <summary>
/// TODO: Functionality currently unknown. Game Maker Studio 2 only.
/// Tile offset starting from the top left, both horizontally and vertically. Game Maker Studio 2 only.
/// </summary>
public uint GMS2UnknownAlways2 { get; set; } = 2;
public uint GMS2TileOffset { get; set; } = 2;

/// <summary>
/// The width of a tile in this tileset. Game Maker Studio 2 only.
Expand Down Expand Up @@ -131,7 +130,7 @@ public void Serialize(UndertaleWriter writer)
writer.WriteUndertaleObjectPointer(Texture);
if (writer.undertaleData.IsGameMaker2())
{
writer.Write(GMS2UnknownAlways2);
writer.Write(GMS2TileOffset);
writer.Write(GMS2TileWidth);
writer.Write(GMS2TileHeight);
writer.Write(GMS2OutputBorderX);
Expand All @@ -158,7 +157,7 @@ public void Unserialize(UndertaleReader reader)
Texture = reader.ReadUndertaleObjectPointer<UndertaleTexturePageItem>();
if (reader.undertaleData.IsGameMaker2())
{
GMS2UnknownAlways2 = reader.ReadUInt32();
GMS2TileOffset = reader.ReadUInt32();
GMS2TileWidth = reader.ReadUInt32();
GMS2TileHeight = reader.ReadUInt32();
GMS2OutputBorderX = reader.ReadUInt32();
Expand Down Expand Up @@ -193,4 +192,4 @@ public void Dispose()
Name = null;
Texture = null;
}
}
}
4 changes: 2 additions & 2 deletions UndertaleModTool/Editors/UndertaleBackgroundEditor.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>

<TextBlock Grid.Row="0" Grid.Column="0" Margin="3">Unknown Always 2</TextBlock>
<local:TextBoxDark Grid.Row="0" Grid.Column="1" Margin="3" Text="{Binding GMS2UnknownAlways2}"/>
<TextBlock Grid.Row="0" Grid.Column="0" Margin="3">Tile Offset</TextBlock>
<local:TextBoxDark Grid.Row="0" Grid.Column="1" Margin="3" Text="{Binding GMS2TileOffset}"/>

<TextBlock Grid.Row="1" Grid.Column="0" Margin="3">Tile Width</TextBlock>
<local:TextBoxDark Grid.Row="1" Grid.Column="1" Margin="3" Text="{Binding GMS2TileWidth}"/>
Expand Down
Loading