Read base game setting to keep player's inventory sorted
Posted: Mon Jun 15, 2020 9:45 am
Hi,
Currently I'm making some gui that contains the player inventory. When clicking a button, some item stacks go into the inventory, some go out of it. At the end of the button event, I'm redrawing the player's inventory. However, the player inventory is "unsorted" at this point, it is at the same stage where I left it after moving items around.
Depending on the player settings (see picture), this could be fine. The issue is, when the player has the setting enabled to always keep the player's main inventory sorted, I can solve this by calling sort_and_merge() on the inventory, however, when the player has this setting disabled, this becomes unwanted behaviour.
Hence my request to allow reading the "Always keep player's main inventory sorted" setting.
Currently I'm making some gui that contains the player inventory. When clicking a button, some item stacks go into the inventory, some go out of it. At the end of the button event, I'm redrawing the player's inventory. However, the player inventory is "unsorted" at this point, it is at the same stage where I left it after moving items around.
Depending on the player settings (see picture), this could be fine. The issue is, when the player has the setting enabled to always keep the player's main inventory sorted, I can solve this by calling sort_and_merge() on the inventory, however, when the player has this setting disabled, this becomes unwanted behaviour.
Hence my request to allow reading the "Always keep player's main inventory sorted" setting.