Prototype game engine for Heroes of Might & Magic, featuring a gameplay plot-twist...
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
3.4KB

  1. -- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
  2. --
  3. -- GNU General Public Licence (version 3 or later)
  4. with core;
  5. package ui is
  6. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  7. type style is (
  8. main,
  9. fairy, dwarf, gnoll, kobold, goblin, imp
  10. );
  11. type enumeration is (
  12. gui_none, gui_button, gui_line, gui_text, gui_icon, gui_sprite, gui_orient
  13. );
  14. ------------------------------------------------------------------------------------------
  15. type gui_data is record
  16. kind : enumeration := gui_none;
  17. text : core.short_string := "- ";
  18. number : integer := 0;
  19. image : core.sprite := (others => 0);
  20. end record;
  21. empty : gui_data;
  22. type gui_array is array (natural range <>) of gui_data;
  23. type structure is record
  24. title : core.short_string := "- ";
  25. toggle : core.signal_code := core.signal_space;
  26. show : boolean := false;
  27. center : boolean := false;
  28. resize : boolean := false;
  29. x : integer := 0;
  30. y : integer := 0;
  31. width : integer := 0;
  32. height : integer := 0;
  33. gui_n : natural := 0;
  34. gui_list : access gui_array := null;
  35. end record;
  36. no_structure : structure;
  37. ------------------------------------------------------------------------------------------
  38. active : style := main;
  39. ------------------------------------------------------------------------------------------
  40. procedure configure;
  41. procedure synchronize;
  42. procedure write (text : in string; x, y : in integer);
  43. procedure draw_icon (data : in core.sprite; description : in string; x, y : in integer; action : core.pointer := core.idle'access);
  44. procedure draw_overicon (data : in core.sprite; description : in string; x, y : in integer; action : core.pointer := core.idle'access);
  45. procedure draw_text_box (text : in string);
  46. procedure draw_help_box (x, y, width, height : in integer; action : core.pointer := core.idle'access);
  47. procedure draw_frame (description : in string; x, y, width, height : in integer; action : core.pointer := core.idle'access);
  48. procedure draw_title_bar (x, y, width : in integer; title : in string);
  49. procedure draw_fill_bar (x, y, width : in integer; fill : in float);
  50. procedure draw_scroll_bar (x, y, height : in integer; offset : in integer);
  51. procedure draw_menu (x, y, width, height : in integer);
  52. procedure draw_tiny_menu (x, y, width, height : in integer);
  53. procedure draw_icon_menu (description : in string; x, y, width, height : in integer; action : core.pointer := core.idle'access);
  54. procedure draw_state_box (x, y : in integer);
  55. procedure add_structure (data : in structure := no_structure);
  56. procedure add_structure_button (icon : in core.sprite; text : in core.short_string);
  57. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  58. end ui;