From 572372a3bf811058594ac99383f06e7ed7ac807e Mon Sep 17 00:00:00 2001 From: xolatile Date: Sat, 11 May 2024 00:49:15 -0400 Subject: [PATCH] Added skill and resource point lists in... --- source/attribute.adb | 2 +- source/chad.adb | 4 +++- source/resource.adb | 24 ++++++++++++++++++++++++ source/resource.ads | 2 ++ source/skill.adb | 24 ++++++++++++++++++++++++ source/skill.ads | 2 ++ 6 files changed, 56 insertions(+), 2 deletions(-) diff --git a/source/attribute.adb b/source/attribute.adb index f4ae49a..7c8baed 100644 --- a/source/attribute.adb +++ b/source/attribute.adb @@ -53,7 +53,7 @@ package body attribute is height => core.icon); -- ui.write (text => data (index)'image, - x => x + offset.x * enumeration'pos (index) - 6 + offset.y, + x => x + offset.x * enumeration'pos (index) - 3 + offset.y, y => y + offset.y * enumeration'pos (index) + 6 + offset.x, size => 18); end loop; diff --git a/source/chad.adb b/source/chad.adb index f23bdf5..1484088 100644 --- a/source/chad.adb +++ b/source/chad.adb @@ -39,7 +39,9 @@ package body chad is procedure draw_data (player : in data; x, y : in integer) is begin - attribute.draw_points (player.attributes, x, y, true); + attribute.draw_points (player.attributes, x, y, true); + skill.draw_points (player.skills, x + core.icon * 3, y, true); + resource.draw_points (player.resources, x + core.icon * 6, y, false); end draw_data; ------------------------------------------------------------------------------------------ diff --git a/source/resource.adb b/source/resource.adb index eb0d267..1dcb750 100644 --- a/source/resource.adb +++ b/source/resource.adb @@ -35,6 +35,30 @@ package body resource is end loop; end configure; + ------------------------------------------------------------------------------------------ + + procedure draw_points (data : in points; x, y : in integer; list : in boolean) is + offset : constant core.vector := ((if list then 0 else core.icon), + (if list then core.icon else 0)); + begin + for index in enumeration loop + ui.draw_icon (data => sprite (index), + text => trait (index).text, + x => x + offset.x * enumeration'pos (index), + y => y + offset.y * enumeration'pos (index)); + -- + ui.draw_icon_menu (x => x + offset.x * enumeration'pos (index) + offset.y, + y => y + offset.y * enumeration'pos (index) + offset.x, + width => core.icon, + height => core.icon); + -- + ui.write (text => data (index)'image, + x => x + offset.x * enumeration'pos (index) - 3 + offset.y, + y => y + offset.y * enumeration'pos (index) + 6 + offset.x, + size => 18); + end loop; + end draw_points; + ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ end resource; diff --git a/source/resource.ads b/source/resource.ads index aa4bee8..1730c2f 100644 --- a/source/resource.ads +++ b/source/resource.ads @@ -39,6 +39,8 @@ package resource is procedure configure; + procedure draw_points (data : in points; x, y : in integer; list : in boolean); + ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ end resource; diff --git a/source/skill.adb b/source/skill.adb index d916c77..9314900 100644 --- a/source/skill.adb +++ b/source/skill.adb @@ -39,6 +39,30 @@ package body skill is end loop; end configure; + ------------------------------------------------------------------------------------------ + + procedure draw_points (data : in points; x, y : in integer; list : in boolean) is + offset : constant core.vector := ((if list then 0 else core.icon), + (if list then core.icon else 0)); + begin + for index in enumeration loop + ui.draw_icon (data => sprite (index), + text => trait (index).text, + x => x + offset.x * enumeration'pos (index), + y => y + offset.y * enumeration'pos (index)); + -- + ui.draw_icon_menu (x => x + offset.x * enumeration'pos (index) + offset.y, + y => y + offset.y * enumeration'pos (index) + offset.x, + width => core.icon, + height => core.icon); + -- + ui.write (text => data (index)'image, + x => x + offset.x * enumeration'pos (index) - 3 + offset.y, + y => y + offset.y * enumeration'pos (index) + 6 + offset.x, + size => 18); + end loop; + end draw_points; + ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ end skill; diff --git a/source/skill.ads b/source/skill.ads index 4bd5fd3..c6b214e 100644 --- a/source/skill.ads +++ b/source/skill.ads @@ -53,6 +53,8 @@ package skill is procedure configure; + procedure draw_points (data : in points; x, y : in integer; list : in boolean); + ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ end skill;