actionviewcompass.c 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. class ActionRaiseAndViewCB : ActionContinuousBaseCB
  2. {
  3. override void CreateActionComponent()
  4. {
  5. m_ActionData.m_ActionComponent = new CAContinuousTime( -1.0 );
  6. //EnableStateChangeCallback();
  7. }
  8. override void OnStateChange(int pOldState, int pCurrentState)
  9. {
  10. //Print("pOldState = " + pOldState);
  11. //Print("pCurrentState = " + pCurrentState);
  12. if (pOldState != STATE_LOOP_LOOP)
  13. return;
  14. if (m_ActionData.m_Action && ActionViewOptics.Cast(m_ActionData.m_Action))
  15. {
  16. //ActionViewOptics.Cast(m_ActionData.m_Action).ExitOptics( ItemOptics.Cast(m_ActionData.m_MainItem), m_ActionData.m_Player );
  17. }
  18. }
  19. };
  20. class ActionViewCompass : ActionContinuousBase
  21. {
  22. void ActionViewCompass()
  23. {
  24. m_CallbackClass = ActionRaiseAndViewCB;
  25. m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_OPENITEM_ONCE;
  26. m_CommandUIDProne = DayZPlayerConstants.CMD_ACTIONFB_OPENITEM_ONCE;
  27. m_Text = "#use_compas";
  28. }
  29. override void CreateConditionComponents()
  30. {
  31. m_ConditionItem = new CCINonRuined;
  32. m_ConditionTarget = new CCTNone;
  33. }
  34. override bool HasProgress()
  35. {
  36. return false;
  37. }
  38. override bool HasTarget()
  39. {
  40. return false;
  41. }
  42. override bool HasProneException()
  43. {
  44. return true;
  45. }
  46. override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
  47. {
  48. return item.IsOpen();
  49. }
  50. /*override void OnCompleteServer( ActionData action_data )
  51. {
  52. if (action_data.m_Player)
  53. {
  54. string message = Rangefinder.Cast( action_data.m_MainItem ).DoMeasurement(action_data.m_Player);
  55. SendMessageToClient(action_data.m_Player,message);
  56. }
  57. action_data.m_Player.GetSoftSkillManager().AddSpecialty( m_SpecialtyWeight );
  58. }*/
  59. }