Last active
August 29, 2015 13:56
-
-
Save Deco/8894234 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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