Prototype game engine for Heroes of Might & Magic, featuring a gameplay plot-twist...
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

97 rindas
4.3KB

  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,
  13. gui_orient
  14. );
  15. ------------------------------------------------------------------------------------------
  16. type gui_data is record
  17. kind : enumeration := gui_none;
  18. text : core.short_string := "-- ";
  19. info : core.long_string := "-- ";
  20. number : integer := 0;
  21. image : core.sprite := (others => 0);
  22. end record;
  23. empty : gui_data;
  24. type gui_array is array (natural range <>) of gui_data;
  25. type structure is record
  26. title : core.short_string := "-- ";
  27. toggle : core.signal_code := core.signal_space;
  28. show : boolean := false;
  29. center : boolean := false;
  30. resize : boolean := false;
  31. x : integer := 0;
  32. y : integer := 0;
  33. width : integer := 0;
  34. height : integer := 0;
  35. gui_n : natural := 0;
  36. gui_list : access gui_array := null;
  37. end record;
  38. ------------------------------------------------------------------------------------------
  39. style_count : constant natural := style'pos (style'last) + 1;
  40. active : style := main;
  41. prioritize : boolean := false;
  42. ------------------------------------------------------------------------------------------
  43. procedure configure;
  44. procedure synchronize;
  45. procedure write (text : in string; x, y : in integer; tint : in core.colour := (others => 255); size : in natural := 0; code : in boolean := false);
  46. procedure draw_icon (data : in core.sprite; text : in string; x, y : in integer; action : core.pointer := core.idle_skip'access);
  47. procedure draw_overicon (data : in core.sprite; text : in string; x, y : in integer; action : core.pointer := core.idle_skip'access);
  48. procedure draw_sprite (data : in core.sprite; text : in string; x, y, offset : in integer; action : core.pointer := core.idle_skip'access);
  49. procedure draw_text_box (x, y, width, height : in integer);
  50. procedure draw_help_box (x, y, width, height : in integer; action : core.pointer := core.idle_skip'access);
  51. procedure draw_frame (description : in string; x, y, width, height : in integer; action : core.pointer := core.idle_skip'access);
  52. procedure draw_button (text, description : in string; icon : in core.sprite; x, y, width, height : in integer; action : core.pointer := core.idle_skip'access);
  53. procedure draw_check_box (x, y : in integer; on : in out boolean; text : in string);
  54. procedure draw_title_bar (x, y, width : in integer; title : in string);
  55. procedure draw_fill_bar (x, y, width : in integer; fill : in float);
  56. procedure draw_tiny_fill_bar (x, y, width : in integer; fill : in float; tint : in core.colour);
  57. procedure draw_scroll_bar (x, y, height : in integer; offset : in integer);
  58. procedure draw_menu (x, y, width, height : in integer);
  59. procedure draw_tiny_menu (x, y, width, height : in integer);
  60. procedure draw_icon_menu (x, y, width, height : in integer);
  61. procedure draw_state_box (x, y : in integer);
  62. procedure add_structure (data : in structure);
  63. procedure add_structure_button (icon : in core.sprite; name : in core.short_string; text : in core.long_string := "");
  64. procedure add_structure_orient;
  65. procedure write_ada_code (text : in core.string_box_data; x, y : in integer);
  66. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  67. end ui;