跳到主要内容

hideWhen()

showWhen() 的反向操作:当复选框已勾选或选中某个选项时隐藏项目。因此,当复选框未勾选,或选中任何其他选项时,它会显示。

签名​

hideWhen(checkBoxId: number): DialogComponent
hideWhen(radioGroupId: number, optionId: number): DialogComponent

返回值

同一个项目,因此可以链式调用

示例​

Dialog:add(CheckBox(1, "Use the default Attack position", true))
-- Only asked when the box is not ticked
Dialog:add(TapPicker(2, "Tap the Attack button"):hideWhen(1))

在块编辑器中,这对应于 show when 的 not checked 或 not option id。