Removed monospace font, added icon action, copied fonts...

This commit is contained in:
Ognjen Milan Robovic 2024-05-01 00:16:19 -04:00
parent 7fc9681914
commit e29da50694
13 changed files with 29 additions and 18 deletions

View File

@ -50,7 +50,7 @@ package ai is
type action_data is record
base : data_limit;
data : core.procedure_pointer;
data : core.pointer;
name : core.short_string;
end record;

View File

@ -297,7 +297,7 @@ package body core is
cursor.x := ray.get_mouse_x;
cursor.y := ray.get_mouse_y;
--
--~ray.draw_fps (0, 0);
ray.draw_fps (window_width - 100, window_height - 100);
--
ray.end_drawing;
--
@ -354,6 +354,8 @@ package body core is
------------------------------------------------------------------------------------------
procedure idle is begin null; end idle;
procedure move_camera_up is begin core.camera.y := core.camera.y - 1; end move_camera_up;
procedure move_camera_down is begin core.camera.y := core.camera.y + 1; end move_camera_down;
procedure move_camera_left is begin core.camera.x := core.camera.x - 1; end move_camera_left;

View File

@ -30,7 +30,7 @@ package core is
subtype short_string is string (1 .. 24);
subtype long_string is string (1 .. 72);
type procedure_pointer is access procedure;
type pointer is access procedure;
type vector is record x, y : integer; end record;
type sprite is record index, width, height, frames, states : integer; end record;
@ -120,6 +120,8 @@ package core is
procedure write_text_box (text : in string);
procedure idle;
procedure move_camera_up;
procedure move_camera_down;
procedure move_camera_left;

View File

@ -69,17 +69,16 @@ procedure main is
------------------------------------------------------------------------------------------
procedure idle is begin null; end idle;
procedure show_attribute_menu is begin menu_insert (menu_attribute); end show_attribute_menu;
procedure show_skill_menu is begin menu_insert (menu_skill); end show_skill_menu;
procedure show_resource_menu is begin menu_insert (menu_resource); end show_resource_menu;
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 show_attribute_menu is begin menu_insert (menu_attribute); end show_attribute_menu;
procedure show_skill_menu is begin menu_insert (menu_skill); end show_skill_menu;
procedure show_resource_menu is begin menu_insert (menu_resource); end show_resource_menu;
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.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;
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;
signal_list : constant array (core.signal_code) of access procedure := (
core.signal_up => core.move_camera_up'access,
@ -96,7 +95,7 @@ procedure main is
core.signal_grave => hide_top_menu'access,
core.signal_kp_add => zoom_in'access,
core.signal_kp_subtract => zoom_out'access,
others => idle'access
others => core.idle'access
);
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

View File

@ -22,7 +22,7 @@ package body skill is
end configure;
------------------------------------------------------------------------------------------
procedure e is begin core.echo (core.warning, "Heyo world!"); end e;
procedure menu (x, y : in integer; center : in boolean) is
column : constant integer := 2;
offset : constant integer := 32;
@ -35,7 +35,7 @@ package body skill is
ui.draw_title_bar (move_x, move_y, width, "Skills");
--
for index in enumeration loop
ui.draw_icon (sprite (index), trait (index).text, move_x + 216 * (enumeration'pos (index) mod column) + offset, move_y + core.icon * (enumeration'pos (index) / column) + offset);
ui.draw_icon (sprite (index), trait (index).text, move_x + 216 * (enumeration'pos (index) mod column) + offset, move_y + core.icon * (enumeration'pos (index) / column) + offset, e'access);
ui.write (trait (index).name, move_x + 216 * (enumeration'pos (index) mod column) + offset + core.icon, move_y + core.icon * (enumeration'pos (index) / column) + offset);
end loop;
end menu;

View File

@ -148,7 +148,7 @@ package body ui is
------------------------------------------------------------------------------------------
procedure draw_icon (data : in core.sprite; description : in string; x, y : in integer) is
procedure draw_icon (data : in core.sprite; description : in string; x, y : in integer; action : access procedure := core.idle'access) is
save_zoom : natural := core.zoom;
begin
select_text_box (description, x, y, core.icon, core.icon);
@ -158,6 +158,14 @@ package body ui is
core.zoom := 1;
core.draw (data, x, y);
core.zoom := save_zoom;
--
if core.cursor.x > x and core.cursor.x < x + core.icon
and core.cursor.y > y and core.cursor.y < y + core.icon
and core.cursor_mode = 1 then
action.all;
core.cursor_mode := 0;
return;
end if;
end draw_icon;
------------------------------------------------------------------------------------------

View File

@ -21,7 +21,7 @@ package ui is
procedure configure;
procedure draw_icon (data : in core.sprite; description : in string; x, y : in integer);
procedure draw_icon (data : in core.sprite; description : in string; x, y : in integer; action : access procedure := core.idle'access);
procedure draw_overicon (data : in core.sprite; description : in string; x, y : in integer);
procedure draw_text_box (x, y, width, height : in integer);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1009 B

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1009 B

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1009 B

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1009 B

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1009 B

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB