Revised few Core functions to use tint, and blanked tiny fill bars...
@ -305,27 +305,27 @@ package body core is
|
|||||||
|
|
||||||
------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
procedure draw_horizontally (data : in sprite; x, y, width, factor : in integer) is
|
procedure draw_horizontally (data : in sprite; x, y, width, factor : in integer; tint : in colour := (others => 255)) is
|
||||||
begin
|
begin
|
||||||
for move in 0 .. width / data.width - 1 loop
|
for move in 0 .. width / data.width - 1 loop
|
||||||
draw (data, x + move * data.width, y, factor => 1);
|
draw (data, x + move * data.width, y, tint => tint, factor => 1);
|
||||||
end loop;
|
end loop;
|
||||||
--
|
--
|
||||||
if width mod data.width > 0 then
|
if width mod data.width > 0 then
|
||||||
draw (data, x + (width / data.width) * data.width, y, 0, 0, width mod data.width, data.height, factor => 1);
|
draw (data, x + (width / data.width) * data.width, y, 0, 0, width mod data.width, data.height, tint => tint, factor => 1);
|
||||||
end if;
|
end if;
|
||||||
end draw_horizontally;
|
end draw_horizontally;
|
||||||
|
|
||||||
------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
procedure draw_vertically (data : in sprite; x, y, height, factor : in integer) is
|
procedure draw_vertically (data : in sprite; x, y, height, factor : in integer; tint : in colour := (others => 255)) is
|
||||||
begin
|
begin
|
||||||
for move in 0 .. height / data.height - 1 loop
|
for move in 0 .. height / data.height - 1 loop
|
||||||
draw (data, x, y + move * data.height, factor => 1);
|
draw (data, x, y + move * data.height, tint => tint, factor => 1);
|
||||||
end loop;
|
end loop;
|
||||||
--
|
--
|
||||||
if height mod data.height > 0 then
|
if height mod data.height > 0 then
|
||||||
draw (data, x, y + (height / data.height) * data.height, 0, 0, data.width, height mod data.height, factor => 1);
|
draw (data, x, y + (height / data.height) * data.height, 0, 0, data.width, height mod data.height, tint => tint, factor => 1);
|
||||||
end if;
|
end if;
|
||||||
end draw_vertically;
|
end draw_vertically;
|
||||||
|
|
||||||
|
@ -159,8 +159,8 @@ package core is
|
|||||||
factor : in integer := zoom;
|
factor : in integer := zoom;
|
||||||
tint : in colour := (others => 255));
|
tint : in colour := (others => 255));
|
||||||
|
|
||||||
procedure draw_horizontally (data : in sprite; x, y, width, factor : in integer);
|
procedure draw_horizontally (data : in sprite; x, y, width, factor : in integer; tint : in colour := (others => 255));
|
||||||
procedure draw_vertically (data : in sprite; x, y, height, factor : in integer);
|
procedure draw_vertically (data : in sprite; x, y, height, factor : in integer; tint : in colour := (others => 255));
|
||||||
|
|
||||||
procedure write (text : in string := "";
|
procedure write (text : in string := "";
|
||||||
x : in integer := 0;
|
x : in integer := 0;
|
||||||
|
@ -315,10 +315,10 @@ begin
|
|||||||
end loop;
|
end loop;
|
||||||
--
|
--
|
||||||
resource.draw_points (player.resources, (preview_width - 4 * icon * resource.count) / 2, (if view_list (map_preview_panel) then icon else 0));
|
resource.draw_points (player.resources, (preview_width - 4 * icon * resource.count) / 2, (if view_list (map_preview_panel) then icon else 0));
|
||||||
--~ui.draw_fill_bar ((preview_width - 320) / 2, 4 * (if view_list (map_preview_panel) then icon else 0), 320, 0.0);
|
ui.draw_fill_bar ((preview_width - 320) / 2, 4 * (if view_list (map_preview_panel) then icon else 0), 320, 0.0);
|
||||||
--~ui.draw_tiny_fill_bar ((preview_width - 160) / 2, 5 * (if view_list (map_preview_panel) then icon else 0), 160, 0.0);
|
ui.draw_tiny_fill_bar ((preview_width - 160) / 2, 5 * (if view_list (map_preview_panel) then icon else 0), 160, 0.3, (255, 255, 0, 255));
|
||||||
--~ui.draw_fill_bar ((preview_width - 320) / 2 + 400, 4 * (if view_list (map_preview_panel) then icon else 0), 320, 1.0);
|
ui.draw_fill_bar ((preview_width - 320) / 2 + 400, 4 * (if view_list (map_preview_panel) then icon else 0), 320, 0.6);
|
||||||
--~ui.draw_tiny_fill_bar ((preview_width - 160) / 2 + 400, 5 * (if view_list (map_preview_panel) then icon else 0), 160, 1.0);
|
ui.draw_tiny_fill_bar ((preview_width - 160) / 2 + 400, 5 * (if view_list (map_preview_panel) then icon else 0), 160, 0.6, (255, 0, 255, 255));
|
||||||
--
|
--
|
||||||
signal_list (signal_mode).all;
|
signal_list (signal_mode).all;
|
||||||
--
|
--
|
||||||
|
@ -89,9 +89,9 @@ package body ui is
|
|||||||
|
|
||||||
------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
procedure draw_horizontally (index : in element; x, y, width : in integer; action : core.pointer := core.idle_skip'access) is
|
procedure draw_horizontally (index : in element; x, y, width : in integer; action : core.pointer := core.idle_skip'access; tint : in core.colour := (others => 255)) is
|
||||||
begin
|
begin
|
||||||
core.draw_horizontally (sprite (active, index), x, y, width, factor => 1);
|
core.draw_horizontally (sprite (active, index), x, y, width, 1, tint);
|
||||||
--
|
--
|
||||||
--~if core.cursor_mode = 1 and cursor_inside (x, y, width / core.zoom, sprite (active, index).height / core.zoom) then
|
--~if core.cursor_mode = 1 and cursor_inside (x, y, width / core.zoom, sprite (active, index).height / core.zoom) then
|
||||||
--~action.all;
|
--~action.all;
|
||||||
@ -101,9 +101,9 @@ package body ui is
|
|||||||
|
|
||||||
------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
procedure draw_vertically (index : in element; x, y, height : in integer; action : core.pointer := core.idle_skip'access) is
|
procedure draw_vertically (index : in element; x, y, height : in integer; action : core.pointer := core.idle_skip'access; tint : in core.colour := (others => 255)) is
|
||||||
begin
|
begin
|
||||||
core.draw_vertically (sprite (active, index), x, y, height, factor => 1);
|
core.draw_vertically (sprite (active, index), x, y, height, 1, tint);
|
||||||
--
|
--
|
||||||
--~if core.cursor_mode = 1 and cursor_inside (x, y, sprite (active, index).width / core.zoom, height / core.zoom) then
|
--~if core.cursor_mode = 1 and cursor_inside (x, y, sprite (active, index).width / core.zoom, height / core.zoom) then
|
||||||
--~action.all;
|
--~action.all;
|
||||||
@ -470,31 +470,17 @@ package body ui is
|
|||||||
procedure draw_tiny_fill_bar (x, y, width : in integer; fill : in float; tint : in core.colour) is
|
procedure draw_tiny_fill_bar (x, y, width : in integer; fill : in float; tint : in core.colour) is
|
||||||
middle_width : constant integer := width - sprite (active, tiny_fill_bar_left).width - sprite (active, tiny_fill_bar_right).width;
|
middle_width : constant integer := width - sprite (active, tiny_fill_bar_left).width - sprite (active, tiny_fill_bar_right).width;
|
||||||
fill_width : constant integer := integer (float (middle_width) * fill);
|
fill_width : constant integer := integer (float (middle_width) * fill);
|
||||||
crop_width : constant integer := sprite (active, tiny_fill_horizontal).width;
|
|
||||||
crop_height : constant integer := sprite (active, tiny_fill_horizontal).height;
|
|
||||||
begin
|
begin
|
||||||
draw (tiny_fill_bar_left, x, y - crop_height);
|
draw (tiny_fill_bar_left, x, y - sprite (active, tiny_fill_bar_left).height);
|
||||||
draw (tiny_fill_bar_right, x + middle_width + crop_width, y - crop_height);
|
draw (tiny_fill_bar_right, x + middle_width + sprite (active, tiny_fill_bar_left).width, y - sprite (active, tiny_fill_bar_left).height);
|
||||||
--
|
--
|
||||||
draw_horizontally (tiny_fill_bar_horizontal, x + sprite (active, tiny_fill_bar_left).width, y - crop_height, middle_width);
|
draw_horizontally (tiny_fill_bar_horizontal, x + sprite (active, tiny_fill_bar_left).width, y - sprite (active, tiny_fill_bar_horizontal).height, middle_width);
|
||||||
--
|
--
|
||||||
for move in 0 .. fill_width / crop_width - 1 loop
|
draw_horizontally (index => tiny_fill_horizontal,
|
||||||
core.draw (data => sprite (active, tiny_fill_horizontal),
|
x => x + sprite (active, tiny_fill_bar_left).width,
|
||||||
x => x + crop_width + move * crop_width,
|
y => y - sprite (active, tiny_fill_bar_horizontal).height,
|
||||||
y => y - crop_height,
|
width => fill_width,
|
||||||
tint => tint,
|
tint => tint);
|
||||||
factor => 1);
|
|
||||||
end loop;
|
|
||||||
--
|
|
||||||
if width mod crop_width > 0 then
|
|
||||||
core.draw (data => sprite (active, tiny_fill_horizontal),
|
|
||||||
x => x + crop_width + (fill_width / crop_width) * crop_width,
|
|
||||||
y => y - crop_height,
|
|
||||||
width => fill_width mod crop_width,
|
|
||||||
height => crop_height,
|
|
||||||
tint => tint,
|
|
||||||
factor => 1);
|
|
||||||
end if;
|
|
||||||
end draw_tiny_fill_bar;
|
end draw_tiny_fill_bar;
|
||||||
|
|
||||||
------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------
|
||||||
|
Before Width: | Height: | Size: 162 B After Width: | Height: | Size: 166 B |
Before Width: | Height: | Size: 157 B After Width: | Height: | Size: 160 B |
Before Width: | Height: | Size: 139 B After Width: | Height: | Size: 140 B |
Before Width: | Height: | Size: 157 B After Width: | Height: | Size: 156 B |
Before Width: | Height: | Size: 143 B After Width: | Height: | Size: 138 B |
Before Width: | Height: | Size: 176 B After Width: | Height: | Size: 170 B |