public void OnRenderInteractiveElements(ICoreClientAPI api, float deltaTime)
        {
            if (!composed)
            {
                Recompose();
            }

            accum1Sec += deltaTime;
            if (accum1Sec > 1)
            {
                var expireText = auction.GetExpireText(api);
                if (expireText != prevExpireText)
                {
                    expireTextElem.Components = VtmlUtil.Richtextify(api, expireText, CairoFont.WhiteDetailText().WithFontSize(14));
                    expireTextElem.RecomposeText();
                    prevExpireText = expireText;
                }
            }

            if (scissorBounds.InnerWidth <= 0 || scissorBounds.InnerHeight <= 0)
            {
                return;
            }

            // 1. Itemstack
            api.Render.PushScissor(scissorBounds, true);
            api.Render.RenderItemstackToGui(dummySlot, scissorBounds.renderX + iconSize / 2, scissorBounds.renderY + iconSize / 2, 100, iconSize * 0.55f, ColorUtil.WhiteArgb, true, false, true);
            api.Render.PopScissor();
            api.Render.Render2DTexturePremultipliedAlpha(hoverTexture.TextureId, scissorBounds.renderX, scissorBounds.renderY, scissorBounds.OuterWidth, scissorBounds.OuterHeight);

            // 2. ItemStack name, price and expire
            stackNameTextElem.RenderInteractiveElements(deltaTime);
            priceTextElem.RenderInteractiveElements(deltaTime);
            expireTextElem.RenderInteractiveElements(deltaTime);
            MouseOverCursor = expireTextElem.MouseOverCursor;

            sellerTextElem.RenderInteractiveElements(deltaTime);



            // 5. Hover overlay
            int   dx  = api.Input.MouseX;
            int   dy  = api.Input.MouseY;
            Vec2d pos = Bounds.PositionInside(dx, dy);

            if (Selected || (pos != null && IsPositionInside(api.Input.MouseX, api.Input.MouseY)))
            {
                api.Render.Render2DTexturePremultipliedAlpha(hoverTexture.TextureId, Bounds.absX, Bounds.absY, Bounds.OuterWidth, Bounds.OuterHeight);
                if (Selected)
                {
                    api.Render.Render2DTexturePremultipliedAlpha(hoverTexture.TextureId, Bounds.absX, Bounds.absY, Bounds.OuterWidth, Bounds.OuterHeight);
                }
            }
        }
        public AuctionCellEntry(ICoreClientAPI capi, ElementBounds bounds, Auction auction, Action <int> onClick) : base(capi, bounds)
        {
            iconSize = (float)scaled(unscaledIconSize);

            dummySlot    = new DummySlot(auction.ItemStack);
            this.onClick = onClick;
            this.auction = auction;

            CairoFont font = CairoFont.WhiteDetailText();
            double    offY = (unScaledCellHeight - font.UnscaledFontsize) / 2;

            scissorBounds = ElementBounds.FixedSize(unscaledIconSize, unscaledIconSize).WithParent(Bounds);
            var stackNameTextBounds = ElementBounds.Fixed(0, offY, 270, 25).WithParent(Bounds).FixedRightOf(scissorBounds, 10);
            var priceTextBounds     = ElementBounds.Fixed(0, offY, 75, 25).WithParent(Bounds).FixedRightOf(stackNameTextBounds, 10);
            var expireTextBounds    = ElementBounds.Fixed(0, 0, 160, 25).WithParent(Bounds).FixedRightOf(priceTextBounds, 10);
            var sellerTextBounds    = ElementBounds.Fixed(0, offY, 110, 25).WithParent(Bounds).FixedRightOf(expireTextBounds, 10);



            stackNameTextElem = new GuiElementRichtext(capi, VtmlUtil.Richtextify(capi, dummySlot.Itemstack.GetName(), font), stackNameTextBounds);

            double    fl        = font.UnscaledFontsize;
            ItemStack gearStack = capi.ModLoader.GetModSystem <ModSystemAuction>().SingleCurrencyStack;
            var       comps     = new RichTextComponentBase[] {
                new RichTextComponent(capi, "" + auction.Price, font)
                {
                    PaddingRight = 10, VerticalAlign = EnumVerticalAlign.Top
                },
                new ItemstackTextComponent(capi, gearStack, fl * 2.5f, 0, EnumFloat.Inline)
                {
                    VerticalAlign = EnumVerticalAlign.Top, offX = -scaled(fl * 0.5f), offY = -scaled(fl * 0.75f)
                }
            };

            priceTextElem  = new GuiElementRichtext(capi, comps, priceTextBounds);
            expireTextElem = new GuiElementRichtext(capi, VtmlUtil.Richtextify(capi, prevExpireText = auction.GetExpireText(capi), font.Clone().WithFontSize(14)), expireTextBounds);
            expireTextElem.BeforeCalcBounds();
            expireTextBounds.fixedY = 5 + (25 - expireTextElem.TotalHeight / RuntimeEnv.GUIScale) / 2;


            sellerTextElem = new GuiElementRichtext(capi, VtmlUtil.Richtextify(capi, auction.SellerName, font.Clone().WithOrientation(EnumTextOrientation.Right)), sellerTextBounds);

            hoverTexture = new LoadedTexture(capi);
        }