예제 #1
0
        /// <summary>
        /// If onlyTrackOneQuestAtATime is true and the specified quest is
        /// now being tracked, disable tracking on other quests.
        /// </summary>
        /// <param name="questID"></param>
        public virtual void CheckTrackingToggles(string questID)
        {
            if (!onlyTrackOneQuestAtATime)
            {
                return;
            }
            var quest = FindQuest(questID);

            if (quest == null || !quest.showInTrackHUD)
            {
                return;
            }
            var changed = false;

            for (int i = 0; i < questList.Count; i++)
            {
                if (questList[i] == null || !questList[i].showInTrackHUD || Equals(questList[i].id, questID))
                {
                    continue;
                }
                questList[i].showInTrackHUD = false;
                changed = true;
            }
            if (changed)
            {
                QuestMachineMessages.RefreshUIs(quest);
            }
        }
예제 #2
0
        public void OnToggleTracking(bool value, object data)
        {
            var quest = data as Quest;

            if (quest == null)
            {
                return;
            }
            quest.showInTrackHUD = value;
            QuestMachineMessages.RefreshUIs(quest);
        }
예제 #3
0
        /// <summary>
        /// Adds a quest to this quest giver's list.
        /// </summary>
        /// <param name="quest"></param>
        public override Quest AddQuest(Quest quest)
        {
            if (quest == null)
            {
                return(null);
            }
            var instance = base.AddQuest(quest);

            instance.AssignQuestGiver(myQuestGiverTextInfo);
            QuestMachineMessages.RefreshUIs(this);
            return(instance);
        }