Пример #1
0
        public ItemstackComponentBase(ICoreClientAPI capi) : base(capi)
        {
            this.capi = capi;

            dummyInv = new DummyInventory(capi);
            dummyInv.OnAcquireTransitionSpeed = (transType, stack, mul) =>
            {
                return(0);
            };
            renderedTooltipSlot = new DummySlot(null, dummyInv);

            stackInfoBounds =
                ElementBounds
                .FixedSize(EnumDialogArea.None, GuiElementItemstackInfo.BoxWidth, 0)
                .WithFixedPadding(10)
                .WithFixedPosition(20, 40)
            ;

            parentBounds = ElementBounds.Fixed(0, 0, 1, 1);
            parentBounds.WithParent(ElementBounds.Empty);
            stackInfoBounds.WithParent(parentBounds);

            stackInfo = new GuiElementItemstackInfo(capi, stackInfoBounds, OnRequireInfoText);
            stackInfo.SetSourceSlot(renderedTooltipSlot);
            stackInfo.ComposeElements(null, null);
            stackInfo.RecompCheckIgnoredStackAttributes = GlobalConstants.IgnoredStackAttributes;
        }