TabooLib / taboolib

Powerful framework for creating multi-platform Minecraft plugin

Home Page:https://tabooproject.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

多页菜单监听失败

BingZi-233 opened this issue · comments

在使用方法
onClick { it -> ******** }
中,无法监听到上下页按钮,以及自定义按钮点击事件。其他的都正常

commented

上下页以及自定义按钮被自身的事件接管,无法通过onClick监听。具体实现:

            onClick(lock = true) {
                // 成员
                if (objectsMap.containsKey(it.rawSlot)) {
                    this@Linked.onClick(it, objectsMap[it.rawSlot]!!)
                } 
                // 自定义按钮(上下页)
                else if (button.containsKey(it.rawSlot)) {
                    button[it.rawSlot]!!(it)
                } 
                // 你的 onClick 方法
                else {
                    onClickGeneral(it)
                }
            }

https://github.com/TabooLib/TabooLib/blob/2421d9ba33daea821633d8ab260ea38ce8046ae4/module-ui/src/main/kotlin/taboolib/module/ui/type/Linked.kt#L165