From 2308d088b9e855d22a3081965e7e485c7f053bb0 Mon Sep 17 00:00:00 2001 From: xolatile Date: Tue, 7 May 2024 09:06:08 -0400 Subject: [PATCH] Work in progress on menu alignment... --- source/skill.adb | 6 +++++- source/ui.adb | 14 ++++++++++++++ source/ui.ads | 1 + 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/source/skill.adb b/source/skill.adb index 4a37464..9efe824 100644 --- a/source/skill.adb +++ b/source/skill.adb @@ -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; diff --git a/source/ui.adb b/source/ui.adb index e0a6ff3..411a13a 100644 --- a/source/ui.adb +++ b/source/ui.adb @@ -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; diff --git a/source/ui.ads b/source/ui.ads index 597ea43..ed8b8f4 100644 --- a/source/ui.ads +++ b/source/ui.ads @@ -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; ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------