Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(button): 针对翻页GUI中,添加物品时,物品(按钮)的类型限定有误。 #33

Open
CarmJos opened this issue Jan 16, 2025 · 3 comments

Comments

@CarmJos
Copy link

CarmJos commented Jan 16, 2025

Image

塞入的物品必须要继承于 Button 而导致无法正常使用。

@huanmeng-qwq
Copy link
Owner

huanmeng-qwq commented Jan 16, 2025

感谢您的错误报告
该类型将修改为List<Button>
另外:
修改page中的items应使用PageArea#items(List)GuiPage#setAllItems link
如果创建的GuiPage可以使用GuiPage#defaultPageArea获取PageArea

@CarmJos
Copy link
Author

CarmJos commented Jan 16, 2025

关于PagedGUI中的物品,如果我期望从物品列表中删除一个物品,难道需要全部重新设置吗。

@huanmeng-qwq
Copy link
Owner

可以使用下面的方法修改:

PageArea area;
area.items().remove(...); // 删除元素

gui.refresh(true);// 立即刷新gui

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants