Added menu height limitation...
This commit is contained in:
parent
c67091299f
commit
cda04b245a
@ -35,8 +35,9 @@ package body menu is
|
|||||||
icon_offset : constant integer := 4;
|
icon_offset : constant integer := 4;
|
||||||
icon_size : constant integer := 32;
|
icon_size : constant integer := 32;
|
||||||
offset : constant integer := icon_size + 2 * icon_offset;
|
offset : constant integer := icon_size + 2 * icon_offset;
|
||||||
|
limitation : constant integer := (if trait (index).length < trait (index).height then trait (index).length else trait (index).height);
|
||||||
width : constant integer := 240;
|
width : constant integer := 240;
|
||||||
height : constant integer := trait (index).length * offset + 2 * draw_offset;
|
height : constant integer := limitation * offset + 2 * draw_offset;
|
||||||
--
|
--
|
||||||
offset_x : constant integer := (if center then (core.window_width - width) / 2 else x);
|
offset_x : constant integer := (if center then (core.window_width - width) / 2 else x);
|
||||||
offset_y : constant integer := (if center then (core.window_height - height) / 2 else y);
|
offset_y : constant integer := (if center then (core.window_height - height) / 2 else y);
|
||||||
@ -48,7 +49,7 @@ package body menu is
|
|||||||
ui.draw_title_bar (offset_x, offset_y, width, trait (index).title);
|
ui.draw_title_bar (offset_x, offset_y, width, trait (index).title);
|
||||||
ui.draw_tiny_menu (offset_x, offset_y, width, height, true);
|
ui.draw_tiny_menu (offset_x, offset_y, width, height, true);
|
||||||
--
|
--
|
||||||
for element_index in 0 .. trait (index).length - 1
|
for element_index in 0 .. limitation - 1
|
||||||
loop
|
loop
|
||||||
ui.draw_frame (offset_x + draw_offset, offset_y + draw_offset + element_index * offset, offset, offset);
|
ui.draw_frame (offset_x + draw_offset, offset_y + draw_offset + element_index * offset, offset, offset);
|
||||||
--
|
--
|
||||||
|
Loading…
Reference in New Issue
Block a user