Skip to content

Commit 0d54b0d

Browse files
authored
feat: (Day) Allows animations to be instanced to their player n event… (AscensionGameDev#2079)
* feat: (Day) Allows animations to be instanced to their player n event run * fix: (Day) Add command printer update * fix: (Day) Allow animation to instance on entity as well * fix: (Day) Broken import
1 parent 8d86c39 commit 0d54b0d

File tree

7 files changed

+426
-291
lines changed

7 files changed

+426
-291
lines changed

Intersect (Core)/GameObjects/Events/Commands/EventCommands.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,8 @@ public partial class PlayAnimationCommand : EventCommand
620620
public sbyte X { get; set; }
621621

622622
public sbyte Y { get; set; }
623+
624+
public bool InstanceToPlayer { get; set; }
623625
}
624626

625627
public partial class HoldPlayerCommand : EventCommand

Intersect.Editor/Forms/Editors/Events/CommandPrinter.cs

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.Text;
34
using System.Windows.Forms;
45

56
using Intersect.Editor.Localization;
@@ -1072,28 +1073,29 @@ private static string GetCommandText(DespawnNpcCommand command, MapInstance map)
10721073

10731074
private static string GetCommandText(PlayAnimationCommand command, MapInstance map)
10741075
{
1076+
StringBuilder commandTextBuilder = new StringBuilder();
10751077
if (command.MapId != Guid.Empty)
10761078
{
10771079
for (var i = 0; i < MapList.OrderedMaps.Count; i++)
10781080
{
10791081
if (MapList.OrderedMaps[i].MapId == command.MapId)
10801082
{
1081-
return Strings.EventCommandList.playanimation.ToString(
1083+
commandTextBuilder.Append(Strings.EventCommandList.playanimation.ToString(
10821084
AnimationBase.GetName(command.AnimationId),
10831085
Strings.EventCommandList.animationonmap.ToString(
10841086
MapList.OrderedMaps[i].Name, command.X, command.Y,
10851087
Strings.Direction.dir[(Direction) command.Dir]
10861088
)
1087-
);
1089+
));
10881090
}
10891091
}
10901092

1091-
return Strings.EventCommandList.playanimation.ToString(
1093+
commandTextBuilder.Append(Strings.EventCommandList.playanimation.ToString(
10921094
AnimationBase.GetName(command.AnimationId),
10931095
Strings.EventCommandList.animationonmap.ToString(
10941096
Strings.EventCommandList.mapnotfound, command.X, command.Y, Strings.Direction.dir[(Direction)command.Dir]
10951097
)
1096-
);
1098+
));
10971099
}
10981100
else
10991101
{
@@ -1117,33 +1119,36 @@ private static string GetCommandText(PlayAnimationCommand command, MapInstance m
11171119

11181120
if (command.EntityId == Guid.Empty)
11191121
{
1120-
return Strings.EventCommandList.playanimation.ToString(
1122+
commandTextBuilder.Append(Strings.EventCommandList.playanimation.ToString(
11211123
AnimationBase.GetName(command.AnimationId),
11221124
Strings.EventCommandList.animationonplayer.ToString(command.X, command.Y, spawnOpt)
1123-
);
1125+
));
11241126
}
11251127
else
11261128
{
11271129
if (map.LocalEvents.ContainsKey(command.EntityId))
11281130
{
1129-
return Strings.EventCommandList.playanimation.ToString(
1131+
commandTextBuilder.Append(Strings.EventCommandList.playanimation.ToString(
11301132
AnimationBase.GetName(command.AnimationId),
11311133
Strings.EventCommandList.animationonevent.ToString(
11321134
map.LocalEvents[command.EntityId].Name, command.X, command.Y, spawnOpt
11331135
)
1134-
);
1136+
));
11351137
}
11361138
else
11371139
{
1138-
return Strings.EventCommandList.playanimation.ToString(
1140+
commandTextBuilder.Append(Strings.EventCommandList.playanimation.ToString(
11391141
AnimationBase.GetName(command.AnimationId),
11401142
Strings.EventCommandList.animationonevent.ToString(
11411143
Strings.EventCommandList.deletedevent, command.X, command.Y, spawnOpt
11421144
)
1143-
);
1145+
));
11441146
}
11451147
}
11461148
}
1149+
1150+
commandTextBuilder.Append(Strings.EventCommandList.PlayAnimationInstanced.ToString(command.InstanceToPlayer));
1151+
return commandTextBuilder.ToString();
11471152
}
11481153

11491154
private static string GetCommandText(PlayBgmCommand command, MapInstance map)

0 commit comments

Comments
 (0)