From ee927d7c10ddf0d9ec4c85e7d3ac9f3730785dd5 Mon Sep 17 00:00:00 2001 From: Andrettin Date: Sat, 12 Aug 2017 22:05:55 +0200 Subject: [PATCH] Added next/previous buttons for the building menu --- scripts/buttons.lua | 49 ++++++++++++++++--- scripts/civilizations/dwarf/buttons.lua | 22 ++++----- scripts/civilizations/goblin/buttons.lua | 14 +++--- scripts/civilizations/teuton/buttons.lua | 14 +++--- .../buttons_faction_settlement_grant.lua | 12 ++--- scripts/icons.lua | 12 +++++ 6 files changed, 82 insertions(+), 41 deletions(-) diff --git a/scripts/buttons.lua b/scripts/buttons.lua index 2e23979f01..117fad3b4c 100644 --- a/scripts/buttons.lua +++ b/scripts/buttons.lua @@ -815,7 +815,7 @@ DefineButton( { Pos = 1, Level = 0, -- Buildings --------------------------------------------------- -DefineButton( { Pos = 11, Level = 1, Icon = "icon-copper-mine", +DefineButton( { Pos = 12, Level = 1, Icon = "icon-copper-mine", Action = "build", Value = "unit-copper-mine", Key = "c", Hint = _("Build ~!Copper Mine"), Popup = "popup-building", ForUnit = { @@ -827,7 +827,7 @@ DefineButton( { Pos = 11, Level = 1, Icon = "icon-copper-mine", } }) -DefineButton( { Pos = 12, Level = 1, Icon = "icon-silver-mine", +DefineButton( { Pos = 13, Level = 1, Icon = "icon-silver-mine", Action = "build", Value = "unit-silver-mine", Key = "v", Hint = _("Build Si~!lver Mine"), Popup = "popup-building", ForUnit = { @@ -839,7 +839,7 @@ DefineButton( { Pos = 12, Level = 1, Icon = "icon-silver-mine", } }) -DefineButton( { Pos = 13, Level = 1, Icon = "icon-gold-mine", +DefineButton( { Pos = 14, Level = 1, Icon = "icon-gold-mine", Action = "build", Value = "unit-gold-mine", Key = "g", Hint = _("Build ~!Gold Mine"), Popup = "popup-building", ForUnit = { @@ -851,7 +851,7 @@ DefineButton( { Pos = 13, Level = 1, Icon = "icon-gold-mine", } }) -DefineButton( { Pos = 13, Level = 5, -- placeholder level, the button shouldn't appear yet since we don't have enough space in the worker building submenu; but it needs to exist so that the game knows that workers can build this structure +DefineButton( { Pos = 13, Level = 5, -- placeholder level, the button shouldn't appear yet since we don't have enough space in the worker building submenu (and maybe should never be visible since it wouldn't make sense to appear for Earth maps and such); but it needs to exist so that the game knows that workers can build this structure Action = "build", Value = "unit-yale-hunting-lodge", Key = "y", Hint = "Build ~!Yale Hunting Lodge", Popup = "popup-building", ForUnit = { @@ -863,7 +863,7 @@ DefineButton( { Pos = 13, Level = 5, -- placeholder level, the button shouldn't } }) -DefineButton( { Pos = 14, Level = 1, Icon = "icon-road", +DefineButton( { Pos = 1, Level = 4, Icon = "icon-road", Action = "build", Value = "unit-road", Key = "o", Hint = "Build R~!oad", Popup = "popup-building", ForUnit = { @@ -875,7 +875,7 @@ DefineButton( { Pos = 14, Level = 1, Icon = "icon-road", } }) -DefineButton( { Pos = 15, Level = 1, Icon = "icon-railroad", +DefineButton( { Pos = 2, Level = 4, Icon = "icon-railroad", Action = "build", Value = "unit-railroad", Key = "r", Hint = "Build ~!Railroad", Popup = "popup-building", ForUnit = { @@ -886,10 +886,45 @@ DefineButton( { Pos = 15, Level = 1, Icon = "icon-railroad", "unit-goblin-worker" } }) +DefineButton( { Pos = 15, Level = 1, Icon = "icon-right-arrow", + Action = "button", Value = 4, + Key = "pagedown", Hint = "Next (~)", Popup = "popup-commands", + ForUnit = { + "unit-germanic-worker", "unit-teuton-worker", + "unit-dwarven-miner", "unit-dwarven-skilled-miner", "unit-dwarven-expert-miner", + "unit-brising-miner", "unit-brising-skilled-miner", "unit-brising-expert-miner", + "unit-gnomish-worker", "unit-deep-gnomish-worker", "unit-derro-worker", + "unit-goblin-worker" + } +}) + +DefineButton( { Pos = 15, Level = 4, Icon = "icon-left-arrow", + Action = "button", Value = 1, + Key = "pageup", Hint = "Previous (~)", Popup = "popup-commands", + ForUnit = { + "unit-germanic-worker", "unit-teuton-worker", + "unit-dwarven-miner", "unit-dwarven-skilled-miner", "unit-dwarven-expert-miner", + "unit-brising-miner", "unit-brising-skilled-miner", "unit-brising-expert-miner", + "unit-gnomish-worker", "unit-deep-gnomish-worker", "unit-derro-worker", + "unit-goblin-worker" + } +}) DefineButton( { Pos = 16, Level = 1, Icon = "icon-cancel", Action = "button", Value = 0, - Key = "escape", Hint = _("Cancel (~)"), Popup = "popup-commands", + Key = "escape", Hint = "Cancel (~)", Popup = "popup-commands", + ForUnit = { + "unit-germanic-worker", "unit-teuton-worker", + "unit-dwarven-miner", "unit-dwarven-skilled-miner", "unit-dwarven-expert-miner", + "unit-brising-miner", "unit-brising-skilled-miner", "unit-brising-expert-miner", + "unit-gnomish-worker", "unit-deep-gnomish-worker", "unit-derro-worker", + "unit-goblin-worker" + } +}) + +DefineButton( { Pos = 16, Level = 4, Icon = "icon-cancel", + Action = "button", Value = 0, + Key = "escape", Hint = "Cancel (~)", Popup = "popup-commands", ForUnit = { "unit-germanic-worker", "unit-teuton-worker", "unit-dwarven-miner", "unit-dwarven-skilled-miner", "unit-dwarven-expert-miner", diff --git a/scripts/civilizations/dwarf/buttons.lua b/scripts/civilizations/dwarf/buttons.lua index 028d118fa1..67e5c51cb9 100644 --- a/scripts/civilizations/dwarf/buttons.lua +++ b/scripts/civilizations/dwarf/buttons.lua @@ -161,18 +161,6 @@ DefineButton( { Pos = 7, Level = 1, Icon = "icon-dwarven-temple", } }) ---[[ -DefineButton( { Pos = 7, Level = 1, Icon = "icon-dwarven-academy", - Action = "build", Value = "unit-dwarven-academy", - Key = "a", Hint = "Build ~!Academy", Popup = "popup-building", - ForUnit = { - "unit-dwarven-miner", "unit-dwarven-skilled-miner", "unit-dwarven-expert-miner", - "unit-brising-miner", "unit-brising-skilled-miner", "unit-brising-expert-miner", - "unit-gnomish-worker", "unit-deep-gnomish-worker", "unit-derro-worker" - } -}) ---]] - DefineButton( { Pos = 8, Level = 1, Icon = "icon-dwarven-market", Action = "build", Value = "unit-dwarven-market", Key = "m", Hint = "Build ~!Market", Popup = "popup-building", @@ -203,6 +191,16 @@ DefineButton( { Pos = 10, Level = 1, Icon = "icon-dwarven-dock", } } ) +DefineButton( { Pos = 11, Level = 1, Icon = "icon-dwarven-academy", + Action = "build", Value = "unit-dwarven-academy", + Key = "a", Hint = "Build ~!Academy", Popup = "popup-building", + ForUnit = { + "unit-dwarven-miner", "unit-dwarven-skilled-miner", "unit-dwarven-expert-miner", + "unit-brising-miner", "unit-brising-skilled-miner", "unit-brising-expert-miner", + "unit-gnomish-worker", "unit-deep-gnomish-worker", "unit-derro-worker" + } +}) + -- Units -------------------------------------------------------------- DefineButton( { Pos = 1, Level = 0, Icon = "icon-dwarven-miner", diff --git a/scripts/civilizations/goblin/buttons.lua b/scripts/civilizations/goblin/buttons.lua index e8f3812a17..177c12bf94 100644 --- a/scripts/civilizations/goblin/buttons.lua +++ b/scripts/civilizations/goblin/buttons.lua @@ -155,14 +155,6 @@ DefineButton( { Pos = 7, Level = 1, Icon = "icon-goblin-temple", ForUnit = {"unit-goblin-worker"} }) ---[[ -DefineButton( { Pos = 7, Level = 1, Icon = "icon-goblin-academy", - Action = "build", Value = "unit-goblin-academy", - Key = "a", Hint = "Build ~!Academy", Popup = "popup-building", - ForUnit = {"unit-goblin-worker"} -}) ---]] - DefineButton( { Pos = 8, Level = 1, Icon = "icon-goblin-market", Action = "build", Value = "unit-goblin-market", Key = "m", Hint = "Build ~!Market", Popup = "popup-building", @@ -181,6 +173,12 @@ DefineButton( { Pos = 10, Level = 1, Icon = "icon-goblin-dock", ForUnit = {"unit-goblin-worker"} }) +DefineButton( { Pos = 11, Level = 1, Icon = "icon-goblin-academy", + Action = "build", Value = "unit-goblin-academy", + Key = "a", Hint = "Build ~!Academy", Popup = "popup-building", + ForUnit = {"unit-goblin-worker"} +}) + DefineButton( { Pos = 6, Level = 1, Icon = "icon-goblin-banner", Action = "build", Value = "unit-goblin-banner", Key = "b", Hint = "Build ~!Banner", Popup = "popup-building", diff --git a/scripts/civilizations/teuton/buttons.lua b/scripts/civilizations/teuton/buttons.lua index 9f5cc666ae..2085905bf1 100644 --- a/scripts/civilizations/teuton/buttons.lua +++ b/scripts/civilizations/teuton/buttons.lua @@ -188,14 +188,6 @@ DefineButton( { Pos = 7, Level = 1, Icon = "icon-teuton-church", ForUnit = {"unit-teuton-worker"} }) ---[[ -DefineButton( { Pos = 7, Level = 1, Icon = "icon-teuton-university", - Action = "build", Value = "unit-teuton-university", - Key = "u", Hint = "Build ~!University", Popup = "popup-building", - ForUnit = {"unit-teuton-worker"} -}) ---]] - DefineButton( { Pos = 8, Level = 1, Action = "build", Value = "unit-teuton-market", Key = "m", Hint = "Build ~!Market", Popup = "popup-building", @@ -214,6 +206,12 @@ DefineButton( { Pos = 10, Level = 1, ForUnit = {"unit-teuton-worker"} }) +DefineButton( { Pos = 11, Level = 1, Icon = "icon-teuton-university", + Action = "build", Value = "unit-teuton-university", + Key = "u", Hint = "Build ~!University", Popup = "popup-building", + ForUnit = {"unit-teuton-worker"} +}) + -- Researches --------------------------------------------------------- DefineButton( { Pos = 2, Level = 0, Icon = "icon-teuton-spatha", diff --git a/scripts/civilizations/teuton/buttons_faction_settlement_grant.lua b/scripts/civilizations/teuton/buttons_faction_settlement_grant.lua index e53e745370..6d20c96356 100644 --- a/scripts/civilizations/teuton/buttons_faction_settlement_grant.lua +++ b/scripts/civilizations/teuton/buttons_faction_settlement_grant.lua @@ -25,9 +25,9 @@ -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- -DefineButton( { Pos = 1, Level = 4, Icon = "icon-flag-old-austria", - Action = "grant-settlement", Value = "austria", - Key = "a", Hint = "Grant to ~!Austria", Popup = "popup-commands", - Description = "Grants this settlement to Austria as your vassal", - ForUnit = {"unit-teuton-town-hall", "unit-teuton-stronghold"} -} ) +--DefineButton( { Pos = 1, Level = 4, Icon = "icon-flag-old-austria", +-- Action = "grant-settlement", Value = "austria", +-- Key = "a", Hint = "Grant to ~!Austria", Popup = "popup-commands", +-- Description = "Grants this settlement to Austria as your vassal", +-- ForUnit = {"unit-teuton-town-hall", "unit-teuton-stronghold"} +--} ) diff --git a/scripts/icons.lua b/scripts/icons.lua index b251365893..d887c9fa3a 100644 --- a/scripts/icons.lua +++ b/scripts/icons.lua @@ -371,6 +371,18 @@ DefineIcon({ File = "neutral/icons/cancel.png" }) +DefineIcon({ + Name = "icon-left-arrow", + Size = {46, 38}, + File = "neutral/icons/left_arrow.png" +}) + +DefineIcon({ + Name = "icon-right-arrow", + Size = {46, 38}, + File = "neutral/icons/right_arrow.png" +}) + DefineIcon({ Name = "icon-build-basic-structure", Size = {46, 38},