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

--      buttons.lua - Darkness buttons
--
--      (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

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

-- general commands -- almost all units have it -------------------------------

DefineButton( { Pos = 1, Level = 0, Icon = "icon-move",
  Action = "move",
  Key = "m", Hint = "~!MOVE",
  ForUnit = {"unit-darkness-warrior", "unit-darkness-worker", "unit-darkness-bowman", "unit-repairman", "unit-darkness-spearman", "unit-ozug", "unit-guard", "unit-ozug-guard", "unit-big-goblin",
  "unit-wolf", "unit-darkness-catapult", "darkness-group", "unit-well-trained-goblin", "unit-tower-guard", "unit-bowman-hero", "unit-darkness-big-goblin"} } )
DefineButton( { Pos = 2, Level = 0, Icon = "icon-stop",
  Action = "stop",
  Key = "s", Hint = "~!STOP",
  ForUnit = {"unit-darkness-warrior", "unit-repairman", "unit-darkness-worker", "unit-darkness-bowman", 
  "unit-darkness-spearman", "unit-ozug", "unit-guard", "unit-ozug-guard", "unit-big-goblin", 
  "unit-well-trained-goblin", "unit-tower-guard", "unit-bowman-hero", "unit-darkness-big-goblin",
  "unit-wolf", "unit-darkness-catapult", "darkness-group"} } )
DefineButton( { Pos = 3, Level = 0, Icon = "icon-attack",
  Action = "attack",
  Key = "a", Hint = "~!ATTACK",
  ForUnit = {"unit-darkness-warrior", "unit-darkness-worker", "unit-guard", "unit-ozug-guard", 
  "unit-darkness-spearman", "unit-big-goblin", "unit-well-trained-goblin", "unit-darkness-big-goblin",
  "unit-wolf", "darkness-group"} } )
DefineButton( { Pos = 3, Level = 0, Icon = "icon-attack-with-bow",
  Action = "attack",
  Key = "a", Hint = "~!ATTACK",
  ForUnit = {"unit-darkness-bowman", "unit-ozug", "unit-darkness-catapult", "unit-tower-guard", "unit-bowman-hero"} } )
DefineButton( { Pos = 4, Level = 0, Icon = "icon-stand",
  Action = "stand-ground",
  Key = "t", Hint = "S~!TAND ON GROUND",
  ForUnit = {"unit-darkness-warrior", "unit-guard", "unit-tower-guard", "unit-bowman-hero", "unit-ozug-guard", "unit-repairman", "unit-ozug",  "unit-darkness-big-goblin",
  "unit-darkness-bowman", "unit-darkness-spearman", "unit-wolf", "unit-darkness-catapult", 
  "unit-big-goblin", "unit-well-trained-goblin",
  "darkness-group"} } )
DefineButton( { Pos = 4, Level = 0, Icon = "icon-repair",
  Action = "repair",
  Key = "r", Hint = "~!REPAIR",
  ForUnit = {"unit-darkness-worker", "unit-repairman"} } )
DefineButton( { Pos = 5, Level = 0, Icon = "icon-patrol",
  Action = "patrol",
  Key = "p", Hint = "~!PATROL",
  ForUnit = {"unit-darkness-warrior", "unit-guard", "unit-ozug-guard", "unit-repairman", "unit-ozug", 
  "unit-darkness-bowman", "unit-darkness-spearman", "unit-wolf", "unit-darkness-catapult", "unit-darkness-big-goblin",
  "darkness-group", "unit-big-goblin", "unit-well-trained-goblin", "unit-tower-guard", "unit-bowman-hero"} } )
DefineButton( { Pos = 5, Level = 0, Icon = "icon-harvest",
  Action = "harvest",
  Key = "h", Hint = "~!HARVEST",
  ForUnit = {"unit-darkness-worker"} } )
DefineButton( { Pos = 6, Level = 0, Icon = "icon-return-goods",
  Action = "return-goods",
  Key = "g", Hint = "RETURN WITH ~!GOODS",
  ForUnit = {"unit-darkness-worker"} } )
DefineButton( { Pos = 7, Level = 0, Icon = "icon-build-basic",
  Action = "button", Value = 1,
  Key = "b", Hint = "~!BUILD BASIC BUILDING",
  ForUnit = {"unit-darkness-worker"} } )

--BUILD
--------
DefineButton( { Pos = 1, Level = 1, Icon = "icon-build-basic",
  Action = "button", Value = 2,
  Key = "1", Hint = "BUILD LEVEL ~!1 BUILDING",
  ForUnit = {"unit-darkness-worker"} } )
DefineButton( { Pos = 2, Level = 1, Icon = "icon-build-basic",
  Action = "button", Value = 3,
  Key = "2", Hint = "BUILD LEVEL ~!2 BUILDING",
  ForUnit = {"unit-darkness-worker"} } )
DefineButton( { Pos = 9, Level = 1, Icon = "icon-cancel",
  Action = "button", Value = 0,
  Key = "c", Hint = "~!CANCEL",
  ForUnit = {"unit-darkness-worker"} } )

--Level 1
DefineButton( { Pos = 1, Level = 2, Icon = "icon-darkness-camp",
  Action = "build", Value = "unit-darkness-camp",
  Key = "c", Hint = "BUILD ~!CAMP",
  ForUnit = {"unit-darkness-worker"} } )
DefineButton( { Pos = 2, Level = 2, Icon = "icon-darkness-farm",
  Action = "build", Value = "unit-darkness-farm",
  Key = "f", Hint = "BUILD ~!FARM",
  ForUnit = {"unit-darkness-worker"} } )
DefineButton( { Pos = 3, Level = 2, Icon = "icon-darkness-garrison",
  Action = "build", Value = "unit-darkness-garrison",
  Key = "g", Hint = "BUILD ~!GARRISON",
  ForUnit = {"unit-darkness-worker"} } )
DefineButton( { Pos = 4, Level = 2, Icon = "icon-darkness-blacksmith",
  Action = "build", Value = "unit-darkness-blacksmith",
  Key = "b", Hint = "BUILD ~!BLACKSMITH",
  ForUnit = {"unit-darkness-worker"} } )
DefineButton( { Pos = 9, Level = 2, Icon = "icon-cancel",
  Action = "button", Value = 0,
  Key = "c", Hint = "~!CANCEL",
  ForUnit = {"unit-darkness-worker"} })

--Level 2
DefineButton( { Pos = 1, Level = 3, Icon = "icon-darkness-lumber-storage",
  Action = "build", Value = "unit-darkness-lumber-storage",
  Key = "l", Hint = "BUILD ~!LUMBER STORAGE",
  ForUnit = {"unit-darkness-worker"} } )
DefineButton( { Pos = 9, Level = 3, Icon = "icon-cancel",
  Action = "button", Value = 0,
  Key = "c", Hint = "~!CANCEL",
  ForUnit = {"unit-darkness-worker"} })

--TRAIN
--------
DefineButton( { Pos = 1, Level = 0, Icon = "icon-darkness-worker",
  Action = "train-unit", Value = "unit-darkness-worker",
  Key = "w", Hint = "TRAIN ~!WORKER",
  ForUnit = {"unit-darkness-camp"} } )
DefineButton( { Pos = 1, Level = 0, Icon = "icon-darkness-warrior",
  Action = "train-unit", Value = "unit-darkness-warrior",
  Key = "w", Hint = "TRAIN ~!WARRIOR",
  ForUnit = {"unit-darkness-garrison"} } )
DefineButton( { Pos = 2, Level = 0, Icon = "icon-darkness-bowman",
  Action = "train-unit", Value = "unit-darkness-bowman",
  Key = "b", Hint = "TRAIN ~!BOWMAN",
  ForUnit = {"unit-darkness-garrison"} } )
DefineButton( { Pos = 3, Level = 0, Icon = "icon-darkness-spearman",
  Action = "train-unit", Value = "unit-darkness-spearman",
  Key = "s", Hint = "TRAIN ~!SPEARMAN",
  ForUnit = {"unit-darkness-garrison"} } )
  DefineButton( { Pos = 4, Level = 0, Icon = "icon-darkness-warrior",
  Action = "train-unit", Value = "unit-darkness-big-goblin",
  Key = "b", Hint = "TRAIN ~!BIG GOBLIN",
  ForUnit = {"unit-darkness-garrison"} } )
DefineButton( { Pos = 1, Level = 0, Icon = "icon-wolf",
  Action = "train-unit", Value = "unit-wolf",
  Key = "w", Hint = "TRAIN ~!WOLF",
  ForUnit = {"unit-darkness-farm"} } )


--SET ACTIONS WHEN UNIT IS READY
---------------------------------
DefineButton( { Pos = 8, Level = 0, Icon = "icon-move",
  Action = "button", Value = 1,
  Key = "a", Hint = "SET ~!ACTIONS",
  ForUnit = {"unit-darkness-camp", "unit-darkness-garrison"} } )
DefineButton( { Pos = 1, Level = 1, Icon = "icon-move",
  Action = "move",
  Key = "m", Hint = "SET ~!MOVE",
  ForUnit = {"unit-darkness-camp", "unit-darkness-garrison"} } )
DefineButton( { Pos = 2, Level = 1, Icon = "icon-stop",
  Action = "stop",
  Key = "s", Hint = "SET ~!STOP",
  ForUnit = {"unit-darkness-camp", "unit-darkness-garrison"} } )
DefineButton( { Pos = 3, Level = 1, Icon = "icon-harvest",
  Action = "harvest",
  Key = "m", Hint = "SET ~!MINE/HARVEST",
  ForUnit = {"unit-darkness-camp"} } )
DefineButton( { Pos = 9, Level = 1, Icon = "icon-cancel",
  Action = "button", Value = 0,
  Key = "c", Hint = "~!CANCEL",
  ForUnit = {"unit-darkness-camp", "unit-darkness-garrison"} } )

--RESEARCH
-----------
DefineButton( { Pos = 2, Level = 0, Icon = "icon-darkness-level2",
  Action = "research", Value = "upgrade-darkness-level2",
  Allowed = "check-single-research",
  Key = "2", Hint = "RESEARCH LEVEL ~!2",
  ForUnit = {"unit-darkness-camp"} } )

DefineButton( { Pos = 1, Level = 0, Icon = "icon-darkness-better-swords",
  Action = "research", Value = "upgrade-darkness-swords",
  Allowed = "check-single-research",
  Key = "s", Hint = "RESEARCH ~!SWORDS",
  ForUnit = {"unit-darkness-blacksmith"} } )
DefineButton( { Pos = 2, Level = 0, Icon = "icon-darkness-bows",
  Action = "research", Value = "upgrade-darkness-bows",
  Allowed = "check-single-research",
  Key = "b", Hint = "RESEARCH ~!BOWS",
  ForUnit = {"unit-darkness-blacksmith"} } )  
    
DefineButton( { Pos = 1, Level = 0, Icon = "icon-darkness-better-swords",
  Action = "research", Value = "upgrade-darkness-better-swords",
  Allowed = "check-single-research",
  Key = "s", Hint = "RESEARCH BETTER ~!SWORDS",
  ForUnit = {"unit-darkness-blacksmith"} } )
DefineButton( { Pos = 2, Level = 0, Icon = "icon-darkness-better-shields",
  Action = "research", Value = "upgrade-darkness-better-shields",
  Allowed = "check-single-research",
  Key = "h", Hint = "RESEARCH BETTER S~!HIELDS",
  ForUnit = {"unit-darkness-blacksmith"} } )
DefineButton( { Pos = 3, Level = 0, Icon = "icon-darkness-better-helmets",
  Action = "research", Value = "upgrade-darkness-better-helmets",
  Allowed = "check-single-research",
  Key = "e", Hint = "RESEARCH BETTER H~!ELMETS",
  ForUnit = {"unit-darkness-blacksmith"} } )
DefineButton( { Pos = 4, Level = 0, Icon = "icon-darkness-spears",
  Action = "research", Value = "upgrade-darkness-spears",
  Allowed = "check-single-research",
  Key = "p", Hint = "RESEARCH S~!PEARS",
  ForUnit = {"unit-darkness-blacksmith"} } )

DefineButton( { Pos = 2,  Level = 0, Icon = "icon-darkness-level3",
  Action = "research", Value = "upgrade-darkness-level3",
  Allowed = "check-single-research",
  Key = "3", Hint = "RESEARCH LEVEL ~!3",
  ForUnit = {"unit-darkness-camp"} } )
