From 16f8808d922aa84415d0ce9e5a9f1dd74b1fcdba Mon Sep 17 00:00:00 2001 From: Maksym H Date: Tue, 25 Apr 2023 21:05:45 +0300 Subject: [PATCH] Change main menu scrollbar style --- builtin/common/btn_style.lua | 10 ++++++++++ builtin/mainmenu/dlg_config_world.lua | 1 + builtin/mainmenu/dlg_contentstore.lua | 1 + builtin/mainmenu/dlg_settings_advanced.lua | 1 + builtin/mainmenu/tab_content.lua | 1 + builtin/mainmenu/tab_credits.lua | 1 + builtin/mainmenu/tab_local.lua | 1 + builtin/mainmenu/tab_local_default.lua | 1 + builtin/mainmenu/tab_online.lua | 1 + textures/base/pack/gui/scrollbar_down.png | Bin 480 -> 447 bytes textures/base/pack/gui/scrollbar_minus.png | Bin 465 -> 475 bytes textures/base/pack/gui/scrollbar_plus.png | Bin 479 -> 490 bytes textures/base/pack/gui/scrollbar_up.png | Bin 487 -> 473 bytes 13 files changed, 18 insertions(+) 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 6ee8de85dff3d9b87db67543001ea3751f1f22e2..61b8782c425fe22ecafe2ad4ee2ca8ea86e9d37e 100644 GIT binary patch delta 421 zcmV;W0b2gx1HS{1B!5CsOjJbx004cK;+U-Hkfr8INqA3j%m4rXh@a&sRFtv7?xeQs zY;2{((DLEs>Op0`Zi?RR@A870<6L~yHCe6N;rA|IsI(2rIsgCw0d!JMQvg8b*k%9# z0V_#FK~#8Nz0%oogD?z*;dojLh4}g4* z&;T$u9|9o{w68EP6Y*LO7={S2-Bbgi0hEdRy=jb50VwD2gr)fvz)10VKIZwjr41M} zj^3vcQ*rJ+=6}inpBKPwdEBpF_!_Dpa9em9v)*Z0021^#v;Hk8abG?$<5bt P00000NkvXXu0mjfzlFXr delta 454 zcmV;%0XhD^1KL z1!8}GyYc*TQA!4wCI+5F{wFKWWdTJGxh9&;F#n)9A;KX*vComXhNpa1{>07*qoM6N<$f;@oHTmS$7 diff --git a/textures/base/pack/gui/scrollbar_minus.png b/textures/base/pack/gui/scrollbar_minus.png index 6d16d12e61903171d26a1c1dae5b8cbc29cb544a..1fa5da895a84cd569faee53f717994f6d810d0cc 100644 GIT binary patch delta 449 zcmV;y0Y3iG1KR_TB!5>>OjJex|NmHu(mi#=E?=mz!S2M+@}#!wn5^i3nBs1V-cNDM z+Tr*A|NnxTHgn!|H$V?%_{mp45|e81U|VpCy2~QUO81jW}rR%=rRA5QaiTEip+t zJ$?#T;QIFkft|+#+yqx3O{EM1cN}$UXP5&JLI2pY3C@5JHV}=D=k7 z11I>jKrb8c{f`UuiwJuF76pJSUr_d?0x-@pON;vAQNL2!=DI8Z<1Qdb$D=tBka?hGnXi3oZ;N$bg$U@pC@c%( z<;DaXkojor&l)mZp#J-U059=30zn3(?K%4R=m-+f&86WyU&wC*;5Zz>vhW3#=4cE! z5($t1V7^1}0e_vp28g2j0mW($0;DbAv+vmehCkZlfH+UkW%s0j&QVmZto2b_Dz zswz*S04?D-XC5>wDGWWYEIB}uINH&N?Me$J4$u*<1~3F8gn6D*0VQnP-N~E80+218 hLx=#7-O51(;2*4i%+X7VecJ#4002ovPDHLkV1l3l)5QP) diff --git a/textures/base/pack/gui/scrollbar_plus.png b/textures/base/pack/gui/scrollbar_plus.png index cbf5a2d5f900efe1a2efda37aa3ef10b83187489..9ef6d69911f4eb35cb66a2e29bc0480791f9deff 100644 GIT binary patch delta 464 zcmV;>0WbdF1L^~iB!5>>OjJex|NmcizK5UXL}NMf%hMU#J+;*h20eU{=KJZkFi_LZvWPjSoI;rA|Is6l1EF;%T@ zir$=^W10W}00DGTPE!Ct=GbNc00BWsL_t(|Ud7hQa)dApMSoGuJk#@#Je}NPuFccLG-w4(Pf$a8>OO2vc}D z7YINMP!0`1k4GC=m0IuQCWrp zgrKj@T9uLR@kaHlZ zku;x2767UDKl(rk`W&ONEpXoy0gTX?<~BgOF?o{5Ccrnb-@5a4LzQy?0000&l{b;TXt|9?TRL#DY*uIHWQi(&n7 z*kb=n1(6}JUbjzMpdM%dIv(%f4(xVJs0d*kHO(HZ0oWuiPdBNFnD7TKpjFik256cG zAYlr$Ed!SeZ3IRJFb7}*YD`pBOsrszNzBmptu2mk||s{j)h z$Q9sR29iWoIe!Cv|8=0Q^^;gGFpk*+@E%wT^vb{)@&$(BW8f?-8KCD3sID^wfPtWf z5kjEr@Ii`dSSm2WO9K%DHDwEgzX|I01Q*Rq`FqVNZp&^Si`YytS$fj*{~8v}HaIOg0N;ESjuw}?vM v+!f#<8!2UCh5~$n)sKj=DKPy?0oK49xr5^&wpp*{00000NkvXXu0mjfGlbC- diff --git a/textures/base/pack/gui/scrollbar_up.png b/textures/base/pack/gui/scrollbar_up.png index 2e53043d44687b6b02ed4fe24817feb2b207eeeb..8904966d3d060b5bb0b5722d58ecf08c49d2b599 100644 GIT binary patch delta 442 zcmV;r0Y(1j1K9(RDSrR}0Fb5T|NsAgnBq@y%WjI^E?=nH;rCp8)Um06`0W zY|SUyR#E_{pI8$cuog410-NWu6ai>n#fZR;h`I(s0KmDmO|zb;hJX+Q()n^wN_gLO z5&(Q(Rq=5i@g4{fAoO>>CUIN~;M09Z4_N<^JkT@%r1O5Kl+XeA+*(Fx0HGzu=MX2B zm>e(+0PqJ`ihn;s6X5gv-CAWJWDEf`XT%!;S`zShSo=PJ&jCP!0Au8UwoL&XZQ&dV zb--p*1?U@}FS~^LULU~uE};U10Qey;*BME}AO-_+Qm8^4J*ripc?) kIY)?)0m>6~*hC2c--_1DiC2dXIsgCw07*qoM6N<$f?3AL2mk;8 delta 456 zcmV;(0XP2H1Lp&fDS!X}|FOaDZi?Q-(DHwn;*h20PjSnAmg4{a|6F|3C{&cBw(Blm zsFzBqQ6O$4MH$Y<~mez@Y3C`6Z^*tB{PfEeIX}^QI93gX>N} zS|12bKnRS>fv~pgxPb6{mrFW-t&|ehg5Uze^X1cRh7F*(4|2Km5*&aKN~LqRQ9@J! z@_EywL?ys?jelkHSWe(HAJF#z=mIoH`6bQ(Xnwzgs0jFsA%NxyaUwu-0-jG0=K%RU z03Zl3h7TCWzW|M>Fb7c|Xo}Sa@Qh!pO+M%91DJ0URRCWAKupELoEy;E_>O!m#y3se zz=6+|8PJ-5$D=%d13oT5%5emN_Q#mtZULBQ4nWEP5J6E2bAA8>+M8m|4`@w9Da@VY y1Z+~fl3ki&KQTU_JkJpjJiu_EZfSnU0Q>^klhvXAdIov`0000