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.

52 lines
2.0KB

  1. -- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
  2. --
  3. -- GNU General Public Licence (version 3 or later)
  4. with core, ui;
  5. package body resource is
  6. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  7. icon : array (enumeration) of core.sprite;
  8. ------------------------------------------------------------------------------------------
  9. procedure configure is
  10. structure : ui.structure;
  11. begin
  12. core.echo (core.comment, "Configuring resource components...");
  13. --
  14. structure.title := "Resource Menu ";
  15. structure.toggle := core.signal_r;
  16. structure.show := false;
  17. structure.center := false;
  18. structure.resize := true;
  19. structure.x := 60;
  20. structure.y := 480;
  21. structure.gui_n := count;
  22. --
  23. ui.add_structure (structure);
  24. --
  25. for index in enumeration loop
  26. icon (index) := core.import_sprite (core.folder & "/icon/resource/" & core.lowercase (enumeration'image (index)) & ".png", 1, 1);
  27. --
  28. ui.add_structure_button (icon (index), trait (index).name, trait (index).text);
  29. end loop;
  30. end configure;
  31. ------------------------------------------------------------------------------------------
  32. procedure draw_points (data : in points; x, y : in integer) is
  33. begin
  34. for index in enumeration loop
  35. ui.draw_icon (icon (index), trait (index).text, x + 4 * core.icon * enumeration'pos (index), y);
  36. ui.draw_frame (trait (index).text, x + 4 * core.icon * enumeration'pos (index) + core.icon, y, 3 * core.icon, core.icon);
  37. ui.write (data (index)'image, x + 4 * core.icon * enumeration'pos (index) + core.icon - 3, y + 6, size => 18);
  38. end loop;
  39. end draw_points;
  40. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  41. end resource;