@@ -415,7 +415,8 @@ local function get_recipe_fs(data)
415
415
local fs = {}
416
416
local recipe = data .recipes [data .rnum ]
417
417
local width = recipe .width
418
- local xoffset = sfinv_only and 4 or 4.92
418
+ local xoffset = sfinv_only and 3.83 or 4.66
419
+ local yoffset = sfinv_only and 6 or 6.6
419
420
local cooktime , shapeless
420
421
421
422
if recipe .type == " cooking" then
@@ -434,8 +435,8 @@ local function get_recipe_fs(data)
434
435
ESC (S (" Recipe @1 of @2" , data .rnum , # data .recipes ))
435
436
436
437
fs [# fs + 1 ] = fmt (FMT .button ,
437
- sfinv_only and 5.8 or 7.4 ,
438
- sfinv_only and 8 or 8.4 ,
438
+ xoffset + ( sfinv_only and 1.98 or 2.7 ) ,
439
+ yoffset + ( sfinv_only and 1.9 or 1.2 ) ,
439
440
2.2 ,
440
441
1 ,
441
442
" alternate" ,
@@ -452,9 +453,8 @@ local function get_recipe_fs(data)
452
453
453
454
for i = 1 , width * rows do
454
455
local item = recipe .items [i ] or " "
455
- local X = ceil ((i - 1 ) % width - width ) + xoffset -
456
- (sfinv_only and 0 or 0.2 )
457
- local Y = ceil (i / width + (sfinv_only and 6 or 7 ) - min (2 , rows ))
456
+ local X = ceil ((i - 1 ) % width - width ) + xoffset
457
+ local Y = ceil (i / width ) + yoffset - min (2 , rows )
458
458
459
459
if width > 3 or rows > 3 then
460
460
local xof = 1 - 4 / width
@@ -466,9 +466,9 @@ local function get_recipe_fs(data)
466
466
s_btn_size = btn_size
467
467
468
468
X = (btn_size * ((i - 1 ) % width ) + xoffset -
469
- (sfinv_only and 2.8 or 2.84 )) * (0.83 - (x_y / 5 ))
469
+ (sfinv_only and 2.83 or ( xoffset - 2 ) )) * (0.83 - (x_y / 5 ))
470
470
Y = (btn_size * floor ((i - 1 ) / width ) +
471
- (5 + ((sfinv_only and 0.81 or 1.97 ) + x_y ))) * (0.86 - (x_y / 5 ))
471
+ (5 + ((sfinv_only and 0.81 or 1.5 ) + x_y ))) * (0.86 - (x_y / 5 ))
472
472
end
473
473
474
474
if X > rightest then
@@ -510,9 +510,11 @@ local function get_recipe_fs(data)
510
510
icon = fmt (" craftguide_%s.png^[resize:16x16" , icon )
511
511
end
512
512
513
+ local pos_y = yoffset + (sfinv_only and 0.25 or - 0.45 )
514
+
513
515
fs [# fs + 1 ] = fmt (FMT .image ,
514
516
min (3.9 , rightest ) + 1.2 ,
515
- sfinv_only and 6.2 or 6.55 ,
517
+ pos_y ,
516
518
0.5 ,
517
519
0.5 ,
518
520
icon )
@@ -522,7 +524,7 @@ local function get_recipe_fs(data)
522
524
523
525
fs [# fs + 1 ] = fmt (" tooltip[%f,%f;%f,%f;%s]" ,
524
526
rightest + 1.2 ,
525
- sfinv_only and 6.2 or 6.55 ,
527
+ pos_y ,
526
528
0.5 ,
527
529
0.5 ,
528
530
ESC (tooltip ))
@@ -533,15 +535,15 @@ local function get_recipe_fs(data)
533
535
534
536
fs [# fs + 1 ] = fmt (FMT .image ,
535
537
arrow_X ,
536
- sfinv_only and 6.85 or 7.2 ,
538
+ yoffset + ( sfinv_only and 0.9 or 0.2 ) ,
537
539
0.9 ,
538
540
0.7 ,
539
541
" craftguide_arrow.png" )
540
542
541
543
if recipe .type == " fuel" then
542
544
fs [# fs + 1 ] = fmt (FMT .image ,
543
545
output_X ,
544
- sfinv_only and 6.68 or 7 ,
546
+ yoffset + ( sfinv_only and 0.7 or 0 ) ,
545
547
1.1 ,
546
548
1.1 ,
547
549
" craftguide_fire.png" )
@@ -551,7 +553,7 @@ local function get_recipe_fs(data)
551
553
552
554
fs [# fs + 1 ] = fmt (FMT .item_image_button ,
553
555
output_X ,
554
- sfinv_only and 6 .7 or 7 ,
556
+ yoffset + ( sfinv_only and 0 .7 or 0 ) ,
555
557
1.1 ,
556
558
1.1 ,
557
559
recipe .output ,
@@ -563,14 +565,14 @@ local function get_recipe_fs(data)
563
565
564
566
fs [# fs + 1 ] = fmt (FMT .image ,
565
567
output_X + 1 ,
566
- sfinv_only and 6.83 or 7.1 ,
568
+ yoffset + ( sfinv_only and 0.7 or 0.1 ) ,
567
569
0.6 ,
568
570
0.4 ,
569
571
" craftguide_arrow.png" )
570
572
571
573
fs [# fs + 1 ] = fmt (FMT .image ,
572
574
output_X + 1.6 ,
573
- sfinv_only and 6.68 or 6.95 ,
575
+ yoffset + ( sfinv_only and 0.55 or 0 ) ,
574
576
0.6 ,
575
577
0.6 ,
576
578
" craftguide_fire.png" )
@@ -587,38 +589,38 @@ local function make_formspec(name)
587
589
local fs = {}
588
590
589
591
if not sfinv_only then
590
- fs [# fs + 1 ] = fmt (" size[%f,%f;]" , 9.62 , 9 )
592
+ fs [# fs + 1 ] = fmt (" size[%f,%f;]" , 9.5 , 8.4 )
591
593
592
594
fs [# fs + 1 ] = [[
593
595
no_prepend[]
594
596
background[1,1;1,1;craftguide_bg.png;true]
595
597
]]
596
598
end
597
599
598
- fs [# fs + 1 ] = fmt (" field[0.3 ,0.33 ;%f,1;filter;;%s]" ,
599
- sfinv_only and 2.75 or 2.72 ,
600
+ fs [# fs + 1 ] = fmt (" field[0.25 ,0.2 ;%f,1;filter;;%s]" ,
601
+ sfinv_only and 2.76 or 2.72 ,
600
602
ESC (data .filter ))
601
603
602
604
fs [# fs + 1 ] = fmt ([[
603
- image_button[%f,0.09 ;0.85,0.85;craftguide_search_icon.png;search;]
604
- image_button[%f,0.09 ;0.85,0.85;craftguide_clear_icon.png;clear;]
605
+ image_button[%f,-0.05 ;0.85,0.85;craftguide_search_icon.png;search;]
606
+ image_button[%f,-0.05 ;0.85,0.85;craftguide_clear_icon.png;clear;]
605
607
field_close_on_enter[filter;false]
606
608
]] ,
607
- sfinv_only and 2.65 or 2.6 ,
608
- sfinv_only and 3.35 or 3.3 )
609
+ sfinv_only and 2.6 or 2.54 ,
610
+ sfinv_only and 3.3 or 3.25 )
609
611
610
612
fs [# fs + 1 ] = fmt (" label[%f,%f;%s / %u]" ,
611
- sfinv_only and 6.3 or 7.8 ,
612
- 0.22 ,
613
+ sfinv_only and 6.35 or 7.85 ,
614
+ 0.06 ,
613
615
colorize (" yellow" , data .pagenum ),
614
616
data .pagemax )
615
617
616
618
fs [# fs + 1 ] = fmt ([[
617
- image_button[%f,0.12 ;0.8,0.8;craftguide_prev_icon.png;prev;]
618
- image_button[%f,0.12 ;0.8,0.8;craftguide_next_icon.png;next;]
619
+ image_button[%f,-0.05 ;0.8,0.8;craftguide_prev_icon.png;prev;]
620
+ image_button[%f,-0.05 ;0.8,0.8;craftguide_next_icon.png;next;]
619
621
]] ,
620
- sfinv_only and 5.5 or 6.88 ,
621
- sfinv_only and 7.25 or 8.8 )
622
+ sfinv_only and 5.45 or 6.83 ,
623
+ sfinv_only and 7.2 or 8.75 )
622
624
623
625
if # data .items == 0 then
624
626
local no_item = S (" No item to show" )
@@ -641,8 +643,8 @@ local function make_formspec(name)
641
643
local Y = (i % IPP - X ) / ROWS + 1
642
644
643
645
fs [# fs + 1 ] = fmt (" item_image_button[%f,%f;%f,%f;%s;%s_inv;]" ,
644
- X - (X * (sfinv_only and 0.12 or 0.14 )),
645
- Y - (Y * 0.1 ) + 0.1 ,
646
+ X - (X * (sfinv_only and 0.12 or 0.14 )) - 0.05 ,
647
+ Y - (Y * 0.1 ) - 0.1 ,
646
648
1 ,
647
649
1 ,
648
650
item ,
0 commit comments