Пример #1
0
        /// <summary>Perform the action associated with a component.</summary>
        /// <param name="cpt">The component.</param>
        /// <return>whether the component action is processed</return>
        public override bool handleLeftClick(IAutoComponent cpt)
        {
            switch (cpt.m_name)
            {
            case "Save":
                if (m_currentFav > -1)
                {
                    m_farmerMakeup.SaveFavorite(m_currentFav + 1);
                    m_extraFavButtons[m_currentFav - 6].sourceRect.Y = 26;
                    m_alerts.Add(new Alert(Game1.mouseCursors, new Rectangle(310, 392, 16, 16), Game1.viewport.Width / 2 - (700 + IClickableMenu.borderWidth * 2) / 2, Game1.viewport.Height / 2 - (500 + IClickableMenu.borderWidth * 2) / 2, "Favorite Saved To Slot " + (m_currentFav + 1) + " .", 1200, false));
                    Game1.playSound("purchase");
                }
                return(true);

            case "Load":
                if (m_currentFav > -1)
                {
                    if (m_farmerMakeup.LoadFavorite(m_currentFav + 1))
                    {
                        Game1.playSound("yoba");
                    }
                    else
                    {
                        m_alerts.Add(new Alert(Game1.mouseCursors, new Rectangle(268, 470, 16, 16), Game1.viewport.Width / 2 - (700 + IClickableMenu.borderWidth * 2) / 2, Game1.viewport.Height / 2 - (500 + IClickableMenu.borderWidth * 2) / 2, "Uh oh! No Favorite is Set!", 1000, false));
                    }
                }
                return(true);

            case "Fav":
                ClickableTextureButton btn = (ClickableTextureButton)cpt;
                int i = btn.m_par;
                if (m_currentFav == -1)
                {
                    m_selectFavLabel.visible = false;
                    m_saveLabel.visible      = true;
                    m_loadLabel.visible      = true;
                    m_saveFavButton.visible  = true;
                    m_loadFavButton.visible  = true;
                }
                else
                {
                    m_extraFavButtons[m_currentFav - 6].drawShadow = false;
                }
                m_extraFavButtons[i].drawShadow = true;
                m_currentFav      = i + 6;
                m_saveLabel.label = "Currently selected: " + (m_currentFav + 1) + ".";
                return(true);

            default:
                return(false);
            }
        }
Пример #2
0
        /// <summary>Perform the action associated with a component.</summary>
        /// <param name="cpt">The component.</param>
        /// <return>whether the component action is processed</return>
        public override bool handleLeftClick(IAutoComponent cpt)
        {
            switch (cpt.m_name)
            {
            case "QFav":
                ClickableTextureButton btn = (ClickableTextureButton)cpt;
                m_farmerMakeup.SaveFavorite(btn.m_par + 1);
                this.m_alerts.Add(new Alert(Game1.mouseCursors, new Rectangle(310, 392, 16, 16), Game1.viewport.Width / 2 - (700 + IClickableMenu.borderWidth * 2) / 2, Game1.viewport.Height / 2 - (500 + IClickableMenu.borderWidth * 2) / 2, "New Favorite Saved.", 1200, false));
                Game1.playSound("purchase");
                return(true);

            default:
                return(false);
            }
        }