public void ShowAbilityRewards() { //Debug.Log("FactionChangePanelController.ShowAbilityRewards()"); ClearRewardIcons(); // show ability rewards // new game manager ? isn't this only in-game ? CapabilityProps capabilityProps = faction.GetFilteredCapabilities(newGameManager); if (capabilityProps.AbilityList.Count > 0) { abilitiesArea.gameObject.SetActive(true); } else { abilitiesArea.gameObject.SetActive(false); return; } for (int i = 0; i < capabilityProps.AbilityList.Count; i++) { RewardButton rewardIcon = objectPooler.GetPooledObject(rewardIconPrefab, abilityIconsArea.transform).GetComponent <RewardButton>(); rewardIcon.Configure(systemGameManager); rewardIcon.SetOptions(rectTransform, false); rewardIcon.SetDescribable(capabilityProps.AbilityList[i]); abilityRewardIcons.Add(rewardIcon); if (capabilityProps.AbilityList[i].RequiredLevel > playerManager.MyCharacter.CharacterStats.Level) { rewardIcon.StackSizeText.text = "Level\n" + capabilityProps.AbilityList[i].RequiredLevel; rewardIcon.HighlightIcon.color = new Color32(255, 255, 255, 80); } abilityRewardsGrid.AddActiveButton(rewardIcon); } }
public void ShowTraitRewards() { //Debug.Log("ClassChangePanelController.ShowTraitRewards()"); ClearTraitRewardIcons(); // show trait rewards CapabilityProps capabilityProps = classSpecialization.GetFilteredCapabilities(playerManager.ActiveCharacter); if (capabilityProps.TraitList.Count > 0) { traitsArea.gameObject.SetActive(true); } else { traitsArea.gameObject.SetActive(false); return; } for (int i = 0; i < capabilityProps.TraitList.Count; i++) { if (capabilityProps.TraitList[i] != null) { RewardButton rewardIcon = objectPooler.GetPooledObject(rewardIconPrefab, traitIconsArea.transform).GetComponent <RewardButton>(); rewardIcon.Configure(systemGameManager); rewardIcon.SetOptions(rectTransform, false); rewardIcon.SetDescribable(capabilityProps.TraitList[i]); traitRewardIcons.Add(rewardIcon); if ((capabilityProps.TraitList[i] as StatusEffect).RequiredLevel > playerManager.MyCharacter.CharacterStats.Level) { rewardIcon.StackSizeText.text = "Level\n" + (capabilityProps.TraitList[i] as StatusEffect).RequiredLevel; rewardIcon.HighlightIcon.color = new Color32(255, 255, 255, 80); } } } }
public void ShowTraitRewards() { //Debug.Log("ClassChangePanelController.ShowTraitRewards()"); ClearTraitRewardIcons(); // show trait rewards CapabilityProps capabilityProps = characterClass.GetFilteredCapabilities(playerManager.ActiveCharacter); if (playerManager.MyCharacter.Faction != null) { CapabilityConsumerSnapshot capabilityConsumerSnapshot = new CapabilityConsumerSnapshot(playerManager.ActiveCharacter, systemGameManager); capabilityConsumerSnapshot.CharacterClass = characterClass; CapabilityProps capabilityPropsFaction = playerManager.MyCharacter.Faction.GetFilteredCapabilities(capabilityConsumerSnapshot, false); capabilityProps = capabilityPropsFaction.Join(capabilityProps); } List <StatusEffect> traitList = capabilityProps.TraitList.Distinct().ToList(); if (traitList.Count > 0) { traitsArea.gameObject.SetActive(true); } else { traitsArea.gameObject.SetActive(false); return; } for (int i = 0; i < traitList.Count; i++) { if (traitList[i] != null) { RewardButton rewardIcon = objectPooler.GetPooledObject(rewardIconPrefab, traitIconsArea.transform).GetComponent <RewardButton>(); rewardIcon.Configure(systemGameManager); rewardIcon.SetOptions(rectTransform, false); rewardIcon.SetDescribable(traitList[i]); traitRewardIcons.Add(rewardIcon); if (traitList[i].RequiredLevel > playerManager.MyCharacter.CharacterStats.Level) { rewardIcon.StackSizeText.text = "Level\n" + traitList[i].RequiredLevel; rewardIcon.HighlightIcon.color = new Color32(255, 255, 255, 80); } uINavigationControllers[1].AddActiveButton(rewardIcon); } } }
public void ShowDescription(Quest quest) { //Debug.Log("QuestDetailsArea.ShowDescription()"); ClearDescription(); if (quest == null) { return; } this.quest = quest; questDescription.text = quest.GetObjectiveDescription(); experienceReward.text += LevelEquations.GetXPAmountForQuest(playerManager.MyCharacter.CharacterStats.Level, quest, systemConfigurationManager) + " XP"; // display currency rewards List <CurrencyNode> currencyNodes = quest.GetCurrencyReward(); // currencies could be different if (currencyNodes.Count > 0) { currencyHeading.gameObject.SetActive(true); currencyArea.gameObject.SetActive(true); if (currencyLootButton != null) { KeyValuePair <Sprite, string> keyValuePair = currencyConverter.RecalculateValues(currencyNodes, true); currencyLootButton.Icon.sprite = keyValuePair.Key; currencyLootButton.Title.text = keyValuePair.Value; } } else { currencyHeading.gameObject.SetActive(false); currencyArea.gameObject.SetActive(false); } // show item rewards if (quest.ItemRewards.Count > 0) { itemsHeading.gameObject.SetActive(true); if (quest.MaxItemRewards > 0) { itemsHeading.GetComponent <TextMeshProUGUI>().text = "Choose " + quest.MaxItemRewards + " Item Rewards:"; } else { itemsHeading.GetComponent <TextMeshProUGUI>().text = "Item Rewards:"; } } for (int i = 0; i < quest.ItemRewards.Count; i++) { RewardButton rewardIcon = objectPooler.GetPooledObject(rewardIconPrefab, itemIconsArea.transform).GetComponent <RewardButton>(); rewardIcon.Configure(systemGameManager); rewardIcon.SetOptions(owner.RectTransform, quest.MaxItemRewards > 0); rewardIcon.OnAttempSelect += HandleAttemptSelect; //Debug.Log("QuestDetailsArea.ShowDescription(): setting describable (and attemptselect) for: " + quest.MyItemRewards[i]); rewardIcon.SetDescribable(quest.ItemRewards[i]); itemRewardIcons.Add(rewardIcon); //if (quest.MaxItemRewards > 0) { itemGrid.AddActiveButton(rewardIcon); //} } // show ability rewards if (quest.AbilityRewards.Count > 0) { abilitiesHeading.gameObject.SetActive(true); if (quest.MaxAbilityRewards > 0) { abilitiesHeading.GetComponent <TextMeshProUGUI>().text = "Choose " + quest.MaxAbilityRewards + " Ability Rewards:"; } else { abilitiesHeading.GetComponent <TextMeshProUGUI>().text = "Ability Rewards:"; } } else { abilitiesHeading.GetComponent <TextMeshProUGUI>().text = ""; } for (int i = 0; i < quest.AbilityRewards.Count; i++) { RewardButton rewardIcon = objectPooler.GetPooledObject(rewardIconPrefab, abilityIconsArea.transform).GetComponent <RewardButton>(); rewardIcon.Configure(systemGameManager); rewardIcon.SetOptions(owner.RectTransform, quest.MaxAbilityRewards > 0); rewardIcon.OnAttempSelect += HandleAttemptSelect; //Debug.Log("QuestDetailsArea.ShowDescription(): setting describable (and attemptselect) for: " + quest.MyAbilityRewards[i]); rewardIcon.SetDescribable(quest.AbilityRewards[i]); abilityRewardIcons.Add(rewardIcon); //if (quest.MaxAbilityRewards > 0) { abilityGrid.AddActiveButton(rewardIcon); //} } // show faction rewards if (quest.FactionRewards.Count > 0) { factionsHeading.gameObject.SetActive(true); if (quest.MaxFactionRewards > 0) { factionsHeading.GetComponent <TextMeshProUGUI>().text = "Choose " + quest.MaxFactionRewards + " Reputation Rewards:"; } else { factionsHeading.GetComponent <TextMeshProUGUI>().text = "Reputation Rewards:"; } } else { factionsHeading.GetComponent <TextMeshProUGUI>().text = ""; } for (int i = 0; i < quest.FactionRewards.Count; i++) { FactionRewardButton rewardIcon = objectPooler.GetPooledObject(factionRewardIconPrefab, factionIconsArea.transform).GetComponent <FactionRewardButton>(); rewardIcon.Configure(systemGameManager); rewardIcon.SetOptions(owner.RectTransform, quest.MaxFactionRewards > 0); rewardIcon.OnAttempSelect += HandleAttemptSelect; //Debug.Log("QuestDetailsArea.ShowDescription(): setting describable (and attemptselect) for: " + quest.MyFactionRewards[i]); rewardIcon.SetDescribable(quest.FactionRewards[i]); factionRewardIcons.Add(rewardIcon); //if (quest.MaxFactionRewards > 0) { factionGrid.AddActiveButton(rewardIcon); //} } // show Skill rewards if (quest.SkillRewards.Count > 0) { skillHeading.gameObject.SetActive(true); if (quest.MaxSkillRewards > 0) { skillHeading.GetComponent <TextMeshProUGUI>().text = "Choose " + quest.MaxSkillRewards + " Skill Rewards:"; } else { skillHeading.GetComponent <TextMeshProUGUI>().text = "Skill Rewards:"; } } else { skillHeading.GetComponent <TextMeshProUGUI>().text = ""; } for (int i = 0; i < quest.SkillRewards.Count; i++) { RewardButton rewardIcon = objectPooler.GetPooledObject(rewardIconPrefab, skillIconsArea.transform).GetComponent <RewardButton>(); rewardIcon.Configure(systemGameManager); rewardIcon.SetOptions(owner.RectTransform, quest.MaxSkillRewards > 0); rewardIcon.SetDescribable(quest.SkillRewards[i]); skillRewardIcons.Add(rewardIcon); //if (quest.MaxSkillRewards > 0) { skillGrid.AddActiveButton(rewardIcon); //} } }