diff --git a/source/ui.adb b/source/ui.adb index 4c4e193..983e977 100644 --- a/source/ui.adb +++ b/source/ui.adb @@ -73,9 +73,6 @@ package body ui is sprite : array (style, element) of core.sprite; monospace : core.font; - -- - monowidth : constant natural := 9; - monoheight : constant natural := 15; console_message_limit : constant natural := 6; console_message_count : natural := 0; diff --git a/source/ui.ads b/source/ui.ads index c9cf44e..c63c67c 100644 --- a/source/ui.ads +++ b/source/ui.ads @@ -17,6 +17,9 @@ package ui is style_count : constant natural := style'pos (style'last) + 1; + monowidth : constant natural := 9; + monoheight : constant natural := 15; + font : array (style) of core.font; active : style := main; diff --git a/source/world.adb b/source/world.adb index 1f9b31d..e9e8e52 100644 --- a/source/world.adb +++ b/source/world.adb @@ -1047,9 +1047,9 @@ package body world is -- offset : constant integer := 8; width : constant integer := 640; - height : constant integer := 600; more : constant natural := 10; 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_y : integer := core.center_y (height) + offset; 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.write (data.name.all, at_x + less, at_y + less); -- - at_y := at_y + core.icon; - -- 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); 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; -- at_x := core.center_x (width) + offset; @@ -1087,6 +1090,30 @@ package body world is "Stack:" & data.limit'image & character'val (10) & "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_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; ------------------------------------------------------------------------------------------ diff --git a/ui/kobold/main_background.png b/ui/kobold/main_background.png index 07ebb92..fc8774a 100644 Binary files a/ui/kobold/main_background.png and b/ui/kobold/main_background.png differ diff --git a/ui/kobold/title_bar_left.png b/ui/kobold/title_bar_left.png index fc75448..d60d30c 100644 Binary files a/ui/kobold/title_bar_left.png and b/ui/kobold/title_bar_left.png differ diff --git a/ui/kobold/title_bar_middle.png b/ui/kobold/title_bar_middle.png index 60c7fbf..9553b37 100644 Binary files a/ui/kobold/title_bar_middle.png and b/ui/kobold/title_bar_middle.png differ diff --git a/ui/kobold/title_bar_right.png b/ui/kobold/title_bar_right.png index db56ecf..4042ee7 100644 Binary files a/ui/kobold/title_bar_right.png and b/ui/kobold/title_bar_right.png differ