示例#1
0
 /*********
 ** Public methods
 *********/
 public MenuFavoritesExtras(IMod env, FarmerMakeup makeup)
     : base(env, 0, 0,
            width: 700 + s_borderSize,
            height: 580 + s_borderSize
            )
 {
     m_farmerMakeup = makeup;
     updateLayout();
 }
 /*********
 ** Public methods
 *********/
 public MenuFavorites(IMod env, FarmerMakeup makeup, IClickableMenu parent)
     : base(env, 0, 0,
            width: 700 + s_borderSize,
            height: 580 + s_borderSize
            )
 {
     m_farmerMakeup = makeup;
     m_parent       = parent;
     updateLayout();
 }
        /*********
        ** Public methods
        *********/
        public MenuCustomize(IMod env, GlobalConfig globalConfig, LocalConfig playerConfig, FarmerMakeup farmerMakeup, IClickableMenu parent = null)
            : base(env, 0, 0,
                   width: 700 + s_borderSize,
                   height: 580 + s_borderSize
                   )
        {
            m_drawCursor   = false;
            m_globalConfig = globalConfig;
            m_farmerMakeup = farmerMakeup;
            m_parent       = parent;
            exitFunction   = exit;
            m_menuTextures = Game1.content.Load <Texture2D>(ContentHelper.s_MenuTextureKey);

            updateLayout();
        }
示例#4
0
        /*********
        ** Public methods
        *********/
        /// <summary>Construct an instance.</summary>
        /// <param name="contentHelper">Encapsulates the underlying mod texture management.</param>
        /// <param name="modHelper">Provides simplified APIs for writing mods.</param>
        /// <param name="modVersion">The current mod version.</param>
        /// <param name="globalConfig">The global config settings.</param>
        /// <param name="playerConfig">The current per-save config settings.</param>
        /// <param name="zoomLevel">The zoom level before the menu was opened.</param>
        public MenuFarmerMakeup(IMod env, FarmerMakeup farmerMakeup, GlobalConfig globalConfig)
            : base(env, 0, 0,
                   width: 700 + s_borderSize,
                   height: 580 + s_borderSize
                   )
        {
            // save metadata
            m_globalConfig          = globalConfig;
            m_farmerMakeup          = farmerMakeup;
            m_farmerMakeup.m_farmer = Game1.player;
            m_playerZoomLevel       = Game1.options.zoomLevel;
            exitFunction            = exit;
            m_menuTextures          = Game1.content.Load <Texture2D>(ContentHelper.s_MenuTextureKey);

            // build menu
            Game1.player.faceDirection(2);
            Game1.player.FarmerSprite.StopAnimation();

            if (m_globalConfig.MenuZoomLock)
            {
                Game1.options.zoomLevel = m_globalConfig.MenuZoomOut ? 0.75f : 1f;
            }
            Game1.overrideGameMenuReset = true;
            Game1.game1.refreshWindowSettings();
            m_tabs.Add(new MenuCustomize(env, globalConfig, m_farmerMakeup.m_config, m_farmerMakeup, this));
            m_tabParents.Add(-1);
            m_tabs.Add(null);
            m_tabParents.Add(-1);
            m_tabs.Add(new MenuFavorites(env, m_farmerMakeup, this));
            m_tabParents.Add((int)MenuTab.ManageFavorites);
            m_tabs.Add(new MenuFavoritesExtras(env, m_farmerMakeup));
            m_tabParents.Add((int)MenuTab.ManageFavorites);
            m_tabs.Add(new MenuAbout(env, globalConfig, ref m_playerZoomLevel));
            m_tabParents.Add(-1);

            this.updateLayout();
        }
 public LoadMenuPatcher(IMod env, FarmerMakeup farmerPatcher)
 {
     m_env           = env;
     m_farmerPatcher = farmerPatcher;
 }