Re: GUI Compendium
Posted: 07 Apr 2021, 20:33
thank’s i used it for this:
Note from Bearbear76: You can use the code tag for code. It look prettier doesn't it? 
Code: Select all
local function text()
local iconFrame=Draft.getDraft('$pickle_kets_icon'):getFrame()
local dialog = GUI.createDialog{
icon = iconFrame, -- Icon of the dialog
title = 'Ket Options', -- Title of the dialog
text = 'Here are the ket ontions{Other[*send a gift to pickle(50 kets)tiping kets(10)]Geting kets[*Buy 15 kets for 20 theos]seveces[*fire deparment28 coses 30 kets]buying rockets[*get Pmars for 5000 kets*get Trocket for 900 kets*get a shuttle for 1,000,000 kets]}On the text feld enter your command.',
width = 300,
height = 180,
closeable = true,
pause = false,
onUpdate = function() end,
onCancel = function() end,
onClose = function() end,
actions = {
{
id = '$cmdOk',
icon = Icon.PLUS,
text = "Done",
onClick = function() end,
golden = false
}
}
}
local parent = dialog.controls:getFirstPart()
local textField = parent:addTextField{
text = 'Enter Command',
height = 30,
width = 200
}
textField:setText('')
textField:getChild(1):setColor(255,0,255)
end
function script:buildCityGUI()
--Debug.toast('In buildCityGUI in Kets.lua')
--Debug.toast('Hi Charles!')
local iconFrame=Draft.getDraft('$pickle_kets_icon'):getFrame()
local budget = GUI.get('cmdBudget')
local bottomBar = budget:getParent()
local width = budget:getWidth()
local height = budget:getHeight()
local button=bottomBar:getCenterPart():addButton{
width=width,
height=height,
icon=iconFrame,
text='Ket options',
golden=true,
--frameDefault=Icon.NP_BLUE_BUTTON,
onClick=function(self)
-- Debug.toast('clicked')
text()
end
}
end
