@@ -566,12 +566,12 @@ def add_dialog_proc(name, p, context = nil)
566
566
return
567
567
end
568
568
dialog . set_cursor_pos ( cursor_column , @first_line_started_from + @started_from )
569
- pos , result , pointer , bg = dialog . call
569
+ dialog_render_info = dialog . call
570
570
old_dialog_contents = dialog . contents
571
571
old_dialog_column = dialog . column
572
572
old_dialog_vertical_offset = dialog . vertical_offset
573
- if result and not result . empty?
574
- dialog . contents = result
573
+ if dialog_render_info and dialog_render_info . contents and not dialog_render_info . contents . empty?
574
+ dialog . contents = dialog_render_info . contents
575
575
dialog . contents = dialog . contents [ 0 ...DIALOG_HEIGHT ] if dialog . contents . size > DIALOG_HEIGHT
576
576
else
577
577
dialog . lines_backup = {
@@ -587,32 +587,32 @@ def add_dialog_proc(name, p, context = nil)
587
587
end
588
588
upper_space = @first_line_started_from - @started_from
589
589
lower_space = @highest_in_all - @first_line_started_from - @started_from - 1
590
- dialog . column = pos . x
590
+ dialog . column = dialog_render_info . pos . x
591
591
diff = ( dialog . column + DIALOG_WIDTH ) - ( @screen_size . last - 1 )
592
592
if diff > 0
593
593
dialog . column -= diff
594
594
end
595
- if ( lower_space + @rest_height - pos . y ) >= DIALOG_HEIGHT
596
- dialog . vertical_offset = pos . y + 1
595
+ if ( lower_space + @rest_height - dialog_render_info . pos . y ) >= DIALOG_HEIGHT
596
+ dialog . vertical_offset = dialog_render_info . pos . y + 1
597
597
elsif upper_space >= DIALOG_HEIGHT
598
- dialog . vertical_offset = pos . y + -( DIALOG_HEIGHT + 1 )
598
+ dialog . vertical_offset = dialog_render_info . pos . y + -( DIALOG_HEIGHT + 1 )
599
599
else
600
- if ( lower_space + @rest_height - pos . y ) < DIALOG_HEIGHT
601
- scroll_down ( DIALOG_HEIGHT + pos . y )
602
- move_cursor_up ( DIALOG_HEIGHT + pos . y )
600
+ if ( lower_space + @rest_height - dialog_render_info . pos . y ) < DIALOG_HEIGHT
601
+ scroll_down ( DIALOG_HEIGHT + dialog_render_info . pos . y )
602
+ move_cursor_up ( DIALOG_HEIGHT + dialog_render_info . pos . y )
603
603
end
604
- dialog . vertical_offset = pos . y + 1
604
+ dialog . vertical_offset = dialog_render_info . pos . y + 1
605
605
end
606
606
Reline ::IOGate . hide_cursor
607
607
reset_dialog ( dialog , old_dialog_contents , old_dialog_column , old_dialog_vertical_offset )
608
608
move_cursor_down ( dialog . vertical_offset )
609
609
Reline ::IOGate . move_cursor_column ( dialog . column )
610
610
dialog . contents . each_with_index do |item , i |
611
- if i == pointer
611
+ if i == dialog_render_info . pointer
612
612
bg_color = '45'
613
613
else
614
- if bg
615
- bg_color = bg
614
+ if dialog_render_info . bg_color
615
+ bg_color = dialog_render_info . bg_color
616
616
else
617
617
bg_color = '46'
618
618
end
0 commit comments