Prototype game engine for Heroes of Might & Magic, featuring a gameplay plot-twist...
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
2.1KB

  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 attribute 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 attribute components...");
  13. --
  14. structure.title := "Attribute Menu ";
  15. structure.toggle := core.signal_a;
  16. structure.show := false;
  17. structure.center := false;
  18. structure.resize := true;
  19. structure.x := 60;
  20. structure.y := 80;
  21. structure.gui_n := count;
  22. --
  23. ui.add_structure (data => structure);
  24. --
  25. for index in enumeration loop
  26. icon (index) := core.import_sprite (core.folder & "/icon/attribute/" & core.lowercase (enumeration'image (index)) & ".png", 1, 1);
  27. --
  28. ui.add_structure_button (icon => icon (index),
  29. name => trait (index).name,
  30. text => trait (index).text);
  31. end loop;
  32. end configure;
  33. ------------------------------------------------------------------------------------------
  34. procedure draw_points (data : in points := (others => 0);
  35. x : in integer := 0;
  36. y : in integer := 0) is
  37. move_x : integer := x;
  38. begin
  39. for index in enumeration loop
  40. ui.draw_icon (icon (index), trait (index).text, move_x, y);
  41. ui.draw_text_box (move_x, y + core.icon, core.icon, core.icon);
  42. ui.write (data (index)'image, move_x + 4, y + core.icon + 8, (255, 255, 255, 255), 15, true);
  43. --
  44. move_x := move_x + core.icon;
  45. end loop;
  46. end draw_points;
  47. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  48. end attribute;