From bcbc66d8e14769111f9fd1f456113541d096dcec Mon Sep 17 00:00:00 2001 From: xolatile Date: Fri, 17 May 2024 19:37:52 -0400 Subject: [PATCH] Work in progress on equipment, works so far... --- source/chad.adb | 12 +++++++++++- source/equipment.adb | 16 ++++++++++++---- source/equipment.ads | 4 +++- source/main.adb | 2 +- 4 files changed, 27 insertions(+), 7 deletions(-) diff --git a/source/chad.adb b/source/chad.adb index 042b174..991b498 100644 --- a/source/chad.adb +++ b/source/chad.adb @@ -83,8 +83,18 @@ package body chad is size => 15, code => true); -- - --~attribute.draw_points (player.attributes, x, y, true); + attribute.draw_points (player.attributes, x, y + 96 + 2 * offset, false); --~skill.draw_points (player.skills, x + core.icon * 3, y, true); + -- + for index_y in 0 .. 3 loop + for index_x in 0 .. 5 loop + ui.draw_icon (data => equipment.icon_sprite (player.items (6 * index_y + index_x)), + text => equipment.trait (player.items (6 * index_y + index_x)).name, + x => x + index_x * core.icon, + y => y + 96 + 3 * offset + 2 * core.icon + index_y * core.icon); + --~equipment.draw_icon (player.items (), x + index_x * core.icon, y + 96 + 3 * offset + 2 * core.icon + index_y * core.icon); + end loop; + end loop; end draw_data; ------------------------------------------------------------------------------------------ diff --git a/source/equipment.adb b/source/equipment.adb index e19b404..d22d992 100644 --- a/source/equipment.adb +++ b/source/equipment.adb @@ -16,7 +16,8 @@ package body equipment is declare folder : constant string := core.lowercase (slot'image (trait (index).kind)); file : constant string := core.lowercase (enumeration'image (index)); begin - sprite (index) := core.import_sprite ("./sprite/equipment/" & folder & "/" & file & ".png", 4, 6); + sprite (index) := core.import_sprite ("./sprite/equipment/" & folder & "/" & file & ".png", 4, 6); + icon_sprite (index) := core.import_sprite ("./sprite/equipment/icon/" & file & ".png", 1, 1); end; end loop; end configure; @@ -25,9 +26,9 @@ package body equipment is procedure draw (index : in enumeration; state : in core.animation; x, y : in integer) is begin - if index = none then - return; - end if; + --~if index = none then + --~return; + --~end if; -- core.draw (sprite (index), x, y, state => state); end draw; @@ -43,6 +44,13 @@ package body equipment is end if; end draw_plus; + ------------------------------------------------------------------------------------------ + + --~procedure draw_icon (index : in enumeration; x, y : in integer) is + --~begin + --~core.draw (icon_sprite (index), x, y, factor => 1); + --~end draw_icon; + ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ end equipment; diff --git a/source/equipment.ads b/source/equipment.ads index a5be2d7..afa2400 100644 --- a/source/equipment.ads +++ b/source/equipment.ads @@ -195,7 +195,8 @@ package equipment is lime_hood => ("Lime Hood ", head, (0, 0, 0, 0, 0, 0), faction.neutral, effect.none) ); - sprite : array (enumeration) of core.sprite; + sprite : array (enumeration) of core.sprite; + icon_sprite : array (enumeration) of core.sprite; ------------------------------------------------------------------------------------------ @@ -203,6 +204,7 @@ package equipment is procedure draw (index : in enumeration; state : in core.animation; x, y : in integer); procedure draw_plus (index : in enumeration; state : in core.animation; x, y : in integer); + --~procedure draw_icon (index : in enumeration; x, y : in integer); ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ diff --git a/source/main.adb b/source/main.adb index e288749..de7e121 100644 --- a/source/main.adb +++ b/source/main.adb @@ -299,7 +299,7 @@ begin -- if view_list (status_preview_panel) then ui.draw_tiny_menu (preview_width, 0, side_panel, preview_height); - chad.draw_data (player, preview_width + 32, 32); + chad.draw_data (world.map.chad_data (1), preview_width + 32, 32); --~ui.draw_state_box (preview_width + 32, 32); end if; --