Experimental UI button selection...

This commit is contained in:
Ognjen Milan Robovic 2024-05-04 09:29:48 -04:00
parent 857e50e96d
commit 40516240a4
4 changed files with 11 additions and 8 deletions

View File

@ -20,7 +20,7 @@ package body attribute is
structure.title := "Attribute Menu ";
structure.toggle := core.signal_a;
structure.show := false;
structure.center := false;
structure.center := true;
structure.resize := true;
structure.x := 880;
structure.y := (core.window_height - 320) / 2;

View File

@ -20,7 +20,7 @@ package body resource is
structure.title := "Resource Menu ";
structure.toggle := core.signal_r;
structure.show := false;
structure.center := false;
structure.center := true;
structure.resize := true;
structure.x := 480;
structure.y := (core.window_height - 320) / 2;

View File

@ -20,7 +20,7 @@ package body skill is
structure.title := "Skill Menu ";
structure.toggle := core.signal_s;
structure.show := false;
structure.center := false;
structure.center := true;
structure.resize := true;
structure.x := 80;
structure.y := (core.window_height - 320) / 2;

View File

@ -155,7 +155,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 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 * (3 * core.icon / 2) + 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);
--
@ -168,10 +168,13 @@ package body ui is
for x in 0 .. data.gui_n - 1 loop
case data.gui_list (x).kind is
when gui_button =>
draw_icon (data.gui_list (x).image, data.gui_list (x).info, at_x, at_y);
draw_frame (data.gui_list (x).info, 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;
draw_frame (data.gui_list (x).info, at_x, at_y, new_width - 2 * offset - core.icon - 2, 3 * core.icon / 2);
draw_icon (data.gui_list (x).image, data.gui_list (x).info, at_x + core.icon / 4, at_y + core.icon / 4);
write (data.gui_list (x).text, at_x + 5 * core.icon / 4, at_y + 2 + core.icon / 4);
if cursor_inside (at_x, at_y, new_width - 2 * offset - core.icon - 2, 3 * core.icon / 2) then
draw (cursor, at_x + new_width - 96, at_y);
end if;
at_y := at_y + 3 * core.icon / 2;
when others => null;
end case;
end loop;