Work in progress on equipment, works so far...

This commit is contained in:
Ognjen Milan Robovic 2024-05-17 19:37:52 -04:00
parent 2cd60b068e
commit bcbc66d8e1
4 changed files with 27 additions and 7 deletions

View File

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

View File

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

View File

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

View File

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