42 lines
1.5 KiB
Ada
42 lines
1.5 KiB
Ada
with core, ui, menu, effect, magic;
|
|
|
|
use magic;
|
|
|
|
package body magic is
|
|
|
|
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
type sprite_array is array (codex) of core.sprite;
|
|
|
|
------------------------------------------------------------------------------------------
|
|
|
|
icon : sprite_array;
|
|
|
|
------------------------------------------------------------------------------------------
|
|
|
|
procedure configure is
|
|
begin
|
|
for index in codex
|
|
loop
|
|
declare
|
|
folder : constant string := core.lowercase (school'image (trait (index).kind));
|
|
file : constant string := core.lowercase (codex'image (index));
|
|
begin
|
|
icon (index) := core.load_sprite ("sprite/ui/magic/" & folder & "/" & file & ".png", 1, 1);
|
|
end;
|
|
end loop;
|
|
end configure;
|
|
|
|
------------------------------------------------------------------------------------------
|
|
|
|
procedure draw (index : in codex; x, y : in integer) is
|
|
offset : constant integer := 16;
|
|
begin
|
|
ui.draw_frame (x, y, icon (index).width + offset, icon (index).height + offset);
|
|
core.draw (icon (index), x + offset / 2, y + offset / 2);
|
|
end draw;
|
|
|
|
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
end magic;
|