Finished core menu system probably...

This commit is contained in:
Ognjen Milan Robovic 2024-05-03 10:39:28 -04:00
parent 4ed6af967d
commit 5d0a29f15a
5 changed files with 15 additions and 7 deletions

View File

@ -19,8 +19,10 @@ package body attribute is
ui.add_structure ((title => "Attribute Menu ", ui.add_structure ((title => "Attribute Menu ",
toggle => core.signal_a, toggle => core.signal_a,
show => false, show => false,
center => true, center => false,
resize => true, resize => true,
x => 880,
y => (core.window_height - 320) / 2,
gui_n => 0, gui_n => 0,
gui_list => (others => ui.empty), gui_list => (others => ui.empty),
others => 0)); others => 0));

View File

@ -175,6 +175,8 @@ begin
ui.active := ui.imp; ui.active := ui.imp;
core.camera := (50, 50);
------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------
gameplay: loop gameplay: loop

View File

@ -19,8 +19,10 @@ package body resource is
ui.add_structure ((title => "Resource Menu ", ui.add_structure ((title => "Resource Menu ",
toggle => core.signal_r, toggle => core.signal_r,
show => false, show => false,
center => true, center => false,
resize => true, resize => true,
x => 480,
y => (core.window_height - 320) / 2,
gui_n => 0, gui_n => 0,
gui_list => (others => ui.empty), gui_list => (others => ui.empty),
others => 0)); others => 0));

View File

@ -23,8 +23,10 @@ package body skill is
ui.add_structure ((title => "Skill Menu ", ui.add_structure ((title => "Skill Menu ",
toggle => core.signal_s, toggle => core.signal_s,
show => false, show => false,
center => true, center => false,
resize => true, resize => true,
x => 80,
y => (core.window_height - 320) / 2,
gui_n => 0, gui_n => 0,
gui_list => (others => ui.empty), gui_list => (others => ui.empty),
others => 0)); others => 0));

View File

@ -151,7 +151,7 @@ package body ui is
procedure draw_structure (data : in structure) is procedure draw_structure (data : in structure) is
offset : constant integer := core.icon; 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_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_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); 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 case data.gui_list (x).kind is
when gui_button => when gui_button =>
draw_icon (data.gui_list (x).image, "", at_x, at_y); 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); 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, at_y); write (data.gui_list (x).text, at_x + core.icon + 6, at_y + 2);
at_y := at_y + core.icon; at_y := at_y + core.icon;
when others => null; when others => null;
end case; 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); 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); select_text_box (title, x, y - sprite (active, title_bar_middle).height, width, sprite (active, title_bar_middle).height);
end draw_title_bar; end draw_title_bar;