diff --git a/.github/workflows/publish_gui_avalonia.yml b/.github/workflows/publish_gui_avalonia.yml
new file mode 100644
index 000000000..aa606e291
--- /dev/null
+++ b/.github/workflows/publish_gui_avalonia.yml
@@ -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 }}
diff --git a/UndertaleModLib/Models/UndertaleAnimationCurve.cs b/UndertaleModLib/Models/UndertaleAnimationCurve.cs
index 60d2c6614..ed95f7cee 100644
--- a/UndertaleModLib/Models/UndertaleAnimationCurve.cs
+++ b/UndertaleModLib/Models/UndertaleAnimationCurve.cs
@@ -36,7 +36,7 @@ public enum GraphTypeEnum : uint
///
/// The channels this animation curve has.
///
- public UndertaleSimpleList Channels { get; set; }
+ public UndertaleSimpleList Channels { get; set; } = new UndertaleSimpleList();
///
public void Serialize(UndertaleWriter writer)
@@ -156,7 +156,7 @@ public enum CurveType : uint
///
/// The points in the channel.
///
- public UndertaleSimpleList Points { get; set; }
+ public UndertaleSimpleList Points { get; set; } = new UndertaleSimpleList();
///
public void Serialize(UndertaleWriter writer)
@@ -228,37 +228,38 @@ public void Dispose()
///
/// A point which can exist on a .
///
+ [PropertyChanged.AddINotifyPropertyChangedInterface]
public class Point : UndertaleObject
{
///
/// The X coordinate of this point. GameMaker abbreviates this to "h".
///
- public float X;
+ public float X { get; set; }
///
/// The Y coordinate of this point. GameMaker abbreviates this to "v".
///
- public float Value;
+ public float Value { get; set; }
///
/// The Y position for the first bezier handle. Only used if the Channel is set to Bezier.
///
- public float BezierX0;
-
+ public float BezierX0 { get; set; }
+
///
/// The Y position for the first bezier handle. Only used if the Channel is set to Bezier.
///
- public float BezierY0;
-
+ public float BezierY0 { get; set; }
+
///
/// The X position for the second bezier handle. Only used if the Channel is set to Bezier.
///
- public float BezierX1;
-
+ public float BezierX1 { get; set; }
+
///
/// The Y position for the second bezier handle. Only used if the Channel is set to Bezier.
///
- public float BezierY1;
+ public float BezierY1 { get; set; }
///
public void Serialize(UndertaleWriter writer)
diff --git a/UndertaleModLib/Models/UndertaleBackground.cs b/UndertaleModLib/Models/UndertaleBackground.cs
index feddc7700..92d8f1def 100644
--- a/UndertaleModLib/Models/UndertaleBackground.cs
+++ b/UndertaleModLib/Models/UndertaleBackground.cs
@@ -153,7 +153,7 @@ public void Unserialize(UndertaleReader reader)
///
/// Added in GameMaker Studio 2.
///
- public List GMS2TileIds { get; set; } = new List();
+ public UndertaleObservableList GMS2TileIds { get; set; } = new UndertaleObservableList();
///
/// Added in GameMaker 2024.14.1.
@@ -222,7 +222,7 @@ public void Unserialize(UndertaleReader reader)
GMS2TileCount = reader.ReadUInt32();
GMS2ExportedSpriteIndex = reader.ReadInt32();
GMS2FrameLength = reader.ReadInt64();
- GMS2TileIds = new List((int)GMS2TileCount * (int)GMS2ItemsPerTileCount);
+ GMS2TileIds = new((int)GMS2TileCount * (int)GMS2ItemsPerTileCount);
for (int i = 0; i < GMS2TileCount * GMS2ItemsPerTileCount; i++)
{
TileID id = new TileID();
diff --git a/UndertaleModLib/Models/UndertaleGameObject.cs b/UndertaleModLib/Models/UndertaleGameObject.cs
index d3d8fc54c..a997f3be9 100644
--- a/UndertaleModLib/Models/UndertaleGameObject.cs
+++ b/UndertaleModLib/Models/UndertaleGameObject.cs
@@ -139,7 +139,7 @@ public class UndertaleGameObject : UndertaleNamedResource, INotifyPropertyChange
///
/// The vertices used for a of type .
///
- public List PhysicsVertices { get; set; } = new List();
+ public UndertaleObservableList PhysicsVertices { get; set; } = new UndertaleObservableList();
#endregion
@@ -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();
diff --git a/UndertaleModLib/Models/UndertaleGeneralInfo.cs b/UndertaleModLib/Models/UndertaleGeneralInfo.cs
index 27072bca8..1ff81cba6 100644
--- a/UndertaleModLib/Models/UndertaleGeneralInfo.cs
+++ b/UndertaleModLib/Models/UndertaleGeneralInfo.cs
@@ -11,7 +11,7 @@ namespace UndertaleModLib.Models;
/// General info about a data file.
///
[PropertyChanged.AddINotifyPropertyChangedInterface]
-public class UndertaleGeneralInfo : UndertaleObject, IDisposable
+public partial class UndertaleGeneralInfo : UndertaleObject, IDisposable
{
///
/// Information flags a data file can use.
diff --git a/UndertaleModLib/Models/UndertaleRoom.cs b/UndertaleModLib/Models/UndertaleRoom.cs
index cc123535f..268f7994d 100644
--- a/UndertaleModLib/Models/UndertaleRoom.cs
+++ b/UndertaleModLib/Models/UndertaleRoom.cs
@@ -1079,6 +1079,26 @@ protected void OnPropertyChanged([CallerMemberName] string name = null)
///
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,
+ };
+ }
+
///
public virtual void Serialize(UndertaleWriter writer)
{
@@ -2066,6 +2086,12 @@ public class LayerAssetsData : LayerData
public UndertalePointerList ParticleSystems { get; set; }
public UndertalePointerList TextItems { get; set; }
+ ///
+ /// List of the lists of types of assets.
+ /// UMT only.
+ ///
+ public List