From 6eaf57031083d370e3a41acc3c7c462f95c9906e Mon Sep 17 00:00:00 2001 From: xolatile Date: Sun, 18 Feb 2024 09:39:24 -0500 Subject: [PATCH] Added icon and draw offsets to menus... (: --- source/menu.adb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/source/menu.adb b/source/menu.adb index 43aae60..962e526 100644 --- a/source/menu.adb +++ b/source/menu.adb @@ -39,11 +39,12 @@ package body menu is ------------------------------------------------------------------------------------------ procedure draw (index : in codex; x, y : in integer) is - icon_offset : constant integer := 16; + draw_offset : constant integer := 16; + icon_offset : constant integer := 4; icon_size : constant integer := 32; - offset : constant integer := icon_size + icon_offset; + offset : constant integer := icon_size + 2 * icon_offset; width : constant integer := 300; - height : constant integer := trait (index).length * offset + 2 * icon_offset; + height : constant integer := trait (index).length * offset + 2 * draw_offset; begin if index = none then return; @@ -54,10 +55,10 @@ package body menu is -- for element_index in 0 .. trait (index).length - 1 loop - ui.draw_frame (x + icon_offset, y + icon_offset + element_index * offset, offset, offset); + ui.draw_frame (x + draw_offset, y + draw_offset + element_index * offset, offset, offset); -- - core.draw (trait (index).elements (element_index).icon, x + 3 * icon_offset / 2, y + 3 * icon_offset / 2 + element_index * offset); - core.write (trait (index).elements (element_index).text, x + 3 * icon_offset / 2 + offset, y + 3 * icon_offset / 2 + element_index * offset); + core.draw (trait (index).elements (element_index).icon, x + draw_offset + icon_offset, y + draw_offset + icon_offset + element_index * offset); + core.write (trait (index).elements (element_index).text, x + draw_offset + icon_offset + offset, y + draw_offset + icon_offset + element_index * offset); end loop; end draw;