Probably going back to simple solution...
This commit is contained in:
parent
f798e6c799
commit
e5a81dc24b
@ -127,8 +127,6 @@ package body core is
|
||||
--
|
||||
if this.width = 0 or this.height = 0 then
|
||||
echo (failure, "Sprite not imported: " & file_path);
|
||||
else
|
||||
echo (import, this.index'image & file_path & this.frames'image & this.states'image & this.width'image & this.height'image);
|
||||
end if;
|
||||
--
|
||||
return this;
|
||||
|
@ -54,8 +54,8 @@ package core is
|
||||
warning => true,
|
||||
success => true,
|
||||
comment => true,
|
||||
import => false,
|
||||
export => false
|
||||
import => true,
|
||||
export => true
|
||||
);
|
||||
|
||||
engine_active : boolean := false;
|
||||
|
@ -13,7 +13,9 @@ package body skill is
|
||||
------------------------------------------------------------------------------------------
|
||||
|
||||
procedure configure is
|
||||
menu_data : ui.structure := ("Skill Menu ", core.signal_s, false, true, false, 0, 0, 320, 160, 0, (others => (ui.gui_none, "- ", 0, (others => 0))));
|
||||
menu_data : ui.structure := ("Skill Menu ", core.signal_s, false, true, false, 0, 0, 320, 160,
|
||||
0, (others => (ui.gui_none, "- ", 0, (others => 0)))
|
||||
);
|
||||
begin
|
||||
core.echo (core.comment, "Configuring skill components...");
|
||||
--
|
||||
@ -21,7 +23,12 @@ package body skill is
|
||||
--
|
||||
for index in enumeration loop
|
||||
sprite (index) := core.import_sprite ("./sprite/skill/" & core.lowercase (enumeration'image (index)) & ".png", 1, 1);
|
||||
ui.add_structure_button (menu_data, sprite (index), trait (index).name, trait (index).text);
|
||||
ui.add_structure_button (menu_data, sprite (index), trait (index).name);
|
||||
end loop;
|
||||
--
|
||||
core.echo (core.export, ">" & menu_data.gui_n'image);
|
||||
for x in 0 .. menu_data.gui_n - 1 loop
|
||||
core.echo (core.export, ">" & x'image & " " & menu_data.gui_list (x).text);
|
||||
end loop;
|
||||
end configure;
|
||||
|
||||
|
@ -156,19 +156,28 @@ package body ui is
|
||||
new_x : constant integer := (if data.center then (core.window_width - new_width) / 2 else data.x);
|
||||
new_y : constant integer := (if data.center then (core.window_height - new_height) / 2 else data.y);
|
||||
--
|
||||
at_x : integer := new_x;
|
||||
at_y : integer := new_y;
|
||||
at_x : integer := new_x + offset;
|
||||
at_y : integer := new_y + offset;
|
||||
begin
|
||||
draw_tiny_menu (new_x, new_y, new_width, new_height);
|
||||
draw_title_bar (new_x, new_y, new_width, data.title);
|
||||
--
|
||||
for x in 0 .. data.gui_n loop
|
||||
core.echo (core.import, "Almost rendering" & data.gui_n'image & " elements!");
|
||||
--
|
||||
for x in 0 .. data.gui_n - 1 loop
|
||||
case data.gui_list (x).kind is
|
||||
when gui_button =>
|
||||
draw_frame ("", at_x + offset, at_y, new_width - 2 * offset, core.icon + offset);
|
||||
draw_icon (data.gui_list (x).image, "", at_x + 3 * offset / 2, at_y + offset / 2);
|
||||
write (data.gui_list (x).text, at_x + 3 * offset / 2 + core.icon, at_y + offset / 2);
|
||||
when others => null;
|
||||
--~draw_frame ("", at_x, at_y, new_width - 2 * offset, core.icon + offset);
|
||||
draw_icon (data.gui_list (x).image, "", at_x, at_y);
|
||||
write (data.gui_list (x).text, at_x + core.icon, at_y);
|
||||
at_y := at_y + x * core.icon;
|
||||
core.echo (core.import, "Rendering!");
|
||||
--~when others => null;
|
||||
when others => core.echo (core.import, "Not rendering!");
|
||||
--~when others =>
|
||||
--~draw_frame ("", at_x + offset, at_y, new_width - 2 * offset, core.icon + offset);
|
||||
--~draw_icon (data.gui_list (x).image, "", at_x + 3 * offset / 2, at_y + offset / 2);
|
||||
--~write (data.gui_list (x).text, at_x + 3 * offset / 2 + core.icon, at_y + offset / 2);
|
||||
end case;
|
||||
end loop;
|
||||
end draw_structure;
|
||||
@ -463,7 +472,7 @@ package body ui is
|
||||
|
||||
------------------------------------------------------------------------------------------
|
||||
|
||||
procedure add_structure_button (data : in out structure; icon : in core.sprite; text, description : in string) is
|
||||
procedure add_structure_button (data : in out structure; icon : in core.sprite; text : in core.short_string) is
|
||||
begin
|
||||
data.gui_list (data.gui_n).kind := gui_button;
|
||||
data.gui_list (data.gui_n).text := text;
|
||||
|
@ -78,7 +78,7 @@ package ui is
|
||||
|
||||
procedure add_structure (data : in structure);
|
||||
|
||||
procedure add_structure_button (data : in out structure; icon : in core.sprite; text, description : in string);
|
||||
procedure add_structure_button (data : in out structure; icon : in core.sprite; text : in core.short_string);
|
||||
|
||||
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user