Added unlimited movement by target...
This commit is contained in:
parent
c7253308a3
commit
300c1b78e3
@ -134,13 +134,13 @@ procedure main is
|
|||||||
movement => (10, 20),
|
movement => (10, 20),
|
||||||
attributes => attribute.default,
|
attributes => attribute.default,
|
||||||
skills => skill.default,
|
skills => skill.default,
|
||||||
resources => ((101, 240), (103, 240), (107, 240), (109, 240), (113, 240), (127, 240)),
|
resources => ((29, 480), (11, 240), (23, 240), (13, 240), (17, 240), (7, 240)),
|
||||||
materials => material.default,
|
materials => material.default,
|
||||||
equipments => (equipment.chest => equipment.elven_armour,
|
equipments => (equipment.chest => equipment.iron_chestplate,
|
||||||
equipment.head => equipment.elven_helmet,
|
equipment.head => equipment.iron_helmet,
|
||||||
equipment.hands => equipment.leather_gauntlets,
|
equipment.hands => equipment.iron_gauntlets,
|
||||||
equipment.feet => equipment.leather_greaves,
|
equipment.feet => equipment.iron_greaves,
|
||||||
equipment.main_hand => equipment.jade_sword,
|
equipment.main_hand => equipment.iron_sword,
|
||||||
others => equipment.none),
|
others => equipment.none),
|
||||||
item_count => 0,
|
item_count => 0,
|
||||||
items => (others => equipment.none)
|
items => (others => equipment.none)
|
||||||
@ -325,10 +325,13 @@ begin
|
|||||||
height => core.icon,
|
height => core.icon,
|
||||||
action => view_show (index));
|
action => view_show (index));
|
||||||
--
|
--
|
||||||
core.draw (view_icon (index), core.window_width - core.icon * (view'pos (view'last) + 1) + core.icon * view'pos (index), core.window_height - core.icon,
|
core.draw (data => view_icon (index),
|
||||||
|
x => core.window_width - core.icon * (view'pos (view'last) + 1) + core.icon * view'pos (index),
|
||||||
|
y => core.window_height - core.icon,
|
||||||
ignore => true,
|
ignore => true,
|
||||||
u => 0,
|
u => 0,
|
||||||
v => boolean'pos (view_list (index)) * core.icon);
|
v => boolean'pos (view_list (index)) * core.icon,
|
||||||
|
factor => 1);
|
||||||
end loop;
|
end loop;
|
||||||
--
|
--
|
||||||
resource.draw_points (world.map.chads (1).resources, (preview_width - 5 * core.icon * resource.count) / 2, core.base);
|
resource.draw_points (world.map.chads (1).resources, (preview_width - 5 * core.icon * resource.count) / 2, core.base);
|
||||||
|
@ -33,7 +33,7 @@ package body material is
|
|||||||
if data (index).value > 0 then
|
if data (index).value > 0 then
|
||||||
ui.draw_icon (icon (index), -(description (index).name), move_x, y);
|
ui.draw_icon (icon (index), -(description (index).name), move_x, y);
|
||||||
ui.draw_text_box (move_x, y + core.icon, core.icon, core.icon);
|
ui.draw_text_box (move_x, y + core.icon, core.icon, core.icon);
|
||||||
ui.write (data (index).value'image, move_x + 4, y + core.icon + 8, (255, 255, 255, 255), 15, true);
|
ui.write (data (index).value'image, move_x, y + core.icon + 8, (255, 255, 255, 255), 15, true);
|
||||||
--
|
--
|
||||||
move_x := move_x + core.icon;
|
move_x := move_x + core.icon;
|
||||||
end if;
|
end if;
|
||||||
|
@ -57,7 +57,7 @@ package body skill is
|
|||||||
--
|
--
|
||||||
ui.draw_icon (icon (index), -(description (index).text), move_x, move_y);
|
ui.draw_icon (icon (index), -(description (index).text), move_x, move_y);
|
||||||
ui.draw_text_box (move_x + core.icon, move_y, core.icon, core.icon);
|
ui.draw_text_box (move_x + core.icon, move_y, core.icon, core.icon);
|
||||||
ui.write (data (index).value'image, move_x + core.icon + 4, move_y + 8, (255, 255, 255, 255), 15, true);
|
ui.write (data (index).value'image, move_x + core.icon, move_y + 8, (255, 255, 255, 255), 15, true);
|
||||||
--
|
--
|
||||||
ui.write (-(description (index).name), move_x + 2 * core.icon + 4, move_y + 8, (255, 255, 255, 255), 15, true);
|
ui.write (-(description (index).name), move_x + 2 * core.icon + 4, move_y + 8, (255, 255, 255, 255), 15, true);
|
||||||
--
|
--
|
||||||
|
@ -81,7 +81,10 @@ package body world is
|
|||||||
------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
procedure draw_tiles (offset, view_from, view_to : in core.vector) is
|
procedure draw_tiles (offset, view_from, view_to : in core.vector) is
|
||||||
time : float := 0.0;
|
time : float := 0.0;
|
||||||
|
step : core.vector := core.camera;
|
||||||
|
size : constant integer := core.base * core.zoom;
|
||||||
|
hits : natural := 0;
|
||||||
begin
|
begin
|
||||||
time := core.time;
|
time := core.time;
|
||||||
--
|
--
|
||||||
@ -93,8 +96,8 @@ package body world is
|
|||||||
--
|
--
|
||||||
if map.views (horizontal, vertical) then
|
if map.views (horizontal, vertical) then
|
||||||
core.draw (data => tiles (map.kind),
|
core.draw (data => tiles (map.kind),
|
||||||
x => offset.x + (horizontal - core.camera.x) * core.base * core.zoom,
|
x => offset.x + (horizontal - core.camera.x) * size,
|
||||||
y => offset.y + (vertical - core.camera.y) * core.base * core.zoom,
|
y => offset.y + (vertical - core.camera.y) * size,
|
||||||
u => core.base * map.tiles (horizontal, vertical),
|
u => core.base * map.tiles (horizontal, vertical),
|
||||||
v => core.base * (core.animation_time mod tiles (map.kind).frames),
|
v => core.base * (core.animation_time mod tiles (map.kind).frames),
|
||||||
width => core.base,
|
width => core.base,
|
||||||
@ -103,38 +106,50 @@ package body world is
|
|||||||
--
|
--
|
||||||
core.increment (drawn_tiles);
|
core.increment (drawn_tiles);
|
||||||
--
|
--
|
||||||
if core.cursor.x > offset.x + (horizontal - core.camera.x ) * core.base * core.zoom - 6
|
if core.cursor_inside (x => offset.x + (horizontal - core.camera.x) * size,
|
||||||
and core.cursor.x < offset.x + (horizontal - core.camera.x + 1) * core.base * core.zoom + 6
|
y => offset.y + (vertical - core.camera.y) * size,
|
||||||
and core.cursor.y > offset.y + (vertical - core.camera.y ) * core.base * core.zoom - 6
|
width => size,
|
||||||
and core.cursor.y < offset.y + (vertical - core.camera.y + 1) * core.base * core.zoom + 6
|
height => size)
|
||||||
and core.cursor_mode = core.cursor_left
|
and core.cursor_mode = core.cursor_left
|
||||||
and not ui.prioritize then
|
and not ui.prioritize then
|
||||||
target.x := horizontal;
|
target.x := horizontal;
|
||||||
target.y := vertical;
|
target.y := vertical;
|
||||||
--
|
|
||||||
core.cursor_mode := core.cursor_none;
|
core.cursor_mode := core.cursor_none;
|
||||||
end if;
|
end if;
|
||||||
|
--
|
||||||
|
if core.cursor_inside (x => offset.x + (target.x - core.camera.x) * size,
|
||||||
|
y => offset.y + (target.y - core.camera.y) * size,
|
||||||
|
width => size,
|
||||||
|
height => size)
|
||||||
|
and core.cursor_mode = core.cursor_left
|
||||||
|
and not ui.prioritize then
|
||||||
|
world.map.chads (1).x := horizontal + 1;
|
||||||
|
world.map.chads (1).y := vertical;
|
||||||
|
end if;
|
||||||
end if;
|
end if;
|
||||||
end loop;
|
end loop;
|
||||||
end loop;
|
end loop;
|
||||||
--
|
--
|
||||||
core.draw (data => arrow_target,
|
|
||||||
x => offset.x + (target.x - core.camera.x) * core.base * core.zoom,
|
|
||||||
y => offset.y + (target.y - core.camera.y) * core.base * core.zoom,
|
|
||||||
factor => core.zoom);
|
|
||||||
--
|
|
||||||
if target /= (-1, -1) then
|
if target /= (-1, -1) then
|
||||||
declare step : core.vector := core.camera;
|
step := core.camera;
|
||||||
size : constant integer := core.base * core.zoom;
|
hits := 0;
|
||||||
begin
|
--
|
||||||
--~loop exit when step.x = target.x - 1;
|
core.draw (data => arrow_target,
|
||||||
--~loop exit when step.y = target.y - 1;
|
x => offset.x + (target.x - core.camera.x) * size,
|
||||||
|
y => offset.y + (target.y - core.camera.y) * size,
|
||||||
|
factor => core.zoom);
|
||||||
|
--
|
||||||
|
loop
|
||||||
|
exit when (step.x = target.x - 1 and step.y = target.y - 1) or (hits = 6);
|
||||||
|
--
|
||||||
if step.x < target.x and step.y < target.y then
|
if step.x < target.x and step.y < target.y then
|
||||||
core.draw (arrow_lower_right, offset.x + (step.x + 1 - core.camera.x) * size, offset.y + (step.y + 1 - core.camera.y) * size, factor => core.zoom);
|
core.draw (arrow_lower_right, offset.x + (step.x + 1 - core.camera.x) * size, offset.y + (step.y + 1 - core.camera.y) * size, factor => core.zoom);
|
||||||
step.x := step.x + 1; step.y := step.y + 1;
|
step.x := step.x + 1;
|
||||||
|
step.y := step.y + 1;
|
||||||
elsif step.x > target.x and step.y < target.y then
|
elsif step.x > target.x and step.y < target.y then
|
||||||
core.draw (arrow_lower_left, offset.x + (step.x - 1 - core.camera.x) * size, offset.y + (step.y + 1 - core.camera.y) * size, factor => core.zoom);
|
core.draw (arrow_lower_left, offset.x + (step.x - 1 - core.camera.x) * size, offset.y + (step.y + 1 - core.camera.y) * size, factor => core.zoom);
|
||||||
step.x := step.x - 1; step.y := step.y + 1;
|
step.x := step.x - 1;
|
||||||
|
step.y := step.y + 1;
|
||||||
elsif step.x = target.x and step.y < target.y then
|
elsif step.x = target.x and step.y < target.y then
|
||||||
core.draw (arrow_lower, offset.x + (step.x - core.camera.x) * size, offset.y + (step.y + 1 - core.camera.y) * size, factor => core.zoom);
|
core.draw (arrow_lower, offset.x + (step.x - core.camera.x) * size, offset.y + (step.y + 1 - core.camera.y) * size, factor => core.zoom);
|
||||||
step.y := step.y + 1;
|
step.y := step.y + 1;
|
||||||
@ -146,17 +161,19 @@ package body world is
|
|||||||
step.x := step.x - 1;
|
step.x := step.x - 1;
|
||||||
elsif step.x < target.x and step.y > target.y then
|
elsif step.x < target.x and step.y > target.y then
|
||||||
core.draw (arrow_upper_right, offset.x + (step.x + 1 - core.camera.x) * size, offset.y + (step.y - 1 - core.camera.y) * size, factor => core.zoom);
|
core.draw (arrow_upper_right, offset.x + (step.x + 1 - core.camera.x) * size, offset.y + (step.y - 1 - core.camera.y) * size, factor => core.zoom);
|
||||||
step.x := step.x + 1; step.y := step.y - 1;
|
step.x := step.x + 1;
|
||||||
|
step.y := step.y - 1;
|
||||||
elsif step.x > target.x and step.y > target.y then
|
elsif step.x > target.x and step.y > target.y then
|
||||||
core.draw (arrow_upper_left, offset.x + (step.x - 1 - core.camera.x) * size, offset.y + (step.y - 1 - core.camera.y) * size, factor => core.zoom);
|
core.draw (arrow_upper_left, offset.x + (step.x - 1 - core.camera.x) * size, offset.y + (step.y - 1 - core.camera.y) * size, factor => core.zoom);
|
||||||
step.x := step.x - 1; step.y := step.y - 1;
|
step.x := step.x - 1;
|
||||||
|
step.y := step.y - 1;
|
||||||
elsif step.x = target.x and step.y > target.y then
|
elsif step.x = target.x and step.y > target.y then
|
||||||
core.draw (arrow_upper, offset.x + (step.x - core.camera.x) * size, offset.y + (step.y - 1 - core.camera.y) * size, factor => core.zoom);
|
core.draw (arrow_upper, offset.x + (step.x - core.camera.x) * size, offset.y + (step.y - 1 - core.camera.y) * size, factor => core.zoom);
|
||||||
step.y := step.y - 1;
|
step.y := step.y - 1;
|
||||||
end if;
|
end if;
|
||||||
--~end loop;
|
--
|
||||||
--~end loop;
|
hits := hits + 1;
|
||||||
end;
|
end loop;
|
||||||
end if;
|
end if;
|
||||||
--
|
--
|
||||||
draw_tiles_timer := natural (1_000_000.0 * (core.time - time));
|
draw_tiles_timer := natural (1_000_000.0 * (core.time - time));
|
||||||
|
Loading…
Reference in New Issue
Block a user