Finished saving equipment and inventory...

This commit is contained in:
Ognjen Milan Robovic 2024-05-28 06:53:48 -04:00
parent 34edd2ef72
commit b6cef84f28
2 changed files with 26 additions and 8 deletions

View File

@ -144,9 +144,18 @@ package body chad is
skill.save_points (here, data.skills); skill.save_points (here, data.skills);
resource.save_points (here, data.resources); resource.save_points (here, data.resources);
material.save_points (here, data.materials); material.save_points (here, data.materials);
--~equipments : equipment.equip_array; --
--~item_count : natural; for index in equipment.slot loop
--~items : item_array; core.io.write (here, equipment.enumeration'pos (data.equipments (index)));
end loop;
--
core.io.write (here, data.item_count);
--
if data.item_count > 0 then
for index in 0 .. data.item_count - 1 loop
core.io.write (here, equipment.enumeration'pos (data.items (index)));
end loop;
end if;
end save_value; end save_value;
------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------
@ -167,9 +176,18 @@ package body chad is
skill.load_points (here, data.skills); skill.load_points (here, data.skills);
resource.load_points (here, data.resources); resource.load_points (here, data.resources);
material.load_points (here, data.materials); material.load_points (here, data.materials);
--~equipments : equipment.equip_array; --
--~item_count : natural; for index in equipment.slot loop
--~items : item_array; core.io.read (here, this); data.equipments (index) := equipment.enumeration'val (this);
end loop;
--
core.io.read (here, data.item_count);
--
if data.item_count > 0 then
for index in 0 .. data.item_count - 1 loop
core.io.read (here, this); data.items (index) := equipment.enumeration'val (this);
end loop;
end if;
end load_value; end load_value;
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

View File

@ -265,7 +265,7 @@ begin
core.cursor_mode := core.cursor_none; core.cursor_mode := core.cursor_none;
--~world.load ("heyo"); world.load ("heyo");
ui.active := ui.style'val (faction.enumeration'pos (chad.trait (player.index).kind) + 1); ui.active := ui.style'val (faction.enumeration'pos (chad.trait (player.index).kind) + 1);
@ -308,7 +308,7 @@ begin
end loop; end loop;
-- --
resource.draw_points (world.map.chads (1).resources, (preview_width - 5 * core.icon * resource.count) / 2, core.base); resource.draw_points (world.map.chads (1).resources, (preview_width - 5 * core.icon * resource.count) / 2, core.base);
material.draw_points (world.map.chads (1).materials, core.icon, 2 * core.base); material.draw_points (world.map.chads (1).materials, (preview_width - core.icon * material.count) / 2, core.base + core.icon);
-- --
signal_list (core.signal_mode).all; signal_list (core.signal_mode).all;
-- --