Ejemplo n.º 1
0
        // Start is called before the first frame update
        public void Setup(QuestStatus status)
        {
            foreach (Transform child in whereToSpawnPrefab.transform)
            {
                Destroy(child.gameObject);
            }

            if (status == null || status.GetQuest() == null)
            {
                return;
            }

            Quest quest = status.GetQuest();

            title.text = quest.GetTitle();

            for (int i = 0; i < quest.GetObjectiveCount(); i++)
            {
                GameObject      instance = Instantiate(objectivePrefab, whereToSpawnPrefab.transform);
                TextMeshProUGUI text     = instance.GetComponentInChildren <TextMeshProUGUI>();
                text.text = quest.GetObjective(i).description;
                if (!status.isCompleted(quest.GetObjective(i).reference))
                {
                    instance.transform.GetChild(0).GetChild(0).gameObject.SetActive(false);
                }
            }
            reward.text = quest.GetReward();
        }
Ejemplo n.º 2
0
 public void Setup(QuestStatus status)
 {
     Debug.Log(status.GetQuest());
     text.text     = status.GetQuest().GetTitle();
     progress.text = status.GetCompletedObjectivesCount() + "/" + status.GetQuest().GetObjectiveCount();
     currentQuest  = status;
 }
Ejemplo n.º 3
0
    public void Setup(QuestStatus status)
    {
        this.title.text = status.GetQuest().GetTitle();

        parent.DetachChildren();

        foreach (var obj in status.GetQuest().GetObjectives())
        {
            ObjectiveItemUI item = Instantiate(objectiveUIButton, parent);

            bool isComplete = false;
            if (status.GetCompletedObjectives().Contains(obj.reference))
            {
                isComplete = true;
            }

            item.Setup(obj.description, isComplete);
        }

        rewardText.text = "";
        foreach (var reward in status.GetQuest().GetRewards())
        {
            rewardText.text += reward.number + "x " + reward.item.name + "\n";
        }
        if (rewardText.text == "")
        {
            rewardText.text = "No Reward.";
        }
    }
Ejemplo n.º 4
0
 public void Setup(QuestStatus status)
 {
     this.status         = status;
     questTitle.text     = status.GetQuest().Title();
     questProgress.text  = status.GetCompletedObjectives().Count + "/" + status.GetQuest().Objectives().Count;
     questTitle.color    = (status.IsComplete()) ? completedColor : activeColor;
     questProgress.color = (status.IsComplete()) ? completedColor : activeColor;
 }
Ejemplo n.º 5
0
    public void Setup(QuestStatus status)
    {
        title.text = status.GetQuest().GetTitle();

        int completed = status.GetCompletedObjectives().Count();

        progress.text = completed + "/" + status.GetQuest().GetObjectiveCount().ToString();
        GetComponent <QuestToolTipSpawner>().Setup(status);
    }
        public void Setup(QuestStatus status)
        {
            this.status = status;
            if (status.GetQuest().GetIsMainQuest())
            {
                title.color    = Color.yellow;
                progress.color = Color.yellow;
            }

            title.text    = status.GetQuest().GetTitle();
            progress.text = status.CompletedObjectivesNumber() + "/" +
                            status.GetQuest().GetObjectiveCount();
        }
        public void Setup(QuestStatus status)
        {
            title.text = status.GetQuest().GetTitle();

            foreach (var objective in status.GetQuest().GetObjectives())
            {
                GameObject prefabVariant = objectivePrefabUncheck;
                if (status.IsObjectiveCompleted(objective.reference))
                {
                    prefabVariant = objectivePrefab;
                }
                GameObject obj = Instantiate(prefabVariant, objectivesContainer);
                obj.GetComponentInChildren <TextMeshProUGUI>().text = objective.description;
            }
        }
Ejemplo n.º 8
0
        public void FoldoutQuestInfo()
        {
            if (isDropdownFolded)
            {
                Quest quest = status.GetQuest();
                foreach (var objective in quest.GetObjectives())
                {
                    GameObject prefab = incompletePrefab;
                    if (status.IsObjectiveComplete(objective))
                    {
                        prefab = objectivePrefab;
                    }
                    GameObject      objectiveInstance = Instantiate(prefab, objectiveContainer);
                    TextMeshProUGUI objectiveText     = objectiveInstance.GetComponentInChildren <TextMeshProUGUI>();
                    objectiveText.text     = objective;
                    objectiveText.fontSize = 24;
                }
            }
            else
            {
                foreach (Transform item in objectiveContainer)
                {
                    Destroy(item.gameObject);
                }
            }

            RotateDropdownIcon();
        }
Ejemplo n.º 9
0
    public void Setup(QuestStatus status)
    {
        this.status = status;
        Quest quest = status.GetQuest();

        title.text    = quest.GetTitle();
        progress.text = $"{status.GetCompletedCount()}/{quest.GetObjectiveCount()}";
    }
Ejemplo n.º 10
0
    public void Setup(QuestStatus status)
    {
        Quest quest = status.GetQuest();

        title.text = quest.GetTitle();
        foreach (var obj in quest.GetObjectives())
        {
            GameObject objectivePrefab        = status.IsObjectiveComplete(obj.reference) ? this.objectivePrefab : objectiveIncompletePrefab;
            GameObject currentObjectivePrefab = Instantiate(objectivePrefab, objectiveContainer);
            currentObjectivePrefab.GetComponentInChildren <TextMeshProUGUI>().text = obj.description;
        }
        rewardText.text = GetRewardText(quest);
    }
        public void Setup(QuestStatus status, int i)
        {
            Quest quest = status.GetQuest();

            title.text = quest.GetObjective(i);
            foreach (Transform item in objectiveContainer)
            {
                Destroy(item.gameObject);
            }

            int objectiveCount = quest.GetObjectiveCount();

            foreach (string parameter in quest.GetObjectiveParameters(i))
            {
                GameObject parameterInstance = Instantiate(parameterPrefab, objectiveContainer);
                parameterInstance.GetComponent <TextMeshProUGUI>().text = parameter;
            }
        }
Ejemplo n.º 12
0
        public void Setup(QuestStatus status)
        {
            Quest quest = status.GetQuest();

            title.text = quest.GetTitle();
            objectiveContainer.DetachChildren();
            foreach (string objective in quest.GetObjectives())
            {
                GameObject prefab = objectiveIncompletePrefab;
                if (status.IsObjectiveComplete(objective))
                {
                    prefab = objectivePrefab;
                }
                GameObject      objectiveInstance = Instantiate(prefab, objectiveContainer);
                TextMeshProUGUI objectiveText     = objectiveInstance.GetComponentInChildren <TextMeshProUGUI>();
                objectiveText.text = objective;
            }
        }
Ejemplo n.º 13
0
        public void Setup(QuestStatus status)
        {
            Quest quest = status.GetQuest();

            title.text = quest.GetTitle();
            ClearObjectives();
            foreach (var objective in quest.GetObjectives())
            {
                GameObject prefab = objectiveIncompletePrefab;
                if (status.IsObjectiveComplete(objective.reference))
                {
                    prefab = objectivePrefab;
                }

                GameObject      objectiveInstance = Instantiate(prefab, objectiveContainer);
                TextMeshProUGUI objectiveText     = objectiveInstance.GetComponentInChildren <TextMeshProUGUI>();
                objectiveText.text = objective.description;
            }
            rewards.text = GetRewardText(quest);
        }
Ejemplo n.º 14
0
        public void Setup(QuestStatus status)
        {
            Quest quest = status.GetQuest();

            // clear objective container
            foreach (Transform child in objectiveContainer)
            {
                Destroy(child.gameObject);
            }

            title.text = quest.Title();

            // fill objective container from quest
            foreach (Quest.Objective objective in quest.Objectives())
            {
                QuestObjective questObjectiveInstance = Instantiate(questObjectivePrefab, objectiveContainer);
                questObjectiveInstance.Setup(objective.description, status.IsObjectiveComplete(objective.reference));
            }

            reward.text = GetRewardText(quest);
        }
        public void Setup(QuestStatus status)
        {
            Quest quest = status.GetQuest();

            title.text = quest.GetTitle();
            foreach (Transform item in objectiveContainer)
            {
                Destroy(item.gameObject);
            }

            foreach (var objective in quest.GetObjectives())
            {
                GameObject prefab = objectiveIncompletePrefab;
                if (status.IsObjectiveComplete(objective))
                {
                    prefab = objectivePrefab;
                }
                GameObject objectiveInstance = Instantiate(prefab, objectiveContainer);
                objectiveInstance.GetComponentInChildren <TextMeshProUGUI>().text = objective;
            }

            rewardText.text = GetRewardText(quest);
        }
Ejemplo n.º 16
0
 public void Setup(QuestStatus status)
 {
     _status       = status;
     title.text    = _status.GetQuest().GetTitle();
     progress.text = $"{_status.GetCompletedCount()}/{_status.GetQuest().GetObjectiveCount()}";
 }
Ejemplo n.º 17
0
 public void Setup(QuestStatus status)
 {
     this.status   = status;
     title.text    = status.GetQuest().GetTitle();
     progress.text = status.GetCompletedCount() + "/" + status.GetQuest().GetObjectiveCount();
 }