Exemplo n.º 1
0
        private void AddItemsFromListToParent(List <GameItem> itemList, RectTransform parent)
        {
            DeleteInstancesFromParent(parent);

            itemList = ItemUtility.SortByRarity(itemList);

            foreach (GameItem item in itemList)
            {
                GameItemInstanceUI newInstance = Instantiate(itemPrefab);
                newInstance.transform.SetParent(parent);
                newInstance.SetItem(item);
            }
        }
Exemplo n.º 2
0
        public void Reload()
        {
            switch (WindowMode)
            {
            case QuestDetailsWindowMode.SETUP:
                RefreshItemRewardDropdown();
                SetNoHero();
                UIHighlighter.Instance.GetGroup(QuestDetailsWindow.HIGHLIGHT_GROUP_ID).AddObjects(highlightsRewards, UIHighlighter.Instance.redHighlightColor, highlightsRewards[0].color);
                break;

            case QuestDetailsWindowMode.HERO_SELECT:
                UIHighlighter.Instance.GetGroup(QuestDetailsWindow.HIGHLIGHT_GROUP_ID).AddObjects(highlightsHeroSelect, UIHighlighter.Instance.redHighlightColor, highlightsHeroSelect[0].color);
                break;

            case QuestDetailsWindowMode.POSTED_REVIEW:
                SetNoHero();
                break;

            case QuestDetailsWindowMode.ACTIVE_REVIEW:
                FindActiveHero();
                break;

            case QuestDetailsWindowMode.COMPLETED:
                FindActiveHero();
                break;
            }

            heroRewardItemDropdown.gameObject.SetActive(WindowMode == QuestDetailsWindowMode.SETUP);
            heroRewardItemInstance.gameObject.SetActive(WindowMode != QuestDetailsWindowMode.SETUP);

            heroGoldRewardInput.gameObject.SetActive(WindowMode == QuestDetailsWindowMode.SETUP);
            heroGoldRewardText.gameObject.SetActive(WindowMode != QuestDetailsWindowMode.SETUP);

            heroSelectButton.enabled = WindowMode == QuestDetailsWindowMode.HERO_SELECT;

            heroGoldRewardText.text = "" + CurrentQuest.GoldRewards[m_HeroNumber].GoldCount;
            heroRewardItemInstance.SetItem(CurrentQuest.ItemRewards[m_HeroNumber]);
            if (heroGoldRewardInput.gameObject.activeSelf)
            {
                heroGoldRewardInput.text = "0";
            }

            CheckAcceptButtonStatus();
            CheckPostButtonStatus();
        }
Exemplo n.º 3
0
 public void SetItem(GameItem item)
 {
     itemInstance.SetItem(item);
     priceText.text = item.BuyPrice + "G";
 }
Exemplo n.º 4
0
        public void OpenWindow(QuestInstance quest, QuestDetailsWindowMode mode)
        {
            WindowMode = mode;
            if (quest == CurrentQuest)
            {
                gameObject.SetActive(!gameObject.activeSelf);
            }
            else
            {
                gameObject.SetActive(true);
            }
            CurrentQuest = quest;
            Reset();

            switch (mode)
            {
            case QuestDetailsWindowMode.SETUP:
                closeButton.gameObject.SetActive(true);
                skipButton.gameObject.SetActive(false);
                cancelButton.gameObject.SetActive(false);
                acceptButton.gameObject.SetActive(false);
                completeButton.gameObject.SetActive(false);
                postButton.gameObject.SetActive(true);

                RefreshItemRewardDropdown();
                SetNoHero();
                CheckPostButtonStatus();
                break;

            case QuestDetailsWindowMode.HERO_SELECT:
                closeButton.gameObject.SetActive(false);
                skipButton.gameObject.SetActive(true);
                cancelButton.gameObject.SetActive(true);
                acceptButton.gameObject.SetActive(true);
                completeButton.gameObject.SetActive(false);
                postButton.gameObject.SetActive(false);
                break;

            case QuestDetailsWindowMode.POSTED_REVIEW:
                closeButton.gameObject.SetActive(true);
                skipButton.gameObject.SetActive(false);
                cancelButton.gameObject.SetActive(true);
                acceptButton.gameObject.SetActive(false);
                completeButton.gameObject.SetActive(false);
                postButton.gameObject.SetActive(false);

                SetNoHero();
                break;

            case QuestDetailsWindowMode.ACTIVE_REVIEW:
                closeButton.gameObject.SetActive(true);
                skipButton.gameObject.SetActive(false);
                cancelButton.gameObject.SetActive(true);
                acceptButton.gameObject.SetActive(false);
                completeButton.gameObject.SetActive(false);
                postButton.gameObject.SetActive(false);

                FindActiveHero();
                break;

            case QuestDetailsWindowMode.COMPLETED:
                closeButton.gameObject.SetActive(false);
                skipButton.gameObject.SetActive(false);
                cancelButton.gameObject.SetActive(false);
                acceptButton.gameObject.SetActive(false);
                completeButton.gameObject.SetActive(true);
                postButton.gameObject.SetActive(false);

                FindActiveHero();
                break;
            }

            questTitle.text     = "<b><u>" + CurrentQuest.QuestSource.RequestTitle + "</u>\n<size=18>" + CurrentQuest.QuestTypeDisplay + " - </b><i>" + CurrentQuest.DurationInDays + " Day" + (CurrentQuest.DurationInDays > 1 ? "s" : "") + " duration</i></size>";
            difficultyText.text = "" + CurrentQuest.DifficultyLevel;

            handlerGoldReward.text = CurrentQuest.HandlerGoldRewardEstimate;

            handlerItemRewardParent.SetActive(CurrentQuest.HandlerItemReward != null);
            handlerRewardItemInstance.SetItem(CurrentQuest.HandlerItemReward != null ? CurrentQuest.HandlerItemReward.Item : (GameItem)null);

            handlerAdditionalRewardParent.SetActive(CurrentQuest.AdditionalReward != null);
            handlerAdditionalReward.text = CurrentQuest.AdditionalReward != null ? CurrentQuest.AdditionalReward.DisplayValue : "-";

            foreach (QuestDetailsHero heroSection in m_HeroSections)
            {
                heroSection.Reload();
            }
        }