Browse Source

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

master
parent
commit
52313927d1
7 changed files with 35 additions and 8 deletions
  1. +0
    -3
      source/ui.adb
  2. +3
    -0
      source/ui.ads
  3. +32
    -5
      source/world.adb
  4. BIN
      ui/kobold/main_background.png
  5. BIN
      ui/kobold/title_bar_left.png
  6. BIN
      ui/kobold/title_bar_middle.png
  7. BIN
      ui/kobold/title_bar_right.png

+ 0
- 3
source/ui.adb View File

@@ -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;


+ 3
- 0
source/ui.ads View File

@@ -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;


+ 32
- 5
source/world.adb View File

@@ -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;

------------------------------------------------------------------------------------------


BIN
ui/kobold/main_background.png View File

Before After
Width: 32  |  Height: 32  |  Size: 180B Width: 32  |  Height: 32  |  Size: 182B

BIN
ui/kobold/title_bar_left.png View File

Before After
Width: 48  |  Height: 48  |  Size: 972B Width: 48  |  Height: 48  |  Size: 965B

BIN
ui/kobold/title_bar_middle.png View File

Before After
Width: 24  |  Height: 48  |  Size: 215B Width: 24  |  Height: 48  |  Size: 211B

BIN
ui/kobold/title_bar_right.png View File

Before After
Width: 32  |  Height: 48  |  Size: 687B Width: 32  |  Height: 48  |  Size: 646B

Loading…
Cancel
Save