GuiEvents
基本信息
| 属性 |
值 |
| 路径 |
baubles.client.gui.GuiEvents |
| 类型 |
class |
| 包名 |
baubles.client.gui |
监听事件
| 事件 |
处理 |
GuiScreenEvent.InitGuiEvent.Post |
在原版 inventory 与扩展 baubles GUI 上添加 GuiBaublesButton |
GuiScreenEvent.ActionPerformedEvent.Post |
处理 baubles 按钮点击(开/关 baubles GUI 与 inventory GUI) |
行为
InitGuiEvent.Post
- 仅当当前 GUI 是
GuiInventory 或 GuiPlayerExpanded 时处理
- 计算 GUI 左上角
guiLeft、guiTop
- 若玩家有 active potion effect 且 NEI 隐藏:把 GUI 向左移动以给药水面板腾位置
- 添加按钮:
- 在
GuiInventory 上显示 tooltip "button.baubles"(“Baubles”)
- 在
GuiPlayerExpanded 上显示 tooltip "button.normal"(“Normal”)
- 旧版按钮位置
(guiLeft+66, guiTop+9),新版 (guiLeft+26, guiTop+9),由 BaublesConfig.useOldGuiButton 切换
ActionPerformedEvent.Post
- 在
GuiInventory 上点击 id=55 的按钮:
- 在
GuiPlayerExpanded 上点击 id=55 的按钮:
NEI 反射
isNeihidden() 通过反射调用 codechicken.nei.NEIClientConfig.isHidden 检测 NEI 是否隐藏;隐藏时 guiLeft 计算不偏移。
相关条目