|
|
@@ -171,11 +171,18 @@ package body ui is |
|
|
|
for x in 0 .. data.gui_n - 1 loop |
|
|
|
case data.gui_list (x).kind is |
|
|
|
when gui_button => |
|
|
|
draw_frame (data.gui_list (x).info, button_data.x, button_data.y, button_data.width, button_data.height); |
|
|
|
draw_icon (data.gui_list (x).image, data.gui_list (x).info, button_data.x + offset, button_data.y + offset); |
|
|
|
write (data.gui_list (x).text, |
|
|
|
button_data.x + offset + core.icon + (core.icon - font (active).scale) / 2, |
|
|
|
button_data.y + offset + (core.icon - font (active).scale) / 2); |
|
|
|
--~draw_frame (data.gui_list (x).info, button_data.x, button_data.y, button_data.width, button_data.height); |
|
|
|
--~draw_icon (data.gui_list (x).image, data.gui_list (x).info, button_data.x + offset, button_data.y + offset); |
|
|
|
--~write (data.gui_list (x).text, |
|
|
|
--~button_data.x + offset + core.icon + (core.icon - font (active).scale) / 2, |
|
|
|
--~button_data.y + offset + (core.icon - font (active).scale) / 2); |
|
|
|
draw_button (text => data.gui_list (x).text, |
|
|
|
description => data.gui_list (x).info, |
|
|
|
icon => data.gui_list (x).image, |
|
|
|
x => button_data.x, |
|
|
|
y => button_data.y, |
|
|
|
width => button_data.width, |
|
|
|
height => button_data.height); |
|
|
|
-- |
|
|
|
button_data.y := button_data.y + button_data.height; |
|
|
|
when gui_orient => |
|
|
@@ -336,10 +343,42 @@ package body ui is |
|
|
|
draw (frame_upper_right, x + width - sprite (active, frame_upper_right).width, y); |
|
|
|
draw (frame_lower_left, x, y + height - sprite (active, frame_lower_left).height); |
|
|
|
draw (frame_lower_right, x + width - sprite (active, frame_lower_right).width, y + height - sprite (active, frame_lower_right).height); |
|
|
|
-- |
|
|
|
if core.cursor_inside (x, y, width, height) then |
|
|
|
core.write_text_box (description); |
|
|
|
-- |
|
|
|
if core.cursor_mode = 1 then |
|
|
|
action.all; |
|
|
|
core.cursor_mode := 0; |
|
|
|
end if; |
|
|
|
end if; |
|
|
|
end draw_frame; |
|
|
|
|
|
|
|
------------------------------------------------------------------------------------------ |
|
|
|
|
|
|
|
procedure draw_button (text, description : in string; icon : in core.sprite; x, y, width, height : in integer; action : core.pointer := core.idle_skip'access) is |
|
|
|
offset : constant integer := core.icon / 4; |
|
|
|
begin |
|
|
|
draw_frame (description, x, y, width, height); |
|
|
|
draw_icon (icon, description, x + offset, y + offset); |
|
|
|
-- |
|
|
|
write (text, |
|
|
|
x + offset + (core.icon - font (active).scale) / 2 + core.icon, |
|
|
|
y + offset + (core.icon - font (active).scale) / 2, |
|
|
|
(if core.cursor_inside (x, y, width, height) then font_tint (active) else (others => 255))); |
|
|
|
-- |
|
|
|
if core.cursor_inside (x, y, width, height) then |
|
|
|
core.write_text_box (description); |
|
|
|
-- |
|
|
|
if core.cursor_mode = 1 then |
|
|
|
action.all; |
|
|
|
core.cursor_mode := 0; |
|
|
|
end if; |
|
|
|
end if; |
|
|
|
end draw_button; |
|
|
|
|
|
|
|
------------------------------------------------------------------------------------------ |
|
|
|
|
|
|
|
procedure draw_title_bar (x, y, width : in integer; title : in string) is |
|
|
|
middle_width : constant integer := width - sprite (active, title_bar_left).width - sprite (active, title_bar_right).width; |
|
|
|
offset : constant integer := (sprite (active, title_bar_middle).height - font (active).scale) / 2; |
|
|
|