// Token: 0x06002176 RID: 8566 RVA: 0x000B6E68 File Offset: 0x000B5268
        public override bool checkHint(out EPlayerMessage message, out string text, out Color color)
        {
            int i = 0;

            while (i < base.objectAsset.interactabilityConditions.Length)
            {
                INPCCondition inpccondition = base.objectAsset.interactabilityConditions[i];
                if (!inpccondition.isConditionMet(Player.player))
                {
                    text  = inpccondition.formatCondition(Player.player);
                    color = Color.white;
                    if (string.IsNullOrEmpty(text))
                    {
                        message = EPlayerMessage.NONE;
                        return(false);
                    }
                    message = EPlayerMessage.CONDITION;
                    return(true);
                }
                else
                {
                    i++;
                }
            }
            message = EPlayerMessage.INTERACT;
            text    = base.objectAsset.interactabilityText;
            color   = Color.white;
            return(true);
        }
예제 #2
0
        // Token: 0x06002162 RID: 8546 RVA: 0x000B5D38 File Offset: 0x000B4138
        public override bool checkHint(out EPlayerMessage message, out string text, out Color color)
        {
            for (int i = 0; i < base.objectAsset.interactabilityConditions.Length; i++)
            {
                INPCCondition inpccondition = base.objectAsset.interactabilityConditions[i];
                if (!inpccondition.isConditionMet(Player.player))
                {
                    message = EPlayerMessage.CONDITION;
                    text    = inpccondition.formatCondition(Player.player);
                    color   = Color.white;
                    return(true);
                }
            }
            if (base.objectAsset.interactabilityPower != EObjectInteractabilityPower.NONE && !base.isWired)
            {
                message = EPlayerMessage.POWER;
            }
            else
            {
                switch (base.objectAsset.interactabilityHint)
                {
                case EObjectInteractabilityHint.DOOR:
                    message = EPlayerMessage.DOOR_OPEN;
                    break;

                case EObjectInteractabilityHint.SWITCH:
                    message = EPlayerMessage.SPOT_ON;
                    break;

                case EObjectInteractabilityHint.FIRE:
                    message = EPlayerMessage.FIRE_ON;
                    break;

                case EObjectInteractabilityHint.GENERATOR:
                    message = EPlayerMessage.GENERATOR_ON;
                    break;

                case EObjectInteractabilityHint.USE:
                    message = EPlayerMessage.USE;
                    break;

                default:
                    message = EPlayerMessage.NONE;
                    break;
                }
            }
            text  = string.Empty;
            color = Color.white;
            return(true);
        }
        // Token: 0x060038D8 RID: 14552 RVA: 0x001A088C File Offset: 0x0019EC8C
        private static void updateQuest(QuestAsset newQuest, DialogueResponse newResponse, DialogueAsset newAcceptDialogue, DialogueAsset newDeclineDialogue, EQuestViewMode newMode)
        {
            PlayerNPCQuestUI.quest           = newQuest;
            PlayerNPCQuestUI.response        = newResponse;
            PlayerNPCQuestUI.acceptDialogue  = newAcceptDialogue;
            PlayerNPCQuestUI.declineDialogue = newDeclineDialogue;
            PlayerNPCQuestUI.mode            = newMode;
            if (PlayerNPCQuestUI.quest == null)
            {
                return;
            }
            PlayerNPCQuestUI.beginContainer.isVisible   = (PlayerNPCQuestUI.mode == EQuestViewMode.BEGIN);
            PlayerNPCQuestUI.endContainer.isVisible     = (PlayerNPCQuestUI.mode == EQuestViewMode.END);
            PlayerNPCQuestUI.detailsContainer.isVisible = (PlayerNPCQuestUI.mode == EQuestViewMode.DETAILS);
            if (PlayerNPCQuestUI.mode == EQuestViewMode.DETAILS)
            {
                if (Player.player.quests.TrackedQuestID == PlayerNPCQuestUI.quest.id)
                {
                    PlayerNPCQuestUI.trackButton.text = PlayerNPCQuestUI.localization.format("Track_Off");
                }
                else
                {
                    PlayerNPCQuestUI.trackButton.text = PlayerNPCQuestUI.localization.format("Track_On");
                }
            }
            PlayerNPCQuestUI.nameLabel.text = PlayerNPCQuestUI.quest.questName;
            string text = PlayerNPCQuestUI.quest.questDescription;

            text = text.Replace("<br>", "\n");
            PlayerNPCQuestUI.descriptionLabel.text = text;
            int num  = Screen.height - 80;
            int num2 = 0;

            if (PlayerNPCQuestUI.quest.conditions != null && PlayerNPCQuestUI.quest.conditions.Length > 0)
            {
                PlayerNPCQuestUI.conditionsLabel.isVisible     = true;
                PlayerNPCQuestUI.conditionsContainer.isVisible = true;
                PlayerNPCQuestUI.conditionsContainer.remove();
                int num3 = 0;
                for (int i = 0; i < PlayerNPCQuestUI.quest.conditions.Length; i++)
                {
                    INPCCondition inpccondition = PlayerNPCQuestUI.quest.conditions[i];
                    bool          flag          = inpccondition.isConditionMet(Player.player);
                    Texture2D     icon          = null;
                    if (PlayerNPCQuestUI.mode != EQuestViewMode.BEGIN)
                    {
                        if (flag)
                        {
                            icon = (Texture2D)PlayerNPCQuestUI.icons.load("Complete");
                        }
                        else
                        {
                            icon = (Texture2D)PlayerNPCQuestUI.icons.load("Incomplete");
                        }
                    }
                    Sleek sleek = inpccondition.createUI(Player.player, icon);
                    if (sleek != null)
                    {
                        sleek.positionOffset_Y = num3;
                        PlayerNPCQuestUI.conditionsContainer.add(sleek);
                        num3 += sleek.sizeOffset_Y;
                    }
                }
                PlayerNPCQuestUI.conditionsContainer.sizeOffset_Y = num3;
                num2 += 30;
                num2 += num3;
            }
            else
            {
                PlayerNPCQuestUI.conditionsLabel.isVisible     = false;
                PlayerNPCQuestUI.conditionsContainer.isVisible = false;
            }
            if (PlayerNPCQuestUI.quest.rewards != null && PlayerNPCQuestUI.quest.rewards.Length > 0)
            {
                PlayerNPCQuestUI.rewardsLabel.isVisible     = true;
                PlayerNPCQuestUI.rewardsContainer.isVisible = true;
                PlayerNPCQuestUI.rewardsContainer.remove();
                int num4 = 0;
                for (int j = 0; j < PlayerNPCQuestUI.quest.rewards.Length; j++)
                {
                    INPCReward inpcreward = PlayerNPCQuestUI.quest.rewards[j];
                    Sleek      sleek2     = inpcreward.createUI(Player.player);
                    if (sleek2 != null)
                    {
                        sleek2.positionOffset_Y = num4;
                        PlayerNPCQuestUI.rewardsContainer.add(sleek2);
                        num4 += sleek2.sizeOffset_Y;
                    }
                }
                PlayerNPCQuestUI.rewardsLabel.positionOffset_Y     = num2;
                PlayerNPCQuestUI.rewardsContainer.positionOffset_Y = num2 + 30;
                PlayerNPCQuestUI.rewardsContainer.sizeOffset_Y     = num4;
                num2 += 30;
                num2 += num4;
            }
            else
            {
                PlayerNPCQuestUI.rewardsLabel.isVisible     = false;
                PlayerNPCQuestUI.rewardsContainer.isVisible = false;
            }
            PlayerNPCQuestUI.detailsBox.area = new Rect(0f, 0f, 5f, (float)num2);
            if (num2 + 105 > num)
            {
                PlayerNPCQuestUI.questBox.positionOffset_Y   = 0;
                PlayerNPCQuestUI.questBox.positionScale_Y    = 0f;
                PlayerNPCQuestUI.questBox.sizeOffset_Y       = num;
                PlayerNPCQuestUI.detailsBox.positionOffset_Y = -num + 100;
                PlayerNPCQuestUI.detailsBox.sizeOffset_Y     = num - 105;
                PlayerNPCQuestUI.detailsBox.sizeOffset_X     = -10;
            }
            else
            {
                PlayerNPCQuestUI.questBox.positionOffset_Y   = -num2 / 2 - 80;
                PlayerNPCQuestUI.questBox.positionScale_Y    = 0.5f;
                PlayerNPCQuestUI.questBox.sizeOffset_Y       = num2 + 100;
                PlayerNPCQuestUI.detailsBox.positionOffset_Y = -5 - num2;
                PlayerNPCQuestUI.detailsBox.sizeOffset_Y     = num2;
                PlayerNPCQuestUI.detailsBox.sizeOffset_X     = 20;
            }
        }