Removing clutter...

This commit is contained in:
Ognjen Milan Robovic 2024-06-02 10:15:47 -04:00
parent 300c1b78e3
commit cb06f12d35
11 changed files with 34 additions and 218 deletions

View File

@ -3,7 +3,7 @@
set -xe set -xe
cd source cd source
gnatmake -gnatp -O3 -f -fstack-check -fno-exceptions -c main.adb gnatmake -O3 -fstack-check -fno-exceptions -c main.adb
gnatbind main.ali gnatbind main.ali
gnatlink -o xhads main.ali -lraylib gnatlink -o xhads main.ali -lraylib
mv xhads ../xhads mv xhads ../xhads

View File

@ -8,37 +8,6 @@ package body attribute is
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
procedure configure is
structure : ui.structure;
--
time : float := 0.0;
begin
time := core.time;
--
core.echo (core.comment, "Configuring" & count'image & " attribute components...");
--
structure.title := "Attribute Menu ";
structure.toggle := core.signal_a;
structure.show := false;
structure.center := false;
structure.resize := true;
structure.x := 60;
structure.y := 100;
structure.gui_n := count;
--
ui.add_structure (data => structure);
--
for index in enumeration loop
icon (index) := core.import_sprite (core.folder & "/icon/attribute/" & core.lowercase (enumeration'image (index)) & ".png", 1, 1);
--
ui.add_structure_button (icon (index), description (index).name, description (index).text);
end loop;
--
core.echo (core.success, "Successfully configured attribute information in" & natural'image (natural (1_000_000.0 * (core.time - time))) & " microseconds.");
end configure;
------------------------------------------------------------------------------------------
procedure draw_points (data : in points; x, y : in integer) is procedure draw_points (data : in points; x, y : in integer) is
move_x : integer := x; move_x : integer := x;
begin begin
@ -51,24 +20,6 @@ package body attribute is
end loop; end loop;
end draw_points; end draw_points;
------------------------------------------------------------------------------------------
procedure save_points (here : in core.io.file_type; data : in points) is
begin
for index in enumeration loop
core.save_point (here, data (index));
end loop;
end save_points;
------------------------------------------------------------------------------------------
procedure load_points (here : in core.io.file_type; data : out points) is
begin
for index in enumeration loop
core.load_point (here, data (index));
end loop;
end load_points;
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
end attribute; end attribute;

View File

@ -43,13 +43,8 @@ package attribute is
------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------
procedure configure;
procedure draw_points (data : in points; x, y : in integer); procedure draw_points (data : in points; x, y : in integer);
procedure save_points (here : in core.io.file_type; data : in points);
procedure load_points (here : in core.io.file_type; data : out points);
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
end attribute; end attribute;

View File

@ -140,10 +140,10 @@ package body chad is
core.save_point (here, data.mana); core.save_point (here, data.mana);
core.save_point (here, data.movement); core.save_point (here, data.movement);
-- --
attribute.save_points (here, data.attributes); for index in attribute.enumeration loop core.save_point (here, data.attributes (index)); end loop;
skill.save_points (here, data.skills); for index in skill.enumeration loop core.save_point (here, data.skills (index)); end loop;
resource.save_points (here, data.resources); for index in resource.enumeration loop core.save_point (here, data.resources (index)); end loop;
material.save_points (here, data.materials); for index in material.enumeration loop core.save_point (here, data.materials (index)); end loop;
-- --
for index in equipment.slot loop for index in equipment.slot loop
core.io.write (here, equipment.enumeration'pos (data.equipments (index))); core.io.write (here, equipment.enumeration'pos (data.equipments (index)));
@ -172,10 +172,10 @@ package body chad is
core.load_point (here, data.mana); core.load_point (here, data.mana);
core.load_point (here, data.movement); core.load_point (here, data.movement);
-- --
attribute.load_points (here, data.attributes); for index in attribute.enumeration loop core.load_point (here, data.attributes (index)); end loop;
skill.load_points (here, data.skills); for index in skill.enumeration loop core.load_point (here, data.skills (index)); end loop;
resource.load_points (here, data.resources); for index in resource.enumeration loop core.load_point (here, data.resources (index)); end loop;
material.load_points (here, data.materials); for index in material.enumeration loop core.load_point (here, data.materials (index)); end loop;
-- --
for index in equipment.slot loop for index in equipment.slot loop
core.io.read (here, this); data.equipments (index) := equipment.enumeration'val (this); core.io.read (here, this); data.equipments (index) := equipment.enumeration'val (this);

View File

@ -198,12 +198,33 @@ begin
--~core.play (core.import_song (core.c_string (core.folder & "/song/main_menu.ogg")).index); --~core.play (core.import_song (core.c_string (core.folder & "/song/main_menu.ogg")).index);
attribute.configure; core.echo (core.comment, "Configuring" & attribute.count'image & " attribute components...");
skill.configure; --
resource.configure; for index in attribute.enumeration loop
attribute.icon (index) := core.import_sprite (core.folder & "/icon/attribute/" & core.lowercase (attribute.enumeration'image (index)) & ".png", 1, 1);
end loop;
core.echo (core.comment, "Configuring" & skill.count'image & " skill components...");
--
for index in skill.enumeration loop
skill.icon (index) := core.import_sprite (core.folder & "/icon/skill/" & core.lowercase (skill.enumeration'image (index)) & ".png", 1, 1);
end loop;
core.echo (core.comment, "Configuring" & resource.count'image & " resource components...");
--
for index in resource.enumeration loop
resource.icon (index) := core.import_sprite (core.folder & "/icon/resource/" & core.lowercase (resource.enumeration'image (index)) & ".png", 1, 1);
end loop;
--~might.configure; --~might.configure;
magic.configure; magic.configure;
material.configure;
core.echo (core.comment, "Configuring" & material.count'image & " material components...");
--
for index in material.enumeration loop
material.icon (index) := core.import_sprite (core.folder & "/icon/material/" & core.lowercase (material.enumeration'image (index)) & ".png", 1, 1);
end loop;
equipment.configure; equipment.configure;
unit.configure; unit.configure;
deity.configure; deity.configure;

View File

@ -8,22 +8,6 @@ package body material is
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
procedure configure is
time : float := 0.0;
begin
time := core.time;
--
core.echo (core.comment, "Configuring" & count'image & " material components...");
--
for index in enumeration loop
icon (index) := core.import_sprite (core.folder & "/icon/material/" & core.lowercase (enumeration'image (index)) & ".png", 1, 1);
end loop;
--
core.echo (core.success, "Successfully configured resource information in" & natural'image (natural (1_000_000.0 * (core.time - time))) & " microseconds.");
end configure;
------------------------------------------------------------------------------------------
procedure draw_points (data : in points := (others => (0, 0)); procedure draw_points (data : in points := (others => (0, 0));
x : in integer := 0; x : in integer := 0;
y : in integer := 0) is y : in integer := 0) is
@ -40,24 +24,6 @@ package body material is
end loop; end loop;
end draw_points; end draw_points;
------------------------------------------------------------------------------------------
procedure save_points (here : in core.io.file_type; data : in points) is
begin
for index in enumeration loop
core.save_point (here, data (index));
end loop;
end save_points;
------------------------------------------------------------------------------------------
procedure load_points (here : in core.io.file_type; data : out points) is
begin
for index in enumeration loop
core.load_point (here, data (index));
end loop;
end load_points;
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
end material; end material;

View File

@ -67,15 +67,10 @@ package material is
------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------
procedure configure;
procedure draw_points (data : in points := (others => (0, 0)); procedure draw_points (data : in points := (others => (0, 0));
x : in integer := 0; x : in integer := 0;
y : in integer := 0); y : in integer := 0);
procedure save_points (here : in core.io.file_type; data : in points);
procedure load_points (here : in core.io.file_type; data : out points);
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
end material; end material;

View File

@ -8,37 +8,6 @@ package body resource is
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
procedure configure is
structure : ui.structure;
--
time : float := 0.0;
begin
time := core.time;
--
core.echo (core.comment, "Configuring" & count'image & " resource components...");
--
structure.title := "Resource Menu ";
structure.toggle := core.signal_r;
structure.show := false;
structure.center := false;
structure.resize := true;
structure.x := 60;
structure.y := 500;
structure.gui_n := count;
--
ui.add_structure (structure);
--
for index in enumeration loop
icon (index) := core.import_sprite (core.folder & "/icon/resource/" & core.lowercase (enumeration'image (index)) & ".png", 1, 1);
--
ui.add_structure_button (icon (index), description (index).name, description (index).text);
end loop;
--
core.echo (core.success, "Successfully configured resource information in" & natural'image (natural (1_000_000.0 * (core.time - time))) & " microseconds.");
end configure;
------------------------------------------------------------------------------------------
procedure draw_points (data : in points; x, y : in integer) is procedure draw_points (data : in points; x, y : in integer) is
frame_width : constant integer := 4 * core.icon; frame_width : constant integer := 4 * core.icon;
begin begin
@ -53,24 +22,6 @@ package body resource is
end loop; end loop;
end draw_points; end draw_points;
------------------------------------------------------------------------------------------
procedure save_points (here : in core.io.file_type; data : in points) is
begin
for index in enumeration loop
core.save_point (here, data (index));
end loop;
end save_points;
------------------------------------------------------------------------------------------
procedure load_points (here : in core.io.file_type; data : out points) is
begin
for index in enumeration loop
core.load_point (here, data (index));
end loop;
end load_points;
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
end resource; end resource;

View File

@ -41,13 +41,8 @@ package resource is
------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------
procedure configure;
procedure draw_points (data : in points; x, y : in integer); procedure draw_points (data : in points; x, y : in integer);
procedure save_points (here : in core.io.file_type; data : in points);
procedure load_points (here : in core.io.file_type; data : out points);
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
end resource; end resource;

View File

@ -8,41 +8,6 @@ package body skill is
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
procedure configure is
structure : ui.structure;
--
time : float := 0.0;
begin
time := core.time;
--
core.echo (core.comment, "Configuring" & count'image & " skill components...");
--
structure.title := "Skill Menu ";
structure.toggle := core.signal_s;
structure.show := false;
structure.center := true;
structure.resize := true;
structure.x := 80;
structure.y := (core.window_height - 320) / 2;
structure.gui_n := count + 1;
--
ui.add_structure (structure);
--
for index in enumeration loop
icon (index) := core.import_sprite (core.folder & "/icon/skill/" & core.lowercase (enumeration'image (index)) & ".png", 1, 1);
--
if enumeration'pos (index) = 9 then
ui.add_structure_orient;
end if;
--
ui.add_structure_button (icon (index), description (index).name, description (index).text);
end loop;
--
core.echo (core.success, "Successfully configured skill information in" & natural'image (natural (1_000_000.0 * (core.time - time))) & " microseconds.");
end configure;
------------------------------------------------------------------------------------------
procedure draw_points (data : in points := (others => (0, 0)); procedure draw_points (data : in points := (others => (0, 0));
x : in integer := 0; x : in integer := 0;
y : in integer := 0) is y : in integer := 0) is
@ -65,24 +30,6 @@ package body skill is
end loop; end loop;
end draw_points; end draw_points;
------------------------------------------------------------------------------------------
procedure save_points (here : in core.io.file_type; data : in points) is
begin
for index in enumeration loop
core.save_point (here, data (index));
end loop;
end save_points;
------------------------------------------------------------------------------------------
procedure load_points (here : in core.io.file_type; data : out points) is
begin
for index in enumeration loop
core.load_point (here, data (index));
end loop;
end load_points;
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
end skill; end skill;

View File

@ -57,15 +57,10 @@ package skill is
------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------
procedure configure;
procedure draw_points (data : in points := (others => (0, 0)); procedure draw_points (data : in points := (others => (0, 0));
x : in integer := 0; x : in integer := 0;
y : in integer := 0); y : in integer := 0);
procedure save_points (here : in core.io.file_type; data : in points);
procedure load_points (here : in core.io.file_type; data : out points);
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
end skill; end skill;