private IGuiElementCell createCell(Auction auction, ElementBounds bounds) { bounds.fixedPaddingY = 0; var cellElem = new AuctionCellEntry(capi, bounds, auction, didClickAuctionElem); return(cellElem); }
private void didClickAuctionElem(int index) { if (selectedElem != null) { selectedElem.Selected = false; } if (index >= 0) { selectedElem = SingleComposer.GetCellList <Auction>("stacklist").elementCells[index] as AuctionCellEntry; selectedElem.Selected = true; } if (curTab == 2) { var auction = selectedElem?.auction; bool sold = auction?.State == EnumAuctionState.Sold || auction?.State == EnumAuctionState.SoldRetrieved; SingleComposer.GetButton("cancelAuction").Visible = auction?.State == EnumAuctionState.Active; SingleComposer.GetButton("retrieveItems").Visible = auction?.State == EnumAuctionState.Expired || (sold && auction.SellerUid != capi.World.Player.PlayerUID); SingleComposer.GetButton("collectFunds").Visible = sold && auction.SellerUid == capi.World.Player.PlayerUID; } }