Bläddra i källkod

Removed monospace font, added icon action, copied fonts...

master
Ognjen Milan Robovic 1 månad sedan
förälder
incheckning
e29da50694
13 ändrade filer med 29 tillägg och 18 borttagningar
  1. +1
    -1
      source/ai.ads
  2. +3
    -1
      source/core.adb
  3. +3
    -1
      source/core.ads
  4. +10
    -11
      source/main.adb
  5. +2
    -2
      source/skill.adb
  6. +9
    -1
      source/ui.adb
  7. +1
    -1
      source/ui.ads
  8. Binär
      sprite/ui/fairy/font.png
  9. Binär
      sprite/ui/gnoll/font.png
  10. Binär
      sprite/ui/goblin/font.png
  11. Binär
      sprite/ui/imp/font.png
  12. Binär
      sprite/ui/kobold/font.png
  13. Binär
      sprite/ui/mono.png

+ 1
- 1
source/ai.ads Visa fil

@@ -50,7 +50,7 @@ package ai is

type action_data is record
base : data_limit;
data : core.procedure_pointer;
data : core.pointer;
name : core.short_string;
end record;



+ 3
- 1
source/core.adb Visa fil

@@ -297,7 +297,7 @@ package body core is
cursor.x := ray.get_mouse_x;
cursor.y := ray.get_mouse_y;
--
--~ray.draw_fps (0, 0);
ray.draw_fps (window_width - 100, window_height - 100);
--
ray.end_drawing;
--
@@ -354,6 +354,8 @@ package body core is

------------------------------------------------------------------------------------------

procedure idle is begin null; end idle;

procedure move_camera_up is begin core.camera.y := core.camera.y - 1; end move_camera_up;
procedure move_camera_down is begin core.camera.y := core.camera.y + 1; end move_camera_down;
procedure move_camera_left is begin core.camera.x := core.camera.x - 1; end move_camera_left;


+ 3
- 1
source/core.ads Visa fil

@@ -30,7 +30,7 @@ package core is
subtype short_string is string (1 .. 24);
subtype long_string is string (1 .. 72);

type procedure_pointer is access procedure;
type pointer is access procedure;

type vector is record x, y : integer; end record;
type sprite is record index, width, height, frames, states : integer; end record;
@@ -120,6 +120,8 @@ package core is

procedure write_text_box (text : in string);

procedure idle;

procedure move_camera_up;
procedure move_camera_down;
procedure move_camera_left;


+ 10
- 11
source/main.adb Visa fil

@@ -69,17 +69,16 @@ procedure main is

------------------------------------------------------------------------------------------

procedure idle is begin null; end idle;
procedure show_attribute_menu is begin menu_insert (menu_attribute); end show_attribute_menu;
procedure show_skill_menu is begin menu_insert (menu_skill); end show_skill_menu;
procedure show_resource_menu is begin menu_insert (menu_resource); end show_resource_menu;
procedure show_unit_menu is begin menu_insert (menu_unit); end show_unit_menu;
procedure show_might_menu is begin menu_insert (menu_might); end show_might_menu;
procedure show_magic_menu is begin menu_insert (menu_magic); end show_magic_menu;
procedure show_attribute_menu is begin menu_insert (menu_attribute); end show_attribute_menu;
procedure show_skill_menu is begin menu_insert (menu_skill); end show_skill_menu;
procedure show_resource_menu is begin menu_insert (menu_resource); end show_resource_menu;
procedure show_unit_menu is begin menu_insert (menu_unit); end show_unit_menu;
procedure show_might_menu is begin menu_insert (menu_might); end show_might_menu;
procedure show_magic_menu is begin menu_insert (menu_magic); end show_magic_menu;
procedure ui_main_style is begin ui.active := ui.style'val ((ui.style'pos (ui.active) + 1) mod 7); end ui_main_style;
procedure hide_top_menu is begin menu_remove; end hide_top_menu;
procedure zoom_in is begin core.zoom := 2; end zoom_in;
procedure zoom_out is begin core.zoom := 1; end zoom_out;
procedure hide_top_menu is begin menu_remove; end hide_top_menu;
procedure zoom_in is begin core.zoom := 2; end zoom_in;
procedure zoom_out is begin core.zoom := 1; end zoom_out;

signal_list : constant array (core.signal_code) of access procedure := (
core.signal_up => core.move_camera_up'access,
@@ -96,7 +95,7 @@ procedure main is
core.signal_grave => hide_top_menu'access,
core.signal_kp_add => zoom_in'access,
core.signal_kp_subtract => zoom_out'access,
others => idle'access
others => core.idle'access
);

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


+ 2
- 2
source/skill.adb Visa fil

@@ -22,7 +22,7 @@ package body skill is
end configure;

------------------------------------------------------------------------------------------
procedure e is begin core.echo (core.warning, "Heyo world!"); end e;
procedure menu (x, y : in integer; center : in boolean) is
column : constant integer := 2;
offset : constant integer := 32;
@@ -35,7 +35,7 @@ package body skill is
ui.draw_title_bar (move_x, move_y, width, "Skills");
--
for index in enumeration loop
ui.draw_icon (sprite (index), trait (index).text, move_x + 216 * (enumeration'pos (index) mod column) + offset, move_y + core.icon * (enumeration'pos (index) / column) + offset);
ui.draw_icon (sprite (index), trait (index).text, move_x + 216 * (enumeration'pos (index) mod column) + offset, move_y + core.icon * (enumeration'pos (index) / column) + offset, e'access);
ui.write (trait (index).name, move_x + 216 * (enumeration'pos (index) mod column) + offset + core.icon, move_y + core.icon * (enumeration'pos (index) / column) + offset);
end loop;
end menu;


+ 9
- 1
source/ui.adb Visa fil

@@ -148,7 +148,7 @@ package body ui is

------------------------------------------------------------------------------------------

procedure draw_icon (data : in core.sprite; description : in string; x, y : in integer) is
procedure draw_icon (data : in core.sprite; description : in string; x, y : in integer; action : access procedure := core.idle'access) is
save_zoom : natural := core.zoom;
begin
select_text_box (description, x, y, core.icon, core.icon);
@@ -158,6 +158,14 @@ package body ui is
core.zoom := 1;
core.draw (data, x, y);
core.zoom := save_zoom;
--
if core.cursor.x > x and core.cursor.x < x + core.icon
and core.cursor.y > y and core.cursor.y < y + core.icon
and core.cursor_mode = 1 then
action.all;
core.cursor_mode := 0;
return;
end if;
end draw_icon;

------------------------------------------------------------------------------------------


+ 1
- 1
source/ui.ads Visa fil

@@ -21,7 +21,7 @@ package ui is

procedure configure;

procedure draw_icon (data : in core.sprite; description : in string; x, y : in integer);
procedure draw_icon (data : in core.sprite; description : in string; x, y : in integer; action : access procedure := core.idle'access);
procedure draw_overicon (data : in core.sprite; description : in string; x, y : in integer);

procedure draw_text_box (x, y, width, height : in integer);


Binär
sprite/ui/fairy/font.png Visa fil

Before After
Width: 162  |  Height: 62  |  Size: 1009B Width: 320  |  Height: 160  |  Size: 5.0KB

Binär
sprite/ui/gnoll/font.png Visa fil

Before After
Width: 162  |  Height: 62  |  Size: 1009B Width: 320  |  Height: 160  |  Size: 5.0KB

Binär
sprite/ui/goblin/font.png Visa fil

Before After
Width: 162  |  Height: 62  |  Size: 1009B Width: 320  |  Height: 160  |  Size: 5.0KB

Binär
sprite/ui/imp/font.png Visa fil

Before After
Width: 162  |  Height: 62  |  Size: 1009B Width: 320  |  Height: 160  |  Size: 5.0KB

Binär
sprite/ui/kobold/font.png Visa fil

Before After
Width: 162  |  Height: 62  |  Size: 1009B Width: 320  |  Height: 160  |  Size: 5.0KB

Binär
sprite/ui/mono.png Visa fil

Before After
Width: 418  |  Height: 158  |  Size: 2.5KB

Laddar…
Avbryt
Spara