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

--      buttons.lua - Dwarves 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

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

------------------------------------------------------------------------------
--	Define", "unit-button.
--
--	DefineButton( { Pos = n, Level = n 'icon ident Action = name ['value value]
--		['allowed check ['values]] Key = key, Hint = hint 'for-unit", "units)
--

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

DefineButton( { Pos = 1, Level = 0, Icon = "icon-move",
  Action = "move",
  Key = "m", Hint = "~!MOVE",
  ForUnit = {"unit-dwarves-warrior", "unit-dwarves-worker", "unit-dwarves-scout", "unit-dwarves-bowman",
  "unit-dwarves-swordman", "unit-dwarves-advanced-worker", "unit-dwarves-advanced-worker2",
  "unit-dwarves-advanced-warrior", "unit-dwarves-scout-hero",
  "unit-dwarves-boat", "unit-dwarves-advanced-bowman", "unit-dwarves-crossbowman", 
  "unit-dwarves-ballista",
  "unit-dwarves-warrior-hero", "unit-dwarves-spearman", "unit-dwarves-bowman-hero", "unit-dwarves-lord", 
  "unit-kendago", "unit-hunter-captain", "unit-hunter",
  "unit-dwarves-healer", "unit-dwarves-crossbowman-hero", "unit-dwarves-spearman-hero",
  "unit-dwarves-healer-hero", "unit-dwarves-transporter", "unit-hrimblid", "unit-dwarves-leader", 
  "unit-dwarf", "dwarves-group"} } )
DefineButton( { Pos = 2, Level = 0, Icon = "icon-stop",
  Action = "stop",
  Key = "s", Hint = "~!STOP",
  ForUnit = {"unit-dwarves-warrior", "unit-dwarves-worker", "unit-dwarves-scout", "unit-dwarves-bowman",
  "unit-dwarves-swordman", "unit-dwarves-advanced-worker", "unit-dwarves-advanced-worker2",
  "unit-dwarves-advanced-warrior", "unit-dwarves-scout-hero",
  "unit-dwarves-boat", "unit-dwarves-advanced-bowman", "unit-dwarves-crossbowman", 
  "unit-dwarves-ballista", "unit-kendago", "unit-dwarves-warrior-hero", "unit-dwarves-spearman", 
  "unit-dwarves-bowman-hero", "unit-dwarves-lord",
  "unit-dwarves-healer", "unit-dwarves-crossbowman-hero", "unit-dwarves-spearman-hero",
  "unit-dwarves-healer-hero", "unit-dwarves-transporter", "unit-hrimblid", "unit-dwarves-leader", 
  "unit-dwarf", "unit-hunter-captain", "unit-hunter",
  "dwarves-group"} } )
DefineButton( { Pos = 3, Level = 0, Icon = "icon-attack",
  Action = "attack",
  Key = "a", Hint = "~!ATTACK",
  ForUnit = {"unit-dwarves-warrior", "unit-dwarves-worker", "unit-dwarves-scout",
  "unit-dwarves-swordman", "unit-dwarves-advanced-worker", "unit-dwarves-advanced-worker2",
  "unit-dwarves-advanced-warrior", "unit-dwarves-scout-hero", "unit-kendago",
  "unit-fortress",  "unit-dwarves-warrior-hero", "unit-dwarves-spearman", "unit-dwarves-lord",
  "unit-dwarves-healer", "unit-dwarves-spearman-hero", "unit-dwarves-healer-hero", "unit-hrimblid", 
  "unit-dwarves-leader", "unit-dwarf", "dwarves-group"} } )
DefineButton( { Pos = 3, Level = 0, Icon = "icon-attack-with-bow",
  Action = "attack",
  Key = "a", Hint = "~!ATTACK",
  ForUnit = {"unit-dwarves-bowman", "unit-dwarves-advanced-bowman", "unit-dwarves-crossbowman",
  "unit-dwarves-ballista", "unit-dwarves-bowman-hero", "unit-dwarves-crossbowman-hero", 
  "unit-hunter-captain", "unit-hunter"} } )

DefineButton( { Pos = 4, Level = 0, Icon = "icon-stand",
  Action = "stand-ground",
  Key = "t", Hint = "S~!TAND ON GROUND",
  ForUnit = {"unit-dwarves-warrior", "unit-dwarves-scout", "unit-dwarves-bowman", 
  "unit-dwarves-ballista", "unit-kendago", "unit-dwarves-swordman",  "unit-dwarves-advanced-warrior", 
  "unit-dwarves-advanced-bowman",
  "unit-dwarves-warrior-hero", "unit-dwarves-bowman-hero", "unit-dwarves-scout-hero",
  "unit-dwarves-crossbowman", "unit-dwarves-spearman", "unit-dwarves-lord", "unit-dwarves-healer",
  "unit-hrimblid", "unit-dwarves-leader", "unit-dwarf",
  "unit-dwarves-crossbowman-hero",  "unit-dwarves-spearman-hero", "unit-dwarves-healer-hero", "unit-hunter-captain", "unit-hunter",
  "dwarves-group",} } )
DefineButton( { Pos = 4, Level = 0, Icon = "icon-repair",
  Action = "repair",
  Key = "r", Hint = "~!REPAIR",
  ForUnit = {"unit-dwarves-worker", "unit-dwarves-advanced-worker", "unit-dwarves-advanced-worker2"} } )
DefineButton( { Pos = 5, Level = 0, Icon = "icon-patrol",
  Action = "patrol",
  Key = "p", Hint = "~!PATROL",
  ForUnit = {"unit-dwarves-warrior", "unit-dwarves-scout", "unit-dwarves-bowman",
  "unit-dwarves-swordman", "unit-dwarves-advanced-warrior", "unit-dwarves-advanced-bowman",
  "unit-dwarves-crossbowman", "unit-dwarves-ballista", "unit-dwarves-warrior-hero", 
  "unit-dwarves-spearman", "unit-kendago", "unit-dwarves-bowman-hero", "unit-dwarves-lord", 
  "unit-dwarves-healer", "unit-dwarves-scout-hero", "unit-hunter-captain", "unit-hunter",
  "unit-dwarves-crossbowman-hero",  "unit-dwarves-spearman-hero", "unit-dwarves-healer-hero",
  "unit-hrimblid", "unit-dwarves-leader", "unit-dwarf", "dwarves-group"} } )
DefineButton( { Pos = 5, Level = 0, Icon = "icon-harvest",
  Action = "harvest",
  Key = "h", Hint = "~!HARVEST",
  ForUnit = {"unit-dwarves-worker", "unit-dwarves-advanced-worker", "unit-dwarves-advanced-worker2"} } )
DefineButton( { Pos = 6, Level = 0, Icon = "icon-return-goods",
  Action = "return-goods",
  Key = "g", Hint = "RETURN WITH ~!GOODS",
  ForUnit = {"unit-dwarves-worker", "unit-dwarves-advanced-worker", "unit-dwarves-advanced-worker2"} } )
DefineButton( { Pos = 9, Level = 0, Icon = "icon-unload",
  Action = "unload",
  Key = "u", Hint = "~!UNLOAD",
  ForUnit = {"unit-dwarves-cottage", "unit-dwarves-farm", "unit-dwarves-stone-wall", "unit-dwarves-boat",
  "unit-dwarves-bunker", "unit-dwarves-transporter"} } )
DefineButton( { Pos = 7, Level = 0, Icon = "icon-build-basic",
  Action = "button", Value = 1,
  Key = "b", Hint = "~!BUILD BASIC BUILDING",
  ForUnit = {"unit-dwarves-worker", "unit-dwarves-advanced-worker", "unit-dwarves-advanced-worker2"} } )
DefineButton( { Pos = 6, Level = 0, Icon = "icon-dwarves-healing",
  Action = "cast-spell", Value = "spell-healing",
  Allowed = "check-upgrade", AllowArg = {"upgrade-dwarves-healing"},
  Key = "h", Hint = "~!HEALING",
  ForUnit = {"unit-dwarves-healer"} } )
DefineButton( { Pos = 6, Level = 0, Icon = "icon-dwarves-healing",
  Action = "cast-spell", Value = "spell-healing2",
  Allowed = "check-upgrade", AllowArg = {"upgrade-dwarves-healing2"},
  Key = "h", Hint = "~!HEALING",
  ForUnit = {"unit-dwarves-healer"} } )
DefineButton( { Pos = 7, Level = 0, Icon = "icon-dwarves-fury",
  Action = "cast-spell", Value = "spell-fury",
  Allowed = "check-upgrade", AllowArg = {"upgrade-dwarves-fury"},
  Key = "f", Hint = "~!FURY",
  ForUnit = {"unit-dwarves-healer"} } )
DefineButton( { Pos = 6, Level = 0, Icon = "icon-dwarves-healing",
  Action = "cast-spell", Value = "spell-healing3",
  Allowed = "check-upgrade", AllowArg = {"upgrade-dwarves-healing3"},
  Key = "h", Hint = "~!HEALING",
  ForUnit = {"unit-dwarves-healer-hero"} } )
DefineButton( { Pos = 7, Level = 0, Icon = "icon-dwarves-fury",
  Action = "cast-spell", Value = "spell-fury2",
  Allowed = "check-upgrade", AllowArg = {"upgrade-dwarves-fury2"},
  Key = "f", Hint = "~!FURY",
  ForUnit = {"unit-dwarves-healer-hero"} } )
DefineButton( { Pos = 8, Level = 0, Icon = "icon-dwarves-hard-strike",
  Action = "cast-spell", Value = "spell-hard-strike",
  Allowed = "check-upgrade", AllowArg = {"upgrade-dwarves-hard-strike"},
  Key = "h", Hint = "~!HARD STRIKE",
  ForUnit = {"unit-dwarves-advanced-worker2"} } )

  
  
--BUILD
--------
DefineButton( { Pos = 1, Level = 1, Icon = "icon-build-basic",
  Action = "button", Value = 2,
  Key = "1", Hint = "BUILD LEVEL ~!1 BUILDING",
  ForUnit = {"unit-dwarves-worker", "unit-dwarves-advanced-worker", "unit-dwarves-advanced-worker2"} } )
DefineButton( { Pos = 2, Level = 1, Icon = "icon-build-basic",
  Action = "button", Value = 3,
  Key = "2", Hint = "BUILD LEVEL ~!2 BUILDING",
  ForUnit = {"unit-dwarves-advanced-worker", "unit-dwarves-advanced-worker2"} } )
DefineButton( { Pos = 3, Level = 1, Icon = "icon-build-basic",
  Action = "button", Value = 4,
  Key = "3", Hint = "BUILD LEVEL ~!3 BUILDING",
  ForUnit = {"unit-dwarves-advanced-worker", "unit-dwarves-advanced-worker2"} } )
DefineButton( { Pos = 4, Level = 1, Icon = "icon-build-basic",
  Action = "button", Value = 5,
  Key = "4", Hint = "BUILD LEVEL ~!4 BUILDING",
  ForUnit = {"unit-dwarves-advanced-worker2"} } )
DefineButton( { Pos = 9, Level = 1, Icon = "icon-cancel",
  Action = "button", Value = 0,
  Key = "c", Hint = "~!CANCEL",
  ForUnit = {"unit-dwarves-worker", "unit-dwarves-advanced-worker", "unit-dwarves-advanced-worker2"} } )
  
--Level 1
DefineButton( { Pos = 1, Level = 2, Icon = "icon-dwarves-town-center",
  Action = "build", Value = "unit-dwarves-town-center",
  Key = "t", Hint = "BUILD ~!TOWN CENTER",
  ForUnit = {"unit-dwarves-worker", "unit-dwarves-advanced-worker", "unit-dwarves-advanced-worker2"} } )
DefineButton( { Pos = 2, Level = 2, Icon = "icon-dwarves-guard-tower",
  Action = "build", Value = "unit-dwarves-guard-tower",
  Key = "g", Hint = "BUILD ~!GUARD TOWER",
  ForUnit = {"unit-dwarves-worker", "unit-dwarves-advanced-worker", "unit-dwarves-advanced-worker2"} } )
DefineButton( { Pos = 3, Level = 2, Icon = "icon-dwarves-cottage",
  Action = "build", Value = "unit-dwarves-cottage",
  Key = "c", Hint = "BUILD ~!COTTAGE",
  ForUnit = {"unit-dwarves-worker", "unit-dwarves-advanced-worker", "unit-dwarves-advanced-worker2"} } )
DefineButton( { Pos = 4, Level = 2, Icon = "icon-dwarves-blacksmith",
  Action = "build", Value = "unit-dwarves-blacksmith",
  Key = "b", Hint = "BUILD ~!BLACKSMITH",
  ForUnit = {"unit-dwarves-worker", "unit-dwarves-advanced-worker", "unit-dwarves-advanced-worker2"} } )
DefineButton( { Pos = 5, Level = 2, Icon = "icon-dwarves-lumber-mill",
  Action = "build", Value = "unit-dwarves-lumber-mill",
  Key = "l", Hint = "BUILD ~!LUMBER MILL",
  ForUnit = {"unit-dwarves-worker", "unit-dwarves-advanced-worker", "unit-dwarves-advanced-worker2"} } )
DefineButton( { Pos = 6, Level = 2, Icon = "icon-dwarves-market",
  Action = "build", Value = "unit-dwarves-market",
  Key = "m", Hint = "BUILD ~!MARKET",
  ForUnit = {"unit-dwarves-worker", "unit-dwarves-advanced-worker", "unit-dwarves-advanced-worker2"} } )
DefineButton( { Pos = 9, Level = 2, Icon = "icon-cancel",
  Action = "button", Value = 1,
  Key = "c", Hint = "~!CANCEL",
  ForUnit = {"unit-dwarves-worker", "unit-dwarves-advanced-worker", "unit-dwarves-advanced-worker2"} } )

--Level2  
DefineButton( { Pos = 1, Level = 3, Icon = "icon-dwarves-farm",
  Action = "build", Value = "unit-dwarves-farm",
  Key = "f", Hint = "BUILD ~!FARM",
  ForUnit = {"unit-dwarves-advanced-worker", "unit-dwarves-advanced-worker2"} } )
DefineButton( { Pos = 1, Level = 3, Icon = "icon-dwarves-farm",
  Action = "build", Value = "unit-dwarves-farm2",
  Key = "f", Hint = "BUILD ~!FARM",
  ForUnit = {"unit-dwarves-advanced-worker", "unit-dwarves-advanced-worker2"} } )
DefineButton( { Pos = 2, Level = 3, Icon = "icon-dwarves-barracks",
  Action = "build", Value = "unit-dwarves-barracks",
  Key = "b", Hint = "BUILD ~!BARRACKS",
  ForUnit = {"unit-dwarves-advanced-worker", "unit-dwarves-advanced-worker2"} } )
DefineButton( { Pos = 3, Level = 3, Icon = "icon-dwarves-wall",
  Action = "build", Value = "unit-dwarves-stone-wall",
  Key = "w", Hint = "BUILD ~!WALL",
  ForUnit = {"unit-dwarves-advanced-worker", "unit-dwarves-advanced-worker2"} } )
DefineButton( { Pos = 9, Level = 3, Icon = "icon-cancel",
  Action = "button", Value = 1,
  Key = "c", Hint = "~!CANCEL",
  ForUnit = {"unit-dwarves-advanced-worker", "unit-dwarves-advanced-worker2"} } )
   
--Level3
DefineButton( { Pos = 1, Level = 4, Icon = "icon-dwarves-mining-post",
  Action = "build", Value = "unit-dwarves-mining-post",
  Key = "m", Hint = "BUILD ~!MINING POST",
  ForUnit = {"unit-dwarves-advanced-worker", "unit-dwarves-advanced-worker2"} } )
DefineButton( { Pos = 2, Level = 4, Icon = "icon-dwarves-shipyard",
  Action = "build", Value = "unit-dwarves-shipyard",
  Key = "s", Hint = "BUILD ~!SHIPYARD",
  ForUnit = {"unit-dwarves-advanced-worker", "unit-dwarves-advanced-worker2"} } )
DefineButton( { Pos = 9, Level = 4, Icon = "icon-cancel",
  Action = "button", Value = 1,
  Key = "c", Hint = "~!CANCEL",
  ForUnit = {"unit-dwarves-advanced-worker", "unit-dwarves-advanced-worker2"} } )

--Level 4
DefineButton( { Pos = 1, Level = 5, Icon = "icon-dwarves-temple",
  Action = "build", Value = "unit-dwarves-temple",
  Key = "t", Hint = "BUILD ~!TEMPLE",
  ForUnit = {"unit-dwarves-advanced-worker2"} } )
DefineButton( { Pos = 2, Level = 5, Icon = "icon-dwarves-blacksmith",
  Action = "build", Value = "unit-dwarves-blacksmith2",
  Key = "b", Hint = "BUILD ~!BLACKSMITH",
  ForUnit = {"unit-dwarves-advanced-worker2"} } )
DefineButton( { Pos = 3, Level = 5, Icon = "icon-dwarves-heros-guild",
  Action = "build", Value = "unit-dwarves-heros-guild",
  Key = "h", Hint = "BUILD ~!HERO'S GUILD",
  ForUnit = {"unit-dwarves-advanced-worker2"} } )
DefineButton( { Pos = 9, Level = 5, Icon = "icon-cancel",
  Action = "button", Value = 1,
  Key = "c", Hint = "~!CANCEL",
  ForUnit = {"unit-dwarves-advanced-worker2"} } )
  
--TRAIN
--------
DefineButton( { Pos = 1, Level = 0, Icon = "icon-raven",
  Action = "train-unit", Value = "unit-raven",
  Key = "r", Hint = "TRAIN ~!RAVEN",
  ForUnit = {"unit-dwarves-cottage", "unit-dwarves-farm", "unit-dwarves-farm2"} } )
DefineButton( { Pos = 1, Level = 0, Icon = "icon-dwarves-warrior",
  Action = "train-unit", Value = "unit-dwarves-warrior",
  Key = "w", Hint = "TRAIN ~!WARRIOR",
  ForUnit = {"unit-dwarves-guard-tower", "unit-dwarves-barracks"} } )
DefineButton( { Pos = 1, Level = 0, Icon = "icon-dwarves-swordman",
  Action = "train-unit", Value = "unit-dwarves-swordman",
  Key = "w", Hint = "TRAIN S~!WORDMAN",
  ForUnit = {"unit-dwarves-guard-tower", "unit-dwarves-barracks"} } )
DefineButton( { Pos = 2, Level = 0, Icon = "icon-dwarves-scout",
  Action = "train-unit", Value = "unit-dwarves-scout",
  Key = "s", Hint = "TRAIN ~!SCOUT",
  ForUnit = {"unit-dwarves-guard-tower", "unit-dwarves-barracks"} } )
DefineButton( { Pos = 3, Level = 0, Icon = "icon-dwarves-bowman",
  Action = "train-unit", Value = "unit-dwarves-bowman",
  Key = "b", Hint = "TRAIN ~!BOWMAN",
  ForUnit = {"unit-dwarves-guard-tower", "unit-dwarves-barracks"} } )
DefineButton( { Pos = 3, Level = 0, Icon = "icon-dwarves-advanced-bowman",
  Action = "train-unit", Value = "unit-dwarves-advanced-bowman",
  Key = "b", Hint = "TRAIN ADVANCED ~!BOWMAN",
  ForUnit = {"unit-dwarves-guard-tower", "unit-dwarves-barracks"} } )
DefineButton( { Pos = 4, Level = 0, Icon = "icon-dwarves-advanced-warrior",
  Action = "train-unit", Value = "unit-dwarves-advanced-warrior",
  Key = "a", Hint = "TRAIN ~!ADVANCED WARRIOR",
  ForUnit = {"unit-dwarves-barracks"} } )
DefineButton( { Pos = 5, Level = 0, Icon = "icon-dwarves-crossbowman",
  Action = "train-unit", Value = "unit-dwarves-crossbowman",
  Key = "r", Hint = "TRAIN C~!ROSSBOWMAN",
  ForUnit = {"unit-dwarves-barracks"} } )
DefineButton( { Pos = 6, Level = 0, Icon = "icon-dwarves-ballista",
  Action = "train-unit", Value = "unit-dwarves-ballista",
  Key = "l", Hint = "BUILD BA~!LLISTA",
  ForUnit = {"unit-dwarves-barracks"} } )
DefineButton( { Pos = 7, Level = 0, Icon = "icon-dwarves-spearman",
  Action = "train-unit", Value = "unit-dwarves-spearman",
  Key = "p", Hint = "TRAIN S~!PEARMAN",
  ForUnit = {"unit-dwarves-barracks"} } )
DefineButton( { Pos = 1, Level = 0, Icon = "icon-dwarves-worker",
  Action = "train-unit", Value = "unit-dwarves-worker",
  Key = "w", Hint = "TRAIN ~!WORKER",
  ForUnit = {"unit-dwarves-town-center", "unit-dwarves-town-hall", "unit-dwarves-city-hall"} } )
DefineButton( { Pos = 1, Level = 0, Icon = "icon-dwarves-advanced-worker",
  Action = "train-unit", Value = "unit-dwarves-advanced-worker",
  Key = "a", Hint = "TRAIN ~!ADVANCED WORKER",
  ForUnit = {"unit-dwarves-town-center", "unit-dwarves-town-hall", "unit-dwarves-city-hall",
             "unit-dwarves-mining-post", "unit-dwarves-mining-post2"} } )
DefineButton( { Pos = 1, Level = 0, Icon = "icon-dwarves-advanced-worker2",
  Action = "train-unit", Value = "unit-dwarves-advanced-worker2",
  Key = "a", Hint = "TRAIN ~!ADVANCED WORKER",
  ForUnit = {"unit-dwarves-town-center", "unit-dwarves-town-hall", "unit-dwarves-city-hall",
             "unit-dwarves-mining-post", "unit-dwarves-mining-post2"} } )
DefineButton( { Pos = 1, Level = 0, Icon = "icon-dwarves-boat",
  Action = "train-unit", Value = "unit-dwarves-boat",
  Key = "b", Hint = "BUILD ~!BOAT",
  ForUnit = {"unit-dwarves-shipyard"} } )
DefineButton( { Pos = 2, Level = 0, Icon = "icon-dwarves-transporter",
  Action = "train-unit", Value = "unit-dwarves-transporter",
  Key = "t", Hint = "BUILD ~!TRANSPORTER",
  ForUnit = {"unit-dwarves-shipyard"} } )
DefineButton( { Pos = 1, Level = 0, Icon = "icon-dwarves-healer",
  Action = "train-unit", Value = "unit-dwarves-healer",
  Key = "e", Hint = "TRAIN H~!EALER",
  ForUnit = {"unit-dwarves-temple"} } )
DefineButton( { Pos = 1, Level = 0, Icon = "icon-dwarves-warrior-hero",
  Action = "train-unit", Value = "unit-dwarves-warrior-hero",
  Key = "w", Hint = "TRAIN ~!WARRIOR",
  ForUnit = {"unit-dwarves-heros-guild"} } )
DefineButton( { Pos = 2, Level = 0, Icon = "icon-dwarves-lord",
  Action = "train-unit", Value = "unit-dwarves-lord",
  Key = "d", Hint = "TRAIN ~!DWARF LORD",
  ForUnit = {"unit-dwarves-heros-guild"} } )
DefineButton( { Pos = 3, Level = 0, Icon = "icon-dwarves-bowman-hero",
  Action = "train-unit", Value = "unit-dwarves-bowman-hero",
  Key = "b", Hint = "TRAIN ~!BOWMAN HERO",
  ForUnit = {"unit-dwarves-heros-guild"} } )
DefineButton( { Pos = 4, Level = 0, Icon = "icon-dwarves-crossbowman-hero",
  Action = "train-unit", Value = "unit-dwarves-crossbowman-hero",
  Key = "c", Hint = "TRAIN ~!CROSSBOWMAN HERO",
  ForUnit = {"unit-dwarves-heros-guild"} } )
DefineButton( { Pos = 5, Level = 0, Icon = "icon-dwarves-spearman-hero",
  Action = "train-unit", Value = "unit-dwarves-spearman-hero",
  Key = "s", Hint = "TRAIN ~!SPEARMAN HERO",
  ForUnit = {"unit-dwarves-heros-guild"} } )
DefineButton( { Pos = 6, Level = 0, Icon = "icon-dwarves-scout-hero",
  Action = "train-unit", Value = "unit-dwarves-scout-hero",
  Key = "c", Hint = "TRAIN S~!COUT HERO",
  ForUnit = {"unit-dwarves-heros-guild"} } )
DefineButton( { Pos = 7, Level = 0, Icon = "icon-dwarves-healer-hero",
  Action = "train-unit", Value = "unit-dwarves-healer-hero",
  Key = "h", Hint = "TRAIN ~!HEALER-HERO",
  ForUnit = {"unit-dwarves-heros-guild"} } )
  

  
--RESEARCH
-----------
DefineButton( { Pos = 1, Level = 0, Icon = "icon-dwarves-daggers",
  Action = "research", Value = "upgrade-dwarves-daggers",
  Allowed = "check-single-research",
  Key = "d", Hint = "RESEARCH LEVEL ~!DAGGERS",
  ForUnit = {"unit-dwarves-blacksmith"} } )
DefineButton( { Pos = 2, Level = 0, Icon = "icon-dwarves-axes",
  Action = "research", Value = "upgrade-dwarves-axes",
  Allowed = "check-single-research",
  Key = "a", Hint = "RESEARCH LEVEL ~!AXES",
  ForUnit = {"unit-dwarves-blacksmith"} } )
DefineButton( { Pos = 2, Level = 0, Icon = "icon-dwarves-level2",
  Action = "research", Value = "upgrade-dwarves-level2",
  Allowed = "check-single-research",
  Key = "2", Hint = "RESEARCH LEVEL ~!2",
  ForUnit = {"unit-dwarves-town-center"} } )
DefineButton( { Pos = 2, Level = 0, Icon = "icon-dwarves-level3",
  Action = "research", Value = "upgrade-dwarves-level3",
  Allowed = "check-single-research",
  Key = "3", Hint = "RESEARCH LEVEL ~!3",
  ForUnit = {"unit-dwarves-town-hall"} } )
DefineButton( { Pos = 2, Level = 0, Icon = "icon-dwarves-level4",
  Action = "research", Value = "upgrade-dwarves-level4",
  Allowed = "check-single-research",
  Key = "4", Hint = "RESEARCH LEVEL ~!4",
  ForUnit = {"unit-dwarves-city-hall"} } )
DefineButton( { Pos = 1, Level = 0, Icon = "icon-dwarves-bowman",
  Action = "research", Value = "upgrade-dwarves-bowman",
  Allowed = "check-single-research",
  Key = "b", Hint = "RESEARCH ~!BOWMAN",
  ForUnit = {"unit-dwarves-blacksmith"} } )
DefineButton( { Pos = 1, Level = 0, Icon = "icon-dwarves-better-bows",
  Action = "research", Value = "upgrade-dwarves-better-bows",
  Allowed = "check-single-research",
  Key = "b", Hint = "RESEARCH ~!BETTER BOWS",
  ForUnit = {"unit-dwarves-blacksmith"} } )
DefineButton( { Pos = 1, Level = 0, Icon = "icon-dwarves-better-bows2",
  Action = "research", Value = "upgrade-dwarves-better-bows2",
  Allowed = "check-single-research",
  Key = "b", Hint = "RESEARCH ~!BETTER BOWS",
  ForUnit = {"unit-dwarves-blacksmith2"} } )
DefineButton( { Pos = 1, Level = 0, Icon = "icon-dwarves-better-arrows",
  Action = "research", Value = "upgrade-dwarves-better-arrows",
  Allowed = "check-single-research",
  Key = "a", Hint = "RESEARCH BETTER ~!ARROWS",
  ForUnit = {"unit-dwarves-blacksmith2"} } )
DefineButton( { Pos = 1, Level = 0, Icon = "icon-dwarves-better-arrows2",
  Action = "research", Value = "upgrade-dwarves-better-arrows2",
  Allowed = "check-single-research",
  Key = "a", Hint = "RESEARCH BETTER ~!ARROWS",
  ForUnit = {"unit-dwarves-blacksmith2"} } )
DefineButton( { Pos = 4, Level = 0, Icon = "icon-dwarves-better-spears",
  Action = "research", Value = "upgrade-dwarves-better-spears",
  Allowed = "check-single-research",
  Key = "s", Hint = "RESEARCH BETTER ~!SPEARS",
  ForUnit = {"unit-dwarves-blacksmith2"} } )
DefineButton( { Pos = 1, Level = 0, Icon = "icon-dwarves-crossbow",
  Action = "research", Value = "upgrade-dwarves-crossbows",
  Allowed = "check-single-research",
  Key = "c", Hint = "RESEARCH ~!CROSSBOWS",
  ForUnit = {"unit-dwarves-blacksmith"} } )
DefineButton( { Pos = 2, Level = 0, Icon = "icon-dwarves-swordman",
  Action = "research", Value = "upgrade-dwarves-swordman",
  Allowed = "check-single-research",
  Key = "s", Hint = "RESEARCH ~!SWORDMAN",
  ForUnit = {"unit-dwarves-blacksmith"} } )
DefineButton( { Pos = 3, Level = 0, Icon = "icon-dwarves-steel",
  Action = "research", Value = "upgrade-dwarves-steel",
  Allowed = "check-single-research",
  Key = "t", Hint = "RESEARCH S~!TEEL",
  ForUnit = {"unit-dwarves-blacksmith"} } )
DefineButton( { Pos = 3, Level = 0, Icon = "icon-dwarves-axe1",
  Action = "research", Value = "upgrade-dwarves-axe1",
  Allowed = "check-single-research",
  Key = "x", Hint = "RESEARCH BETTER A~!XES",
  ForUnit = {"unit-dwarves-blacksmith"} } )
DefineButton( { Pos = 4, Level = 0, Icon = "icon-dwarves-armor1",
  Action = "research", Value = "upgrade-dwarves-armor1",
  Allowed = "check-single-research",
  Key = "a", Hint = "RESEARCH BETTER ~!ARMOR",
  ForUnit = {"unit-dwarves-blacksmith"} } )
DefineButton( { Pos = 4, Level = 0, Icon = "icon-dwarves-armor2",
  Action = "research", Value = "upgrade-dwarves-armor2",
  Allowed = "check-single-research",
  Key = "a", Hint = "RESEARCH BETTER ~!ARMOR",
  ForUnit = {"unit-dwarves-blacksmith"} } )
DefineButton( { Pos = 2, Level = 0, Icon = "icon-dwarves-advanced-worker",
  Action = "research", Value = "upgrade-dwarves-advanced-worker",
  Allowed = "check-single-research",
  Key = "a", Hint = "RESEARCH ~!ADVANCED WORKER",
  ForUnit = {"unit-dwarves-town-hall"} } )
DefineButton( { Pos = 2, Level = 0, Icon = "icon-dwarves-agriculture",
  Action = "research", Value = "upgrade-dwarves-agriculture",
  Allowed = "check-single-research",
  Key = "a", Hint = "RESEARCH ~!AGRICULTURE",
  ForUnit = {"unit-dwarves-cottage"} } )
DefineButton( { Pos = 3, Level = 0, Icon = "icon-dwarves-stone-working",
  Action = "research", Value = "upgrade-dwarves-stone-working",
  Allowed = "check-single-research",
  Key = "s", Hint = "RESEARCH ~!STONE WORKING",
  ForUnit = {"unit-dwarves-town-hall"} } )
DefineButton( { Pos = 1, Level = 0, Icon = "icon-dwarves-ships",
  Action = "research", Value = "upgrade-dwarves-ships",
  Allowed = "check-single-research",
  Key = "s", Hint = "RESEARCH ~!SHIP BUILDING",
  ForUnit = {"unit-dwarves-lumber-mill"} } )
DefineButton( { Pos = 1, Level = 0, Icon = "icon-dwarves-crossbow",
  Action = "research", Value = "upgrade-dwarves-crossbows",
  Allowed = "check-single-research",
  Key = "c", Hint = "RESEARCH ~!CROSSBOWS",
  ForUnit = {"unit-dwarves-blacksmith"} } )
DefineButton( { Pos = 2, Level = 0, Icon = "icon-dwarves-axe2",
  Action = "research", Value = "upgrade-dwarves-axe2",
  Allowed = "check-single-research",
  Key = "x", Hint = "RESEARCH BETTER A~!XES",
  ForUnit = {"unit-dwarves-blacksmith"} } )
DefineButton( { Pos = 2, Level = 0, Icon = "icon-dwarves-axe3",
  Action = "research", Value = "upgrade-dwarves-axe3",
  Allowed = "check-single-research",
  Key = "x", Hint = "RESEARCH BETTER A~!XES",
  ForUnit = {"unit-dwarves-blacksmith"} } )
DefineButton( { Pos = 3, Level = 0, Icon = "icon-dwarves-better-swords",
  Action = "research", Value = "upgrade-dwarves-better-swords",
  Allowed = "check-single-research",
  Key = "s", Hint = "RESEARCH BETTER ~!SWORDS",
  ForUnit = {"unit-dwarves-blacksmith"} } )
DefineButton( { Pos = 3, Level = 0, Icon = "icon-dwarves-better-swords2",
  Action = "research", Value = "upgrade-dwarves-better-swords2",
  Allowed = "check-single-research",
  Key = "s", Hint = "RESEARCH BETTER ~!SWORDS",
  ForUnit = {"unit-dwarves-blacksmith"} } )
DefineButton( { Pos = 4, Level = 0, Icon = "icon-dwarves-spears",
  Action = "research", Value = "upgrade-dwarves-spears",
  Allowed = "check-single-research",
  Key = "p", Hint = "RESEARCHS~!PEARS",
  ForUnit = {"unit-dwarves-blacksmith"} } )
DefineButton( { Pos = 2, Level = 0, Icon = "icon-dwarves-better-food",
  Action = "research", Value = "upgrade-dwarves-better-food",
  Allowed = "check-single-research",
  Key = "f", Hint = "RESEARCH BETTER ~!FOOD",
  ForUnit = {"unit-dwarves-farm"} } )
DefineButton( { Pos = 2, Level = 0, Icon = "icon-dwarves-better-shields",
  Action = "research", Value = "upgrade-dwarves-better-shields",
  Allowed = "check-single-research",
  Key = "s", Hint = "RESEARCH BETTER ~!SHIELDS",
  ForUnit = {"unit-dwarves-blacksmith2"} } )
DefineButton( { Pos = 3, Level = 0, Icon = "icon-dwarves-better-helmets",
  Action = "research", Value = "upgrade-dwarves-better-helmets",
  Allowed = "check-single-research",
  Key = "h", Hint = "RESEARCH BETTER ~!HELMETS",
  ForUnit = {"unit-dwarves-blacksmith2"} } )
DefineButton( { Pos = 5, Level = 0, Icon = "icon-dwarves-ballistas",
  Action = "research", Value = "upgrade-dwarves-ballistas",
  Allowed = "check-single-research",
  Key = "b", Hint = "RESEARCH BETTER ~!BALLISTAS",
  ForUnit = {"unit-dwarves-blacksmith2"} } )
DefineButton( { Pos = 2, Level = 0, Icon = "icon-dwarves-healing",
  Action = "research", Value = "upgrade-dwarves-healing",
  Allowed = "check-single-research",
  Key = "h", Hint = "RESEARCH ~!HEALING",
  ForUnit = {"unit-dwarves-temple"} } )
DefineButton( { Pos = 2, Level = 0, Icon = "icon-dwarves-healing",
  Action = "research", Value = "upgrade-dwarves-healing2",
  Allowed = "check-single-research",
  Key = "h", Hint = "RESEARCH ADVANCED ~!HEALING",
  ForUnit = {"unit-dwarves-temple"} } )
DefineButton( { Pos = 3, Level = 0, Icon = "icon-dwarves-fury",
  Action = "research", Value = "upgrade-dwarves-fury",
  Allowed = "check-single-research",
  Key = "f", Hint = "RESEARCH ~!FURY-SPELL",
  ForUnit = {"unit-dwarves-temple"} } )
DefineButton( { Pos = 2, Level = 0, Icon = "icon-dwarves-advanced-worker2",
  Action = "research", Value = "upgrade-dwarves-advanced-worker2",
  Allowed = "check-single-research",
  Key = "a", Hint = "RESEARCH ~!ADVANCED WORKERS",
  ForUnit = {"unit-dwarves-mining-post2"} } )
DefineButton( { Pos = 2, Level = 0, Icon = "icon-dwarves-transporters",
  Action = "research", Value = "upgrade-dwarves-transporters",
  Allowed = "check-single-research",
  Key = "t", Hint = "RESEARCH ~!TRANSPORTERS",
  ForUnit = {"unit-dwarves-shipyard"} } )
  
--UPGRADE
----------
DefineButton( { Pos = 2, Level = 0, Icon = "icon-dwarves-town-hall",
  Action = "upgrade-to", Value = "unit-dwarves-town-hall",
  Allowed = "check-upgrade-to",
  Key = "t", Hint = "UPGRADE TO ~!TOWN HALL",
  ForUnit = {"unit-dwarves-town-center"} } )
DefineButton( { Pos = 1, Level = 0, Icon = "icon-dwarves-bunker",
  Action = "upgrade-to", Value = "unit-dwarves-bunker",
  Allowed = "check-upgrade-to",
  Key = "b", Hint = "UPGRADE TO ~!BUNKER",
  ForUnit = {"unit-dwarves-stone-wall"} } )
DefineButton( { Pos = 4, Level = 0, Icon = "icon-dwarves-city-hall",
  Action = "upgrade-to", Value = "unit-dwarves-city-hall",
  Allowed = "check-upgrade-to",
  Key = "c", Hint = "UPGRADE TO ~!CITY HALL",
  ForUnit = {"unit-dwarves-town-hall"} } )
DefineButton( { Pos = 2, Level = 0, Icon = "icon-dwarves-mining-post",
  Action = "upgrade-to", Value = "unit-dwarves-mining-post2",
  Allowed = "check-upgrade-to",
  Key = "u", Hint = "~!UPGRADE MINING POST",
  ForUnit = {"unit-dwarves-mining-post"} } )

--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-dwarves-guard-tower", "unit-dwarves-barracks", "unit-dwarves-shipyard",
  "unit-dwarves-town-center", "unit-dwarves-town-hall", "unit-dwarves-city-hall", "unit-dwarves-mining-post",
  "unit-dwarves-mining-post2", "unit-dwarves-temple", "unit-dwarves-heros-guild"} } )
DefineButton( { Pos = 1, Level = 1, Icon = "icon-move",
  Action = "move",
  Key = "m", Hint = "SET ~!MOVE",
  ForUnit = {"unit-dwarves-guard-tower", "unit-dwarves-barracks", "unit-dwarves-shipyard", "unit-dwarves-town-center", "unit-dwarves-town-hall", "unit-dwarves-city-hall"} } )
DefineButton( { Pos = 2, Level = 1, Icon = "icon-stop",
  Action = "stop",
  Key = "s", Hint = "SET ~!STOP",
  ForUnit = {"unit-dwarves-guard-tower", "unit-dwarves-barracks", "unit-dwarves-shipyard", "unit-dwarves-town-center", "unit-dwarves-town-hall", "unit-dwarves-city-hall"} } )
DefineButton( { Pos = 3, Level = 1, Icon = "icon-harvest",
  Action = "harvest",
  Key = "m", Hint = "SET ~!MINE/HARVEST",
  ForUnit = {"unit-dwarves-town-center", "unit-dwarves-town-hall", "unit-dwarves-city-hall"} } )
DefineButton( { Pos = 9, Level = 1, Icon = "icon-cancel",
  Action = "button", Value = 0,
  Key = "c", Hint = "~!CANCEL",
  ForUnit = {"unit-dwarves-guard-tower", "unit-dwarves-barracks", "unit-dwarves-shipyard", "unit-dwarves-town-center", "unit-dwarves-town-hall", "uit-dwarves-city-hall"} } )
