add consts for triggers

This commit is contained in:
Mister_Nebula 2022-09-11 16:31:21 +01:00
parent c9a0d8a4de
commit 9d663894ac
5 changed files with 26 additions and 13 deletions

View File

@ -26,6 +26,15 @@ public class AnimationSync : PlayerSyncObject
public Animator InvisibleAnimator { get; private set; } public Animator InvisibleAnimator { get; private set; }
public NetworkAnimator NetworkAnimator { get; private set; } public NetworkAnimator NetworkAnimator { get; private set; }
public const string HOLD_LANTERN_TRIGGER = "HoldLantern";
public const string HOLD_SHARED_STONE_TRIGGER = "HoldSharedStone";
public const string HOLD_SCROLL_TRIGGER = "HoldScroll";
public const string HOLD_WARP_CORE_TRIGGER = "HoldWarpCore";
public const string HOLD_VESSEL_CORE_TRIGGER = "HoldAdvWarpCore";
public const string HOLD_CONVERSATION_STONE_TRIGGER = "HoldItem";
public const string DROP_HELD_ITEM = "DropHeldItem";
public const string TAUNT_THUMBS_UP = "ThumbsUp";
protected void Awake() protected void Awake()
{ {
InvisibleAnimator = gameObject.GetRequiredComponent<Animator>(); InvisibleAnimator = gameObject.GetRequiredComponent<Animator>();

View File

@ -1,4 +1,5 @@
using QSB.CampfireSync.WorldObjects; using QSB.Animation.Player;
using QSB.CampfireSync.WorldObjects;
using QSB.ItemSync.WorldObjects.Items; using QSB.ItemSync.WorldObjects.Items;
using QSB.Messaging; using QSB.Messaging;
using QSB.Player; using QSB.Player;
@ -23,7 +24,7 @@ internal class BurnSlideReelMessage : QSBWorldObjectMessage<QSBSlideReelItem, in
campfire._burnedSlideReelSocket, campfire._burnedSlideReelSocket,
campfire._sector, null); campfire._sector, null);
fromPlayer.HeldItem = null; fromPlayer.HeldItem = null;
fromPlayer.AnimationSync.VisibleAnimator.SetTrigger("DropHeldItem"); fromPlayer.AnimationSync.VisibleAnimator.SetTrigger(AnimationSync.DROP_HELD_ITEM);
WorldObject.AttachedObject.Burn(); WorldObject.AttachedObject.Burn();
campfire.SetDropSlideReelMode(false); campfire.SetDropSlideReelMode(false);
campfire._hasBurnedSlideReel = true; campfire._hasBurnedSlideReel = true;

View File

@ -1,4 +1,5 @@
using QSB.ItemSync.WorldObjects; using QSB.Animation.Player;
using QSB.ItemSync.WorldObjects;
using QSB.ItemSync.WorldObjects.Items; using QSB.ItemSync.WorldObjects.Items;
using QSB.Messaging; using QSB.Messaging;
using QSB.Player; using QSB.Player;
@ -69,6 +70,6 @@ internal class DropItemMessage : QSBWorldObjectMessage<IQSBItem,
var player = QSBPlayerManager.GetPlayer(From); var player = QSBPlayerManager.GetPlayer(From);
player.HeldItem = null; player.HeldItem = null;
player.AnimationSync.VisibleAnimator.SetTrigger("DropHeldItem"); player.AnimationSync.VisibleAnimator.SetTrigger(AnimationSync.DROP_HELD_ITEM);
} }
} }

View File

@ -1,4 +1,5 @@
using QSB.ItemSync.WorldObjects.Items; using QSB.Animation.Player;
using QSB.ItemSync.WorldObjects.Items;
using QSB.Messaging; using QSB.Messaging;
using QSB.Player; using QSB.Player;
using QSB.Utility; using QSB.Utility;
@ -39,27 +40,27 @@ internal class MoveToCarryMessage : QSBWorldObjectMessage<IQSBItem, uint>
switch (itemType) switch (itemType)
{ {
case ItemType.Scroll: case ItemType.Scroll:
player.AnimationSync.VisibleAnimator.SetTrigger("HoldScroll"); player.AnimationSync.VisibleAnimator.SetTrigger(AnimationSync.HOLD_SCROLL_TRIGGER);
break; break;
case ItemType.WarpCore: case ItemType.WarpCore:
if (((QSBWarpCoreItem)WorldObject).IsVesselCoreType()) if (((QSBWarpCoreItem)WorldObject).IsVesselCoreType())
{ {
player.AnimationSync.VisibleAnimator.SetTrigger("HoldAdvWarpCore"); player.AnimationSync.VisibleAnimator.SetTrigger(AnimationSync.HOLD_VESSEL_CORE_TRIGGER);
} }
else else
{ {
player.AnimationSync.VisibleAnimator.SetTrigger("HoldWarpCore"); player.AnimationSync.VisibleAnimator.SetTrigger(AnimationSync.HOLD_WARP_CORE_TRIGGER);
} }
break; break;
case ItemType.SharedStone: case ItemType.SharedStone:
player.AnimationSync.VisibleAnimator.SetTrigger("HoldSharedStone"); player.AnimationSync.VisibleAnimator.SetTrigger(AnimationSync.HOLD_SHARED_STONE_TRIGGER);
break; break;
case ItemType.ConversationStone: case ItemType.ConversationStone:
player.AnimationSync.VisibleAnimator.SetTrigger("HoldItem"); player.AnimationSync.VisibleAnimator.SetTrigger(AnimationSync.HOLD_CONVERSATION_STONE_TRIGGER);
break; break;
case ItemType.Lantern: case ItemType.Lantern:
player.AnimationSync.VisibleAnimator.SetTrigger("HoldLantern"); player.AnimationSync.VisibleAnimator.SetTrigger(AnimationSync.HOLD_LANTERN_TRIGGER);
break; break;
case ItemType.SlideReel: case ItemType.SlideReel:
case ItemType.DreamLantern: case ItemType.DreamLantern:

View File

@ -1,4 +1,5 @@
using QSB.ItemSync.WorldObjects.Items; using QSB.Animation.Player;
using QSB.ItemSync.WorldObjects.Items;
using QSB.ItemSync.WorldObjects.Sockets; using QSB.ItemSync.WorldObjects.Sockets;
using QSB.Messaging; using QSB.Messaging;
using QSB.Player; using QSB.Player;
@ -33,7 +34,7 @@ internal class SocketItemMessage : QSBMessage<(SocketMessageType Type, int Socke
var player = QSBPlayerManager.GetPlayer(From); var player = QSBPlayerManager.GetPlayer(From);
player.HeldItem = null; player.HeldItem = null;
player.AnimationSync.VisibleAnimator.SetTrigger("DropHeldItem"); player.AnimationSync.VisibleAnimator.SetTrigger(AnimationSync.DROP_HELD_ITEM);
return; return;
} }
case SocketMessageType.StartUnsocket: case SocketMessageType.StartUnsocket: