This commit is contained in:
Anna 2022-09-04 17:02:13 -04:00
parent c8d6af01d8
commit cab5c3d80e
6 changed files with 15 additions and 2 deletions

View File

@ -11,6 +11,7 @@ internal class Message {
public float X { get; init; }
public float Y { get; init; }
public float Z { get; init; }
public float Yaw { get; init; }
[JsonProperty("message")]
public string Text { get; init; }
@ -30,6 +31,7 @@ internal class MessageWithTerritory {
public float X { get; init; }
public float Y { get; init; }
public float Z { get; init; }
public float Yaw { get; init; }
[JsonProperty("message")]
public string Text { get; init; }

View File

@ -10,6 +10,7 @@ public class MessageRequest {
public float X { get; set; }
public float Y { get; set; }
public float Z { get; set; }
public float Yaw { get; set; }
public Guid PackId { get; set; }
[JsonProperty("template_1")]

View File

@ -43,7 +43,8 @@ internal class Messages : IDisposable {
}
PluginLog.Log($"spawning vfx for {message.Id}");
if (this.Plugin.Vfx.SpawnStatic(message.Id, VfxPath, message.Position) == null) {
var rotation = Quaternion.CreateFromYawPitchRoll(message.Yaw, 0, 0);
if (this.Plugin.Vfx.SpawnStatic(message.Id, VfxPath, message.Position, rotation) == null) {
PluginLog.Log("trying again");
this.SpawnQueue.Enqueue(message);
}

View File

@ -147,6 +147,7 @@ internal class Write : ITab {
X = player.Position.X,
Y = player.Position.Y,
Z = player.Position.Z,
Yaw = player.Rotation,
PackId = pack.Id,
Template1 = this._part1,
Word1List = this._word1.Item1 == -1 ? null : this._word1.Item1,

View File

@ -35,7 +35,7 @@ internal unsafe class Vfx : IDisposable {
this.Spawned.Clear();
}
internal VfxStruct* SpawnStatic(Guid id, string path, Vector3 pos) {
internal VfxStruct* SpawnStatic(Guid id, string path, Vector3 pos, Quaternion rotation) {
VfxStruct* vfx;
fixed (byte* p = Encoding.UTF8.GetBytes(path)) {
fixed (byte* pool = Pool) {
@ -54,6 +54,8 @@ internal unsafe class Vfx : IDisposable {
// update position
vfx->Position = new Vector3(pos.X, pos.Y, pos.Z);
// update rotation
vfx->Rotation = new Quaternion(rotation.X, rotation.Y, rotation.Z, rotation.W);
// update
vfx->Flags |= 2;
@ -81,6 +83,9 @@ internal unsafe class Vfx : IDisposable {
[FieldOffset(0x50)]
public Vector3 Position;
[FieldOffset(0x60)]
public Quaternion Rotation;
[FieldOffset(0x70)]
public Vector3 Scale;

View File

@ -174,6 +174,9 @@ words:
- moogle
- goblin
- dragon
- namazu
- goat
- mameshiba
- name: Situations
words: