Added end turn button sprites...

This commit is contained in:
Ognjen Milan Robovic 2024-06-01 14:09:35 -04:00
parent cb34d6abf4
commit 4340ab7d2d
13 changed files with 39 additions and 11 deletions

View File

@ -527,6 +527,7 @@ package body core is
cursor.x := ray.get_mouse_x;
cursor.y := ray.get_mouse_y;
wheel := wheel + ray.mouse_wheel_move;
end_turn := false;
--
ray.end_drawing;
--

View File

@ -113,6 +113,8 @@ package core is
global_image : ray.image;
end_turn : boolean := false;
------------------------------------------------------------------------------------------
function "=" (a, b : in signal_code) return boolean;

View File

@ -295,6 +295,9 @@ begin
ui.draw_tiny_menu (preview_width, 0, side_panel, preview_height);
chad.draw_data (world.map.chads (1), preview_width + 32, 32);
--
ui.draw_end_turn_button (x => core.window_width - side_panel + side_panel / 2 - core.icon,
y => core.window_height - core.icon - text_box_height - 106 - 2 * core.icon);
--
ui.draw_console_box (x => core.window_width - core.icon - (side_panel - 2 * core.icon),
y => core.window_height - core.icon - text_box_height - 106,
width => side_panel - 2 * core.icon,

View File

@ -46,7 +46,9 @@ package body ui is
--
title_bar_left, title_bar_middle, title_bar_right,
--
check_box_on, check_box_off
check_box_on, check_box_off,
--
end_turn_button
);
------------------------------------------------------------------------------------------
@ -585,6 +587,20 @@ package body ui is
------------------------------------------------------------------------------------------
procedure draw_end_turn_button (x, y : in integer) is
begin
draw (end_turn_button, x, y);
--
if core.cursor_inside (x, y, sprite (active, end_turn_button).width, sprite (active, end_turn_button).height) and core.cursor_mode = core.cursor_left then
core.end_turn := true;
core.cursor_mode := core.cursor_none;
--
echo ("-- Turn --");
end if;
end draw_end_turn_button;
------------------------------------------------------------------------------------------
procedure draw_state_box (x, y : in integer) is
begin
ui.write ("Cursor X:" & core.cursor.x'image, x, y + 0);

View File

@ -84,6 +84,8 @@ package ui is
procedure draw_tiny_menu (x, y, width, height : in integer);
procedure draw_icon_menu (x, y, width, height : in integer);
procedure draw_end_turn_button (x, y : in integer);
procedure draw_state_box (x, y : in integer);
procedure draw_console_box (x, y, width, height : in integer);

View File

@ -75,16 +75,16 @@ package body world is
--
core.increment (drawn_tiles);
--
if core.cursor.x > offset.x + (horizontal - core.camera.x ) * core.base * core.zoom - 6
and core.cursor.x < offset.x + (horizontal - core.camera.x + 1) * core.base * core.zoom + 6
and core.cursor.y > offset.y + (vertical - core.camera.y ) * core.base * core.zoom - 6
and core.cursor.y < offset.y + (vertical - core.camera.y + 1) * core.base * core.zoom + 6
and core.cursor_mode = core.cursor_left
and not ui.prioritize then
map.chads (1).x := horizontal;
map.chads (1).y := vertical;
core.cursor_mode := core.cursor_none;
end if;
--~if core.cursor.x > offset.x + (horizontal - core.camera.x ) * core.base * core.zoom - 6
--~and core.cursor.x < offset.x + (horizontal - core.camera.x + 1) * core.base * core.zoom + 6
--~and core.cursor.y > offset.y + (vertical - core.camera.y ) * core.base * core.zoom - 6
--~and core.cursor.y < offset.y + (vertical - core.camera.y + 1) * core.base * core.zoom + 6
--~and core.cursor_mode = core.cursor_left
--~and not ui.prioritize then
--~map.chads (1).x := horizontal;
--~map.chads (1).y := vertical;
--~core.cursor_mode := core.cursor_none;
--~end if;
end if;
end loop;
end loop;
@ -790,6 +790,7 @@ package body world is
procedure player_up is
begin
if map.chads (1).movement.value = 0 then return; end if;
core.decrement (map.chads (1).y);
core.clip (map.chads (1).y, 0, map.height - 1);
map.chads (1).movement := map.chads (1).movement - 1;
@ -805,6 +806,7 @@ package body world is
procedure player_down is
begin
if map.chads (1).movement.value = 0 then return; end if;
core.increment (map.chads (1).y);
core.clip (map.chads (1).y, 0, map.height - 1);
map.chads (1).movement := map.chads (1).movement - 1;
@ -820,6 +822,7 @@ package body world is
procedure player_left is
begin
if map.chads (1).movement.value = 0 then return; end if;
core.decrement (map.chads (1).x);
core.clip (map.chads (1).x, 0, map.width - 1);
map.chads (1).movement := map.chads (1).movement - 1;
@ -835,6 +838,7 @@ package body world is
procedure player_right is
begin
if map.chads (1).movement.value = 0 then return; end if;
core.increment (map.chads (1).x);
core.clip (map.chads (1).x, 0, map.width - 1);
map.chads (1).movement := map.chads (1).movement - 1;

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 869 B

BIN
ui/imp/end_turn_button.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
ui/main/end_turn_button.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 729 B