|
|
@@ -43,10 +43,12 @@ package body ui is |
|
|
|
|
|
|
|
------------------------------------------------------------------------------------------ |
|
|
|
|
|
|
|
structure_limit : constant natural := 12; |
|
|
|
|
|
|
|
sprite : array (style, element) of core.sprite; |
|
|
|
font : array (style) of core.font; |
|
|
|
|
|
|
|
structure_array : array (0 .. 12) of structure; |
|
|
|
structure_array : array (0 .. structure_limit) of structure; |
|
|
|
|
|
|
|
structure_count : natural := 0; |
|
|
|
|
|
|
@@ -180,7 +182,7 @@ package body ui is |
|
|
|
|
|
|
|
procedure synchronize is |
|
|
|
begin |
|
|
|
for index in 0 .. 12 loop |
|
|
|
for index in 0 .. structure_limit loop |
|
|
|
exit when index = structure_count; |
|
|
|
-- |
|
|
|
if core.signal_mode = core.signal_code'pos (structure_array (index).toggle) then |
|
|
@@ -323,6 +325,21 @@ package body ui is |
|
|
|
|
|
|
|
------------------------------------------------------------------------------------------ |
|
|
|
|
|
|
|
procedure draw_fill_bar (x, y, width : in integer; fill : in float) is |
|
|
|
middle_width : constant integer := width - sprite (active, fill_bar_left).width - sprite (active, fill_bar_right).width; |
|
|
|
fill_width : constant integer := integer (float (middle_width) * fill); |
|
|
|
begin |
|
|
|
draw (fill_bar_left, x, y - sprite (active, fill_bar_left).height); |
|
|
|
draw (fill_bar_right, x + middle_width + sprite (active, fill_bar_left).width, y - sprite (active, fill_bar_right).height); |
|
|
|
-- |
|
|
|
draw_horizontally (fill_bar_horizontal, x + sprite (active, fill_bar_left).width, y - sprite (active, fill_bar_horizontal).height, middle_width); |
|
|
|
draw_horizontally (fill_horizontal, x + sprite (active, fill_bar_left).width, y - sprite (active, fill_bar_horizontal).height, fill_width); |
|
|
|
-- |
|
|
|
select_text_box ("", x, y, width, sprite (active, fill_bar_horizontal).height); |
|
|
|
end draw_fill_bar; |
|
|
|
|
|
|
|
------------------------------------------------------------------------------------------ |
|
|
|
|
|
|
|
procedure draw_scroll_bar (x, y, height : in integer; offset : in integer) is |
|
|
|
middle_height : constant integer := height - sprite (active, scroll_bar_upper).height - sprite (active, scroll_bar_lower).height; |
|
|
|
begin |
|
|
@@ -408,7 +425,7 @@ package body ui is |
|
|
|
|
|
|
|
------------------------------------------------------------------------------------------ |
|
|
|
|
|
|
|
procedure draw_state_box (x, y : in integer) is |
|
|
|
procedure draw_state_box (x, y : in integer) is -- TODO: Delete this at some point. |
|
|
|
begin |
|
|
|
ui.write ("Cursor X:" & core.cursor.x'image, x, y + 0); |
|
|
|
ui.write ("Cursor Y:" & core.cursor.y'image, x, y + 32); |
|
|
@@ -423,7 +440,7 @@ package body ui is |
|
|
|
|
|
|
|
------------------------------------------------------------------------------------------ |
|
|
|
|
|
|
|
procedure add_structure (data : in structure) is |
|
|
|
procedure add_structure (data : in structure) is -- TODO: This is dumb, tho less error-prone... |
|
|
|
begin |
|
|
|
structure_array (structure_count) := data; |
|
|
|
-- |
|
|
|