From ab48e7100ab3f6d2a0c877128349e8832637721b Mon Sep 17 00:00:00 2001 From: xolatile Date: Wed, 1 May 2024 09:26:06 -0400 Subject: [PATCH] UI refactoring works excellent, menu implementations later... --- source/main.adb | 3 ++- source/skill.adb | 2 +- source/ui.adb | 9 ++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/source/main.adb b/source/main.adb index 70745b3..6696947 100644 --- a/source/main.adb +++ b/source/main.adb @@ -140,7 +140,6 @@ begin gameplay: loop core.synchronize; - ui.synchronize; -- exit when core.engine_active = false; -- @@ -164,6 +163,8 @@ begin -- menu_render; -- + ui.synchronize; + -- ui.draw_help_box (0, core.window_height - text_box_height, core.window_width, text_box_height); end loop gameplay; diff --git a/source/skill.adb b/source/skill.adb index 320aa39..7eb0e7f 100644 --- a/source/skill.adb +++ b/source/skill.adb @@ -10,7 +10,7 @@ package body skill is sprite : array (enumeration) of core.sprite; - menu_data : ui.structure := ("Skill Menu ", core.signal_o, false, true, false, 0, 0, 320, 160); + menu_data : ui.structure := ("Skill Menu ", core.signal_o, true, true, false, 0, 0, 320, 160); ------------------------------------------------------------------------------------------ diff --git a/source/ui.adb b/source/ui.adb index ed41bbd..8853d12 100644 --- a/source/ui.adb +++ b/source/ui.adb @@ -155,10 +155,6 @@ package body ui is begin draw_tiny_menu (new_x, new_y, new_width, new_height); draw_title_bar (new_x, new_y, new_width, data.title); - -- - if core.signal_mode = core.signal_code'pos (data.toggle) then - data.show := (if data.show then false else true); - end if; end draw_structure; ------------------------------------------------------------------------------------------ @@ -187,6 +183,10 @@ package body ui is for index in 0 .. 12 loop exit when index = structure_count; -- + if core.signal_mode = core.signal_code'pos (structure_array (index).toggle) then + structure_array (index).show := (if structure_array (index).show then false else true); + end if; + -- if structure_array (index).show then draw_structure (structure_array (index)); end if; @@ -207,7 +207,6 @@ package body ui is begin select_text_box (description, x, y, core.icon, core.icon); -- - --~draw (icon, x, y); draw (icon, x, y); -- core.zoom := 1;