|
|
@@ -156,19 +156,28 @@ package body ui is |
|
|
|
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); |
|
|
|
-- |
|
|
|
at_x : integer := new_x; |
|
|
|
at_y : integer := new_y; |
|
|
|
at_x : integer := new_x + offset; |
|
|
|
at_y : integer := new_y + offset; |
|
|
|
begin |
|
|
|
draw_tiny_menu (new_x, new_y, new_width, new_height); |
|
|
|
draw_title_bar (new_x, new_y, new_width, data.title); |
|
|
|
-- |
|
|
|
for x in 0 .. data.gui_n loop |
|
|
|
core.echo (core.import, "Almost rendering" & data.gui_n'image & " elements!"); |
|
|
|
-- |
|
|
|
for x in 0 .. data.gui_n - 1 loop |
|
|
|
case data.gui_list (x).kind is |
|
|
|
when gui_button => |
|
|
|
draw_frame ("", at_x + offset, at_y, new_width - 2 * offset, core.icon + offset); |
|
|
|
draw_icon (data.gui_list (x).image, "", at_x + 3 * offset / 2, at_y + offset / 2); |
|
|
|
write (data.gui_list (x).text, at_x + 3 * offset / 2 + core.icon, at_y + offset / 2); |
|
|
|
when others => null; |
|
|
|
--~draw_frame ("", at_x, at_y, new_width - 2 * offset, core.icon + offset); |
|
|
|
draw_icon (data.gui_list (x).image, "", at_x, at_y); |
|
|
|
write (data.gui_list (x).text, at_x + core.icon, at_y); |
|
|
|
at_y := at_y + x * core.icon; |
|
|
|
core.echo (core.import, "Rendering!"); |
|
|
|
--~when others => null; |
|
|
|
when others => core.echo (core.import, "Not rendering!"); |
|
|
|
--~when others => |
|
|
|
--~draw_frame ("", at_x + offset, at_y, new_width - 2 * offset, core.icon + offset); |
|
|
|
--~draw_icon (data.gui_list (x).image, "", at_x + 3 * offset / 2, at_y + offset / 2); |
|
|
|
--~write (data.gui_list (x).text, at_x + 3 * offset / 2 + core.icon, at_y + offset / 2); |
|
|
|
end case; |
|
|
|
end loop; |
|
|
|
end draw_structure; |
|
|
@@ -463,7 +472,7 @@ package body ui is |
|
|
|
|
|
|
|
------------------------------------------------------------------------------------------ |
|
|
|
|
|
|
|
procedure add_structure_button (data : in out structure; icon : in core.sprite; text, description : in string) is |
|
|
|
procedure add_structure_button (data : in out structure; icon : in core.sprite; text : in core.short_string) is |
|
|
|
begin |
|
|
|
data.gui_list (data.gui_n).kind := gui_button; |
|
|
|
data.gui_list (data.gui_n).text := text; |
|
|
|