Esempio n. 1
0
        private void OnClickNode(UIMouseEvent evt, UIElement listeningElement, ItemNode node)
        {
            int points = 0;

            if (node.IsAscend)
            {
                points = m_itemSource.GetAscendPoints;
            }
            else
            {
                points = m_itemSource.GetEvolutionPoints;
            }
            switch (node.CanAddLevel(points))
            {
            case ItemReason.CanUpgrade:
                m_itemSource.SpendPoints(node.GetRequiredPoints, node.IsAscend);
                node.AddLevel();

                UpdateToolTip(node);
                UpdateValue();
                Main.PlaySound(SoundID.CoinPickup);
                break;

            default:
                Main.PlaySound(SoundID.MenuClose);
                break;
            }
        }