Work in progress on unit sub-menu...

This commit is contained in:
Ognjen Milan Robovic 2024-06-09 14:39:09 -04:00
parent 3f5351fce6
commit 935bd03170
2 changed files with 21 additions and 4 deletions

View File

@ -25,7 +25,7 @@ package unit is
kind : faction.enumeration := faction.neutral; kind : faction.enumeration := faction.neutral;
limit : natural := 0; limit : natural := 0;
attributes : attribute.bonus := (others => 0); attributes : attribute.bonus := (others => 0);
hire_fee : natural := 0; hiring_fee : natural := 0;
weekly_fee : natural := 0; weekly_fee : natural := 0;
battle_fee : natural := 0; battle_fee : natural := 0;
equipments : equipment.equip_array := equipment.default; equipments : equipment.equip_array := equipment.default;

View File

@ -2,7 +2,7 @@
-- --
-- GNU General Public Licence (version 3 or later) -- GNU General Public Licence (version 3 or later)
with core, ui, attribute, skill, resource, equipment, unit, construction, chad, effect; with core, ui, attribute, skill, resource, faction, equipment, unit, construction, chad, effect;
use type core.cursor_code; use type core.cursor_code;
use type core.signal_code; use type core.signal_code;
@ -1043,15 +1043,32 @@ package body world is
------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------
procedure show_unit is procedure show_unit is
data : unit.definition := unit.description (show_unit_data);
--
offset : constant integer := 8; offset : constant integer := 8;
width : constant integer := 600; width : constant integer := 640;
height : constant integer := 600; height : constant integer := 600;
at_x : integer := core.center_x (width) + offset; at_x : integer := core.center_x (width) + offset;
at_y : integer := core.center_y (height) + offset; at_y : integer := core.center_y (height) + offset;
begin begin
ui.draw_frame (core.center_x (width), core.center_y (height), width, height); ui.draw_frame (core.center_x (width), core.center_y (height), width, height);
-- --
ui.draw_sprite (unit.view (show_unit_data), unit.description (show_unit_data).name.all, at_x, at_y, 0); ui.draw_sprite (unit.view (show_unit_data), data.name.all, at_x, at_y, 0);
--
at_y := at_y + unit.view_height;
--
ui.draw_separator (at_x, at_y, width - 2 * offset);
--
at_y := at_y + core.base;
--
ui.draw_text ("Hiring fee:" & data.hiring_fee'image & character'val (10) &
"Weekly fee:" & data.weekly_fee'image & character'val (10) &
"Battle fee:" & data.battle_fee'image,
at_x, at_y, (width - 3 * offset) / 2 - 20, 0, 0, 10);
ui.draw_text ("Faction: " & faction.description (data.kind).name.all & character'val (10) &
"Stack:" & data.limit'image & character'val (10) &
"Bonus: " & attribute.description (faction.description (data.kind).bonus_attribute).name.all,
at_x + (width - offset) / 2, at_y, (width - 3 * offset) / 2 - 20, 0, 0, 10);
end show_unit; end show_unit;
------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------