Minor Kobold UI theme change, and some unit menu refactoring...

This commit is contained in:
Ognjen Milan Robovic 2024-06-09 15:42:24 -04:00
parent 349e9d2589
commit 52313927d1
7 changed files with 35 additions and 8 deletions

View File

@ -73,9 +73,6 @@ package body ui is
sprite : array (style, element) of core.sprite; sprite : array (style, element) of core.sprite;
monospace : core.font; monospace : core.font;
--
monowidth : constant natural := 9;
monoheight : constant natural := 15;
console_message_limit : constant natural := 6; console_message_limit : constant natural := 6;
console_message_count : natural := 0; console_message_count : natural := 0;

View File

@ -17,6 +17,9 @@ package ui is
style_count : constant natural := style'pos (style'last) + 1; style_count : constant natural := style'pos (style'last) + 1;
monowidth : constant natural := 9;
monoheight : constant natural := 15;
font : array (style) of core.font; font : array (style) of core.font;
active : style := main; active : style := main;

View File

@ -1047,9 +1047,9 @@ package body world is
-- --
offset : constant integer := 8; offset : constant integer := 8;
width : constant integer := 640; width : constant integer := 640;
height : constant integer := 600;
more : constant natural := 10; more : constant natural := 10;
less : constant natural := 5; less : constant natural := 5;
height : constant integer := chad.view_height + 4 * core.icon + 2 * core.base + 3 * ui.monoheight + 2 * more + 2 * offset;
at_x : integer := core.center_x (width) + offset; at_x : integer := core.center_x (width) + offset;
at_y : integer := core.center_y (height) + offset; at_y : integer := core.center_y (height) + offset;
begin begin
@ -1062,14 +1062,17 @@ package body world is
ui.draw_text_box (at_x, at_y, width - unit.view_width - 2 * offset, core.icon); ui.draw_text_box (at_x, at_y, width - unit.view_width - 2 * offset, core.icon);
ui.write (data.name.all, at_x + less, at_y + less); ui.write (data.name.all, at_x + less, at_y + less);
-- --
at_y := at_y + core.icon;
--
for index in attribute.enumeration loop for index in attribute.enumeration loop
ui.draw_icon_menu (at_x, at_y, core.icon * 2, core.icon, attribute.description (index).text.all); if attribute.enumeration'pos (index) = attribute.count / 2 or attribute.enumeration'pos (index) = 0 then -- hack
at_y := at_y + core.icon;
at_x := core.center_x (width) + offset + unit.view_width;
end if;
--
ui.draw_icon_menu (at_x, at_y, core.icon * 3, core.icon, attribute.description (index).text.all);
core.draw (attribute.icon (index), at_x, at_y, factor => 1); core.draw (attribute.icon (index), at_x, at_y, factor => 1);
ui.write (data.attributes (index)'image, at_x + core.icon + more, at_y + more, code => true); ui.write (data.attributes (index)'image, at_x + core.icon + more, at_y + more, code => true);
-- --
at_x := at_x + 2 * core.icon; at_x := at_x + 3 * core.icon;
end loop; end loop;
-- --
at_x := core.center_x (width) + offset; at_x := core.center_x (width) + offset;
@ -1087,6 +1090,30 @@ package body world is
"Stack:" & data.limit'image & character'val (10) & "Stack:" & data.limit'image & character'val (10) &
"Bonus: " & attribute.description (faction.description (data.kind).bonus_attribute).name.all, "Bonus: " & attribute.description (faction.description (data.kind).bonus_attribute).name.all,
at_x + (width - offset) / 2, at_y, (width - 3 * offset) / 2 - 2 * more, 0, 0, more); at_x + (width - offset) / 2, at_y, (width - 3 * offset) / 2 - 2 * more, 0, 0, more);
--
at_y := at_y + 3 * ui.monoheight + 2 * more;
--
ui.draw_separator (at_x, at_y, width - 2 * offset);
--
at_y := at_y + core.base - core.icon;
--
for index in equipment.kind loop
if equipment.kind'pos (index) mod 2 = 0 then -- hack
at_y := at_y + core.icon;
at_x := core.center_x (width) + offset;
end if;
--
ui.draw_icon_menu (at_x, at_y, (width - 2 * offset) / 2, core.icon, equipment.description (data.equipments (index)).name.all);
ui.write (equipment.description (data.equipments (index)).name.all, at_x + core.icon + more, at_y + more, code => true);
--
if equipment.enumeration'pos (data.equipments (index)) /= equipment.enumeration'pos (equipment.none) then
core.draw (equipment.icon (data.equipments (index)), at_x, at_y, factor => 1);
else
core.draw (equipment.slot (index), at_x, at_y, factor => 1);
end if;
--
at_x := at_x + (width - 2 * offset) / 2;
end loop;
end show_unit; end show_unit;
------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 B

After

Width:  |  Height:  |  Size: 182 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 972 B

After

Width:  |  Height:  |  Size: 965 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 215 B

After

Width:  |  Height:  |  Size: 211 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 687 B

After

Width:  |  Height:  |  Size: 646 B