diff --git a/builtin/common/btn_style.lua b/builtin/common/btn_style.lua index 6a42b8678..25e013824 100644 --- a/builtin/common/btn_style.lua +++ b/builtin/common/btn_style.lua @@ -108,3 +108,13 @@ function checkbox(x, y, name, label, checked, small) x, y - 0.25, small and 4.3 or 7, name ) end +-------------------------------------------------------------------------------- +function scrollbar_style(name, style_type) + return "style" .. (style_type and "_type" or "") .. "[" .. name .. ";scrollbar_bgimg=" .. + button_path .. "scrollbar_bg.png;scrollbar_thumb_top_img=" .. + button_path .. "scrollbar_slider_top.png;scrollbar_thumb_bottom_img=" .. + button_path .. "scrollbar_slider_bottom.png;scrollbar_thumb_img=" .. + button_path .. "scrollbar_slider_middle.png;scrollbar_up_img=" .. + button_path .. "scrollbar_up.png;scrollbar_down_img=" .. + button_path .. "scrollbar_down.png;scrollbar_middle=16]" +end diff --git a/builtin/mainmenu/dlg_config_world.lua b/builtin/mainmenu/dlg_config_world.lua index 9f0cf11e5..325941647 100644 --- a/builtin/mainmenu/dlg_config_world.lua +++ b/builtin/mainmenu/dlg_config_world.lua @@ -180,6 +180,7 @@ local function get_formspec(data) "background9[5.6,0.85;5.8,6;" .. defaulttexturedir_esc .. "worldlist_bg.png;false;40]" .. "tablecolumns[color;tree;text]" .. "tableoptions[background=#0000;border=false]" .. + scrollbar_style("world_config_modlist") .. "table[5.58,0.84;5.59,5.82;world_config_modlist;" .. pkgmgr.render_packagelist(data.list) .. ";" .. data.selected_mod .."]" end diff --git a/builtin/mainmenu/dlg_contentstore.lua b/builtin/mainmenu/dlg_contentstore.lua index 1c2d5c6f2..415256fc5 100644 --- a/builtin/mainmenu/dlg_contentstore.lua +++ b/builtin/mainmenu/dlg_contentstore.lua @@ -381,6 +381,7 @@ function install_dialog.get_formspec() "label[0,0.8;", fgettext("Dependencies:"), "]", "tablecolumns[color;text;color;text]", + scrollbar_style("packages") .. "table[0,1.1;6.25,3;packages;", table.concat(formatted_deps, ","), "]", "container_end[]", diff --git a/builtin/mainmenu/dlg_settings_advanced.lua b/builtin/mainmenu/dlg_settings_advanced.lua index 084a34f96..f1113608a 100644 --- a/builtin/mainmenu/dlg_settings_advanced.lua +++ b/builtin/mainmenu/dlg_settings_advanced.lua @@ -1027,6 +1027,7 @@ local function create_settings_formspec(tabview, _, tabdata) "style[Dsearch_string;border=false;bgcolor=transparent]" .. "field[0.3,0.15;12.0,0.9;Dsearch_string;;" .. core.formspec_escape(search_string) .. "]" .. "field_close_on_enter[Dsearch_string;false]" .. + scrollbar_style("list_settings") .. "table[0,0.8;11.8,3.5;list_settings;" local current_level = 0 diff --git a/builtin/mainmenu/tab_content.lua b/builtin/mainmenu/tab_content.lua index 6692103e1..0ee815257 100644 --- a/builtin/mainmenu/tab_content.lua +++ b/builtin/mainmenu/tab_content.lua @@ -63,6 +63,7 @@ local function get_formspec(tabview, name, tabdata) "background9[0,0.23;5.3,4.46;" .. defaulttexturedir_esc .. "worldlist_bg.png;false;40]" .. "tablecolumns[color;tree;text]" .. "tableoptions[background=#0000;border=false]" .. + scrollbar_style("pkglist") .. "table[0,0.25;5.1,4.3;pkglist;" .. pkgmgr.render_packagelist(packages) .. ";" .. tabdata.selected_pkg .. "]" .. diff --git a/builtin/mainmenu/tab_credits.lua b/builtin/mainmenu/tab_credits.lua index 98190a3bb..378adcdd0 100644 --- a/builtin/mainmenu/tab_credits.lua +++ b/builtin/mainmenu/tab_credits.lua @@ -135,6 +135,7 @@ return { "worldlist_bg.png;false;40]" .. "tablecolumns[color;text]" .. "tableoptions[background=#0000;highlight=#00000000;border=false]" .. + scrollbar_style("list_credits") .. "table[0,1.5;11.75,4.05;list_credits;" .. "#FFFF00," .. fgettext("Core Developers") .. " (MultiCraft),," .. buildCreditList(multicraft_developers) .. ",,," .. diff --git a/builtin/mainmenu/tab_local.lua b/builtin/mainmenu/tab_local.lua index 650261edc..821a21b4e 100644 --- a/builtin/mainmenu/tab_local.lua +++ b/builtin/mainmenu/tab_local.lua @@ -147,6 +147,7 @@ local function get_formspec(_, _, tab_data) "background9[0,0;6.5,4.8;" .. defaulttexturedir_esc .. "worldlist_bg.png;false;40]" .. "tableoptions[background=#0000;border=false]" .. "tablecolumns[" .. image_column(fgettext("Creative mode")) .. ";text]" .. + scrollbar_style("sp_worlds") .. "table[0,0;6.28,4.64;sp_worlds;" .. menu_render_worldlist() .. ";" .. index .. "]" if tab_data.hidden then diff --git a/builtin/mainmenu/tab_local_default.lua b/builtin/mainmenu/tab_local_default.lua index 990c56d23..257f37b0a 100644 --- a/builtin/mainmenu/tab_local_default.lua +++ b/builtin/mainmenu/tab_local_default.lua @@ -106,6 +106,7 @@ local function get_formspec(this) "background9[0,0;6.5,4.8;" .. defaulttexturedir_esc .. "worldlist_bg.png;false;40]" .. "tableoptions[background=#0000;border=false]" .. "tablecolumns[" .. image_column(fgettext("Creative mode")) .. ";text]" .. + scrollbar_style("sp_worlds") .. "table[0,0;6.28,4.64;sp_worlds;" .. menu_render_worldlist() .. ";" .. index .. "]" .. btn_style("switch_local") .. diff --git a/builtin/mainmenu/tab_online.lua b/builtin/mainmenu/tab_online.lua index 2ae12987b..44f1f7fd0 100644 --- a/builtin/mainmenu/tab_online.lua +++ b/builtin/mainmenu/tab_online.lua @@ -113,6 +113,7 @@ local function get_formspec(tabview, name, tabdata) image_column(fgettext("Server mode")) .. ",padding=0.5;" .. "color,span=1;" .. "text,padding=0.5]" .. + scrollbar_style("favorites") .. "table[-0.02,-0.1;6.91,4.87;favorites;" if menudata.search_result then diff --git a/textures/base/pack/gui/scrollbar_down.png b/textures/base/pack/gui/scrollbar_down.png index 6ee8de85d..61b8782c4 100644 Binary files a/textures/base/pack/gui/scrollbar_down.png and b/textures/base/pack/gui/scrollbar_down.png differ diff --git a/textures/base/pack/gui/scrollbar_minus.png b/textures/base/pack/gui/scrollbar_minus.png index 6d16d12e6..1fa5da895 100644 Binary files a/textures/base/pack/gui/scrollbar_minus.png and b/textures/base/pack/gui/scrollbar_minus.png differ diff --git a/textures/base/pack/gui/scrollbar_plus.png b/textures/base/pack/gui/scrollbar_plus.png index cbf5a2d5f..9ef6d6991 100644 Binary files a/textures/base/pack/gui/scrollbar_plus.png and b/textures/base/pack/gui/scrollbar_plus.png differ diff --git a/textures/base/pack/gui/scrollbar_up.png b/textures/base/pack/gui/scrollbar_up.png index 2e53043d4..8904966d3 100644 Binary files a/textures/base/pack/gui/scrollbar_up.png and b/textures/base/pack/gui/scrollbar_up.png differ