actioninteractbase.c 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. class ActionInteractBaseCB : ActionBaseCB
  2. {
  3. override void CreateActionComponent()
  4. {
  5. m_ActionData.m_ActionComponent = new CAInteract;
  6. }
  7. override void InitActionComponent()
  8. {
  9. #ifdef ENABLE_LOGGING
  10. if ( LogManager.IsActionLogEnable() )
  11. {
  12. Debug.ActionLog("n/a", m_ActionData.m_Action.ToString() , "n/a", "InitActionComponent", m_ActionData.m_Player.ToString() );
  13. }
  14. #endif
  15. m_Interrupted = false;
  16. m_Canceled = false;
  17. CreateActionComponent();
  18. if ( m_ActionData.m_ActionComponent )
  19. {
  20. m_ActionData.m_ActionComponent.Init(m_ActionData);
  21. }
  22. m_ActionData.m_State = UA_PROCESSING;
  23. RegisterAnimationEvent("ActionExec", UA_ANIM_EVENT);
  24. m_SoundObject = m_ActionData.m_Action.PlayActionSound(m_ActionData.m_Player);
  25. }
  26. override void EndActionComponent()
  27. {
  28. SetCommand(DayZPlayerConstants.CMD_ACTIONINT_END);
  29. m_ActionData.m_State = UA_FINISHED;
  30. }
  31. };
  32. class ActionInteractBase : AnimatedActionBase
  33. {
  34. //deprecated
  35. string m_HUDCursorIcon;
  36. void ActionInteractBase()
  37. {
  38. m_CallbackClass = ActionInteractBaseCB;
  39. m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_PICKUP_HANDS;
  40. }
  41. override void CreateConditionComponents()
  42. {
  43. m_ConditionItem = new CCINone;
  44. m_ConditionTarget = new CCTObject(UAMaxDistances.DEFAULT);
  45. }
  46. //deprecated
  47. string GetHUDCursorIcon()
  48. {
  49. return "";
  50. }
  51. override typename GetInputType()
  52. {
  53. return InteractActionInput;
  54. }
  55. override int GetActionCategory()
  56. {
  57. return AC_INTERACT;
  58. }
  59. override bool UseMainItem()
  60. {
  61. return false;
  62. }
  63. override bool MainItemAlwaysInHands()
  64. {
  65. return false;
  66. }
  67. };