DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ UpdatePossibleActions()

override void ToggleLightsActionInput::UpdatePossibleActions ( PlayerBase player,
ActionTarget target,
ItemBase item,
int action_condition_mask )
inlineprivate

См. определение в файле ActionInput.c строка 758

759 {
760 if( ForceActionCheck(player) )
761 {
762 m_SelectAction = m_ForcedActionData.m_Action;
763 return;
764 }
765 //ForceActionTarget(player.m_PlayerLightManager.
766
767 m_SelectAction = NULL;
768 array<ActionBase_Basic> possible_actions;
769 ActionBase action;
770 int i;
771
772 m_MainItem = NULL;
773 if ( player && !player.IsInVehicle() )
774 {
775 Clothing headgear = Clothing.Cast(player.FindAttachmentBySlotName("Headgear"));
776 Clothing eyewear = Clothing.Cast(player.FindAttachmentBySlotName("Eyewear"));
777 //TODO - extend this to allow for a switchable control over all possible light sources (depth 0 or 1 only?)
778
779 if ( headgear && headgear.GetLightSourceItem() )
780 {
781 target_new = new ActionTarget(headgear, null, -1, vector.Zero, -1);
782 ForceActionTarget(target_new);
783 }
784 else if ( eyewear && eyewear.GetLightSourceItem() )
785 {
786 target_new = new ActionTarget(eyewear, null, -1, vector.Zero, -1);
787 ForceActionTarget(target_new);
788 }
789 else
790 ClearForcedTarget();
791 }
792 else if ( player && player.IsInVehicle() )
793 {
794 HumanCommandVehicle vehCommand = player.GetCommand_Vehicle();
795 if( vehCommand )
796 {
797 Transport trans = vehCommand.GetTransport();
798 if( trans )
799 {
800 target_new = new ActionTarget(trans, null, -1, vector.Zero, -1);
801 ForceActionTarget(target_new);
802 }
803 }
804
805 if ( !target_new )
806 ClearForcedTarget();
807 }
808
809 target = m_ForcedTarget;
810 m_Target = m_ForcedTarget;
811
812 if(target && target.GetObject())
813 {
814 target.GetObject().GetActions(this.Type(), possible_actions);
815 if(possible_actions)
816 {
817 for (i = 0; i < possible_actions.Count(); i++)
818 {
819 action = ActionBase.Cast(possible_actions.Get(i));
820 if ( action.Can(player, target, m_MainItem, action_condition_mask) )
821 {
822 m_SelectAction = action;
823 return;
824 }
825 }
826 }
827 }
828 }
NoIndicationActionInputBase m_SelectAction
ref ActionTarget m_Target
Определения ActionInput.c:15
class ActionTargets ActionTarget
class BaitData m_MainItem
Определения ActionBase.c:36
string Type
Определения JsonDataContaminatedArea.c:11
bool Can(PlayerBase player, ActionTarget target, ItemBase item, int condition_mask)
Определения ActionBase.c:861
override ItemBase GetLightSourceItem()
Определения Headtorch_ColorBase.c:240
proto native Transport GetTransport()
ref ActionTarget target_new
Определения ActionInput.c:749

Перекрестные ссылки ActionTarget, ActionBase::Can(), Clothing::GetLightSourceItem(), HumanCommandVehicle::GetTransport(), m_MainItem, m_SelectAction, m_Target, target_new, Type и vector::Zero.