private void addIconBases()
        {
            // position of first button = right of chests, below coin slots
            var plot = Constants.IconReplacersPlot;

            int slotOrder = 0;

            foreach (var action in new[]
            {   // order of creation; determines positioning per the ButtonPlot transform
                TIH.Sort,
                TIH.LootAll,
                TIH.DepositAll,    // + smartdep
                TIH.QuickStack,    // + smartloot
                TIH.Rename
            })
            {
                ButtonBases.Add(action, new ChestIconBase(this, plot.GetPosition(slotOrder++), IHBase.ButtonBG));
            }

            // Now create the base for the Cancel Edit Button (a text button),
            // but don't add it to the list yet because it only appears under
            // certain conditions (handle in AddButtonsToBases())

            // Add another half-button-height to prevent overlap
            var nudge = new Vector2(0, Constants.ButtonH / 2);

            CancelEditBase = new TextButtonBase(this, plot.GetPosition(slotOrder) + nudge);
        }
示例#2
0
        protected override void AddBasesToLayer()
        {
            // only two buttons right now; they're just above
            // the coin and ammo slots.

            var plot      = Constants.InventoryButtonsPlot;
            int slotOrder = 0;

            foreach (var tih in new[] {
                TIH.Sort,
                TIH.CleanStacks
            })
            {
                ButtonBases.Add(tih, new IconButtonBase(this, plot.GetPosition(slotOrder++), IHBase.ButtonBG));
            }
        }
        // // // // // // //
        // Create the Sockets
        // // // // // // //

        private void addTextBases()
        {
            // position buttons right of chests, below coin slots

            int slotOrder = 0;

            foreach (var action in new[]
            {                   // order of creation; determines positioning per the ButtonPlot transform
                TIH.LootAll,    // + sort/rsort
                TIH.DepositAll, // + smartdep
                TIH.QuickStack, // + smartloot
            })
            {
                ButtonBases.Add(action, new TextButtonBase(this, Constants.TextReplacersPlot.GetPosition(slotOrder++)));
            }
        }