From 0d318154e6d6c2173171af891577e4dd6baadbb5 Mon Sep 17 00:00:00 2001 From: CharlesDev Date: Thu, 11 Apr 2024 19:10:57 -0400 Subject: [PATCH] fixed actors not being able to be copied between areas --- Fushigi/Program.cs | 2 +- Fushigi/course/CourseActor.cs | 4 ++-- Fushigi/ui/widgets/LevelViewport.cs | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Fushigi/Program.cs b/Fushigi/Program.cs index 5ccbf09..ceefdfa 100644 --- a/Fushigi/Program.cs +++ b/Fushigi/Program.cs @@ -8,7 +8,7 @@ internal class Program { - public const string Version = "v1.1.5.2"; + public const string Version = "v1.1.5.3"; private static void Main(string[] args) { diff --git a/Fushigi/course/CourseActor.cs b/Fushigi/course/CourseActor.cs index a100d81..bf0a7e0 100644 --- a/Fushigi/course/CourseActor.cs +++ b/Fushigi/course/CourseActor.cs @@ -278,7 +278,7 @@ public static CourseActorType GetActorTypeFromGyaml(string gyaml) return CourseActorType.None; } - public CourseActor Clone() + public CourseActor Clone(CourseArea areaTo) { CourseActor cloned = new(mPackName, mAreaHash, mLayer) { @@ -293,7 +293,7 @@ public CourseActor Clone() mRotation = mRotation }; cloned.mStartingTrans = mStartingTrans; - cloned.mAreaHash = mAreaHash; + cloned.mAreaHash = areaTo.mRootHash; cloned.mHash = (ulong)(new Random().NextDouble() * ulong.MaxValue); cloned.mActorParameters = mActorParameters.Clone(); cloned.mSystemParameters = mSystemParameters.Clone(); diff --git a/Fushigi/ui/widgets/LevelViewport.cs b/Fushigi/ui/widgets/LevelViewport.cs index b91e24c..6698648 100644 --- a/Fushigi/ui/widgets/LevelViewport.cs +++ b/Fushigi/ui/widgets/LevelViewport.cs @@ -720,7 +720,7 @@ public void Draw(Vector2 size, double deltaSeconds, IDictionary la { CopiedObjects = new CourseActor[selectedActors.Length]; for (int i = 0; i < CopiedObjects.Length; i++) - CopiedObjects[i] = selectedActors[i].Clone(); + CopiedObjects[i] = selectedActors[i].Clone(mArea); } bool ctrlOrCtrlShift = (modifiers == KeyboardModifier.CtrlCmd || modifiers == (KeyboardModifier.CtrlCmd | KeyboardModifier.Shift)); bool ctrlAndShift = modifiers == (KeyboardModifier.CtrlCmd | KeyboardModifier.Shift); @@ -747,7 +747,7 @@ private void DoImmediatePaste(bool freshCopy) if (freshCopy) newActor = new CourseActor(actor.mPackName, actor.mAreaHash, actor.mLayer); else - newActor = actor.Clone(); + newActor = actor.Clone(mArea); newActor.mStartingTrans = actor.mStartingTrans; mEditContext.AddActor(newActor); @@ -782,7 +782,7 @@ private async Task DoPaste(bool freshCopy) if (freshCopy) newActor = new CourseActor(actor.mPackName, actor.mAreaHash, actor.mLayer); else - newActor = actor.Clone(); + newActor = actor.Clone(mArea); newActor.mTranslation = pos;