Prototype game engine for Heroes of Might & Magic, featuring a gameplay plot-twist...
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

103 satır
4.4KB

  1. -- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
  2. --
  3. -- GNU General Public Licence (version 3 or later)
  4. with core;
  5. use core;
  6. package ui is
  7. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  8. type style is (
  9. main,
  10. fairy, dwarf, gnoll, kobold, goblin, imp
  11. );
  12. type enumeration is (
  13. gui_none, gui_button, gui_line, gui_text, gui_icon, gui_sprite,
  14. gui_orient
  15. );
  16. ------------------------------------------------------------------------------------------
  17. type gui_data is record
  18. kind : enumeration := gui_none;
  19. text : core.unstring := +("--");
  20. info : core.unstring := +("--");
  21. number : integer := 0;
  22. image : core.sprite := (others => 0);
  23. end record;
  24. empty : gui_data;
  25. type gui_array is array (natural range <>) of gui_data;
  26. type structure is record
  27. title : core.short_string := "-- ";
  28. toggle : core.signal_code := core.signal_space;
  29. show : boolean := false;
  30. center : boolean := false;
  31. resize : boolean := false;
  32. x : integer := 0;
  33. y : integer := 0;
  34. width : integer := 0;
  35. height : integer := 0;
  36. gui_n : natural := 0;
  37. gui_list : access gui_array := null;
  38. end record;
  39. ------------------------------------------------------------------------------------------
  40. style_count : constant natural := style'pos (style'last) + 1;
  41. active : style := main;
  42. prioritize : boolean := false;
  43. ------------------------------------------------------------------------------------------
  44. procedure configure;
  45. procedure synchronize;
  46. procedure echo (message : in string);
  47. procedure write (text : in string; x, y : in integer; tint : in core.colour := (others => 255); size : in natural := 15; code : in boolean := false);
  48. procedure draw_icon (data : in core.sprite; text : in string; x, y : in integer; action : core.pointer := core.idle_skip'access);
  49. procedure draw_overicon (data : in core.sprite; text : in string; x, y : in integer; action : core.pointer := core.idle_skip'access);
  50. procedure draw_sprite (data : in core.sprite; text : in string; x, y, offset : in integer; action : core.pointer := core.idle_skip'access);
  51. procedure draw_text_box (x, y, width, height : in integer);
  52. procedure draw_help_box (x, y, width, height : in integer; action : core.pointer := core.idle_skip'access);
  53. procedure draw_frame (description : in string; x, y, width, height : in integer; action : core.pointer := core.idle_skip'access);
  54. procedure draw_button (text, description : in string; icon : in core.sprite; x, y, width, height : in integer; action : core.pointer := core.idle_skip'access);
  55. procedure draw_check_box (x, y : in integer; on : in out boolean; text : in string);
  56. procedure draw_title_bar (x, y, width : in integer; title : in string);
  57. procedure draw_fill_bar (x, y, width : in integer; fill : in float);
  58. procedure draw_tiny_fill_bar (x, y, width : in integer; fill : in float; tint : in core.colour);
  59. procedure draw_scroll_bar (x, y, height : in integer; offset : in integer);
  60. procedure draw_menu (x, y, width, height : in integer);
  61. procedure draw_tiny_menu (x, y, width, height : in integer);
  62. procedure draw_icon_menu (x, y, width, height : in integer);
  63. procedure draw_end_turn_button (x, y : in integer);
  64. procedure draw_state_box (x, y : in integer);
  65. procedure draw_console_box (x, y, width, height : in integer);
  66. procedure add_structure (data : in structure);
  67. procedure add_structure_button (icon : in core.sprite; name : in core.unstring; text : in core.unstring);
  68. procedure add_structure_orient;
  69. procedure write_ada_code (text : in core.string_box_data; x, y : in integer);
  70. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  71. end ui;