--       _________ __                 __                               
--      /   _____//  |_____________ _/  |______     ____  __ __  ______
--      \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
--      /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \ 
--     /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
--             \/                  \/          \//_____/            \/ 
--  ______________________                           ______________________
--            T H E   W A R   B E G I N S
--     Stratagus - A free fantasy real time strategy game engine
--
--  ui.lua      -   Define the human user interface
--
--  (c) Copyright 2000,2004 by Jimmy Salmon and Mohydine
--
--      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
--
--  $Id: ui.lua,v 1.35 2004/03/27 22:13:01 jsalmon3 Exp $

DefineCursor({
  Name = "cursor-point",
  Race = "red-ants",
  File = "ui/red-ants/cursors/human_gauntlet.png",
  HotSpot = { 3,  2},
  Size = {28, 32}})
DefineCursor({
  Name = "cursor-green-hair",
  Race = "red-ants",
  File = "ui/red-ants/cursors/green_eagle.png",
  HotSpot = {15, 15},
  Size = {32, 32}})
DefineCursor({
  Name = "cursor-yellow-hair",
  Race = "red-ants",
  File = "ui/red-ants/cursors/yellow_eagle.png",
  HotSpot = {15, 15},
  Size = {32, 32}})
DefineCursor({
  Name = "cursor-red-hair",
  Race = "red-ants",
  File = "ui/red-ants/cursors/red_eagle.png",
  HotSpot = {15, 15},
  Size = {32, 32}})


---;;Screen looks like
---;;(0 0)
---;;+----------------------------------------+
---;;|(0 Map_top)                             |
---;;+----------------------------------------+
---;;|The Map                                 |
---;;|(0 Map_Bottom)                          |
---;;+----------------------------------------+
---;;|                                        |
---;;|                                        |
---;;+----------------------------------------+
---;;(0 screen_height)
--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
--  * Race red-ants.
--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;



function HumanScreen(screen_width, screen_height)
  info_panel_x = 0
  ---info_panel_y = 160
  info_panel_y = (screen_height - 192) + 16
  icon_size = {46, 38}

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

    "resource-line", {
        "",
      0, 0},

    "resources", {
      "sugar", { "file", "graphics/ui/gold,wood,oil,mana.png", "frame", 0,
        "pos", { 200 + 0, 0}, "size", {14, 14}, "text-pos", { 200 + 0 + 18, 1}},
      "wood", { "file", "graphics/ui/gold,wood,oil,mana.png", "frame", 1,
        "pos", { 200 + 75, 0}, "size", {14, 14}, "text-pos", { 200 + 75 + 18, 1}},
      "plancton", { "file", "graphics/ui/gold,wood,oil,mana.png", "frame", 2,
        "pos", { 200 + 150, 0}, "size", {14, 14}, "text-pos", { 200 + 150 + 18, 1}},
      --"eggs", { "file", "graphics/ui/food.png", "frame", 0,
      --  "pos", { 200 + 225, 0}, "size", {14, 14}, "text-pos", { 200 + 225 + 18, 1}},
      "food", { "file", "graphics/ui/food.png", "frame", 0,
        "pos", { screen_width - 16 - 138, 0}, "size", {14, 14}, "text-pos", { (screen_width - 16 - 138) + 18, 1}},
      "score", { "file", "graphics/ui/score.png", "frame", 0,
        "pos", { screen_width - 16 - 68, 0}, "size", {14, 14}, "text-pos", { (screen_width - 16 - 68) + 18, 1}}},

    "info-panel", {
      "panel", {
        "pos", { 0, screen_height-200},
        "size", {1, 146},
         },
      "selected", {
        "single", {
          "icon", {
            "pos", {  6, screen_height-200}, "size", icon_size }},
        "multiple", {
          "icons", {
            { "pos", {  6, screen_height-200}, "size", icon_size},
            { "pos", {  6, screen_height-200+81}, "size", icon_size},
            { "pos", {  20, screen_height-200+81}, "size", icon_size},
            { "pos", {  34, screen_height-200+81}, "size", icon_size},
            { "pos", {  48, screen_height-200+81}, "size", icon_size},
            { "pos", {  12, screen_height-200+81+14}, "size", icon_size},
            { "pos", {  26, screen_height-200+81+14}, "size", icon_size},
            { "pos", {  40, screen_height-200+81+14}, "size", icon_size},
            { "pos", {  52, screen_height-200+81+14}, "size", icon_size}},
          "max-text", {
            "font", "game",
            "pos", { 6,screen_height-200 }}}
      },
      "training", {
        "single", {
          "text", {
            "text", "Training:",
            "font", "game",
            "pos", { 6, screen_height-130}},
          "icon", {
            "pos", { 6, screen_height-115},
            "size", icon_size}},
        "multiple", {
            "text", {
                "text", "Training:",
                "font", "game",
                "pos", { 35, screen_height-130}},
          "icons", {
            { "pos", {  6, screen_height-115}, "size", icon_size},
            { "pos", {  20, screen_height-115}, "size", icon_size},
            { "pos", {  34, screen_height-115}, "size", icon_size},
            { "pos", {  48, screen_height-115}, "size", icon_size},
            { "pos", {  62, screen_height-115}, "size", icon_size},
            { "pos", {  76, screen_height-115}, "size", icon_size}}}
      },
      "upgrading", {
        "text", {
          "text", "Upgrading:",
          "font", "game",
          "pos", { 6, screen_height-130}},
        "icon", {
          "pos", { 6, screen_height-115},
          "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, screen_height-115}, "size", icon_size},
          { "pos", { 20, screen_height-115}, "size", icon_size},
          { "pos", { 34, screen_height-115}, "size", icon_size},
          { "pos", { 48, screen_height-115}, "size", icon_size},
          { "pos", { 62, screen_height-115}, "size", icon_size},
          { "pos", { 78, screen_height-115}, "size", icon_size}}
      },
      "completed-bar", {
        "color", {235, 185, 0},
        ---"coloroutline", {255, 0, 0},
        "pos", { 10, screen_height-60},
        "size", {128, 5},
        "has-shadow",
        "text", {
          ---"text", "% Complete",
          "text", " ",
          "font", "game",
          "pos", { 50, 275}}
      }
    },

    "button-panel", {
      "panel", {
        "pos", {-148, 270}},
      "icons", {
        {"pos", { 176,screen_height-179}, "size", icon_size},
        {"pos", { 232, screen_height-179}, "size", icon_size},
        {"pos", { 288,screen_height-179}, "size", icon_size},
        {"pos", { 176, screen_height-129}, "size", icon_size},
        {"pos", { 232, screen_height-129}, "size", icon_size},
        {"pos", { 288, screen_height-129}, "size", icon_size},
        {"pos", { 176, screen_height-79}, "size", icon_size},
        {"pos", { 232, screen_height-79}, "size", icon_size},
        {"pos", { 288, screen_height-79}, "size", icon_size}},
      "command-key-font", "game"
    },

    "map-area", {
      "pos", {0, 0},
      "size", {
        screen_width,
        screen_height - 32}},

    "menu-panel", {
      "panel", {
        "file", "graphics/ui/red-ants/menubutton.png",
        "pos", {0, screen_height - 16 - 16}},
      "menu-button", {
        "pos", {6, screen_height - 10 - 16},
        "size", {80, 16},
        "caption", "Menu (~<F10~>)",
        "font", "game",
        "style", "network"},
    
      "network-menu-button", {
        "pos", {6, screen_height - 10 - 16},
        "size", {80, 16},
        "caption", "Menu",
        "font", "game",
        "style", "network"},
      "network-diplomacy-button", {
        "pos", {90, screen_height  -10 -16 },
        "size", {80, 16},
        "caption", "Diplomacy",
        "font", "game",
        "style", "network"},
    },

    "minimap", {
      "panel-pos", {0, 16},
      "pos", {screen_width-150 ,screen_height-162},
      "size", {128, 128}},

    "status-line", {
      "file", "graphics/ui/red-ants/" ..
        screen_width .. "x" .. screen_height ..
        "/statusline.png",
      --"pos", { 176, screen_height - 16 },
    "pos", { 176, screen_height - 32 },
      "text-pos", { 2 + 176, 2 + screen_height - 30 },
      "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/red-ants/panel_1.png",
      "panel2", "graphics/ui/red-ants/panel_2.png",
      "panel3", "graphics/ui/red-ants/panel_3.png",
      "panel4", "graphics/ui/red-ants/panel_4.png",
      "panel5", "graphics/ui/red-ants/panel_5.png"
    },

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

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