From 5d0a29f15a022c8e30b8fb2126baa0c5c5abd561 Mon Sep 17 00:00:00 2001 From: xolatile Date: Fri, 3 May 2024 10:39:28 -0400 Subject: [PATCH] Finished core menu system probably... --- source/attribute.adb | 4 +++- source/main.adb | 2 ++ source/resource.adb | 4 +++- source/skill.adb | 4 +++- source/ui.adb | 8 ++++---- 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/source/attribute.adb b/source/attribute.adb index a3061ae..d3350d1 100644 --- a/source/attribute.adb +++ b/source/attribute.adb @@ -19,8 +19,10 @@ package body attribute is ui.add_structure ((title => "Attribute Menu ", toggle => core.signal_a, show => false, - center => true, + center => false, resize => true, + x => 880, + y => (core.window_height - 320) / 2, gui_n => 0, gui_list => (others => ui.empty), others => 0)); diff --git a/source/main.adb b/source/main.adb index 7d18b23..fd521a1 100644 --- a/source/main.adb +++ b/source/main.adb @@ -175,6 +175,8 @@ begin ui.active := ui.imp; + core.camera := (50, 50); + ------------------------------------------------------------------------------------------ gameplay: loop diff --git a/source/resource.adb b/source/resource.adb index de610db..9874e09 100644 --- a/source/resource.adb +++ b/source/resource.adb @@ -19,8 +19,10 @@ package body resource is ui.add_structure ((title => "Resource Menu ", toggle => core.signal_r, show => false, - center => true, + center => false, resize => true, + x => 480, + y => (core.window_height - 320) / 2, gui_n => 0, gui_list => (others => ui.empty), others => 0)); diff --git a/source/skill.adb b/source/skill.adb index 9fcad23..36ceedc 100644 --- a/source/skill.adb +++ b/source/skill.adb @@ -23,8 +23,10 @@ package body skill is ui.add_structure ((title => "Skill Menu ", toggle => core.signal_s, show => false, - center => true, + center => false, resize => true, + x => 80, + y => (core.window_height - 320) / 2, gui_n => 0, gui_list => (others => ui.empty), others => 0)); diff --git a/source/ui.adb b/source/ui.adb index c493f98..934fcfa 100644 --- a/source/ui.adb +++ b/source/ui.adb @@ -151,7 +151,7 @@ package body ui is procedure draw_structure (data : in structure) is offset : constant integer := core.icon; - new_width : constant integer := (if data.resize then 300 else data.width); + new_width : constant integer := (if data.resize then 320 else data.width); new_height : constant integer := (if data.resize then data.gui_n * core.icon + 2 * offset else data.height); new_x : constant integer := (if data.center then (core.window_width - new_width) / 2 else data.x); new_y : constant integer := (if data.center then (core.window_height - new_height) / 2 else data.y); @@ -166,8 +166,8 @@ package body ui is case data.gui_list (x).kind is when gui_button => draw_icon (data.gui_list (x).image, "", at_x, at_y); - draw_frame ("", at_x + core.icon, at_y, new_width - 2 * offset - core.icon, core.icon); - write (data.gui_list (x).text, at_x + core.icon, at_y); + draw_frame ("", at_x + core.icon + 2, at_y, new_width - 2 * offset - core.icon - 2, core.icon); + write (data.gui_list (x).text, at_x + core.icon + 6, at_y + 2); at_y := at_y + core.icon; when others => null; end case; @@ -331,7 +331,7 @@ package body ui is -- draw_horizontally (title_bar_middle, x + sprite (active, title_bar_left).width, y - sprite (active, title_bar_middle).height, middle_width); -- - core.write (title, x + sprite (active, title_bar_left).width / 2 + 16, y - sprite (active, title_bar_middle).height / 2 - 8, font (active)); + core.write (title, x + sprite (active, title_bar_left).width / 2 + 20, y - sprite (active, title_bar_middle).height / 2 - 6, font (active)); -- select_text_box (title, x, y - sprite (active, title_bar_middle).height, width, sprite (active, title_bar_middle).height); end draw_title_bar;