From 22dd2acbdf7ec0b98184b84612bb2d608d9a665a Mon Sep 17 00:00:00 2001 From: Hans Henrik Bergan Date: Fri, 2 Jan 2026 22:44:21 +0100 Subject: [PATCH] bot item list scroll to bottom on new entry previously when adding a new item to a large list, the list would practically scroll to the top each time. for very long lists with a lot of stuff to add, this becomes increasingly annoying and time-consuming for each new entry. for small lists, it makes no difference. --- mods/game_bot/functions/ui_elements.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mods/game_bot/functions/ui_elements.lua b/mods/game_bot/functions/ui_elements.lua index 31c2a438c6..76672c1190 100644 --- a/mods/game_bot/functions/ui_elements.lua +++ b/mods/game_bot/functions/ui_elements.lua @@ -25,6 +25,13 @@ UI.Container = function(callback, unique, parent, widget) local oldItems = {} + local scrollToBottom = function() + local scrollbar = widget.scroll + if scrollbar and scrollbar.setValue and scrollbar.getMaximum then + scrollbar:setValue(scrollbar:getMaximum()) + end + end + local updateItems = function() local items = widget:getItems() @@ -71,6 +78,7 @@ UI.Container = function(callback, unique, parent, widget) for i, child in ipairs(widget.items:getChildren()) do child.onItemChange = updateItems end + scrollToBottom() end widget.getItems = function()