Added animations to unit view menu.

This commit is contained in:
Ognjen Milan Robovic 2024-03-13 11:28:18 -04:00
parent 6bb8e275fb
commit c74d2f6476
3 changed files with 13 additions and 8 deletions

View File

@ -105,7 +105,7 @@ begin
resource.menu (300, 500, false);
unit.menu (300, 500, true);
--
unit.stat (unit.griffin, 0, 0, true);
unit.stat (unit.power_lich, 0, 0, true);
--
--~might.menu (0, 0, true);
--~magic.menu (0, 0, true);

View File

@ -84,8 +84,8 @@ package body unit is
procedure stat (index : in codex; x, y : in integer; center : in boolean) is
offset : constant integer := 16;
width : constant integer := 160 + 2 * offset;
height : constant integer := 128 + 2 * offset;
width : constant integer := 10 + offset + 6 * (sprite (index).width + 8);
height : constant integer := attribute.count * core.icon + 2 * offset + 10 + sprite (index).height;
move_x : constant integer := (if center then (core.window_width - width) / 2 else x);
move_y : constant integer := (if center then (core.window_height - height) / 2 else y);
move : integer := 0;
@ -99,12 +99,17 @@ package body unit is
loop
move := attribute.codex'pos (data) * core.icon;
--
ui.draw_icon ( move_x + view_width + 8 + offset, move_y + offset + move);
attribute.draw (data, move_x + view_width + 8 + offset, move_y + offset + move);
ui.draw_icon ( move_x + view_width + 12 + offset, move_y + offset + move);
attribute.draw (data, move_x + view_width + 12 + offset, move_y + offset + move);
--
core.write (integer'image (trait (index).attributes (data)), move_x + view_width + 8 + offset + core.icon, move_y + offset + move, 16#999999#);
core.write (integer'image (trait (index).attributes (data)), move_x + view_width + 12 + offset + core.icon, move_y + offset + move, 16#999999#);
core.write (" /", move_x + view_width + 24 + offset + core.icon, move_y + offset + move, 16#CCCCCC#);
core.write (integer'image (attribute.base_limit'last), move_x + view_width + 40 + offset + core.icon, move_y + offset + move, 16#CCCCCC#);
core.write (integer'image (attribute.base_limit'last), move_x + view_width + 36 + offset + core.icon, move_y + offset + move, 16#CCCCCC#);
end loop;
for animate in animation
loop
draw (index, animate, move_x + offset + animation'pos (animate) * (sprite (index).width + 8), move_y + offset + 8 + core.icon * attribute.count);
ui.draw_icon_menu (move_x + offset + animation'pos (animate) * (sprite (index).width + 8), move_y + offset + 8 + core.icon * attribute.count, sprite (index).width, sprite (index).height);
end loop;
end stat;

View File

@ -166,7 +166,7 @@ package unit is
("Vampire ", faction.necropolis, (others => 1), effect.none),
("Vampire Lord ", faction.necropolis, (others => 1), effect.none),
("Lich ", faction.necropolis, (others => 1), effect.none),
("Power Lich ", faction.necropolis, (others => 1), effect.none),
("Power Lich ", faction.necropolis, (6, 3, 9, 7), effect.none),
("Black Knight ", faction.necropolis, (others => 1), effect.none),
("Dread Knight ", faction.necropolis, (others => 1), effect.none),
("Bone Dragon ", faction.necropolis, (others => 1), effect.none),