[1.0.0]LuaControl.set_personal_logistic_slot strange behavior
Posted: Sun Nov 01, 2020 8:02 pm
LuaControl.set_personal_logistic_slot is behaving kind of strange/unexpected:
It seems like it only returns true and updates the UI when min and max are different to the value that was set previously.
If only min changes, then it returns false, but the value is set anyways without updating the UI
If only max changes, it returns false and doesn't update anything
To reproduce:
- start a new game
- /cheat to unlock logistic requests
- open Character gui, logistics tab
- In the console run the following commands:
prints true, character ui updates
Only changing min
prints false, button turns red but the numbers stay at 0 and 1k
- Close/Open the ui: numbers are updated
Only changing max
prints false, numbers stay the same, closing/opening doesn't help
Only changing min and max (since the last command didn't work max is still at 1k)
prints true, gui updates
Only changing min
prints false, button turns to default color, numbers stay at 15 and 2k
- Close/Open the ui: numbers are updated
Changing min and max
prints true, ui updates
Expected behavior: Just work
- Update the values even when only one of them changes, in that case return true and update the UI
It seems like it only returns true and updates the UI when min and max are different to the value that was set previously.
If only min changes, then it returns false, but the value is set anyways without updating the UI
If only max changes, it returns false and doesn't update anything
To reproduce:
- start a new game
- /cheat to unlock logistic requests
- open Character gui, logistics tab
- In the console run the following commands:
Code: Select all
/c game.print(serpent.line(game.player.set_personal_logistic_slot(1, {name = "wooden-chest", min = 0, max = 1000})))
Only changing min
Code: Select all
/c game.print(serpent.line(game.player.set_personal_logistic_slot(1, {name = "wooden-chest", min = 10, max = 1000})))
- Close/Open the ui: numbers are updated
Only changing max
Code: Select all
/c game.print(serpent.line(game.player.set_personal_logistic_slot(1, {name = "wooden-chest", min = 10, max = 2000})))
Only changing min and max (since the last command didn't work max is still at 1k)
Code: Select all
/c game.print(serpent.line(game.player.set_personal_logistic_slot(1, {name = "wooden-chest", min = 15, max = 2000})))
Only changing min
Code: Select all
/c game.print(serpent.line(game.player.set_personal_logistic_slot(1, {name = "wooden-chest", min = 0, max = 2000})))
- Close/Open the ui: numbers are updated
Changing min and max
Code: Select all
/c game.print(serpent.line(game.player.set_personal_logistic_slot(1, {name = "wooden-chest", min = 10, max = 1000})))
Expected behavior: Just work

- Update the values even when only one of them changes, in that case return true and update the UI