From 292500e7da28a015b6972cac274b0a774c530e35 Mon Sep 17 00:00:00 2001 From: xolatile Date: Tue, 30 Apr 2024 19:58:38 -0400 Subject: [PATCH] Fixed lower left corner bug, due to PNG mode, and added UI theme scroller... --- source/core.adb | 2 +- source/main.adb | 6 ++---- source/ui.adb | 7 ++++--- source/ui.ads | 3 ++- sprite/ui/main/corner_lower_left.png | Bin 468 -> 688 bytes 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/source/core.adb b/source/core.adb index 7733944..81e9728 100644 --- a/source/core.adb +++ b/source/core.adb @@ -240,7 +240,7 @@ package body core is engine_active := true; texture_array := new texture_data_array (0 .. 1600); sound_array := new sound_data_array (0 .. 4); - font_array := new font_data_array (0 .. 4); + font_array := new font_data_array (0 .. 8); -- echo (comment, "-- Setting trace log level to none (ignoring all default Raylib logs)."); ray.set_trace_log_level (ray.log_none); diff --git a/source/main.adb b/source/main.adb index a7956db..a988542 100644 --- a/source/main.adb +++ b/source/main.adb @@ -76,8 +76,7 @@ procedure main is procedure show_unit_menu is begin menu_insert (menu_unit); end show_unit_menu; procedure show_might_menu is begin menu_insert (menu_might); end show_might_menu; procedure show_magic_menu is begin menu_insert (menu_magic); end show_magic_menu; - procedure ui_main_style is begin ui.active := ui.main; end ui_main_style; - procedure ui_steam_style is begin ui.active := ui.steam; end ui_steam_style; + procedure ui_main_style is begin ui.active := ui.style'val ((ui.style'pos (ui.active) + 1) mod 7); end ui_main_style; procedure hide_top_menu is begin menu_remove; end hide_top_menu; procedure zoom_in is begin core.zoom := 2; end zoom_in; procedure zoom_out is begin core.zoom := 1; end zoom_out; @@ -93,8 +92,7 @@ procedure main is core.signal_u => show_unit_menu'access, core.signal_m => show_might_menu'access, core.signal_n => show_magic_menu'access, - core.signal_d => ui_main_style'access, - core.signal_f => ui_steam_style'access, + core.signal_v => ui_main_style'access, core.signal_grave => hide_top_menu'access, core.signal_kp_add => zoom_in'access, core.signal_kp_subtract => zoom_out'access, diff --git a/source/ui.adb b/source/ui.adb index 0a1901c..5b8a11d 100644 --- a/source/ui.adb +++ b/source/ui.adb @@ -135,14 +135,15 @@ package body ui is glyphs (index) := core.import_font ("./sprite/ui/" & folder_path & "/font.png", 24, 0); -- for this in element loop - sprite (index, this) := core.import_sprite ("./sprite/ui/" & folder_path & core.lowercase (element'image (this)) & ".png", 1, 1); + sprite (index, this) := core.import_sprite ("./sprite/ui/" & folder_path & "/" & core.lowercase (element'image (this)) & ".png", 1, 1); end loop; end load_ui; begin core.echo (core.comment, "Configuring UI components..."); -- - load_ui (main, "main/"); - load_ui (steam, "steam/"); + for index in style loop + load_ui (index, core.lowercase (style'image (index))); + end loop; end configure; ------------------------------------------------------------------------------------------ diff --git a/source/ui.ads b/source/ui.ads index d6e581e..0833155 100644 --- a/source/ui.ads +++ b/source/ui.ads @@ -9,7 +9,8 @@ package ui is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ type style is ( - main, steam + main, + fairy, dwarf, gnoll, kobold, goblin, imp ); ------------------------------------------------------------------------------------------ diff --git a/sprite/ui/main/corner_lower_left.png b/sprite/ui/main/corner_lower_left.png index 04859e5553343b8262b75dbe31e33008ad371e76..fc610caec117aac52569e9dd6ef2e79512f97c16 100644 GIT binary patch delta 676 zcmV;V0$csm1F!{<7=H)`00020X>r~F000SaNLh0L04^f{04^f|c%?sf0007FNkl)zoy6Ei0GI?q!Y9xW35146OCThCAqJRAAS8Sx2AD}8BzyzfL;|7V(Gmy=FN^_8B@hxm zgy64D5ljLh;Ug%I?g@8>zrXZ4bMNJxd$ryxTzAz$lb4Br6%~d_&tQHX?&9xz~a1)&q8wu(;)qtbko4SbxE11)wEZ!WRXgBv`{&1w>m< z?GCX^0s_7%V4!EHB%t8C1k9FD=v5~0-2!Gx$m~YV;D-dvmVkgC7BEW!3jR$%?cA*O zG4qIoQvMe39|9Wl^AZUY*C1W{4bgV^I-NNi&-fW1HCV!n1z1V2hOY`>=BK3u1bj6H z+yZii%zusvBm4Q$^boY>M{vA*LQO*S?psetuFuZX=xG8-F!ue*;edqK%mUpK(k`1y zK*DQhfsvk2m4Jd*30Nfo39lAVlOTL|CBw5{jDXD zfN1&dAuuRG9RvQ1fRY3xy!bpo1K6|OwHWK$B^}A9vR@$q4gUkI&_Xv11((MF0000< KMNUMnLSTXw40002j2boO(000b7OjJbx008dp?f?J)|Ns92W})N&0004W zQchC!ypibVOV4i;nVmKrHdY*QaO#gXr!{nNN~!2 z^GA*2Rq_fywud-@+9+d;?>*RI;d$Ibske~(8hX$B5?U+A5=v=x2|4$E4IPFf5*iFg zBor8qNXTsT|Io!Sgae4WIl=+QL5^_X<GKLs)NYgoy~zMsP%lf)LZ?@$=xZUIsKIY;%N71I-~94RLNm))3}K z;Q_)U?SdG2F#?T45F