@@ -779,46 +779,40 @@ local function get_output_fs(data, fs, L)
779
779
end
780
780
781
781
local pos_x = L .rightest + L .btn_size + 0.1
782
- local pos_y = YOFFSET + (sfinv_only and 0.25 or - 0.45 )
782
+ local pos_y = YOFFSET + (sfinv_only and 0.25 or - 0.45 ) + L . spacing
783
783
784
784
if sub (icon , 1 , 18 ) == " craftguide_furnace" then
785
785
fs [# fs + 1 ] = fmt (FMT .animated_image ,
786
- pos_x , pos_y + L . spacing , 0.5 , 0.5 , PNG .furnace_anim , 8 , 180 )
786
+ pos_x , pos_y , 0.5 , 0.5 , PNG .furnace_anim , 8 , 180 )
787
787
else
788
- fs [# fs + 1 ] = fmt (FMT .image , pos_x , pos_y + L . spacing , 0.5 , 0.5 , icon )
788
+ fs [# fs + 1 ] = fmt (FMT .image , pos_x , pos_y , 0.5 , 0.5 , icon )
789
789
end
790
790
791
791
local tooltip = custom_recipe and custom_recipe .description or
792
792
L .shapeless and S " Shapeless" or S " Cooking"
793
793
794
- fs [# fs + 1 ] = fmt (FMT .tooltip , pos_x , pos_y + L . spacing , 0.5 , 0.5 , ESC (tooltip ))
794
+ fs [# fs + 1 ] = fmt (FMT .tooltip , pos_x , pos_y , 0.5 , 0.5 , ESC (tooltip ))
795
795
end
796
796
797
797
local arrow_X = L .rightest + (L ._btn_size or 1.1 )
798
798
local output_X = arrow_X + 0.9
799
+ local Y = YOFFSET + (sfinv_only and 0.7 or 0 ) + L .spacing
799
800
800
- fs [# fs + 1 ] = fmt (FMT .image ,
801
- arrow_X , YOFFSET + (sfinv_only and 0.9 or 0.2 ) + L .spacing ,
802
- 0.9 , 0.7 , PNG .arrow )
801
+ fs [# fs + 1 ] = fmt (FMT .image , arrow_X , Y + 0.2 , 0.9 , 0.7 , PNG .arrow )
803
802
804
803
if L .recipe .type == " fuel" then
805
- fs [# fs + 1 ] = fmt (FMT .animated_image ,
806
- output_X , YOFFSET + (sfinv_only and 0.7 or 0 ) + L .spacing ,
807
- 1.1 , 1.1 , PNG .fire_anim , 8 , 180 )
804
+ fs [# fs + 1 ] = fmt (FMT .animated_image , output_X , Y , 1.1 , 1.1 , PNG .fire_anim , 8 , 180 )
808
805
else
809
806
local item = L .recipe .output
810
807
item = clean_name (item )
811
808
local name = match (item , " %S*" )
812
809
813
- fs [# fs + 1 ] = fmt (FMT .image ,
814
- output_X , YOFFSET + (sfinv_only and 0.7 or 0 ) + L .spacing ,
815
- 1.1 , 1.1 , PNG .selected )
810
+ fs [# fs + 1 ] = fmt (FMT .image , output_X , Y , 1.1 , 1.1 , PNG .selected )
816
811
817
812
local _name = sfinv_only and name or fmt (" _%s" , name )
818
813
819
814
fs [# fs + 1 ] = fmt (" item_image_button[%f,%f;%f,%f;%s;%s;%s]" ,
820
- output_X , YOFFSET + (sfinv_only and 0.7 or 0 ) + L .spacing ,
821
- 1.1 , 1.1 , item , _name , " " )
815
+ output_X , Y , 1.1 , 1.1 , item , _name , " " )
822
816
823
817
local infos = {
824
818
unknown = not reg_items [name ] or nil ,
@@ -922,14 +916,14 @@ local function get_grid_fs(data, fs, rcp, spacing)
922
916
end
923
917
end
924
918
919
+ Y = Y + (sfinv_only and 0.7 or 0 )
920
+
925
921
if not large_recipe then
926
- fs [# fs + 1 ] = fmt (FMT .image ,
927
- X , Y + (sfinv_only and 0.7 or 0 ), btn_size , btn_size , PNG .selected )
922
+ fs [# fs + 1 ] = fmt (FMT .image , X , Y , btn_size , btn_size , PNG .selected )
928
923
end
929
924
930
925
fs [# fs + 1 ] = fmt (FMT .item_image_button ,
931
- X , Y + (sfinv_only and 0.7 or 0 ),
932
- btn_size , btn_size , item , item , ESC (label ))
926
+ X , Y , btn_size , btn_size , item , item , label )
933
927
934
928
local infos = {
935
929
unknown = not reg_items [name ] or nil ,
@@ -1012,12 +1006,13 @@ local function get_panels(data, fs)
1012
1006
local lbl = " "
1013
1007
1014
1008
if not sfinv_only and rn == 0 then
1015
- fs [# fs + 1 ] = fmt (FMT .image ,
1016
- XOFFSET - 0.7 , YOFFSET - 0.4 + spacing , 2 , 2 , PNG .nothing )
1009
+ local X = XOFFSET - 0.7
1010
+ local Y = YOFFSET - 0.4 + spacing
1011
+
1012
+ fs [# fs + 1 ] = fmt (FMT .image , X , Y , 2 , 2 , PNG .nothing )
1017
1013
1018
1014
fs [# fs + 1 ] = fmt (FMT .tooltip ,
1019
- XOFFSET - 0.7 , YOFFSET - 0.4 + spacing , 2 , 2 ,
1020
- is_recipe and ES " No recipes" or ES " No usages" )
1015
+ X , Y , 2 , 2 , is_recipe and ES " No recipes" or ES " No usages" )
1021
1016
1022
1017
elseif (not sfinv_only and is_recipe ) or
1023
1018
(sfinv_only and not data .show_usages ) then
@@ -1059,16 +1054,15 @@ local function get_panels(data, fs)
1059
1054
1060
1055
for i = 1 , # data .favs do
1061
1056
local item = data .favs [i ]
1057
+ local X = 7.85 + (i - 0.5 )
1058
+ local Y = spacing + 0.45
1062
1059
1063
1060
if data .query_item == item then
1064
- fs [# fs + 1 ] = fmt (FMT .image ,
1065
- 7.85 + (i - 0.5 ), spacing + 0.45 ,
1066
- 1.1 , 1.1 , PNG .selected )
1061
+ fs [# fs + 1 ] = fmt (FMT .image , X , Y , 1.1 , 1.1 , PNG .selected )
1067
1062
end
1068
1063
1069
1064
fs [# fs + 1 ] = fmt (FMT .item_image_button ,
1070
- 7.85 + (i - 0.5 ), spacing + 0.45 ,
1071
- 1.1 , 1.1 , item , item , " " )
1065
+ X , Y , 1.1 , 1.1 , item , item , " " )
1072
1066
end
1073
1067
end
1074
1068
end
@@ -1124,15 +1118,15 @@ local function make_fs(data)
1124
1118
0.06 , clr (" #ff0" , data .pagenum ), data .pagemax )
1125
1119
1126
1120
if # data .items == 0 then
1127
- local no_item = S " No item to show"
1121
+ local no_item = ES " No item to show"
1128
1122
local pos = 3
1129
1123
1130
1124
if next (recipe_filters ) and # init_items > 0 and data .filter == " " then
1131
- no_item = S " Collect items to reveal more recipes"
1125
+ no_item = ES " Collect items to reveal more recipes"
1132
1126
pos = pos - 1
1133
1127
end
1134
1128
1135
- fs [# fs + 1 ] = fmt (FMT .label , pos , 2 , ESC ( no_item ) )
1129
+ fs [# fs + 1 ] = fmt (FMT .label , pos , 2 , no_item )
1136
1130
end
1137
1131
1138
1132
local first_item = (data .pagenum - 1 ) * IPP
@@ -1143,18 +1137,15 @@ local function make_fs(data)
1143
1137
1144
1138
local X = i % ROWS
1145
1139
local Y = (i % IPP - X ) / ROWS + 1
1140
+ X = X - (X * (sfinv_only and 0.12 or 0.14 )) - 0.05
1141
+ Y = Y - (Y * 0.1 ) - 0.1
1146
1142
1147
1143
if data .query_item == item then
1148
- fs [# fs + 1 ] = fmt (FMT .image ,
1149
- X - (X * (sfinv_only and 0.12 or 0.14 )) - 0.05 ,
1150
- Y - (Y * 0.1 ) - 0.1 ,
1151
- 1 , 1 , PNG .selected )
1144
+ fs [# fs + 1 ] = fmt (FMT .image , X , Y , 1 , 1 , PNG .selected )
1152
1145
end
1153
1146
1154
1147
fs [# fs + 1 ] = fmt (" item_image_button[%f,%f;%f,%f;%s;%s_inv;]" ,
1155
- X - (X * (sfinv_only and 0.12 or 0.14 )) - 0.05 ,
1156
- Y - (Y * 0.1 ) - 0.1 ,
1157
- 1 , 1 , item , item )
1148
+ X , Y , 1 , 1 , item , item )
1158
1149
end
1159
1150
1160
1151
if (data .recipes and # data .recipes > 0 ) or (data .usages and # data .usages > 0 ) then
0 commit comments