[2.0.43] "list-box" GUI elements ignore "enabled" property
Posted: Wed Apr 02, 2025 1:05 pm
GUI elements with the "list-box" type always behave as if they are "enabled", regardless of the value of the property. For comparison, a "drop-down" element with the same properties behaves as expected:
Toggling "enabled" for each, the drop-down becomes interactable or not, as expected. The list-box always behaves as if "enabled":
Code: Select all
game.player.gui.screen.add{name="test", type="frame", caption="list-box test"}
e1 = game.player.gui.screen["test"].add{type="list-box", items={"one","two","three"}, enabled=false}
e2 = game.player.gui.screen["test"].add{type="drop-down", items={"one","two","three"}, enabled=false}
script.on_event(defines.events.on_gui_selection_state_changed, function(event) game.print(serpent.line(event)) end)
Code: Select all
e1.enabled = true
e2.enabled = true