Refactored player information again...

This commit is contained in:
Ognjen Milan Robovic 2024-06-06 12:34:30 -04:00
parent 551608e391
commit 7ab9ee3918

View File

@ -149,6 +149,7 @@ procedure main is
offset : constant integer := 8;
more : constant natural := 10;
less : constant natural := 5;
side : constant integer := chad.view_width + attribute.count * core.icon;
at_x : integer := 0;
at_y : integer := 0;
begin
@ -157,23 +158,23 @@ procedure main is
ui.draw_text_box (x + chad.view_width + offset, y + offset, width - chad.view_width - 2 * offset, core.icon);
ui.write (chad.description (player_1.index).name.all, x + chad.view_width + offset + less, y + offset + less);
--
ui.draw_text_box (x => x + chad.view_width + attribute.count * core.icon + offset,
ui.draw_text_box (x => x + side + offset,
y => y + core.icon + offset,
width => width - chad.view_width - attribute.count * core.icon - 2 * offset,
width => width - side - 2 * offset,
height => core.icon);
--
ui.write (text => chad.description (player_1.index).title.all,
x => x + chad.view_width + attribute.count * core.icon + offset + more,
x => x + side + offset + more,
y => y + core.icon + offset + more,
code => true);
--
ui.draw_text_box (x => x + chad.view_width + attribute.count * core.icon + offset,
ui.draw_text_box (x => x + side + offset,
y => y + 2 * core.icon + offset,
width => width - chad.view_width - attribute.count * core.icon - 2 * offset,
width => width - side - 2 * offset,
height => core.icon);
--
ui.write (text => "Level" & player_1.level'image,
x => x + chad.view_width + attribute.count * core.icon + offset + more,
x => x + side + offset + more,
y => y + 2 * core.icon + offset + more,
code => true);
--
@ -191,13 +192,21 @@ procedure main is
at_x := x + offset;
at_y := y + offset + chad.view_height + core.icon;
--
ui.draw_tiny_fill_bar (at_x, at_y + 0 * core.icon, width - 2 * offset, float (player_1.health.value) / float (player_1.health.limit), (127, 0, 0, 255));
ui.draw_tiny_fill_bar (at_x, at_y + 1 * core.icon, width - 2 * offset, float (player_1.mana.value) / float (player_1.mana.limit), (0, 0, 127, 255));
ui.draw_tiny_fill_bar (at_x, at_y + 2 * core.icon, width - 2 * offset, float (player_1.movement.value) / float (player_1.movement.limit), (0, 127, 0, 255));
ui.draw_tiny_fill_bar (at_x, at_y + 0 * core.icon, side, float (player_1.health.value) / float (player_1.health.limit), (127, 0, 0, 255));
ui.draw_tiny_fill_bar (at_x, at_y + 1 * core.icon, side, float (player_1.mana.value) / float (player_1.mana.limit), (0, 0, 127, 255));
ui.draw_tiny_fill_bar (at_x, at_y + 2 * core.icon, side, float (player_1.movement.value) / float (player_1.movement.limit), (0, 127, 0, 255));
--
ui.write ("Health " & player_1.health.value'image & " /" & player_1.health.limit'image, at_x + core.icon, at_y - core.icon + more, code => true);
ui.write ("Mana " & player_1.mana.value'image & " /" & player_1.mana.limit'image, at_x + core.icon, at_y + more, code => true);
ui.write ("Movement" & player_1.movement.value'image & " /" & player_1.movement.limit'image, at_x + core.icon, at_y + core.icon + more, code => true);
ui.draw_text_box (at_x + side, at_y - core.icon, width - side - 2 * offset, core.icon);
ui.draw_text_box (at_x + side, at_y, width - side - 2 * offset, core.icon);
ui.draw_text_box (at_x + side, at_y + core.icon, width - side - 2 * offset, core.icon);
--
ui.write ("Health", at_x + side + more, at_y - core.icon + more, code => true);
ui.write ("Mana", at_x + side + more, at_y + more, code => true);
ui.write ("Movement", at_x + side + more, at_y + core.icon + more, code => true);
--
ui.write (player_1.health.value'image & " /" & player_1.health.limit'image, at_x + core.icon, at_y - core.icon + more, code => true);
ui.write (player_1.mana.value'image & " /" & player_1.mana.limit'image, at_x + core.icon, at_y + more, code => true);
ui.write (player_1.movement.value'image & " /" & player_1.movement.limit'image, at_x + core.icon, at_y + core.icon + more, code => true);
--
at_x := x + offset;
at_y := y + offset + chad.view_height + 3 * core.icon;
@ -228,6 +237,9 @@ procedure main is
--
at_y := at_y + core.icon;
--
ui.draw_text_box (at_x + side, at_y, width - side - 2 * offset, 3 * core.icon);
ui.write ("Inventory", at_x + side + more, at_y + core.icon + more, code => true);
--
for index_y in 0 .. 2 loop
for index_x in 0 .. 7 loop
ui.draw_icon (data => equipment.icon (player_1.items (8 * index_y + index_x)),
@ -518,7 +530,7 @@ begin
world.save ("heyo");
--~world.mapshot (folder & "/mapshot.png");
--~world.mapshot (core.folder & "/mapshot.png");
------------------------------------------------------------------------------------------