Construction unstringing...

This commit is contained in:
Ognjen Milan Robovic 2024-06-01 17:27:18 -04:00
parent 48ff5347a8
commit 103ce2e4c1
3 changed files with 23 additions and 12 deletions

View File

@ -9,9 +9,27 @@ package body construction is
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
procedure configure is procedure configure is
procedure define (index : in enumeration; name : in string; kind : in faction.enumeration; price : in resource.price;
--
frames : in natural := 1;
evoke : in effect.information := effect.none) is
begin
description (index).name := core.unbound (name);
description (index).kind := kind;
description (index).price := price;
description (index).frames := frames;
description (index).evoke := evoke;
end define;
begin begin
core.echo (core.comment, "Configuring construction components..."); core.echo (core.comment, "Configuring construction components...");
-- --
define (house, "Dwarf House", faction.dwarf, (others => 0));
define (cottage, "Fairy Cottage", faction.fairy, (others => 0));
define (shack, "Gnoll Shack", faction.gnoll, (others => 0));
define (homestead, "Kobold Homestead", faction.kobold, (others => 0));
define (hut, "Goblin Hut", faction.goblin, (others => 0));
define (den, "Imp Den", faction.imp, (others => 0));
--
for index in enumeration loop for index in enumeration loop
declare folder : constant string := core.lowercase (faction.enumeration'image (description (index).kind)); declare folder : constant string := core.lowercase (faction.enumeration'image (description (index).kind));
file : constant string := core.lowercase (enumeration'image (index)); file : constant string := core.lowercase (enumeration'image (index));
@ -36,7 +54,7 @@ package body construction is
draw (index, x, y); draw (index, x, y);
-- --
if core.cursor_inside (x, y, sprite (index).width, sprite (index).height) and core.cursor_mode = core.cursor_middle and not ui.prioritize then if core.cursor_inside (x, y, sprite (index).width, sprite (index).height) and core.cursor_mode = core.cursor_middle and not ui.prioritize then
core.write_text_box (description (index).name); core.write_text_box (core.bound (description (index).name));
end if; end if;
end draw_plus; end draw_plus;

View File

@ -15,7 +15,7 @@ package construction is
------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------
type definition is record type definition is record
name : core.short_string; name : core.unstring;
kind : faction.enumeration; kind : faction.enumeration;
price : resource.price; price : resource.price;
frames : integer; frames : integer;
@ -26,16 +26,8 @@ package construction is
count : constant natural := enumeration'pos (enumeration'last) + 1; count : constant natural := enumeration'pos (enumeration'last) + 1;
description : constant array (enumeration) of definition := ( description : array (enumeration) of definition;
house => ("Dwarf House ", faction.dwarf, (others => 0), 1, effect.none), sprite : array (enumeration) of core.sprite;
cottage => ("Fairy Cottage ", faction.fairy, (others => 0), 1, effect.none),
shack => ("Gnoll Shack ", faction.gnoll, (others => 0), 1, effect.none),
homestead => ("Kobold Homestead ", faction.kobold, (others => 0), 1, effect.none),
hut => ("Goblin Hut ", faction.goblin, (others => 0), 1, effect.none),
den => ("Imp Den ", faction.imp, (others => 0), 1, effect.none)
);
sprite : array (enumeration) of core.sprite;
------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------

View File

@ -15,6 +15,7 @@ package body equipment is
procedure configure is procedure configure is
procedure define (index : in enumeration; name : in string; kind : in slot; procedure define (index : in enumeration; name : in string; kind : in slot;
--
attributes : in attribute.bonus := (others => 0); attributes : in attribute.bonus := (others => 0);
favor : in faction.enumeration := faction.neutral; favor : in faction.enumeration := faction.neutral;
evoke : in effect.information := effect.none) is evoke : in effect.information := effect.none) is