Ver código fonte

Probably going back to simple solution...

master
Ognjen Milan Robovic 1 mês atrás
pai
commit
e5a81dc24b
5 arquivos alterados com 29 adições e 15 exclusões
  1. +0
    -2
      source/core.adb
  2. +2
    -2
      source/core.ads
  3. +9
    -2
      source/skill.adb
  4. +17
    -8
      source/ui.adb
  5. +1
    -1
      source/ui.ads

+ 0
- 2
source/core.adb Ver arquivo

@@ -127,8 +127,6 @@ package body core is
-- --
if this.width = 0 or this.height = 0 then if this.width = 0 or this.height = 0 then
echo (failure, "Sprite not imported: " & file_path); 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; end if;
-- --
return this; return this;


+ 2
- 2
source/core.ads Ver arquivo

@@ -54,8 +54,8 @@ package core is
warning => true, warning => true,
success => true, success => true,
comment => true, comment => true,
import => false,
export => false
import => true,
export => true
); );


engine_active : boolean := false; engine_active : boolean := false;


+ 9
- 2
source/skill.adb Ver arquivo

@@ -13,7 +13,9 @@ package body skill is
------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------


procedure configure 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 begin
core.echo (core.comment, "Configuring skill components..."); core.echo (core.comment, "Configuring skill components...");
-- --
@@ -21,7 +23,12 @@ package body skill is
-- --
for index in enumeration loop for index in enumeration loop
sprite (index) := core.import_sprite ("./sprite/skill/" & core.lowercase (enumeration'image (index)) & ".png", 1, 1); 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 loop;
end configure; end configure;




+ 17
- 8
source/ui.adb Ver arquivo

@@ -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_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); 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 begin
draw_tiny_menu (new_x, new_y, new_width, new_height); draw_tiny_menu (new_x, new_y, new_width, new_height);
draw_title_bar (new_x, new_y, new_width, data.title); 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 case data.gui_list (x).kind is
when gui_button => 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 case;
end loop; end loop;
end draw_structure; 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 begin
data.gui_list (data.gui_n).kind := gui_button; data.gui_list (data.gui_n).kind := gui_button;
data.gui_list (data.gui_n).text := text; data.gui_list (data.gui_n).text := text;


+ 1
- 1
source/ui.ads Ver arquivo

@@ -78,7 +78,7 @@ package ui is


procedure add_structure (data : in structure); 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);


------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------




Carregando…
Cancelar
Salvar