Skip to content

Commit

Permalink
Added next/previous buttons for the building menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrettin committed Aug 12, 2017
1 parent 92f623d commit ee927d7
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 41 deletions.
49 changes: 42 additions & 7 deletions scripts/buttons.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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 = {
Expand All @@ -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 = {
Expand All @@ -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 = {
Expand All @@ -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 = {
Expand All @@ -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 = {
Expand All @@ -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 (~<PgDwn~>)", 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 (~<PgUp~>)", 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 (~<Esc~>)"), Popup = "popup-commands",
Key = "escape", Hint = "Cancel (~<Esc~>)", 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 (~<Esc~>)", Popup = "popup-commands",
ForUnit = {
"unit-germanic-worker", "unit-teuton-worker",
"unit-dwarven-miner", "unit-dwarven-skilled-miner", "unit-dwarven-expert-miner",
Expand Down
22 changes: 10 additions & 12 deletions scripts/civilizations/dwarf/buttons.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
14 changes: 6 additions & 8 deletions scripts/civilizations/goblin/buttons.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
14 changes: 6 additions & 8 deletions scripts/civilizations/teuton/buttons.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
--} )
12 changes: 12 additions & 0 deletions scripts/icons.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down

0 comments on commit ee927d7

Please sign in to comment.