--__________         __    __  .__           ___________
--\______   \_____ _/  |__/  |_|  |   ____   \_   _____/__________
-- |    |  _/\__  \\   __\   __\  | _/ __ \   |    __)/  _ \_  __ \
-- |    |   \ / __ \|  |  |  | |  |_\  ___/   |     \(  <_> )  | \/
-- |______  /(____  /__|  |__| |____/\___  >  \___  / \____/|__|
--        \/      \/                     \/       \/
--   _____                     .___.__
--  /     \ _____    ____    __| _/|__| ____  ___________
-- /  \ /  \\__  \  /    \  / __ | |  |/ ___\/  _ \_  __ \
--/    Y    \/ __ \|   |  \/ /_/ | |  \  \__(  <_> )  | \/
--\____|__  (____  /___|  /\____ | |__|\___  >____/|__|
--        \/     \/     \/      \/         \/

--      ui.lua - UI for dwarves
--
--      (c) Copyright 2005 by Kimmo Merikivi
--
--      This program is free software; you can redistribute it and/or modify
--      it under the terms of the GNU General Public License as published by
--      the Free Software Foundation; either version 2 of the License, or
--      (at your option) any later version.
--  
--      This program is distributed in the hope that it will be useful,
--      but WITHOUT ANY WARRANTY; without even the implied warranty of
--      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
--      GNU General Public License for more details.
--  
--      You should have received a copy of the GNU General Public License
--      along with this program; if not, write to the Free Software
--      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

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


--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
--	* Race dwarves.
--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

function DwarvenScreen(screen_width, screen_height)
  info_panel_x = 0
  info_panel_y = 160
  icon_size = {46, 38}

  DefineUI("dwarves", screen_width, screen_height,
    "normal-font-color", "white",
    "reverse-font-color", "yellow",

  "filler", {
      "file", "graphics/ui/panels/" ..
        screen_width .. "x" .. screen_height ..
        "/filler1.png",
      "pos", { screen_width - 16, 0}},

    "resource-line", {
      "graphics/ui/panels/" ..
        screen_width .. "x" .. screen_height ..
        "/resource.png",
      176, 0},

    "resources", {
      "gold", { "file", "graphics/ui/resources.png", "row", 0,
        "pos", { 176 + 0, 0}, "size", {14, 14}, "text-pos", { 176 + 0 + 18, 1}},
      "wood", { "file", "graphics/ui/resources.png", "row", 1,
        "pos", { 176 + 75, 0}, "size", {14, 14}, "text-pos", { 176 + 75 + 18, 1}},
      "oil", { "file", "graphics/ui/resources.png", "row", 2,
        "pos", { 176 + 150, 0}, "size", {14, 14}, "text-pos", { 176 + 150 + 18, 1}},
      "stone", { "file", "graphics/ui/resources.png", "row", 3,
        "pos", { 176 + 225, 0}, "size", {14, 14}, "text-pos", { 176 + 225 + 18, 1}},
      "iron", { "file", "graphics/ui/resources.png", "row", 4,
        "pos", { 176 + 300, 0}, "size", {14, 14}, "text-pos", { 176 + 300 + 18, 1}},
      "titanium", { "file", "graphics/ui/resources.png", "row", 5,
        "pos", { 176 + 375, 0}, "size", {14, 14}, "text-pos", { 176 + 375 + 18, 1}},
      "food", { "file", "graphics/ui/resources.png", "row", 6,
        "pos", { screen_width - 16 - 138, 0}, "size", {14, 14}, "text-pos", { (screen_width - 16 - 138) + 18, 1}},
      "score", { "file", "graphics/ui/resources.png", "row", 8,
        "pos", { screen_width - 16 - 68, 0}, "size", {14, 14}, "text-pos", { (screen_width - 16 - 68) + 18, 1}}},

    "info-panel", {
      "panel", {
        "file", "graphics/ui/panels/infopanel.png",
        "pos", { info_panel_x, info_panel_y},
        "size", {176, 230}
      },
      "selected", {
        "single", {
          "icon", {
            "pos", {  6, 166}, "size", icon_size}},
        "multiple", {
          "icons", {
            { "pos", {  6, 166}, "size", icon_size},
            { "pos", { 62, 166}, "size", icon_size},
            { "pos", {118, 166}, "size", icon_size},
            { "pos", {  6, 220}, "size", icon_size},
            { "pos", { 62, 220}, "size", icon_size},
            { "pos", {118, 220}, "size", icon_size},
            { "pos", {  6, 274}, "size", icon_size},
            { "pos", { 62, 274}, "size", icon_size},
            { "pos", {118, 274}, "size", icon_size},
	    { "pos", {  6, 328}, "size", icon_size},
            { "pos", { 62, 328}, "size", icon_size},
            { "pos", {118, 328}, "size", icon_size},
	    { "pos", { 23, 183}, "size", icon_size},
	    { "pos", { 85, 183}, "size", icon_size},
	    { "pos", {  23, 240}, "size", icon_size},
	    { "pos", { 85, 240}, "size", icon_size},
	    { "pos", {  23, 297}, "size", icon_size},
            { "pos", { 85, 297}, "size", icon_size}},
          "max-text", {
            "font", "user1",
            "pos", { info_panel_x + 10, info_panel_y + 10}}}
      },
      "training", {
        "single", {
          "text", {
            "text", "Training:",
            "font", "game",
            "pos", { info_panel_x + 37, info_panel_y + 8 + 78}},
          "icon", {
            "pos", { info_panel_x + 107, info_panel_y + 8 + 70},
            "size", icon_size}},
        "multiple", {
          "icons", {
            { "pos", {  6, 216}, "size", icon_size},
            { "pos", { 62, 216}, "size", icon_size},
            { "pos", {118, 216}, "size", icon_size},
            { "pos", {  6, 263}, "size", icon_size},
            { "pos", { 62, 263}, "size", icon_size},
            { "pos", {118, 263}, "size", icon_size},
	    { "pos", {  6, 310}, "size", icon_size},
            { "pos", { 62, 310}, "size", icon_size},
            { "pos", {118, 310}, "size", icon_size},
	    { "pos", { 23, 236}, "size", icon_size},
	    { "pos", { 85, 236}, "size", icon_size},
	    { "pos", { 23, 262}, "size", icon_size},
	    { "pos", { 85, 262}, "size", icon_size},
	    { "pos", { 23, 288}, "size", icon_size},
	    { "pos", { 85, 288}, "size", icon_size}}}
      },
      "upgrading", {
        "text", {
          "text", "Upgrading:",
          "font", "game",
          "pos", { info_panel_x + 29, info_panel_y + 8 + 78}},
        "icon", {
          "pos", { info_panel_x + 107, info_panel_y + 8 + 70},
          "size", icon_size},
      },
      "researching", {
        "text", {
          "text", "Researching:",
          "font", "game",
          "pos", { info_panel_x + 16, info_panel_y + 8 + 78}},
        "icon", {
          "pos", { info_panel_x + 107, info_panel_y + 8 + 70},
          "size", icon_size}
      },

      "transporting", {
          "icons", {
            { "pos", {  6, 166}, "size", icon_size},
            { "pos", { 62, 166}, "size", icon_size},
            { "pos", {118, 166}, "size", icon_size},
            { "pos", {  6, 220}, "size", icon_size},
            { "pos", { 62, 220}, "size", icon_size},
            { "pos", {118, 220}, "size", icon_size},
            { "pos", {  6, 274}, "size", icon_size},
            { "pos", { 62, 274}, "size", icon_size},
            { "pos", {118, 274}, "size", icon_size},
	    { "pos", {  6, 328}, "size", icon_size},
            { "pos", { 62, 328}, "size", icon_size},
            { "pos", {118, 328}, "size", icon_size},
	    { "pos", { 23, 183}, "size", icon_size},
	    { "pos", { 85, 183}, "size", icon_size},
	    { "pos", {  23, 240}, "size", icon_size},
	    { "pos", { 85, 240}, "size", icon_size},
	    { "pos", {  23, 297}, "size", icon_size},
            { "pos", { 85, 297}, "size", icon_size}},
      },
      
      "completed-bar", {
        "color", {48, 100, 4},
        "pos", { 12, 360},
        "size", {152, 14},
        "text", {
          "text", "% Complete",
          "font", "game",
          "pos", { 50, 360}}
      }
    },

    "button-panel", {
      "panel", {
        "file", "graphics/ui/panels/" ..
          screen_width .. "x" .. screen_height ..
          "/buttonpanel.png",
        "pos", {0, 390}},
      "icons", {
        {"pos", {  6, 391}, "size", icon_size},
        {"pos", { 62, 391}, "size", icon_size},
        {"pos", {118, 391}, "size", icon_size},
        {"pos", {  6, 438}, "size", icon_size},
        {"pos", { 62, 438}, "size", icon_size},
        {"pos", {118, 438}, "size", icon_size},
        {"pos", {  6, 485}, "size", icon_size},
        {"pos", { 62, 485}, "size", icon_size},
        {"pos", {118, 485}, "size", icon_size}}
    },

    "map-area", {
      "pos", {176, 16},
      "size", {
        (32 * math.floor((screen_width - 176 - 16) / 32)),
        (32 * math.floor((screen_height - 16 - 16) / 32))}},

    "menu-panel", {
      "panel", {
        "file", "graphics/ui/panels/menubutton.png",
        "pos", {0, 0}},
      "menu-button", {
        "pos", {24, 2},
        "size", {128, 19},
        "caption", "Menu (~<F10~>)",
        "style", "main"},
      "network-menu-button", {
        "pos", {6, 2},
        "size", {80, 19},
        "caption", "Menu",
        "style", "network"},
      "network-diplomacy-button", {
        "pos", {90, 2},
        "size", {80, 19},
        "caption", "Diplomacy",
        "style", "network"},
    },

    "minimap", {
      "transparent",
      "file", "graphics/ui/panels/minimap.png",
      "panel-pos", {0, 24},
      "pos", {0 + 24, 24 + 2},
      "size", {128, 128}},

    "status-line", {
      "file", "graphics/ui/panels/" ..
        screen_width .. "x" .. screen_height ..
        "/statusline.png",
      "pos", { 176, screen_height - 16},
      "text-pos", { 2 + 176, 2 + screen_height - 16},
      "font", "game"},

    "cursors", {
      "point", "cursor-point",
      "glass", "cursor-glass",
      "cross", "cursor-cross",
      "yellow", "cursor-yellow-hair",
      "green", "cursor-green-hair",
      "red", "cursor-red-hair",
      "scroll", "cursor-scroll",
      "arrow-e", "cursor-arrow-e",
      "arrow-ne", "cursor-arrow-ne",
      "arrow-n", "cursor-arrow-n",
      "arrow-nw", "cursor-arrow-nw",
      "arrow-w", "cursor-arrow-w",
      "arrow-sw", "cursor-arrow-sw",
      "arrow-s", "cursor-arrow-s",
      "arrow-se", "cursor-arrow-se"},

    "menu-panels", {
      "panel1", "graphics/ui/panels/panel_1.png",
      "panel2", "graphics/ui/panels/panel_2.png",
      "panel3", "graphics/ui/panels/panel_3.png",
      "panel4", "graphics/ui/panels/panel_4.png",
      "panel5", "graphics/ui/panels/panel_5.png"},

    "victory-background", "graphics/ui/victory.png",
    "defeat-background", "graphics/ui/defeat.png")
end

DwarvenScreen(640, 480)
DwarvenScreen(800, 600)
DwarvenScreen(1024, 768)
DwarvenScreen(1280, 960)
DwarvenScreen(1600, 1200)
