inventory-framework icon indicating copy to clipboard operation
inventory-framework copied to clipboard

Allow paginated item slot be manually changed

Open DevNatan opened this issue 2 years ago • 0 comments

First, a few things...

  • [X] Is your feature request related to a problem?
  • [ ] Will this feature just help you or is it something everyone needs?
  • [ ] Have you tried to implement or draft this feature?
  • [ ] Is your feature a breaking change?

😄 Describe the solution you'd like

As described here https://github.com/DevNatan/inventory-framework/issues/245#issuecomment-1259535333 there's a need that the slots of paginated items are defined by themselves during their rendering

Allowing use of withSlot on onItemRender solves the problem

override fun onItemRender(_: PaginatedViewSlotContext<*>, item: ViewItem, _: *) {
    val x: Int = TODO("Developer can define this somehow")
    item.withSlot(x)
}

🧠 Describe alternatives you've considered

No response

🤚 Drawbacks

No response

💻 Platform

  • [ ] Bukkit
  • [ ] Sponge
  • [ ] Other
  • [X] All

⭐ Version

2.5.4-rc.1

✍️ Additional context

No response

DevNatan avatar Sep 27 '22 13:09 DevNatan