Page 1 of 1

[1.1.88] adding LuaGuiElement of type=slider doesn't immediately respect enabled attribute

Posted: Sun Jul 30, 2023 8:11 am
by commanderguy3001
When adding a new LuaGuiElement of type slider, either through a mod or via command ingame, the slider will disregard the `enabled` attribute when adding it.

Actual behavior: No matter if this attribute is set to true or false, the slider will be enabled in the GUI and will function as if it was enabled.

Expected behaviour: The slider accurately reflects the current setting of the `enabled` attribute at any point in time.

Minimal example to reproduce:
- start a new default settings save file
- run the below code in game in the chat/command line:

Code: Select all

/c
local player=game.player
local gui=player.gui
local screen=gui.screen
local slider = screen.add{
  type="slider",
  name="bugged_slider",
  minimum_value=0,
  maximum_value=10,
  enabled=false
}
This will create a slider in the top left of the screen that the user can interact with despite having `enabled=false`.

To verify if the slider should actually be disabled:

Code: Select all

/c
local player=game.player
local gui=player.gui
local screen=gui.screen
local slider=screen.bugged_slider
game.player.print(slider.enabled)
which outputs `false` as expected.

Workaround to the problem:

Code: Select all

/c
local player=game.player
local gui=player.gui
local screen=gui.screen
local slider=screen.bugged_slider
slider.enabled=false
The above code will disable the slider as expected.

Re: [1.1.88] adding LuaGuiElement of type=slider doesn't immediately respect enabled attribute

Posted: Mon Jul 31, 2023 4:08 pm
by Rseding91
Thanks for the report. It's now fixed for the next release.