2024-04-25 00:27:13 -04:00
|
|
|
-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
|
|
|
|
--
|
|
|
|
-- GNU General Public Licence (version 3 or later)
|
|
|
|
|
2024-02-15 21:03:09 -05:00
|
|
|
with core;
|
|
|
|
|
|
|
|
package ui is
|
|
|
|
|
|
|
|
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
type style is (
|
2024-04-30 19:58:38 -04:00
|
|
|
main,
|
|
|
|
fairy, dwarf, gnoll, kobold, goblin, imp
|
2024-02-15 21:03:09 -05:00
|
|
|
);
|
|
|
|
|
2024-05-03 07:55:17 -04:00
|
|
|
type enumeration is (
|
|
|
|
gui_none, gui_button, gui_line, gui_text, gui_icon, gui_sprite, gui_orient
|
|
|
|
);
|
2024-05-01 09:15:38 -04:00
|
|
|
|
|
|
|
------------------------------------------------------------------------------------------
|
|
|
|
|
2024-05-03 07:55:17 -04:00
|
|
|
type gui_data is record
|
2024-05-03 10:13:49 -04:00
|
|
|
kind : enumeration := gui_none;
|
|
|
|
text : core.short_string := "- ";
|
2024-05-04 08:26:51 -04:00
|
|
|
info : core.long_string := "- ";
|
2024-05-03 10:13:49 -04:00
|
|
|
number : integer := 0;
|
|
|
|
image : core.sprite := (others => 0);
|
2024-05-03 07:55:17 -04:00
|
|
|
end record;
|
|
|
|
|
2024-05-03 10:13:49 -04:00
|
|
|
empty : gui_data;
|
|
|
|
|
2024-05-04 07:12:00 -04:00
|
|
|
type gui_array is array (natural range <>) of gui_data;
|
2024-05-01 09:15:38 -04:00
|
|
|
|
|
|
|
type structure is record
|
2024-05-04 07:12:00 -04:00
|
|
|
title : core.short_string := "- ";
|
|
|
|
toggle : core.signal_code := core.signal_space;
|
|
|
|
show : boolean := false;
|
|
|
|
center : boolean := false;
|
|
|
|
resize : boolean := false;
|
|
|
|
x : integer := 0;
|
|
|
|
y : integer := 0;
|
|
|
|
width : integer := 0;
|
|
|
|
height : integer := 0;
|
|
|
|
gui_n : natural := 0;
|
|
|
|
gui_list : access gui_array := null;
|
2024-05-01 09:15:38 -04:00
|
|
|
end record;
|
|
|
|
|
2024-02-15 21:03:09 -05:00
|
|
|
------------------------------------------------------------------------------------------
|
|
|
|
|
2024-05-04 07:12:00 -04:00
|
|
|
active : style := main;
|
2024-02-15 21:03:09 -05:00
|
|
|
|
|
|
|
------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
procedure configure;
|
2024-05-01 09:15:38 -04:00
|
|
|
procedure synchronize;
|
|
|
|
|
2024-05-09 02:08:01 -04:00
|
|
|
procedure write (text : in string; x, y : in integer; size : in natural := 0; tint : in core.colour := (others => 255));
|
2024-02-15 21:03:09 -05:00
|
|
|
|
2024-05-01 07:24:10 -04:00
|
|
|
procedure draw_icon (data : in core.sprite; description : in string; x, y : in integer; action : core.pointer := core.idle'access);
|
|
|
|
procedure draw_overicon (data : in core.sprite; description : in string; x, y : in integer; action : core.pointer := core.idle'access);
|
2024-02-15 21:03:09 -05:00
|
|
|
|
2024-05-01 09:15:38 -04:00
|
|
|
procedure draw_text_box (text : in string);
|
|
|
|
|
|
|
|
procedure draw_help_box (x, y, width, height : in integer; action : core.pointer := core.idle'access);
|
2024-03-13 14:07:17 -04:00
|
|
|
|
2024-05-01 07:24:10 -04:00
|
|
|
procedure draw_frame (description : in string; x, y, width, height : in integer; action : core.pointer := core.idle'access);
|
2024-02-15 21:03:09 -05:00
|
|
|
|
2024-02-19 21:52:43 -05:00
|
|
|
procedure draw_title_bar (x, y, width : in integer; title : in string);
|
2024-05-01 09:55:56 -04:00
|
|
|
procedure draw_fill_bar (x, y, width : in integer; fill : in float);
|
2024-02-19 21:52:43 -05:00
|
|
|
procedure draw_scroll_bar (x, y, height : in integer; offset : in integer);
|
2024-02-16 14:58:54 -05:00
|
|
|
|
2024-04-27 12:34:16 -04:00
|
|
|
procedure draw_menu (x, y, width, height : in integer);
|
|
|
|
procedure draw_tiny_menu (x, y, width, height : in integer);
|
2024-03-13 14:07:17 -04:00
|
|
|
|
2024-05-01 07:24:10 -04:00
|
|
|
procedure draw_icon_menu (description : in string; x, y, width, height : in integer; action : core.pointer := core.idle'access);
|
2024-02-15 21:03:09 -05:00
|
|
|
|
2024-03-14 14:40:05 -04:00
|
|
|
procedure draw_state_box (x, y : in integer);
|
|
|
|
|
2024-05-04 08:26:51 -04:00
|
|
|
procedure add_structure (data : in structure);
|
2024-04-23 16:19:29 -04:00
|
|
|
|
2024-05-04 08:26:51 -04:00
|
|
|
procedure add_structure_button (icon : in core.sprite; text : in core.short_string; description : in core.long_string := "");
|
2024-05-07 09:06:08 -04:00
|
|
|
procedure add_structure_orient;
|
2024-05-03 07:55:17 -04:00
|
|
|
|
2024-02-15 21:03:09 -05:00
|
|
|
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
end ui;
|