Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
229 commits
Select commit Hold shift + click to select a range
d607c7e
Initial commit of the Avalonia port
luizzeroxis May 5, 2025
3cc992c
Use SetData
luizzeroxis May 19, 2025
49ff512
Changed Margin properties to style classes
luizzeroxis May 19, 2025
8fb2923
Removed MVVM-Toolkit, added PropertyChanged.SourceGenerator
luizzeroxis May 20, 2025
071aa3c
Add sprite view
luizzeroxis May 20, 2025
482229c
Extracted image cache, moved to main view model.
luizzeroxis May 21, 2025
a031070
Merge remote-tracking branch 'origin/master' into avalonia
luizzeroxis May 21, 2025
2b1cbc7
Added image viewer to sprite editor
luizzeroxis May 23, 2025
a971190
Context menu for adding new resources
luizzeroxis May 24, 2025
2e202fd
Switch TreeView for a custom ListBox so it's virtualized
luizzeroxis May 25, 2025
70246a4
Separated data list to file
luizzeroxis May 25, 2025
a200a4c
Fix drag and drop of resources from list
luizzeroxis May 25, 2025
f3879ab
Don't show expander when there's no children
luizzeroxis May 25, 2025
3ec8c67
Fix list not adding items to the right place and reduced duplicate code
luizzeroxis May 26, 2025
e42853b
Fix error when loading data when data tree is collapsed
luizzeroxis May 26, 2025
29c6211
Add sound editor
luizzeroxis May 26, 2025
a680d40
Double click to expand tree item, fixed some problem with tab closing
luizzeroxis May 27, 2025
d0a9bd8
Add background editor
luizzeroxis May 27, 2025
95f0634
Fix Version variable not updating
luizzeroxis May 27, 2025
d446402
Changed columns to be 1*,3*
luizzeroxis May 27, 2025
64e5534
Add title
luizzeroxis May 28, 2025
b956469
Add embedded texture editor
luizzeroxis May 28, 2025
c042ce6
Checkered background
luizzeroxis May 28, 2025
3c74f8d
Add texture page item editor
luizzeroxis May 28, 2025
89951fe
Improved scrolling on embedded texture editor
luizzeroxis May 28, 2025
1c5d765
Add save image button to texture page item
luizzeroxis May 29, 2025
ba5cf7e
Add message dialog
luizzeroxis May 31, 2025
644b211
Add button functions to message dialog, move styles out and reorganiz…
luizzeroxis Jun 1, 2025
b5764b4
Add embedded audio editor
luizzeroxis Jun 1, 2025
34a6231
Tree item view model now references DataTreeView
luizzeroxis Jun 1, 2025
7650c80
Add script editor
luizzeroxis Jun 1, 2025
b53d81c
Add variable editor
luizzeroxis Jun 1, 2025
c0288a9
Enter to open item
luizzeroxis Jun 2, 2025
87f69f4
Add function editor
luizzeroxis Jun 2, 2025
7d690c9
Merge remote-tracking branch 'origin/master' into avalonia
luizzeroxis Jun 2, 2025
65597a1
Add code locals editor
luizzeroxis Jun 2, 2025
bda6a69
Add path editor
luizzeroxis Jun 2, 2025
40072f0
Add save image button to embedded texture
luizzeroxis Jun 2, 2025
3168ee7
Add font editor
luizzeroxis Jun 4, 2025
46edfa4
Small adjustments
luizzeroxis Jun 4, 2025
700cf6c
Change menu no NativeMenu for a better experience with global menus (…
luizzeroxis Jun 13, 2025
b7477c5
Add resource id to bottom right corner
luizzeroxis Jun 13, 2025
a9d74b1
Deal with code entries with parents and show code errors
luizzeroxis Jun 13, 2025
2213cbc
Improvements to message dialog - esc to close, text wrap, max height
luizzeroxis Jun 13, 2025
d4ffca5
Add close and GitHub menu items
luizzeroxis Jun 13, 2025
c859df6
Add audio group editor
luizzeroxis Jun 14, 2025
b3a880c
Limit multiline resource names to one line
luizzeroxis Jun 14, 2025
bb56d03
Show null entries in themed gray
luizzeroxis Jun 14, 2025
63444b6
Add shader editor
luizzeroxis Jun 15, 2025
4affcc7
Fix message boxes on non-Windows
luizzeroxis Jun 15, 2025
dfb12bb
Add timeline editor
luizzeroxis Jun 15, 2025
e227f03
Make variables list update when changed
luizzeroxis Jun 15, 2025
1fdf421
Add texture group information editor
luizzeroxis Jun 15, 2025
52e2124
Reduced expander size
luizzeroxis Jun 16, 2025
7168fd4
Add embedded image editor
luizzeroxis Jun 16, 2025
7fb17fb
Move styles to separate file
luizzeroxis Jun 16, 2025
eb27957
Add filter functionality to data tree
luizzeroxis Jun 17, 2025
f1cdc7b
Merge remote-tracking branch 'origin/master' into avalonia
luizzeroxis Jun 17, 2025
2a3cb07
Add Ctrl+K shortcut and better error checking to code editor
luizzeroxis Jun 18, 2025
60eaa7c
Move resource initialization to the library
luizzeroxis Jun 20, 2025
c2ac848
Add save function
luizzeroxis Jun 20, 2025
9dae7e9
Preserve state when switching tabs
luizzeroxis Jun 20, 2025
cead481
Forgot to add this file
luizzeroxis Jun 21, 2025
ccbaabf
Add collision mask viewer
luizzeroxis Jun 21, 2025
3b9cf05
Add settings window
luizzeroxis Jun 22, 2025
b507292
Add particle system editor
luizzeroxis Jun 25, 2025
5c3eb96
Add particle system emitter editor
luizzeroxis Jun 27, 2025
d9ab2de
Auto select first item on data grid
luizzeroxis Jun 27, 2025
6564a59
Add extension editor
luizzeroxis Jun 27, 2025
b8c855d
Merge remote-tracking branch 'origin/master' into avalonia
luizzeroxis Jun 28, 2025
985d3cc
Added (rough) search in code window
luizzeroxis Jun 29, 2025
3caf773
Open search result in line, enter to search (shift+enter to add new l…
luizzeroxis Jul 4, 2025
ef2cf35
Open file through command line argument, show data file errors
luizzeroxis Jul 4, 2025
e90bcdf
Change Version to DataVersion
luizzeroxis Jul 5, 2025
81df6f3
Save settings to file and set version
luizzeroxis Jul 5, 2025
ed702ec
Update dependencies
luizzeroxis Jul 5, 2025
740ea8f
Basic scripting support, add command box funcionality
luizzeroxis Jul 5, 2025
5f9c770
Import and export collision mask data
luizzeroxis Jul 7, 2025
3891bf5
Added more scripting functions
luizzeroxis Jul 8, 2025
8ae9835
Small accumulated fixes
luizzeroxis Jul 8, 2025
f1b85b7
Change bug fix to setting AutoScrollToSelectedItem to false since tha…
luizzeroxis Jul 15, 2025
9d05648
Added tab navigation, open in new tab options, changed some button te…
luizzeroxis Jul 16, 2025
6ac9cf4
Add draggable tabs
luizzeroxis Jul 17, 2025
9637a5e
Added loader dialog
luizzeroxis Jul 18, 2025
252c948
Add more scripting API implementations and improve scripting
luizzeroxis Jul 19, 2025
062570d
Add SkiaSharp.NativeAssets.Linux
luizzeroxis Jul 19, 2025
86682f6
Add remove and copy name options to resources
luizzeroxis Jul 20, 2025
1c5e7c9
Room editor improvements
luizzeroxis Jul 22, 2025
fa66cb3
Various improvements
luizzeroxis Jul 22, 2025
ac3113e
Add room editors for sprite and particle system instances
luizzeroxis Jul 23, 2025
6ec3335
Add icon
luizzeroxis Jul 24, 2025
d3c7c41
Room editor fixes
luizzeroxis Jul 25, 2025
b93e377
Click on room items to select them
luizzeroxis Jul 26, 2025
d44bb9d
Add loader dialogs on code editor
luizzeroxis Jul 26, 2025
c0983d3
Select sprite instances in room, reset translation and scaling when c…
luizzeroxis Jul 26, 2025
cea0e9a
Avalonia GitHub Actions
luizzeroxis Jul 27, 2025
13f6b75
Move items in room
luizzeroxis Jul 28, 2025
eae6bc9
Add decompile settings
luizzeroxis Jul 29, 2025
eda89bb
Merge remote-tracking branch 'origin/master' into avalonia
luizzeroxis Jul 30, 2025
65dad71
Only select from selected category
luizzeroxis Jul 31, 2025
7625f54
Properly select selected item in room tree, keep current layer when u…
luizzeroxis Aug 2, 2025
562e64c
Ask user for asset name when creating, and if room should be added in…
luizzeroxis Aug 3, 2025
0c1e53a
Add scripting function for text inputs
luizzeroxis Aug 3, 2025
bc17e36
Flip and rotate tiles, instance color, fix crash with rooms after 202…
luizzeroxis Aug 4, 2025
9836df1
Fix data grid add not enabling
luizzeroxis Aug 6, 2025
47236d2
Save changes before quitting dialog
luizzeroxis Aug 7, 2025
6c88eee
Small dialog fixes
luizzeroxis Aug 7, 2025
357a3c4
Ask user to save when creating new, opening or closing data file
luizzeroxis Aug 9, 2025
5233ace
Moved view accessing functions to interface
luizzeroxis Aug 9, 2025
e4c8078
Loader window is now an interface for testing
luizzeroxis Aug 9, 2025
a3897d1
Merge remote-tracking branch 'origin/master' into avalonia
luizzeroxis Aug 10, 2025
4dc296a
Update version to 0.8.3.0
luizzeroxis Aug 10, 2025
45ca572
Allow custom Styles.xaml in AppData
luizzeroxis Aug 10, 2025
220108b
Moved room properties to left side, zoom textbox
luizzeroxis Aug 10, 2025
9a29b0d
Fix forgotten Avalonia.Markup.Xaml.Loader and update dependencies
luizzeroxis Aug 11, 2025
1b32c9b
Single namespace
luizzeroxis Aug 16, 2025
1c03a16
Reorganized folders
luizzeroxis Aug 16, 2025
5fbeed0
Restore caret position and focus after compile in code editor
luizzeroxis Aug 19, 2025
f97ca8a
Basic code syntax highlighting
luizzeroxis Aug 20, 2025
cbeb8e8
Rough tile editor
luizzeroxis Aug 30, 2025
701b791
Add copy and paste to room instances
luizzeroxis Sep 27, 2025
395ab75
Add move up and down buttons to room editor
luizzeroxis Oct 12, 2025
5bd9c79
Add swap to position to resources
luizzeroxis Oct 12, 2025
246044e
Removed room debug text, added room coordinates under mouse
luizzeroxis Oct 13, 2025
fae20e2
Setting to disable syntax highlighting
luizzeroxis Oct 13, 2025
1b44d06
Update dependencies
luizzeroxis Oct 13, 2025
bb50336
Merge branch 'master' into avalonia
luizzeroxis Oct 13, 2025
b57feee
Fix for updates
luizzeroxis Oct 13, 2025
c5a72e3
Add option to not auto compile
luizzeroxis Oct 14, 2025
ca87358
Fix sprites not showing up when opening
luizzeroxis Oct 15, 2025
480169d
Fix color background
luizzeroxis Oct 15, 2025
636d70c
Fix negative scaled items not being selected in room
luizzeroxis Oct 15, 2025
e46a6f6
Render tiled backgrounds
luizzeroxis Oct 16, 2025
9541ea7
Room editor reorganize around room items
luizzeroxis Oct 19, 2025
d531874
Changed custom data tree view with TreeDataGrid
luizzeroxis Oct 22, 2025
44df104
Temporary fix to resource position swaps sometimes not working
luizzeroxis Oct 23, 2025
4a03185
Setting to open new resource after creating it
luizzeroxis Oct 23, 2025
24e67b2
Fix crash when rendering happens at same time as updates in room editor
luizzeroxis Oct 27, 2025
c44e25b
Add room grid
luizzeroxis Oct 28, 2025
9bc6dd6
Removed unecessary columns and buttons in data grids
luizzeroxis Oct 28, 2025
4282595
Remove DynamicData, replace with custom solution
luizzeroxis Nov 23, 2025
4363d01
Update dependencies
luizzeroxis Nov 24, 2025
2f0928e
Added a reset to the list when there's too many changes to fix perfor…
luizzeroxis Dec 8, 2025
7ceabe6
Gray parented code entries and null entries (again)
luizzeroxis Dec 9, 2025
f2843c1
Update SKImageViewer to be simpler and more robust
luizzeroxis Dec 14, 2025
02b7505
Show sprite in object, hide GMS2 stuff in GMS1.
luizzeroxis Dec 14, 2025
310cf76
Merge branch 'master' into avalonia
luizzeroxis Dec 15, 2025
05c979a
Update to .NET 10
luizzeroxis Dec 15, 2025
606243e
Add right click to code editor to replace integer index with a proper…
luizzeroxis Dec 21, 2025
6cbf213
Improved code editor performance by caching highlighting data
luizzeroxis Dec 24, 2025
87c5a6d
Added loader to search on code
luizzeroxis Dec 24, 2025
efb69b1
Expand data tree item on load
luizzeroxis Dec 24, 2025
2e2d76e
View font and embedded image image
luizzeroxis Dec 25, 2025
e2934a1
Import audio
luizzeroxis Dec 25, 2025
4474391
Import embedded texture
luizzeroxis Dec 26, 2025
623da7b
Drop data files into window to open
luizzeroxis Dec 26, 2025
0d21d2d
CollectionChanged and loader window works in other threads (hopefully…
luizzeroxis Dec 28, 2025
284f2eb
Removed ShowMessageDialog
luizzeroxis Dec 28, 2025
7beb969
Add right click option on tab to select item on list
luizzeroxis Dec 28, 2025
8958931
Moved ScrollViewer inside views to fix some issues
luizzeroxis Dec 28, 2025
71064fe
Add save as image to room editor
luizzeroxis Dec 28, 2025
d78cc7c
Add button to export sprite textures as PNGs
luizzeroxis Dec 31, 2025
cefd37b
Fast tile rendering with DrawVertices
luizzeroxis Dec 31, 2025
aff5518
Fix whitespace
luizzeroxis Dec 31, 2025
abb7a4e
Merge branch 'master' into avalonia
luizzeroxis Jan 1, 2026
b19fff5
Update for new background properties
luizzeroxis Jan 2, 2026
8af09c6
Add path viewer
luizzeroxis Jan 12, 2026
434e07e
Little reorganizing of room editor
luizzeroxis Jan 15, 2026
08ff972
Add select any layer to room editor
luizzeroxis Jan 15, 2026
687af36
Merge remote-tracking branch 'origin/master' into avalonia
luizzeroxis Jan 19, 2026
5066d24
Update version number
luizzeroxis Jan 19, 2026
8320d7c
Update dependencies
luizzeroxis Jan 19, 2026
d235762
Add tile picker
luizzeroxis Jan 20, 2026
024139d
Formatting fixes
luizzeroxis Jan 20, 2026
87b585a
Move room view things to view model
luizzeroxis Jan 20, 2026
1d8908b
Add auto size tile layer button
luizzeroxis Jan 21, 2026
081784c
Use resources in styles
luizzeroxis Jan 21, 2026
74964ba
Tile set columns control now a NumericUpDown
luizzeroxis Jan 21, 2026
8d54ae5
Add some keyboard shortcuts
luizzeroxis Jan 23, 2026
1c7f64f
Add middle click button in places
luizzeroxis Jan 23, 2026
0d929f0
Add flip x, flip y and rotate buttons to tile picker, and right click…
luizzeroxis Jan 25, 2026
c3c372a
Room editor reorganizing
luizzeroxis Jan 26, 2026
6ec4541
Fix crash after changing syntax highlight setting (#7)
luizzeroxis Jan 26, 2026
5b2e65f
Moved room renderer to separate file
luizzeroxis Jan 31, 2026
d06884f
Limiting room items and isolating custom draw operation
luizzeroxis Feb 2, 2026
8caad01
The room renderer now first creates render commands, which will store…
luizzeroxis Feb 8, 2026
7371a67
Cull tiles in tiles layer outside view
luizzeroxis Feb 8, 2026
a7527ca
Changed to software rendering on Linux to hopefully avoid crashes
luizzeroxis Feb 8, 2026
d14e747
Add animation curve editor
luizzeroxis Feb 11, 2026
caa921a
Only show chunks that exist in data file
luizzeroxis Feb 12, 2026
5efdd81
Made selection color the same as theme in custom draw operations
luizzeroxis Feb 12, 2026
a15e0c7
Small changes
luizzeroxis Feb 12, 2026
7fc19c6
Add textbox to flags box
luizzeroxis Feb 14, 2026
20f2ad3
Add "run with runner" feature
luizzeroxis Feb 16, 2026
6267c34
Change MessageWindow's arguments to Buttons
luizzeroxis Feb 17, 2026
c3fc657
Moved file picker types to separate file
luizzeroxis Feb 17, 2026
3b64f9d
Forgot other operating systems existed
luizzeroxis Feb 17, 2026
4639c7f
Added basic test project
luizzeroxis Feb 18, 2026
f6c49a6
Merge branch 'master' into avalonia
luizzeroxis Feb 19, 2026
c45c050
Add audio player with SDL
luizzeroxis Feb 21, 2026
1df3eca
Add attach and detach events to tabs, sounds stop when embedded audio…
luizzeroxis Feb 23, 2026
e9e3f3a
View and play audio from sound if in the same data file
luizzeroxis Feb 24, 2026
05457c8
Fix version comparer
luizzeroxis Feb 24, 2026
cc06d26
Improve audio player
luizzeroxis Feb 24, 2026
8593ee4
Improve some rotations
luizzeroxis Feb 27, 2026
458f074
Zoom in tile picker
luizzeroxis Mar 1, 2026
4b3e3a3
Checkered background in tile picker
luizzeroxis Mar 1, 2026
e832fd3
Try to fix crash in large rooms
luizzeroxis Mar 5, 2026
36fa046
Use default monospace font on Linux, moved font config to style resource
luizzeroxis Mar 5, 2026
81f7cf7
Quick fix for search results not opening in correct line when compila…
luizzeroxis Mar 13, 2026
84315a3
Slightly better go to location logic
luizzeroxis Mar 13, 2026
582dc7e
Add add button to reference, can add new code entry within object wit…
luizzeroxis Mar 14, 2026
1980d3f
Add setting to not start maximized
luizzeroxis Mar 15, 2026
1e9787a
Try to show message on error
luizzeroxis Mar 21, 2026
afeb8c3
Moved things to ImportExport
luizzeroxis Mar 21, 2026
8446487
Fix and add tests to ObservableCollectionView
luizzeroxis Mar 26, 2026
4598395
Binary search in observable collection view, more testing
luizzeroxis Mar 29, 2026
f202cb0
Allow shift+enter in command box
luizzeroxis Apr 3, 2026
8cd9b6c
Add some TargetWidth and TargetHeight support
luizzeroxis Apr 3, 2026
f3cc266
Merge branch 'master' into avalonia
luizzeroxis Apr 4, 2026
5982476
Update dependencies
luizzeroxis Apr 4, 2026
4ffc60d
Allow playing sounds in sound editor if there's no audio groups
luizzeroxis Apr 4, 2026
75b204f
Make double tapping reference views go to the reference
skirlez Feb 19, 2026
507532a
Merge branch 'skirlez/avalonia' into avalonia
luizzeroxis Apr 5, 2026
12afdc0
Allow dragging and dropping objects and sprites into room
luizzeroxis Apr 13, 2026
5ad993d
Add auto tile IDs button
luizzeroxis Apr 14, 2026
6414567
Small scripting fixes
luizzeroxis Apr 23, 2026
d4252ef
Merge commit 'f3f1c878' into avalonia
luizzeroxis Apr 23, 2026
cd16932
Fix things from last merge
luizzeroxis Apr 23, 2026
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
50 changes: 50 additions & 0 deletions .github/workflows/publish_gui_avalonia.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Publish UndertaleModToolAvalonia

on:
push:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build_gui:

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
configuration: [Release]
bundled: [true]
singlefile: [false]
include:
- os: ubuntu-latest
rid: linux-x64
- os: macOS-latest
rid: osx-x64
- os: windows-latest
rid: win-x64

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Publish ${{ matrix.os }} GUI
run: |
dotnet publish UndertaleModToolAvalonia.Desktop -c ${{ matrix.configuration }} -r ${{ matrix.rid }} --self-contained ${{ matrix.bundled }} -p:PublishSingleFile=${{ matrix.singlefile }} --output Publish/${{ matrix.os }}
- name: Copy external files
run: |
cp ./README.md ./Publish/${{ matrix.os }}
cp ./SCRIPTS.md ./Publish/${{ matrix.os }}
cp ./LICENSE.txt ./Publish/${{ matrix.os }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: GUI-${{ matrix.os }}-${{ matrix.configuration }}-isBundled-${{ matrix.bundled }}-isSingleFile-${{ matrix.singlefile }}
path: Publish/${{ matrix.os }}
23 changes: 12 additions & 11 deletions UndertaleModLib/Models/UndertaleAnimationCurve.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public enum GraphTypeEnum : uint
/// <summary>
/// The channels this animation curve has.
/// </summary>
public UndertaleSimpleList<Channel> Channels { get; set; }
public UndertaleSimpleList<Channel> Channels { get; set; } = new UndertaleSimpleList<Channel>();

/// <inheritdoc />
public void Serialize(UndertaleWriter writer)
Expand Down Expand Up @@ -156,7 +156,7 @@ public enum CurveType : uint
/// <summary>
/// The points in the channel.
/// </summary>
public UndertaleSimpleList<Point> Points { get; set; }
public UndertaleSimpleList<Point> Points { get; set; } = new UndertaleSimpleList<Point>();

/// <inheritdoc />
public void Serialize(UndertaleWriter writer)
Expand Down Expand Up @@ -228,37 +228,38 @@ public void Dispose()
/// <summary>
/// A point which can exist on a <see cref="Channel"/>.
/// </summary>
[PropertyChanged.AddINotifyPropertyChangedInterface]
public class Point : UndertaleObject
{
/// <summary>
/// The X coordinate of this point. GameMaker abbreviates this to "h".
/// </summary>
public float X;
public float X { get; set; }

/// <summary>
/// The Y coordinate of this point. GameMaker abbreviates this to "v".
/// </summary>
public float Value;
public float Value { get; set; }

/// <summary>
/// The Y position for the first bezier handle. Only used if the Channel is set to Bezier.
/// </summary>
public float BezierX0;
public float BezierX0 { get; set; }

/// <summary>
/// The Y position for the first bezier handle. Only used if the Channel is set to Bezier.
/// </summary>
public float BezierY0;
public float BezierY0 { get; set; }

/// <summary>
/// The X position for the second bezier handle. Only used if the Channel is set to Bezier.
/// </summary>
public float BezierX1;
public float BezierX1 { get; set; }

/// <summary>
/// The Y position for the second bezier handle. Only used if the Channel is set to Bezier.
/// </summary>
public float BezierY1;
public float BezierY1 { get; set; }

/// <inheritdoc />
public void Serialize(UndertaleWriter writer)
Expand Down
4 changes: 2 additions & 2 deletions UndertaleModLib/Models/UndertaleBackground.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public void Unserialize(UndertaleReader reader)
/// <remarks>
/// Added in GameMaker Studio 2.
/// </remarks>
public List<TileID> GMS2TileIds { get; set; } = new List<TileID>();
public UndertaleObservableList<TileID> GMS2TileIds { get; set; } = new UndertaleObservableList<TileID>();

/// <remarks>
/// Added in GameMaker 2024.14.1.
Expand Down Expand Up @@ -222,7 +222,7 @@ public void Unserialize(UndertaleReader reader)
GMS2TileCount = reader.ReadUInt32();
GMS2ExportedSpriteIndex = reader.ReadInt32();
GMS2FrameLength = reader.ReadInt64();
GMS2TileIds = new List<TileID>((int)GMS2TileCount * (int)GMS2ItemsPerTileCount);
GMS2TileIds = new((int)GMS2TileCount * (int)GMS2ItemsPerTileCount);
for (int i = 0; i < GMS2TileCount * GMS2ItemsPerTileCount; i++)
{
TileID id = new TileID();
Expand Down
4 changes: 2 additions & 2 deletions UndertaleModLib/Models/UndertaleGameObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public class UndertaleGameObject : UndertaleNamedResource, INotifyPropertyChange
/// <summary>
/// The vertices used for a <see cref="CollisionShape"/> of type <see cref="CollisionShapeFlags.Custom"/>.
/// </summary>
public List<UndertalePhysicsVertex> PhysicsVertices { get; set; } = new List<UndertalePhysicsVertex>();
public UndertaleObservableList<UndertalePhysicsVertex> PhysicsVertices { get; set; } = new UndertaleObservableList<UndertalePhysicsVertex>();

#endregion

Expand Down Expand Up @@ -247,7 +247,7 @@ public void Unserialize(UndertaleReader reader)
Awake = reader.ReadBoolean();
Kinematic = reader.ReadBoolean();
// Needs to be done manually because count is separated
PhysicsVertices.Capacity = physicsShapeVertexCount;
PhysicsVertices.SetCapacity(physicsShapeVertexCount);
for (int i = 0; i < physicsShapeVertexCount; i++)
{
UndertalePhysicsVertex v = new UndertalePhysicsVertex();
Expand Down
2 changes: 1 addition & 1 deletion UndertaleModLib/Models/UndertaleGeneralInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace UndertaleModLib.Models;
/// General info about a data file.
/// </summary>
[PropertyChanged.AddINotifyPropertyChangedInterface]
public class UndertaleGeneralInfo : UndertaleObject, IDisposable
public partial class UndertaleGeneralInfo : UndertaleObject, IDisposable
{
/// <summary>
/// Information flags a data file can use.
Expand Down
45 changes: 45 additions & 0 deletions UndertaleModLib/Models/UndertaleRoom.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1079,6 +1079,26 @@ protected void OnPropertyChanged([CallerMemberName] string name = null)
/// </remarks>
public int YOffset => Y + SpriteYOffset;

public GameObject Clone()
{
return new()
{
X = this.X,
Y = this.Y,
ObjectDefinition = this.ObjectDefinition,
InstanceID = this.InstanceID,
CreationCode = this.CreationCode,
ScaleX = this.ScaleX,
ScaleY = this.ScaleY,
Color = this.Color,
Rotation = this.Rotation,
PreCreateCode = this.PreCreateCode,
ImageSpeed = this.ImageSpeed,
ImageIndex = this.ImageIndex,
Nonexistent = this.Nonexistent,
};
}

/// <inheritdoc />
public virtual void Serialize(UndertaleWriter writer)
{
Expand Down Expand Up @@ -2066,6 +2086,12 @@ public class LayerAssetsData : LayerData
public UndertalePointerList<ParticleSystemInstance> ParticleSystems { get; set; }
public UndertalePointerList<TextItemInstance> TextItems { get; set; }

/// <summary>
/// List of the lists of types of assets.
/// UMT only.
/// </summary>
public List<object> AllAssets { get; set; } = new List<object>();

/// <inheritdoc />
public void Serialize(UndertaleWriter writer)
{
Expand Down Expand Up @@ -2128,6 +2154,8 @@ public void Unserialize(UndertaleReader reader)
if (reader.undertaleData.IsVersionAtLeast(2024, 6))
reader.ReadUndertaleObject(TextItems);
}

InitializeAllAssets();
}

/// <inheritdoc cref="UndertaleObject.UnserializeChildObjectCount(UndertaleReader)"/>
Expand Down Expand Up @@ -2182,6 +2210,23 @@ public static uint UnserializeChildObjectCount(UndertaleReader reader)
return count;
}

public void InitializeAllAssets()
{
AllAssets.Clear();
if (LegacyTiles != null)
AllAssets.Add(LegacyTiles);
if (Sprites != null)
AllAssets.Add(Sprites);
if (Sequences != null)
AllAssets.Add(Sequences);
if (NineSlices != null)
AllAssets.Add(NineSlices);
if (ParticleSystems != null)
AllAssets.Add(ParticleSystems);
if (TextItems != null)
AllAssets.Add(TextItems);
}

/// <inheritdoc/>
public void Dispose()
{
Expand Down
2 changes: 1 addition & 1 deletion UndertaleModLib/Models/UndertaleVariable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace UndertaleModLib.Models;
/// <summary>
/// A variable entry in a GameMaker data file.
/// </summary>
// TODO: INotifyPropertyChanged
[PropertyChanged.AddINotifyPropertyChangedInterface]
public class UndertaleVariable : UndertaleNamedResource, ISearchable, UndertaleInstruction.IReferencedObject, IDisposable, IGMVariable
{
/// The name of the Variable.
Expand Down
7 changes: 5 additions & 2 deletions UndertaleModLib/UndertaleChunks.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using UndertaleModLib.Models;
using UndertaleModLib.Util;
Expand Down Expand Up @@ -1743,7 +1746,7 @@ public class UndertaleChunkVARI : UndertaleChunk
public uint VarCount2 { get; set; }
public uint MaxLocalVarCount { get; set; }
public bool DifferentVarCounts { get; set; }
public List<UndertaleVariable> List = new List<UndertaleVariable>();
public ObservableCollection<UndertaleVariable> List = new ObservableCollection<UndertaleVariable>();

[Obsolete]
public uint InstanceVarCount { get => VarCount1; set => VarCount1 = value; }
Expand Down Expand Up @@ -1793,7 +1796,7 @@ internal override void UnserializeChunk(UndertaleReader reader)
else
varLength = 12;
List.Clear();
List.Capacity = (int)(Length / varLength);
//List.Capacity = (int)(Length / varLength);
while (reader.Position + varLength <= startPosition + Length)
List.Add(reader.ReadUndertaleObject<UndertaleVariable>());
}
Expand Down
Loading