Removed popup box, added attribute cheat, refactored help menu...

This commit is contained in:
Ognjen Milan Robovic 2024-06-10 10:19:24 -04:00
parent 461186f783
commit 1becd3bd79
7 changed files with 25 additions and 52 deletions

View File

@ -439,12 +439,8 @@ package body core is
------------------------------------------------------------------------------------------
function read_help_box return string is begin return to_string (help_box.text); end read_help_box;
function read_text_box return string is begin return to_string (text_box.text); end read_text_box;
------------------------------------------------------------------------------------------
procedure write_help_box (text : in string) is begin help_box.text := to_unbounded_string (text); end write_help_box;
procedure write_text_box (text : in string) is begin text_box.text := to_unbounded_string (text); end write_text_box;
------------------------------------------------------------------------------------------

View File

@ -111,7 +111,6 @@ package core is
zoom : natural := 1;
help_box : string_box_data;
text_box : string_box_data;
global_image : ray.image;
@ -204,10 +203,8 @@ package core is
procedure overlay;
function read_help_box return string;
function read_text_box return string;
procedure write_help_box (text : in string);
procedure write_text_box (text : in string);
procedure save_point (here : in core.io.file_type; data : in point);
procedure load_point (here : in core.io.file_type; data : out point);

View File

@ -42,14 +42,14 @@ package location is
well_of_strength => (new string'("Well of Strength"), true, 4, (effect.modify_attribute, attribute.enumeration'pos (attribute.offense), 2, false, 0)),
old_dwarven_grave => (new string'("Old Dwarven Grave"), true, 1, (effect.modify_attribute, attribute.enumeration'pos (attribute.defense), 1, false, 0)),
huge_ancient_urn => (new string'("Huge Ancient Urn"), true, 1, (effect.modify_attribute, attribute.enumeration'pos (attribute.offense), 1, false, 0)),
banana_tree => (new string'("Banana Tree"), true, 4, (effect.modify_material, material.enumeration'pos (material.banana), 4, true, 600)),
apple_tree => (new string'("Apple Tree"), true, 4, (effect.modify_material, material.enumeration'pos (material.apple), 6, true, 600)),
cherry_tree => (new string'("Cherry Tree"), true, 4, (effect.modify_material, material.enumeration'pos (material.cherry), 6, true, 600)),
lemon_tree => (new string'("Lemon Tree"), true, 4, (effect.modify_material, material.enumeration'pos (material.lemon), 6, true, 600)),
orange_tree => (new string'("Orange Tree"), true, 4, (effect.modify_material, material.enumeration'pos (material.orange), 6, true, 600)),
pear_tree => (new string'("Pear Tree"), true, 4, (effect.modify_material, material.enumeration'pos (material.pear), 6, true, 600)),
peach_tree => (new string'("Peach Tree"), true, 4, (effect.modify_material, material.enumeration'pos (material.peach), 6, true, 600)),
plum_tree => (new string'("Plum Tree"), true, 4, (effect.modify_material, material.enumeration'pos (material.plum), 6, true, 600)),
banana_tree => (new string'("Banana Tree"), true, 4, (effect.modify_material, material.enumeration'pos (material.banana), 4, true, 12)),
apple_tree => (new string'("Apple Tree"), true, 4, (effect.modify_material, material.enumeration'pos (material.apple), 6, true, 12)),
cherry_tree => (new string'("Cherry Tree"), true, 4, (effect.modify_material, material.enumeration'pos (material.cherry), 6, true, 12)),
lemon_tree => (new string'("Lemon Tree"), true, 4, (effect.modify_material, material.enumeration'pos (material.lemon), 6, true, 12)),
orange_tree => (new string'("Orange Tree"), true, 4, (effect.modify_material, material.enumeration'pos (material.orange), 6, true, 12)),
pear_tree => (new string'("Pear Tree"), true, 4, (effect.modify_material, material.enumeration'pos (material.pear), 6, true, 12)),
peach_tree => (new string'("Peach Tree"), true, 4, (effect.modify_material, material.enumeration'pos (material.peach), 6, true, 12)),
plum_tree => (new string'("Plum Tree"), true, 4, (effect.modify_material, material.enumeration'pos (material.plum), 6, true, 12)),
pillars_of_observation => (new string'("Pillars of Observation"), true, 1, (effect.modify_attribute, attribute.enumeration'pos (attribute.reach), 2, false, 0))
);

View File

@ -46,6 +46,7 @@ procedure main is
core.signal_f6 => world.resource_cheat_6'access,
core.signal_f7 => world.reveal_map'access,
core.signal_f8 => world.restore_points'access,
core.signal_f9 => world.increase_attributes'access,
others => core.idle_skip'access
);

View File

@ -85,8 +85,6 @@ package body ui is
procedure draw_background (index : in element; x, y, width, height : in integer; action : core.pointer := core.idle_skip'access);
procedure draw_popup_box;
------------------------------------------------------------------------------------------
procedure configure is
@ -115,12 +113,6 @@ package body ui is
prioritize := false;
--
draw (cursor, core.cursor.x, core.cursor.y);
--
if core.cursor_mode = core.cursor_middle then
draw_popup_box;
end if;
--
core.write_text_box ("--");
end synchronize;
------------------------------------------------------------------------------------------
@ -688,29 +680,6 @@ package body ui is
end if;
end draw_background;
------------------------------------------------------------------------------------------
procedure draw_popup_box is
width : constant integer := 320;
height : constant integer := core.icon;
middle : constant integer := sprite (active, text_middle).width;
offset : constant integer := 16;
begin
draw_background (text_middle, core.cursor.x + middle + offset, core.cursor.y + middle + offset, width - 2 * middle, height - 2 * middle);
--
draw_horizontally (text_upper, core.cursor.x + middle + offset, core.cursor.y + offset, width - 2 * middle);
draw_horizontally (text_lower, core.cursor.x + middle + offset, core.cursor.y + height - middle + offset, width - 2 * middle);
draw_vertically (text_left, core.cursor.x + offset, core.cursor.y + middle + offset, height - 2 * middle);
draw_vertically (text_right, core.cursor.x + width - middle + offset, core.cursor.y + middle + offset, height - 2 * middle);
--
draw (text_upper_left, core.cursor.x + offset, core.cursor.y + offset);
draw (text_upper_right, core.cursor.x + width - middle + offset, core.cursor.y + offset);
draw (text_lower_left, core.cursor.x + offset, core.cursor.y + height - middle + offset);
draw (text_lower_right, core.cursor.x + width - middle + offset, core.cursor.y + height - middle + offset);
--
ui.write (core.read_text_box, core.cursor.x + 4 + offset, core.cursor.y + 6 + offset);
end draw_popup_box;
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
end ui;

View File

@ -280,7 +280,7 @@ package body world is
core.draw (landmark.game (data), x, y, factor => factor);
--
if core.cursor_inside (x, y, landmark.game (data).width * factor, landmark.game (data).height * factor) and core.cursor_mode = core.cursor_middle then
core.write_text_box (landmark.description (data).name.all);
ui.draw_text (landmark.description (data).name.all, core.cursor.x + core.icon, core.cursor.y, border => 10);
end if;
end draw_landmark;
@ -291,7 +291,7 @@ package body world is
core.draw (location.game (data), x, y, state => core.animation'val (boolean'pos (used)), factor => factor);
--
if core.cursor_inside (x, y, location.game (data).width * factor, location.game (data).height * factor) and core.cursor_mode = core.cursor_middle then
core.write_text_box (location.description (data).name.all);
ui.draw_text (location.description (data).name.all, core.cursor.x + core.icon, core.cursor.y, border => 10);
end if;
end draw_location;
@ -302,7 +302,7 @@ package body world is
core.draw (construction.game (data), x, y, factor => factor);
--
if core.cursor_inside (x, y, construction.game (data).width * factor, construction.game (data).height * factor) and core.cursor_mode = core.cursor_middle then
core.write_text_box (construction.description (data).name.all);
ui.draw_text (construction.description (data).name.all, core.cursor.x + core.icon, core.cursor.y, border => 10);
end if;
end draw_construction;
@ -312,8 +312,8 @@ package body world is
begin
core.draw (equipment.game (data), x, y, state => core.idle, factor => factor);
--
if core.cursor_inside (x, y, equipment.game (data).width * factor, equipment.game (data).height * factor) and core.cursor_mode = core.cursor_middle and equipment_valid (data) then
core.write_text_box (equipment.description (data).name.all);
if core.cursor_inside (x, y, equipment.game (data).width * factor, equipment.game (data).height * factor) and core.cursor_mode = core.cursor_middle then
ui.draw_text (equipment.description (data).name.all, core.cursor.x + core.icon, core.cursor.y, border => 10);
end if;
end draw_equipment;
@ -328,7 +328,7 @@ package body world is
end loop;
--
if core.cursor_inside (x, y, core.base * factor, core.base * factor) and core.cursor_mode = core.cursor_middle then
core.write_text_box (unit.description (data).name.all);
ui.draw_text (unit.description (data).name.all, core.cursor.x + core.icon, core.cursor.y, border => 10);
end if;
end draw_unit;
@ -776,6 +776,15 @@ package body world is
------------------------------------------------------------------------------------------
procedure increase_attributes is
begin
for index in attribute.enumeration loop
map.chads (1).attributes (index) := map.chads (1).attributes (index) + 1;
end loop;
end increase_attributes;
------------------------------------------------------------------------------------------
procedure player_up is
begin
if map.chads (1).movement.value = 0 then return; end if;

View File

@ -89,6 +89,7 @@ package world is
procedure resource_cheat_6;
procedure reveal_map;
procedure restore_points;
procedure increase_attributes;
procedure player_up;
procedure player_down;