Skip to content

Instantly share code, notes, and snippets.

@Deco
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Deco/8894234 to your computer and use it in GitHub Desktop.
Save Deco/8894234 to your computer and use it in GitHub Desktop.
GUIProtoBuyMenu.kExoButtonMaps = {
leftArm = {
{ // remember this means [1] =
id = "claw",
label = "Claw",
powerCost = 5,
buttonImages = {
disabled = "materials/...",
normal = "materials/...",
selected = "materials/...",
},
},
{ // and this means [2] =
id = "shield"
label = "Shield",
powerCost = 10,
buttonImages = {
disabled = "materials/...",
normal = "materials/...",
selected = "materials/...",
},
},
// ...
},
rightArm = {
// ...
},
damageModules = {
{
id = "lvl0",
label = "Level 0",
powerCost = 5,
buttonImages = {
disabled = "materials/...",
normal = "materials/...",
selected = "materials/...",
},
},
...
},
...
}
function GUIProtoBuyMenu:Something()
self.exoButtons = {}
for moduleNum, moduleDetails in ipairs(GUIProtoBuyMenu.kExoButtonMaps.leftArm) do
local button = create button
button.details = moduleDetails
button:SetLabel(moduleDetails.label)
button:SetImage(moduleDetails.buttonImages.normal)
button:SetPosition( Vector( 50, 50 + 20*moduleNum, 0) )
// etc
self.content:AddChild(button)
table.insert(self.exoButtons, button)
end
// same for other panels
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment