7 if ( (dst && dst.GetParent() && !dst.GetParent().GetHierarchyRootPlayer()) || (src && src.GetParent() && !src.GetParent().GetHierarchyRootPlayer()) )
26 if ( invloc1.GetItem() && invloc1.GetItem().GetInventoryHandAnimation(invloc1,val) )
34 switch (invloc1.GetSlot())
38 if (invloc1.GetItem() && invloc1.GetItem().IsWeapon())
40 return WeaponHideShowTypes.HIDESHOW_SLOT_RFLLEFTBACK;
42 else if (invloc1.GetItem() && invloc1.GetItem().IsOneHandedBehaviour())
44 return WeaponHideShowTypes.HIDESHOW_SLOT_1HDLEFTBACK;
46 return WeaponHideShowTypes.HIDESHOW_SLOT_2HDLEFTBACK;
50 if (invloc1.GetItem() && invloc1.GetItem().IsWeapon())
52 return WeaponHideShowTypes.HIDESHOW_SLOT_RFLRIGHTBACK;
54 else if (invloc1.GetItem() && invloc1.GetItem().IsOneHandedBehaviour())
56 return WeaponHideShowTypes.HIDESHOW_SLOT_1HDRIGHTBACK;
58 return WeaponHideShowTypes.HIDESHOW_SLOT_2HDRIGHTBACK;
62 EntityAI parent_item = invloc1.GetParent();
65 owner = parent_item.GetHierarchyRootPlayer();
70 EntityAI item2 = parent_item.GetHierarchyParent();
71 if (owner && item1 == item2)
73 return WeaponHideShowTypes.HIDESHOW_SLOT_PISTOLBELT;
75 return WeaponHideShowTypes.HIDESHOW_SLOT_PISTOLCHEST;
78 return WeaponHideShowTypes.HIDESHOW_SLOT_KNIFEBACK;
90 return WeaponHideShowTypes.HIDESHOW_SLOT_INVENTORY;
107 return WeaponHideShowTypes.HIDESHOW_SLOT_RFLRIGHTBACK;
109 else if (item.IsOneHandedBehaviour())
111 return WeaponHideShowTypes.HIDESHOW_SLOT_1HDRIGHTBACK;
113 return WeaponHideShowTypes.HIDESHOW_SLOT_2HDRIGHTBACK;
117 return WeaponHideShowTypes.HIDESHOW_SLOT_INVENTORY;
124 if (player.IsInTransport())
129 if (src.GetItem().GetHierarchyRootPlayer() == player)
134 if (
LogManager.IsInventoryHFSMLogEnable())
hndDebugPrint(
"[hndfsm] SelectAnimationOfTakeToHands - selected animType=" + animType +
" for item=" + src.GetItem());
138 if (
LogManager.IsInventoryHFSMLogEnable())
hndDebugPrint(
"[hndfsm] SelectAnimationOfTakeToHands - no animation");
144 if (player.IsInTransport())
147 if (src.GetItem().GetHierarchyRootPlayer() == player)
152 if (
LogManager.IsInventoryHFSMLogEnable())
hndDebugPrint(
"[hndfsm] SelectAnimationOfMoveFromHands guard - selected animType=" + animType +
" for item=" + src.GetItem());
156 if (
LogManager.IsInventoryHFSMLogEnable())
hndDebugPrint(
"[hndfsm] SelectAnimationOfMoveFromHands - no animation");
162 if (player.IsInTransport())
167 if (old_src.GetItem().GetHierarchyRootPlayer() == player || new_src.GetItem().GetHierarchyRootPlayer() == player)
173 if (animType1 != -1 && animType2 != -1)
175 if (
LogManager.IsInventoryHFSMLogEnable())
hndDebugPrint(
"[hndfsm] SelectAnimationOfForceSwapInHands guard - selected animType1=" + animType1 +
" animType2=" + animType2 +
" for old_item=" + old_src.GetItem() +
" for new_item=" + new_src.GetItem());
185 if (
LogManager.IsInventoryHFSMLogEnable())
hndDebugPrint(
"[hndfsm] SelectAnimationOfForceSwapInHands - no animation");
190class HandSelectAnimationOfTakeToHandsEvent
extends HandGuardBase
192 void HandSelectAnimationOfTakeToHandsEvent(Man p = null) { }
199 e.m_AnimationID = animType;
206class HandSelectAnimationOfMoveFromHandsEvent
extends HandGuardBase
221 if (eai.GetInventory().GetCurrentInventoryLocation(src))
223 if (e.m_IsJuncture ==
false && e.m_IsRemote ==
false)
229 hndDebugPrint(
"[hndfsm] HandSelectAnimationOfMoveFromHandsEvent - rejected");
239 e.m_AnimationID = animType;
260 Error(
"HandSelectAnimationOfForceSwapInHandsEvent - not an swap event");
266 HandEventForceSwap es = HandEventForceSwap.Cast(e);
271 hndDebugPrint(
"[hndfsm] HandSelectAnimationOfForceSwapInHandsEvent FSwap e=" + e.DumpToString());
274 if (!es.m_Src2.IsValid() || !es.m_Src.IsValid())
276 Error(
"[hndfsm] HandSelectAnimationOfForceSwapInHandsEvent - invalid item source");
280 bool allow = e.m_IsJuncture || e.m_IsRemote;
291 Error(
"[hndfsm] HandSelectAnimationOfForceSwapInHandsEvent - no room at dst=" +
InventoryLocation.DumpToStringNullSafe(es.m_Dst2));
306 e.m_AnimationID = animType1;
307 es.m_Animation2ID = animType2;
313 Error(
"[hndfsm] HandSelectAnimationOfForceSwapInHandsEvent - m_HasRoomGuard.GuardCondition failed");
318 Error(
"[hndfsm] HandSelectAnimationOfForceSwapInHandsEvent - not a swap event");
333 if (ProcessSwapEvent(e, animType1, animType2))
335 e.m_AnimationID = animType1;
336 es.m_Animation2ID = animType2;
341 Error(
"[hndfsm] HandSelectAnimationOfSwapInHandsEvent - not a swap event");
script counterpart to engine's class Inventory
proto native bool HasInventorySlot(int slotId)
static bool CanSwapEntitiesEx(notnull EntityAI item1, notnull EntityAI item2)
static proto native bool LocationCanMoveEntity(notnull InventoryLocation src, notnull InventoryLocation dst)
queries if the entity contained in inv_loc.m_item can be moved to another location This is a shorthan...
static bool CanForceSwapEntitiesEx(notnull EntityAI item1, InventoryLocation item1_dst, notnull EntityAI item2, out InventoryLocation item2_dst)
Abstracted event, not to be used, only inherited.
TODO(kumarjac): This guard is unused but it has a fault and doesn't conform with maximimal/minimal ch...
void HandSelectAnimationOfForceSwapInHandsEvent(Man p=NULL)
void HandSelectAnimationOfMoveFromHandsEvent(Man p=null)
bool ProcessSwapEvent(notnull HandEventBase e, out int animType1, out int animType2)
override bool GuardCondition(HandEventBase e)
provides access to slot configuration
void Error(string err)
Messagebox with error message.
override bool GuardCondition(WeaponEventBase e)
void HandEventBase(Man p=null, InventoryLocation src=null)
bool SelectAnimationOfMoveFromHands(notnull Man player, notnull InventoryLocation src, notnull InventoryLocation dst, out int animType)
int SlotToAnimType(notnull Man player, notnull InventoryLocation src, InventoryLocation dst=null)
bool SelectAnimationOfTakeToHands(notnull Man player, notnull InventoryLocation src, notnull InventoryLocation dst, out int animType)
bool SelectAnimationOfForceSwapInHands(notnull Man player, notnull InventoryLocation old_src, notnull InventoryLocation new_src, notnull InventoryLocation old_dst, notnull InventoryLocation new_dst, out int animType1, out int animType2)
void hndDebugPrint(string s)
InventoryLocationType
types of Inventory Location