Пример #1
0
        public override void RefreshButton(Currencies playerCurrencies)
        {
            var selectedItem = GetSelectedItem();
            var haveSpace    = CanAddRewardToInventory(selectedItem);

            MainButton.interactable = selectedItem != null && selectedItem.CanClaim && haveSpace;
            var tooltip = MainButton.GetComponent <UITooltip>();

            if (tooltip != null)
            {
                tooltip.m_text = "";
                if (selectedItem != null && !selectedItem.CanClaim)
                {
                    tooltip.m_text = "$mod_epicloot_bounties_notcompletetooltip";
                }
                else if (selectedItem != null && !haveSpace)
                {
                    tooltip.m_text = "$mod_epicloot_bounties_noroomtooltip";
                }
            }

            var canAbandon = selectedItem != null && selectedItem.BountyInfo.State == BountyState.InProgress;

            AbandonButton.interactable = canAbandon;
            AbandonButtonIcon.color    = canAbandon ? Color.red : Color.grey;
        }
Пример #2
0
        public override void RefreshButton(Currencies playerCurrencies)
        {
            var selectedItem = GetSelectedItem();
            var haveSpace    = Player.m_localPlayer.GetInventory().FindEmptySlot(false).x >= 0 || Player.m_localPlayer.GetInventory().FindFreeStackSpace(selectedItem?.ItemInfo.Item.m_shared.m_name) > 0;

            MainButton.interactable = selectedItem != null && selectedItem.CanAfford(playerCurrencies) && haveSpace;
            var tooltip = MainButton.GetComponent <UITooltip>();

            if (tooltip != null)
            {
                tooltip.m_text = "";
                if (selectedItem != null && !selectedItem.CanAfford(playerCurrencies))
                {
                    tooltip.m_text = "$mod_epicloot_merchant_cannotafford";
                }
                else if (!haveSpace)
                {
                    tooltip.m_text = "$mod_epicloot_merchant_noroomtooltip";
                }
            }
        }
Пример #3
0
        public override void RefreshButton(Currencies playerCurrencies)
        {
            var selectedItem = GetSelectedItem();

            MainButton.interactable = selectedItem != null && selectedItem.CanAfford && !selectedItem.AlreadyPurchased;

            var tooltip = MainButton.GetComponent <UITooltip>();

            if (tooltip != null)
            {
                tooltip.m_text = "";
                if (selectedItem != null && !selectedItem.CanAfford)
                {
                    tooltip.m_text = "$mod_epicloot_merchant_cannotafford";
                }
                else if (selectedItem != null && selectedItem.AlreadyPurchased)
                {
                    tooltip.m_text = "$mod_epicloot_merchant_purchasedtooltip";
                }
            }
        }