Beispiel #1
0
    private void UpdateWoundSlots(HUDItemSlot.SlotData data)
    {
        bool flag = Inventory3DManager.Get().isActiveAndEnabled&& BodyInspectionController.Get().IsActive() && (!Inventory3DManager.Get().m_CarriedItem || data.slot.CanInsertItem(Inventory3DManager.Get().m_CarriedItem));

        data.obj.gameObject.SetActive(flag);
        if (!flag)
        {
            return;
        }
        Vector3 screenPoint = data.slot.GetScreenPoint();

        if (screenPoint.z <= 0f)
        {
            data.icon.enabled = false;
            return;
        }
        data.icon.rectTransform.position = screenPoint;
        BIWoundSlot biwoundSlot = (BIWoundSlot)data.slot;

        if (biwoundSlot.GetInjury() != null && BodyInspectionController.Get() != null && BodyInspectionController.Get().enabled&& biwoundSlot.GetInjury().m_Bandage == null && biwoundSlot.m_Maggots == null && biwoundSlot.GetInjury().m_ParentInjury == null)
        {
            data.icon.enabled = true;
            data.icon.color   = ((!(Inventory3DManager.Get().m_SelectedSlot == data.slot)) ? this.m_NormalColor : this.m_SelectedColor);
        }
        else
        {
            data.icon.enabled = false;
        }
    }
Beispiel #2
0
    private void UpdateWoundSlots(SlotData data)
    {
        if (!Inventory3DManager.Get().isActiveAndEnabled || !BodyInspectionController.Get().IsActive())
        {
            data.obj.gameObject.SetActive(false);
            return;
        }
        if (GreenHellGame.IsPCControllerActive() && (Inventory3DManager.Get().m_CarriedItem == null || !data.slot.CanInsertItem(Inventory3DManager.Get().m_CarriedItem)))
        {
            data.obj.gameObject.SetActive(false);
            return;
        }
        BIWoundSlot biwoundSlot = (BIWoundSlot)data.slot;

        if (biwoundSlot == null || biwoundSlot.m_Injury == null)
        {
            data.obj.gameObject.SetActive(false);
            return;
        }
        if (biwoundSlot.m_Injury.m_Type == InjuryType.Leech)
        {
            data.obj.gameObject.SetActive(false);
            return;
        }
        if (!data.obj.gameObject.activeSelf)
        {
            data.obj.gameObject.SetActive(true);
        }
        Vector3 screenPoint = data.slot.GetScreenPoint();

        if (screenPoint.z <= 0f)
        {
            data.icon.enabled = false;
            return;
        }
        data.icon.rectTransform.position = screenPoint;
        if (biwoundSlot.GetInjury() != null && BodyInspectionController.Get() != null && BodyInspectionController.Get().enabled&& EnumTools.ConvertInjuryPlaceToLimb(biwoundSlot.GetInjury().m_Place) == HUDBodyInspection.Get().GetSelectedLimb() && biwoundSlot.GetInjury().m_Bandage == null && biwoundSlot.m_Maggots == null && biwoundSlot.GetInjury().m_ParentInjury == null)
        {
            data.icon.enabled       = true;
            this.m_SelectedSlotData = data;
            return;
        }
        data.icon.enabled = false;
    }