Added player equipment...

This commit is contained in:
Ognjen Milan Robovic 2024-06-06 10:50:00 -04:00
parent e34d94adb6
commit 8071b8fb81
2 changed files with 40 additions and 0 deletions

View File

@ -197,6 +197,33 @@ procedure main is
ui.write ("Mana " & player_1.mana.value'image & " /" & player_1.mana.limit'image, at_x + core.icon, at_y + 10, code => true); ui.write ("Mana " & player_1.mana.value'image & " /" & player_1.mana.limit'image, at_x + core.icon, at_y + 10, code => true);
ui.write ("Movement" & player_1.movement.value'image & " /" & player_1.movement.limit'image, at_x + core.icon, at_y + core.icon + 10, code => true); ui.write ("Movement" & player_1.movement.value'image & " /" & player_1.movement.limit'image, at_x + core.icon, at_y + core.icon + 10, code => true);
-- --
at_x := x + offset;
at_y := y + offset + chad.view_height + 3 * core.icon;
--
for index in equipment.kind loop
if equipment.enumeration'pos (player_1.equipments (index)) /= equipment.enumeration'pos (equipment.none) then
ui.draw_overicon (data => equipment.icon (player_1.equipments (index)),
text => equipment.description (player_1.equipments (index)).name.all,
x => at_x + equipment.kind'pos (index) * core.icon,
y => at_y);
else
ui.draw_overicon (data => equipment.slot (index),
text => "Slot '" & core.lowercase (equipment.kind (index)'image) & "' is empty.",
x => at_x + equipment.kind'pos (index) * core.icon,
y => at_y);
end if;
end loop;
--
ui.draw_text_box (x => at_x + (equipment.kind'pos (equipment.kind'last) + 1) * core.icon,
y => at_y,
width => width - (equipment.kind'pos (equipment.kind'last) + 1) * core.icon - 2 * offset,
height => core.icon);
--
ui.write (text => "Equipment",
x => at_x + (equipment.kind'pos (equipment.kind'last) + 1) * core.icon + 10,
y => at_y + 10,
code => true);
--
--~for index_y in 0 .. 3 loop --~for index_y in 0 .. 3 loop
--~for index_x in 0 .. 5 loop --~for index_x in 0 .. 5 loop
--~ui.draw_icon (data => equipment.icon (player_1.items (6 * index_y + index_x)), --~ui.draw_icon (data => equipment.icon (player_1.items (6 * index_y + index_x)),

View File

@ -174,6 +174,19 @@ package body ui is
core.draw (data, x, y, factor => 1); core.draw (data, x, y, factor => 1);
-- --
draw (overicon, x, y); draw (overicon, x, y);
--
if core.cursor_inside (x, y, core.icon / core.zoom, core.icon / core.zoom) then
prioritize := true;
--
draw (icon_selected, x, y);
--
core.write_help_box (text);
--
if core.cursor_mode = core.cursor_left then
action.all;
core.cursor_mode := core.cursor_none;
end if;
end if;
end draw_overicon; end draw_overicon;
------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------