From fbb0c23895d7e63462a7fd5b4a63a34693d06dcc Mon Sep 17 00:00:00 2001 From: xolatile Date: Mon, 19 Feb 2024 22:08:42 -0500 Subject: [PATCH] Last push for today... --- source/main.adb | 2 +- source/menu.adb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/main.adb b/source/main.adb index d8e38ce..26f9266 100644 --- a/source/main.adb +++ b/source/main.adb @@ -114,7 +114,7 @@ begin -- menu.draw (menu.attribute_information, 100, 100, false); menu.draw (menu.skill_information, 700, 100, false); - menu.draw (menu.resource_information, 400, 100, false); + menu.draw (menu.resource_information, 400, 100, true); -- core.write ("Menu :" & menu.trait (menu.mouse_over_menu).title, preview_width + 32, 32 + 320, 16#CCCCCC#); if menu.mouse_over_menu_element = -1 then diff --git a/source/menu.adb b/source/menu.adb index 4ed558c..e14ab44 100644 --- a/source/menu.adb +++ b/source/menu.adb @@ -89,7 +89,7 @@ package body menu is procedure draw (index : in codex; x, y : in integer; center : in boolean) is scroll_bar : constant boolean := (if trait (index).length > trait (index).height then true else false); - limitation : constant integer := (if trait (index).length > trait (index).height then trait (index).height else trait (index).length); + limitation : constant integer := (if scroll_bar then trait (index).height else trait (index).length); width : constant integer := 2 * draw_offset + offset + 24 * 8; height : constant integer := limitation * offset + 2 * draw_offset; begin @@ -112,7 +112,7 @@ package body menu is end loop; -- if scroll_bar then - ui.draw_scroll_bar (x + width - draw_offset, y + draw_offset, height - 2 * draw_offset, 0); + ui.draw_scroll_bar (trait (index).x + width - draw_offset, trait (index).y + draw_offset, height - 2 * draw_offset, 0); end if; end draw;