Skip to content

Commit 910ba9b

Browse files
committed
🚑️(coreMindustry/menu) info.attrs更新
1 parent 167dbf1 commit 910ba9b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

scripts/coreMindustry/menu.kts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package coreMindustry
22

3+
import coreLibrary.lib.Commands.Hidden
4+
35
data class MenuChooseEvent(
46
val player: Player, val menuId: Int, val value: Int
57
) : Event, ReceivedEvent {
@@ -22,7 +24,9 @@ onEnable {
2224
val player = player ?: return@impl
2325

2426
var commands = cmds.subCommands().values.toSet().sortedBy { it.name }
25-
if (!showAll) commands = commands.filter { info -> info.attrs.all { it.visible(this) } }
27+
if (!showAll) commands = commands.filter { info ->
28+
info.attrs.all { it !is Hidden || it.visible() }
29+
}
2630
MenuV2(player) {
2731
title = if (prefix.isEmpty()) "Help" else "Help: $prefix"
2832
msg = "点击选项将直接执行指令"

0 commit comments

Comments
 (0)