public void ShowItem(Item item, EquipmentType type, HeroDetailsInterface heroInterface, System.Action <Item> onEquip) { this.type = type; this.onEquip = onEquip; this.heroInterface = heroInterface; _rectTranform = GetComponent <RectTransform>(); if (item == null) { itemIcon.sprite = EquipSlotIcons[type]; NoItemDisplay(); } else { this.item = item; itemIcon.sprite = item.data.LoadSprite(); if (item.data.ClassRestriction != null) { requireText.text = "Restricted to " + item.data.ClassRestriction.ToString() + " class"; RequireGO.SetActive(true); } else { RequireGO.SetActive(false); } UpdateDetails(item.isIdentified); } // Show Window MoveWindow(0f); }
public void Btn_Clicked() { StopCoroutine(trackHeldRoutine); if (!heroHeld && Input.GetMouseButtonUp(0)) { HeroDetailsInterface heroDetails = (HeroDetailsInterface)MenuManager.Instance.Push("Interface_HeroDetails"); //heroDetails.Initialize(hero, campHeroInterface); } heroHeld = false; }
void Start() { Instance = this; revealFX.gameObject.SetActive(true); revealFX.color = new Color(1, 1, 1, 0); wrapper.transform.localScale = Vector2.zero; wrapper.transform.DOScale(Vector2.one, 0.5f).SetEase(Ease.OutBack); modalShadow.color = new Color(0, 0, 0, 0); modalShadow.DOFade(0.5f, 0.5f); heroDetails = GameObject.FindObjectOfType <HeroDetailsInterface>(); }
//bool _isBusy = false; public void SelectItem(Item item, EquipmentType type, HeroDetailsInterface heroInterface, System.Action <Item> onEquip) { _isClosing = false; this.type = type; this.onEquip = onEquip; this.heroInterface = heroInterface; _rectTranform = GetComponent <RectTransform>(); this.item = item; itemIcon.sprite = item.data.LoadSprite(); if (item.data.ClassRestriction != null) { requireText.text = "Restricted to " + item.data.ClassRestriction.ToString() + " class"; RequireGO.SetActive(true); } else { RequireGO.SetActive(false); } UpdateDetails(item.isIdentified); if (!item.isIdentified) { BTN_Equip.interactable = false; } else { BTN_Equip.interactable = true; } if (heroInterface.Equipped.ContainsKey(type)) { CurrentlyEquipped.sprite = item.data.LoadSprite(); equipedItem = heroInterface.Equipped[type]; } else { CurrentlyEquipped.sprite = EquipSlotIcons[type]; equipedItem = null; } SelectedEquipment.sprite = item.data.LoadSprite(); // Show Window MoveWindow(0f); }
public void LoadItem(Item item, Action <Item, ItemDisplayInterface> onItemClick, HeroDetailsInterface heroInterface) { this.item = item; this.onItemClick = onItemClick; itemBackground.color = item.GetBackgroundColor(); qualityText.text = item.Quality.ToString(); itemIcon.sprite = item.data.LoadSprite(); this.heroInterface = heroInterface; DebugLabel.text = "#" + item.MongoID; UpdateIdentify(); }
public void LoadInventory(EquipmentType EquipType, System.Action <Item> onEquip, HeroDetailsInterface heroInterface, bool reveal = false) { if (_currentItemDisplay != null) { return; } InventoryTitle.text = "Inventory - " + EquipType; _EquipType = EquipType; _heroInterface = heroInterface; if (reveal) { _rectTranform.DOAnchorPos(new Vector2(0f, _rectTranform.anchoredPosition.y), 0.3f).SetEase(Ease.OutSine); } // Load the items from the player inventory here RefreshItems(); this._onEquip = onEquip; }
void OnDestroy() { PlayerManager.Instance.Signals.OnChangedCurrency -= OnChangedCurrency; _heroInterface = null; _itemPanel = null; }
public void Initialize(Hero hero, HeroDetailsInterface heroInterface) { this.hero = hero; this.heroInterface = heroInterface; // Fade the Shadow in fader.color = new Color(0f, 0f, 0f, 0f); fader.DOColor(new Color(0f, 0f, 0f, 0.7f), 0.3f); // Transition the panel in RevealPanel.localScale = Vector3.zero; RevealPanel.DOScale(1f, 0.4f); // Skip worrying about UI configuration ResetStars(); AwakenContainer.gameObject.SetActive(false); // Spawn hero UI element heroRef = Instantiate(hero.LoadUIAnimationReference(), ModelContainer); RectTransform heroRT = heroRef.GetComponent <RectTransform>(); heroRT.anchorMin = new Vector2(0.5f, 0f); heroRT.anchorMax = new Vector2(0.5f, 0f); heroRT.pivot = new Vector2(0.5f, 0f); heroRT.anchoredPosition = new Vector2(0f, 50f); heroRT.localScale *= 2.5f; if (hero.isAscended) { AcceptButton.gameObject.SetActive(false); CancelButton.gameObject.SetActive(false); ContinueButton.gameObject.SetActive(true); StarContainer.gameObject.SetActive(false); AwakenText.text = "Limit Reached"; AwakenContainer.gameObject.SetActive(true); // Swap out requirement icons MaterialRequiredAmount.text = "None"; RelicRequiredAmount.text = "None"; RelicRequiredAmount.color = Color.white; MaterialRequiredAmount.color = Color.white; RelicRequiredIcon.sprite = null; MaterialRequiredIcon.sprite = null; RelicRequiredIcon.color = new Color(0.3f, 0.3f, 0.3f, 1f); MaterialRequiredIcon.color = new Color(0.3f, 0.3f, 0.3f, 1f); } else { // Required Relic Checks and display code CurrencyTypes relicType = CurrencyTypes.RELICS_SWORD; switch (hero.data.Class) { case HeroClass.Assassin: relicType = CurrencyTypes.RELICS_BOW; break; case HeroClass.Tank: relicType = CurrencyTypes.RELICS_SHIELD; break; case HeroClass.Mage: relicType = CurrencyTypes.RELICS_STAFF; break; default: case HeroClass.Bruiser: // Already set to sword break; } RelicRequiredIcon.sprite = IconReferenceList[hero.data.Class]; CurrencyManager.ColorizeSlashText(relicType, 1, RelicRequiredAmount, AcceptButton); // Required Material Checks and display code Debug.Log("Hero Quality: [" + hero.Quality.ToString() + "]\n"); int currencyCount = 0; bool hasEnoughCurrency = false; switch (hero.Quality) { case HeroQuality.Common: currencyCount = CurrencyTypes.ESSENCE_LOW.GetAmount(); MaterialRequiredIcon.sprite = Resources.Load <Sprite>("Items/Essences/low_essence"); MaterialRequiredAmount.text = currencyCount + "/25"; if (currencyCount >= 25) { hasEnoughCurrency = true; } SetCurrentStars(1); SetTargetStars(2); break; case HeroQuality.Rare: currencyCount = CurrencyTypes.ESSENCE_MID.GetAmount(); MaterialRequiredIcon.sprite = Resources.Load <Sprite>("Items/Essences/medium_essence"); MaterialRequiredAmount.text = currencyCount + "/15"; if (currencyCount >= 15) { hasEnoughCurrency = true; } SetCurrentStars(2); SetTargetStars(3); break; case HeroQuality.Legendary: currencyCount = CurrencyTypes.ESSENCE_HIGH.GetAmount(); MaterialRequiredIcon.sprite = Resources.Load <Sprite>("Items/Essences/high_essence"); MaterialRequiredAmount.text = currencyCount + "/15"; if (currencyCount >= 15) { hasEnoughCurrency = true; } // Awaken test show StarContainer.gameObject.SetActive(false); AwakenContainer.gameObject.SetActive(true); break; } if (!hasEnoughCurrency) { // Disable the accept button AcceptButton.interactable = false; MaterialRequiredAmount.color = Color.red; } else { MaterialRequiredAmount.color = Color.white; } if (!hero.isMaxLevel()) { AcceptButton.interactable = false; AwakenText.text = "Not Max Level"; AwakenText.color = Color.red; StarContainer.gameObject.SetActive(false); AwakenContainer.gameObject.SetActive(true); } } if (!PlayerPrefs.HasKey("tutorial_hero_upgrades")) { StoryManager.Instance.DisplayStory("story_tutorial_hero_upgrades"); PlayerPrefs.SetInt("tutorial_hero_upgrades", 1); } }
public void Btn_ShowHeroDetails() { HeroDetailsInterface heroDetails = (HeroDetailsInterface)MenuManager.Instance.Push("Interface_HeroDetails"); heroDetails.Initialize(selectedHero, this, btnBack); }