Refactored player information...
This commit is contained in:
parent
19d3e1efa2
commit
430a3328bf
@ -149,7 +149,7 @@ procedure main is
|
|||||||
x : constant integer := preview_width + core.icon;
|
x : constant integer := preview_width + core.icon;
|
||||||
y : constant integer := core.icon;
|
y : constant integer := core.icon;
|
||||||
width : constant integer := side_panel - 2 * core.icon;
|
width : constant integer := side_panel - 2 * core.icon;
|
||||||
height : constant integer := chad.view_height + 8 * core.icon + 3 * core.base + 2 * offset;
|
height : constant integer := chad.view_height + 11 * core.icon + 3 * core.base + 2 * offset;
|
||||||
more : constant natural := 10;
|
more : constant natural := 10;
|
||||||
less : constant natural := 5;
|
less : constant natural := 5;
|
||||||
side : constant integer := chad.view_width + attribute.count * core.icon;
|
side : constant integer := chad.view_width + attribute.count * core.icon;
|
||||||
@ -161,19 +161,15 @@ procedure main is
|
|||||||
ui.draw_text_box (at_x + chad.view_width, at_y, width - chad.view_width - 2 * offset, core.icon);
|
ui.draw_text_box (at_x + chad.view_width, at_y, width - chad.view_width - 2 * offset, core.icon);
|
||||||
ui.write (chad.description (player_1.index).name.all, at_x + chad.view_width + less, at_y + less);
|
ui.write (chad.description (player_1.index).name.all, at_x + chad.view_width + less, at_y + less);
|
||||||
--
|
--
|
||||||
ui.draw_text_box (at_x + side, at_y + 1 * core.icon, width - side - 2 * offset, core.icon);
|
ui.draw_text (chad.description (player_1.index).title.all, at_x + side, at_y + 1 * core.icon, width - side - 2 * offset, core.icon, more);
|
||||||
ui.draw_text_box (at_x + side, at_y + 2 * core.icon, width - side - 2 * offset, core.icon);
|
ui.draw_text ("Level" & player_1.level'image, at_x + side, at_y + 2 * core.icon, width - side - 2 * offset, core.icon, more);
|
||||||
--
|
|
||||||
ui.write (chad.description (player_1.index).title.all, at_x + side + more, at_y + 1 * core.icon + more, code => true);
|
|
||||||
ui.write ("Level" & player_1.level'image, at_x + side + more, at_y + 2 * core.icon + more, code => true);
|
|
||||||
--
|
--
|
||||||
at_x := x + chad.view_width + offset;
|
at_x := x + chad.view_width + offset;
|
||||||
at_y := y + core.icon + offset;
|
at_y := y + core.icon + offset;
|
||||||
--
|
--
|
||||||
for index in attribute.enumeration loop
|
for index in attribute.enumeration loop
|
||||||
ui.draw_icon (attribute.icon (index), attribute.description (index).text.all, at_x, at_y);
|
ui.draw_icon (attribute.icon (index), attribute.description (index).text.all, at_x, at_y);
|
||||||
ui.draw_text_box (at_x, at_y + core.icon, core.icon, core.icon);
|
ui.draw_text (player_1.attributes (index).value'image, at_x, at_y + core.icon, core.icon, core.icon, more);
|
||||||
ui.write (player_1.attributes (index).value'image, at_x + less, at_y + core.icon + more, code => true);
|
|
||||||
--
|
--
|
||||||
at_x := at_x + core.icon;
|
at_x := at_x + core.icon;
|
||||||
end loop;
|
end loop;
|
||||||
@ -189,13 +185,9 @@ procedure main is
|
|||||||
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 + 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.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.draw_text_box (at_x + side, at_y - core.icon, width - side - 2 * offset, core.icon);
|
ui.draw_text ("Health", at_x + side, at_y - core.icon, width - side - 2 * offset, core.icon, more);
|
||||||
ui.draw_text_box (at_x + side, at_y, width - side - 2 * offset, core.icon);
|
ui.draw_text ("Mana", at_x + side, at_y, width - side - 2 * offset, core.icon, more);
|
||||||
ui.draw_text_box (at_x + side, at_y + core.icon, width - side - 2 * offset, core.icon);
|
ui.draw_text ("Movement", at_x + side, at_y + core.icon, width - side - 2 * offset, core.icon, more);
|
||||||
--
|
|
||||||
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.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.mana.value'image & " /" & player_1.mana.limit'image, at_x + core.icon, at_y + more, code => true);
|
||||||
@ -221,20 +213,11 @@ procedure main is
|
|||||||
end if;
|
end if;
|
||||||
end loop;
|
end loop;
|
||||||
--
|
--
|
||||||
ui.draw_text_box (x => at_x + (equipment.kind'pos (equipment.kind'last) + 1) * core.icon,
|
ui.draw_text ("Equipment", at_x + 8 * core.icon, at_y, width - 8 * core.icon - 2 * offset, core.icon, more);
|
||||||
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 + more,
|
|
||||||
y => at_y + more,
|
|
||||||
code => true);
|
|
||||||
--
|
--
|
||||||
at_y := at_y + core.icon;
|
at_y := at_y + core.icon;
|
||||||
--
|
--
|
||||||
ui.draw_text_box (at_x + side, at_y, width - side - 2 * offset, core.icon);
|
ui.draw_text ("Skills", at_x + side, at_y, width - side - 2 * offset, core.icon, more);
|
||||||
ui.write ("Skills", at_x + side + more, at_y + more, code => true);
|
|
||||||
--
|
--
|
||||||
for index in 0 .. chad.skill_limit - 1 loop
|
for index in 0 .. chad.skill_limit - 1 loop
|
||||||
ui.draw_icon (skill.icon (player_1.skills (index)), skill.description (player_1.skills (index)).text.all, at_x + index * core.icon, at_y);
|
ui.draw_icon (skill.icon (player_1.skills (index)), skill.description (player_1.skills (index)).text.all, at_x + index * core.icon, at_y);
|
||||||
@ -260,7 +243,11 @@ procedure main is
|
|||||||
end loop;
|
end loop;
|
||||||
end loop;
|
end loop;
|
||||||
--
|
--
|
||||||
ui.draw_text ("Heyo world!" & character'val (10) & "Goodcyaa world!", 600, 600, 0, 0);
|
at_y := at_y + 3 * core.icon;
|
||||||
|
--
|
||||||
|
ui.draw_text (world.day_name (7).all, at_x, at_y + 0 * core.icon, width - 2 * offset, core.icon, more, 0);
|
||||||
|
ui.draw_text (world.week_name (52).all, at_x, at_y + 1 * core.icon, width - 2 * offset, core.icon, more, 0);
|
||||||
|
ui.draw_text (world.month_name (2).all, at_x, at_y + 2 * core.icon, width - 2 * offset, core.icon, more, 0);
|
||||||
end player_information;
|
end player_information;
|
||||||
|
|
||||||
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -327,14 +327,12 @@ package body ui is
|
|||||||
|
|
||||||
------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
procedure draw_text (text : in string; x, y, width, height : in integer; tint : in core.colour := (others => 255)) is
|
procedure draw_text (text : in string; x, y, width, height : in integer; offset, border : in natural := 0; tint : in core.colour := (others => 255)) is
|
||||||
offset : constant integer := 8;
|
|
||||||
--
|
|
||||||
new_width : constant natural := (if width < core.base then monowidth * core.string_width (text) else width);
|
new_width : constant natural := (if width < core.base then monowidth * core.string_width (text) else width);
|
||||||
new_height : constant natural := (if height < core.base then monoheight * core.string_height (text) else height);
|
new_height : constant natural := (if height < core.base then monoheight * core.string_height (text) else height);
|
||||||
begin
|
begin
|
||||||
draw_text_box (x, y, new_width + 2 * offset, new_height + 2 * offset);
|
draw_text_box (x, y, new_width + 2 * border, new_height + 2 * border);
|
||||||
write (text, x + offset, y + offset, tint, code => true);
|
write (text, x + border + offset, y + border + offset, tint, code => true);
|
||||||
end draw_text;
|
end draw_text;
|
||||||
|
|
||||||
------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------
|
||||||
|
@ -44,7 +44,7 @@ package ui is
|
|||||||
procedure draw_frame (description : in string; x, y, width, height : in integer; action : core.pointer := core.idle_skip'access);
|
procedure draw_frame (description : in string; x, y, width, height : in integer; action : core.pointer := core.idle_skip'access);
|
||||||
procedure draw_button (text, description : in string; icon : in core.sprite; x, y, width, height : in integer; action : core.pointer := core.idle_skip'access);
|
procedure draw_button (text, description : in string; icon : in core.sprite; x, y, width, height : in integer; action : core.pointer := core.idle_skip'access);
|
||||||
|
|
||||||
procedure draw_text (text : in string; x, y, width, height : in integer; tint : in core.colour := (others => 255));
|
procedure draw_text (text : in string; x, y, width, height : in integer; offset, border : in natural := 0; tint : in core.colour := (others => 255));
|
||||||
|
|
||||||
procedure draw_check_box (x, y : in integer; on : in out boolean; text : in string);
|
procedure draw_check_box (x, y : in integer; on : in out boolean; text : in string);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user