From be775dfd2e1e46ccffd37489e9f1cc23fc76d205 Mon Sep 17 00:00:00 2001 From: xolatile Date: Sun, 12 May 2024 11:12:52 -0400 Subject: [PATCH] Moved monospace font to UI... --- source/main.adb | 4 ---- source/ui.adb | 8 ++++++-- source/ui.ads | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/source/main.adb b/source/main.adb index 72653fa..169ff5b 100644 --- a/source/main.adb +++ b/source/main.adb @@ -13,8 +13,6 @@ procedure main is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - monospace : font; - side_panel : integer := 0; preview_width : integer := 0; preview_height : integer := 0; @@ -142,8 +140,6 @@ begin initialize; - monospace := import_font ("./sprite/ui/monospace.png", 11, 0); - ui.active := ui.main; ui.configure; diff --git a/source/ui.adb b/source/ui.adb index 4c982c7..39c5530 100644 --- a/source/ui.adb +++ b/source/ui.adb @@ -70,6 +70,8 @@ package body ui is structure_count : natural := 0; + monospace : core.font; + ------------------------------------------------------------------------------------------ procedure draw (index : in element := none; @@ -229,6 +231,8 @@ package body ui is end loop; end load_ui; begin + monospace := core.import_font ("./sprite/ui/monospace.png", 11, 0); + -- core.echo (core.comment, "Configuring UI components..."); -- for index in style loop @@ -264,9 +268,9 @@ package body ui is ------------------------------------------------------------------------------------------ - procedure write (text : in string; x, y : in integer; tint : in core.colour := (others => 255); size : in natural := 0) is + procedure write (text : in string; x, y : in integer; tint : in core.colour := (others => 255); size : in natural := 0; code : in boolean := false) is begin - core.write (text, x, y, tint, font (active).scale, font (active)); + core.write (text, x, y, tint, font (active).scale, (if code then monospace else font (active))); end write; ------------------------------------------------------------------------------------------ diff --git a/source/ui.ads b/source/ui.ads index e102729..0eaff7b 100644 --- a/source/ui.ads +++ b/source/ui.ads @@ -57,7 +57,7 @@ package ui is procedure configure; procedure synchronize; - procedure write (text : in string; x, y : in integer; tint : in core.colour := (others => 255); size : in natural := 0); + procedure write (text : in string; x, y : in integer; tint : in core.colour := (others => 255); size : in natural := 0; code : in boolean := false); procedure draw_icon (data : in core.sprite; text : in string; x, y : in integer; action : core.pointer := core.idle_skip'access); procedure draw_overicon (data : in core.sprite; text : in string; x, y : in integer; action : core.pointer := core.idle_skip'access);