/// Use a generator function to seamlessly create and initialize a new
        /// instance of this Button Layer.
        public static ChestButtonReplacerLayer New(bool text)
        {
            var newThis = new ChestButtonReplacerLayer(text);

            newThis.Initialize();
            return(newThis);
        }
Example #2
0
        private void InitButtons()
        {
            KEP            = new KeyEventProvider();
            ButtonStore    = new Dictionary <string, ICoreButton>();
            ButtonUpdates  = new Stack <string>();
            ButtonTooltips = new Stack <string>();

            // TODO: does doing this here also make the mp-server freak out (since it'll be loading textures)?
            if (ModOptions["InvButtons"])
            {
                InventoryButtons = InventoryButtonLayer.New();
            }

            // if (ModOptions["TextReplacers"])
            ReplacerButtons = ChestButtonReplacerLayer.New(ModOptions["UseReplacers"]);
            // else if (ModOptions["IconReplacers"])

            // Initialize the action ModifyInterfaceLayerList will use
            IHInterface.Initialize();
        }