From c74d2f647623385969307e21155df74a8161fcd7 Mon Sep 17 00:00:00 2001 From: xolatile Date: Wed, 13 Mar 2024 11:28:18 -0400 Subject: [PATCH] Added animations to unit view menu. --- source/main.adb | 2 +- source/unit.adb | 17 +++++++++++------ source/unit.ads | 2 +- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/source/main.adb b/source/main.adb index 9e77392..7a1874f 100644 --- a/source/main.adb +++ b/source/main.adb @@ -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); diff --git a/source/unit.adb b/source/unit.adb index 8a4bda0..8360678 100644 --- a/source/unit.adb +++ b/source/unit.adb @@ -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; diff --git a/source/unit.ads b/source/unit.ads index 0a1b958..66ad6a2 100644 --- a/source/unit.ads +++ b/source/unit.ads @@ -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),