@@ -108,6 +108,17 @@ local FMT = {
108
108
arrow = " image_button[%f,%f;0.8,0.8;%s;%s;;;false;%s]" ,
109
109
}
110
110
111
+ local function mul_elem (elem , n )
112
+ local fstr , elems = " " , {}
113
+
114
+ for i = 1 , n do
115
+ fstr = fstr .. " %s"
116
+ elems [i ] = elem
117
+ end
118
+
119
+ return fmt (fstr , unpack (elems ))
120
+ end
121
+
111
122
craftguide .group_stereotypes = {
112
123
dye = " dye:white" ,
113
124
wool = " wool:white" ,
@@ -940,12 +951,12 @@ local function get_panels(data, fs)
940
951
prev_name , PNG .prev , PNG .prev_hover ,
941
952
next_name , PNG .next , PNG .next_hover )
942
953
943
- fs [# fs + 1 ] = fmt (FMT .button .. FMT . button ,
954
+ fs [# fs + 1 ] = fmt (mul_elem ( FMT .button , 2 ) ,
944
955
x_arrow + (is_recipe and xof_r or xof_u ),
945
956
y_arrow , 0.8 , 0.8 , prev_name , " " ,
946
957
x_arrow + 1.8 , y_arrow , 0.8 , 0.8 , next_name , " " )
947
958
else
948
- fs [# fs + 1 ] = fmt (FMT .arrow .. FMT . arrow ,
959
+ fs [# fs + 1 ] = fmt (mul_elem ( FMT .arrow , 2 ) ,
949
960
x_arrow + (is_recipe and xof_r or xof_u ),
950
961
y_arrow , PNG .prev , prev_name , PNG .prev_hover ,
951
962
x_arrow + 1.8 , y_arrow , PNG .next , next_name , PNG .next_hover )
@@ -1000,7 +1011,7 @@ local function make_formspec(name)
1000
1011
PNG .prev , PNG .prev_hover ,
1001
1012
PNG .next , PNG .next_hover )
1002
1013
1003
- fs [# fs + 1 ] = fmt (FMT .button .. FMT . button .. FMT . button .. FMT . button ,
1014
+ fs [# fs + 1 ] = fmt (mul_elem ( FMT .button , 4 ) ,
1004
1015
sfinv_only and 2.6 or 2.54 , - 0.12 , 0.85 , 1 , " search" , " " ,
1005
1016
sfinv_only and 3.3 or 3.25 , - 0.12 , 0.85 , 1 , " clear" , " " ,
1006
1017
sfinv_only and 5.45 or (ROWS * 6.83 ) / 11 , - 0.12 , 0.85 , 1 , " prev_page" , " " ,
@@ -1013,7 +1024,7 @@ local function make_formspec(name)
1013
1024
sfinv_only and 2.6 or 2.54 , PNG .search , PNG .search_hover ,
1014
1025
sfinv_only and 3.3 or 3.25 , PNG .clear , PNG .clear_hover )
1015
1026
1016
- fs [# fs + 1 ] = fmt (FMT .arrow .. FMT . arrow ,
1027
+ fs [# fs + 1 ] = fmt (mul_elem ( FMT .arrow , 2 ) ,
1017
1028
sfinv_only and 5.45 or (ROWS * 6.83 ) / 11 ,
1018
1029
- 0.05 , PNG .prev , " prev_page" , PNG .prev ,
1019
1030
sfinv_only and 7.2 or (ROWS * 8.75 ) / 11 ,
0 commit comments