Parcourir la source

Work in progress on menu alignment...

master
Ognjen Milan Robovic il y a 1 semaine
Parent
révision
2308d088b9
3 fichiers modifiés avec 20 ajouts et 1 suppressions
  1. +5
    -1
      source/skill.adb
  2. +14
    -0
      source/ui.adb
  3. +1
    -0
      source/ui.ads

+ 5
- 1
source/skill.adb Voir le fichier

@@ -24,13 +24,17 @@ package body skill is
structure.resize := true;
structure.x := 80;
structure.y := (core.window_height - 320) / 2;
structure.gui_n := count;
structure.gui_n := count + 1;
--
ui.add_structure (structure);
--
for index in enumeration loop
sprite (index) := core.import_sprite ("./sprite/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 (sprite (index), trait (index).name, trait (index).text);
end loop;
end configure;


+ 14
- 0
source/ui.adb Voir le fichier

@@ -175,6 +175,9 @@ package body ui is
--~draw (cursor, at_x + new_width - 96, at_y);
--~end if;
at_y := at_y + core.icon + 2 * offset;
when gui_orient =>
at_x := at_x + new_width - 2 * core.icon + offset;
at_y := new_y + core.icon;
when others => null;
end case;
end loop;
@@ -467,9 +470,20 @@ package body ui is
structure_array (structure_count - 1).gui_list (structure_array (structure_count - 1).gui_n).number := 0;
structure_array (structure_count - 1).gui_list (structure_array (structure_count - 1).gui_n).image := icon;
--
core.echo (core.import, "> button > " & text);
core.increment (structure_array (structure_count - 1).gui_n);
end add_structure_button;

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

procedure add_structure_orient is
begin
structure_array (structure_count - 1).gui_list (structure_array (structure_count - 1).gui_n).kind := gui_orient;
--
core.echo (core.import, "> orient");
core.increment (structure_array (structure_count - 1).gui_n);
end add_structure_orient;

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

end ui;

+ 1
- 0
source/ui.ads Voir le fichier

@@ -79,6 +79,7 @@ package ui is
procedure add_structure (data : in structure);

procedure add_structure_button (icon : in core.sprite; text : in core.short_string; description : in core.long_string := "");
procedure add_structure_orient;

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



Chargement…
Annuler
Enregistrer