Bladeren bron

Revised few Core functions to use tint, and blanked tiny fill bars...

master
Ognjen Milan Robovic 2 weken geleden
bovenliggende
commit
907f117f41
10 gewijzigde bestanden met toevoegingen van 24 en 38 verwijderingen
  1. +6
    -6
      source/core.adb
  2. +2
    -2
      source/core.ads
  3. +4
    -4
      source/main.adb
  4. +12
    -26
      source/ui.adb
  5. BIN
      ui/dwarf/tiny_fill_bar_horizontal.png
  6. BIN
      ui/fairy/tiny_fill_horizontal.png
  7. BIN
      ui/gnoll/tiny_fill_horizontal.png
  8. BIN
      ui/goblin/tiny_fill_horizontal.png
  9. BIN
      ui/imp/tiny_fill_horizontal.png
  10. BIN
      ui/kobold/tiny_fill_horizontal.png

+ 6
- 6
source/core.adb Bestand weergeven

@@ -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
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;
--
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 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
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;
--
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 draw_vertically;



+ 2
- 2
source/core.ads Bestand weergeven

@@ -159,8 +159,8 @@ package core is
factor : in integer := zoom;
tint : in colour := (others => 255));

procedure draw_horizontally (data : in sprite; x, y, width, factor : in integer);
procedure draw_vertically (data : in sprite; x, y, height, 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; tint : in colour := (others => 255));

procedure write (text : in string := "";
x : in integer := 0;


+ 4
- 4
source/main.adb Bestand weergeven

@@ -315,10 +315,10 @@ begin
end loop;
--
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_tiny_fill_bar ((preview_width - 160) / 2, 5 * (if view_list (map_preview_panel) then icon else 0), 160, 0.0);
--~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_tiny_fill_bar ((preview_width - 160) / 2 + 400, 5 * (if view_list (map_preview_panel) then icon else 0), 160, 1.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.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, 0.6);
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;
--


+ 12
- 26
source/ui.adb Bestand weergeven

@@ -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
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
--~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
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
--~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
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);
crop_width : constant integer := sprite (active, tiny_fill_horizontal).width;
crop_height : constant integer := sprite (active, tiny_fill_horizontal).height;
begin
draw (tiny_fill_bar_left, x, y - crop_height);
draw (tiny_fill_bar_right, x + middle_width + crop_width, 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 + 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
core.draw (data => sprite (active, tiny_fill_horizontal),
x => x + crop_width + move * crop_width,
y => y - crop_height,
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;
draw_horizontally (index => tiny_fill_horizontal,
x => x + sprite (active, tiny_fill_bar_left).width,
y => y - sprite (active, tiny_fill_bar_horizontal).height,
width => fill_width,
tint => tint);
end draw_tiny_fill_bar;

------------------------------------------------------------------------------------------


BIN
ui/dwarf/tiny_fill_bar_horizontal.png Bestand weergeven

Before After
Width: 32  |  Height: 32  |  Size: 162B Width: 32  |  Height: 32  |  Size: 166B

BIN
ui/fairy/tiny_fill_horizontal.png Bestand weergeven

Before After
Width: 32  |  Height: 32  |  Size: 157B Width: 32  |  Height: 32  |  Size: 160B

BIN
ui/gnoll/tiny_fill_horizontal.png Bestand weergeven

Before After
Width: 32  |  Height: 32  |  Size: 139B Width: 32  |  Height: 32  |  Size: 140B

BIN
ui/goblin/tiny_fill_horizontal.png Bestand weergeven

Before After
Width: 32  |  Height: 32  |  Size: 157B Width: 32  |  Height: 32  |  Size: 156B

BIN
ui/imp/tiny_fill_horizontal.png Bestand weergeven

Before After
Width: 32  |  Height: 32  |  Size: 143B Width: 32  |  Height: 32  |  Size: 138B

BIN
ui/kobold/tiny_fill_horizontal.png Bestand weergeven

Before After
Width: 32  |  Height: 32  |  Size: 176B Width: 32  |  Height: 32  |  Size: 170B

Laden…
Annuleren
Opslaan